Biopython Emboss Needle gives no output file
2
0
Entering edit mode
7.2 years ago
weihan • 0

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 • 3.1k views
ADD COMMENT
2
Entering edit mode
7.2 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
7.2 years ago
Asaf 10k

Keep reading the cookbook, you should execute this line.

ADD COMMENT

Login before adding your answer.

Traffic: 2620 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6