# HG changeset patch # User peterjc # Date 1431527652 14400 # Node ID 242f1a5a9277a745f5edeabc34895f1375635f8e # Parent 3070949d8fd7850037d0838742274bcb30c9cf0e planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_idxstats commit ddda833946bc691eacf9c116695bda3a1bbdbf19 diff -r 3070949d8fd7 -r 242f1a5a9277 tools/samtools_idxstats/README.rst --- a/tools/samtools_idxstats/README.rst Fri Nov 21 07:02:43 2014 -0500 +++ b/tools/samtools_idxstats/README.rst Wed May 13 10:34:12 2015 -0400 @@ -1,7 +1,7 @@ Galaxy wrapper for samtools idxstats ==================================== -This wrapper is copyright 2013-2014 by Peter Cock, The James Hutton Institute +This wrapper is copyright 2013-2015 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below. @@ -52,6 +52,8 @@ v0.0.1 - Initial public release v0.0.2 - Use quoted filenames when calling samtools (in case of spaces etc) v0.0.3 - Embed samtools citation in tool XML. +v0.0.4 - Reorder XML elements (internal change only). + - Planemo for Tool Shed upload (``.shed.yml``, internal change only). ======= ====================================================================== @@ -61,20 +63,30 @@ Development is on this GitHub repository: https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_idxstats -For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use -the following command from the Galaxy root folder:: - $ tar -czf samtools_idxstats.tar.gz tools/samtools_idxstats/README.rst tools/samtools_idxstats/samtools_idxstats.xml tools/samtools_idxstats/samtools_idxstats.py tools/samtools_idxstats/tool_dependencies.xml test-data/ex1.bam test-data/ex1.idxstats.tabular +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):: + + $ planemo shed_upload --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_idxstats/ + ... -Check this worked:: +or:: + + $ planemo shed_upload --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_idxstats/ + ... - $ tar -tzf samtools_idxstats.tar.gz - tools/samtools_idxstats/README.rst - tools/samtools_idxstats/samtools_idxstats.xml - tools/samtools_idxstats/samtools_idxstats.py - tools/samtools_idxstats/tool_dependencies.xml +To just build and check the tar ball, use:: + + $ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/samtools_idxstats/ + ... + $ tar -tzf shed_upload.tar.gz test-data/ex1.bam test-data/ex1.idxstats.tabular + tools/samtools_idxstats/README.rst + tools/samtools_idxstats/samtools_idxstats.py + tools/samtools_idxstats/samtools_idxstats.xml + tools/samtools_idxstats/tool_dependencies.xml Licence (MIT) diff -r 3070949d8fd7 -r 242f1a5a9277 tools/samtools_idxstats/samtools_idxstats.py --- a/tools/samtools_idxstats/samtools_idxstats.py Fri Nov 21 07:02:43 2014 -0500 +++ b/tools/samtools_idxstats/samtools_idxstats.py Wed May 13 10:34:12 2015 -0400 @@ -21,22 +21,22 @@ cmd = "samtools 2>&1 | grep -i ^Version" sys.exit(os.system(cmd)) -def stop_err(msg, error_level=1): +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) != 4: - stop_err("Require three arguments: BAM, BAI, tabular filenames") + sys_exit("Require three arguments: BAM, BAI, tabular filenames") bam_filename, bai_filename, tabular_filename = sys.argv[1:] 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 not os.path.isfile(bai_filename): if bai_filename == "None": - stop_err("Error: Galaxy did not index your BAM file") - stop_err("Input BAI file not found: %s" % bai_filename) + sys_exit("Error: Galaxy did not index your BAM file") + sys_exit("Input BAI file not found: %s" % bai_filename) #Assign sensible names with real extensions, and setup symlinks: tmp_dir = tempfile.mkdtemp() @@ -58,4 +58,4 @@ os.rmdir(tmp_dir) 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 3070949d8fd7 -r 242f1a5a9277 tools/samtools_idxstats/samtools_idxstats.xml --- a/tools/samtools_idxstats/samtools_idxstats.xml Fri Nov 21 07:02:43 2014 -0500 +++ b/tools/samtools_idxstats/samtools_idxstats.xml Wed May 13 10:34:12 2015 -0400 @@ -1,9 +1,14 @@ - + samtools idxstats samtools samtools + + + + + samtools_idxstats.py --version samtools_idxstats.py "$input_bam" "${input_bam.metadata.bam_index}" "$out_tabular" @@ -12,11 +17,6 @@ - - - - - diff -r 3070949d8fd7 -r 242f1a5a9277 tools/samtools_idxstats/tool_dependencies.xml --- a/tools/samtools_idxstats/tool_dependencies.xml Fri Nov 21 07:02:43 2014 -0500 +++ b/tools/samtools_idxstats/tool_dependencies.xml Wed May 13 10:34:12 2015 -0400 @@ -1,6 +1,6 @@ - +