[Bioperl-l] Bug in Bio::SeqFeature::Annotated ?

Emmanuel QUEVILLON horkko at gmail.com
Tue Aug 2 10:11:08 EDT 2005


Dears,

I tried to play with BioPerl to produce GFF3 output files. It works alright 
when I use Bio::SeqFeature::Generic and Bio::Tools::GFF but was more complex 
and longer when I tried to use Bio::SeqFeature::Annotated and 
Bio::FeatureIO.
Actually there are two problems with Bio::SeqFeature::Annotated

1) A bug in the '_initialize' method:


sub _initialize {
my ($self, at args) = @_;
my (
$start, $end, $strand, $frame, $phase, $score,
$name, $id, $annot, $location, <=== here $id shouldn't be here
$display_name, #deprecate
$seq_id, $type,$source
) =
$self->_rearrange([qw(START
END
STRAND
FRAME
PHASE
SCORE
NAME
ANNOTATION
LOCATION
DISPLAY_NAME
SEQ_ID
TYPE
SOURCE
)], @args);

defined $start && $self->start($start);
defined $end && $self->end($end);
defined $strand && $self->strand($strand);
defined $frame && $self->frame($frame);
defined $phase && $self->phase($phase);
defined $score && $self->score($score);
defined $source && $self->source($source);
defined $type && $self->type($type);
defined $location && $self->location($location);
defined $annot && $self->annotation($annot);

$id causes a shift in the values when they are rearranged. Then, for 
example, $id = (value of $annot) and $annot = (value of $location) and so 
on.

So it would be nice if it could be corrected (removed). This bug is still in 
the BioPerl live.

2) It is not possible to set a correct type when you create you 
Bio::SeqFeature::Annotated object. Actually it is correctly set when the 
object is created, but when you pass this object to 
Bio::FeatureIO::write_feature, suddenly the value is undefined and the gff3 
output contains the default value which is 'region'. I tried to debug this 
problem but I did not find a way to solve it. Maybe I miss some knowledges 
about Perl! ?

3) Also it could be nice it a test could be done on the presence or not of 
an annot object. If you follow the structure of the _initialize method 
below, you can see that start, end, frame, phase. source etc.. are set 
before the call of sub annotation. When these subroutines are called, a 
Bio::Annotation::Collection is created and set in memory. Then when 
annotation sub is called, this previous Collection object is overwriten with 
$annot. So the idea would be to install a test to throw or warn an error to 
the user for example when a Collection object is passed to the new method to 
avoid the overwriten.

that's all :). I hope these remarks will be usefull. If not, sorry to bother 
the list.

Regards

Emmanuel

-- 
Emmanuel Quevillon
email: horkko at gmail.com <http://gmail.com>
blog: http://horkko.blogspot.com



More information about the Bioperl-l mailing list