[Bioperl-l] Bio::FeatureHolderI interface confusion

Hilmar Lapp hlapp at gmx.net
Wed Jun 18 17:49:50 EDT 2003


On Wednesday, June 18, 2003, at 02:59  PM, Chris Mungall wrote:

> I call:
>
>   $sf->add_SeqFeature(...)
>
> Which is in the pod docs for SeqFeature::Generic, and I don't think it 
> is
> in any interface. So the point remains, SeqFeature::Generic is a
> completely hidden implementation class, yet I am violating the 
> SeqFeatureI
> contract by calling add_SeqFeature on it.
>
> Maybe this is deliberate? Maybe features are meant to be immutable with
> respect to nesting?

They aren't meant to be, but they can opt to be. This is reflected by 
absence of mutating method signatures in the interfaces. If you look 
closely you will also notice that the scalar  getters don't 
specifically say that they will set the property if you pass an 
argument.

I'm happy to support a proposal to make this more obvious / have a 
better convention, including foregoing altogether immutable objects. 
Others may have different opinions though.

>
> you mean "Bio::SeqFeatureI implements get_SeqFeatures()" I think; but
> point taken. I have definitely been confused by something.
>
> the variety of method names for one thing  eg - sub_SeqFeature
>
> the fact that the same signature seems to be shared amongst multiple
> interfaces
>
> FeatureHolderI
>
> 	get_SeqFeatures
> 	get_all_SeqFeatures
>
> SeqI   (which ISA FeatureHolderI)

I suggested to make SeqI a feature holder because the whole point of 
SeqI over PrimarySeqI is to add features and annotation bundles. I.e., 
SeqIs that don't permit features to be added doesn't make sense to me.

>
> 	get_SeqFeatures
> 	get_all_SeqFeatures
>

get_all_SeqFeatures is the feature tree flattened out

> (are these copied and pasted from FeatureHolderI or are they the actual
> interface?)
>
> SeqFeatureI
>
> 	get_SeqFeatures
> 	(but no get_all_Seqfeatures)
>
> And nothing for modifying the list of 'sub' SeqFeatures
>

see above. Please propose a new convention that you think makes better 
sense for how to include or not include mutability into the contracts. 
The present one isn't good I agree.

	-hilmar

> I was also confusing myself by looking at:
>
> CollectionI
>
> 	add_features
> 	features
>
> So I retract, the contracts are not wrong. It's just it drives me 
> insane
> trying to read them.
>
> There is still the one outstanding question of adding seq features
>
>> sub_SeqFeature() must die!
>>
>> Lincoln
>>
>>
>
> _______________________________________________
> 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