[Bioperl-l] Annotation proposal

Matthew Pocock mrp@sanger.ac.uk
Tue, 10 Apr 2001 13:39:28 +0100


Ewan Birney wrote:

>     Bio::Seq and Bio::SeqFeature::Gene should *be* Bio::AnnotationContainerI's
> not *have-a* annotation. This is closer to both OMG and BioJava things, which
> I think is nice.

Not quite so close - Annotatable defines the method getAnnotation which 
returns an Annotation instance. Sequences, Features and other things 
extend Annotatable so have an Annotation.

As for the general discussion, It looks like you are trying to develope 
an API for managing type-safe frames (frames with one slot that 
references another frame that defines what slots should exist and 
potentialy annotation about how the slot should be interpreted). It's a 
pity that neither Perl nor Java allow easy on-the-fly definitons of new 
classes which can be validated early (e.g. at compile). Of course, the 
core interfaces define well-constrained frames, but this falls down for 
fuzzy data.

Something along the lines of a perl object with a data hash and a 
functions hash may work out - you use the AUTOLOAD method to pull out 
the apropreate function and execute it, and the function grabs the data 
hash for it's stoorage (implemented as a blessed 2-element list?). ISA 
can be over-ridden easily enough (in the instance-method case), as can 
CAN. One benefit of this is that the subs that make up an object can be 
closures so that you can create the equivalent of inner classes.

Anybody bored enough to join me in playing with this?

Matthew

> What do people think?
> 
> 
> 
> 
> 
>           
> 
> 
> 
> 
> 
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <birney@ebi.ac.uk>. 
> -----------------------------------------------------------------
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l