hakyim / TO-DELETE-PrediXcan

Code for the in-dev PrediXcan Project
MIT License
28 stars 83 forks source link

AttributeError: TranscriptionMatrix instance has no attribute 'gene_list' #30

Open LiangyingYin opened 6 years ago

LiangyingYin commented 6 years ago

Hi all,

I'm new to PrediXcan and trying to run this with a test on gtex_v7_Adipose_Subcutaneous_imputed_europeans_tw_0.5_signif.db. However, I got an error saying:

2018-04-18 16:13:44.757285 Preloading weights... Traceback (most recent call last): File "/exeh_3/yinly/05_PrediXcan/PrediXcan/Software/PrediXcan.py", line 230, in main() File "/exeh_3/yinly/05_PrediXcan/PrediXcan/Software/PrediXcan.py", line 212, in main transcription_matrix.save(PRED_EXP_FILE) File "/exeh_3/yinly/05_PrediXcan/PrediXcan/Software/PrediXcan.py", line 117, in save outfile.write('FID\t' + 'IID\t' + '\t'.join(self.gene_list) + '\n') # Nb. this lists the names of rows, not of columns AttributeError: TranscriptionMatrix instance has no attribute 'gene_list'

Here is my code: TISSUES=("TW_Adipose_Subcutaneous")

for T in ${TISSUES[@]} do /exeh_4/ccarlos/bin/anaconda2/bin/python2.7 /exeh_3/yinly/05_PrediXcan/PrediXcan/Software/PrediXcan.py --predict \ --weights /exeh_3/yinly/05_PrediXcan/PrediXcan/GTEx-V7_HapMap-2017-11-29/gtex_v7_Adipose_Subcutaneous_imputed_europeans_tw_0.5_signif.db \ --dosages /exeh_3/yinly/05_PrediXcan/Dosage/ \ --samples /exeh_3/yinly/05_PrediXcan/Dosage/samples.txt \ --output_prefix /exeh_3/yinly/05_PrediXcan/Result/gtex_v7_Adipose_Subcutaneous_imputed_europeans done

It worked well when testing it on the given data example, However, when I run this on my own data, I got the above error. The path to genotype dosages is correct. Besides, I checked the file format, it's the same as the given sample and I paste several lines below(only the first 5 columns). chr21 rs3965725 14597009 A C chr21 rs2847439 14600130 A G chr21 rs2775537 14601415 G A chr21 rs2801233 14603577 C T chr21 rs2266579 14604361 C T chr21 rs2261012 14607040 T A chr21 rs2801317 14608578 T A chr21 rs2801314 14613701 A G chr21 rs2801301 14627705 G A chr21 rs2261645 14630588 A G

Please let me known if more information is required. Thanks a lot.

Heroico commented 5 years ago

Hi there, This error often happens when there is no snp intersection between the db and one of the genotype files. (To be in the intersection, a snp must have the same chromosome, position, and -alleles up to strand reversion-)

Just in case, the 6-th column must be the MAF and from the 7-th column on follow the dosages of the individuals in the same order as the phenotype file.