The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

# $Id: CytoMarker.pm,v 1.12.4.1 2006/10/02 23:10:21 sendu Exp $
#
# BioPerl module for Bio::Map::CytoMarker
#
# Cared for by Sendu Bala <bix@sendu.me.uk>
#
# Copyright Heikki Lehvaslaiho
#
# You may distribute this module under the same terms as perl itself
# POD documentation - main docs before the code
=head1 NAME
Bio::Map::CytoMarker - An object representing a marker.
=head1 SYNOPSIS
$o_usat = new Bio::Map::CytoMarker(-name=>'Chad Super Marker 2',
-position => $pos);
=head1 DESCRIPTION
This object handles markers with a positon in a cytogenetic map known.
This marker will have a name and a position.
=head1 FEEDBACK
=head2 Mailing Lists
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/wiki/Mailing_lists - About the mailing lists
=head2 Reporting Bugs
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
web:
=head1 AUTHOR - Heikki Lehvaslaiho
Email heikki-at-bioperl-dot-org
=head1 CONTRIBUTORS
Chad Matsalla bioinformatics1@dieselwurks.com
Lincoln Stein lstein@cshl.org
Jason Stajich jason@bioperl.org
Sendu Bala bix@sendu.me.uk
=head1 APPENDIX
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _
=cut
# Let the code begin...
use strict;
=head2 Bio::Map::MarkerI methods
=cut
=head2 get_position_object
Title : get_position_class
Usage : my $position = $marker->get_position_object();
Function: To get an object of the default Position class
for this Marker. Subclasses should redefine this method.
The Position returned needs to be a L<Bio::Map::PositionI> with
-element set to self.
Returns : L<Bio::Map::PositionI>
Args : none for an 'empty' PositionI object, optionally
Bio::Map::MapI and value string to set the Position's -map and -value
attributes.
=cut
sub get_position_object {
my ($self, $map, $value) = @_;
$map ||= $self->default_map;
if ($value) {
$self->throw("Value better be scalar, not [$value]") unless ref($value) eq '';
}
my $pos = new Bio::Map::CytoPosition();
$pos->map($map) if $map;
$pos->value($value) if $value;
$pos->element($self);
return $pos;
}
=head2 Comparison methods
The numeric values for cutogeneic loctions go from the p tip of
chromosome 1, down to the q tip and similarly throgh consecutive
chromosomes, through X and end the the q tip of X. See
L<Bio::Map::CytoPosition::cytorange> for more details.
=cut
=head2 New methods
=cut
=head2 get_chr
Title : get_chr
Usage : my $mychr = $marker->get_chr();
Function: Read only method for the chromosome string of the location.
A shortcut to $marker->position->chr().
Returns : chromosome value
Args : [optional] new chromosome value
=cut
sub get_chr {
my ($self) = @_;
return unless $self->position;
return $self->position->chr;
}
1;