Dear all, I would like to run freebayes as a multi-thread application. I followed the script given as an example
freebayes-parallel < fasta_generate_regions.py ref.fa.fai 100000) 36 -f ref.fa aln.bam > out.vcf"
by writing a command:
pathTo/freebayes/scripts/frebayes-parallel <(pathTo/freebayes/scripts/fasta_generate_regions.py pathTo/ref< File >.fa.fai) 36 -f pathTo/< refFile >.fa pathTo/<alnDeduplicated>.bam > < file.vcf >
but I am getting this error:
$ File "pathTo/freebayes/scripts/fasta_generate_regions.py", line 7
print "usage: ", sys.argv[0], " <fasta file or index file> <region size>"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("usage: ", sys.argv[0], " <fasta file or index file> <region size>")?
Same thing if I use <fasta_generate_regions.py pathTo="" ref<File="">.fa.fai)
. frebayes-parallel is in the PATH variable but if I don't give the absolute path I get the error command not found
What would be the correct syntax for this feature?
Tx
Are you running with python 2 or 3?
I think the standard is Python 3.7.0 because this is what comes out if I type
python
on the terminalYep that makes sense. You will need to run that tool with Python2 specifically.
In python3,
print
commands require parentheses:print("Some string")
, whereas in Python2 this wasn't strictly the case.You can tell this from the error it gives you since it's showing you an
^
pointing (roughly) to where it was expecting to see()
You may need to take a look at the shebang in the first line of the python script
athTo/freebayes/scripts/fasta_generate_regions.py
. It probably isn't specifyingpython2
(which it should really).I ran:
$ ~/src/freebayes/scripts/frebayes-parallel <(python2 ~/src/freebayes/scripts/fasta_generate_regions.py ~/refSeq/fusion/fusion38-10k.fa.fai) 36 -f ~/refSeq/fusion/fusion38-10k.fa ~/servers/chirexpsrv3_a32/LUIGI_HIPO32_nls/rslt/A1/A1-N_F-AlnSrtDed.bam > ~/Downloads/h32/rslt/A1-N_F.vcf
ang got:bash: /home/gigiux/src/freebayes/scripts/frebayes-parallel: No such file or directory
$ Traceback (most recent call last): File "/home/gigiux/src/freebayes/scripts/fasta_generate_regions.py", line 17, in <module> region_size = int(sys.argv[2]) IndexError: list index out of range
same thing when i changed the shebang to
#!/usr/bin/env python2
I would have expected changing the shebang to work, but there may be other elements of the code that also need to change. I'll need to take a closer look. Can you provide a link to the walkthrough you're using, and some example data so we can replicate the issue?
marongiu.luigi are you doing the following?
I thought I did it by launching freebayes-parallel with its absolute path...
I will, but it might take sometimes...
how to add thread in freebayes?
You have to use
freebayes-parallel
to execute multiple instances. It is otherwise a single threaded application.