diff --git a/extras/soap-tools/descriptionExtract.py b/extras/soap-tools/descriptionExtract.py new file mode 100755 index 0000000000000000000000000000000000000000..d1ff2b90bc313e97f5a0986f9fc00430fb809906 --- /dev/null +++ b/extras/soap-tools/descriptionExtract.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python +""" +Extract the HGVS variant description from a reference sequence and an observed +sequence. + +Usage: + {command} reference observed + + reference: Reference DNA sequence. + observed: Observed DNA sequence. + +The extracted HGVS description is retrieved from the Mutalyzer SOAP webservice +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(reference, observed): + """ + Extract the HGVS variant description from a reference sequence and an + observed sequence. + """ + service = Client(WSDL_LOCATION, cache=None).service + result = service.descriptionExtract(reference, observed) + + if result: + print result.description + else: + print 'No description returned.' + + +if __name__ == '__main__': + if len(sys.argv) != 3: + print format_usage() + sys.exit(1) + main(*sys.argv[1:]) diff --git a/mutalyzer/services/rpc.py b/mutalyzer/services/rpc.py index 6551e3dfa96418ecd07827aa094d081b2371fca1..0270a19486bbca21f9d7860f6ed88d5f5fe19589 100644 --- a/mutalyzer/services/rpc.py +++ b/mutalyzer/services/rpc.py @@ -539,7 +539,7 @@ class MutalyzerService(ServiceBase): return result #chromosomeName - @srpc(Mandatory.String, Mandatory.String, String, + @srpc(Mandatory.String, Mandatory.String, String, _returns=Array(Mandatory.String)) def numberConversion(build, variant, gene=None): """ @@ -1029,6 +1029,8 @@ class MutalyzerService(ServiceBase): """ Extract the HGVS variant description from a reference sequence and an observed sequence. + + Note that this only works on DNA sequences for now. """ output = Output(__file__) @@ -1036,7 +1038,7 @@ class MutalyzerService(ServiceBase): 'Received request descriptionExtract') result = Allele() - result.allele = describe.describeDNA(reference, observed) + result.allele = describe.describe(reference, observed) result.description = describe.alleleDescription(result.allele) output.addMessage(__file__, -1, 'INFO',