Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emboss Command Line - Stdout issue #3202

Closed
antoinekoehl opened this issue Aug 10, 2020 · 2 comments
Closed

Emboss Command Line - Stdout issue #3202

antoinekoehl opened this issue Aug 10, 2020 · 2 comments

Comments

@antoinekoehl
Copy link

Setup

I am reporting a problem with Biopython version, Python version, and operating
system as follows:

3.6.10 |Anaconda, Inc.| (default, Mar 25 2020, 18:53:43)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
CPython
Darwin-18.7.0-x86_64-i386-64bit
1.76

Expected behaviour

I am trying to align two sequence using the python wrapper to EMBOSS Needle. When I initialize the needle_cline object with needle_cline.outfile = 'test.txt' it works and generates the Needle alignment file as normal. The outfile is identical to the one produced by running command line Needle with the same sequences.

When I instead specify needle_cline.stdout = True , it gives me the following error:

Actual behaviour


ApplicationError Traceback (most recent call last)
in
----> 1 stdout, stderr = needle_cline()

/opt/miniconda3/envs/Remote_Homology/lib/python3.6/site-packages/Bio/Application/init.py in call(self, stdin, stdout, stderr, cwd, env)
529 if return_code:
530 raise ApplicationError(return_code, str(self),
--> 531 stdout_str, stderr_str)
532 return stdout_str, stderr_str
533

ApplicationError: Non-zero return code 1 from 'needle -stdout -asequence=/Users/antoinekoehl/Documents/GitHub/remote_homology/PDBs/5A31N.fa -bsequence=/Users/antoinekoehl/Documents/GitHub/remote_homology/PDBs/4ZU9A.fa -gapopen=10 -gapextend=0.5', message 'Needleman-Wunsch global alignment of two sequences'

Steps to reproduce

from Bio.Emboss.Applications import NeedleCommandline
needle_cline = NeedleCommandline()
needle_cline.asequence = pdb_dir + '/5A31N.fa'
needle_cline.bsequence = pdb_dir + '/4ZU9A.fa'
needle_cline.gapopen = 10
needle_cline.gapextend = 0.5
needle_cline.stdout = True
stdout, stderr = needle_cline()

When I print(needle_cline) the command appears correct:

needle -stdout -asequence=/Users/antoinekoehl/Documents/GitHub/remote_homology/PDBs/5A31N.fa -bsequence=/Users/antoinekoehl/Documents/GitHub/remote_homology/PDBs/4ZU9A.fa -gapopen=10 -gapextend=0.5

I did notice that using command line needle (to stdout) first gives me the output : Needleman-Wunsch global alignment of two sequences. When I then press enter, the alignment shows up.

@peterjc
Copy link
Member

peterjc commented Aug 10, 2020

You need to add -auto to the command line to say automated mode, do not prompt the user. i.e. needle_cline.auto = True in your example.

@peterjc
Copy link
Member

peterjc commented Sep 2, 2020

I'm assuming you got this to work, closing issue.

@peterjc peterjc closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants