Question: Subprocess Fails To Catch The Standard Output!
4
gravatar for Thaman
8.3 years ago by
Thaman3.2k
Finland
Thaman3.2k wrote:

I am trying to generate tree with fasta file input and Alignment with MuscleCommandline as i fail to do it through Clustalcommandline

import sys,os, subprocess
from Bio import AlignIO
from Bio.Align.Applications import MuscleCommandline
cline = MuscleCommandline(input="c:\Python26\opuntia.fasta")
child= subprocess.Popen(str(cline),
                         stdout = subprocess.PIPE,
                         stderr=subprocess.PIPE,
                        shell=(sys.platform!="win32"))
align=AlignIO.read(child.stdout,"fasta")
outfile=open('c:\Python26\opuntia.phy','w')
AlignIO.write([align],outfile,'phylip')
outfile.close()

Error i always encountered........

Traceback (most recent call last):
  File "<string>", line 244, in run_nodebug
  File "C:\Python26\muscleIO.py", line 11, in <module>
    align=AlignIO.read(child.stdout,"fasta")
  File "C:\Python26\Lib\site-packages\Bio\AlignIO\__init__.py", line 423, in read
    raise ValueError("No records found in handle")
ValueError: No records found in handle
python • 1.8k views
ADD COMMENTlink modified 7.0 years ago by Brad Chapman9.2k • written 8.3 years ago by Thaman3.2k
7
gravatar for Brad Chapman
8.3 years ago by
Brad Chapman9.2k
Boston, MA
Brad Chapman9.2k wrote:

Check my answer at StackOverflow:

http://stackoverflow.com/questions/2856697/subprocess-fails-to-catch-the-standard-output/2857818#2857818

ADD COMMENTlink written 8.3 years ago by Brad Chapman9.2k
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: 1741 users visited in the last hour