Bio::Map
OrderedPositionWithDistance
Toolbar
Summary
Bio::Map::OrderedPositionWithDistance - 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.
Included modules
Inherit
Synopsis
use Bio::Map::OrderedPositionWithDistance;
# the first marker in the sequence
my $position = new Bio::Map::OrderedPositionWithDistance(-positions => 1,
-distance => 22.3 );
# the second marker in the sequence, 15.6 units from the fist one
my $position2 = new Bio::Map::OrderedPositionWithDistance(-positions => 2,
-distance => 15.6 );
# the third marker in the sequence, coincidental with the second
# marker
my $position3 = new Bio::Map::OrderedPositionWithDistance(-positions => 3,
-distance => 0 );
Description
This object is an implementation of the PositionI interface and the
Position object handles the specific values of a position.
OrderedPositionWithDistance 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
Mapmaker.pm.
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
Methods description
Title : distance($new_distance) Usage : $position->distance(new_distance) _or_ $position->distance() Function: get/set the distance of this position from the previous marker Returns : A scalar representing the current distance for this position. Args : If $new_distance is provided the distance of this Position will be set to $new_distance |
Title : new Usage : my $obj = new Bio::Map::OrderedPositionWithDistance(); Function: Builds a new Bio::Map::OrderedPositionWithDistance object Returns : Bio::Map::OrderedPositionWithDistance Args : -positions - Should be a single value representing the order of this marker within the list of markers -distance - The distance this marker is from the marker before it. 0 reflects coincidentality. |
Methods code
sub distance
{ my ($self,$distance) = @_;
if ($distance) {
$self->{'_distance'} = $distance;
}
return $self->{'_distance'};
}
1; } |
sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->{'_positions'} = [];
my ($positions,$distance) = $self->_rearrange([qw(POSITIONS DISTANCE)], @args);
if( ref($positions) =~ /array/i ) {
foreach my $p ( @$positions ) {
$self->add_position($p);
}
} else {
$self->add_position($positions);
}
$distance && $self->distance($distance);
return $self; } |
General documentation
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.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
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
email or the web:
bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
AUTHOR - Chad Matsalla | Top |
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _