[Biopython-dev] [Bug 2803] Insure Alignment objects are passed to AlignIO.write()

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Apr 1 15:36:54 UTC 2009


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





------- Comment #3 from cymon.cox at gmail.com  2009-04-01 11:36 EST -------
(In reply to comment #2)
> Thanks for filing the bug (originally raised in our discussion on the mailing
> list).
> 
> There is a major drawback to your proposed fix,
> 
> +    if isinstance(alignments, types.GeneratorType):
> +        alignments = list(alignments)
> 
> This means if you gave the AlignIO.write function a generator returning
> hundreds or large alignment objects, they would all get loaded into memory at
> once.  One of the big aims with Bio.SeqIO and AlignIO in using
> generators/iterators is to allow memory efficient working where we try to keep
> only one record/alignment in memory at a time.
> 
> Anyway, I'll take a look at this.  I think we need to just check the case where
> Bio.AlignIO.write uses Bio.SeqIO.write internally...
> 

Yes, I see. I had originally intended to check the type while looping through
the alignments before calling SeqIO.write, but thought better of it because
some alignments may get written before a error occurs, whereas it seems best
that either all or none at all get written from the call to AlignIO.write. 

C.


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