[Bioperl-l] Bio::SeqFeature::Annotated too much varaibles

Emmanuel Quevillon equevill at infobiogen.fr
Mon Nov 7 04:45:48 EST 2005


Hi,

I already sent this small bug few months ago but nobody answered me nor 
corrected the bug.
I get the bioperl-live on friday and checked Bio::SeqFeature::Annotated 
module.
The problem still remains uncorrected in '_initialize' subroutine :

...

  *my* *(*
      $start, $end, $strand, $frame, $phase, $score,
      $name, $id, $annot, $location,                 <========= $id should not be here, it shift all the followin values (check below)
      $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*)*;

...

I wrote a simple test to illustrate it :

#!/usr/local/bin/perl -w

use lib '/home/tuco/tmp/src/bioperl-live/';
use Bio::SeqFeature::Annotated;

$sfa = Bio::SeqFeature::Annotated->new(
                       -start => 1,
                       -end => 5,
                       -strand => "+",
                       -frame => 2,
                       -phase => 2,
                       -score => 12,
                       -display_name => 'test.annot',
                       -seq_id => 'test.displayname'
                      );

print "Name:",$sfa->name, " \nAnnotation:", $sfa->annotation(), " 
\nLOC:", $sfa->location(), "\nSeq_ID:", $sfa->seq_id(), "\n";


Here is the results with the cvs module :

tuco at euphorbe SeqFeature>perl ~/test.pl

------------- EXCEPTION  -------------
MSG: object test.annot pretends to be a location but does not implement 
Bio::LocationI
STACK Bio::SeqFeature::Annotated::location 
/home/tuco/tmp/src/bioperl-live//Bio/SeqFeature/Annotated.pm:792
STACK Bio::SeqFeature::Annotated::_initialize 
/home/tuco/tmp/src/bioperl-live//Bio/SeqFeature/Annotated.pm:152
STACK Bio::SeqFeature::Annotated::new 
/home/tuco/tmp/src/bioperl-live//Bio/SeqFeature/Annotated.pm:117
STACK toplevel /home/tuco/test.pl:6

--------------------------------------
tuco at euphorbe SeqFeature>

Where you can see I did not set any location.

If I remove '$id' from _initialize :

tuco at euphorbe SeqFeature>perl ~/test.pl
Name:                                                                                         
<============ another problem (below)
Annotation:Bio::Annotation::Collection=HASH(0x81910a0)
LOC:Bio::Location::Simple=HASH(0x8168b14)
Seq_ID:test.displayname
tuco at euphorbe SeqFeature>

No problems.

Another problem is when the name is set, :

*defined* $name         && $self->name*(*$name || $display_name*)*;

How can the name be set if only $name is tested? 
Maybe would be better if this line was  : 

*defined* ($name || $display_name)         && $self->name*(*$name || $display_name*)*;


In this case :

tuco at euphorbe SeqFeature>perl ~/test.pl
Name:test.annot
Annotation:Bio::Annotation::Collection=HASH(0x8190fa4)
LOC:Bio::Location::Simple=HASH(0x8168aa0)
Seq_ID:test.displayname
tuco at euphorbe SeqFeature>

The name is correctly set by using -name or -display_name . Maybe a 
warning might be thrown when -dsiaply_name is used to force user to use 
-name?

Sorry to bother you with that.

Please could you correct this?

Thanks

Regards

Emmanuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: equevill.vcf
Type: text/x-vcard
Size: 322 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/bioperl-l/attachments/20051107/5e6b1579/equevill.vcf


More information about the Bioperl-l mailing list