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

SOAP example client for getGeneName

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@662 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent a84b70ea
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
"""
Get gene name from a transcript accession number.
Usage:
{command} transcript [build]
transcript: Transcript accession number, e.g. 'NM_002001.2'.
build: Human genome build, 'hg18' or 'hg19' (default: 'hg19').
The transcript gene name is retrieved from the Mutalyzer SOAP web service and
printed to standard output.
"""
from mutalyzer.util import monkey_patch_suds; monkey_patch_suds()
import sys
from suds.client import Client
from mutalyzer.util import format_usage
WSDL_LOCATION = 'http://localhost/mutalyzer/services/?wsdl'
def main(transcript, build='hg19'):
"""
Get transcript gene name and print it to standard output.
"""
service = Client(WSDL_LOCATION, cache=None).service
result = service.getGeneName(build, transcript)
if result:
print str(result)
if __name__ == '__main__':
if len(sys.argv) < 2:
print format_usage()
sys.exit(1)
main(*sys.argv[1:])
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