3
+ − 1 <tool id="insect_phenology_model" name="Insect phenology model" version="1.1.0">
0
+ − 2 <description>expressing stage-specific phenology and population dynamics</description>
+ − 3 <requirements>
4
+ − 4 <requirement type="package" version="1.4.4">r-optparse</requirement>
0
+ − 5 </requirements>
2
+ − 6 <command detect_errors="exit_code"><![CDATA[
33
+ − 7 #import os
+ − 8 #set output_data_dir = "output_data_dir"
+ − 9 #set output_plots_dir = "output_plots_dir"
+ − 10 #set error_file = $os.path.join($output_data_dir, "04_combined_generations.csv")
17
+ − 11 #set life_stages = list()
13
+ − 12 #set plot_adult_life_stage = $plot_adult_life_stage_cond.plot_adult_life_stage
+ − 13 #set plot_nymph_life_stage = $plot_nymph_life_stage_cond.plot_nymph_life_stage
17
+ − 14 #if str($plot_egg_life_stage) == "yes":
+ − 15 $life_stages.append("Egg")
+ − 16 #end if
+ − 17 #if str($plot_nymph_life_stage) == "yes":
+ − 18 $life_stages.append("Nymph")
+ − 19 #end if
+ − 20 #if str($plot_adult_life_stage) == "yes":
+ − 21 $life_stages.append("Adult")
+ − 22 #end if
13
+ − 23 #if str($plot_egg_life_stage) == "yes" and str($plot_nymph_life_stage) == "yes" and str($plot_adult_life_stage) == "yes":
17
+ − 24 $life_stages.append("Total")
13
+ − 25 #end if
17
+ − 26 #set life_stages = ",".join($life_stages)
33
+ − 27 mkdir output_data_dir &&
+ − 28 mkdir output_plots_dir &&
0
+ − 29 Rscript '$__tool_directory__/insect_phenology_model.R'
6
+ − 30 --adult_mortality $adult_mortality
+ − 31 --adult_accumulation $adult_accumulation
+ − 32 --egg_mortality $egg_mortality
+ − 33 --input '$input'
+ − 34 --insect '$insect'
+ − 35 --insects_per_replication $insects_per_replication
17
+ − 36 --life_stages '$life_stages'
+ − 37 #if str($plot_adult_life_stage) == "yes":
+ − 38 --life_stages_adult '$plot_adult_life_stage_cond.life_stages_adult'
9
+ − 39 #end if
17
+ − 40 #if str($plot_nymph_life_stage) == "yes":
+ − 41 --life_stages_nymph '$plot_nymph_life_stage_cond.life_stages_nymph'
9
+ − 42 #end if
6
+ − 43 --location '$location'
+ − 44 --max_clutch_size $max_clutch_size
+ − 45 --min_clutch_size $min_clutch_size
+ − 46 --nymph_mortality $nymph_mortality
+ − 47 --num_days $input.metadata.data_lines
+ − 48 --old_nymph_accumulation $old_nymph_accumulation
+ − 49 --oviposition $oviposition
+ − 50 --photoperiod $photoperiod
+ − 51 --replications $replications
9
+ − 52 --plot_generations_separately $plot_generations_separately
+ − 53 --plot_std_error $plot_std_error
26
+ − 54 --young_nymph_accumulation $young_nymph_accumulation
29
+ − 55 &>ipm_log.txt;
+ − 56 if [[ $? -ne 0 ]]; then
33
+ − 57 cp ipm_log.txt '$error_file';
29
+ − 58 exit 1;
+ − 59 fi]]></command>
0
+ − 60 <inputs>
4
+ − 61 <param name="input" type="data" format="csv" label="Temperature data" />
2
+ − 62 <param name="location" type="text" value="" optional="false" label="Location" />
5
+ − 63 <param name="insect" type="select" label="Select insect">
9
+ − 64 <option value="BMSB" selected="True">Brown Marmorated Stink Bug</option>
5
+ − 65 </param>
9
+ − 66 <param name="replications" type="integer" value="10" min="2" label="Number of replications" />
6
+ − 67 <param name="insects_per_replication" type="integer" value="1000" min="1" label="Number of insects with which to start each replication" />
0
+ − 68 <param name="photoperiod" type="float" value="13.5" min="0" label="Critical photoperiod for diapause induction/termination" />
6
+ − 69 <param name="egg_mortality" type="integer" value="1" min="0" label="Adjustment rate for egg mortality" />
+ − 70 <param name="nymph_mortality" type="integer" value="1" min="0" label="Adjustment rate for nymph mortality" />
+ − 71 <param name="adult_mortality" type="integer" value="1" min="0" label="Adjustment rate for adult mortality" />
0
+ − 72 <param name="oviposition" type="integer" value="1" min="0" label="Adjustment oviposition rate" />
+ − 73 <param name="min_clutch_size" type="integer" value="0" min="0" label="Adjustment of minimum clutch size" />
+ − 74 <param name="max_clutch_size" type="integer" value="0" min="0" label="Adjustment of maximum clutch size" />
6
+ − 75 <param name="young_nymph_accumulation" type="integer" value="0" min="0" label="Adjustment of degree-days accumulation (egg->young nymph)" />
+ − 76 <param name="old_nymph_accumulation" type="integer" value="0" min="0" label="Adjustment of degree-days accumulation (young nymph->old nymph)" />
+ − 77 <param name="adult_accumulation" type="integer" value="0" min="0" label="Adjustment of degree-days accumulation (old nymph->adult)" />
9
+ − 78 <param name="plot_generations_separately" type="select" label="Plot generations separately?">
+ − 79 <option value="yes" selected="True">Yes</option>
+ − 80 <option value="no">No</option>
+ − 81 </param>
13
+ − 82 <param name="plot_egg_life_stage" type="select" label="Plot egg life stage?">
+ − 83 <option value="yes" selected="true">Yes</option>
+ − 84 <option value="no">No</option>
+ − 85 </param>
+ − 86 <conditional name="plot_nymph_life_stage_cond">
+ − 87 <param name="plot_nymph_life_stage" type="select" label="Plot nymph life stage?">
+ − 88 <option value="yes" selected="true">Yes</option>
+ − 89 <option value="no">No</option>
9
+ − 90 </param>
13
+ − 91 <when value="yes">
17
+ − 92 <param name="life_stages_nymph" type="select" multiple="true" label="Select nymph life stage">
9
+ − 93 <option value="Total" selected="true">All</option>
+ − 94 <option value="Young">Young</option>
+ − 95 <option value="Old">Old</option>
+ − 96 </param>
+ − 97 </when>
13
+ − 98 <when value="no"/>
+ − 99 </conditional>
+ − 100 <conditional name="plot_adult_life_stage_cond">
+ − 101 <param name="plot_adult_life_stage" type="select" label="Plot adult life stage?">
+ − 102 <option value="yes" selected="true">Yes</option>
+ − 103 <option value="no">No</option>
+ − 104 </param>
+ − 105 <when value="yes">
17
+ − 106 <param name="life_stages_adult" type="select" multiple="true" label="Select adult life stage">
9
+ − 107 <option value="Total" selected="true">All</option>
+ − 108 <option value="Pre-vittelogenic">Pre-vittelogenic</option>
+ − 109 <option value="Vittelogenic">Vittelogenic</option>
+ − 110 <option value="Diapausing">Diapausing</option>
+ − 111 </param>
+ − 112 </when>
13
+ − 113 <when value="no"/>
9
+ − 114 </conditional>
+ − 115 <param name="plot_std_error" type="select" label="Plot standard error?">
+ − 116 <option value="yes" selected="True">Yes</option>
+ − 117 <option value="no">No</option>
0
+ − 118 </param>
+ − 119 </inputs>
+ − 120 <outputs>
33
+ − 121 <collection name="output_data_collection" type="list" label="${tool.name} (data), on ${on_string}">
+ − 122 <discover_datasets pattern="__name__" directory="output_data_dir" format="csv" />
+ − 123 </collection>
+ − 124 <collection name="output_plots_collection" type="list" label="${tool.name} (plots), on ${on_string}">
+ − 125 <discover_datasets pattern="__name__" directory="output_plots_dir" format="pdf" />
9
+ − 126 </collection>
0
+ − 127 </outputs>
+ − 128 <tests>
+ − 129 <test>
3
+ − 130 <param name="input" value="state_college.csv" ftype="csv" />
+ − 131 <param name="location" value="State College PA" />
12
+ − 132 <param name="replications" value="2" />
22
+ − 133 <param name="plot_generations_separately" value="no" />
+ − 134 <param name="plot_egg_life_stage" value="no" />
+ − 135 <param name="life_stages_nymph" value="Young" />
+ − 136 <param name="life_stages_adult" value="Pre-vittelogenic" />
33
+ − 137 <output_collection name="output_data_collection" type="list">
+ − 138 <element name="04_combined_generations.csv" file="output_combined1.csv" ftype="csv" compare="contains"/>
+ − 139 </output_collection>
+ − 140 <output_collection name="output_plots_collection" type="list">
28
+ − 141 <element name="02_young_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 142 <element name="05_pre-vittelogenic_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 143 </output_collection>
+ − 144 </test>
+ − 145 <test>
+ − 146 <param name="input" value="state_college.csv" ftype="csv" />
+ − 147 <param name="location" value="State College PA" />
+ − 148 <param name="replications" value="2" />
+ − 149 <param name="plot_generations_separately" value="no" />
33
+ − 150 <output_collection name="output_data_collection" type="list">
+ − 151 <element name="04_combined_generations.csv" file="output_combined2.csv" ftype="csv" compare="contains"/>
+ − 152 </output_collection>
+ − 153 <output_collection name="output_plots_collection" type="list">
28
+ − 154 <element name="01_egg_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 155 <element name="04_total_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 156 <element name="08_total_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 157 <element name="09_total_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 158 </output_collection>
+ − 159 </test>
+ − 160 <test>
+ − 161 <param name="input" value="state_college.csv" ftype="csv" />
+ − 162 <param name="location" value="State College PA" />
+ − 163 <param name="replications" value="2" />
+ − 164 <param name="plot_egg_life_stage" value="no" />
+ − 165 <param name="life_stages_nymph" value="Old" />
+ − 166 <param name="plot_adult_life_stage" value="no" />
33
+ − 167 <output_collection name="output_data_collection" type="list">
+ − 168 <element name="01_generation_P.csv" file="output_p_3.csv" ftype="csv" compare="contains"/>
+ − 169 <element name="02_generation_F1.csv" file="output_f1_3.csv" ftype="csv" compare="contains"/>
+ − 170 <element name="03_generation_F2.csv" file="output_f2_3.csv" ftype="csv" compare="contains"/>
+ − 171 <element name="04_combined_generations.csv" file="output_combined3.csv" ftype="csv" compare="contains"/>
+ − 172 </output_collection>
+ − 173 <output_collection name="output_plots_collection" type="list">
28
+ − 174 <element name="03_old_nymph_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 175 </output_collection>
+ − 176 </test>
+ − 177 <test>
+ − 178 <param name="input" value="state_college.csv" ftype="csv" />
+ − 179 <param name="location" value="State College PA" />
+ − 180 <param name="replications" value="2" />
33
+ − 181 <output_collection name="output_data_collection" type="list">
+ − 182 <element name="01_generation_P.csv" file="output_p_4.csv" ftype="csv" compare="contains"/>
+ − 183 <element name="02_generation_F1.csv" file="output_f1_4.csv" ftype="csv" compare="contains"/>
+ − 184 <element name="03_generation_F2.csv" file="output_f2_4.csv" ftype="csv" compare="contains"/>
+ − 185 <element name="04_combined_generations.csv" file="output_combined4.csv" ftype="csv" compare="contains"/>
+ − 186 </output_collection>
+ − 187 <output_collection name="output_plots_collection" type="list">
28
+ − 188 <element name="01_egg_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 189 <element name="04_total_nymph_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 190 <element name="08_total_adult_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 191 <element name="09_total_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
9
+ − 192 </output_collection>
0
+ − 193 </test>
+ − 194 </tests>
+ − 195 <help>
+ − 196 **What it does**
6
+ − 197
0
+ − 198 Provides an agent-based stochastic model expressing stage-specific phenology and population dynamics for an insect species across geographic regions.
+ − 199
+ − 200 -----
+ − 201
+ − 202 **Required options**
+ − 203
+ − 204 * **Location** - the location associated with the selected temperature data.
+ − 205 * **Temperature data** - select the dataset from your history containing the temperature data.
7
+ − 206 * **Select insect** - currently only the Brown Marmorated Stink Bug can be analyzed.
0
+ − 207 * **Number of replications** - number of replications.
6
+ − 208 * **Number of insects with which to start each replication** - the analysis for each replication will start with this number of insects.
0
+ − 209 * **Critical photoperiod for diapause induction/termination** - critical photoperiod for diapause induction/termination.
+ − 210 * **Adjustment rate for egg mortality** - adjustment rate for egg mortality.
+ − 211 * **Adjustment rate for nymph mortality** - adjustment rate for nymph mortality.
+ − 212 * **Adjustment rate for adult mortality** - adjustment rate for adult mortality.
+ − 213 * **Adjustment oviposition rate** - adjustment oviposition rate.
+ − 214 * **Adjustment of minimum clutch size** - adjustment of minimum clutch size.
+ − 215 * **Adjustment of maximum clutch size** - adjustment of maximum clutch size
6
+ − 216 * **Adjustment of degree-days accumulation (egg->young nymph)** - adjustment of degree-days accumulation (egg->young nymph).
+ − 217 * **Adjustment of degree-days accumulation (young nymph->old nymph)** - adjustment of degree-days accumulation (young nymph->old nymph).
+ − 218 * **Adjustment of degree-days accumulation (old nymph->adult)** - adjustment of degree-days accumulation (old nymph->adult).
9
+ − 219 * **Plot generations separately** - select "Yes" to plot P, F1 and F2 as separate lines or "no" to pool across generations, resulting in a total for the selected life states.
14
+ − 220 * **Plot egg life stage** - select "Yes" to plot the egg life stage. If all life stages (egg, nymph and adult) are selected for plotting, one output for the total will be produced.
+ − 221 * **Plot nymph life stage** - select "Yes" to plot the nymph life stage. If all life stages (egg, nymph and adult) are selected for plotting, one output for the total will be produced.
+ − 222
+ − 223 * **Select nymph life stage** - select the nymph life stage for plotting.
+ − 224
+ − 225 * **Plot adult life stage** - select "Yes" to plot the adult life stage. If all life stages (egg, nymph and adult) are selected for plotting, one output for the total will be produced.
+ − 226
+ − 227 * **Select adult life stage** - select the adult life stage for plotting.
+ − 228
6
+ − 229 * **Plot standard error** - add standard error lines to plot.
0
+ − 230 </help>
+ − 231 <citations>
+ − 232 <citation type="doi">10.3389/fphys.2016.00165</citation>
3
+ − 233 <citation type="doi">10.1175/JTECH-D-11-00103.1</citation>
+ − 234 <citation type="doi">10.7289/V5D21VHZ</citation>
0
+ − 235 </citations>
+ − 236 </tool>