Skip to content
Snippets Groups Projects
Commit ecfad88a authored by Vermaat's avatar Vermaat
Browse files

Updated SOAP client examples and documentation.

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/soaplib-branch@120 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 0dc8bda1
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ def handler(req):
- ".js" ; Return the raw content of the file (to include JavaScript
from an HTML file).
- ".py" ; Return the content as a downloadable file after it has
been processed by TAL (to generate webservice client
".cs" been processed by TAL (to generate webservice client
files).
By default, the HTML publisher is used for normal HTML files and other
......@@ -98,7 +98,7 @@ def handler(req):
#if
# Process the file with TAL and return the content as a downloadable file.
if req.uri.endswith(".py") :
if req.uri.endswith(".py") or req.uri.endswith(".cs") :
reqFile = req.uri.split('/')[-1]
#req.content_type = 'application/octet-stream'
req.headers_out["Content-Disposition"] = \
......
/*
Compilation instructions:
wsdl 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
gmcs /target:library MutalyzerService.cs -r:System.Web.Services
gmcs /r:MutalyzerService.dll client-mono.cs
*/
using System;
class Mutalyzer {
public static void Main(string [] args) {
checkSyntax c = new checkSyntax();
c.variant = args[0];
Console.WriteLine("Checking " + c.variant);
MutalyzerService mutalyzer = new MutalyzerService();
checkSyntaxResponse result = mutalyzer.checkSyntax(c);
if (result == null)
Console.WriteLine("[No result]");
else
Console.WriteLine(result.checkSyntaxResult);
}
}
#!/usr/bin/python
import logging; logging.basicConfig()
from SOAPpy import WSDL
url = 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
o = WSDL.Proxy(url)
# Get all transcripts that are hit when we look at position 159272155 on
# chromosome 1.
print "hg19", "chr1", 159272155
transcripts = o.getTranscripts(build = "hg19", chrom = "chr1",
pos = 159272155)
if not type(transcripts) == list: transcripts = [transcripts]
for i in transcripts :
print i, o.getGeneName(build = "hg19", accno = i)
# Get all transcripts and genes that have (part of) a transcript in the range
# 159272155-159372155 on chromosome 1
print "\n", "hg19", "chr1", 159272155, 159372155, 1
transcripts = o.getTranscriptsRange(build = "hg19", chrom = "chr1",
pos1 = 159272155, pos2 = 159372155, method = 1)
if not type(transcripts) == list: transcripts = [transcripts]
for i in transcripts :
print i, o.getGeneName(build = "hg19", accno = i)
# Get all transcripts and genes that have the entire transcript in the range
# 159272155-159372155 on chromosome 1
print "\n", "hg19", "chr1", 159272155, 159372155, 0
transcripts = o.getTranscriptsRange(build = "hg19", chrom = "chr1",
pos1 = 159272155, pos2 = 159372155, method = 0)
if not type(transcripts) == list: transcripts = [transcripts]
for i in transcripts :
print i, o.getGeneName(build = "hg19", accno = i)
print "\n"
print o.mappingInfo(LOVD_ver = "123", build = "hg19", accNo = "NM_002001.2",
variant = "c.1del")
print "\n"
print o.transcriptInfo(LOVD_ver = "123", build = "hg19", accNo = "NM_002001.2")
print "\n"
print o.numberConversion(build = "hg19", variant = "NM_002001.2:c.1del")
m = o.transcriptInfo(LOVD_ver = "123", build = "hg19", accNo = "NM_002001.2")
print m.CDS_stop
transcripts = o.getTranscriptsByGeneName(build = "hg19", name = "DMD")
if not type(transcripts) == list: transcripts = [transcripts]
for i in transcripts :
print i
mutalyzerOutput = o.runMutalyzer(variant = "NM_002001.2:g.1del")
print mutalyzerOutput.original
print mutalyzerOutput.mutated
print mutalyzerOutput.origMRNA
print mutalyzerOutput.mutatedMRNA
print mutalyzerOutput.origCDS
print mutalyzerOutput.newCDS
print mutalyzerOutput.origProtein
print mutalyzerOutput.newProtein
print mutalyzerOutput.altProtein
print mutalyzerOutput.errors
print mutalyzerOutput.warnings
print mutalyzerOutput.summary
#!/usr/bin/python
from SOAPpy import WSDL
import logging; logging.basicConfig()
from suds.client import Client
o = WSDL.Proxy("http://<tal tal:replace = "path"></tal>/service.wsdl")
url = 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
c = Client(url)
o = c.service
# Get all transcripts that are hit when we look at position 159272155 on
# Get all transcripts that are hit when we look at position 159272155 on
# chromosome 1.
print "hg19", "chr1", 159272155
for i in o.getTranscripts(build = "hg19", chrom = "chr1",
for i in o.getTranscripts(build = "hg19", chrom = "chr1",
pos = 159272155) :
print i, o.getGeneName(build = "hg19", accno = i)
# Get all transcripts and genes that have (part of) a transcript in the range
# Get all transcripts and genes that have (part of) a transcript in the range
# 159272155-159372155 on chromosome 1
print "\n", "hg19", "chr1", 159272155, 159372155, 1
for i in o.getTranscriptsRange(build = "hg19", chrom = "chr1",
for i in o.getTranscriptsRange(build = "hg19", chrom = "chr1",
pos1 = 159272155, pos2 = 159372155, method = 1) :
print i, o.getGeneName(build = "hg19", accno = i)
# Get all transcripts and genes that have the entire transcript in the range
# Get all transcripts and genes that have the entire transcript in the range
# 159272155-159372155 on chromosome 1
print "\n", "hg19", "chr1", 159272155, 159372155, 0
for i in o.getTranscriptsRange(build = "hg19", chrom = "chr1",
for i in o.getTranscriptsRange(build = "hg19", chrom = "chr1",
pos1 = 159272155, pos2 = 159372155, method = 0) :
print i, o.getGeneName(build = "hg19", accno = i)
print "\n"
print o.mappingInfo(LOVD_ver = "123", build = "hg19", accNo = "NM_002001.2",
print o.mappingInfo(LOVD_ver = "123", build = "hg19", accNo = "NM_002001.2",
variant = "c.1del")
print "\n"
......@@ -41,7 +44,7 @@ print m.CDS_stop
for i in o.getTranscriptsByGeneName(build = "hg19", name = "DMD") :
print i
mutalyzerOutput = o.runMutalyzer(variant = "NM_002001.2:g.1del")
mutalyzerOutput = o.runMutalyzer("NM_002001.2:g.1del")
print mutalyzerOutput.original
print mutalyzerOutput.mutated
print mutalyzerOutput.origMRNA
......
......@@ -8,16 +8,18 @@
<h3>Webservices page</h3>
</center>
<br>
The following programs are example scripts for the webservice. In order
for them to function, you need to have <tt>python-soappy</tt> installed.<br>
All these scripts use the following
<tt><a href = "service.wsdl">service.wsdl</a></tt> file.<br>
<br>
The <tt><a href = "sp.py">sp.py</a></tt> test client. This client retrieves
a list of transcripts, given a chromosome and a genomic position. Of each
of these transcripts, the corresponding gene name is given.<br>
<br>
Also see the <a href = "documentation">documentation</a> page for a full
Most Mutalyzer functionality is available trough a SOAP webservice.
A <a href="service/?wsdl">WSDL description</a> is available
for easy generation of client programs in many languages.
<h3>Example clients</h3>
The following are some example client programs for the webservice.
<ul>
<li>Python client using the suds library: <a href="client-suds.py"><tt>client-suds.py</tt></a>
<li>Python client using the soappy library: <a href="client-soappy.py"><tt>client-soappy.py</tt></a>
<li>Mono client in C#: <a href="client-mono.cs"><tt>client-mono.cs</tt></a>
</ul>
<h3>Documentation</h3>
Also see the <a href = "documentation">documentation</a> page for a full
description of the webservice.
</div>
</body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment