Question: The Biopython Needlecommandline Class Complains About Needle Returning Non-Zero
gravatar for jergosh
7.9 years ago by
United Kingdom
jergosh60 wrote:

I'm trying to run needle using Biopython's NeedleCommandline. The two input files are tempfile.NamedTemporaryFiles.

 cline = NeedleCommandline(, 
 stdout, stderr = cline()

This returns "Bio.Application.ApplicationError: Command 'needle -stdout -asequence=/var/folders/zm/jvdqjg5j3kg67_pxlsjc84c40000gn/T/tmpQXYVkP -bsequence=/var/folders/zm/jvdqjg5j3kg67_pxlsjc84c40000gn/T/tmpcVFncj -gapopen=10 -gapextend=1' returned non-zero exit status 1, 'Needleman-Wunsch global alignment of two sequences'"

I tried running the same command by hand (after setting the NamedTemporaryFile(delete=False) in both files) and it runs just fine. I also tried using an output file (with outfile="xxx.needle" in NeedleCommandline) but it still doesn't work.

I also verified the return code when running it manually by 'echo $#' and it is 0.

biopython • 2.9k views
ADD COMMENTlink modified 4.4 years ago by Medhat8.8k • written 7.9 years ago by jergosh60

Try to get the return code of the last command by '$?' and not '$#'. The latter is a string length on an empty string, which is always 0.

ADD REPLYlink written 7.9 years ago by Michael Schubert7.0k

Argh, thanks for pointing that out

ADD REPLYlink written 7.9 years ago by jergosh60

Could you double check the file handles for the A and B sequences have been closed before calling needle?

ADD REPLYlink written 7.9 years ago by Peter5.9k
Please log in to add an answer.


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