[Biopython-dev] Bio.SeqIO function to read a single record

Peter Cock p.j.a.cock at googlemail.com
Sat Dec 8 13:10:33 UTC 2007


Michiel de Hoon wrote:
> >
> > I'd suggested a Bio.SeqIO function, with a name like parse1() or
> > parse_sole() etc which would return a single SeqRecord - and raise
> > an error if the handle didn't contain one and only one record.  We
> > could call this function read() if you prefer.
> >
> I'd prefer read() instead of parse1(), parse_sole() etc. for the
> following reasons:
>
> 1) Having two names that are clearly different emphasizes the fact that
> they return different things (parse() returns an iterator, read() a record).
>
> 2) Some modules deal with data that always consist of one record (for
> example, gene expression data in case of Bio.Cluster). Such modules can
> have a read() function but not a parse(). It would feel strange if a
> module has a parse1() function but not a parse().

OK. I've filed an enhancement bug, which I'll mention on the main mailing list,
http://bugzilla.open-bio.org/show_bug.cgi?id=2417
Unless there is some negative feedback,  I'll add that functionality shortly.

Peter



More information about the Biopython-dev mailing list