| 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.
| blastall | No description | Code |
| emboss | Description | Code |
| keggapi | Description | Code |
| seqret | No description | Code |
| togoWS | Description | Code |
| ws | Description | Code |
| emboss | code | next | Top |
Name: emboss - run EMBOSS applications and KBWS via REST service
Description:
This is a wrapper around EMBOSS REST service provided at
http://rest.g-language.org/emboss/. |
| keggapi | code | prev | 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 |
| blastall | description | prev | next | Top |
warn("This method is deprecated. Use emboss('kblast') instead."); emboss('kblast', @_);}
| emboss | description | prev | next | Top |
opt_default(); my @args = opt_get(@_); my $program = shift; my @argv; my %file; my $i = 1; for my $tmp (@args){ if(-e $tmp){ $file{"file$i"} = [$tmp]; $i ++; }else{ push(@argv, $tmp); } } my %options = opt_val(); foreach my $key (keys %options){ if ($options{$key} eq '1'){ push(@argv, '-' . $key); }else{ push(@argv, $key . '=' . $options{$key}); } } require LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->post("http://rest.g-language.org/emboss/", Content_Type=>'multipart/form-data', Content=>[ %file, 'arg'=>join('/', @argv)] ); if ($response->is_redirect) { return $response->header('Location'); }elsif ($response->is_success) { return $response->content; }else{ die $response->status_line; }}
| keggapi | description | prev | next | Top |
my $program = shift; return readFile('http://rest.g-language.org/keggapi/' . $program . '/' . join('/', @_), 1);}
| seqret | description | prev | next | Top |
warn("This method is deprecated. Use emboss() instead."); emboss('seqret', @_);}
| 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] =~ /^[A-Z][A-Z]_\d+$/){ $opt{db} = 'nuccore'; }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'; } } @args = readFile('http://rest.g-language.org/gbp/wild.pl?id=' . $args[0], 1) if($args[0] =~ /\*/); 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; eval{ require MOBY::Client::Central; require MOBY::Client::Service; }; if($@){ croak "MOBY::Client::Central does not seem to be installed. Try'cpan MOBY::Client::Central' to install this module to enable BioMOBY support."; } 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; }}