tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Expression / Platform.pm
blobbde70601e9d4737ab2576fd37b26d973bac9b162
1 # $Id$
3 # BioPerl module for Bio::Expression::Platform
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::Platform - 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::Platform;
73 use strict;
74 use base qw(Bio::Root::Root);
75 use Bio::DB::Taxonomy;
77 =head2 new()
79 Usage : my $obj = Bio::Expression::Platform->new();
80 Function: Builds a new Bio::Expression::Platform object
81 Returns : an instance of Bio::Expression::Platform
82 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::Platform 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 $self->taxdb( Bio::DB::Taxonomy->new(-source => 'entrez') );
113 return 1;
118 =head2 get_datasets()
120 Usage :
121 Function:
122 Example :
123 Returns :
124 Args :
126 =cut
128 sub get_datasets {
129 my ($self,@args) = @_;
130 my $db = $self->db();
132 my @datasets = $db->get_datasets( $self );
134 return @datasets;
137 =head2 accession()
139 Usage : $obj->accession($newval)
140 Function:
141 Example :
142 Returns : value of accession (a scalar)
143 Args : on set, new value (a scalar or undef, optional)
146 =cut
148 sub accession {
149 my($self,$val) = @_;
150 $self->{'accession'} = $val if defined($val);
151 return $self->{'accession'};
154 =head2 name()
156 Usage : $obj->name($newval)
157 Function:
158 Example :
159 Returns : value of name (a scalar)
160 Args : on set, new value (a scalar or undef, optional)
163 =cut
165 sub name {
166 my($self,$val) = @_;
167 $self->{'name'} = $val if defined($val);
168 return $self->{'name'};
171 =head2 taxon()
173 Usage : $obj->taxon()
174 Function:
175 Example :
176 Returns : A Bio::Taxonomy::Node object
177 Args : none
180 =cut
182 sub taxon {
183 my($self) = @_;
184 if ( ! $self->{'taxon'} ) {
185 $self->{'taxon'} = $self->taxdb->get_Taxonomy_Node( $self->_taxon_id() );
187 return $self->{'taxon'};
190 =head2 contact()
192 Usage : $obj->contact($newval)
193 Function:
194 Example :
195 Returns : a Bio::Expression::Contact object
196 Args : on set, new value (a scalar or undef, optional)
199 =cut
201 sub contact {
202 my($self,$val) = @_;
203 $self->{'contact'} = $val if defined($val);
204 return $self->{'contact'};
207 =head2 db()
209 Usage : $obj->db($newval)
210 Function:
211 Example :
212 Returns : value of db (a scalar)
213 Args : on set, new value (a scalar or undef, optional)
216 =cut
218 sub db {
219 my($self,$val) = @_;
220 $self->{'db'} = $val if defined($val);
221 return $self->{'db'};
224 =head2 _taxon_id()
226 Usage : $obj->_taxon_id($newval)
227 Function:
228 Example :
229 Returns : value of _taxon_id (a scalar)
230 Args : on set, new value (a scalar or undef, optional)
233 =cut
235 sub _taxon_id {
236 my($self,$val) = @_;
237 $self->{'_taxon_id'} = $val if defined($val);
238 return $self->{'_taxon_id'};
241 =head2 taxdb()
243 Usage : $obj->taxdb($newval)
244 Function:
245 Example :
246 Returns : a Bio::DB::Taxonomy object
247 Args : on set, new value (a scalar or undef, optional)
250 =cut
252 sub taxdb {
253 my($self,$val) = @_;
254 $self->{'taxdb'} = $val if defined($val);
255 return $self->{'taxdb'};