Web Services
Content
Description
This help document describes the infrastructure for automated and remote access to data within the database. Web services are provided using common standards, such as Simple Object Access Protocol (SOAP). This enables both local and remote researchers to connect to an installation of the database and retrieve data using pre-defined methods, without needing to resort to use of a web browser. The methods that are currently available are described below.Data can currently be retrieved by an experiment handle. An experiment handle is retrieved by an experiment identification number, or the ExptID. Currently, one can obtain the meta data for a hybridization or a public url to download raw data for an hybridization.
There are also services to retrieve all experiment handles for an experimenter, an organism, or a publication within the database. Sample scripts are included below.
Obtaining List Data
There are four methods for obtaining data from hybridizations within the database: by experimenter, by organism, by category, and by publication. In order to know what data currently exist in the database, there are three methods that allow one to list data within the database.List all organisms
This method returns a hash of all organisms in the database that have a public experiment available to view. The hash key is the Organism abbreviation and the hash value is the Genus and species name of the organism. For example
HS => Homo sapiens
MM => Mus musculus
- Sample Perl Code
my $organismHash = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl')
-> Organism
-> result;
- Sample Perl Code
List all categories
This method returns a hash of all categories in the database that annotate a public experiment available to view and their descriptions.- Sample Perl Code
my $catHash = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl') -> Category
-> result;
- Sample Perl Code
List all publications
This method returns a hash table containing all the publications available in the database. The hash key is the publication ID in the database and the hash value is a short citation corresponding to the publication. For example:
205 => Helmann JD, et al. (2003). J Bacteriol 185(1):243-53
133 => Matrajt M, et al. (2002). Mol Microbiol 44(3):735-47
207 => Mueller A, et al. (2003) Proc Natl Acad Sci USA 100, 1292-1297
- Sample Perl Code
my $publicationHash = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl')
-> Publication
-> result;
- Sample Perl Code
Obtaining An Experiment Identifier
If you know an experiment identifier (exptid) for which you would like to retrieve data than you may skip this step. If you do not already have an expeirment identifier, you may use one of the methods above to obtain a group of experiments for a particular annotaion, such as category, experimenter or publication.
Get all experiments for an organism
This method returns an array of experiment identifers from the database for all public experiments for a given organism, in the example below homo sapiens.my $exptOrg = SOAP::Lite
use SOAP::Lite;- -> uri('http://smd.stanford.edu/Experiment')
-> proxy('http://smd.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptByOrgansim ('HS')
-> result;
Get all experiments for an experimenter
This method returns an array of experiment identifers from the database for all public experiments for a given experimenter, in the example below 'SPELLMAN'.my $exptExpter = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptByExperimenter ('SPELLMAN')
-> result;
Get all experiments for a category
This method returns an array of experiment identifers from the database for all public experiments for a given category in the database, in the example below 'Batten Disease'.my $resCat = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptCategory('Batten disease')
-> result;
Get all experiments for a publication
This method returns an array of experiment identifers from the database for a publication identifier.my $resPub = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptPub('7')
-> result;
Obtaining Experiment Information
Once you have an experiment identifier(s), you can obtain either the meta data for that experiment or grab the raw data via a public ftp URL.
Retieve Meta data for an experiment
This method retrieves the meta data for an experiment identifier. You can request the data either as an xml file or as a hash table with a parameter 'xml' or 'hash_table'. This parameter must be passed to the arguement.my $metaData = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptMetaData (2341, 'xml')
-> result;
Retieve URL for raw experiment data
This method returns a URL to a public ftp site to download the raw data for an experiment identifier. For more information please see the help documentation.my $exptURL = SOAP::Lite
- -> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptFTP (2341)
-> result;
Sample Client Script
#!/usr/bin/perl -w
use strict;
use SOAP::Lite;
##############################################
#########Get List Data from SMD #############
##############################################
##Get a hash of all organisms with public data in the database
my $organismHash = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl')
-> Organism
-> result;
foreach my $organism (keys %{$organismHash}){
print "$organism\t$$organismHash{$organism}\n";
}
##Get an array of all categories with public data in the database
my $catHash = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl')
-> Category
-> result;
foreach my $cat (keys %{$catHash}{
print "$cat\t$$catHash{$cat}\n";
}
##Get a hash of all publications in the database
my $publicationHash = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/listData')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/listData.pl')
-> Publication
-> result;
foreach my $pub (keys %{$publicationHash}){
print "$pub\t$$publicationHash{$pub}\n";
}
###########################################
#######Grab an SMD experiment handle#######
###########################################
########by experimenter####################
my $exptExpter = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptByExperimenter ('SPELLMAN')
-> result;
print "@{$exptExpter}\n" if defined $$exptExpter[0];
#########by organism#######################
my $exptOrg = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptByOrgansim ('VC')
-> result;
print "@{$exptOrg}\n" if defined ($$exptOrg[0]);
########by category#######################
my $resCat = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptCategory('Batten disease')
-> result;
#print "@{$resCat}\n" if defined ($$resCat[0]);
########by publication#######################
my $resPub = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptPub('7')
-> result;
print "@{$resPub}\n" if defined ($$resCat[0]);
###########################################
####### Get Experiment Data #######
###########################################
#get meta data from an experiment
my $metaData = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptMetaData (2341, 'xml')
###state the form of returned data, either 'xml' or 'hash table'
-> result;
print "$metaData\n";
#########Get Raw Data For ExptID #############
my $exptURL = SOAP::Lite
-> uri('http://genome-www5.stanford.edu/Experiment')
-> proxy('http://genome-www5.stanford.edu/cgi-bin/tools/webservices/exptHandle.pl')
-> ExptFTP (2341)
-> result;
print "$exptURL\n";
Please send comments or questions to: array@genome.stanford.edu
