# HG changeset patch # User peterjc # Date 1431528816 14400 # Node ID 9aa51c1a17cca2fd18fc97fbf05dc01808398d2b # Parent 1fc238a9fa95f991712d8bc4d34091c5ecd6ce2c planemo upload for repository https://github.com/peterjc/pico_galaxy/tools/seq_select_by_id commit 3abdffd9ade48aa2c2b5f52572d0f77b4f3d2c9c diff -r 1fc238a9fa95 -r 9aa51c1a17cc tools/seq_select_by_id/README.rst --- a/tools/seq_select_by_id/README.rst Thu Nov 27 06:38:33 2014 -0500 +++ b/tools/seq_select_by_id/README.rst Wed May 13 10:53:36 2015 -0400 @@ -1,7 +1,7 @@ Galaxy tool to select FASTA, QUAL, FASTQ or SFF sequences by ID =============================================================== -This tool is copyright 2011-2014 by Peter Cock, The James Hutton Institute +This tool is copyright 2011-2015 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below. @@ -79,6 +79,11 @@ - Include input dataset name in output dataset names. - If white space is found in the requested tabular field then only the first word is used as the identifier (with a warning to stderr). +v0.0.10 - Includes testing of stdout messages. + - Includes testing of failure modes. +v0.0.11 - Use the ``format_source=...`` tag. + - Reorder XML elements (internal change only). + - Planemo for Tool Shed upload (``.shed.yml``, internal change only). ======= ====================================================================== @@ -91,22 +96,31 @@ Development has now moved to a dedicated GitHub repository: https://github.com/peterjc/pico_galaxy/tree/master/tools -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):: + + $ planemo shed_upload --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/seq_select_by_id/ + ... + +or:: - $ tar -czf seq_select_by_id.tar.gz tools/seq_select_by_id/README.rst tools/seq_select_by_id/seq_select_by_id.* tools/seq_select_by_id/tool_dependencies.xml test-data/k12_ten_proteins.fasta test-data/k12_hypothetical.fasta test-data/k12_hypothetical.tabular test-data/k12_hypothetical_alt.tabular + $ planemo shed_upload --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/seq_select_by_id/ + ... + +To just build and check the tar ball, use:: -Check this worked:: - - $ tar -tzf seq_select_by_id.tar.gz + $ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/seq_select_by_id/ + ... + $ tar -tzf shed_upload.tar.gz + test-data/k12_hypothetical.fasta + test-data/k12_hypothetical.tabular + test-data/k12_hypothetical_alt.tabular + test-data/k12_ten_proteins.fasta tools/seq_select_by_id/README.rst tools/seq_select_by_id/seq_select_by_id.py tools/seq_select_by_id/seq_select_by_id.xml tools/seq_select_by_id/tool_dependencies.xml - test-data/k12_ten_proteins.fasta - test-data/k12_hypothetical.fasta - test-data/k12_hypothetical.tabular - test-data/k12_hypothetical_alt.tabular Licence (MIT) diff -r 1fc238a9fa95 -r 9aa51c1a17cc tools/seq_select_by_id/seq_select_by_id.py --- a/tools/seq_select_by_id/seq_select_by_id.py Thu Nov 27 06:38:33 2014 -0500 +++ b/tools/seq_select_by_id/seq_select_by_id.py Wed May 13 10:53:36 2015 -0400 @@ -22,7 +22,7 @@ """ import sys -def stop_err(msg, err=1): +def sys_exit(msg, err=1): sys.stderr.write(msg.rstrip() + "\n") sys.exit(err) @@ -34,17 +34,17 @@ try: tabular_file, col_arg, in_file, seq_format, out_file = sys.argv[1:] except ValueError: - stop_err("Expected five arguments, got %i:\n%s" % (len(sys.argv)-1, " ".join(sys.argv))) + sys_exit("Expected five arguments, got %i:\n%s" % (len(sys.argv)-1, " ".join(sys.argv))) try: if col_arg.startswith("c"): column = int(col_arg[1:])-1 else: column = int(col_arg)-1 except ValueError: - stop_err("Expected column number, got %s" % col_arg) + sys_exit("Expected column number, got %s" % col_arg) if seq_format == "fastqcssanger": - stop_err("Colorspace FASTQ not supported.") + sys_exit("Colorspace FASTQ not supported.") elif seq_format.lower() in ["sff", "fastq", "qual", "fasta"]: seq_format = seq_format.lower() elif seq_format.lower().startswith("fastq"): @@ -54,13 +54,13 @@ #We don't care what the scores are seq_format = "qual" else: - stop_err("Unrecognised file format %r" % seq_format) + sys_exit("Unrecognised file format %r" % seq_format) try: from Bio import SeqIO except ImportError: - stop_err("Biopython 1.54 or later is required") + sys_exit("Biopython 1.54 or later is required") def parse_ids(tabular_file, col): @@ -94,7 +94,7 @@ try: from Bio.SeqIO.SffIO import SffIterator, SffWriter except ImportError: - stop_err("Requires Biopython 1.54 or later") + sys_exit("Requires Biopython 1.54 or later") try: from Bio.SeqIO.SffIO import ReadRocheXmlManifest @@ -120,7 +120,7 @@ except KeyError, err: out_handle.close() if name not in records: - stop_err("Identifier %r not found in sequence file" % name) + sys_exit("Identifier %r not found in sequence file" % name) else: raise err out_handle.close() @@ -134,7 +134,7 @@ out_handle.write(records.get_raw(name)) except KeyError: out_handle.close() - stop_err("Identifier %r not found in sequence file" % name) + sys_exit("Identifier %r not found in sequence file" % name) count += 1 out_handle.close() diff -r 1fc238a9fa95 -r 9aa51c1a17cc tools/seq_select_by_id/seq_select_by_id.xml --- a/tools/seq_select_by_id/seq_select_by_id.xml Thu Nov 27 06:38:33 2014 -0500 +++ b/tools/seq_select_by_id/seq_select_by_id.xml Wed May 13 10:53:36 2015 -0400 @@ -1,25 +1,25 @@ - + from a tabular file biopython Bio - seq_select_by_id.py --version - -seq_select_by_id.py $input_tabular $column $input_file $input_file.ext $output_file - + seq_select_by_id.py --version + +seq_select_by_id.py $input_tabular $column $input_file $input_file.ext $output_file + - + @@ -27,6 +27,10 @@ + + + + @@ -34,6 +38,24 @@ + + + + + + + + + + + + + + + + + +