tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Expression / Sample.pm
blob88a2d0bd6f1967f5b7d1dff94d672ee9031a8b1f
1 # $Id$
3 # BioPerl module for Bio::Expression::Sample
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Allen Day <allenday@ucla.edu>
9 # Copyright Allen Day
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
15 =head1 NAME
17 Bio::Expression::Sample - DESCRIPTION of Object
19 =head1 SYNOPSIS
21 Give standard usage here
23 =head1 DESCRIPTION
25 Describe the object here
27 =head1 FEEDBACK
29 =head2 Mailing Lists
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to
33 the Bioperl mailing list. Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38 =head2 Support
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
49 =head2 Reporting Bugs
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 of the bugs and their resolution. Bug reports can be submitted via
53 the web:
55 http://bugzilla.open-bio.org/
57 =head1 AUTHOR - Allen Day
59 Email allenday@ucla.edu
61 =head1 APPENDIX
63 The rest of the documentation details each of the object methods.
64 Internal methods are usually preceded with a _
66 =cut
69 # Let the code begin...
72 package Bio::Expression::Sample;
73 use strict;
74 use base qw(Bio::Root::Root);
76 =head2 new()
78 Usage : my $obj = Bio::Expression::Sample->new();
79 Function: Builds a new Bio::Expression::Sample object
80 Returns : an instance of Bio::Expression::Sample
81 Args :
84 =cut
86 sub new {
87 my($class,@args) = @_;
89 my $self = $class->SUPER::new(@args);
90 $self->_initialize(@args);
91 return $self;
94 =head2 _initialize()
96 Usage : $obj->_initialize(%arg);
97 Function: Internal method to initialize a new Bio::Expression::Sample object
98 Returns : true on success
99 Args : passed through to new()
101 =cut
103 sub _initialize {
104 my($self,%arg) = @_;
106 foreach my $arg (keys %arg){
107 my $marg = $arg;
108 $marg =~ s/^-//;
109 $self->$marg($arg{$arg}) if $self->can($marg);
112 return 1;
115 =head2 accession()
117 Usage : $obj->accession($newval)
118 Function:
119 Example :
120 Returns : value of accession (a scalar)
121 Args : on set, new value (a scalar or undef, optional)
124 =cut
126 sub accession {
127 my($self,$val) = @_;
128 $self->{'accession'} = $val if defined($val);
129 return $self->{'accession'};
132 =head2 dataset()
134 Usage : $obj->dataset($newval)
135 Function:
136 Example :
137 Returns : value of dataset (a scalar)
138 Args : on set, new value (a scalar or undef, optional)
141 =cut
143 sub dataset {
144 my($self,$val) = @_;
145 $self->{'dataset'} = $val if defined($val);
146 return $self->{'dataset'};
149 =head2 db()
151 Usage : $obj->db($newval)
152 Function:
153 Example :
154 Returns : value of db (a scalar)
155 Args : on set, new value (a scalar or undef, optional)
158 =cut
160 sub db {
161 my($self,$val) = @_;
162 $self->{'db'} = $val if defined($val);
163 return $self->{'db'};
171 =head2 name()
173 Usage : $obj->name($newval)
174 Function:
175 Example :
176 Returns : value of name (a scalar)
177 Args : on set, new value (a scalar or undef, optional)
180 =cut
182 sub name {
183 my($self,$val) = @_;
184 $self->_load();
185 $self->{'name'} = $val if defined($val);
186 return $self->{'name'};
189 =head2 source_name()
191 Usage : $obj->source_name($newval)
192 Function:
193 Example :
194 Returns : value of source_name (a scalar)
195 Args : on set, new value (a scalar or undef, optional)
198 =cut
200 sub source_name {
201 my($self,$val) = @_;
202 $self->_load();
203 $self->{'source_name'} = $val if defined($val);
204 return $self->{'source_name'};
207 =head2 description()
209 Usage : $obj->description($newval)
210 Function:
211 Example :
212 Returns : value of description (a scalar)
213 Args : on set, new value (a scalar or undef, optional)
216 =cut
218 sub description {
219 my($self,$val) = @_;
220 $self->_load();
221 $self->{'description'} = $val if defined($val);
222 return $self->{'description'};
225 =head2 treatment_description()
227 Usage : $obj->treatment_description($newval)
228 Function:
229 Example :
230 Returns : value of treatment_description (a scalar)
231 Args : on set, new value (a scalar or undef, optional)
234 =cut
236 sub treatment_description {
237 my($self,$val) = @_;
238 $self->_load();
239 $self->{'treatment_description'} = $val if defined($val);
240 return $self->{'treatment_description'};
243 sub _load {
244 my $self = shift;
245 if ( $self->{'_load'} ) {
246 return 1;
248 $self->{'_load'}++;
249 $self->db->fill_sample( $self );
250 return $self->{'_load'};