add latest changes to, um, Changes
[bioperl-live.git] / Bio / DB / Expression.pm
blob76462427a08dda17ca6c6508527b82ab379b426a
2 # BioPerl module for Bio::DB::Expression
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Allen Day <allenday@ucla.edu>
8 # Copyright Allen Day
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::DB::Expression - DESCRIPTION of Object
18 =head1 SYNOPSIS
20 use Bio::DB::Expression;
21 my $db = Bio::DB::Expression->new( -source => 'geo' );
22 my @platforms = $db->get_platforms();
23 foreach my $platform ( @platforms ) {
24 my @datasets = $platform->get_datasets();
25 foreach my $dataset ( @datasets ) {
26 my @samples = $dataset->get_samples();
27 foreach my $sample ( @samples ) {
28 #...
33 =head1 DESCRIPTION
35 Describe the object here
37 =head1 FEEDBACK
39 =head2 Mailing Lists
41 User feedback is an integral part of the evolution of this and other
42 Bioperl modules. Send your comments and suggestions preferably to
43 the Bioperl mailing list. Your participation is much appreciated.
45 bioperl-l@bioperl.org - General discussion
46 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 =head2 Support
50 Please direct usage questions or support issues to the mailing list:
52 I<bioperl-l@bioperl.org>
54 rather than to the module maintainer directly. Many experienced and
55 reponsive experts will be able look at the problem and quickly
56 address it. Please include a thorough description of the problem
57 with code and data examples if at all possible.
59 =head2 Reporting Bugs
61 Report bugs to the Bioperl bug tracking system to help us keep track
62 of the bugs and their resolution. Bug reports can be submitted via
63 the web:
65 https://github.com/bioperl/bioperl-live/issues
67 =head1 AUTHOR - Allen Day
69 Email allenday@ucla.edu
71 =head1 APPENDIX
73 The rest of the documentation details each of the object methods.
74 Internal methods are usually preceded with a _
76 =cut
79 # Let the code begin...
82 package Bio::DB::Expression;
83 use strict;
84 use base qw(Bio::Root::HTTPget Bio::Root::Root);
85 use Bio::Root::HTTPget;
86 our $DefaultSource = 'geo';
88 =head2 new()
90 Usage : my $obj = Bio::DB::Expression->new();
91 Function: Builds a new Bio::DB::Expression object
92 Returns : an instance of Bio::DB::Expression
93 Args :
96 =cut
98 sub new {
99 my($class,@args) = @_;
101 if( $class =~ /Bio::DB::Expression::(\S+)/ ) {
102 my ($self) = $class->SUPER::new(@args);
103 $self->_initialize(@args);
104 return $self;
105 } else {
106 my %param = @args;
107 @param{ map { lc $_ } keys %param } = values %param; # lowercase keys
108 my $source = $param{'-source'} || $DefaultSource;
110 $source = "\L$source"; # normalize capitalization to lower case
112 # normalize capitalization
113 return unless( $class->_load_expression_module($source) );
114 return "Bio::DB::Expression::$source"->new(@args);
118 =head2 get_platforms()
120 Usage :
121 Function:
122 Example :
123 Returns : a list of Bio::Expression::Platform objects
124 Args :
126 =cut
128 sub get_platforms {
129 my ($self,@args) = @_;
130 $self->throw_not_implemented();
133 =head2 get_samples()
135 Usage :
136 Function:
137 Example :
138 Returns : a list of Bio::Expression::Sample objects
139 Args :
141 =cut
143 sub get_samples {
144 my ($self,@args) = @_;
145 $self->throw_not_implemented();
148 =head2 get_contacts()
150 Usage :
151 Function:
152 Example :
153 Returns : a list of Bio::Expression::Contact objects
154 Args :
156 =cut
158 sub get_contacts {
159 my ($self,@args) = @_;
160 $self->throw_not_implemented();
163 =head2 get_datasets()
165 Usage :
166 Function:
167 Example :
168 Returns : a list of Bio::Expression::DataSet objects
169 Args :
171 =cut
173 sub get_datasets {
174 my ($self,@args) = @_;
175 $self->throw_not_implemented();
181 =head2 _load_expression_module
183 Title : _load_expression_module
184 Usage : *INTERNAL Bio::DB::Expression stuff*
185 Function: Loads up (like use) a module at run time on demand
186 Example :
187 Returns :
188 Args :
190 =cut
192 sub _load_expression_module {
193 my ($self, $source) = @_;
194 my $module = "Bio::DB::Expression::" . $source;
195 my $ok;
197 eval { $ok = $self->_load_module($module) };
198 if ( $@ ) {
199 print STDERR $@;
200 print STDERR <<END;
201 $self: $source cannot be found
202 Exception $@
203 For more information about the Bio::DB::Expression system please see
204 the Bio::DB::Expression docs. This includes ways of checking for
205 formats at compile time, not run time.
209 return $ok;