Author Topic: bedops install  (Read 6090 times)

zhilianghu

  • Newbie
  • *
  • Posts: 11
bedops install
« on: November 05, 2013, 07:44:26 AM »
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

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: bedops install
« Reply #1 on: November 05, 2013, 04:30:24 PM »
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

  • Newbie
  • *
  • Posts: 11
Re: bedops install
« Reply #2 on: November 06, 2013, 08:03:01 AM »
It does not recognize "python --version".
"python -V" gives: Python 2.4.3

I will upgrade python and try again. Thank you.

Zhiliang

zhilianghu

  • Newbie
  • *
  • Posts: 11
Re: bedops install
« Reply #3 on: November 06, 2013, 11:42:01 AM »
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

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: bedops install
« Reply #4 on: November 06, 2013, 01:56:33 PM »
"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.
« Last Edit: November 06, 2013, 02:15:30 PM by AlexReynolds »

zhilianghu

  • Newbie
  • *
  • Posts: 11
Re: bedops install
« Reply #5 on: November 07, 2013, 09:13:10 AM »
I installed Python 2.7.6rc1, now it works great.

Thank you,

Zhiliang

AlexReynolds

  • Administrator
  • Jr. Member
  • *****
  • Posts: 72
Re: bedops install
« Reply #6 on: November 07, 2013, 03:57:30 PM »
No problem, let us know if you run into any further difficulties.