# HG changeset patch # User peterjc # Date 1431513523 14400 # Node ID e279ed332c8eb18c1ee952c2a1b02e73d9d1d08a # Parent ba3ec1b3e6350350603e6ea91788e8586bbef3df planemo upload for repository https://github.com/peterjc/pico_galaxy/tools/seq_rename commit b6a4aa926554f2973b537999ff53478117975064 diff -r ba3ec1b3e635 -r e279ed332c8e tools/seq_rename/README.rst --- a/tools/seq_rename/README.rst Thu Nov 27 08:20:54 2014 -0500 +++ b/tools/seq_rename/README.rst Wed May 13 06:38:43 2015 -0400 @@ -1,7 +1,7 @@ Galaxy tool to rename FASTA, QUAL, FASTQ or SFF sequences ========================================================= -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. @@ -75,6 +75,9 @@ - Tool definition now embeds citation information. - 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.7 - Use the ``format_source=...`` tag. + - Reorder XML elements (internal change only). + - Planemo for Tool Shed upload (``.shed.yml``, internal change only). ======= ====================================================================== @@ -87,21 +90,30 @@ 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_rename/ + ... + +or:: - $ tar -czf seq_rename.tar.gz tools/seq_rename/README.rst tools/seq_rename/seq_rename.* tools/seq_rename/tool_dependencies.xml test-data/four_human_proteins.fasta test-data/four_human_proteins.rename.tabular test-data/four_human_proteins.rename.fasta + $ planemo shed_upload --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/seq_rename/ + ... + +To just build and check the tar ball, use:: -Check this worked:: - - $ tar -tzf seq_rename.tar.gz + $ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/seq_rename/ + ... + $ tar -tzf shed_upload.tar.gz + test-data/four_human_proteins.fasta + test-data/four_human_proteins.rename.fasta + test-data/four_human_proteins.rename.tabular tools/seq_rename/README.rst tools/seq_rename/seq_rename.py tools/seq_rename/seq_rename.xml tools/seq_rename/tool_dependencies.xml - test-data/four_human_proteins.fasta - test-data/four_human_proteins.rename.tabular - test-data/four_human_proteins.rename.fasta Licence (MIT) diff -r ba3ec1b3e635 -r e279ed332c8e tools/seq_rename/seq_rename.py --- a/tools/seq_rename/seq_rename.py Thu Nov 27 08:20:54 2014 -0500 +++ b/tools/seq_rename/seq_rename.py Wed May 13 06:38:43 2015 -0400 @@ -27,7 +27,7 @@ print "v0.0.6" sys.exit(0) -def stop_err(msg, err=1): +def sys_exit(msg, err=1): sys.stderr.write(msg.rstrip() + "\n") sys.exit(err) @@ -35,7 +35,7 @@ try: tabular_file, old_col_arg, new_col_arg, in_file, seq_format, out_file = sys.argv[1:] except ValueError: - stop_err("Expected six arguments (tabular file, old col, new col, input file, format, output file), got %i:\n%s" % (len(sys.argv)-1, " ".join(sys.argv))) + sys_exit("Expected six arguments (tabular file, old col, new col, input file, format, output file), got %i:\n%s" % (len(sys.argv)-1, " ".join(sys.argv))) try: if old_col_arg.startswith("c"): @@ -43,16 +43,16 @@ else: old_column = int(old_col_arg)-1 except ValueError: - stop_err("Expected column number, got %s" % old_col_arg) + sys_exit("Expected column number, got %s" % old_col_arg) try: if old_col_arg.startswith("c"): new_column = int(new_col_arg[1:])-1 else: new_column = int(new_col_arg)-1 except ValueError: - stop_err("Expected column number, got %s" % new_col_arg) + sys_exit("Expected column number, got %s" % new_col_arg) if old_column == new_column: - stop_err("Old and new column arguments are the same!") + sys_exit("Old and new column arguments are the same!") def parse_ids(tabular_file, old_col, new_col): """Read tabular file and record all specified ID mappings. @@ -109,7 +109,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 @@ -142,7 +142,7 @@ writer = fastqWriter(open(out_file, "w")) marker = "@" else: - stop_err("Unsupported file type %r" % seq_format) + sys_exit("Unsupported file type %r" % seq_format) #Now do the renaming count = 0 renamed = 0 diff -r ba3ec1b3e635 -r e279ed332c8e tools/seq_rename/seq_rename.xml --- a/tools/seq_rename/seq_rename.xml Thu Nov 27 08:20:54 2014 -0500 +++ b/tools/seq_rename/seq_rename.xml Wed May 13 06:38:43 2015 -0400 @@ -1,18 +1,18 @@ - + with ID mapping from a tabular file biopython Bio - seq_rename.py --version - -seq_rename.py $input_tabular $old_column $new_column $input_file $input_file.ext $output_file - + seq_rename.py --version + +seq_rename.py $input_tabular $old_column $new_column $input_file $input_file.ext $output_file + @@ -20,7 +20,7 @@ - +