[Bioperl-l] Bio::FeatureHolderI interface confusion
Hilmar Lapp
hlapp at gmx.net
Wed Jun 18 17:34:37 EDT 2003
On Wednesday, June 18, 2003, at 03:37 PM, Lincoln Stein wrote:
> Oy vey. As far as I can see, this is all the propagation of a POD
> typo.
> Look here at the top of the FeatureHolderI file:
>
> Popular feature-holders are for instance L<Bio::Seq> objects. Since
> L<Bio::SeqFeatureI> defines a sub_SeqFeature() method, most
> Bio::SeqFeatureI implementations like L<Bio::SeqFeature::Generic>
> will
> implement the feature holder interface as well.
>
> This isn't true; it's called get_SeqFeatures() in Bio::SeqFeatureI.
>
It was called sub_SeqFeature() before. Obviously after making the
change I forgot to change the doc in FeatureHolderI accordingly. Sorry
'bout that.
> Then below (still in FeatureHolderI):
>
> =head2 get_SeqFeatures
>
> Title : get_SeqFeatures
> Usage :
> Function: Get the feature objects held by this feature holder.
> Example :
> Returns : an array of Bio::SeqFeatureI implementing objects
> Args : none
>
> At some day we may want to expand this method to allow for a feature
> filter to be passed in.
>
> =cut
>
> sub get_SeqFeatures{
> shift->throw_not_implemented();
> }
>
> Clearly the right brain didn't know what the left was doing.
Well, I didn't paint one on canvas and typed the other on the keyboard
... it's the same half of the brain, but at different times.
> Then in
> Bio::Seqfeature::Generic:
>
> # we revamped the feature containing property to implementing
> # Bio::FeatureHolderI
> *sub_SeqFeature = \&get_SeqFeatures;
> *add_sub_SeqFeature = \&add_SeqFeature;
>
>> Step 4 would not be a contract violation if Bio::SeqFeatureI inherited
>> from Bio::FeatureHolderI - it does not.
>>
>> Yes, I can do a test:
>>
>> if ($sf->isa("Bio::FeatureHolderI")) {
>> $sf->add_SeqFeature($foo);
>> }
>> else {
>> $self->throw("feature does not have ability to hold subfeatures");
>> }
>
> This is yuck. Bio::SeqI implements get_SeqFeatures(). Always has,
> always
> will.
Yes the latter, no the former. It used to be called all_SeqFeature()
and top_SeqFeature() before 1.2.x (which actually caused my brain to
tie up in a knot).
>
> sub_SeqFeature() must die!
>
I emphatically agree.
-hilmar
> Lincoln
>
> --
> =======================================================================
> =
> Lincoln D. Stein Cold Spring Harbor
> Laboratory
> lstein at cshl.org Cold Spring Harbor, NY
> =======================================================================
> =
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the Bioperl-l
mailing list