[Bioperl-l] Changes to Bio::SeqI broke Bio::Graphics
Hilmar Lapp
hlapp@gnf.org
Mon, 11 Nov 2002 10:58:33 -0800
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
-------------------------------------------------------------