bug 2549; fixed small bug in Bio::Taxon which doesn't catch -common_name
[bioperl-live.git] / Bio / Map / CytoMap.pm
blobd3cfed2a234af1d6a4e49951f6d1331dcce261f1
1 # $Id$
3 # BioPerl module for Bio::Map::CytoMap
5 # Cared for by Sendu Bala <bix@sendu.me.uk>
7 # Copyright Heikki Lehvaslaiho
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Map::CytoMap - A Bio::MapI compliant map implementation handling cytogenic bands
17 =head1 SYNOPSIS
19 use Bio::Map::CytoMap;
20 my $map = Bio::Map::CytoMap->new(-name => 'human1',
21 -species => $human);
22 foreach my $marker ( @markers ) { # get a list of markers somewhere
23 $map->add_element($marker);
26 =head1 DESCRIPTION
28 This is the simple implementation of cytogenetic maps based on
29 L<Bio::Map::MapI>. It handles the essential storage of name, species,
30 type, and units as well as in memory representation of the elements of
31 a map.
33 For CytoMaps type is hard coded to be 'cytogeneticmap' and
34 units are set to '' but can be set to something else.
36 =head1 FEEDBACK
38 =head2 Mailing Lists
40 User feedback is an integral part of the evolution of this and other
41 Bioperl modules. Send your comments and suggestions preferably to
42 the Bioperl mailing list. Your participation is much appreciated.
44 bioperl-l@bioperl.org - General discussion
45 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
47 =head2 Reporting Bugs
49 Report bugs to the Bioperl bug tracking system to help us keep track
50 of the bugs and their resolution. Bug reports can be submitted via the
51 web:
53 http://bugzilla.open-bio.org/
55 =head1 AUTHOR - Heikki Lehvaslaiho
57 Email heikki-at-bioperl-dot-org
59 =head1 CONTRIBUTORS
61 Jason Stajich jason@bioperl.org
62 Lincoln Stein lstein@cshl.org
63 Sendu Bala bix@sendu.me.uk
65 =head1 APPENDIX
67 The rest of the documentation details each of the object methods.
68 Internal methods are usually preceded with a _
70 =cut
72 package Bio::Map::CytoMap;
73 use vars qw($MAPCOUNT);
74 use strict;
77 use base qw(Bio::Map::SimpleMap);
78 BEGIN { $MAPCOUNT = 1; }
80 =head2 new
82 Title : new
83 Usage : my $obj = Bio::Map::CytoMap->new();
84 Function: Builds a new Bio::Map::CytoMap object
85 Returns : Bio::Map::CytoMap
86 Args : -name => name of map (string)
87 -species => species for this map (Bio::Species) [optional]
88 -elements=> elements to initialize with
89 (arrayref of Bio::Map::MappableI objects) [optional]
91 -uid => Unique Id
93 =cut
95 sub new {
96 my ($class, @args) = @_;
98 my $self = $class->SUPER::new(@args);
100 $self->{'_uid'} = $MAPCOUNT++;
101 my ($uid) = $self->_rearrange([qw(UID)], @args);
102 defined $uid && $self->unique_id($uid);
104 return $self;
107 =head2 type
109 Title : type
110 Usage : my $type = $map->type
111 Function: Get hard-coded Map type
112 Returns : String coding Map type (always 'cyto')
113 Args : none
115 =cut
117 sub type {
118 return 'cyto';
121 =head2 length
123 Title : length
124 Usage : my $length = $map->length();
125 Function: Retrieves the length of the map,
126 Returns : 0 since length is not calculatable for cytogenetic maps
127 Args : none
129 =cut
131 sub length {
132 return 0;