changeset 3:f725e3820fb4 draft

Add 2-1 and 2-2 tools. Code cleanup.
author hackdna
date Fri, 10 May 2013 17:07:41 -0400
parents fb14f26733e1
children ccf0e1ca6fe9
files refinery_test_1-1.xml refinery_test_1-2.xml refinery_test_2-1.xml refinery_test_2-2.xml refinery_test_tool.py
diffstat 5 files changed, 103 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/refinery_test_1-1.xml	Thu May 09 00:48:11 2013 -0400
+++ b/refinery_test_1-1.xml	Fri May 10 17:07:41 2013 -0400
@@ -15,7 +15,7 @@
     </inputs>
 
     <outputs>
-        <data format="txt" name="output_file" label="Text file"/>
+        <data format="txt" name="output_file" label="Ouput file"/>
     </outputs>
 
     <stdio>
--- a/refinery_test_1-2.xml	Thu May 09 00:48:11 2013 -0400
+++ b/refinery_test_1-2.xml	Fri May 10 17:07:41 2013 -0400
@@ -15,8 +15,8 @@
     </inputs>
 
     <outputs>
-        <data format="txt" name="output_file1" label="Text file"/>
-        <data format="txt" name="output_file2" label="Text file"/>
+        <data format="txt" name="output_file1" label="Output file A"/>
+        <data format="txt" name="output_file2" label="Output file B"/>
     </outputs>
 
     <stdio>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/refinery_test_2-1.xml	Fri May 10 17:07:41 2013 -0400
@@ -0,0 +1,49 @@
+<tool id="refinery_test_2-1" name="Refinery test tool 2-1" version="0.1">
+    <description>for testing Galaxy workflow execution from Refinery</description>
+
+    <command interpreter="python">
+        refinery_test_tool.py -i $input_file1 $input_file2 -o $output_file -e $exit_code -p $p_fail -s $sleep_time $stdout $stderr
+    </command>
+
+    <inputs>
+        <param name="input_file1" format="txt" type="data" label="Input file A"/>
+        <param name="input_file2" format="txt" type="data" label="Input file B"/>
+        <param name="sleep_time" type="integer" label="Sleep (seconds)" value="0" min="0"/>
+        <param name="p_fail" type="float" label="Probability of failure [0.0, 1.0]" value="0.0" min="0.0" max="1.0"/>
+        <param name="stdout" type="boolean" label="Write to standard out" truevalue="--stdout" falsevalue=""/>
+        <param name="stderr" type="boolean" label="Write to standard error" truevalue="--stderr" falsevalue=""/>
+        <param name="exit_code" type="integer" label="Exit code [0, 255]" value="0" min="0" max="255"/>
+    </inputs>
+
+    <outputs>
+        <data format="txt" name="output_file" label="Output file"/>
+    </outputs>
+
+    <stdio>
+        <exit_code range="1:" level="fatal" />
+        <regex match=".+" source="stdout" level="fatal" description="Tool produced output to standard out" />
+        <regex match=".+" source="stderr" level="fatal" description="Tool produced output to standard error" />
+    </stdio>
+
+    <help>
+
+.. class:: infomark
+
+**Purpose**
+
+To test Galaxy workflow execution and monitoring from Refinery.
+
+-----
+
+.. class:: infomark
+
+**Inputs and outputs**
+
+This wrapper will accept two text files as input and produce a single output file
+with concatenated content from input files.
+
+*Note:* You must set the "Probability of failure" parameter to a non-zero value
+for "Write to standard out", "Write to standard error" or "Exit code" to take effect.
+
+    </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/refinery_test_2-2.xml	Fri May 10 17:07:41 2013 -0400
@@ -0,0 +1,50 @@
+<tool id="refinery_test_2-2" name="Refinery test tool 2-2" version="0.1">
+    <description>for testing Galaxy workflow execution from Refinery</description>
+
+    <command interpreter="python">
+        refinery_test_tool.py -i $input_file1 $input_file2 -o $output_file1 $output_file2 -e $exit_code -p $p_fail -s $sleep_time $stdout $stderr
+    </command>
+
+    <inputs>
+        <param name="input_file1" format="txt" type="data" label="Input file A"/>
+        <param name="input_file2" format="txt" type="data" label="Input file B"/>
+        <param name="sleep_time" type="integer" label="Sleep (seconds)" value="0" min="0"/>
+        <param name="p_fail" type="float" label="Probability of failure [0.0, 1.0]" value="0.0" min="0.0" max="1.0"/>
+        <param name="stdout" type="boolean" label="Write to standard out" truevalue="--stdout" falsevalue=""/>
+        <param name="stderr" type="boolean" label="Write to standard error" truevalue="--stderr" falsevalue=""/>
+        <param name="exit_code" type="integer" label="Exit code [0, 255]" value="0" min="0" max="255"/>
+    </inputs>
+
+    <outputs>
+        <data format="txt" name="output_file1" label="Output file A"/>
+        <data format="txt" name="output_file2" label="Output file B"/>
+    </outputs>
+
+    <stdio>
+        <exit_code range="1:" level="fatal" />
+        <regex match=".+" source="stdout" level="fatal" description="Tool produced output to standard out" />
+        <regex match=".+" source="stderr" level="fatal" description="Tool produced output to standard error" />
+    </stdio>
+
+    <help>
+
+.. class:: infomark
+
+**Purpose**
+
+To test Galaxy workflow execution and monitoring from Refinery.
+
+-----
+
+.. class:: infomark
+
+**Inputs and outputs**
+
+This wrapper will accept two text files as input and produce a single output file
+with concatenated content from input files.
+
+*Note:* You must set the "Probability of failure" parameter to a non-zero value
+for "Write to standard out", "Write to standard error" or "Exit code" to take effect.
+
+    </help>
+</tool>
--- a/refinery_test_tool.py	Thu May 09 00:48:11 2013 -0400
+++ b/refinery_test_tool.py	Fri May 10 17:07:41 2013 -0400
@@ -29,7 +29,7 @@
     input = read_files(args.input_files)
     try:
         for out_file in args.output_files:
-            out_file.write('\n' + "Output file name: " + out_file.name + '\n')
+            out_file.write("Output file name: " + out_file.name + '\n\n')
             out_file.write(input)
     except IOError as e:
         cleanup(args)