[Biopython-dev] [Bug 2643] Proposal: fastPhaseOutputIO for SeqIO

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Nov 10 10:16:14 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2643





------- Comment #16 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-10 05:16 EST -------
(In reply to comment #15)
> I have modified the module so it returns Alignment objects instead of
> SeqRecords.
> The problem is that Alignment.add_sequence doesn't support SeqRecords objects
> as inputs; it only requires an id and the sequence.  This causes that some
> information is lost: to be more precise, everything I was
> putting in 'description' (subpop. label: 6  (internally 1)) is lost, because
> there is not a way to store it in the Alignment object.

Adding a SeqRecord to an alignment would be enhancement request Bug 2553.  I
see you've just spotted enhancement request Bug 2554 which would also solve
this issue nicely. As a short term solution until one of these bugs is
implemented, some of the Bio.AlignIO parsers "cheat" and bypass the public API
to use alignment._records directly (this is just a list of SeqRecord objects).

> Moreover, now the parser only returns a single Alignment object per file (I
> think it is not supposed to be possible to have two fastphase outputs in the
> same file), because I thought it was the most useful thing.

Bio.AlignIO uses generators/iterators just like Bio.SeqIO - so that in general
you can return multiple alignments for use with Bio.AlignIO.parse().  However,
if the file format really does just return one pairwise alignment, then just
yield one alignment (this happens on the Nexus file format).

> However, I left an option to have SeqRecord objects returned instead of
> Alignments (unfortunately I removed them from the doctests :().

If you want this as part of Bio.AlignIO / Bio.SeqIO you don't need to do this. 
Once a parser is added to Bio.AlignIO, the file format can also be used from
Bio.SeqIO to get SeqRecord objects (the rows of all the alignments).

Peter


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list