<div dir="ltr"><div>Debian-based distros (ie Debian, Ubuntu or Mint) have clustalW 2.1 in their repositories, but it is called just clustalw. So your code should be<br><br>cline = ClustalwCommandline("clustalw2", infile="test.fasta")<br>
<br></div>You said your code generates a file. What is that file?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-29 8:28 GMT+09:00 Peter Cock <span dir="ltr"><<a href="mailto:p.j.a.cock@googlemail.com" target="_blank">p.j.a.cock@googlemail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Aug 29, 2014 at 8:06 AM, Jakub Stanislaw Nowak<br>
<<a href="mailto:jakub.nowak@ed.ac.uk">jakub.nowak@ed.ac.uk</a>> wrote:<br>
> Hello,<br>
><br>
> I am trying to run alignment using ClustalW in python.<br>
><br>
> I have used this code to compile<br>
><br>
> cline = ClustalwCommandline("clustalw2", infile="test.fasta")<br>
> print(cline)<br>
> stdout, stderr = cline()<br>
> align = AlignIO.read("test.aln", "clustal")<br>
> print(align)<br>
><br>
><br>
> But it is generating file. I think I have some problem with setting a proper<br>
> pathway to clustal.<br>
><br>
><br>
> This is the error:<br>
><br>
> clustalw2 -infile=test.fasta<br>
> Traceback (most recent call last):<br>
> File "/Users/user/Google Drive/Bioinformatics/smallRNAseq/Python U<br>
> densities/trial4old.py", line 95, in <module><br>
> stdout, stderr = cline()<br>
> File<br>
> "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Bio/Application/__init__.py",<br>
> line 513, in __call__<br>
> stdout_str, stderr_str)<br>
> Bio.Application.ApplicationError: Non-zero return code 127 from 'clustalw2<br>
> -infile=test.fasta', message '/bin/sh: clustalw2: command not found'<br>
><br>
><br>
><br>
> Can you suggest some solution?<br>
<br>
</div></div>What happens at the command line (outside Python)<br>
if you run these command?<br>
<br>
$ clustalw2 -infile=test.fasta<br>
<br>
$ which clustalw2<br>
<br>
If that fails, it means clustalw2 is not installed on your $PATH.<br>
How was clustalw2 installed?<br>
<br>
If you have clustalw2 somewhere like this:<br>
/Users/jakub/downloads/clustalw2.1/bin/clustalw2<br>
<br>
Then the command would become:<br>
<br>
/Users/jakub/downloads/clustalw2.1/bin/clustalw2 -infile=test.fasta<br>
<br>
The Python code would become:<br>
<br>
cline = ClustalwCommandline("/Users/jakub/downloads/clustalw2.1/bin/clustalw2",<br>
infile="test.fasta")<br>
<br>
Regards,<br>
<br>
Peter<br>
_______________________________________________<br>
Biopython mailing list - <a href="mailto:Biopython@mailman.open-bio.org">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/mailman/listinfo/biopython</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><font face="arial,helvetica,sans-serif">Alexey Morozov,<br>LIN SB RAS, bioinformatics group.<br>Irkutsk, Russia.<br></font>
</div>