[Bioperl-l] SeqIO parsing

Ewan Birney birney@ebi.ac.uk
Tue, 24 Sep 2002 22:44:18 +0100 (BST)


On Tue, 24 Sep 2002, Hilmar Lapp wrote:

> >
> >        (iii) To prevent henious errors of RootI compliance without 
> > verbose
> > being overriden, put in a default implementation of verbose returning 0
> > and a warning.
> >
> 
> Not a warning -- throw_not_implemented() and ideally also throw() 
> and warn() should still work without warning about themselves.

I disagree - warn() has to rely on verbose() and if verbose() throws on
unimplemented, then we have the very real chance of someone implementing a
RootI object without providing a sensible verbose() call, and then
run-time the client having a nasty, unrecoverable error thrown from deep
within some code - 


better I think to warn here and return 0

> 
> 
> >
> >   this scheme in my mind has one *SERIOUS* gotcha. People *have* to 
> > write
> > their @ISA's with their implementation tree *first* and their interface
> > inheritance second. Is this ok with people?
> >
> 
> It should be the style everyone employs already. Otherwise you set 
> yourself up for trouble anyway (how would you avoid the interface 
> method stub that throws an exception from being invoked if you put 
> the interface first?).
> 
> 
> >
> > The nice thing about (a) is that it should give speed ups across the
> > entire system, not just SeqIO.
> >
> >
> > Jason/Hilmar - is there a hidden gotcha here somewhere?
> >
> >
> 
> Not that I'd see one immediately.
> 
> 
> >
> >
> >   (b) Making a new Bio::Seq::SeqFactory with privledged access to
> > functions in Bio::Seq and Bio::PrimarySeq to make fast access 
> > objects, eg,
> > not going through a second alphabet on setting seq.
> >
> 
> I doubt this will have a huge effect but I'm happy to be surprised. 
> Also, as for alphabet, you can avoid second alphabet guessing by 
> saying $seq->seq(-seq => $seqstr, -alphabet => $seq->alphabet()) or 
> $seq(-seq => $seqstr, -alphabet => 'protein').
> 
> >
> > BTW - I think I can cut the object creation time by a factor of 6 in my
> > tests if I get this written right ;)
> >
> >
> 
> looking forward to it :-)
> 
> 	-hilmar
> --
> -------------------------------------------------------------
> Hilmar Lapp                            email: lapp at gnf.org
> GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
> -------------------------------------------------------------
> 
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------