[Biopython-dev] Relaxing SeqIO, AlignIO, etc write functions?

Peter biopython at maubp.freeserve.co.uk
Thu Mar 18 15:01:32 EDT 2010


On Mon, Mar 15, 2010 at 5:26 PM, Eric Talevich wrote:
> On Mon, Mar 15, 2010 at 11:40 AM, Peter wrote:
>>
>> So, should we continue to insist on:
>>
>> record = SeqRecord(...)
>> SeqIO.write([record], filename, format)
>>
>> or should be relax a little more and allow this too?:
>>
>> record = SeqRecord(...)
>> SeqIO.write(record, filename, format)
>>
>> For SeqIO and AlignIO we can do a simple isinstance check
>> for a SeqRecord or alignment object - there isn't really a
>> problem with ambiguity here. Probably also try for Phylo?
>>
>> What's the general consensus on the dev list?
>
> Sounds good to me! The code I just deleted from Bio.Phylo._io
> was doing something foolish anyway (testing whether the
> argument is iterable) -- now that Bio.Phylo has a single legitimate
> base class, I can restore the feature with an isinstance(trees,
> BaseTree.Tree) check if we have a consensus here.
>
> -Eric

There was another +1 vote from Marshall Hampton, and no
comments against (so far). Let's leave it a few days, but unless
anyone speaks out in favour of the status-quo (keep the
current strict check in the write function), then make the change.

Peter


More information about the Biopython-dev mailing list