This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Syntax error when trying to run the BAGEL algorithm (Python) for pooled CRISPR screen analysis

When I try to run the BAGEL algorithm (https://github.com/hart-lab/bagel) the following syntax error keeps appearing:

C:\BAGEL>BAGEL.py bf -i RPE1.txt -o RPE1out.txt -e CEGv2.txt -n NEGv1.txt -c 1,2,3
File "C:\BAGEL\BAGEL.py", line 106
print helptext('main')
^
SyntaxError: invalid syntax

Skipping line 106 will cause the same syntax error at other points in the script. I'm running Python 3.6, Numpy and Scipy, other python screen analysis tools like BAGELp (https://github.com/sb43/BAGELp) or DrugZ (https://github.com/hart-lab/drugz) run without any issues.

Any suggestions on how to solve this issue would be appreciated!

bagel python crispr screen

1 answer

Based on the error message that tool is written for python2 and not compatible with python3.

If this is the only type of error you get you could change all print statements to functions

print "hello world"

should become

print("hello world")

I changed all the print statements. unfortunately there are other incompatibilities, running it from python2 currently fails as SciPy refuses to install. Will look into it, thanks!

Log in to answer this question.