diff column_maker.xml @ 7:e7c273e8d4d6 draft

"planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/column_maker commit 35c79ccee143e8d178ebd24f6317888de3ca0187"
author devteam
date Mon, 25 Jan 2021 09:59:49 +0000
parents 0aeda7a81b46
children 227e82286a0e
line wrap: on
line diff
--- a/column_maker.xml	Wed Dec 30 00:49:52 2020 +0000
+++ b/column_maker.xml	Mon Jan 25 09:59:49 2021 +0000
@@ -1,45 +1,52 @@
-<tool id="Add_a_column1" name="Compute" version="1.4">
+<tool id="Add_a_column1" name="Compute" version="1.5">
     <description>an expression on every row</description>
     <requirements>
         <requirement type="package" version="3.8">python</requirement>
-        <requirement type="package" version="4.4">sed</requirement>
         <requirement type="package" version="1.19.1">numpy</requirement>
     </requirements>
     <command detect_errors="aggressive"><![CDATA[
-        #if $header_lines_conditional.header_lines_select == "yes":
-            (sed -n '1,1p' '$input' | sed  "s|$|%${header_lines_conditional.header_new_column_name}|" | tr "%" "\t") > header &&
-            sed '1,1d' '$input' > data &&
-        #else:
-            touch header &&
-            ln -s '$input' data &&
-        #end if
+        ln -s '$input' data &&
 
         ## inject colums and column_types metadata into inputs json
         #import json
         #set inputs_dict = json.load(open($inputs))
         #set inputs_dict['columns'] = $input.metadata.columns
         #set inputs_dict['column_types'] = $input.metadata.column_types
+        ## flatten conditional
+        #if $header_lines_conditional.header_lines_select == "yes":
+            #set inputs_dict['header_new_column_name'] = str($header_lines_conditional.header_new_column_name)
+        #end if
         #set x = json.dump($inputs_dict, open($inputs, 'w'))
 
         python '$__tool_directory__/column_maker.py'
-             data column_maker_output
+             data '$out_file1'
              --load_json '$inputs'
-        && cat header column_maker_output > '$out_file1'
     ]]></command>
     <configfiles>
       <inputs name="inputs"/>
     </configfiles>
     <inputs>
-        <param name="cond" type="text" value="c3-c2" label="Add expression"/>
+        <param name="cond" type="text" value="c3-c2" label="Add expression">
+            <sanitizer>
+                <valid initial="default">
+                    <add value="&lt;" />
+                    <add value="&gt;" />
+                    <add value="&quot;" />
+                    <add value="&apos;" />
+                </valid>
+            </sanitizer>
+        </param>
         <param format="tabular" name="input" type="data" label="as a new column to" help="Dataset missing? See TIP below"/>
-        <param name="round" type="select" label="Round result?">
-            <option value="no">NO</option>
-            <option value="yes">YES</option>
-        </param>
+        <param name="round" type="boolean" truevalue="yes" falsevalue="no" label="Round result?" />
+        <param name="avoid_scientific_notation" type="boolean" truevalue="yes" falsevalue="no"
+        label="Avoid scientific notation"
+        help="If yes, use fully expanded decimal representation when writing new columns (use only if expression produces decimal numbers)." />
         <conditional name="header_lines_conditional">
-            <param name="header_lines_select" type="select" label="Skip a header line" help="# characters are already considered as comments and kept" >
-                <option value="no" >no</option>
-                <option value="yes" >yes</option>
+            <param name="header_lines_select" type="select"
+            label="Input has a header line with column names?"
+            help="Select Yes to be able to specify a name for the new column and have it added to the header line. If you select No, the first line will be treated as a regular line: If it is empty or starts with a # character it will be skipped, otherwise the tool will attempt to compute the specified expression on it." >
+                <option value="no" >No</option>
+                <option value="yes" >Yes</option>
             </param>
             <when value="no">
             </when>
@@ -47,10 +54,6 @@
                 <param name="header_new_column_name" type="text" value="New Column" label="The new column name" />
             </when>
         </conditional>
-        <param name="avoid_scientific_notation" type="select" label="Avoid scientific notation" help="If yes, use fully expanded decimal representation when writing new columns (use only if expression produces decimal numbers).">
-            <option value="no">no</option>
-            <option value="yes">yes</option>
-        </param>
     </inputs>
     <outputs>
         <data format_source="input" name="out_file1" metadata_source="input"/>
@@ -59,19 +62,19 @@
         <test>
             <param name="cond" value="c3-c2"/>
             <param name="input" value="1.bed"/>
-            <param name="round" value="no"/>
+            <param name="round" value="false"/>
             <output name="out_file1" file="column_maker_out1.interval"/>
         </test>
         <test>
             <param name="cond" value="c4*1"/>
             <param name="input" value="1.interval"/>
-            <param name="round" value="no"/>
+            <param name="round" value="false"/>
             <output name="out_file1" file="column_maker_out2.interval"/>
         </test>
         <test>
             <param name="cond" value="c4*1"/>
             <param name="input" value="1.header.tsv"/>
-            <param name="round" value="no"/>
+            <param name="round" value="false"/>
             <conditional name="header_lines_conditional">
                 <param name="header_lines_select" value="yes" />
                 <param name="header_new_column_name" value="value1_again" />
@@ -81,13 +84,13 @@
         <test>
             <param name="cond" value="c4*1"/>
             <param name="input" value="1.interval"/>
-            <param name="round" value="yes"/>
+            <param name="round" value="true"/>
             <output name="out_file1" file="column_maker_out3.interval"/>
         </test>
         <test>
             <param name="cond" value="float(.0000000000001)"/>
             <param name="input" value="1.bed"/>
-            <param name="round" value="no"/>
+            <param name="round" value="false"/>
             <output name="out_file1">
                 <assert_contents>
                     <has_text text="CCDS10397" />
@@ -98,8 +101,8 @@
         <test>
             <param name="cond" value="float(.0000000000001)"/>
             <param name="input" value="1.bed"/>
-            <param name="round" value="no"/>
-            <param name="avoid_scientific_notation" value="yes"/>
+            <param name="round" value="false"/>
+            <param name="avoid_scientific_notation" value="true"/>
             <output name="out_file1">
                 <assert_contents>
                     <has_text text="CCDS10397" />