Mercurial > repos > peterjc > samtools_depad
changeset 3:a908d8f33a17 draft
planemo upload for repository https://github.com/peterjc/pico_galaxy/tools/samtools_depad commit e387d5cd1861487502a3d60d3ed56a1cb6ec621a
author | peterjc |
---|---|
date | Wed, 13 May 2015 10:12:45 -0400 |
parents | 8e1e3a1ecad7 |
children | 5a54e8d6200d |
files | tools/samtools_depad/README.rst tools/samtools_depad/samtools_depad.py tools/samtools_depad/samtools_depad.xml tools/samtools_depad/tool_dependencies.xml |
diffstat | 4 files changed, 41 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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))
--- 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 @@ -<tool id="samtools_depad" name="Depad SAM/BAM file" version="0.0.2"> +<tool id="samtools_depad" name="Depad SAM/BAM file" version="0.0.3"> <description>samtools depad</description> <requirements> <requirement type="binary">samtools</requirement> <requirement type="package" version="0.1.19">samtools</requirement> </requirements> + <stdio> + <!-- Assume anything other than zero is an error --> + <exit_code range="1:" /> + <exit_code range=":-1" /> + </stdio> <version_command interpreter="python">samtools_depad.py --version</version_command> <command interpreter="python">samtools_depad.py "$padded_ref" "$input_bam" "$input_bam.ext" "$output_bam"</command> <inputs> @@ -13,11 +18,6 @@ <outputs> <data name="output_bam" format="bam" label="$input_bam.name (depad)" /> </outputs> - <stdio> - <!-- Assume anything other than zero is an error --> - <exit_code range="1:" /> - <exit_code range=":-1" /> - </stdio> <tests> <test> <param name="padded_ref" value="sam_spec_padded.fasta" ftype="fasta" />
--- 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 @@ <?xml version="1.0"?> <tool_dependency> <package name="samtools" version="0.1.19"> - <repository changeset_revision="632f1a03db92" name="package_samtools_0_1_19" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="0e56e4dac6e7" name="package_samtools_0_1_19" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> </tool_dependency>