sync w/ main trunk
[bioperl-live.git] / Bio / Expression / DataSet.pm
blob0cd70fa398a6cbef3bc9b77a2b5cb9efb4799e00
1 # $Id$
3 # BioPerl module for Bio::Expression::DataSet
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::DataSet - 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 L<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::DataSet;
73 use strict;
74 use base qw(Bio::Root::Root);
76 =head2 new()
78 Usage : my $obj = Bio::Expression::DataSet->new();
79 Function: Builds a new Bio::Expression::DataSet object
80 Returns : an instance of Bio::Expression::DataSet
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::DataSet 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 name()
134 Usage :
135 Function:
136 Example :
137 Returns :
138 Args :
141 =cut
143 sub name {
144 my($self,$val) = @_;
145 $self->_load();
146 $self->{'db'} = $val if defined($val);
147 return $self->{'db'};
150 =head2 db()
152 Usage : $obj->db($newval)
153 Function:
154 Example :
155 Returns : value of db (a scalar)
156 Args : on set, new value (a scalar or undef, optional)
159 =cut
161 sub db {
162 my($self,$val) = @_;
163 $self->{'db'} = $val if defined($val);
164 return $self->{'db'};
167 =head2 pubmed_id()
169 Usage : $obj->pubmed_id($newval)
170 Function:
171 Example :
172 Returns : value of pubmed_id (a scalar)
173 Args : on set, new value (a scalar or undef, optional)
176 =cut
178 sub pubmed_id {
179 my($self,$val) = @_;
180 $self->_load();
181 $self->{'pubmed_id'} = $val if defined($val);
182 return $self->{'pubmed_id'};
185 =head2 web_link()
187 Usage : $obj->web_link($newval)
188 Function:
189 Example :
190 Returns : value of web_link (a scalar)
191 Args : on set, new value (a scalar or undef, optional)
194 =cut
196 sub web_link {
197 my($self,$val) = @_;
198 $self->_load();
199 $self->{'web_link'} = $val if defined($val);
200 return $self->{'web_link'};
203 =head2 contact()
205 Usage : $obj->contact($newval)
206 Function:
207 Example :
208 Returns : value of contact (a scalar)
209 Args : on set, new value (a scalar or undef, optional)
212 =cut
214 sub contact {
215 my($self,$val) = @_;
216 $self->_load();
217 $self->{'contact'} = $val if defined($val);
218 return $self->{'contact'};
221 =head2 samples()
223 Usage : $obj->samples($newval)
224 Function:
225 Example :
226 Returns : value of samples (a scalar)
227 Args : on set, new value (a scalar or undef, optional)
230 =cut
232 sub samples {
233 my($self,$val) = @_;
234 $self->_load();
235 $self->{'samples'} = $val if defined($val);
236 return $self->{'samples'};
239 =head2 description()
241 Usage : $obj->description($newval)
242 Function:
243 Example :
244 Returns : value of description (a scalar)
245 Args : on set, new value (a scalar or undef, optional)
248 =cut
250 sub description {
251 my($self,$val) = @_;
252 $self->_load();
253 $self->{'description'} = $val if defined($val);
254 return $self->{'description'};
257 =head2 design()
259 Usage : $obj->design($newval)
260 Function:
261 Example :
262 Returns : value of design (a scalar)
263 Args : on set, new value (a scalar or undef, optional)
266 =cut
268 sub design {
269 my($self,$val) = @_;
270 $self->_load();
271 $self->{'design'} = $val if defined($val);
272 return $self->{'design'};
275 =head2 design_description()
277 Usage : $obj->design_description($newval)
278 Function:
279 Example :
280 Returns : value of design_description (a scalar)
281 Args : on set, new value (a scalar or undef, optional)
284 =cut
286 sub design_description {
287 my($self,$val) = @_;
288 $self->_load();
289 $self->{'design_description'} = $val if defined($val);
290 return $self->{'design_description'};
305 =head2 get_samples()
307 Usage :
308 Function:
309 Example :
310 Returns :
311 Args :
314 =cut
316 sub get_samples {
317 my ($self,@args) = @_;
318 if ( $self->samples() ) {
319 return @{ $self->samples() };
321 else {
322 return ();
332 sub _load {
333 my $self = shift;
334 if ( $self->{'_load'} ) {
335 return 1;
337 $self->{'_load'}++;
338 $self->db->fill_dataset( $self );
339 return $self->{'_load'};