# HG changeset patch # User peterjc # Date 1431526365 14400 # Node ID a908d8f33a178ae78b832cee673130f53464b274 # Parent 8e1e3a1ecad7612affd41a3aade41b1085826b66 planemo upload for repository https://github.com/peterjc/pico_galaxy/tools/samtools_depad commit e387d5cd1861487502a3d60d3ed56a1cb6ec621a diff -r 8e1e3a1ecad7 -r a908d8f33a17 tools/samtools_depad/README.rst --- a/tools/samtools_depad/README.rst Fri Nov 28 11:47:41 2014 -0500 +++ b/tools/samtools_depad/README.rst Wed May 13 10:12:45 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. @@ -51,6 +51,9 @@ ------- ---------------------------------------------------------------------- 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). ======= ====================================================================== @@ -60,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 8e1e3a1ecad7 -r a908d8f33a17 tools/samtools_depad/samtools_depad.py --- a/tools/samtools_depad/samtools_depad.py Fri Nov 28 11:47:41 2014 -0500 +++ b/tools/samtools_depad/samtools_depad.py Wed May 13 10:12:45 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 8e1e3a1ecad7 -r a908d8f33a17 tools/samtools_depad/samtools_depad.xml --- a/tools/samtools_depad/samtools_depad.xml Fri Nov 28 11:47:41 2014 -0500 +++ b/tools/samtools_depad/samtools_depad.xml Wed May 13 10:12:45 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 @@ - - - - - diff -r 8e1e3a1ecad7 -r a908d8f33a17 tools/samtools_depad/tool_dependencies.xml --- a/tools/samtools_depad/tool_dependencies.xml Fri Nov 28 11:47:41 2014 -0500 +++ b/tools/samtools_depad/tool_dependencies.xml Wed May 13 10:12:45 2015 -0400 @@ -1,6 +1,6 @@ - +