Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue while running SMulTiXcan.py. AttributeError: 'Series' object has no attribute 'zscore' #173

Open
charliexbrown opened this issue May 5, 2023 · 2 comments

Comments

@charliexbrown
Copy link

charliexbrown commented May 5, 2023

I get AttributeError while running SMultiXcan from the results from SPrediXcan:

python ~/SMulTiXcan.py --models_folder ~/mashr_mod/eqtl/mashr/
--models_name_pattern '(.).db'
--model_db_snp_key varID
--gwas_file wt.tpmt_gwas4predix.txt
--snp_covariance ~/mashr_mod/gtex_v8_expression_mashr_snp_smultixcan_covariance.txt.gz
--snp_column ID_b38 --keep_non_rsid --effect_allele_column ALT --non_effect_allele_column REF
--beta_column BETA --se_column SE --pvalue_column P
--metaxcan_folder spredixcan_output/ --metaxcan_file_name_parse_pattern '(.
)_(.*).csv'
--output spredixcan_output/wt.tpmt_multix.csv
--throw
--cutoff_condition_number 30
--verbosity 4

...
INFO - Creating MetaXcan results manager
Traceback (most recent call last):
File "/home/cbidoli/MetaXcan/software/SMulTiXcan.py", line 93, in
run(args)
File "/home/cbidoli/MetaXcan/software/SMulTiXcan.py", line 22, in run
context = CrossModelUtilities.context_from_args(args)
File "/research/rgs01/home/clusterHome/cbidoli/MetaXcan/software/metax/cross_model/Utilities.py", line 162, in context_from_args
metaxcan_manager = MetaXcanResultsManager.build_manager(args.metaxcan_folder, filters=args.metaxcan_filter, file_name_pattern=args.metaxcan_file_name_parse_pattern)
File "/research/rgs01/home/clusterHome/cbidoli/MetaXcan/software/metax/metaxcan/MetaXcanResultsManager.py", line 35, in build_manager
manager = MetaXcanResultsManager(results)
File "/research/rgs01/home/clusterHome/cbidoli/MetaXcan/software/metax/metaxcan/MetaXcanResultsManager.py", line 14, in init
data, genes, models = _build_data(data)
File "/research/rgs01/home/clusterHome/cbidoli/MetaXcan/software/metax/metaxcan/MetaXcanResultsManager.py", line 71, in _build_data
if not numpy.isfinite(row.zscore):
File "/hpcf/authorized_apps/rhel7_apps/anaconda3-202210/install/lib/python3.9/site-packages/pandas/core/generic.py", line 5575, in getattr
return object.getattribute(self, name)
AttributeError: 'Series' object has no attribute 'zscore'

I thought it was a conda packages issues but both numpy and pandas are updated (numpy=1.24.2, pandas=2.0.0) so I don't know how to fix this error. Thanks!

@Fnyasimi
Copy link
Collaborator

Hi @charliexbrown looks like the zscore column is missing. I suggest you harmonize your gwas and provide the zscore instead of beta and se.

@charliexbrown
Copy link
Author

Thank you @Fnyasimi!
I figured out the error, in this case I had some extra files in the metaxcan folder that were causing some background noise while performing the analysis. In the end it worked without harmonizing the gwas, but is zscore imputation always recommended in order to perform multixcan analysis? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants