Mercurial > repos > peterjc > samtools_idxstats
changeset 6:2f6466b40dbf draft
planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/samtools_idxstats commit 4bd49529e9ca2096cd875e98daf7190d13fa8d0b-dirty
author | peterjc |
---|---|
date | Wed, 01 Feb 2017 13:15:58 -0500 |
parents | 08834fedb0d0 |
children | fadea02ca989 |
files | tools/samtools_idxstats/README.rst tools/samtools_idxstats/samtools_idxstats.py tools/samtools_idxstats/tool_dependencies.xml |
diffstat | 3 files changed, 12 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- 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::
--- 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))
--- 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 @@ <?xml version="1.0"?> <tool_dependency> <package name="samtools" version="0.1.19"> - <repository changeset_revision="0e56e4dac6e7" name="package_samtools_0_1_19" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + <repository changeset_revision="a0ab0fae27e5" name="package_samtools_0_1_19" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> </package> </tool_dependency>