Question: Problem With Clustalw Alignment Which Was Running Fine
0
gravatar for Thaman
8.8 years ago by
Thaman3.2k
Finland
Thaman3.2k wrote:

Hi again,

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.

Thanks

alignment clustalw • 4.0k views
ADD COMMENTlink modified 6.1 years ago by Biostar ♦♦ 20 • written 8.8 years ago by Thaman3.2k

You did set your filename variable, right? ;-)

ADD REPLYlink written 8.8 years ago by Michael Schubert6.9k
2
gravatar for Michael Schubert
8.8 years ago by
Cambridge, UK
Michael Schubert6.9k wrote:

You did set your filename variable, right? ;-)

Other than that, try print str(cline) and executing the resulting string in cmd. This will give you a better error message to track what's wrong.

ADD COMMENTlink written 8.8 years ago by Michael Schubert6.9k
1

To expand on this, run 'clustalw -infile=opuntia.fasta -seqnos=ON' from the command prompt in the same directory you are running your script. What does clustalw say? This is the best way to debug these types of issues.

ADD REPLYlink written 8.8 years ago by Brad Chapman9.4k

Actually before I didn't included filename and maybe seems like varialbe. Now I corrected where filename is assigned to fasta file name

ADD REPLYlink written 8.8 years ago by Thaman3.2k

When I run 'clustalw -infile=opuntia.fasta -seqnos=ON' then it gives error message > ERROR: Cannot open input file (-infile=opuntia.fasta) and in next line Cannot open input file. No alignment!. But, I when tried like this 'clustalw -align -infile=opuntia.fasta -seqnos=ON then it's generate .aln and .dnd files.

ADD REPLYlink written 8.8 years ago by Thaman3.2k

Do you have a file called 'opuntia.fasta' in the current directory? Clustalw is telling you it can't find the file. Adding '-align' to the parameters shouldn't change anything since this is the default. Perhaps you ran the first and second commands in different directories?

ADD REPLYlink written 8.8 years ago by Brad Chapman9.4k

Yes, I have opuntia.fast in the current directory. I didn't change the directory and ran the first and second commands from the directory where is my opuntia.fasta file is. For all verification I have uploaded picture so you can guide me >> http://i56.tinypic.com/35d6rk6.jpg

ADD REPLYlink written 8.8 years ago by Thaman3.2k

I do not see why your clustalw -infile=.. should not work. Have you tried supplying the full path of your fasta file or another file? Other than that, see if the current version of clustalw behaves the same way.

ADD REPLYlink written 8.8 years ago by Michael Schubert6.9k

I tried with clustalw 1.83, 2.0.3, 2.0.7 and finally worked with 2.0.12 version. But, still I have a doubt why it's not working in 2.0.3? Because 2.0.3 worked for me with the given configuration before but not now.

ADD REPLYlink written 8.8 years ago by Thaman3.2k

Well, if the current version is working and a deprecated one is not don't ask why, just accept it (unless you desperately need the old one to work) :-)

ADD REPLYlink written 8.8 years ago by Michael Schubert6.9k

Maybe I have understand problem is due to compatibility. Thanks :)

ADD REPLYlink written 8.7 years ago by Thaman3.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: 1614 users visited in the last hour