UsingTheWSInterface

From BRF-Software
Jump to navigation Jump to search

Using The Web-Services Interface

Synopsis

Web-services allow for interchange of structured data via the internet. EMMA provides a SOAP-based web-service layer to query for expression data. The server has been tested with Perl SOAP::Lite and Java Axis clients.

Available Methods

EMMA WSDL location: https://www.cebitec.uni-bielefeld.de/groups/brf/software/emma/web_service_emma.wsdl Methods:

  • fetchAllProjects()
         o Gets all available EMMA projects.
         o Input:
           --none--
         o Output:
           tns:ArrayOfString -- The projects
  • fetchAllExperiments()
         o Gets all experminents in the given project.
         o Input:
           - xsd:string -- The project
         o Output:
           tns:ArrayOfString -- The experiments
  • fetchAllExperimentalFactorsByExperiment()
         o Gets all factors associated with the given experiment in the given project.
         o Input:
           - xsd:string -- The project
           - xsd:string -- The experiment
         o Output:
           tns:ArrayOfString -- The factors
  • fetchAllExperimentalFactorValuesByFactorAndExperiment()
         o Gets all factor values for given project, experiment and factor.
         o Input:
           - xsd:string -- The project
           - xsd:string -- The experiment
           - xsd:string -- The factor
         o Output:
           tns:ArrayOfString -- The factor value identifiers
  • fetchAllReporterByName()
         o Gets the valid reporter names for the given gene.
         o Input:
           - xsd:string -- The project
           - xsd:string -- The experiment
           - xsd:string -- The gene name
         o Output:
           tns:ArrayOfString -- The valid reporter identifiers
  • fetchLatestSignificantMeanM1WithBestQualityByExperimentAndReporterAndFactorAndFactorValue()
         o Gets the latest significant mean expression value of best quality for the given project, experiment, reporter, factor, and factor value.
         o Input:
           - xsd:string -- The project
           - xsd:string -- The experiment
           - xsd:string -- The reporter
           - xsd:string -- The factor
           - xsd:string -- The factor value
         o Output:
           xsd:double -- The M-value
  • fetchMultipleMvalues()
         o Gets the latest significant mean expression as above but can handle a list of reporters.
         o Input:
           - xsd:string -- The project
           - xsd:string -- The experiment
           - Array of xsd:string -- The list of reporter Identifiers
           - xsd:string -- The factor
           - xsd:string -- The factor value
         o Output:
           Array of GeneMvalueStruct -- A list of GeneIDs and Mvalues

Sample Perl-client

Have a look at the a very simple :-) SOAP::Lite client written in perl.


#!/usr/bin/env perl

use strict;
use warnings;
use SOAP::Lite;
use Data::Dumper;


my $soap = SOAP::Lite->
    service('https://www.cebitec.uni-bielefeld.de/groups/brf/software/emma/web_service_emma.wsdl');
  

print Dumper $soap->fetchAllProjects();
print Dumper $soap->fetchAllExperiments('EMMA2.Coryne-Center');
print Dumper $soap->fetchAllReporterByName('EMMA2.Coryne-Center',  'GlucoseAcetat', "cg0001"); 
print  Dumper $soap-> fetchAllExperimentalFactorsByExperiment ('EMMA2.Coryne-Center','GlucoseAcetat');
print  Dumper $soap-> fetchAllExperimentalFactorValuesByFactorAndExperiment ('EMMA2.Coryne-Center','GlucoseAcetat','Carbon Source');
print Dumper $soap->fetchMultipleMvalues('EMMA2.Coryne-Center', 'GlucoseAcetat',['R:cg0001', 'R:cg0012'], 'Carbon Source', 'Acetat.Glucose');


Here is a more sophisticated client, that can produce a heatmap web-page for some genes of interest:


#!/usr/bin/env perl

use strict;
use Getopt::Std;
use SOAP::Lite; 
use Data::Dumper;
use CGI qw/:standard/;

my $soap = SOAP::Lite->

    service('https://www.cebitec.uni-bielefeld.de/groups/brf/software/emma/web_service_emma.wsdl');
  

my @vals = ();
my $min = my $max = 0;
print "<html><head></head><body><table><tr><th>Gene name</th><th>WT</th><th>Delta hspR (cg3097)</th></tr>";
foreach (('0001'..'0020')) {
    #print "cg$_";
    my $reps = $soap->fetchAllReporterByName('EMMA2:Coryne','Heat Shock',"cg$_");
    next unless ref ($reps) and scalar @$reps;
    my $wt = $soap->fetchLatestSignificantMeanM1WithBestQualityByExperimentAndReporterAndFactorAndFactorValue('EMMA2:Coryne','Heat Shock',$reps->[0],'Strains','WT');
    my $hspr = $soap->fetchLatestSignificantMeanM1WithBestQualityByExperimentAndReporterAndFactorAndFactorValue('EMMA2:Coryne','Heat Shock',$reps->[0],'Strains','Delta hspR (cg3097)');

    push @vals ,["cg$_",$wt,$hspr];
    $min = $wt if $wt < $min;$min = $hspr if $hspr < $min;
    $max =  $wt if $wt > $max; $max = $hspr if $hspr > $max;
    print STDERR '.';

};

foreach (@vals)
{

    my ($v1,$v2,$v3) = (@$_);
    my $red1 = my $red2 = my $green1 = my $green2 = 0;
    if ($max > 0) {
	$red1 = ($v2 > 0)?100*$v2 /$max : 0;
	$red2 = ($v3 > 0)?100*$v3 /$max : 0;
    };
    if ($min < 0) {
	$green1 = ($v2 < 0)? 100*$v2 / $min : 0;
	$green2 = ($v3 < 0)? 100*$v3 / $min : 0;

    };
    print qq|

	<tr> <td >$v1 </td> <td style="background-color:rgb($red1%,$green1%,0%)"  > <span style="color:white">$v2 </span></td> <td style="background-color:rgb($red2%,$green2%,0%)"  > <span style="color:white">$v3</span>
	    </td></tr> |
		;
    
}
print "</table></body></html>\n";

__END__


And here ist the resulting output:

Media:UsingTheWSInterface$test.html