[Bioperl-l] Changes to Bio::SeqI broke Bio::Graphics
Matthew Pocock
matthew_pocock@yahoo.co.uk
Mon, 11 Nov 2002 20:25:42 +0000
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