[Biopython-dev] [Bug 2561] SeqRecord format method to get a string in a given file format

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Aug 1 10:26:05 UTC 2008


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





------- Comment #3 from biopython-bugzilla at maubp.freeserve.co.uk  2008-08-01 06:26 EST -------
(In reply to comment #2)
> I would be in favor of adding a .tostring(format) method to the SeqRecord
> class.

OK.

> If I am not mistaken, such a method would make SeqIO.write superfluous:
> 
> for record in records:
>     handle.write(record.tostring(format))
> 
> does the same thing as
> 
> Bio.SeqIO.write(handle, records, format)

This would do the same thing ONLY for sequential file formats (which admittedly
are the most commonly used ones).  It wouldn't work for anything more
structured with a file header/footer (e.g. any XML format, and most alignment
file formats).

> To keep the Biopython API clean, I would therefore suggest to add
> record.tostring(format) and to remove SeqIO.write (after properly deprecating
> it and having a bunch of releases with SeqIO.write deprecated).

I don't think we can or should deprecate Bio.SeqIO.write() for the reason
above.

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