# HG changeset patch # User peterjc # Date 1485950281 18000 # Node ID 683ea5ab0008361a5ebd56068899058a9b9cd831 # Parent 5f5a358b281fe4bcf1c991c282291c48ee9dca0f v0.0.6 Fixed input parameter help text diff -r 5f5a358b281f -r 683ea5ab0008 tools/mummer/README.rst --- a/tools/mummer/README.rst Wed Aug 05 11:34:31 2015 -0400 +++ b/tools/mummer/README.rst Wed Feb 01 06:58:01 2017 -0500 @@ -1,7 +1,7 @@ Galaxy wrapper for drawing dotplots using MUMmer 3 ================================================== -This wrapper is copyright 2014-2015 by Peter Cock, The James Hutton Institute +This wrapper is copyright 2014-2016 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below. @@ -65,6 +65,8 @@ - Test case added. v0.0.5 - Reorder XML elements (internal change only). - Planemo for Tool Shed upload (``.shed.yml``, internal change only). +v0.0.6 - PEP8 style changes to Python script (internal change only). + - Fixed display of input parameter help text. ======= ====================================================================== @@ -79,12 +81,12 @@ Planemo commands (which requires you have set your Tool Shed access details in ``~/.planemo.yml`` and that you have access rights on the Tool Shed):: - $ planemo shed_update --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/mummer/ + $ planemo shed_update -t testtoolshed --check_diff ~/repositories/pico_galaxy/tools/mummer/ ... or:: - $ planemo shed_update --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/mummer/ + $ planemo shed_update -t toolshed --check_diff ~/repositories/pico_galaxy/tools/mummer/ ... To just build and check the tar ball, use:: diff -r 5f5a358b281f -r 683ea5ab0008 tools/mummer/mummer.py --- a/tools/mummer/mummer.py Wed Aug 05 11:34:31 2015 -0400 +++ b/tools/mummer/mummer.py Wed Feb 01 06:58:01 2017 -0500 @@ -14,17 +14,14 @@ import tempfile import shutil -def sys_exit( msg ): - sys.stderr.write("%s\n" % msg) - sys.exit(1) def run(cmd): print(cmd) return_code = os.system(cmd) if return_code: - sys_exit("Error %i from: %s" % (return_code, cmd)) + sys.exit("Error %i from: %s" % (return_code, cmd)) -if "-v" in sys.argv [1:]or "--version" in sys.argv[1:]: +if "-v" in sys.argv[1:]or "--version" in sys.argv[1:]: print("MUMmer wrapper v0.0.3\n") # TODO - How to get a version string from the mummer binary? os.system("nucmer --version") @@ -32,29 +29,29 @@ os.system("mummerplot --version") sys.exit(0) -#Parse Command Line -#TODO - optparse +# Parse Command Line +# TODO - optparse try: fasta_a, fasta_b, algorithm, png_out, pdf_out = sys.argv[1:] -except: - sys_exit("Expect 5 arguments, got %i" % (len(sys.argv) - 1)) +except ValueError: + sys.exit("Expect 5 arguments, got %i" % (len(sys.argv) - 1)) valid_algo = ["mummer", "nucmer", "promer"] if algorithm not in valid_algo: - sys_exit("Invalid algorithm argument %r, should be: %s" % (algorithm, ", ".join(valid_algo))) + sys.exit("Invalid algorithm argument %r, should be: %s" % (algorithm, ", ".join(valid_algo))) base_path = tempfile.mkdtemp() prefix = os.path.join(base_path, "ref_qry") coords = prefix + ".mums" -#gnuplot = prefix + ".gp" +# gnuplot = prefix + ".gp" ps_image = prefix + ".ps" png_image = prefix + ".png" if algorithm == "mummer": - #Add -mum as per example to find maximal unique matches between ref and query. - #Add the -b -c options to search both strands and report relative to forward strand - #which then matches the default dual-strand approach in nucmer and promer + # Add -mum as per example to find maximal unique matches between ref and query. + # Add the -b -c options to search both strands and report relative to forward strand + # which then matches the default dual-strand approach in nucmer and promer cmd = '%s -mum -b -c "%s" "%s" > %s' % (algorithm, fasta_a, fasta_b, coords) else: coords = "out.delta" @@ -80,6 +77,6 @@ cmd = 'ps2pdf -dEPSCrop "%s" "%s"' % (ps_image, pdf_out) run(cmd) -#Remove temp files... -os.remove(coords) # Might not be under the temp directory... +# Remove temp files... +os.remove(coords) # Might not be under the temp directory... shutil.rmtree(base_path) diff -r 5f5a358b281f -r 683ea5ab0008 tools/mummer/mummer.xml --- a/tools/mummer/mummer.xml Wed Aug 05 11:34:31 2015 -0400 +++ b/tools/mummer/mummer.xml Wed Feb 01 06:58:01 2017 -0500 @@ -1,4 +1,4 @@ - + Combine mummer/nucmer/promer with mummerplot @@ -29,10 +29,10 @@ + help="Nucleotide FASTA file, e.g. contigs from genome assembly." /> + help="Nucleotide FASTA file, e.g. contigs from genome assembly." /> diff -r 5f5a358b281f -r 683ea5ab0008 tools/mummer/tool_dependencies.xml --- a/tools/mummer/tool_dependencies.xml Wed Aug 05 11:34:31 2015 -0400 +++ b/tools/mummer/tool_dependencies.xml Wed Feb 01 06:58:01 2017 -0500 @@ -7,6 +7,6 @@ - +