[Biocorba-l] Annotations
Thomas Down
td2@sanger.ac.uk
Mon, 04 Jun 2001 15:45:17 +0100
Ewan Birney wrote:
>
>
>
> - We need an explicit extension of SeqFeature which has-a annotation.
>
> (or mix-in of SeqFeature and Annotation? Hmmmm)
>
> - most sequence features (>95%) *do not* have annotations in real
>life (believe me, i know) but certain ones have heavy annotation (eg
>Genes).
>
I've been watching this with interest. I'm not really competant to talk
about BioPerl,
but here's a view of how we do this in BioJava, which might make an
interesting extra
data point. We handle this using a lightweight Annotatable interface.
This just has one method:
public interface Annotatable {
public Annotation getAnnotation();
}
Annotatable gets re-used in various places. For our purposes, the two
imporatant cases
are Sequence and Feature (equivalent to Bioperl SeqFeature), which both
implement
Annotatable.
Annotation objects encapsulate key-value mappings. There are a couple of
general-purpose implementations, or you can write your own (imposing
whatever
constraints you want). There's also a singleton object,
Annotation.EMTPY_ANNOTATION.
I'd definitely agree with Ewan about needing to make Features quite
lightweight.
If you don't need the annotation mechanism, you can just create a
feature with the
empty Annotation. If you're doing custom Feature implementations (the
biojava-ensembl
bridge has these, for instance) you can even go for the
ultra-lightweight solution:
public Annotation getAnnotation() {
return Annotation.EMTPY_ANNOTATION;
}
This has been working pretty well for us so far, but I don't know how it
would
scale for Corba-over-a-network.
The big future issue for this is that we're starting to think about
having slightly
more formalized Annotations, where you have some overview of what keys
to expect in an Annotation associated with a particular kind of feature.
In the
last couple of weeks, I've been looking at RDF Schema and DAML as mechanisms
which could be used to define annotation schemas. This ought to retrofit
quite cleanly on top of the current Annotatable/Annotation API.
Thomas