[Biopython] Fwd: [BioPython] Clustalw Problems

Peter biopython at maubp.freeserve.co.uk
Thu Apr 23 15:47:28 UTC 2009


Forwarding to the mailing list - I'll reply soon.

Peter

---------- Forwarded message ----------
From: Bradley Hintze <bradley.h at aggiemail.usu.edu>
Date: Thu, Apr 23, 2009 at 4:06 PM
Subject: Re: [BioPython] Clustalw Problems
To: Peter <biopython at maubp.freeserve.co.uk>


Peter,

Sorry that it has taken so long to reply..school.
I am still having issues with the alignments. I have BioPython 1.50

I tried to do what you suggested and got the following:

>>> from Bio.Clustalw import MultipleAlignCL
>>> from Bio.Clustalw import do_alignment
>>> cline=MultipleAlignCL(r'C:\Bradley_BioPython\mtr4.fasta',r'C:\Bradley_BioPyt
hon\clustalw1.83.XP\clustalw.exe')
>>> cline.set_output(r'C:\Bradley_BioPython\test.aln')
>>> print cline
C:\Bradley_BioPython\clustalw1.83.XP\clustalw.exe -INFILE=C:\Bradley_BioPython\m
tr4.fasta -OUTFILE=C:\Bradley_BioPython\test.aln
>>> al=do_alignment('C:\Bradley_BioPython\clustalw1.83.XP\clustalw.exe -INFILE=C
:\Bradley_BioPython\mtr4.fasta -OUTFILE=C:\Bradley_BioPython\test.aln')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python25\Lib\site-packages\Bio\Clustalw\__init__.py", line 120, in do
_alignment
    % str(command_line))
ValueError: Bad command line option in the command: C:\Bradley_BioPython\clustal
w1.83.XP\clustalw.exe -INFILE=C:\Bradley_BioPython\mtr4.fasta -OUTFILE=C:\Bradle
y_BioPython     est.aln

When i try running 'cline' i get this

>>> al=do_alignment(cline)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python25\Lib\site-packages\Bio\Clustalw\__init__.py", line 124, in do
_alignment
    % command_line.sequence_file)
IOError: Cannot open sequence file C:\Bradley_BioPython\mtr4.fasta

Any ideas?

On Wed, Apr 8, 2009 at 3:50 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>
> On 4/8/09, Bradley Hintze <bradley.h at aggiemail.usu.edu> wrote:
> > Hi,
> >
> >  I am having a hard time running an alignment. I am running in windows and
> >  here is my code and the error message that I get after running do_alignment.
> >
> >  >>> import os
> >  >>> from Bio.Clustalw import MultipleAlignCL
> >  >>> from Bio.Clustalw import do_alignment
> >  >>> cline=MultipleAlignCL(r"C:\Documents and
> >  Settings\student\Desktop\Foo\mtr4.fasta", r"C:\Program
> >  Files\clustalw1.83.XP\clustalw.exe")
> >  >>> cline.set_output(r"C:\Documents and
> >  Settings\students\Desktop\Foo\test.aln")
> >  >>> al=do_alignment(cline)
> >  Traceback (most recent call last):
> >   File "<stdin>", line 1, in <module>
> >   File "C:\Python25\Lib\site-packages\Bio\Clustalw\__init__.py", line 124,
> >  in do_alignment
> >    % command_line.sequence_file)
> >  IOError: Cannot open sequence file C:\Documents and
> >  Settings\student\Desktop\Foo\mtr4.fasta
> >
> >  when I open the file using o=open('C:\Documents and
> >  Settings\student\Desktop\Foo\mtr4.fasta') it woks fine.
> >
> >  any ideas?
>
> As a general tip, try this to see what the command Biopython is trying
> to run is:
>
> >>> print cline
>
> Then try running the same command by hand at the command prompt (DOS
> prompt), and make sure it works.
>
> I can tell from the error message you have Python 2.5, but what
> version of Biopython do you have?
>
> I'm not at a Windows machine to check, but it is generally a good idea
> to avoid file names and paths with spaces where you can.  In this
> case, I'm sure relative names would be fine:
>
> >>> import os
> >>> from Bio.Clustalw import MultipleAlignCL
> >>> from Bio.Clustalw import do_alignment
> >>> cline=MultipleAlignCL("mtr4.fasta", r"C:\Program Files\clustalw1.83.XP\clustalw.exe")
> >>> cline.set_output("test.aln")
>
> Peter



--
Bradley J. Hintze
Biochemistry Undergraduate
Utah State University
801-712-8799




More information about the Biopython mailing list