diff tools_grum.xml @ 0:c65c94b47771 draft

"planemo upload for repository https://forgemia.inra.fr/grum/grum/-/tree/master/siwaa_recipe/galaxy_tools commit 5dce511538bebef7453c594f68ea7d13e8fc3ea8"
author siwaa
date Tue, 24 Aug 2021 13:04:11 +0000
parents
children 9c1c1c7f0e48
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools_grum.xml	Tue Aug 24 13:04:11 2021 +0000
@@ -0,0 +1,142 @@
+<tool id="GRUM" name="GRUM, Estimate the values of parameters" version="1.2.0">
+  <description></description>
+  <requirements>
+    <container type="singularity">docker://registry.forgemia.inra.fr/grum/grum:1.2</container>
+  </requirements>
+  <command detect_errors="aggressive">
+    <![CDATA[
+	     #if str( $selectAction.action ) == 'getDefaultInitial':
+	        #if str( $selectAction.mammalParamGet.choose ) == 'defaultGoat':
+                   cp '$__tool_directory__/default/goat_parameters.json' ${parameter_values_file_only};
+	        #elif str( $selectAction.mammalParamGet.choose ) == 'defaultCow':
+                   cp '$__tool_directory__/default/cow_parameters.json' ${parameter_values_file_only};
+	        #end if
+	     #elif str( $selectAction.action ) == 'estimateParameters':
+                #if str( $selectAction.mammalParamSet.choose ) == 'defaultGoat':
+	           /bin/bash -c "Rscript --verbose /data/grum/siwaa_recipe/grum_siwaa.R ${selectAction.litter_input} ${selectAction.bw_input} ${selectAction.do_plot_fitted} '$__tool_directory__/default/goat_parameters.json';";
+		   #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
+                      cp '$__tool_directory__/default/goat_parameters.json' ${parameter_values_file};
+		   #end if   
+	           #elif str( $selectAction.mammalParamSet.choose ) == 'defaultCow':
+                   /bin/bash -c "Rscript --verbose /data/grum/siwaa_recipe/grum_siwaa.R ${selectAction.litter_input} ${selectAction.bw_input} ${selectAction.do_plot_fitted} '$__tool_directory__/default/cow_parameters.json';";
+		   #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
+                      cp '$__tool_directory__/default/cow_parameters.json' ${parameter_values_file};
+		   #end if   
+	           #elif str( $selectAction.mammalParamSet.choose ) == 'customMammal':
+                   /bin/bash -c "Rscript --verbose /data/grum/siwaa_recipe/grum_siwaa.R ${selectAction.litter_input} ${selectAction.bw_input} ${selectAction.do_plot_fitted} ${selectAction.mammalParamSet.parameterValues_input} ;";
+		   #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
+                     cp ${selectAction.mammalParamSet.parameterValues_input} ${parameter_values_file};
+	           #end if
+	        #end if
+		#if str( $selectAction.do_plot_fitted ) == 'do_plot_fitted':
+                   pdfunite goat_*.pdf simulation_plots.pdf;
+                   cp simulation_plots.pdf ${simulation_plots};
+                #end if
+	     cp estimated_parameters.csv ${estimated_parameters};
+             #end if
+    ]]>
+  </command>
+  <inputs>
+    <conditional name="selectAction">
+      <param name="action" type="select" label="Select the action to perform">
+	<option value="estimateParameters" selected="true">estimate Goat parameters values</option>
+	<option value="getDefaultInitial">get default Goat initial parameters initial values</option>
+      </param>
+      <when value="estimateParameters">
+	<param name="litter_input" type="data" format="csv" label="Litter file" optional="true"/>
+	<param name="bw_input" type="data" format="csv" label="Body weight file" optional="true"/>
+	<conditional name="mammalParamSet">
+	  <param name="choose" type="select" label="Select the mammal parameters initial values">
+	    <option value="defaultGoat" selected="true">default Goat parameters initiale values</option>
+	    <option value="defaultCow">default Cow parameters initial values</option>
+	    <option value="customMammal">custom Mammal parameters initial values</option>
+	  </param>
+	  <when value="customMammal">
+	    <param name="parameterValues_input" type="data" format="json" label="Select a mammal parameters initial values file(json)"/>
+	  </when>
+	  <when value="defaultGoat">
+	  </when>
+	  <when value="defaultCow">
+	  </when>
+	</conditional>
+	<param name="do_plot_fitted" type="boolean" checked="true" label="Plot fitted"
+               truevalue="do_plot_fitted" falsevalue="do_not_plot_fitted" />
+	<param name="do_output_parameterValues" type="boolean" checked="true" label="Output the parameter Values file"
+               truevalue="do_output_parameterValues" falsevalue="do_not_outputParametersValues" />
+      </when>
+      <when value="getDefaultInitial">
+	<conditional name="mammalParamGet">
+	  <param name="choose" type="select" label="Select the mammal parameter values">
+	    <option value="defaultGoat" selected="true">default Goat parameters initial values</option>
+	    <option value="defaultCow">default Cow parameters initial values</option>
+	  </param>
+	  <when value="defaultGoat">
+	  </when>
+	  <when value="defaultCow">
+	  </when>
+	</conditional>	  
+	</when>
+      </conditional>
+  </inputs>
+  <outputs>
+    <data format="csv" name="estimated_parameters" label="GRUM estimated parameters" >
+      <filter>selectAction['action'] == 'estimateParameters'</filter>
+    </data>
+    <data format="pdf" name="simulation_plots" label="GRUM plots" >
+      <filter>selectAction['action'] == 'estimateParameters' and selectAction['do_plot_fitted']</filter>
+    </data>
+    <data format="json" name="parameter_values_file_only" label="Parameters initial values" >
+      <filter>selectAction['action'] == 'getDefaultInitial'</filter>
+    </data>
+    <data format="json" name="parameter_values_file" label="Parameters initial values" >
+      <filter>selectAction['action'] == 'estimateParameters' and selectAction['do_output_parameterValues']</filter>
+    </data>
+  </outputs>
+  <tests>
+    <test>
+      <conditional name="selectAction">
+        <param name="action" value="estimateParameters"/>
+      </conditional>
+      <param name="litter_input" value="inputs/Litter_test.csv" ftype="csv" />
+      <param name="bw_input" value="inputs/BW_test.csv" ftype="csv" />
+      <conditional name="mammalParam">
+	<param name="choose" value="defaultGoat"/>
+      </conditional>
+      <param name="do_plot_fitted" value="true" />
+      <output name="estimated_parameters" ftype="csv">
+	<assert_contents>
+          <has_line line="&quot;ID&quot;,&quot;W0&quot;,&quot;G0&quot;,&quot;kr_1&quot;,&quot;kUa_1&quot;,&quot;kUf_1&quot;,&quot;kn_1&quot;,&quot;kmd_1&quot;,&quot;kr_2&quot;,&quot;kUa_2&quot;,&quot;kUf_2&quot;,&quot;kn_2&quot;,&quot;kmd_2&quot;" />
+	  <has_line_matching expression="&quot;X2004029&quot;,.*" />
+	  <has_line_matching expression="&quot;X2005115&quot;,.*" />
+	  <has_n_columns n="13" sep=","/>
+          <has_n_lines n="3" />
+        </assert_contents>
+      </output>
+    </test>
+  </tests>
+  <help>
+Inputs:
+=======
+
+- Litter for each mammal.
+- Sequence of body weight of mammals.
+- (optional) Initial parameter values for the estimation process, if the defaults available are not revelant.
+
+Outputs:
+========
+
+- Estimated parameters for each goat (csv file).
+- (optional) Plots of simulations with estimated parameters for each goat (pdf file).
+- (optional) Initial parameters values used for the estimation process (json file)
+
+Example:
+========
+
+- Copy to your history files BW_smalltable.csv and Litter_smalltable.csv from GRUM Datasets.
+- Select default initial parameter values set, or provide one.
+- Fill filenames and choose the adequate number of cores.
+- And then execute (it takes around 20 minutes per goat for estimation)
+
+  </help>
+</tool>
+