Bio::Map OrderedPosition
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Bio::Map::OrderedPosition - Abstracts the notion of a member
of an ordered list of markers. Each marker is a certain distance
from the one in the ordered list before it.
Package variables
No package variables defined.
    use Bio::Map::OrderedPosition;
# the first marker in the sequence
my $position = Bio::Map::OrderedPosition->new(-order => 1,
-positions => [ [ $map, 22.3] ] );
# the second marker in the sequence, 15.6 units from the fist one
my $position2 = Bio::Map::OrderedPosition->new(-order => 2,
-positions => [ [ $map, 37.9] ] );
# the third marker in the sequence, coincidental with the second
# marker
my $position3 = Bio::Map::OrderedPosition->new(-order => 3,
-posititions => [ [ $map, 37.9]] );
This object is an implementation of the PositionI interface and the
Position object handles the specific values of a position.
OrderedPosition is intended to be slightly more specific then Position
but only specific enough for a parser from the MarkerIO subsystem to
create and then pass to a client application to bless into the proper
type. For an example of how this is intended to work, see the
No units are assumed here - units are handled by context of which Map
a position is placed in.
Se Bio::Map::Position for additional information.
Methods description
newcode    nextTop
 Title   : new
Usage : my $obj = Bio::Map::OrderedPosition->new();
Function: Builds a new Bio::Map::OrderedPosition object
Returns : Bio::Map::OrderedPosition
Args : -order : The order of this position
 Title   : order
Usage : $o_position->order($new_order);
my $order = $o_position->order();
Function: Get/set the order position of this position in a map.
Returns : int, the order of this position
Args : none to get, OR int to set
 Title   : sortable
Usage : my $num = $position->sortable();
Function: Read-only method that is guaranteed to return a value suitable
for correctly sorting this kind of position amongst other positions
of the same kind on the same map. Note that sorting different kinds
of position together is unlikely to give sane results.
Returns : numeric
Args : none
 Title   : equals
Usage : if ($mappable->equals($mapable2)) {...}
Function: Test if a position is equal to another position.
Returns : boolean
Args : Bio::Map::PositionI
 Title   : less_than
Usage : if ($mappable->less_than($m2)) {...}
Function: Tests if a position is less than another position
It is assumed that 2 positions are in the same map.
Returns : boolean
Args : Bio::Map::PositionI
 Title   : greater_than
Usage : if ($mappable->greater_than($m2)) {...}
Function: Tests if position is greater than another position.
It is assumed that 2 positions are in the same map.
Returns : boolean
Args : Bio::Map::PositionI
Methods code
sub new {
    my($class,@args) = @_;
    my $self = $class->SUPER::new(@args);
    my ($order) = $self->_rearrange([qw(ORDER)], @args);
    $order && $self->order($order);
    return $self;
sub order {
    my ($self, $order) = @_;
    if ($order) {
        $self->{'_order'} = $order;
    return $self->{'_order'} || return;
sub sortable {
    my $self = shift;
    return $self->order;
sub equals {
   my ($self,$compare) = @_;
   return 0 if (! defined $compare || ! $compare->isa('Bio::Map::OrderedPosition'));
   return ($compare->order == $self->order);

# admittedly these aren't really the best comparisons in the world
# but it is a first pass we'll need to refine the algorithm or not
# provide general comparisions and require these to be implemented
# by objects closer to the specific type of data
sub less_than {
   my ($self,$compare) = @_;
   return 0 if (! defined $compare || ! $compare->isa('Bio::Map::OrderedPosition'));
   return ($compare->order < $self->order);
sub greater_than {
   my ($self,$compare) = @_;
   return 0 if (! defined $compare || ! $compare->isa('Bio::Map::OrderedPosition'));
   return ($compare->order > $self->order);

General documentation
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.                  - General discussion - About the mailing lists
Support Top
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
AUTHOR - Chad MatsallaTop
Lincoln Stein,
Heikki Lehvaslaiho, heikki-at-bioperl-dot-org
Jason Stajich,
Sendu Bala,
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _