segrelabgenomics / GWASvar2gene

Other
2 stars 1 forks source link

AttributeError: 'list' object has no attribute 'SNP_A' #1

Open twoneu opened 2 years ago

twoneu commented 2 years ago

Hello all,

Thank you for building this tool and for your detailed documentation. While trying to run Step 2 with no secondary PLINK directory specified, I encountered the following error:

Traceback (most recent call last):
  File "GWASVar2Gene.py", line 561, in <module>
    sec_lines['SNP_A'] = sec_lines.SNP_A.apply(lambda x: convert_variant_format(x, example_variant=example_primary_variant))
AttributeError: 'list' object has no attribute 'SNP_A'

My input for this trial run is as follows:

python -u GWASVar2Gene.py --GWAS_variants ../output/out_trial_cancer_GWAS_variant_IDs_added.tsv \
                           --primary_plink_directory /usr/plink_files/for_eclipser/ \
                           -primary_plink_prefix HRC.r1-1 \
                           -primary_ldr 0.5 \
                           -GENCODE ../data/gencode.v26.annotation.gtf \
                           -output_dir ../output/GWAS_var_GTEx_QTL_Gene_mapping \
                           -output_prefix Sample_GWAS_variants \
                           -tissue_file ../data/gtex_tissue_file.txt \
                           -plink_memory_allocation 100152 \
                           -variants_only True

What troubleshooting steps would you recommend to get at the source of this error? Please let me know if more information is necessary and I will provide it.

twoneu commented 2 years ago

I was able to overcome this error by running STEP2 with a secondary plink directory specified, but am now encountering an error with line 545 of GWASVar2Gene.py:

prim_ext_lines = prim_ext_lines.loc[prim_ext_lines.SNP_A != prim_ext_lines.SNP_B].copy()
Error: AttributeError: 'list' object has no attribute 'loc'

Again, please let me know if more information is necessary to troubleshoot. Thank you very much for your time.