0
|
1 =head1 LICENSE
|
|
2
|
|
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and
|
|
4 Genome Research Limited. All rights reserved.
|
|
5
|
|
6 This software is distributed under a modified Apache license.
|
|
7 For license details, please see
|
|
8
|
|
9 http://www.ensembl.org/info/about/code_licence.html
|
|
10
|
|
11 =head1 CONTACT
|
|
12
|
|
13 Please email comments or questions to the public Ensembl
|
|
14 developers list at <dev@ensembl.org>.
|
|
15
|
|
16 Questions may also be sent to the Ensembl help desk at
|
|
17 <helpdesk@ensembl.org>.
|
|
18
|
|
19 =cut
|
|
20
|
|
21 =head1 NAME
|
|
22
|
|
23 Bio::EnsEMBL::Map::MapLocation
|
|
24
|
|
25 =head1 SYNOPSIS
|
|
26
|
|
27 =head1 DESCRIPTION
|
|
28
|
|
29 Represents a location on a genetic map, yac map, radition hybrid map,
|
|
30 etc.
|
|
31
|
|
32 =head1 METHODS
|
|
33
|
|
34 =cut
|
|
35
|
|
36
|
|
37 package Bio::EnsEMBL::Map::MapLocation;
|
|
38
|
|
39 use strict;
|
|
40 use vars qw(@ISA);
|
|
41
|
|
42 use Bio::EnsEMBL::Utils::Exception qw(deprecate);
|
|
43
|
|
44 =head2 new
|
|
45
|
|
46 Arg [1] : (optional) string $name
|
|
47 Arg [2] : (optional) string $map_name
|
|
48 Arg [3] : (optional) string $chromosome_name
|
|
49 Arg [4] : (optional) string $position
|
|
50 Arg [5] : (optional) float $lod_score
|
|
51 Example : $map_location = Bio::EnsEMBL::Map::MapLocation('DS1234',
|
|
52 'genethon',
|
|
53 'X',
|
|
54 '12.39',
|
|
55 50.12);
|
|
56 Description: Creates a new MapLocation
|
|
57 Returntype : Bio::EnsEMBL::Map::MapLocation
|
|
58 Exceptions : none
|
|
59 Caller : general
|
|
60 Status : stable
|
|
61
|
|
62 =cut
|
|
63
|
|
64 sub new {
|
|
65 my ($caller, $name, $map_name, $chromosome_name, $position, $lod_score) = @_;
|
|
66
|
|
67 my $class = ref($caller) || $caller;
|
|
68
|
|
69 return bless( {'map_name' => $map_name,
|
|
70 'name' => $name,
|
|
71 'chromosome_name' => $chromosome_name,
|
|
72 'position' => $position,
|
|
73 'lod_score' => $lod_score}, $class );
|
|
74 }
|
|
75
|
|
76
|
|
77
|
|
78 =head2 map_name
|
|
79
|
|
80 Arg [1] : string $map_name
|
|
81 Example : $map_name = $map_location->map_name;
|
|
82 Description: Getter/Setter for the map name
|
|
83 Returntype : string
|
|
84 Exceptions : none
|
|
85 Caller : general
|
|
86 Status : stable
|
|
87
|
|
88 =cut
|
|
89
|
|
90 sub map_name {
|
|
91 my $self = shift;
|
|
92 $self->{'map_name'} = shift if(@_);
|
|
93 return $self->{'map_name'};
|
|
94 }
|
|
95
|
|
96
|
|
97
|
|
98 =head2 name
|
|
99
|
|
100 Arg [1] : (optional) string $name
|
|
101 Example : $name = $map_location->name;
|
|
102 Description: A name associated with the marker at this position. For
|
|
103 example if this is a genethon map location the name will be
|
|
104 the synonym of source genethon.
|
|
105 Returntype : string
|
|
106 Exceptions : none
|
|
107 Caller : general
|
|
108 Status : stable
|
|
109
|
|
110 =cut
|
|
111
|
|
112 sub name {
|
|
113 my $self = shift;
|
|
114 $self->{'name'} = shift if(@_);
|
|
115 return $self->{'name'};
|
|
116 }
|
|
117
|
|
118
|
|
119 =head2 chromosome_name
|
|
120
|
|
121 Arg [1] : (optional) string $chromosome_name
|
|
122 Example : $chr_name = $map_location->chromosome_name;
|
|
123 $map_location->chromosome_name('X');
|
|
124 Description: The name of the chromosome associated with this map location
|
|
125 Returntype : string
|
|
126 Exceptions : none
|
|
127 Caller : general
|
|
128 Status : stable
|
|
129
|
|
130 =cut
|
|
131
|
|
132 sub chromosome_name{
|
|
133 my $self = shift;
|
|
134 $self->{'chromosome_name'} = shift if(@_);
|
|
135 return $self->{'chromosome_name'};
|
|
136 }
|
|
137
|
|
138
|
|
139
|
|
140 =head2 position
|
|
141
|
|
142 Arg [1] : (optional) string $position
|
|
143 Example : $pos = $map_location->position;
|
|
144 Description: Getter/Setter for the position of this map location
|
|
145 Returntype : string
|
|
146 Exceptions : none
|
|
147 Caller : general
|
|
148 Status : stable
|
|
149
|
|
150 =cut
|
|
151
|
|
152 sub position {
|
|
153 my $self = shift;
|
|
154 $self->{'position'} = shift if(@_);
|
|
155 return $self->{'position'};
|
|
156 }
|
|
157
|
|
158
|
|
159
|
|
160 =head2 lod_score
|
|
161
|
|
162 Arg [1] : (optional) float $lod
|
|
163 Example : $lod = $map_location->lod_score;
|
|
164 Description: Getter/Setter for lod score of this map location
|
|
165 Returntype : float
|
|
166 Exceptions : none
|
|
167 Caller : general
|
|
168 Status : stable
|
|
169
|
|
170 =cut
|
|
171
|
|
172 sub lod_score {
|
|
173 my $self = shift;
|
|
174 $self->{'lod_score'} = shift if(@_);
|
|
175 return $self->{'lod_score'};
|
|
176 }
|
|
177
|
|
178
|
|
179
|
|
180 =head2 chromosome
|
|
181
|
|
182 Description: DEPRECATED use chromosome_name() instead
|
|
183
|
|
184 =cut
|
|
185
|
|
186 sub chromosome {
|
|
187 my $self = shift;
|
|
188 deprecate('use chromosome_name instead');
|
|
189
|
|
190 if(@_) {
|
|
191 my $chr = shift;
|
|
192 if(ref($chr)) {
|
|
193 $self->chromosome_name($chr->seq_region_name());
|
|
194 } else {
|
|
195 $self->chromosome_name($chr);
|
|
196 }
|
|
197 }
|
|
198
|
|
199 #this object has no way to talk to db and thus no way to
|
|
200 #get a chromosome object
|
|
201 return $self->chromosome_name();
|
|
202 }
|
|
203
|
|
204
|
|
205
|
|
206
|
|
207 1;
|