[Bioperl-l] small question

Ewan Birney birney@ebi.ac.uk
Sun, 30 Jul 2000 16:39:58 +0100 (GMT)

On Sun, 30 Jul 2000, L.Pollak wrote:

> whats the difference between
> Bio::Seq->desc
> and
> Bio::Annotation->description
> ??

Should be nothing. <sigh>.

The problem is that I originally wrote the Annotation object for Pfam and
then imported it into Bioperl, reusing it for sequences. Then there is the
following trickiness:

   Bio::Seq->desc is actually a Bio::PrimarySeqI attribute, and should
ideally (from this perspective) be implemented such that:

   $seq->desc('new description');
   # Bio::Seq both has-a Bio::PrimarySeq as well as implementing its
   # interface. This call gets the PrimarySeq, therefore potentiall
   # triggering deallocation of the SeqFeatures - a v. good thing
   $primary_seq = $seq->primary_seq();
   $seq = 0; # deallocate the heavyweight object. We now have "just the sequence"
   print $primary_seq->desc # should be new description

However, the rest of the "annotation" part of Bio::Seq has been
implemented by the fact that Bio::Seq has-a Bio::Annotation, giving us
DBLink objects, References etc. This is a *good thing* as we want to reuse
these objects elsewhere (which we certainly do). Therefore

   $seq->annotation->description() should be the same as

I suspect the solution to all of this is to make the $seq->desc function
in set mode to set both the Bio::Annotation->description *and* the
primary_seq description. On get mode it should go to Bio::PrimarySeq and 
the SeqIO packages should automatically make sure that they read in the
description into both the annotation and primary_seq slots.

This is pretty icky though.

Basically we have a "design problem" in here. This does not surprise me;
the description line is a very loosely defined idea which gets
overloaded/reused and abused in bioinformatics, and so it does not
surprise me that we can't find an obvious place to put it in the object
scheme of things.

If anyone one has any ideas about how to solve this little condundrum,
speak freely ;) suggestions that we do a ground up redesign are less
constructive than some more local fix ...


> thx, Lorenz
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420