Bio::DB::Expression geo
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::DB::Expression::geo - *** DESCRIPTION of Class
Package variables
No package variables defined.
Included modules
Bio::Expression::Contact
Bio::Expression::DataSet
Bio::Expression::Platform
Bio::Expression::Sample
Inherit
Bio::DB::Expression
Synopsis
*** Give standard usage here
Description
*** Describe the object here
Methods
_initializeDescriptionCode
get_platformsDescriptionCode
get_samplesDescriptionCode
get_contactsDescriptionCode
get_datasetsDescriptionCode
fill_sample
No description
Code
fill_dataset
No description
Code
_get_url
No description
Code
Methods description
_initialize()code    nextTop
 Usage   : $obj->_initialize(%arg);
Function: Internal method to initialize a new Bio::DB::Expression::geo object
Returns : true on success
Args : Arguments passed to new()
get_platforms()codeprevnextTop
 Usage   :
Function:
Example :
Returns : a list of Bio::Expression::Platform objects
Args :
get_samples()codeprevnextTop
 Usage   :
Function:
Example :
Returns : a list of Bio::Expression::Sample objects
Args :
get_contacts()codeprevnextTop
 Usage   :
Function:
Example :
Returns : a list of Bio::Expression::Contact objects
Args :
get_datasets()codeprevnextTop
 Usage   : $db->get_datasets('accession');
Function:
Example :
Returns : a list of Bio::Expression::DataSet objects
Args :
Methods code
_initializedescriptionprevnextTop
sub _initialize {
  my($self,%arg) = @_;

  foreach my $arg (keys %arg){
    my $marg = $arg;
    $marg =~ s/^-//;
    $self->$marg($arg{$arg}) if $self->can($marg);
  }

  return 1;
}
get_platformsdescriptionprevnextTop
sub get_platforms {
  my ($self,@args) = @_;

  my $doc = $self->_get_url( URL_PLATFORMS );
  $doc =~ s!^.+?>Release date<.+?</tr>(.+)</table>!$1!gs;

  my @platforms = ();
  my @records = split m!</tr>\s+<tr>!, $doc;
foreach my $record ( @records ) { my ($platform_acc,$name,$tax_acc,$contact_acc,$contact_name) = $record =~ m!acc\.cgi\?acc=(.+?)".+?<td.+?>(.+?)<.+?<td.+?>.+?<.+?<td.+?>.+?href=".+?id=(.+?)".+?<td.+?OpenSubmitter\((\d+?)\).+?>(.+?)<!s;
next unless $platform_acc; my $platform = Bio::Expression::Platform->new( -accession => $platform_acc, -name => $name, -_taxon_id => $tax_acc, -contact => Bio::Expression::Contact->new( -source => 'geo', -accession => $contact_acc, -name => $contact_name, -db => $self ), -db => $self, ); push @platforms, $platform; } return @platforms;
}
get_samplesdescriptionprevnextTop
sub get_samples {
  my ($self,@args) = @_;
  $self->throw_not_implemented();
}
get_contactsdescriptionprevnextTop
sub get_contacts {
  my ($self,@args) = @_;
  $self->throw_not_implemented();
}
get_datasetsdescriptionprevnextTop
sub get_datasets {
  my ($self,$platform) = @_;

  my @lines = split /\n/, $self->_get_url( URL_PLATFORM . $platform->accession );

  my @datasets = ();

  foreach my $line ( @lines ) {
    my ($dataset_acc) = $line =~ /^\!Platform_series_id = (\S+?)\s*$/;
    next unless $dataset_acc;

    my $dataset = Bio::Expression::DataSet->new(
                                                -accession => $dataset_acc,
                                                -platform => $platform,
                                                -db => $self,
                                               );

    push @datasets, $dataset;
  }

  return @datasets;
}
fill_sampledescriptionprevnextTop
sub fill_sample {
  my ( $self, $sample ) = @_;

  my @lines = split /\n/, $self->_get_url( URL_SAMPLE. $sample->accession );

  foreach my $line ( @lines ) {
    if ( my ($name) = $line =~ /^\!Sample_title = (.+?)\s*$/ ) {
      $sample->name( $name );
    }
    elsif ( my ($desc) = $line =~ /^\!Sample_characteristics.*? = (.+?)\s*$/ ) {
      $sample->description( $desc );
    }
    elsif ( my ($source_name) = $line =~ /^\!Sample_source_name.*? = (.+?)\s*$/ ) {
      $sample->source_name( $source_name );
    }
    elsif ( my ($treatment_desc) = $line =~ /^\!Sample_treatment_protocol.*? = (.+?)\s*$/ ) {
      $sample->treatment_description( $treatment_desc );
    }
  }
  return 1;
}
fill_datasetdescriptionprevnextTop
sub fill_dataset {
  my ( $self, $dataset ) = @_;

  my @lines = split /\n/, $self->_get_url( URL_DATASET . $dataset->accession );

  my @samples = ();

  foreach my $line ( @lines ) {
    if ( my ($sample_acc) = $line =~ /^\!Series_sample_id = (\S+?)\s*$/ ) {
      my $sample = Bio::Expression::Sample->new(
                                                -accession => $sample_acc,
                                                -dataset => $dataset,
                                                -db => $self,
                                               );
      push @samples, $sample;
    }
    elsif ( my ($pubmed_acc) = $line =~ /^\!Series_pubmed_id = (.+?)\s*$/ ) {
      $dataset->pubmed_id( $pubmed_acc );
    }
    elsif ( my ($web_link) = $line =~ /^\!Series_web_link = (.+?)\s*$/ ) {
      $dataset->web_link( $web_link );
    }
    elsif ( my ($contact) = $line =~ /^\!Series_contact_name = (.+?)\s*$/ ) {
      $dataset->contact( $contact );
    }
    elsif ( my ($name) = $line =~ /^\!Series_title = (.+?)\s*$/ ) {
      $dataset->name( $name );
    }
    elsif ( my ($desc) = $line =~ /^\!Series_summary = (.+?)\s*$/ ) {
      $dataset->description( $desc );
    }
    elsif ( my ($design) = $line =~ /^\!Series_type = (.+?)\s*$/ ) {
      $dataset->design( $design );
    }
    elsif ( my ($design_desc) = $line =~ /^\!Series_overall_design = (.+?)\s*$/ ) {
      $dataset->design_description( $design_desc );
    }
  }

  $dataset->samples(\@samples);
}

#################################################
}
_get_urldescriptionprevnextTop
sub _get_url {
  my ($self,$url) = @_;

  my $response;
  eval {
    $response = $self->get( $url );
  };
  if( $@ ) {
    $self->warn("Can't query website: $@");
    return;
  }
  $self->debug( "resp is $response\n"); 

  return $response;
}


1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to the
Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support Top
Please direct usage questions or support issues to the mailing list:
bioperl-l@bioperl.org
rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via the
web:
  https://redmine.open-bio.org/projects/bioperl/
AUTHORTop
Allen Day <allenday@ucla.edu>
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a '_'. Methods are
in alphabetical order for the most part.
_platforms_doc()Top
 Usage   :
Function:
Example :
Returns : an HTML document containing a table of all platforms
Args :