I had successfully completed Multiple sequence alignment problem using ClustalW2 and parsing result in a Web. My configuration before was
- Python 2.6 - BioPython 1.54 - ClustalW 2.0.3
In between I changed all my configuration for another project, now when I again tried to run my project (Clustalw MSA) then I figure out it's not working which I try to troubleshoot with my current configuration. Then I removed all current configuration and moved to the previous to check whether it was compatibility issue. But, moving to the previous configuration where my project was successfully doesn't seems to work anyhow.
This worked fine for me as suggested by Biostar user Peter and Brad
import sys, subprocess, os, tempfile from Bio import Phylo from Bio import AlignIO from Bio import SeqIO from Bio.Align.Applications import ClustalwCommandline filename="opuntia.fasta" cline = ClustalwCommandline("clustalw", infile=filename, seqnos="ON") child = subprocess.call(str(cline), shell=(sys.platform!="win32"))
The given line of code was supposed to generate .aln and .dnd file respective to it's given inputted file.
When I print child then it's shows -1 which was supposed to be 0 after subprocess completes. Though I am using Windows Vista, Python26 and ClustalW2 are in system variable PATH which created big problem in previous.
Output of cline and child
>>> print cline clustalw -infile=test.fasta >>> print child -1
But, I dont know where it's going wrong this time which was running fine with a given configuration. I genineuly believe it's subprocess problem which I am not understanding completely in different python version. Hope to hear from you guys.
Special thanks to Brad Chapman, Eric, Peter and Khadeer for solving my previous problem.