3
Bio::DB::Expression::geo - *** DESCRIPTION of Class
7
*** Give standard usage here
11
*** Describe the object here
17
User feedback is an integral part of the evolution of this and other
18
Bioperl modules. Send your comments and suggestions preferably to the
19
Bioperl mailing list. Your participation is much appreciated.
21
bioperl-l@bioperl.org - General discussion
22
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
26
Report bugs to the Bioperl bug tracking system to help us keep track
27
of the bugs and their resolution. Bug reports can be submitted via the
30
http://bugzilla.open-bio.org/
34
Allen Day E<lt>allenday@ucla.eduE<gt>
38
The rest of the documentation details each of the object methods.
39
Internal methods are usually preceded with a '_'. Methods are
40
in alphabetical order for the most part.
45
# Let the code begin...
47
package Bio::DB::Expression::geo;
49
use base qw(Bio::DB::Expression);
51
use Bio::Expression::Contact;
52
use Bio::Expression::DataSet;
53
use Bio::Expression::Platform;
54
use Bio::Expression::Sample;
56
use constant URL_PLATFORMS => 'http://www.ncbi.nlm.nih.gov/geo/query/browse.cgi?pgsize=100000&mode=platforms&submitter=-1&filteron=0&filtervalue=-1&private=1&sorton=pub_date&sortdir=1&start=1';
57
use constant URL_PLATFORM => 'http://www.ncbi.nlm.nih.gov/projects/geo/query/acc.cgi?form=text&view=full&acc=';
58
use constant URL_DATASET => 'http://www.ncbi.nlm.nih.gov/projects/geo/query/acc.cgi?form=text&view=full&acc=';
59
use constant URL_SAMPLE => 'http://www.ncbi.nlm.nih.gov/projects/geo/query/acc.cgi?form=text&view=full&acc=';
63
Usage : $obj->_initialize(%arg);
64
Function: Internal method to initialize a new Bio::DB::Expression::geo object
65
Returns : true on success
66
Args : Arguments passed to new()
73
foreach my $arg (keys %arg){
76
$self->$marg($arg{$arg}) if $self->can($marg);
82
=head2 get_platforms()
87
Returns : a list of Bio::Expression::Platform objects
93
my ($self,@args) = @_;
95
my $doc = $self->_get_url( URL_PLATFORMS );
96
$doc =~ s!^.+?>Release date<.+?</tr>(.+)</table>!$1!gs;
99
my @records = split m!</tr>\s+<tr>!, $doc;
101
foreach my $record ( @records ) {
102
my ($platform_acc,$name,$tax_acc,$contact_acc,$contact_name) =
103
$record =~ m!acc\.cgi\?acc=(.+?)".+?<td.+?>(.+?)<.+?<td.+?>.+?<.+?<td.+?>.+?href=".+?id=(.+?)".+?<td.+?OpenSubmitter\((\d+?)\).+?>(.+?)<!s;
104
next unless $platform_acc;
106
my $platform = Bio::Expression::Platform->new(
107
-accession => $platform_acc,
109
-_taxon_id => $tax_acc,
110
-contact => Bio::Expression::Contact->new(
112
-accession => $contact_acc,
113
-name => $contact_name,
118
push @platforms, $platform;
129
Returns : a list of Bio::Expression::Sample objects
135
my ($self,@args) = @_;
136
$self->throw_not_implemented();
139
=head2 get_contacts()
144
Returns : a list of Bio::Expression::Contact objects
150
my ($self,@args) = @_;
151
$self->throw_not_implemented();
154
=head2 get_datasets()
156
Usage : $db->get_datasets('accession');
159
Returns : a list of Bio::Expression::DataSet objects
165
my ($self,$platform) = @_;
167
my @lines = split /\n/, $self->_get_url( URL_PLATFORM . $platform->accession );
171
foreach my $line ( @lines ) {
172
my ($dataset_acc) = $line =~ /^\!Platform_series_id = (\S+?)\s*$/;
173
next unless $dataset_acc;
175
my $dataset = Bio::Expression::DataSet->new(
176
-accession => $dataset_acc,
177
-platform => $platform,
181
push @datasets, $dataset;
188
my ( $self, $sample ) = @_;
190
my @lines = split /\n/, $self->_get_url( URL_SAMPLE. $sample->accession );
192
foreach my $line ( @lines ) {
193
if ( my ($name) = $line =~ /^\!Sample_title = (.+?)\s*$/ ) {
194
$sample->name( $name );
196
elsif ( my ($desc) = $line =~ /^\!Sample_characteristics.*? = (.+?)\s*$/ ) {
197
$sample->description( $desc );
199
elsif ( my ($source_name) = $line =~ /^\!Sample_source_name.*? = (.+?)\s*$/ ) {
200
$sample->source_name( $source_name );
202
elsif ( my ($treatment_desc) = $line =~ /^\!Sample_treatment_protocol.*? = (.+?)\s*$/ ) {
203
$sample->treatment_description( $treatment_desc );
210
my ( $self, $dataset ) = @_;
212
my @lines = split /\n/, $self->_get_url( URL_DATASET . $dataset->accession );
216
foreach my $line ( @lines ) {
217
if ( my ($sample_acc) = $line =~ /^\!Series_sample_id = (\S+?)\s*$/ ) {
218
my $sample = Bio::Expression::Sample->new(
219
-accession => $sample_acc,
220
-dataset => $dataset,
223
push @samples, $sample;
225
elsif ( my ($pubmed_acc) = $line =~ /^\!Series_pubmed_id = (.+?)\s*$/ ) {
226
$dataset->pubmed_id( $pubmed_acc );
228
elsif ( my ($web_link) = $line =~ /^\!Series_web_link = (.+?)\s*$/ ) {
229
$dataset->web_link( $web_link );
231
elsif ( my ($contact) = $line =~ /^\!Series_contact_name = (.+?)\s*$/ ) {
232
$dataset->contact( $contact );
234
elsif ( my ($name) = $line =~ /^\!Series_title = (.+?)\s*$/ ) {
235
$dataset->name( $name );
237
elsif ( my ($desc) = $line =~ /^\!Series_summary = (.+?)\s*$/ ) {
238
$dataset->description( $desc );
240
elsif ( my ($design) = $line =~ /^\!Series_type = (.+?)\s*$/ ) {
241
$dataset->design( $design );
243
elsif ( my ($design_desc) = $line =~ /^\!Series_overall_design = (.+?)\s*$/ ) {
244
$dataset->design_description( $design_desc );
248
$dataset->samples(\@samples);
251
#################################################
253
=head2 _platforms_doc()
258
Returns : an HTML document containing a table of all platforms
265
my ($self,$url) = @_;
269
$response = $self->get( $url );
272
$self->warn("Can't query website: $@");
275
$self->debug( "resp is $response\n");