line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Phenotype::Measure |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Christian M. Zmasek or |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002. |
9
|
|
|
|
|
|
|
# (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002. |
10
|
|
|
|
|
|
|
# |
11
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself. |
12
|
|
|
|
|
|
|
# Refer to the Perl Artistic License (see the license accompanying this |
13
|
|
|
|
|
|
|
# software package, or see http://www.perl.com/language/misc/Artistic.html) |
14
|
|
|
|
|
|
|
# for the terms under which you may use, modify, and redistribute this module. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
17
|
|
|
|
|
|
|
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
18
|
|
|
|
|
|
|
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
19
|
|
|
|
|
|
|
# |
20
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Bio::Phenotype::Measure - Representation of context/value(-range)/unit triplets |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 SYNOPSIS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
use Bio::Phenotype::Measure; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my $measure = Bio::Phenotype::Measure->new( -context => "length", |
33
|
|
|
|
|
|
|
-description => "reduced length in 4(Tas1r3)", |
34
|
|
|
|
|
|
|
-start => 0, |
35
|
|
|
|
|
|
|
-end => 15, |
36
|
|
|
|
|
|
|
-unit => "mm", |
37
|
|
|
|
|
|
|
-comment => "see also Miller et al" ); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
print $measure->context(); |
40
|
|
|
|
|
|
|
print $measure->description(); |
41
|
|
|
|
|
|
|
print $measure->start(); |
42
|
|
|
|
|
|
|
print $measure->end(); |
43
|
|
|
|
|
|
|
print $measure->unit(); |
44
|
|
|
|
|
|
|
print $measure->comment(); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
print $measure->to_string(); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Measure is for biochemically defined phenotypes or any other types of measures. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 FEEDBACK |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 Mailing Lists |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
57
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to one |
58
|
|
|
|
|
|
|
of the Bioperl mailing lists. Your participation is much appreciated. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
61
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 Support |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
I |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
70
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
71
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
72
|
|
|
|
|
|
|
with code and data examples if at all possible. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 Reporting Bugs |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
77
|
|
|
|
|
|
|
the bugs and their resolution. Bug reports can be submitted via the |
78
|
|
|
|
|
|
|
web: |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 AUTHOR |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Christian M. Zmasek |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Email: czmasek-at-burnham.org or cmzmasek@yahoo.com |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
WWW: http://monochrome-effect.net/ |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Address: |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Genomics Institute of the Novartis Research Foundation |
93
|
|
|
|
|
|
|
10675 John Jay Hopkins Drive |
94
|
|
|
|
|
|
|
San Diego, CA 92121 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 APPENDIX |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
The rest of the documentation details each of the object |
99
|
|
|
|
|
|
|
methods. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=cut |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# Let the code begin... |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
package Bio::Phenotype::Measure; |
107
|
4
|
|
|
4
|
|
471
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
118
|
|
108
|
|
|
|
|
|
|
|
109
|
4
|
|
|
4
|
|
20
|
use base qw(Bio::Root::Root); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
2073
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 new |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Title : new |
115
|
|
|
|
|
|
|
Usage : my $me = Bio::Phenotype::Measure->new( -context => "length", |
116
|
|
|
|
|
|
|
-description => "reduced length in 4(Tas1r3)", |
117
|
|
|
|
|
|
|
-start => 0, |
118
|
|
|
|
|
|
|
-end => 15, |
119
|
|
|
|
|
|
|
-unit => "mm", |
120
|
|
|
|
|
|
|
-comment => "see Miller also et al" ); |
121
|
|
|
|
|
|
|
Function: Creates a new Measure object. |
122
|
|
|
|
|
|
|
Returns : A new Measure object. |
123
|
|
|
|
|
|
|
Args : -context => the context |
124
|
|
|
|
|
|
|
-description => a description |
125
|
|
|
|
|
|
|
-start => the start value |
126
|
|
|
|
|
|
|
-end => the end value |
127
|
|
|
|
|
|
|
-unit => the unit |
128
|
|
|
|
|
|
|
-comment => a comment |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub new { |
133
|
5
|
|
|
5
|
1
|
173
|
my( $class, @args ) = @_; |
134
|
|
|
|
|
|
|
|
135
|
5
|
|
|
|
|
39
|
my $self = $class->SUPER::new( @args ); |
136
|
|
|
|
|
|
|
|
137
|
5
|
|
|
|
|
48
|
my ( $con, $desc, $start, $end, $unit, $comment ) |
138
|
|
|
|
|
|
|
= $self->_rearrange( [ qw( CONTEXT |
139
|
|
|
|
|
|
|
DESCRIPTION |
140
|
|
|
|
|
|
|
START |
141
|
|
|
|
|
|
|
END |
142
|
|
|
|
|
|
|
UNIT |
143
|
|
|
|
|
|
|
COMMENT ) ], @args ); |
144
|
|
|
|
|
|
|
|
145
|
5
|
|
|
|
|
22
|
$self->init(); |
146
|
|
|
|
|
|
|
|
147
|
5
|
100
|
|
|
|
11
|
$con && $self->context( $con ); |
148
|
5
|
100
|
|
|
|
12
|
$desc && $self->description( $desc ); |
149
|
5
|
100
|
|
|
|
14
|
$start && $self->start( $start ); |
150
|
5
|
100
|
|
|
|
10
|
$end && $self->end( $end ); |
151
|
5
|
100
|
|
|
|
12
|
$unit && $self->unit( $unit ); |
152
|
5
|
100
|
|
|
|
13
|
$comment && $self->comment( $comment ); |
153
|
|
|
|
|
|
|
|
154
|
5
|
|
|
|
|
13
|
return $self; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
} # new |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=head2 init |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Title : init() |
164
|
|
|
|
|
|
|
Usage : $measure->init(); |
165
|
|
|
|
|
|
|
Function: Initializes this Measure to all "". |
166
|
|
|
|
|
|
|
Returns : |
167
|
|
|
|
|
|
|
Args : |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=cut |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub init { |
172
|
6
|
|
|
6
|
1
|
15
|
my( $self ) = @_; |
173
|
|
|
|
|
|
|
|
174
|
6
|
|
|
|
|
32
|
$self->context( "" ); |
175
|
6
|
|
|
|
|
24
|
$self->description( "" ); |
176
|
6
|
|
|
|
|
14
|
$self->start( "" ); |
177
|
6
|
|
|
|
|
17
|
$self->end( "" ); |
178
|
6
|
|
|
|
|
22
|
$self->unit( "" ); |
179
|
6
|
|
|
|
|
16
|
$self->comment( "" ); |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
} # init |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 context |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Title : context |
189
|
|
|
|
|
|
|
Usage : $measure->context( "Ca-conc" ); |
190
|
|
|
|
|
|
|
or |
191
|
|
|
|
|
|
|
print $measure->context(); |
192
|
|
|
|
|
|
|
Function: Set/get for the context of this Measure. |
193
|
|
|
|
|
|
|
Returns : The context. |
194
|
|
|
|
|
|
|
Args : The context (optional). |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=cut |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub context { |
199
|
11
|
|
|
11
|
1
|
23
|
my ( $self, $value ) = @_; |
200
|
|
|
|
|
|
|
|
201
|
11
|
100
|
|
|
|
30
|
if ( defined $value ) { |
202
|
8
|
|
|
|
|
27
|
$self->{ "_context" } = $value; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
11
|
|
|
|
|
28
|
return $self->{ "_context" }; |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
} # context |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=head2 description |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
Title : description |
215
|
|
|
|
|
|
|
Usage : $measure->description( "reduced in 4(Tas1r3)" ); |
216
|
|
|
|
|
|
|
or |
217
|
|
|
|
|
|
|
print $measure->description(); |
218
|
|
|
|
|
|
|
Function: Set/get for the description of this Measure. |
219
|
|
|
|
|
|
|
Returns : A description. |
220
|
|
|
|
|
|
|
Args : A description (optional). |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=cut |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
sub description { |
225
|
15
|
|
|
15
|
1
|
1847
|
my ( $self, $value ) = @_; |
226
|
|
|
|
|
|
|
|
227
|
15
|
100
|
|
|
|
32
|
if ( defined $value ) { |
228
|
10
|
|
|
|
|
17
|
$self->{ "_description" } = $value; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
15
|
|
|
|
|
38
|
return $self->{ "_description" }; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
} # description |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=head2 start |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
Title : start |
241
|
|
|
|
|
|
|
Usage : $measure->start( 330 ); |
242
|
|
|
|
|
|
|
or |
243
|
|
|
|
|
|
|
print $measure->start(); |
244
|
|
|
|
|
|
|
Function: Set/get for the start value of this Measure. |
245
|
|
|
|
|
|
|
Returns : The start value. |
246
|
|
|
|
|
|
|
Args : The start value (optional). |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=cut |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub start { |
251
|
11
|
|
|
11
|
1
|
20
|
my ( $self, $value ) = @_; |
252
|
|
|
|
|
|
|
|
253
|
11
|
100
|
|
|
|
23
|
if ( defined $value ) { |
254
|
8
|
|
|
|
|
13
|
$self->{ "_start" } = $value; |
255
|
|
|
|
|
|
|
} |
256
|
|
|
|
|
|
|
|
257
|
11
|
|
|
|
|
26
|
return $self->{ "_start" }; |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
} # start |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=head2 end |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
Title : end |
267
|
|
|
|
|
|
|
Usage : $measure->end( 459 ); |
268
|
|
|
|
|
|
|
or |
269
|
|
|
|
|
|
|
print $measure->end(); |
270
|
|
|
|
|
|
|
Function: Set/get for the end value of this Measure. |
271
|
|
|
|
|
|
|
Returns : The end value. |
272
|
|
|
|
|
|
|
Args : The end value (optional). |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=cut |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub end { |
277
|
11
|
|
|
11
|
1
|
19
|
my ( $self, $value ) = @_; |
278
|
|
|
|
|
|
|
|
279
|
11
|
100
|
|
|
|
29
|
if ( defined $value ) { |
280
|
8
|
|
|
|
|
15
|
$self->{ "_end" } = $value; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
11
|
|
|
|
|
20
|
return $self->{ "_end" }; |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
} # end |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=head2 unit |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
Title : unit |
293
|
|
|
|
|
|
|
Usage : $measure->unit( "mM" ); |
294
|
|
|
|
|
|
|
or |
295
|
|
|
|
|
|
|
print $measure->unit(); |
296
|
|
|
|
|
|
|
Function: Set/get for the unit of this Measure. |
297
|
|
|
|
|
|
|
Returns : The unit. |
298
|
|
|
|
|
|
|
Args : The unit (optional). |
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
=cut |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
sub unit { |
303
|
11
|
|
|
11
|
1
|
18
|
my ( $self, $value ) = @_; |
304
|
|
|
|
|
|
|
|
305
|
11
|
100
|
|
|
|
36
|
if ( defined $value ) { |
306
|
8
|
|
|
|
|
13
|
$self->{ "_unit" } = $value; |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
11
|
|
|
|
|
20
|
return $self->{ "_unit" }; |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
} # unit |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=head2 comment |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
Title : comment |
319
|
|
|
|
|
|
|
Usage : $measure->comment( "see also Miller et al" ); |
320
|
|
|
|
|
|
|
or |
321
|
|
|
|
|
|
|
print $measure->comment(); |
322
|
|
|
|
|
|
|
Function: Set/get for an arbitrary comment about this Measure. |
323
|
|
|
|
|
|
|
Returns : A comment. |
324
|
|
|
|
|
|
|
Args : A comment (optional). |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=cut |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
sub comment { |
329
|
11
|
|
|
11
|
1
|
19
|
my ( $self, $value ) = @_; |
330
|
|
|
|
|
|
|
|
331
|
11
|
100
|
|
|
|
42
|
if ( defined $value ) { |
332
|
8
|
|
|
|
|
10
|
$self->{ "_comment" } = $value; |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
11
|
|
|
|
|
23
|
return $self->{ "_comment" }; |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
} # comment |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=head2 to_string |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
Title : to_string() |
345
|
|
|
|
|
|
|
Usage : print $measure->to_string(); |
346
|
|
|
|
|
|
|
Function: To string method for Measure objects. |
347
|
|
|
|
|
|
|
Returns : A string representations of this Measure. |
348
|
|
|
|
|
|
|
Args : |
349
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=cut |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
sub to_string { |
353
|
1
|
|
|
1
|
1
|
517
|
my ( $self ) = @_; |
354
|
|
|
|
|
|
|
|
355
|
1
|
|
|
|
|
2
|
my $s = ""; |
356
|
|
|
|
|
|
|
|
357
|
1
|
|
|
|
|
2
|
$s .= "-- Context:\n"; |
358
|
1
|
|
|
|
|
2
|
$s .= $self->context()."\n"; |
359
|
1
|
|
|
|
|
2
|
$s .= "-- Description:\n"; |
360
|
1
|
|
|
|
|
2
|
$s .= $self->description()."\n"; |
361
|
1
|
|
|
|
|
2
|
$s .= "-- Start:\n"; |
362
|
1
|
|
|
|
|
2
|
$s .= $self->start()."\n"; |
363
|
1
|
|
|
|
|
2
|
$s .= "-- End:\n"; |
364
|
1
|
|
|
|
|
2
|
$s .= $self->end()."\n"; |
365
|
1
|
|
|
|
|
1
|
$s .= "-- Unit:\n"; |
366
|
1
|
|
|
|
|
3
|
$s .= $self->unit()."\n"; |
367
|
1
|
|
|
|
|
2
|
$s .= "-- Comment:\n"; |
368
|
1
|
|
|
|
|
2
|
$s .= $self->comment(); |
369
|
|
|
|
|
|
|
|
370
|
1
|
|
|
|
|
5
|
return $s; |
371
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
} # to_string |
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
1; |