changeset 9:28fe4ea796ad draft

planemo upload for https://github.com/peterjc/pico_galaxy/tools/fastq_paired_unpaired/17960ea552e04adf4afaa0cb732ee182b3d5e328
author peterjc
date Tue, 12 May 2015 12:54:31 -0400
parents 4b2365372652
children 89d7f067a0ff
files tools/fastq_paired_unpaired/README.rst tools/fastq_paired_unpaired/fastq_paired_unpaired.py tools/fastq_paired_unpaired/fastq_paired_unpaired.xml
diffstat 3 files changed, 35 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/tools/fastq_paired_unpaired/README.rst	Fri Nov 28 11:38:30 2014 -0500
+++ b/tools/fastq_paired_unpaired/README.rst	Tue May 12 12:54:31 2015 -0400
@@ -1,7 +1,7 @@
 Galaxy tool to divide FASTQ files into paired and unpaired reads
 ================================================================
 
-This tool is copyright 2010-2013 by Peter Cock, The James Hutton Institute
+This tool is copyright 2010-2015 by Peter Cock, The James Hutton Institute
 (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved.
 See the licence text below (MIT licence).
 
@@ -66,6 +66,9 @@
 v0.1.0  - Switch to using Biopython (easier to use script outside of Galaxy).
         - Leaves FASTQ plus lines blank (smaller output files).
         - Tool definition now embeds citation information.
+v0.1.1  - Reorder XML elements (internal change only).
+        - Use ``format_source=...`` tag.
+        - Planemo for Tool Shed upload (``.shed.yml``, internal change only).
 ======= ======================================================================
 
 
@@ -79,22 +82,31 @@
 Development has now moved to a dedicated GitHub repository:
 https://github.com/peterjc/pico_galaxy/tree/master/tools/fastq_paired_unpaired
 
-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)::
 
-    $ tar -czf fastq_paired_unpaired.tar.gz tools/fastq_paired_unpaired/README.rst tools/fastq_paired_unpaired/fastq_paired_unpaired.* test-data/sanger-pairs-*.fastq
+    $ planemo shed_upload --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/fastq_paired_unpaired/
+    ...
+
+or::
 
-Check this worked::
+    $ planemo shed_upload --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/fastq_paired_unpaired/
+    ...
 
-    $ tar -tzf fastq_paired_unpaired.tar.gz
-    tools/fastq_paired_unpaired/README.rst
-    tools/fastq_paired_unpaired/fastq_paired_unpaired.py
-    tools/fastq_paired_unpaired/fastq_paired_unpaired.xml
+To just build and check the tar ball, use::
+
+    $ planemo shed_upload --tar_only  ~/repositories/pico_galaxy/tools/fastq_paired_unpaired/
+    ...
+    $ tar -tzf shed_upload.tar.gz 
     test-data/sanger-pairs-forward.fastq
     test-data/sanger-pairs-interleaved.fastq
     test-data/sanger-pairs-mixed.fastq
     test-data/sanger-pairs-reverse.fastq
     test-data/sanger-pairs-singles.fastq
+    tools/fastq_paired_unpaired/README.rst
+    tools/fastq_paired_unpaired/fastq_paired_unpaired.py
+    tools/fastq_paired_unpaired/fastq_paired_unpaired.xml
 
 
 Licence (MIT)
--- a/tools/fastq_paired_unpaired/fastq_paired_unpaired.py	Fri Nov 28 11:38:30 2014 -0500
+++ b/tools/fastq_paired_unpaired/fastq_paired_unpaired.py	Tue May 12 12:54:31 2015 -0400
@@ -22,14 +22,14 @@
     print("Version 0.1.0")
     sys.exit(0)
 
-def stop_err(msg, err=1):
+def sys_exit(msg, err=1):
    sys.stderr.write(msg.rstrip() + "\n")
    sys.exit(err)
 
 try:
     from Bio.SeqIO.QualityIO import FastqGeneralIterator
 except ImportError:
-    stop_err("Biopython missing")
+    sys_exit("Biopython missing")
 
 msg = """Expect either 3 or 4 arguments, all FASTQ filenames.
 
@@ -88,13 +88,13 @@
     pairs_fastq = None
     format, input_fastq, pairs_f_fastq, pairs_r_fastq, singles_fastq = sys.argv[1:]
 else:
-    stop_err(msg)
+    sys_exit(msg)
 
 format = format.replace("fastq", "").lower()
 if not format:
     format="sanger" #safe default
 elif format not in ["sanger","solexa","illumina","cssanger"]:
-    stop_err("Unrecognised format %s" % format)
+    sys_exit("Unrecognised format %s" % format)
 
 #Cope with three widely used suffix naming convensions,
 #Illumina: /1 or /2
--- a/tools/fastq_paired_unpaired/fastq_paired_unpaired.xml	Fri Nov 28 11:38:30 2014 -0500
+++ b/tools/fastq_paired_unpaired/fastq_paired_unpaired.xml	Tue May 12 12:54:31 2015 -0400
@@ -1,9 +1,14 @@
-<tool id="fastq_paired_unpaired" name="Divide FASTQ file into paired and unpaired reads" version="0.1.0">
+<tool id="fastq_paired_unpaired" name="Divide FASTQ file into paired and unpaired reads" version="0.1.1">
     <description>using the read name suffices</description>
     <requirements>
         <requirement type="package" version="1.64">biopython</requirement>
         <requirement type="python-module">Bio</requirement>
     </requirements>
+    <stdio>
+        <!-- Anything other than zero is an error -->
+        <exit_code range="1:" />
+        <exit_code range=":-1" />
+    </stdio>
     <version_command interpreter="python">fastq_paired_unpaired.py --version</version_command>
     <command interpreter="python">
 fastq_paired_unpaired.py $input_fastq.extension $input_fastq
@@ -14,11 +19,6 @@
 #end if
 $output_singles
     </command>
-    <stdio>
-        <!-- Anything other than zero is an error -->
-        <exit_code range="1:" />
-        <exit_code range=":-1" />
-    </stdio>
     <inputs>
         <param name="input_fastq" type="data" format="fastq" label="FASTQ file to divide into paired and unpaired reads"/>
         <conditional name="output_choice_cond">
@@ -32,14 +32,14 @@
         </conditional>
     </inputs>
     <outputs>
-        <data name="output_singles" format="input" label="Orphan or single reads"/>
-        <data name="output_forward" format="input" label="Forward paired reads">
+        <data name="output_singles" format_source="input_fastq" label="Orphan or single reads"/>
+        <data name="output_forward" format_source="input_fastq" label="Forward paired reads">
             <filter>output_choice_cond["output_choice"] == "separate"</filter>
         </data>
-        <data name="output_reverse" format="input" label="Reverse paired reads">
+        <data name="output_reverse" format_source="input_fastq" label="Reverse paired reads">
             <filter>output_choice_cond["output_choice"] == "separate"</filter>
         </data>
-        <data name="output_paired" format="input" label="Interleaved paired reads">
+        <data name="output_paired" format_source="input_fastq" label="Interleaved paired reads">
             <filter>output_choice_cond["output_choice"] == "interleaved"</filter>
         </data>
     </outputs>