NAME

Bio::LocatableSeq - A Sequence object with start/end points on it that can be projected into a MSA or have coordinates relative to another seq.

SYNOPSIS

    use Bio::LocatableSeq;
    my $seq = new Bio::LocatableSeq(-seq => "CAGT-GGT",
				    -id  => "seq1",
				    -start => 1,
				    -end   => 7);

DESCRIPTION

# a normal sequence object
$locseq->seq();
$locseq->id();

# has start,end points
$locseq->start();
$locseq->end();

# inheriets off RangeI, so range operations possible

FEEDBACK

Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

bioperl-l@bioperl.org          - General discussion
http://bio.perl.org/MailList.html             - About the mailing lists

The locatable sequence object was developed mainly because the SimpleAlign object requires this functionality, and in the rewrite of the Sequence object we had to decide what to do with this.

It is, to be honest, not well integrated with the rest of bioperl, for example, the trunc() function does not return a LocatableSeq object, as some might have thought. There are all sorts of nasty gotcha's about interactions between coordinate systems when these sort of objects are used.

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:

bioperl-bugs@bio.perl.org
http://bio.perl.org/bioperl-bugs/

APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

start

Title   : start
Usage   : $obj->start($newval)
Function: 
Returns : value of start
Args    : newvalue (optional)

end

Title   : end
Usage   : $obj->end($newval)
Function: 
Returns : value of end
Args    : newvalue (optional)

strand

Title   : strand
Usage   : $obj->strand($newval)
Function: 
Returns : value of strand
Args    : newvalue (optional)

get_nse

Title   : get_nse
Usage   :
Function: read-only name of form id/start-end 
Example :
Returns : 
Args    :

no_gaps

Title   : no_gaps
Usage   :$self->no_gaps('.')
Function: 

          Gets number of gaps in the sequence. The count excludes
          leading or trailing gap characters.

          Valid bioperl sequence characters are [A-Za-z\-\.\*]. Of
          these, '.' and '-' are counted as gap characters unless an
          optional argument specifies one of them. 

Returns : number of internal gaps in the sequnce. 
Args    : a gap character (optional)

column_from_residue_number

Title   : column_from_residue_number
Usage   : $col = $seq->column_from_residue_number($resnumber)
Function:

          This function gives the position in the alignment
          (i.e. column number) of the given residue number in the
          sequence. For example, for the sequence

 	     Seq1/91-97 AC..DEF.GH

          column_from_residue_number(94) returns 5.

          An exception is thrown if the residue number would lie
          outside the length of the aligment
          (e.g. column_from_residue_number( "Seq2", 22 )

Returns : A column number for the position of the
          given residue in the given sequence (1 = first column)
Args    : A residue number in the whole sequence (not just that
          segment of it in the alignment)

location_from_column

Title   : location_from_column
Usage   : $loc = $ali->location_from_column( $seq_number, $column_number)
Function:

          This function gives the residue number in the sequence with
          the given name for a given position in the alignment
          (i.e. column number) of the given. Gaps complicate this
          process and force the output to be a L<Bio::Range> where
          values can be undefined. For example, for the alignment

 	     Seq1/91-97 AC..DEF.G.
 	     Seq2/1-9   .CYHDEFKGK

          location_from_column( Seq1/91-97, 3 ) position 93
          location_from_column( Seq1/91-97, 2 ) position 92^93
          location_from_column( Seq1/91-97, 10) position 97^98
          location_from_column( Seq2/1-9, 1 )   position undef

          An exact position returns a Bio::Location::Simple
          object, a position between bases returns a
          Bio::Location::Fuzzy object where location_type() returns
          'BETWEEN'. Column before the first residue returns
          undef. Note that if the position is after the last residue
          in the alignment, that there is no guarantee that the
          original sequence has residues after that position.

          An exception is thrown if the column number is not within
          the sequence.

Returns : Bio::Location::Simple or Bio::Location::Fuzzy object or
          undef
Args    : A column number
Throws  : If column is not within the sequence

See Bio::Location::Simple, Bio::Location::Fuzzy for more.