Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Failed to run haps_filters through multipop_selection_pipeline #28

Open
AhmedElfarargi opened this issue Jun 2, 2019 · 1 comment
Open

Comments

@AhmedElfarargi
Copy link

I am testing the multipop_selection_pipeline with the test lactase data. After running the following command, I noticed that there's something went wrong with the selection_pipeline

multipop_selection_pipeline -p CEU_ids.txt -p YRI_ids.txt -i CEU_YRI_lactase.vcf --config-file defaults.cfg --a "--phased-vcf" -c 2

multi_population.log
selection_pipeline command = selection_pipeline -c 2 -i /SelectionPipelineTestData/lactase/CEU.vcf --population CEU --config-file defaults.cfg --phased-vcf
selection_pipeline failed to run selection_pipeline -c 2 -i /SelectionPipelineTestData/lactase/CEU.vcf --population CEU --config-file defaults.cfg --phased-vcf

CEU2_selection_pipeline.log
haps filter command = haps_filters --maf 0.01 --hwe 0.0001 --chi-sq --missing 0.99 --output CEU2_filtered.haps --haps CEU2vcf_to_haps.haps
haps filter failed to run haps_filters --maf 0.01 --hwe 0.0001 --chi-sq --missing 0.99 --output CEU2_filtered.haps --haps CEU2vcf_to_haps.haps
haps filter STDERR: Traceback (most recent call last):
haps filter STDERR: File "/bin/haps_filters", line 11, in
haps filter STDERR: load_entry_point('selectionTools==1.1.1', 'console_scripts', 'haps_filters')()
haps filter STDERR: File "/lib/python2.7/site-packages/selectionTools-1.1.1-py2.7.egg/selection_pipeline/haps_filters.py", line 123
haps filter STDERR: filter_haps_file(args)
haps filter STDERR: File "/lib/python2.7/site-packages/selectionTools-1.1.1-py2.7.egg/selection_pipeline/haps_filters.py", line 83,
haps filter STDERR: hardy_weinberg_asymptotic(countAB, countAA, countBB)
haps filter STDERR: File "/lib/python2.7/site-packages/selectionTools-1.1.1-py2.7.egg/selection_pipeline/haps_filters.py", line 37,
haps filter STDERR: return stats.chisqprob(chi_sq_total, 1)
haps filter STDERR: AttributeError: 'module' object has no attribute 'chisqprob'

should I modify something within haps_filters.py file?

Thanks

@murraycadzow
Copy link
Collaborator

Hi,
It would appear that stats.chisqprob from SciPy has since been deprecated (https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.stats.chisqprob.html).

A solution that might work is modifying the script to define the chisqprob function in the haps_filters.py

from scipy import stats
stats.chisqprob = lambda chisq, df: stats.chi2.sf(chisq, df)

Which I found here

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

No branches or pull requests

2 participants