Question: how to run freebayes in multi-thread
0
gravatar for marongiu.luigi
9 weeks ago by
Germany, Mannheim, UMM
marongiu.luigi380 wrote:

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

freebayes multi-thread vcf • 303 views
ADD COMMENTlink modified 9 weeks ago by RamRS21k • written 9 weeks ago by marongiu.luigi380
1

Are you running with python 2 or 3?

ADD REPLYlink written 9 weeks ago by jrj.healey12k

I think the standard is Python 3.7.0 because this is what comes out if I type python on the terminal

ADD REPLYlink written 9 weeks ago by marongiu.luigi380

Yep 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 specifying python2 (which it should really).

ADD REPLYlink modified 9 weeks ago • written 9 weeks ago by jrj.healey12k

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

ADD REPLYlink written 9 weeks ago by marongiu.luigi380

same thing when i changed the shebang to #!/usr/bin/env python2

ADD REPLYlink written 9 weeks ago by marongiu.luigi380

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?

ADD REPLYlink written 9 weeks ago by jrj.healey12k

marongiu.luigi are you doing the following?

Note that any of the above examples can be made parallel by using the scripts/freebayes-parallel script. If you find freebayes to be slow, you should probably be running it in parallel using this script to run on a single host, or generating a series of scripts, one per region, and run them on a cluster. Be aware that the freebayes-parallel script contains calls to other programs using relative paths from the scripts subdirectory; the easiest way to ensure a successful run is to invoke the freebayes-parallel script from within the scripts subdirectory.

ADD REPLYlink written 9 weeks ago by genomax65k

I thought I did it by launching freebayes-parallel with its absolute path...

ADD REPLYlink written 9 weeks ago by marongiu.luigi380

I will, but it might take sometimes...

ADD REPLYlink written 9 weeks ago by marongiu.luigi380
4
gravatar for finswimmer
9 weeks ago by
finswimmer11k
Germany
finswimmer11k wrote:
  • As mentioned by jrj.healey fasta_generate_regions.py must be run with python2
  • fasta_generate_regions.py requires two parameters:
    • the reference file or its index file
    • the size of the region

You are missing the size of the region in your command.

The error message you describe in this comment stated out whats wrong:

bash: /home/gigiux/src/freebayes/scripts/frebayes-parallel: No such file or directory

You are missing in e in freebayes-parallel.

(There is already a pull request to make the python scripts work in python2 and 3)

ADD COMMENTlink modified 9 weeks ago • written 9 weeks ago by finswimmer11k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1430 users visited in the last hour