[Bioperl-l] LocatableSeq::subseq(): bug or not?

Chris Fields cjfields at illinois.edu
Mon Nov 24 00:31:17 UTC 2008


Currently, we have Bio::LocatableSeq use the default (Bio::PrimarySeq)  
implementation of subseq().  However the returned data apparently  
clashes with the actual PrimarySeq documentation:

  Function: returns the subseq from start to end, where the first base
            is 1 and the number is inclusive, ie 1-2 are the first two
            bases of the sequence

So, should the following actually return the indicated range of bases  
(no gaps)?  Or should we clarify the above documentation to indicate  
subseq() returns the first x positions/columns (anything) instead of  
'bases' (no gaps)?

my $seq = Bio::LocatableSeq->new(
    -seq => '--atg---gta--',
    -strand => 1,
    -start => 1,
    -end => 6,
    -alphabet => 'dna'
);

# comments indicate current returned val
$seq->subseq(1,3);  # returns '--a'
$seq->subseq(3,6);  # returns 'atg-'
$seq->subseq(1,10); # returns '--atg---gt'

chris



More information about the Bioperl-l mailing list