[Bioperl-l] Annotation of features
Lincoln Stein
lstein@cshl.org
Wed, 25 Sep 2002 17:12:32 -0400
I think lazy evaluation is the right way to do it. Maintain the tag/value
hash in Generic the same way it's currently done, but if the caller invokes
annotation(), then those values are used to initialize an AnnotationI which
is then returned.
Lincoln
On Wednesday 25 September 2002 4:15 pm, David Block wrote:
> On Wednesday, September 25, 2002, at 12:36 PM, Hilmar Lapp wrote:
> > Currently the only annotation you can stick on SeqFeatureIs is
> > tag/value pairs. This is orthogonal to SeqIs.
> >
> > I just realized that SeqFeature::Generic does have annotation(). I vote
> > for propagating this method to the interface level.
> >
> > SeqFeatureI's tag/value annotation should be transparently the same as
> > for SeqI. This means tag/value pairs should be annotated as
> > Bio::Annotation::SimpleValue instances added to the
> > AnnotationCollection.
> >
> > This may, however, create significant overhead when SeqFeatureIs are
> > instantiated (every tag/value pair amounts to an object).
> > Thoughts/comments?
> >
> > The problem could possibly be alleviated by writing an adaptor that
> > adapts SeqFeatureI to AnnotationCollectionI, and annotation() would
> > return an instance of that adaptor. In that case the implementation
> > could make sure that you only incur the overhead once you actually
> > request those values.
>
> So the tag-value hash would be replaced by an annotation object, which
> would have an internal tag-value hash, and would allow you to act as if
> those hash key-value pairs were full-fledged AnnotationI objects?
>
> Sounds good to me. The key-value pairs are completely optional as far
> as creating SeqFeatures, right? So even the object creation for
> Annotations will be only for the objects that currently require creating
> a hash - some inevitable overhead, but the benefit of being able to
> create an annotation and hang it off of virtually anything in the
> Bio::Seq and Bio::SeqFeature hierarchy.
>
> > I'd be glad to hear anyone's thoughts on this.
> >
> > -hilmar
>
> There - you've got mine.
>
> Dave
>
> > --
> > -------------------------------------------------------------
> > Hilmar Lapp email: lapp at gnf.org
> > GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
> > -------------------------------------------------------------
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l@bioperl.org
> > http://bioperl.org/mailman/listinfo/bioperl-l