Applications of BEDOPS > bedops

bedops install

(1/2) > >>

zhilianghu:
I installed the BEDOPS from source (with gcc-4.8.1) on my RHEL 6 box, now when I type the command:

> vcf2bed < infile.vcf > outfile

it complains:

  File "/usr/local/sbin/bedops/vcf2bed", line 142
    except getopt.GetoptError as error:
                               ^
SyntaxError: invalid syntax

(the same error as I used per-compiled downloads)

Could you help?

Zhiliang


AlexReynolds:
I ran vcf2bed on some test VCF input without options within a Linux-based Python 2.7.4 installation and I could not replicate the error you encountered.

What version of Python are you running (python --version)? Perhaps I can see what I can do to try to replicate your environment and see if I run into the same error that way.

zhilianghu:
It does not recognize "python --version".
"python -V" gives: Python 2.4.3

I will upgrade python and try again. Thank you.

Zhiliang

zhilianghu:
I upgraded to python versoin 3.3.  Now it complains:

----------------
  File "/usr/local/sbin/bedops/vcf2bed", line 189
    print 'ERROR: Could not map data values to VCF header keys (perhaps missing or bad delimiters in header line?)'
                                                                                                                  ^
SyntaxError: invalid syntax
------------------

It's persistent even when I don't feed any data to it. I took a look at /usr/local/sbin/bedops/vcf2bed - the above error simply printed the line 189 of the codes.

Any further suggestions?

Zhiliang

AlexReynolds:
"Python3" makes a lot of syntax changes that break scripts written for Python 2.x. For practical purposes, it is a separate language.

BEDOPS conversion scripts are written for Python 2.7 or greater, but less than Python3 3.x. (Where some documentation says Python 2.5 or greater, that is a typo and will be fixed in a future revision of the documentation.)

The vcf2bed script should catch attempts to run it within Python3 3.x or greater, so that's an issue of concern and I'll need to investigate that. Thanks for that report.

In any case, to run BEDOPS conversion scripts, you will need to install and run Python 2.7 or greater, but less than Python3 3.x. Open up your package manager tool and install Python 2.7 or greater. If you need to select an active Python installation, please make sure it is Python 2.7+.

We may explore Python3 support at a later time, but adoption of Python3 is still an issue for discussion for scientific use of the language:

http://jakevdp.github.io/blog/2013/01/03/will-scientists-ever-move-to-python-3/

Give Python 2.7 a shot and let us know if you still have problems.

Navigation

[0] Message Index

[#] Next page

Go to full version