[BioPython] do_alignment

Peter biopython at maubp.freeserve.co.uk
Mon Jan 5 13:09:22 UTC 2009


On Mon, Jan 5, 2009 at 12:49 PM, Seda Alper <sedaalper at yahoo.com> wrote:
> Hi!
>
> I executed the code below about Clustalw . However it doesn't work.
>
> import os
> from Bio.Clustalw import MultipleAlignCL
>
> cline = MultipleAlignCL(os.path.join(os.curdir,"opuntia.fasta"))
> cline.set_output("test.aln")
> print cline
>
> from Bio import Clustalw
>
> alignment = Clustalw.do_alignment(cline)
>
> The error like that
>>>>
> clustalw -INFILE=.\opuntia.fasta -OUTFILE=test.aln
>
> Traceback (most recent call last):
>  File "C:\Python25\ders\se.py", line 10, in <module>
>    alignment = Clustalw.do_alignment(cline)
>  File "C:\Python25\Lib\site-packages\Bio\Clustalw\__init__.py", line 95, in do_alignment
>    shell=(sys.platform!="win32")
>  File "C:\Python25\lib\subprocess.py", line 594, in __init__
>    errread, errwrite)
>  File "C:\Python25\lib\subprocess.py", line 816, in _execute_child
>    startupinfo)
> WindowsError: [Error 2] The system cannot find the file specified
>
> What to do?
>
> Thanks
> Seda

I'm not at my Windows machine to double check this, but I suspect you
don't have clustalw on your path.  If you don't have clustalw on your
path, you'll have to tell Biopython where it is:

clustalw_exe = r"C:\Program Files\...\clustalw.exe"
assert os.path.isfile(clustalw_exe)
cline = MultipleAlignCL(os.path.join(os.curdir,"opuntia.fasta"), clustalw_exe)
...

Peter



More information about the Biopython mailing list