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

Chris Fields cjfields at illinois.edu
Thu Oct 16 21:28:57 EDT 2008


Michael,

You can easily remove the -end call as the end will be calculated from  
the start position and the number of residues (non-gap positions),  
though it may be a good idea to initially test passing it in to make  
sure the gaps are being called correctly.

The LocatableSeq bug in question wasn't explicitly checking for a  
miscalculated end even though it appeared to, so it was particularly  
nasty as several modules were either passing in the wrong -end or the  
gap symbols were not correctly set (so LocatableSeq incorrectly  
checked the ends).  There are still a few issues to work out.   
Primarily, we need a workaround for LocatableSeqs derived from HSPs  
where the sequences are translated, so we need to either bypass the  
end point check or work in a tuple when calculating the end.

chris

On Oct 15, 2008, at 12:55 PM, Michael Kiwala wrote:

> I'd like to add Bio::Assembly::IO::ace to the list of affected
> parsers.  I've been off the list for a while, so I know I'm just
> jumping right in the middle of something, and it's probably bigger
> than I know.  But I'd like to help out anyway. :)
>
> I need some background on LocatableSeq in order to understand the
> problem.  Is it not redundant to pass -start, -end, and -seq?  Seems
> like normally you would only need -start or -end plus the -seq, right?
> Does anyone see a problem with just removing the -end argument to
> Bio::LocatableSeq->new() calls in B:A:IO:ace since the -start and -seq
> are already being provided?
>
> Thanks,
> Michael
>
>
>> On Mon Sep 15 00:13:57 EDT 2008 Chris Fields wrote:
>>
>> 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
>
>
> --
> I saved latin.  What did you ever do?
>   -Max Fischer
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Marie-Claude Hofmann
College of Veterinary Medicine
University of Illinois Urbana-Champaign






More information about the Bioperl-l mailing list