nspies / svviz2

for visual evaluation of read support for structural variation
50 stars 13 forks source link

AttributeError: module 'scipy.misc' has no attribute 'comb' #63

Closed ehenrion closed 4 years ago

ehenrion commented 4 years ago

Hi there,

I recently hit this issue when launching svviz2.

Traceback (most recent call last):
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/bin/svviz2", line 8, in <module>
    sys.exit(main())
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/app/main.py", line 60, in main
    run(datahub)
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/app/main.py", line 49, in run
    report.report(datahub)
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/app/report.py", line 15, in report
    results.extend(tally_support(datahub))
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/app/report.py", line 79, in tally_support
    value["ref"], value["alt"])
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/remap/genotyping.py", line 16, in calculate_genotype_likelihoods
    log_combo = statistics.log_choose(ref+alt, alt)
  File "/cvmfs/soft.mugqic/CentOS6/software/python/Python-3.7.3/lib/python3.7/site-packages/svviz2/utility/statistics.py", line 6, in log_choose
    return numpy.log10(scipy.misc.comb(n,k))
AttributeError: module 'scipy.misc' has no attribute 'comb'

After some research, I found the following statement in this page : https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.comb.html

comb is deprecated! Importing comb from scipy.misc is deprecated in scipy 1.0.0. Use scipy.special.comb instead.

Indeed, I recently updated the scipy package to 1.3.3...

Replacing both occurrences of scipy.misc by scipy.special in svviz2/utility/statistics.py fixed the issue.

Best, Ed

nspies commented 4 years ago

Thanks for noting this!