[Biopython-dev] Alignment problem. bug?
Peter
biopython at maubp.freeserve.co.uk
Tue Jul 8 08:51:31 UTC 2008
On Mon, Jul 7, 2008 at 9:30 PM, Sebastian Bassi <sbassi at gmail.com> wrote:
> I would like to confirm that this is a bug ot not. If I get
> confirmation, I would fill it in bugzilla.
It does look like a bug to me...
> With this code:
>
> from Bio import Clustalw
> from Bio.Clustalw import MultipleAlignCL
>
> cline = MultipleAlignCL('foralig.txt')
> cline.set_output("alig.aln")
> alignment = Clustalw.do_alignment(cline)
>
> I get:
>
> Traceback (most recent call last):
> File "/mnt/hda2/py252/bin/ii.py", line 112, in <module>
> alignment = Clustalw.do_alignment(cline)
> File "/mnt/hda2/py252/lib/python2.5/site-packages/Bio/Clustalw/__init__.py",
> line 125, in do_alignment
> return parse_file(out_file, alphabet)
> File "/mnt/hda2/py252/lib/python2.5/site-packages/Bio/Clustalw/__init__.py",
> line 47, in parse_file
> generic_alignment = AlignIO.read(handle, "clustal")
> File "/mnt/hda2/py252/lib/python2.5/site-packages/Bio/AlignIO/__init__.py",
> line 299, in read
> first = iterator.next()
> File "/mnt/hda2/py252/lib/python2.5/site-packages/Bio/AlignIO/ClustalIO.py",
> line 169, in next
> raise ValueError("Could not parse line:\n%s" % line)
> ValueError: Could not parse line:
>
>
> I tested with Biopython 1.47 and 1.46 with the input file:
> http://www.pastecode.com.ar/f44f28b41 (download at
> http://www.pastecode.com.ar/pastebin.php?dl=f44f28b41)
> The clustal program is running because I see in the disk its output
> (posted here: http://www.pastecode.com.ar/f275a5475). It seems it
> fails to parse it.
>
> I also tested in an older version (I guess it is 1.44) and it works
> OK. So I think the problem was introduced in 1.46.
For Biopython 1.46+ I switched the Bio.Clustalw parser to internally
call Bio.AlignIO, so one thing you could try is reverting
Bio/Clustalw/__init__.py to the older version (e.g. that shipped with
Biopython 1.45).
You haven't said which version of the ClustalW tool you are using -
maybe 2.0? If so, there could be a subtle change in the output
format since 1.83. If you could run the tool by hand and share the
output that would be helpful to try and track down this issue.
I don't seem to have any version of ClustalW installed on my current
machine, so it will take me a little longer to reproduce this here.
Could you file a bug please, and attach the example input and the
output when run by hand at the command line.
Thanks,
Peter
More information about the Biopython-dev
mailing list