# HG changeset patch # User peterjc # Date 1431526502 14400 # Node ID 01f8967ce1e0db6daa8536cf9d58a68cfa5cdd20 # Parent 2d303f2e09e0f15c95e660e6c4bd2457c7707c4c v0.0.3; internal changes to help packaging with planemo diff -r 2d303f2e09e0 -r 01f8967ce1e0 tools/samtools_depad/README.rst --- a/tools/samtools_depad/README.rst Fri Nov 21 06:37:20 2014 -0500 +++ b/tools/samtools_depad/README.rst Wed May 13 10:15:02 2015 -0400 @@ -1,7 +1,7 @@ Galaxy wrapper for samtools depad ================================= -This wrapper is copyright 2014 by Peter Cock, The James Hutton Institute +This wrapper is copyright 2014-2015 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below. @@ -21,7 +21,7 @@ Manual Installation =================== -This expects samtools to be on the $PATH, and was tested using v0.1.19. +This expects samtools to be on the ``$PATH``, and was tested using v0.1.19. To install the wrapper copy or move the following files under the Galaxy tools folder, e.g. in a ``tools/samtools_depad`` folder: @@ -35,10 +35,10 @@ -If you wish to run the unit tests, also add this to ``tools_conf.xml.sample`` -and move/copy the ``test-data`` files under Galaxy's ``test-data`` folder. Then:: +If you wish to run the unit tests, also move/copy the ``test-data/`` files +under Galaxy's ``test-data/`` folder. Then:: - $ ./run_functional_tests.sh -id samtools_depad + $ ./run_tests.sh -id samtools_depad That's it. @@ -49,7 +49,11 @@ ======= ====================================================================== Version Changes ------- ---------------------------------------------------------------------- -v0.0.1 - Initial public release +v0.0.1 - Initial public release. +v0.0.2 - Embed samtools citation in the tool XML. + - Removed unused imports from Python wrapper script. +v0.0.3 - Reorder XML elements (internal change only). + - Planemo for Tool Shed upload (``.shed.yml``, internal change only). ======= ====================================================================== @@ -59,22 +63,31 @@ Development is on this GitHub repository: https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_depad -For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use -the following command from the Galaxy root folder:: +For pushing a release to the test or main "Galaxy Tool Shed", use the following +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):: - $ tar -czf samtools_depad.tar.gz tools/samtools_depad/README.rst tools/samtools_depad/samtools_depad.xml tools/samtools_depad/samtools_depad.py tools/samtools_depad/tool_dependencies.xml test-data/sam_spec_padded.fasta test-data/sam_spec_padded.sam test-data/sam_spec_padded.bam test-data/sam_spec_padded.depad.bam + $ planemo shed_upload --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_depad/ + ... + +or:: -Check this worked:: + $ planemo shed_upload --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_depad/ + ... + +To just build and check the tar ball, use:: - $ tar -tzf samtools_depad.tar.gz - tools/samtools_depad/README.rst - tools/samtools_depad/samtools_depad.xml - tools/samtools_depad/samtools_depad.py - tools/samtools_depad/tool_dependencies.xml + $ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/samtools_depad/ + ... + $ tar -tzf shed_upload.tar.gz + test-data/sam_spec_padded.bam + test-data/sam_spec_padded.depad.bam test-data/sam_spec_padded.fasta test-data/sam_spec_padded.sam - test-data/sam_spec_padded.bam - test-data/sam_spec_padded.depad.bam + tools/samtools_depad/README.rst + tools/samtools_depad/samtools_depad.py + tools/samtools_depad/samtools_depad.xml + tools/samtools_depad/tool_dependencies.xml Licence (MIT) diff -r 2d303f2e09e0 -r 01f8967ce1e0 tools/samtools_depad/samtools_depad.py --- a/tools/samtools_depad/samtools_depad.py Fri Nov 21 06:37:20 2014 -0500 +++ b/tools/samtools_depad/samtools_depad.py Wed May 13 10:15:02 2015 -0400 @@ -11,31 +11,29 @@ """ import sys import os -import subprocess -import tempfile if "-v" in sys.argv or "--version" in sys.argv: #Galaxy seems to invert the order of the two lines - print "(Galaxy wrapper v0.0.1)" + print "(Galaxy wrapper v0.0.2)" cmd = "samtools 2>&1 | grep -i ^Version" sys.exit(os.system(cmd)) -def stop_err(msg, error_level=1): - """Print error message to stdout and quit with given error level.""" - sys.stderr.write("%s\n" % msg) - sys.exit(error_level) +def sys_exit(msg, error_level=1): + """Print error message to stdout and quit with given error level.""" + sys.stderr.write("%s\n" % msg) + sys.exit(error_level) if len(sys.argv) != 5: - stop_err("Require four arguments: padded FASTA, SAM/BAM file, format (SAM or BAM), output BAM filenames") + sys_exit("Require four arguments: padded FASTA, SAM/BAM file, format (SAM or BAM), output BAM filenames") padded_ref, bam_filename, input_format, output_filename = sys.argv[1:] if not os.path.isfile(padded_ref): - stop_err("Input padded reference FASTA file not found: %s" % padded_ref) + sys_exit("Input padded reference FASTA file not found: %s" % padded_ref) if not os.path.isfile(bam_filename): - stop_err("Input BAM file not found: %s" % bam_filename) + sys_exit("Input BAM file not found: %s" % bam_filename) if input_format.lower() not in ["sam", "bam"]: - stop_err("Input format should be SAM or BAM, not %r" % input_format) + sys_exit("Input format should be SAM or BAM, not %r" % input_format) #Run samtools depad: if input_format.lower() == "sam": @@ -45,4 +43,4 @@ return_code = os.system(cmd) if return_code: - stop_err("Return code %i from command:\n%s" % (return_code, cmd)) + sys_exit("Return code %i from command:\n%s" % (return_code, cmd)) diff -r 2d303f2e09e0 -r 01f8967ce1e0 tools/samtools_depad/samtools_depad.xml --- a/tools/samtools_depad/samtools_depad.xml Fri Nov 21 06:37:20 2014 -0500 +++ b/tools/samtools_depad/samtools_depad.xml Wed May 13 10:15:02 2015 -0400 @@ -1,9 +1,14 @@ - + samtools depad samtools samtools + + + + + samtools_depad.py --version samtools_depad.py "$padded_ref" "$input_bam" "$input_bam.ext" "$output_bam" @@ -13,11 +18,6 @@ - - - - - @@ -56,4 +56,7 @@ This wrapper is available to install into other Galaxy Instances via the Galaxy Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/samtools_depad + + 10.1093/bioinformatics/btp352 + diff -r 2d303f2e09e0 -r 01f8967ce1e0 tools/samtools_depad/tool_dependencies.xml --- a/tools/samtools_depad/tool_dependencies.xml Fri Nov 21 06:37:20 2014 -0500 +++ b/tools/samtools_depad/tool_dependencies.xml Wed May 13 10:15:02 2015 -0400 @@ -1,6 +1,6 @@ - +