comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:c65c94b47771
1 <tool id="GRUM" name="GRUM, Estimate the values of parameters" version="1.2.0">
2 <description></description>
3 <requirements>
4 <container type="singularity">docker://registry.forgemia.inra.fr/grum/grum:1.2</container>
5 </requirements>
6 <command detect_errors="aggressive">
7 <![CDATA[
8 #if str( $selectAction.action ) == 'getDefaultInitial':
9 #if str( $selectAction.mammalParamGet.choose ) == 'defaultGoat':
10 cp '$__tool_directory__/default/goat_parameters.json' ${parameter_values_file_only};
11 #elif str( $selectAction.mammalParamGet.choose ) == 'defaultCow':
12 cp '$__tool_directory__/default/cow_parameters.json' ${parameter_values_file_only};
13 #end if
14 #elif str( $selectAction.action ) == 'estimateParameters':
15 #if str( $selectAction.mammalParamSet.choose ) == 'defaultGoat':
16 /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';";
17 #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
18 cp '$__tool_directory__/default/goat_parameters.json' ${parameter_values_file};
19 #end if
20 #elif str( $selectAction.mammalParamSet.choose ) == 'defaultCow':
21 /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';";
22 #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
23 cp '$__tool_directory__/default/cow_parameters.json' ${parameter_values_file};
24 #end if
25 #elif str( $selectAction.mammalParamSet.choose ) == 'customMammal':
26 /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} ;";
27 #if str( $selectAction.do_output_parameterValues ) == 'do_output_parameterValues':
28 cp ${selectAction.mammalParamSet.parameterValues_input} ${parameter_values_file};
29 #end if
30 #end if
31 #if str( $selectAction.do_plot_fitted ) == 'do_plot_fitted':
32 pdfunite goat_*.pdf simulation_plots.pdf;
33 cp simulation_plots.pdf ${simulation_plots};
34 #end if
35 cp estimated_parameters.csv ${estimated_parameters};
36 #end if
37 ]]>
38 </command>
39 <inputs>
40 <conditional name="selectAction">
41 <param name="action" type="select" label="Select the action to perform">
42 <option value="estimateParameters" selected="true">estimate Goat parameters values</option>
43 <option value="getDefaultInitial">get default Goat initial parameters initial values</option>
44 </param>
45 <when value="estimateParameters">
46 <param name="litter_input" type="data" format="csv" label="Litter file" optional="true"/>
47 <param name="bw_input" type="data" format="csv" label="Body weight file" optional="true"/>
48 <conditional name="mammalParamSet">
49 <param name="choose" type="select" label="Select the mammal parameters initial values">
50 <option value="defaultGoat" selected="true">default Goat parameters initiale values</option>
51 <option value="defaultCow">default Cow parameters initial values</option>
52 <option value="customMammal">custom Mammal parameters initial values</option>
53 </param>
54 <when value="customMammal">
55 <param name="parameterValues_input" type="data" format="json" label="Select a mammal parameters initial values file(json)"/>
56 </when>
57 <when value="defaultGoat">
58 </when>
59 <when value="defaultCow">
60 </when>
61 </conditional>
62 <param name="do_plot_fitted" type="boolean" checked="true" label="Plot fitted"
63 truevalue="do_plot_fitted" falsevalue="do_not_plot_fitted" />
64 <param name="do_output_parameterValues" type="boolean" checked="true" label="Output the parameter Values file"
65 truevalue="do_output_parameterValues" falsevalue="do_not_outputParametersValues" />
66 </when>
67 <when value="getDefaultInitial">
68 <conditional name="mammalParamGet">
69 <param name="choose" type="select" label="Select the mammal parameter values">
70 <option value="defaultGoat" selected="true">default Goat parameters initial values</option>
71 <option value="defaultCow">default Cow parameters initial values</option>
72 </param>
73 <when value="defaultGoat">
74 </when>
75 <when value="defaultCow">
76 </when>
77 </conditional>
78 </when>
79 </conditional>
80 </inputs>
81 <outputs>
82 <data format="csv" name="estimated_parameters" label="GRUM estimated parameters" >
83 <filter>selectAction['action'] == 'estimateParameters'</filter>
84 </data>
85 <data format="pdf" name="simulation_plots" label="GRUM plots" >
86 <filter>selectAction['action'] == 'estimateParameters' and selectAction['do_plot_fitted']</filter>
87 </data>
88 <data format="json" name="parameter_values_file_only" label="Parameters initial values" >
89 <filter>selectAction['action'] == 'getDefaultInitial'</filter>
90 </data>
91 <data format="json" name="parameter_values_file" label="Parameters initial values" >
92 <filter>selectAction['action'] == 'estimateParameters' and selectAction['do_output_parameterValues']</filter>
93 </data>
94 </outputs>
95 <tests>
96 <test>
97 <conditional name="selectAction">
98 <param name="action" value="estimateParameters"/>
99 </conditional>
100 <param name="litter_input" value="inputs/Litter_test.csv" ftype="csv" />
101 <param name="bw_input" value="inputs/BW_test.csv" ftype="csv" />
102 <conditional name="mammalParam">
103 <param name="choose" value="defaultGoat"/>
104 </conditional>
105 <param name="do_plot_fitted" value="true" />
106 <output name="estimated_parameters" ftype="csv">
107 <assert_contents>
108 <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;" />
109 <has_line_matching expression="&quot;X2004029&quot;,.*" />
110 <has_line_matching expression="&quot;X2005115&quot;,.*" />
111 <has_n_columns n="13" sep=","/>
112 <has_n_lines n="3" />
113 </assert_contents>
114 </output>
115 </test>
116 </tests>
117 <help>
118 Inputs:
119 =======
120
121 - Litter for each mammal.
122 - Sequence of body weight of mammals.
123 - (optional) Initial parameter values for the estimation process, if the defaults available are not revelant.
124
125 Outputs:
126 ========
127
128 - Estimated parameters for each goat (csv file).
129 - (optional) Plots of simulations with estimated parameters for each goat (pdf file).
130 - (optional) Initial parameters values used for the estimation process (json file)
131
132 Example:
133 ========
134
135 - Copy to your history files BW_smalltable.csv and Litter_smalltable.csv from GRUM Datasets.
136 - Select default initial parameter values set, or provide one.
137 - Fill filenames and choose the adequate number of cores.
138 - And then execute (it takes around 20 minutes per goat for estimation)
139
140 </help>
141 </tool>
142