SMulTiXcanerror

181 views
Skip to first unread message

Lanj

unread,
Aug 9, 2018, 9:42:23 PM8/9/18
to PrediXcan/MetaXcan
Hello, I tried to run SMulTiXcan.py using the metaMany results on different tissue models. But I got error messages. Could you please help me figuring out what's wrong? Thank you very much!

Here's my command:
python ~/MetaXcan/software/SMulTiXcan.py \
--models_folder /gtex/ \
--models_name_pattern "gtext_v7_(.*)_signif.db" \
--snp_covariance snp_covariance_v7.txt.gz \
--metaxcan_folder results/ \
--metaxcan_filter "mace-gtex_v7_(.*)_imputed.csv" \
--metaxcan_file_name_parse_pattern "mace-gtex_v7_(.*)_imputed.csv" \
--gwas_file mace.txt \
--snp_column SNP_old \
--effect_allele_column Allele1 \
--non_effect_allele_column Allele2 \
--beta_column Effect \
--pvalue_column P.value \
--verbosity 7 \
--throw \
--output mace_smultixcan \


This is the output:

INFO - Creating context
INFO - Loading genes
INFO - Context for snp covariance
INFO - Processing GWAS command line parameters
INFO - Reading input gwas: mace.txt
INFO - Processing input gwas
Level 9 - Calculating zscore from pvalue
Level 9 - Acquiring sign from beta
Level 9 - loading /gtex/gtex_v7_Adipose_Subcutaneous_imputed_europeans_tw_0.5_signif.db
Level 9 - loading /gtex/gtex_v7_Adipose_Visceral_Omentum_imputed_europeans_tw_0.5_signif.db
...........
Level 9 - loading /gtex/gtex_v7_Whole_Blood_imputed_europeans_tw_0.5_signif.db
Level 9 - preloading models
Traceback (most recent call last):
  File "/gpfs22/home/MetaXcan/software/SMulTiXcan.py", line 78, in <module>
    run(args)
  File "/gpfs22/home/MetaXcan/software/SMulTiXcan.py", line 20, in run
    context = CrossModelUtilities.context_from_args(args)
  File "/gpfs22/home/MetaXcan/software/metax/cross_model/Utilities.py", line 187, in context_from_args
    name_pattern=args.models_name_pattern, name_filter=args.models_name_filter)
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 300, in load_model_manager
    models = _get_models(paths, trim_ensemble_version)
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 283, in _get_models
    _m = {NamingConventions.extract_model_name(x, name_pattern): load_model(x) for x in paths}
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 283, in <dictcomp>
    _m = {NamingConventions.extract_model_name(x, name_pattern): load_model(x) for x in paths}
  File "/gpfs22/home/MetaXcan/software/metax/NamingConventions.py", line 15, in extract_model_name
    p = r.search(p).group(1)
AttributeError: 'NoneType' object has no attribute 'group'

Alvaro Barbeira

unread,
Aug 10, 2018, 9:52:55 AM8/10/18
to Lanj, PrediXcan/MetaXcan
Hi there!

I suggest adding:

--models_name_filter "gtext_v7_(.*)_signif.db" \

It might seem redundant to have a command lien argument for filter and another for parsing the name;  this exists to allow restriction to cross-tissue analysis of specific tissues (for example Brain tissues; or adipose and blood, etc) while allowing a different parsing scheme. The same goes for metaxcan results file name parsing.

Also, I suggest checking if your version is up to date with the public repository.

Best,

Alvaro

--
You received this message because you are subscribed to the Google Groups "PrediXcan/MetaXcan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to predixcanmetaxcan+unsubscribe@googlegroups.com.
To post to this group, send email to predixcanmetaxcan@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/predixcanmetaxcan/56935ef9-271f-4199-8b17-68e6a3f6caee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lanj

unread,
Aug 10, 2018, 12:03:29 PM8/10/18
to PrediXcan/MetaXcan
Thank you for your reply!

I added the model_name_filter line but now the program exits with error before even loading the tissue model.
INFO - Creating context
INFO - Loading genes
Traceback (most recent call last):
  File "/home/MetaXcan/software/SMulTiXcan.py", line 78, in <module>
    run(args)
  File "/home/MetaXcan/software/SMulTiXcan.py", line 20, in run
    context = CrossModelUtilities.context_from_args(args)
  File "/gpfs22/home/MetaXcan/software/metax/cross_model/Utilities.py", line 159, in context_from_args
    genes = PredictionModel.load_genes(args.models_folder, args.models_name_filter)
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 155, in load_genes
    models = models.drop_duplicates()
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3098, in drop_duplicates
    duplicated = self.duplicated(subset, keep=keep)
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3144, in duplicated
    labels, shape = map(list, zip(*map(f, vals)))
ValueError: need more than 0 values to unpack

I downloaded the software back in June and the version of MetaXcan.py  is 0.6.1. Is this the latest version?

Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to predixcanmetax...@googlegroups.com.
To post to this group, send email to predixca...@googlegroups.com.

Alvaro Barbeira

unread,
Aug 10, 2018, 12:08:38 PM8/10/18
to Lanj, PrediXcan/MetaXcan
currently the latest version is 0.6.5, from July 31st.

To unsubscribe from this group and stop receiving emails from it, send an email to predixcanmetaxcan+unsubscribe@googlegroups.com.
To post to this group, send email to predixcanmetaxcan@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/predixcanmetaxcan/3ac3476b-10c7-4cee-b887-6eb3613a3e66%40googlegroups.com.

Lanj

unread,
Aug 10, 2018, 1:42:45 PM8/10/18
to PrediXcan/MetaXcan
Thank you all for your help! I updated the version and now the outputs look different but I still encountered error at the end:

INFO - Creating context
INFO - Creating MetaXcan results manager
Level 9 - Loading metaxcan results/mace-gtex_v7_Adipose_Subcutaneous_imputed.csv
..............
Level 9 - Loading metaxcan results/mace-gtex_v7_Whole_Blood_imputed.csv
Level 9 - Building data
Level 9 - Processing Thyroid
Level 9 - Processing Testis
..........
Level 9 - Processing Nerve_Tibial
INFO - Loading genes
Traceback (most recent call last):
  File "/home/MetaXcan/software/SMulTiXcan.py", line 78, in <module>
    run(args)
  File "/home/MetaXcan/software/SMulTiXcan.py", line 20, in run
    context = CrossModelUtilities.context_from_args(args)
  File "/gpfs22/home/MetaXcan/software/metax/cross_model/Utilities.py", line 162, in context_from_args
    genes = PredictionModel.load_genes(args.models_folder, args.models_name_filter)
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 168, in load_genes
    models = models.drop_duplicates()
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3098, in drop_duplicates
    duplicated = self.duplicated(subset, keep=keep)
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3144, in duplicated
    labels, shape = map(list, zip(*map(f, vals)))
ValueError: need more than 0 values to unpack


Lanj

unread,
Aug 15, 2018, 12:53:22 PM8/15/18
to PrediXcan/MetaXcan
Hi Alvaro,

I am still having problem with the SMulTiXan.py script. Here is how I ran it:

python ~/MetaXcan/software/SMulTiXcan.py \
--models_folder /metaXcan_DB/gtex/ \
--models_name_pattern "gtext_v7_(.*)_imputed_europeans_tw_0.5_signif.db" \
--models_name_filter "gtext_v7_(.*)_imputed_europeans_tw_0.5_signif.db" \
--snp_covariance /metaXcan_DB/snp_covariance_v7.txt.gz \
--metaxcan_folder results/ \
--metaxcan_filter "mace-gtex_v7_(.*)_imputed.csv" \
--metaxcan_file_name_parse_pattern "mace-gtex_v7_(.*)_imputed.csv" \
--gwas_file mace.txt \
--snp_column SNP_old \
--effect_allele_column Allele1 \
--non_effect_allele_column Allele2 \
--beta_column Effect \
--pvalue_column P.value \
--verbosity 7 \
--throw \
--output mace_smultixcan \

My outputs look like this:
INFO - Creating context
INFO - Creating MetaXcan results manager
Level 9 - Loading metaxcan results/mace-gtex_v7_Adipose_Subcutaneous_imputed.csv
............
Level 9 - Loading metaxcan results/mace-gtex_v7_Whole_Blood_imputed.csv
Level 9 - Building data
Level 9 - Processing Thyroid
...........
Level 9 - Processing Nerve_Tibial
INFO - Loading genes
Traceback (most recent call last):
  File "/home/MetaXcan/software/SMulTiXcan.py", line 78, in <module>
    run(args)
  File "/home/MetaXcan/software/SMulTiXcan.py", line 20, in run
    context = CrossModelUtilities.context_from_args(args)
  File "/gpfs22/home/MetaXcan/software/metax/cross_model/Utilities.py", line 162, in context_from_args
    genes = PredictionModel.load_genes(args.models_folder, args.models_name_filter)
  File "/gpfs22/home/MetaXcan/software/metax/PredictionModel.py", line 168, in load_genes
    models = models.drop_duplicates()
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3098, in drop_duplicates
    duplicated = self.duplicated(subset, keep=keep)
  File "/home/.conda/envs/myenvironment/lib/python2.7/site-packages/pandas/core/frame.py", line 3144, in duplicated
    labels, shape = map(list, zip(*map(f, vals)))
ValueError: need more than 0 values to unpack

Do you have any suggestion on how I can pinpoint the problem is? 
Thank you very much!
Lan

Rodrigo Bonazzola

unread,
Aug 15, 2018, 2:38:07 PM8/15/18
to PrediXcan/MetaXcan
Hi Lan,

I noticed you have a typo in the models_name_* arguments. There is an extra "t" (it should be "gtex" instead of "gtext").
Could you try running SMulTiXcan after fixing this and let us know?

Best,
Rodrigo
Reply all
Reply to author
Forward
0 new messages