samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
682 stars 240 forks source link

plot-vcfstats SyntaxError on Ubuntu 16.04 #593

Closed dburkhardt closed 7 years ago

dburkhardt commented 7 years ago

When I run plot-vcfstats, there's an error with the version of python that's being used. Here's the output.

Parsing bcftools stats output: study.vcf.stats
Plotting graphs: python plot.py
  File "plot.py", line 63
    if x.ndim != 1: raise ValueError, "smooth only accepts 1 dimension arrays."
                                    ^
SyntaxError: invalid syntax
The command exited with non-zero status 256:
    python plot.py

 at /usr/local/bin/plot-vcfstats line 76.
    main::error("The command exited with non-zero status 256:\x{a}\x{9}python plot.py\x{a}\x{a}") called at /usr/local/bin/plot-vcfstats line 275
    main::plot(HASH(0x1864080)) called at /usr/local/bin/plot-vcfstats line 65

My guess is that in plot.py, python3, not python2 is being invoked. I can't seem to find this file though.

pd3 commented 7 years ago

Thank you for the bug report. The python script is generated by plot-vcfstats. This commit should fix the issue https://github.com/samtools/bcftools/commit/68898afa967eb3175faed1918971c7bf65f67839

pinninti1991 commented 6 years ago

Hi, how to solve this problem. CMD- plot-vcfstats hg38multi.vchk -p plots/ Parsing bcftools stats output: hg38multi.vchk Plotting graphs: python plots/plot.py File "plots/plot.py", line 60 if x.ndim != 1: raise ValueError, "smooth only accepts 1 dimension arrays." ^ SyntaxError: invalid syntax The command exited with non-zero status 256: python plots/plot.py

at /usr/bin/plot-vcfstats line 78. main::error("The command exited with non-zero status 256:\x{a}\x{9}python plots/pl"...) called at /usr/bin/plot-vcfstats line 271 main::plot(HASH(0x27f55f0)) called at /usr/bin/plot-vcfstats line 67

yifangt commented 5 years ago

Same problem here. Does anybody have any updated info to share? Thanks a lot!

Never mind! Found out the problem: The syntax error is related to the two lines containing: ....raise ValueError, "smooth only accepts 1 dimension arrays." One for python2.x (first line) and the other, python 3.x. Simply delete the first line of both for python3.x.