Problem With Clustalw Alignment Which Was Running Fine
1
0
Entering edit mode
14.0 years ago
Thaman ★ 3.3k

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

clustalw alignment • 8.3k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode
14.0 years ago

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 COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1778 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6