* sync with trunk
[bioperl-live.git] / Bio / Expression / DataSet.pm
bloba2b94cafa5277c59cb29fdb21c2d6b0e5bf4e81e
1 # $Id$
3 # BioPerl module for Bio::Expression::DataSet
5 # Cared for by Allen Day <allenday@ucla.edu>
7 # Copyright Allen Day
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Expression::DataSet - DESCRIPTION of Object
17 =head1 SYNOPSIS
19 Give standard usage here
21 =head1 DESCRIPTION
23 Describe the object here
25 =head1 FEEDBACK
27 =head2 Mailing Lists
29 User feedback is an integral part of the evolution of this and other
30 Bioperl modules. Send your comments and suggestions preferably to
31 the Bioperl mailing list. Your participation is much appreciated.
33 bioperl-l@bioperl.org - General discussion
34 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
36 =head2 Reporting Bugs
38 Report bugs to the Bioperl bug tracking system to help us keep track
39 of the bugs and their resolution. Bug reports can be submitted via
40 the web:
42 http://bugzilla.open-bio.org/
44 =head1 AUTHOR - Allen Day
46 Email allenday@ucla.edu
48 =head1 APPENDIX
50 The rest of the documentation details each of the object methods.
51 Internal methods are usually preceded with a _
53 =cut
56 # Let the code begin...
59 package Bio::Expression::DataSet;
60 use strict;
61 use base qw(Bio::Root::Root);
63 =head2 new()
65 Usage : my $obj = Bio::Expression::DataSet->new();
66 Function: Builds a new Bio::Expression::DataSet object
67 Returns : an instance of Bio::Expression::DataSet
68 Args :
71 =cut
73 sub new {
74 my($class,@args) = @_;
76 my $self = $class->SUPER::new(@args);
77 $self->_initialize(@args);
78 return $self;
81 =head2 _initialize()
83 Usage : $obj->_initialize(%arg);
84 Function: Internal method to initialize a new Bio::Expression::DataSet object
85 Returns : true on success
86 Args : passed through to new()
88 =cut
90 sub _initialize {
91 my($self,%arg) = @_;
93 foreach my $arg (keys %arg){
94 my $marg = $arg;
95 $marg =~ s/^-//;
96 $self->$marg($arg{$arg}) if $self->can($marg);
99 return 1;
102 =head2 accession()
104 Usage : $obj->accession($newval)
105 Function:
106 Example :
107 Returns : value of accession (a scalar)
108 Args : on set, new value (a scalar or undef, optional)
111 =cut
113 sub accession {
114 my($self,$val) = @_;
115 $self->{'accession'} = $val if defined($val);
116 return $self->{'accession'};
119 =head2 name()
121 Usage :
122 Function:
123 Example :
124 Returns :
125 Args :
128 =cut
130 sub name {
131 my($self,$val) = @_;
132 $self->_load();
133 $self->{'db'} = $val if defined($val);
134 return $self->{'db'};
137 =head2 db()
139 Usage : $obj->db($newval)
140 Function:
141 Example :
142 Returns : value of db (a scalar)
143 Args : on set, new value (a scalar or undef, optional)
146 =cut
148 sub db {
149 my($self,$val) = @_;
150 $self->{'db'} = $val if defined($val);
151 return $self->{'db'};
154 =head2 pubmed_id()
156 Usage : $obj->pubmed_id($newval)
157 Function:
158 Example :
159 Returns : value of pubmed_id (a scalar)
160 Args : on set, new value (a scalar or undef, optional)
163 =cut
165 sub pubmed_id {
166 my($self,$val) = @_;
167 $self->_load();
168 $self->{'pubmed_id'} = $val if defined($val);
169 return $self->{'pubmed_id'};
172 =head2 web_link()
174 Usage : $obj->web_link($newval)
175 Function:
176 Example :
177 Returns : value of web_link (a scalar)
178 Args : on set, new value (a scalar or undef, optional)
181 =cut
183 sub web_link {
184 my($self,$val) = @_;
185 $self->_load();
186 $self->{'web_link'} = $val if defined($val);
187 return $self->{'web_link'};
190 =head2 contact()
192 Usage : $obj->contact($newval)
193 Function:
194 Example :
195 Returns : value of contact (a scalar)
196 Args : on set, new value (a scalar or undef, optional)
199 =cut
201 sub contact {
202 my($self,$val) = @_;
203 $self->_load();
204 $self->{'contact'} = $val if defined($val);
205 return $self->{'contact'};
208 =head2 samples()
210 Usage : $obj->samples($newval)
211 Function:
212 Example :
213 Returns : value of samples (a scalar)
214 Args : on set, new value (a scalar or undef, optional)
217 =cut
219 sub samples {
220 my($self,$val) = @_;
221 $self->_load();
222 $self->{'samples'} = $val if defined($val);
223 return $self->{'samples'};
226 =head2 description()
228 Usage : $obj->description($newval)
229 Function:
230 Example :
231 Returns : value of description (a scalar)
232 Args : on set, new value (a scalar or undef, optional)
235 =cut
237 sub description {
238 my($self,$val) = @_;
239 $self->_load();
240 $self->{'description'} = $val if defined($val);
241 return $self->{'description'};
244 =head2 design()
246 Usage : $obj->design($newval)
247 Function:
248 Example :
249 Returns : value of design (a scalar)
250 Args : on set, new value (a scalar or undef, optional)
253 =cut
255 sub design {
256 my($self,$val) = @_;
257 $self->_load();
258 $self->{'design'} = $val if defined($val);
259 return $self->{'design'};
262 =head2 design_description()
264 Usage : $obj->design_description($newval)
265 Function:
266 Example :
267 Returns : value of design_description (a scalar)
268 Args : on set, new value (a scalar or undef, optional)
271 =cut
273 sub design_description {
274 my($self,$val) = @_;
275 $self->_load();
276 $self->{'design_description'} = $val if defined($val);
277 return $self->{'design_description'};
292 =head2 get_samples()
294 Usage :
295 Function:
296 Example :
297 Returns :
298 Args :
301 =cut
303 sub get_samples {
304 my ($self,@args) = @_;
305 if ( $self->samples() ) {
306 return @{ $self->samples() };
308 else {
309 return ();
319 sub _load {
320 my $self = shift;
321 if ( $self->{'_load'} ) {
322 return 1;
324 $self->{'_load'}++;
325 $self->db->fill_dataset( $self );
326 return $self->{'_load'};