diff energy.xml @ 5:345c2a16b95f draft

"planemo upload for repository https://github.com/galaxycomputationalchemistry/galaxy-tools-compchem/tools/gromacs commit 3846f6c5a15ba0586afbd5c901229e237a4e4f17"
author chemteam
date Fri, 08 May 2020 07:45:15 -0400
parents 5b0e6c2039a7
children c8d2c0162b6e
line wrap: on
line diff
--- a/energy.xml	Wed Apr 15 14:25:30 2020 -0400
+++ b/energy.xml	Fri May 08 07:45:15 2020 -0400
@@ -11,6 +11,11 @@
         ln -s '$edr_input' ./edr_input.edr &&
         echo #echo str($terms).replace(',', ' ')# | gmx energy -f ./edr_input.edr -o ./energy.xvg
         ## echo #echo ' '.join(str($terms).split(','))# | gmx energy -f ./edr_input.edr -o ./energy.xvg
+        #if $fmt == 'tabular':
+            &&
+            grep '@\|#' energy.xvg &&
+            grep -v '@\|#' energy.xvg | sed 's/[[:space:]]*//' | sed  's/  /\t/g' > energy.tabular
+        #end if
 
     ]]></command>
 
@@ -67,21 +72,36 @@
             <option value="48">Protein lambda values</option>
             <option value="49">Non-protein lambda values</option>
         </param>
-
+        <param argument="fmt" type='select' label="Output format" help="Format for output; either standard GROMACS XVG, or Galaxy tabular file.">
+            <option value="xvg">GROMACS XVG format</option>
+            <option value="tabular" selected="true">Galaxy tabular</option>
+        </param>
 
     <expand macro="log" />
 
     </inputs>
     <outputs>
-        <data name="output1" format="xvg" from_work_dir="energy.xvg"/>
+        <data name="output1" format="xvg" from_work_dir="energy.xvg">
+            <filter>fmt == 'xvg'</filter>
+        </data>
+        <data name="output2" format="tabular" from_work_dir="energy.tabular">
+            <filter>fmt == 'tabular'</filter>
+        </data>
         <expand macro="log_outputs" />
     </outputs>
     <tests>
         <test>
             <param name="edr_input" value="md_0_1.edr" />
             <param name="terms" value="10,12,13" />
+            <param name="fmt" value="xvg" />
             <output name="output1" file="md_0_1.xvg" ftype="xvg" lines_diff="12"/>
         </test>
+        <test>
+            <param name="edr_input" value="md_0_1.edr" />
+            <param name="terms" value="10,12,13" />
+            <param name="fmt" value="tabular" />
+            <output name="output1" file="md_0_1.tabular" ftype="tabular"/>
+        </test>
     </tests>
     <help><![CDATA[
 
@@ -107,7 +127,7 @@
 
 **Output**
 
-       - Tabular file containing selected terms and some header lines
+       - Tabular or XVG file containing selected terms and some header lines
 
     ]]></help>