File Coverage

Bio/Map/CytoMarker.pm
Criterion Covered Total %
statement 21 21 100.0
branch 5 10 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 2 2 100.0
total 34 41 82.9


line stmt bran cond sub pod time code
1             #
2             # BioPerl module for Bio::Map::CytoMarker
3             #
4             # Please direct questions and support issues to
5             #
6             # Cared for by Sendu Bala
7             #
8             # Copyright Heikki Lehvaslaiho
9             #
10             # You may distribute this module under the same terms as perl itself
11              
12             # POD documentation - main docs before the code
13              
14             =head1 NAME
15              
16             Bio::Map::CytoMarker - An object representing a marker.
17              
18             =head1 SYNOPSIS
19              
20             $o_usat = Bio::Map::CytoMarker->new(-name=>'Chad Super Marker 2',
21             -position => $pos);
22              
23             =head1 DESCRIPTION
24              
25             This object handles markers with a positon in a cytogenetic map known.
26             This marker will have a name and a position.
27              
28             =head1 FEEDBACK
29              
30             =head2 Mailing Lists
31              
32             User feedback is an integral part of the evolution of this and other
33             Bioperl modules. Send your comments and suggestions preferably to the
34             Bioperl mailing list. Your participation is much appreciated.
35              
36             bioperl-l@bioperl.org - General discussion
37             http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38              
39             =head2 Support
40              
41             Please direct usage questions or support issues to the mailing list:
42              
43             I
44              
45             rather than to the module maintainer directly. Many experienced and
46             reponsive experts will be able look at the problem and quickly
47             address it. Please include a thorough description of the problem
48             with code and data examples if at all possible.
49              
50             =head2 Reporting Bugs
51              
52             Report bugs to the Bioperl bug tracking system to help us keep track
53             of the bugs and their resolution. Bug reports can be submitted via the
54             web:
55              
56             https://github.com/bioperl/bioperl-live/issues
57              
58             =head1 AUTHOR - Heikki Lehvaslaiho
59              
60             Email heikki-at-bioperl-dot-org
61              
62             =head1 CONTRIBUTORS
63              
64             Chad Matsalla bioinformatics1@dieselwurks.com
65             Lincoln Stein lstein@cshl.org
66             Jason Stajich jason@bioperl.org
67             Sendu Bala bix@sendu.me.uk
68              
69             =head1 APPENDIX
70              
71             The rest of the documentation details each of the object methods.
72             Internal methods are usually preceded with a _
73              
74             =cut
75              
76             # Let the code begin...
77              
78             package Bio::Map::CytoMarker;
79 1     1   1108 use strict;
  1         2  
  1         30  
80 1     1   6 use Bio::Map::CytoPosition;
  1         1  
  1         32  
81              
82 1     1   5 use base qw(Bio::Map::Marker);
  1         1  
  1         312  
83              
84              
85             =head2 Bio::Map::MarkerI methods
86              
87             =cut
88              
89             =head2 get_position_object
90              
91             Title : get_position_class
92             Usage : my $position = $marker->get_position_object();
93             Function: To get an object of the default Position class
94             for this Marker. Subclasses should redefine this method.
95             The Position returned needs to be a L with
96             -element set to self.
97             Returns : L
98             Args : none for an 'empty' PositionI object, optionally
99             Bio::Map::MapI and value string to set the Position's -map and -value
100             attributes.
101              
102             =cut
103              
104             sub get_position_object {
105 4     4 1 8 my ($self, $map, $value) = @_;
106 4   33     9 $map ||= $self->default_map;
107 4 50       8 if ($value) {
108 4 50       13 $self->throw("Value better be scalar, not [$value]") unless ref($value) eq '';
109             }
110            
111 4         18 my $pos = Bio::Map::CytoPosition->new();
112 4 50       27 $pos->map($map) if $map;
113 4 50       17 $pos->value($value) if $value;
114 4         20 $pos->element($self);
115 4         13 return $pos;
116             }
117              
118              
119             =head2 Comparison methods
120              
121             The numeric values for cutogeneic loctions go from the p tip of
122             chromosome 1, down to the q tip and similarly throgh consecutive
123             chromosomes, through X and end the the q tip of X. See
124             L for more details.
125              
126             =cut
127              
128             =head2 New methods
129              
130             =cut
131              
132             =head2 get_chr
133              
134             Title : get_chr
135             Usage : my $mychr = $marker->get_chr();
136             Function: Read only method for the chromosome string of the location.
137             A shortcut to $marker->position->chr().
138             Returns : chromosome value
139             Args : [optional] new chromosome value
140              
141             =cut
142              
143             sub get_chr {
144 1     1 1 2 my ($self) = @_;
145 1 50       5 return unless $self->position;
146 1         5 return $self->position->chr;
147             }
148              
149             1;
150