2 # BioPerl module for Bio::Phenotype::Measure
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Christian M. Zmasek <czmasek-at-burnham.org> or <cmzmasek@yahoo.com>
8 # (c) Christian M. Zmasek, czmasek-at-burnham.org, 2002.
9 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
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.
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.
20 # You may distribute this module under the same terms as perl itself
22 # POD documentation - main docs before the code
26 Bio::Phenotype::Measure - Representation of context/value(-range)/unit triplets
30 use Bio::Phenotype::Measure;
32 my $measure = Bio::Phenotype::Measure->new( -context => "length",
33 -description => "reduced length in 4(Tas1r3)",
37 -comment => "see also Miller et al" );
39 print $measure->context();
40 print $measure->description();
41 print $measure->start();
42 print $measure->end();
43 print $measure->unit();
44 print $measure->comment();
46 print $measure->to_string();
50 Measure is for biochemically defined phenotypes or any other types of measures.
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.
60 bioperl-l@bioperl.org - General discussion
61 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
65 Please direct usage questions or support issues to the mailing list:
67 I<bioperl-l@bioperl.org>
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.
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
80 https://github.com/bioperl/bioperl-live/issues
86 Email: czmasek-at-burnham.org or cmzmasek@yahoo.com
88 WWW: http://monochrome-effect.net/
92 Genomics Institute of the Novartis Research Foundation
93 10675 John Jay Hopkins Drive
98 The rest of the documentation details each of the object
104 # Let the code begin...
106 package Bio
::Phenotype
::Measure
;
109 use base
qw(Bio::Root::Root);
115 Usage : my $me = Bio::Phenotype::Measure->new( -context => "length",
116 -description => "reduced length in 4(Tas1r3)",
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
128 -comment => a comment
133 my( $class, @args ) = @_;
135 my $self = $class->SUPER::new
( @args );
137 my ( $con, $desc, $start, $end, $unit, $comment )
138 = $self->_rearrange( [ qw( CONTEXT
143 COMMENT ) ], @args );
147 $con && $self->context( $con );
148 $desc && $self->description( $desc );
149 $start && $self->start( $start );
150 $end && $self->end( $end );
151 $unit && $self->unit( $unit );
152 $comment && $self->comment( $comment );
164 Usage : $measure->init();
165 Function: Initializes this Measure to all "".
174 $self->context( "" );
175 $self->description( "" );
179 $self->comment( "" );
189 Usage : $measure->context( "Ca-conc" );
191 print $measure->context();
192 Function: Set/get for the context of this Measure.
193 Returns : The context.
194 Args : The context (optional).
199 my ( $self, $value ) = @_;
201 if ( defined $value ) {
202 $self->{ "_context" } = $value;
205 return $self->{ "_context" };
215 Usage : $measure->description( "reduced in 4(Tas1r3)" );
217 print $measure->description();
218 Function: Set/get for the description of this Measure.
219 Returns : A description.
220 Args : A description (optional).
225 my ( $self, $value ) = @_;
227 if ( defined $value ) {
228 $self->{ "_description" } = $value;
231 return $self->{ "_description" };
241 Usage : $measure->start( 330 );
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).
251 my ( $self, $value ) = @_;
253 if ( defined $value ) {
254 $self->{ "_start" } = $value;
257 return $self->{ "_start" };
267 Usage : $measure->end( 459 );
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).
277 my ( $self, $value ) = @_;
279 if ( defined $value ) {
280 $self->{ "_end" } = $value;
283 return $self->{ "_end" };
293 Usage : $measure->unit( "mM" );
295 print $measure->unit();
296 Function: Set/get for the unit of this Measure.
298 Args : The unit (optional).
303 my ( $self, $value ) = @_;
305 if ( defined $value ) {
306 $self->{ "_unit" } = $value;
309 return $self->{ "_unit" };
319 Usage : $measure->comment( "see also Miller et al" );
321 print $measure->comment();
322 Function: Set/get for an arbitrary comment about this Measure.
324 Args : A comment (optional).
329 my ( $self, $value ) = @_;
331 if ( defined $value ) {
332 $self->{ "_comment" } = $value;
335 return $self->{ "_comment" };
345 Usage : print $measure->to_string();
346 Function: To string method for Measure objects.
347 Returns : A string representations of this Measure.
357 $s .= "-- Context:\n";
358 $s .= $self->context()."\n";
359 $s .= "-- Description:\n";
360 $s .= $self->description()."\n";
362 $s .= $self->start()."\n";
364 $s .= $self->end()."\n";
366 $s .= $self->unit()."\n";
367 $s .= "-- Comment:\n";
368 $s .= $self->comment();