You do have EMBOSS installed, right?
hello
I'm new to biopython and trying to run the example provided by the biopython documentation section 6.4.5 EMBOSS needle and water:
from Bio.Emboss.Applications import NeedleCommandline
needle_cline = NeedleCommandline(asequence="alpha.fasta", bsequence="beta.fasta",
gapopen=10, apextend=0.5,outfile="needle.txt")
stdout,stderr=needle_cline()
I have created two .fasta files and saved two sequences in FASTA format and named the files alpha.fasta and beta.fasta respectively in the same directory as the script containing the above given example. whenever it executes the last line (stdout,stderr=needle_cline()) it's giving the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Anaconda\lib\site-packages\Bio\Application\__init__.py", line 513, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 1 from 'needle -outfile=needle.txt -asequence=alpha.fasta -bsequence=beta.fasta -gapopen=10 -gapextend=0.5', message "'needle' is not recognized as an internal or external command,"
I can't figure out why I'm not able to run this simple example, also it is not creating the output file named needle.txt
Thanks in advance
2 answers
Sounds like needle may not be in your path. Try running it directly on the command-line, instead of through this wrapper, to see what error message you get:
$ needle -outfile=needle.txt -asequence=alpha.fasta -bsequence=beta.fasta -gapopen=10 -gapextend=0.5
well I did try the following now it did run without errors but did not result in anything:
needle_cline = NeedleCommandline(r"C:\EMBOSS\needle.exe",asequence="alpha.faa", bsequence="beta.faa",gapopen=10, gapextend=0.5, outfile="needle.txt")
I haven't installed EMBOSS, thought it was included in the Biopython library, I'm using Anaconda Spyder (Python 2.7), and included the Bipoython library in the Libs folder for the python interpreter
The Biopython library is just a wrapper to the EMBOSS executables. You need to install it - start here. Unfortunately their FTP server is down right now, but there are some mirrors around.
I know, tried couple of times didnt lead anywhere, I'm following the instructions provided by this website since I'm trying to use the tools provided by EMBOSS on windows platform... hope it wont cause me any problems...
Have you installed emboss separately and is it in your path? Biopython is saying that 'needle' is not a recognized command, which suggests to me that it is not installed. A quick test for this is at your command line type 'needle' and then enter. If you get a message like 'command not found' then you need to install emboss
There was a previous answer and comment thread suggesting that "not installed" is the problem. For some reason it has been deleted; I will reopen.
Log in to answer this question.