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

Florent Angly florent.angly at gmail.com
Mon Mar 5 02:39:08 EST 2012

Hi all,

I have just been burned by a problem with the Bio::Seq add_SeqFeature() 
method. Bio::Seq is a class which implements Bio::SeqI, which itselt 
implements Bio::FeatureHolderI, which defines an add_SeqFeature() method as:
>  Usage   : $feat->add_SeqFeature($subfeat);
>            $feat->add_SeqFeature($subfeat,'EXPAND')
>  Function: adds a SeqFeature into the subSeqFeature array.
>            with no 'EXPAND' qualifer, subfeat will be tested
>            as to whether it lies inside the parent, and throw
>            an exception if not.
>            If EXPAND is used, the parent''s start/end/strand will
>            be adjusted so that it grows to accommodate the new
>            subFeature
>  Example :
>  Returns : nothing
>  Args    : a Bio::SeqFeatureI object

In comparison, the add_SeqFeature method implemented by Bio::Seq is:
>  Title   : add_SeqFeature
>  Usage   : $seq->add_SeqFeature($feat);
>            $seq->add_SeqFeature(@feat);
>  Function: Adds the given feature object (or each of an array of feature
>            objects to the feature array of this
>            sequence. The object passed is required to implement the
>            Bio::SeqFeatureI interface.
>  Returns : 1 on success
>  Args    : A Bio::SeqFeatureI implementing object, or an array of such 
> objects.

As you can see, there is a discrepancy. While the Bio::Seq method takes 
an array of features, Bio::FeatureHolderI states that it should take a 
single feature and the optional 'EXPAND' scalar.

It would not be very hard to modify Bio::Seq so that it complies with 
Bio::FeatureHolderI. One would have to make sure that the Bio::Seq 
feature takes the 'EXPAND' option and to have a deprecation message for 
any call with more than one feature.

First, I am missing something here or does Bio::Seq need to comply with 
Then, if Bio::Seq needs to be changed, I wanted to have some feedback 
from other wise Bioperl-ers to see if the course of action I described 
is adapted.



More information about the Bioperl-l mailing list