Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcffirstheader python 2 dependency in Snippy 4.x #224

Closed
amilesj opened this issue Aug 21, 2018 · 14 comments
Closed

vcffirstheader python 2 dependency in Snippy 4.x #224

amilesj opened this issue Aug 21, 2018 · 14 comments
Assignees
Labels
Milestone

Comments

@amilesj
Copy link

amilesj commented Aug 21, 2018

vcffirstheader seems to use python 2. When I ran Snippy 4.0.5 in my normal environment with python 3.6.2, I got the following error in the log after the freebayes-parallel line:

File "/home/amiles/miniconda3/bin/vcffirstheader", line 9 print line.strip() ^ SyntaxError: invalid syntax

I changed my script to activate my environment with python 2.7 before running Snippy, and it worked fine.

Best,
Arianna

@tseemann tseemann self-assigned this Aug 22, 2018
@tseemann tseemann added the bug label Aug 22, 2018
@luckystar008
Copy link

I had the same problem,When I run Snippy 4.0.5, vcffirstheader reports an error:
`### freebayes-parallel reference/ref.txt 8 -p 2 -P 0 -C 10 --min-repeat-entropy 1.5 --strict-vcf -q 13 -m 60
--min-coverage 10 -F 0.05 -f reference/ref.fa snps.bam > snps.raw.vcf

File "/disk1/cau/cvmjxx/miniconda3/bin/vcffirstheader", line 9
print line.strip()
^
SyntaxError: invalid syntax
And the version of python:Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.`

@tseemann tseemann added this to the Snippy 5.0 milestone Aug 25, 2018
@tseemann
Copy link
Owner

tseemann commented Aug 25, 2018

Yes, it seems freebayes or vcflib have a hidden dependency on python 2 for that script.

I will have to think about how best to tackle this.

@tseemann
Copy link
Owner

tseemann commented Aug 25, 2018

@luckystar008 @amilesj
Can you tell me what these command say?

head -n 1 $(which vcffirstheader)
head -n 1 $(which fasta_generate_regions.py)
head -n 1 $(which freebayes-parallel)

@amilesj
Copy link
Author

amilesj commented Aug 25, 2018

#!/usr/bin/env python
#!/home/amiles/miniconda3/bin/python
#!/bin/bash

@tseemann
Copy link
Owner

tseemann commented Aug 25, 2018

@amilesj thank you! and what does /home/amiles/miniconda3/bin/python --version say?

Under python PEP rules it should be 2.x .... but my guess is 3.x due to Conda madness.

@amilesj
Copy link
Author

amilesj commented Aug 25, 2018

Yes its 3.6.2

@luckystar008
Copy link

1.#!/usr/bin/env python
2.#!/disk1/cau/cvmjxx/miniconda3/bin/python
3.#!/bin/bash
Python 3.6.2 |Continuum Analytics, Inc.| (default, Jul 20 2017, 13:51:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Hope to solve this problem.All the best!

@tseemann
Copy link
Owner

I think I will need to write my own wrappers for these python tools, as the conda 2 vs 3 problem will keep cropping up.

Until then, you can change /usr/bin/env python to /usr/bin/python or whereever your system has python 2.x installed. they use no modules so should just work.

@luckystar008
Copy link

@tseemann Do I just change the version of pyhon used by vcffirstheader or change the pyhon version of entire snippy and dependency package?

@tseemann
Copy link
Owner

tseemann commented Aug 25, 2018

Snippy is written in Perl. not python.

Snippy uses other packages (freebayes, vcflib) which include some python 2.x scripts in them. They are the issue, not snippy itself. You just need to edit the first line of all the failing scripts to point to a python 2 executable.

I am unable to fix the other packages.

@tseemann tseemann changed the title vcffirstheader python 2 dependency in Snippy 4.0.5 vcffirstheader python 2 dependency in Snippy 4.x Sep 16, 2018
@rtfcoimbra
Copy link

rtfcoimbra commented Apr 4, 2019

One can also change all instances of print line.strip() to print(line.strip()) in the vcffirstheader script. That should fix the syntax compatibility with python 3.

@jdeligt
Copy link

jdeligt commented Aug 13, 2019

Please also see #309 for another python 2 dependecy fix

@tseemann
Copy link
Owner

I have joined the vcflib project and made a 1.0.0-rc3 release which is py3 now.
Will be in Conda soon: bioconda/bioconda-recipes#17050

@tseemann
Copy link
Owner

tseemann commented Dec 2, 2019

Fixed now

@tseemann tseemann closed this as completed Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants