[Bioperl-l] Compliance of Bio::Seq add_SeqFeature() method

Fields, Christopher J cjfields at illinois.edu
Sun Mar 4 21:13:38 EST 2012

On Mar 4, 2012, at 3:44 PM, Hilmar Lapp wrote:

> On Mar 4, 2012, at 3:30 PM, Fields, Christopher J wrote:
>> Dealing with the additional optional 'EXPAND' Is kind of a pain
> I know, but if we don't want it required we should take it out of the interface.
> 	-hilmar

Actually, I misread Florent's original post, I was thinking that FeatureHolderI was the outlier here, but it is Bio::Seq.  Yes, I think Bio::Seq is abusing the FeatureHolderI interface, it should just be for a single feature (it can safely ignore the 'EXPAND' option).  However, use of 'EXPAND' assumes the FeatureHolderI is also a Bio::RangeI (must have a start and end to expand), something that is not mentioned in the interface as a requirement and is not guaranteed, for instance Bio::Seq is not Bio::RangeI.  

So I think the FeatureHolderI interface is really too specific in this case, and the RangeI-specific requirements (e.g. for 'EXPAND') should be relaxed or completely removed as Hilmar indicates.  Implementations can freely go above and beyond what the interface requires.  I think we do need some alternative method in FeatureHolderI for safely adding multiple features in one go, this could simply use the plural, e.g. add_SeqFeatures(). 

Re: Bio::Seq::add_SeqFeature as currently implemented, this behavior has been around for a long, long time. 'git blame' has Ewan adding this back in 2000, so I expect this to potentially break something even if it doesn't show up in tests.  Doesn't mean we shouldn't fix it, just that we need to indicate the problem with it (maybe as easy as pointing to this thread), and suggest a possible alternative such as the way mentioned above. 


More information about the Bioperl-l mailing list