[Bioperl-l] generic sequence factory in SeqIO

Jason Stajich jason@cgt.mc.duke.edu
Mon, 22 Apr 2002 23:41:00 -0400 (EDT)


changes are in - it appears I made one little mistake in the display_id
initialization of embl reads which is causing a liveseq test to fail - I
will fix tomorrow if no one gets to it sooner.

We now do delayed instantiation of sequences in the embl/genbank/swiss
readers so that we don't have to test the type of sequence we're building
to see if it 'can' call division, secondary_accessions, etc.

-j

On Tue, 23 Apr 2002 hlapp@gmx.net wrote:

> Very cool Jason. Roll it out. Deprecate next_primary_seq().
>
> Few remarks:
> 1) Factory methods for object instantiation are usually called
> create_XXXX(). You may want to rename it.
> 2) I'd rename sequence_builder() to sequence_factory(). (GoF convention is
> actually to name the classes accordingly, too.)
> 3) I assume SeqIO.pm has that method declared, too (it's the interface).
>
> > I've put into place the propsed pluggable sequence factories in Bio::SeqIO
> > classes as described by Hilmar a while back.  This is part of the steps to
> > revamp SeqIO.
> >
> > This requires the creation of
> >
> > Bio::Factory::SeqBuilderI - interface which describes this factory
> >   one method -- new_sequence() which passes all arguments to the
> >                 instantiation call of the
> >
> > Bio::Seq::SeqBuilder -- a generic object which wraps the creation of
> >                         bioperl sequences
> >
> > Added a method to Bio::SeqIO
> >    sequence_builder()
> > which get/sets a Bio::Factory::SeqBuilderI object.
> >
> > Added to all the SeqIO:: subclasses a _initialize method (where necessary)
> > which called
> > $self->sequence_builder() with the appropriate Bio:: Rich/Large/Primary/
> > or Seq builder.
> >
> > Additionally, I vote that we remove the next_primary_seq from Bio::SeqIO
> > as this is replaced by the functionality
> >
> > $seqio->sequence_builder(new Bio::Seq::SeqBuilder(-type =>
> > 'Bio::PrimarySeq');
> >
> > while( my $seq = $seqio->next_seq ) {  ... }
> >
> > I would like to go ahead an roll this out and get some comments back. All
> > tests pass of course... =)
> >
> > -jason
> > --
> > Jason Stajich
> > Duke University
> > jason@cgt.mc.duke.edu
> >
> >
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l
> >
>
>

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu