[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 12:14:28 UTC 2008


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





------- Comment #17 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-10 07:14 EST -------
(In reply to comment #16)
> (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).

Or, for another approach which at least avoids private properties but instead
makes an assumption that added sequences are always put at the end of the
alignment:

alignment = Alignment(generic_dna)

alignment.add_sequence(id_one, seq_one)
assert alignment[-1].id == id_one
alignment[-1].description = desrc_one
alignment[-1].annotations["label"] = label_one
...

alignment.add_sequence(id_two, seq_two)
assert alignment[-1].id == id_two
alignment[-1].description = desrc_two
alignment[-1].annotations["label"] = label_two
...
yield alignment

However, I agree with you, the best solution is to pass SeqRecord objects to
the alignment directly (i.e. Bug 2553 and/or Bug 2554).


-- 
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