Question: Biopython Emboss Needle gives no output file
0
gravatar for weihan
16 months ago by
weihan0
weihan0 wrote:

I'm learning Emboss Needle from biopython to align two sequences. When I type in the following comments(used as an example from Biopython cookbook):

from Bio.Emboss.Applications import NeedleCommandline
needle_cline = NeedleCommandline(asequence="alpha.faa", bsequence="beta.faa", gapopen=10, gapextend=0.5, outfile="needle.txt")
print(needle_cline)

It returns: needle -outfile=needle.txt -asequence=alpha.faa -bsequence=beta.faa -gapopen=10 -gapextend=0.5

However, no output file named "needle.txt" is generated. All input files are present. No errors msg appear in the process. Anyone knows what went wrong? Thanks!

alignment • 584 views
ADD COMMENTlink modified 16 months ago by Asaf4.8k • written 16 months ago by weihan0
2
gravatar for a.zielezinski
16 months ago by
a.zielezinski8.3k
a.zielezinski8.3k wrote:

You just created a needle command line object without actually running the program :)

To run the command, type:

stdout, stderr = needle_cline()
print(stdout + stderr)

The output file needle.txt should be right there for you. For more information, read the whole 6.4.5. section (EMBOSS needle and water) in the BioPython Tutorial and Cookbook.

ADD COMMENTlink modified 16 months ago • written 16 months ago by a.zielezinski8.3k

Thank you! However, when I type in

stdout, stderr = needle_cline()

It returns:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 516, in __call__ stdout_str, stderr_str) Bio.Application.ApplicationError: Non-zero return code 127 from 'needle -outfile=needle.txt -asequence=alpha.faa -bsequence=beta.faa -gapopen=10 -gapextend=0.5', message '/bin/sh: needle: command not found'

Is there something wrong with PATH?

ADD REPLYlink written 16 months ago by weihan0

Probably. It can't find needle in default $PATH.

ADD REPLYlink written 16 months ago by Asaf4.8k
1
gravatar for Asaf
16 months ago by
Asaf4.8k
Israel
Asaf4.8k wrote:

Keep reading the cookbook, you should execute this line.

ADD COMMENTlink written 16 months ago by Asaf4.8k
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: 699 users visited in the last hour