diff pick_value.xml @ 1:b19e21af9c52 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/pick_value commit 2d21c3bffadee4551f1a3c71d475a1468dd7e6e2
author iuc
date Mon, 15 Jan 2024 14:09:58 +0000
parents bf793b71559a
children
line wrap: on
line diff
--- a/pick_value.xml	Tue Nov 07 09:02:42 2023 +0000
+++ b/pick_value.xml	Mon Jan 15 14:09:58 2024 +0000
@@ -1,4 +1,4 @@
-<tool name="Pick parameter value" id="pick_value" version="0.1.0" profile="21.01" tool_type="expression">
+<tool name="Pick parameter value" id="pick_value" version="0.2.0" profile="21.01" tool_type="expression">
     <macros>
         <xml name="booleans">
             <repeat name="pick_from" title="Pick from">
@@ -146,7 +146,11 @@
         <output type="boolean" name="boolean_param" from="output">
             <filter>style_cond['type_cond']['param_type'] == 'boolean'</filter>
         </output>
-        <output type="data" name="data_param" from="output">
+        <!-- Galaxy already copies the dataset with all its properties (including format)
+             in exec_after_process. setting the format_source here is in this sense
+             redundant, but helps the workflow editor to infer the data type
+             (from the dataset in the first repeat element) -->
+        <output type="data" name="data_param" from="output" format_source="style_cond|type_cond|pick_from_0|value">
             <filter>style_cond['type_cond']['param_type'] == 'data'</filter>
         </output>
     </outputs>
@@ -185,14 +189,14 @@
                         <param name="value" value_json="null" />
                     </repeat>
                     <repeat name="pick_from">
-                        <param name="value" value="simple_line.txt" />
+                        <param name="value" value="simple_line.txt" ftype="tsv"/>
                     </repeat>
                     <repeat name="pick_from">
-                        <param name="value" value="simple_line_alternative.txt" />
+                        <param name="value" value="simple_line_alternative.txt" ftype="csv" />
                     </repeat>
                 </conditional>
             </conditional>
-            <output name="data_param" value="simple_line.txt" />
+            <output name="data_param" value="simple_line.txt" ftype="tsv" />
         </test>
         <test expect_num_outputs="1">
             <conditional name="style_cond">
@@ -363,11 +367,30 @@
                     <repeat name="pick_from">
                         <param name="value" value_json="null" />
                     </repeat>
-                    <param name="default_value" value="simple_line.txt" />
+                    <param name="default_value" value="simple_line.txt" ftype="tsv" />
                 </conditional>
             </conditional>
-            <output name="data_param" value="simple_line.txt" />
+            <output name="data_param" value="simple_line.txt" ftype="tsv" />
         </test>
+
+        <!-- with first_or_default that the default is used if given -->
+        <test expect_num_outputs="1">
+            <conditional name="style_cond">
+                <param name="pick_style" value="first_or_default" />
+                <conditional name="type_cond">
+                    <param name="param_type" value="data" />
+                    <repeat name="pick_from">
+                        <param name="value" value_json="null" />
+                    </repeat>
+                    <repeat name="pick_from">
+                        <param name="value" value="simple_line.txt" ftype="csv" />
+                    </repeat>
+                    <param name="default_value" value="simple_line_alternative.txt" ftype="tabular" />
+                </conditional>
+            </conditional>
+            <output name="data_param" value="simple_line.txt" ftype="csv"/>
+        </test>
+
     </tests>
 </tool>