3 # BioPerl module for Bio::Phenotype::Measure
5 # Cared for by Christian M. Zmasek <czmasek@gnf.org> or <cmzmasek@yahoo.com>
7 # (c) Christian M. Zmasek, czmasek@gnf.org, 2002.
8 # (c) GNF, Genomics Institute of the Novartis Research Foundation, 2002.
10 # You may distribute this module under the same terms as perl itself.
11 # Refer to the Perl Artistic License (see the license accompanying this
12 # software package, or see http://www.perl.com/language/misc/Artistic.html)
13 # for the terms under which you may use, modify, and redistribute this module.
15 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
16 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
17 # MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 # You may distribute this module under the same terms as perl itself
21 # POD documentation - main docs before the code
25 Bio::Phenotype::Measure - Representation of context/value(-range)/unit triplets
29 use Bio::Phenotype::Measure;
31 my $measure = Bio::Phenotype::Measure->new( -context => "length",
32 -description => "reduced length in 4(Tas1r3)",
36 -comment => "see also Miller et al" );
38 print $measure->context();
39 print $measure->description();
40 print $measure->start();
41 print $measure->end();
42 print $measure->unit();
43 print $measure->comment();
45 print $measure->to_string();
49 Measure is for biochemically defined phenotypes or any other types of measures.
55 User feedback is an integral part of the evolution of this and other
56 Bioperl modules. Send your comments and suggestions preferably to one
57 of the Bioperl mailing lists. Your participation is much appreciated.
59 bioperl-l@bioperl.org - General discussion
60 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
64 Report bugs to the Bioperl bug tracking system to help us keep track
65 the bugs and their resolution. Bug reports can be submitted via the
68 http://bugzilla.open-bio.org/
74 Email: czmasek@gnf.org or cmzmasek@yahoo.com
76 WWW: http://www.genetics.wustl.edu/eddy/people/zmasek/
80 Genomics Institute of the Novartis Research Foundation
81 10675 John Jay Hopkins Drive
86 The rest of the documentation details each of the object
92 # Let the code begin...
94 package Bio
::Phenotype
::Measure
;
97 use base
qw(Bio::Root::Root);
103 Usage : my $me = Bio::Phenotype::Measure->new( -context => "length",
104 -description => "reduced length in 4(Tas1r3)",
108 -comment => "see Miller also et al" );
109 Function: Creates a new Measure object.
110 Returns : A new Measure object.
111 Args : -context => the context
112 -description => a description
113 -start => the start value
114 -end => the end value
116 -comment => a comment
121 my( $class, @args ) = @_;
123 my $self = $class->SUPER::new
( @args );
125 my ( $con, $desc, $start, $end, $unit, $comment )
126 = $self->_rearrange( [ qw( CONTEXT
131 COMMENT ) ], @args );
135 $con && $self->context( $con );
136 $desc && $self->description( $desc );
137 $start && $self->start( $start );
138 $end && $self->end( $end );
139 $unit && $self->unit( $unit );
140 $comment && $self->comment( $comment );
152 Usage : $measure->init();
153 Function: Initializes this Measure to all "".
162 $self->context( "" );
163 $self->description( "" );
167 $self->comment( "" );
177 Usage : $measure->context( "Ca-conc" );
179 print $measure->context();
180 Function: Set/get for the context of this Measure.
181 Returns : The context.
182 Args : The context (optional).
187 my ( $self, $value ) = @_;
189 if ( defined $value ) {
190 $self->{ "_context" } = $value;
193 return $self->{ "_context" };
203 Usage : $measure->description( "reduced in 4(Tas1r3)" );
205 print $measure->description();
206 Function: Set/get for the description of this Measure.
207 Returns : A description.
208 Args : A description (optional).
213 my ( $self, $value ) = @_;
215 if ( defined $value ) {
216 $self->{ "_description" } = $value;
219 return $self->{ "_description" };
229 Usage : $measure->start( 330 );
231 print $measure->start();
232 Function: Set/get for the start value of this Measure.
233 Returns : The start value.
234 Args : The start value (optional).
239 my ( $self, $value ) = @_;
241 if ( defined $value ) {
242 $self->{ "_start" } = $value;
245 return $self->{ "_start" };
255 Usage : $measure->end( 459 );
257 print $measure->end();
258 Function: Set/get for the end value of this Measure.
259 Returns : The end value.
260 Args : The end value (optional).
265 my ( $self, $value ) = @_;
267 if ( defined $value ) {
268 $self->{ "_end" } = $value;
271 return $self->{ "_end" };
281 Usage : $measure->unit( "mM" );
283 print $measure->unit();
284 Function: Set/get for the unit of this Measure.
286 Args : The unit (optional).
291 my ( $self, $value ) = @_;
293 if ( defined $value ) {
294 $self->{ "_unit" } = $value;
297 return $self->{ "_unit" };
307 Usage : $measure->comment( "see also Miller et al" );
309 print $measure->comment();
310 Function: Set/get for an arbitrary comment about this Measure.
312 Args : A comment (optional).
317 my ( $self, $value ) = @_;
319 if ( defined $value ) {
320 $self->{ "_comment" } = $value;
323 return $self->{ "_comment" };
333 Usage : print $measure->to_string();
334 Function: To string method for Measure objects.
335 Returns : A string representations of this Measure.
345 $s .= "-- Context:\n";
346 $s .= $self->context()."\n";
347 $s .= "-- Description:\n";
348 $s .= $self->description()."\n";
350 $s .= $self->start()."\n";
352 $s .= $self->end()."\n";
354 $s .= $self->unit()."\n";
355 $s .= "-- Comment:\n";
356 $s .= $self->comment();