[ensembl-dev] Bug in BioMart::Dataset::GenomicSequence

Youens-Clark, Ken kclark at cshl.edu
Wed Mar 7 22:43:51 GMT 2012


There's a problem with BioMart::Dataset::GenomicSequence.  It's trying to substr beyond the length of the string. I've added a simple check like so that seems to fix it, but probably some more checking needs to be added.  For instance, on Gramene.org, I'm getting a $seq_edits of '104.489' which doesn't seem at all like what the code is expecting.

[brie@/usr/local/ensembl-live/biomart-perl/lib/BioMart/Dataset]$ diff -c GenomicSequence.pm.orig GenomicSequence.pm
*** GenomicSequence.pm.orig     Wed Mar  7 17:39:11 2012
--- GenomicSequence.pm  Wed Mar  7 17:37:55 2012
***************
*** 355,361 ****
                foreach my $seq_edit (split /\;/, $seq_edits) {
                        my ($start, $end, $alt_seq) = split /\,/, $seq_edit;
                        my $len = $end - $start + 1;
!           substr($$seqref, $start - 1, $len) = $alt_seq;
                }
        }
  
--- 355,363 ----
                foreach my $seq_edit (split /\;/, $seq_edits) {
                        my ($start, $end, $alt_seq) = split /\,/, $seq_edit;
                        my $len = $end - $start + 1;
!             if ( $start < length($$seqref) ) {
!                       substr($$seqref, $start - 1, $len) = $alt_seq;
!             }
                }
        }

--
Ken Youens-Clark
kclark at cshl.edu
Ware Lab/CSHL/USDA-ARS





More information about the Dev mailing list