Summary | Included libraries | Package variables | Description | General documentation | Methods |
G::Tools::WebServices - Interface to web services, including BioMOBY and TogoWS
This class is a part of G-language Genome Analysis Environment, collecting interfaces to web services.
keggapi | Description | Code |
togoWS | Description | Code |
ws | Description | Code |
keggapi | code | next | Top |
Name: keggapi - runs KEGG API Description: This is a wrapper around KEGG API REST wrapper, provided at http://rest.g-language.org/keggapi/. |
togoWS | code | prev | next | Top |
Name: togoWS - runs togoWS REST web services Description: This is a wrapper around togoWS REST web services provided at http://togows.dbcls.jp/. |
ws | code | prev | next | Top |
Name: ws - runs web services through BioMOBY Description: This is a wrapper around MOBY::Client::Service to run web services through BioMOBY. Use help -w |
keggapi | description | prev | next | Top |
my $program = shift; return readFile('http://rest.g-language.org/keggapi/' . $program . '/' . join('/', @_), 1);}
togoWS | description | prev | next | Top |
opt_default(db=>'', format=>'', field=>'', search=>''); my @args = opt_get(@_); my %opt = opt_val(); if(length $opt{search}){ $opt{db} = 'uniprot' unless(length $opt{db}); return split(/\n/, get('http://togows.dbcls.jp/search/' . $opt{db} . '/' . $opt{search})); }else{ unless(length $opt{db}){ if($args[0] =~ /^K\d+$/){ $opt{db} = 'orthology'; }elsif($args[0] =~ /^\d\.\d+\.\d+\.\d+$/){ $opt{db} = 'enzyme'; }elsif($args[0] =~ /^C\d+$/){ $opt{db} = 'compound'; }elsif($args[0] =~ /^D\d+$/){ $opt{db} = 'drug'; }elsif($args[0] =~ /^G\d+$/){ $opt{db} = 'glycan'; }elsif($args[0] =~ /^R\d+$/){ $opt{db} = 'reaction'; }elsif($args[0] =~ /^NC_\d+$/){ $opt{db} = 'genbank'; }elsif($args[0] =~ /^BIOMD\d+$/){ $opt{db} = 'biomodels'; }elsif($args[0] =~ /^MODEL\d+$/){ $opt{db} = 'biomodels'; }elsif($args[0] =~ /^GO:\d+$/){ $opt{db} = 'go'; }elsif($args[0] =~ /^IPR\d+$/){ $opt{db} = 'interpro'; }elsif($args[0] =~ /^REACT_\d+$/){ $opt{db} = 'reactome'; }elsif($args[0] =~ /^[a-zA-Z0-9]+_[a-zA-Z0-9]+$/){ $opt{db} = 'uniprot'; }else{ $opt{db} = 'pubmed'; } } my $url = 'http://togows.dbcls.jp/entry/' . $opt{db} . '/' . join(',', @args); $url .= '/' . $opt{field} if (length $opt{field}); $url .= '.' . $opt{format} if (length $opt{format}); return get($url); }}
ws | description | prev | next | Top |
my $service = shift; require MOBY::Client::Central; require MOBY::Client::Service; my $m = MOBY::Client::Central->new(); my %ns = %{$m->retrieveNamespaces()}; my ($sv, $reg) = $m->findService(serviceName=>$service); die("Web Service: $service not found.") unless($sv); my @inputlist; my %hash = @_; foreach my $input (@{$$sv[0]->{input}}){ my ($query, $name) = each %hash; last unless($query); my $article = $input->articleName(); my $xml = ($ns{$name}) ? '<Object id="'.$query.'" namespace="'.$name.'"/>' : '<'.$name.' id="'.$query.'"/>'; push(@inputlist, [$article, $xml]); } my $wsdl = $m->retrieveService($$sv[0]); my $serv = MOBY::Client::Service->new( service => $wsdl ); my $result = $serv->execute(XMLinputlist => [@inputlist]); $result =~ s/\n/=%=/g; if($result =~ /<moby:Simple.*?>(.*)<\/moby:Simple>/){ my $res = $1; $res =~ s/=%=/\n/g; return $res; }}