[Bioperl-l] significant bug with Bio::LocatableSeq

Chris Fields cjfields at illinois.edu
Mon Sep 15 04:13:57 UTC 2008


While debugging some tests in bioperl, I noticed a fairly significant  
issue with Bio::LocatableSeq which is probably due to some  
inconsistencies with start/end coordinates.  For some reason this  
started popping up with error messages recently when running AlignIO  
tests on bioperl-live (i.e. something changed which exposed the bug,  
maybe the verbosity level):

1..295
ok 1 - use Bio::AlignIO;
ok 2 - The object isa Bio::AlignIO
ok 3 - The object isa Bio::Align::AlignI
ok 4
ok 5
ok 6 - The object isa Bio::AlignIO

--------------------- WARNING ---------------------
MSG: In sequence 02 residue count gives end value 399.
Overriding value [355] with value 399 for Bio::LocatableSeq::end().
STACK Bio::LocatableSeq::end /Users/cjfields/bioperl/bioperl-live/blib/ 
lib/Bio/LocatableSeq.pm:150
STACK Bio::LocatableSeq::new /Users/cjfields/bioperl/bioperl-live/blib/ 
lib/Bio/LocatableSeq.pm:103
STACK Bio::AlignIO::arp::next_aln /Users/cjfields/bioperl/bioperl-live/ 
blib/lib/Bio/AlignIO/arp.pm:106
STACK toplevel t/AlignIO.t:34
---------------------------------------------------
.... followed by tons of similar errors.

The problem is, no change is ever made.  This is demonstrated by the  
following:

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

use strict;
use warnings;
use Bio::LocatableSeq;

my $seq = Bio::LocatableSeq->new(
     -id => 'foo',
     -seq => 'A----TGCGCTTCCTCGCTTCCG',
     -start => 10,
     -end => 100, # intentially bad
     -strand => -1);

print $seq->end."\n";

-----------------------------

Results:

--------------------- WARNING ---------------------
MSG: In sequence foo residue count gives end value 28.
Overriding value [100] with value 28 for Bio::LocatableSeq::end().
STACK Bio::LocatableSeq::end /Users/cjfields/bioperl/bioperl-live/Bio/ 
LocatableSeq.pm:150
STACK Bio::LocatableSeq::new /Users/cjfields/bioperl/bioperl-live/Bio/ 
LocatableSeq.pm:103
STACK toplevel seq.pl:7
---------------------------------------------------
100

The warning pops up when -end is passed to LocatableSeq::new and  
indicates that the passed coordinate doesn't match up with the one  
calculated from the sequence (minus gaps).  I've isolated the bug down  
to the end() method and am working on fixing it.  Note that this  
affects LocatableSeq::length as well.  This appears to affect arp,  
nexus, stockholm, and a few other AlignIO parsers as well.

chris



More information about the Bioperl-l mailing list