Add tests for memory leaks and weaken for Issue #81
[bioperl-live.git] / Bio / Map / CytoMap.pm
blob2179bb9c780bd68f83b3f32987e1f41e3a467755
2 # BioPerl module for Bio::Map::CytoMap
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Sendu Bala <bix@sendu.me.uk>
8 # Copyright Heikki Lehvaslaiho
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Map::CytoMap - A Bio::MapI compliant map implementation handling cytogenic bands
18 =head1 SYNOPSIS
20 use Bio::Map::CytoMap;
21 my $map = Bio::Map::CytoMap->new(-name => 'human1',
22 -species => $human);
23 foreach my $marker ( @markers ) { # get a list of markers somewhere
24 $map->add_element($marker);
27 =head1 DESCRIPTION
29 This is the simple implementation of cytogenetic maps based on
30 L<Bio::Map::MapI>. It handles the essential storage of name, species,
31 type, and units as well as in memory representation of the elements of
32 a map.
34 For CytoMaps type is hard coded to be 'cytogeneticmap' and
35 units are set to '' but can be set to something else.
37 =head1 FEEDBACK
39 =head2 Mailing Lists
41 User feedback is an integral part of the evolution of this and other
42 Bioperl modules. Send your comments and suggestions preferably to
43 the Bioperl mailing list. Your participation is much appreciated.
45 bioperl-l@bioperl.org - General discussion
46 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 =head2 Support
50 Please direct usage questions or support issues to the mailing list:
52 I<bioperl-l@bioperl.org>
54 rather than to the module maintainer directly. Many experienced and
55 reponsive experts will be able look at the problem and quickly
56 address it. Please include a thorough description of the problem
57 with code and data examples if at all possible.
59 =head2 Reporting Bugs
61 Report bugs to the Bioperl bug tracking system to help us keep track
62 of the bugs and their resolution. Bug reports can be submitted via the
63 web:
65 https://github.com/bioperl/bioperl-live/issues
67 =head1 AUTHOR - Heikki Lehvaslaiho
69 Email heikki-at-bioperl-dot-org
71 =head1 CONTRIBUTORS
73 Jason Stajich jason@bioperl.org
74 Lincoln Stein lstein@cshl.org
75 Sendu Bala bix@sendu.me.uk
77 =head1 APPENDIX
79 The rest of the documentation details each of the object methods.
80 Internal methods are usually preceded with a _
82 =cut
84 package Bio::Map::CytoMap;
85 use vars qw($MAPCOUNT);
86 use strict;
89 use base qw(Bio::Map::SimpleMap);
90 BEGIN { $MAPCOUNT = 1; }
92 =head2 new
94 Title : new
95 Usage : my $obj = Bio::Map::CytoMap->new();
96 Function: Builds a new Bio::Map::CytoMap object
97 Returns : Bio::Map::CytoMap
98 Args : -name => name of map (string)
99 -species => species for this map (Bio::Species) [optional]
100 -elements=> elements to initialize with
101 (arrayref of Bio::Map::MappableI objects) [optional]
103 -uid => Unique Id
105 =cut
107 sub new {
108 my ($class, @args) = @_;
110 my $self = $class->SUPER::new(@args);
112 $self->{'_uid'} = $MAPCOUNT++;
113 my ($uid) = $self->_rearrange([qw(UID)], @args);
114 defined $uid && $self->unique_id($uid);
116 return $self;
119 =head2 type
121 Title : type
122 Usage : my $type = $map->type
123 Function: Get hard-coded Map type
124 Returns : String coding Map type (always 'cyto')
125 Args : none
127 =cut
129 sub type {
130 return 'cyto';
133 =head2 length
135 Title : length
136 Usage : my $length = $map->length();
137 Function: Retrieves the length of the map,
138 Returns : 0 since length is not calculatable for cytogenetic maps
139 Args : none
141 =cut
143 sub length {
144 return 0;