# HG changeset patch # User peterjc # Date 1485972958 18000 # Node ID 2f6466b40dbf7a3ddfc733b2984cb3424c3f2b89 # Parent 08834fedb0d0c47e30d86164a915682f3f90b470 planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_idxstats commit 4bd49529e9ca2096cd875e98daf7190d13fa8d0b-dirty diff -r 08834fedb0d0 -r 2f6466b40dbf tools/samtools_idxstats/README.rst --- a/tools/samtools_idxstats/README.rst Thu May 21 10:58:28 2015 -0400 +++ b/tools/samtools_idxstats/README.rst Wed Feb 01 13:15:58 2017 -0500 @@ -68,12 +68,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/samtools_idxstats/ + $ planemo shed_update -t testtoolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_idxstats/ ... or:: - $ planemo shed_update --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_idxstats/ + $ planemo shed_update -t toolshed --check_diff ~/repositories/pico_galaxy/tools/samtools_idxstats/ ... To just build and check the tar ball, use:: diff -r 08834fedb0d0 -r 2f6466b40dbf tools/samtools_idxstats/samtools_idxstats.py --- a/tools/samtools_idxstats/samtools_idxstats.py Thu May 21 10:58:28 2015 -0400 +++ b/tools/samtools_idxstats/samtools_idxstats.py Wed Feb 01 13:15:58 2017 -0500 @@ -12,33 +12,27 @@ """ 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 + # Galaxy seems to invert the order of the two lines print "(Galaxy wrapper v0.0.2)" cmd = "samtools 2>&1 | grep -i ^Version" sys.exit(os.system(cmd)) -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: - sys_exit("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): - sys_exit("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": - sys_exit("Error: Galaxy did not index your BAM file") - sys_exit("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: +# Assign sensible names with real extensions, and setup symlinks: tmp_dir = tempfile.mkdtemp() bam_file = os.path.join(tmp_dir, "temp.bam") bai_file = os.path.join(tmp_dir, "temp.bam.bai") @@ -48,14 +42,14 @@ assert os.path.isfile(bai_file), bai_file assert os.path.isfile(bam_file + ".bai"), bam_file -#Run samtools idxstats: +# Run samtools idxstats: cmd = 'samtools idxstats "%s" > "%s"' % (bam_file, tabular_filename) return_code = os.system(cmd) -#Remove the temp symlinks: +# Remove the temp symlinks: os.remove(bam_file) os.remove(bai_file) os.rmdir(tmp_dir) if return_code: - sys_exit("Return code %i from command:\n%s" % (return_code, cmd)) + sys.exit("Return code %i from command:\n%s" % (return_code, cmd)) diff -r 08834fedb0d0 -r 2f6466b40dbf tools/samtools_idxstats/tool_dependencies.xml --- a/tools/samtools_idxstats/tool_dependencies.xml Thu May 21 10:58:28 2015 -0400 +++ b/tools/samtools_idxstats/tool_dependencies.xml Wed Feb 01 13:15:58 2017 -0500 @@ -1,6 +1,6 @@ - +