small update
[bioperl-live.git] / Bio / Expression / Platform.pm
blob9743959994799bc7179d5af2ad22b70c93dc9d85
1 # $Id$
3 # BioPerl module for Bio::Expression::Platform
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::Platform - 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::Platform;
60 use strict;
61 use base qw(Bio::Root::Root);
62 use Bio::DB::Taxonomy;
64 =head2 new()
66 Usage : my $obj = Bio::Expression::Platform->new();
67 Function: Builds a new Bio::Expression::Platform object
68 Returns : an instance of Bio::Expression::Platform
69 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::Platform 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 $self->taxdb( Bio::DB::Taxonomy->new(-source => 'entrez') );
100 return 1;
105 =head2 get_datasets()
107 Usage :
108 Function:
109 Example :
110 Returns :
111 Args :
113 =cut
115 sub get_datasets {
116 my ($self,@args) = @_;
117 my $db = $self->db();
119 my @datasets = $db->get_datasets( $self );
121 return @datasets;
124 =head2 accession()
126 Usage : $obj->accession($newval)
127 Function:
128 Example :
129 Returns : value of accession (a scalar)
130 Args : on set, new value (a scalar or undef, optional)
133 =cut
135 sub accession {
136 my($self,$val) = @_;
137 $self->{'accession'} = $val if defined($val);
138 return $self->{'accession'};
141 =head2 name()
143 Usage : $obj->name($newval)
144 Function:
145 Example :
146 Returns : value of name (a scalar)
147 Args : on set, new value (a scalar or undef, optional)
150 =cut
152 sub name {
153 my($self,$val) = @_;
154 $self->{'name'} = $val if defined($val);
155 return $self->{'name'};
158 =head2 taxon()
160 Usage : $obj->taxon()
161 Function:
162 Example :
163 Returns : A Bio::Taxonomy::Node object
164 Args : none
167 =cut
169 sub taxon {
170 my($self) = @_;
171 if ( ! $self->{'taxon'} ) {
172 $self->{'taxon'} = $self->taxdb->get_Taxonomy_Node( $self->_taxon_id() );
174 return $self->{'taxon'};
177 =head2 contact()
179 Usage : $obj->contact($newval)
180 Function:
181 Example :
182 Returns : a Bio::Expression::Contact object
183 Args : on set, new value (a scalar or undef, optional)
186 =cut
188 sub contact {
189 my($self,$val) = @_;
190 $self->{'contact'} = $val if defined($val);
191 return $self->{'contact'};
194 =head2 db()
196 Usage : $obj->db($newval)
197 Function:
198 Example :
199 Returns : value of db (a scalar)
200 Args : on set, new value (a scalar or undef, optional)
203 =cut
205 sub db {
206 my($self,$val) = @_;
207 $self->{'db'} = $val if defined($val);
208 return $self->{'db'};
211 =head2 _taxon_id()
213 Usage : $obj->_taxon_id($newval)
214 Function:
215 Example :
216 Returns : value of _taxon_id (a scalar)
217 Args : on set, new value (a scalar or undef, optional)
220 =cut
222 sub _taxon_id {
223 my($self,$val) = @_;
224 $self->{'_taxon_id'} = $val if defined($val);
225 return $self->{'_taxon_id'};
228 =head2 taxdb()
230 Usage : $obj->taxdb($newval)
231 Function:
232 Example :
233 Returns : a Bio::DB::Taxonomy object
234 Args : on set, new value (a scalar or undef, optional)
237 =cut
239 sub taxdb {
240 my($self,$val) = @_;
241 $self->{'taxdb'} = $val if defined($val);
242 return $self->{'taxdb'};