[Bioperl-l] Changes to Bio::SeqI broke Bio::Graphics

Lincoln Stein lstein@cshl.org
Tue, 12 Nov 2002 15:25:45 -0500


The following methods are required for a feature to be renderable:

	start()
	end()
	display_name()  
	sub_SeqFeature()
	primary_tag()
	source_tag()
	score()
	strand()
	location()

Some of this sounds pretty generic (display_name() and location()), the rest 
is pretty seq-featureish.

I guess I'm just a recursive relationship kinda' guy, but it seems to me to be 
elegant for a sequence entry to be equivalent to a feature.  This allows an 
entry to be a feature in a larger virtual sequence, such as a genome 
assembly.  I don't see why we persist in thinking in this flat-file EMBL 
entry way.

Lincoln

On Monday 11 November 2002 06:21 pm, Hilmar Lapp wrote:
> Lincoln correct me if this is wrong, but I guess that 'lightweight
> interface' is more or less Bio::SeqFeatureI.
>
> One could duplicate (well, probably remove a few methods?)
> Bio::SeqFeatureI as Bio::SeqFeature::RenderableFeatureI ... Is that
> what you were thinking of?
>
> 	-hilmar
>
> On Monday, November 11, 2002, at 12:25 PM, Matthew Pocock wrote:
> > Rather than all this kludging to make sequences look like features
> > so that they can be rendered, could you instead define the renderer
> > in terms of some light-weigth interface for the data you need to
> > render something and adapt both features and sequences to that
> > interface? That way, you can later decide to render traces,
> > barcharts, pictures by just providing an apropreate adaptor.
> >
> > Just my 2p
> >
> > Matthew
> >
> > Hilmar Lapp wrote:
> >> I was thinking of doing exactly that, just don't have time. I'd
> >> have called it Bio::SeqFeature::SeqAdaptor, because basically the
> >> pattern is to adapt a Bio::SeqI object to the Bio::SeqFeatureI
> >> interface. Hence,
> >>     Bio::SeqFeature::SeqAdaptor is-a Bio::SeqFeatureI, Bio::SeqI
> >> Bio::SeqI would be implemented by composition, as you say. With
> >> this you'd be able to look at any seq object as if it were a
> >> feature. I believe Lincoln has already accomplished a similar
> >> thing in Bio::DB::GFF::Feature even though it's not explicit. Not
> >> sure though.
> >> The only downside of this is that it could potentially be
> >> expensive if you want to disguise very many sequences.
> >>     -hilmar
> >>
> >> On Saturday, November 9, 2002, at 04:53 AM, Ewan Birney wrote:
> >>> On Fri, 8 Nov 2002, Lincoln Stein wrote:
> >>>>> Why? So that they looked like sequence features? I still think
> >>>>> it is wrong
> >>>>> to have Bio::SeqI inherieting from Bio::RangeI.
> >>>>
> >>>> When rendering the features of a sequence, it looks nice to have
> >>>> a single
> >>>> feature that goes all the way across the whole sequence labeled
> >>>> with the
> >>>> display_id of the sequence.  When Bio::SeqI had start() and
> >>>> end() features,
> >>>> this was sufficient to pass the sequence object to the drawing
> >>>> code and get
> >>>> the desired effect.
> >>>
> >>> I think this is changing the sequence interface for a specific
> >>> use case. I
> >>> would claim a better pattern here is:
> >>>
> >>>
> >>>   Bio::SeqFeature::SequenceExtent
> >>>
> >>> which is-a Bio::SeqFeatureI and has-a Bio::SeqI and chains the
> >>> call to
> >>> "end" to "length" and also "has_tags" etc to something sensible in
> >>> Bio::AnnotationCollection.
> >>>
> >>> I am happy to write this. Does this sound like a better solution?
> >>>
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Bioperl-l mailing list
> >>> Bioperl-l@bioperl.org
> >>> http://bioperl.org/mailman/listinfo/bioperl-l
> >>
> >> -- -------------------------------------------------------------
> >> 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
> >
> > -- BioJava Consulting LTD - Support and training for BioJava
> > http://www.biojava.co.uk
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein@cshl.org			                  Cold Spring Harbor, NY
========================================================================