54
+ − 1 <tool id="insect_phenology_model" name="Insect phenology model" version="1.2.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
42
+ − 33 #if str($merge_ytd_temperature_data_cond.merge_ytd_temperature_data) == "yes":
+ − 34 --input_ytd '$merge_ytd_temperature_data_cond.input_ytd'
44
+ − 35 --location '$merge_ytd_temperature_data_cond.location'
+ − 36 --num_days_ytd $merge_ytd_temperature_data_cond.input_ytd.metadata.data_lines
42
+ − 37 #end if
37
+ − 38 --input_norm '$input_norm'
6
+ − 39 --insect '$insect'
+ − 40 --insects_per_replication $insects_per_replication
17
+ − 41 --life_stages '$life_stages'
+ − 42 #if str($plot_adult_life_stage) == "yes":
+ − 43 --life_stages_adult '$plot_adult_life_stage_cond.life_stages_adult'
9
+ − 44 #end if
17
+ − 45 #if str($plot_nymph_life_stage) == "yes":
+ − 46 --life_stages_nymph '$plot_nymph_life_stage_cond.life_stages_nymph'
9
+ − 47 #end if
6
+ − 48 --max_clutch_size $max_clutch_size
+ − 49 --min_clutch_size $min_clutch_size
+ − 50 --nymph_mortality $nymph_mortality
+ − 51 --old_nymph_accumulation $old_nymph_accumulation
+ − 52 --oviposition $oviposition
+ − 53 --photoperiod $photoperiod
9
+ − 54 --plot_generations_separately $plot_generations_separately
+ − 55 --plot_std_error $plot_std_error
48
+ − 56 --replications $replications
50
+ − 57 --script_dir '$__tool_directory__'
26
+ − 58 --young_nymph_accumulation $young_nymph_accumulation
29
+ − 59 &>ipm_log.txt;
+ − 60 if [[ $? -ne 0 ]]; then
33
+ − 61 cp ipm_log.txt '$error_file';
29
+ − 62 exit 1;
+ − 63 fi]]></command>
0
+ − 64 <inputs>
37
+ − 65 <param name="input_norm" type="data" format="csv" label="30 year normals temperature data">
+ − 66 <validator type="expression" message="30 year normals temperature data must have 10 columns and 366 rows">value is not None and value.metadata.columns==10 and value.metadata.data_lines==366</validator>
+ − 67 </param>
42
+ − 68 <conditional name="merge_ytd_temperature_data_cond">
+ − 69 <param name="merge_ytd_temperature_data" type="select" label="Merge year-to-date temperature data with 30 year normals temperature data?">
+ − 70 <option value="yes" selected="true">Yes</option>
+ − 71 <option value="no">No</option>
+ − 72 </param>
+ − 73 <when value="yes">
+ − 74 <param name="input_ytd" type="data" format="csv" label="Year-to-date temperature data">
+ − 75 <validator type="expression" message="Year-to-date temperature data must have 6 columns">value is not None and value.metadata.columns==6</validator>
+ − 76 </param>
44
+ − 77 <param name="location" type="text" value="" optional="true" label="Location" help="Enter the location or leave blank to use the station name from 30 year normals data."/>
42
+ − 78 </when>
+ − 79 <when value="no"/>
+ − 80 </conditional>
5
+ − 81 <param name="insect" type="select" label="Select insect">
9
+ − 82 <option value="BMSB" selected="True">Brown Marmorated Stink Bug</option>
5
+ − 83 </param>
42
+ − 84 <param name="replications" type="integer" value="10" min="2" label="Number of replications"/>
+ − 85 <param name="insects_per_replication" type="integer" value="1000" min="1" label="Number of insects with which to start each replication"/>
+ − 86 <param name="photoperiod" type="float" value="13.5" min="0" label="Critical photoperiod for diapause induction/termination"/>
55
+ − 87 <param name="egg_mortality" type="float" value="1" min="0" max="1" label="Adjustment rate for egg mortality" help="Floating point value between 0 and 1"/>
54
+ − 88 <param name="nymph_mortality" type="float" value="1" min="0" label="Adjustment rate for nymph mortality"/>
+ − 89 <param name="adult_mortality" type="float" value="1" min="0" label="Adjustment rate for adult mortality"/>
+ − 90 <param name="oviposition" type="float" value="1" min="0" label="Adjustment oviposition rate"/>
+ − 91 <param name="min_clutch_size" type="float" value="0" min="0" label="Adjustment of minimum clutch size"/>
+ − 92 <param name="max_clutch_size" type="float" value="0" min="0" label="Adjustment of maximum clutch size"/>
+ − 93 <param name="young_nymph_accumulation" type="float" value="0" min="0" label="Adjustment of degree-days accumulation (egg->young nymph)"/>
+ − 94 <param name="old_nymph_accumulation" type="float" value="0" min="0" label="Adjustment of degree-days accumulation (young nymph->old nymph)"/>
+ − 95 <param name="adult_accumulation" type="float" value="0" min="0" label="Adjustment of degree-days accumulation (old nymph->adult)"/>
9
+ − 96 <param name="plot_generations_separately" type="select" label="Plot generations separately?">
+ − 97 <option value="yes" selected="True">Yes</option>
+ − 98 <option value="no">No</option>
+ − 99 </param>
13
+ − 100 <param name="plot_egg_life_stage" type="select" label="Plot egg life stage?">
+ − 101 <option value="yes" selected="true">Yes</option>
+ − 102 <option value="no">No</option>
+ − 103 </param>
+ − 104 <conditional name="plot_nymph_life_stage_cond">
+ − 105 <param name="plot_nymph_life_stage" type="select" label="Plot nymph life stage?">
+ − 106 <option value="yes" selected="true">Yes</option>
+ − 107 <option value="no">No</option>
9
+ − 108 </param>
13
+ − 109 <when value="yes">
17
+ − 110 <param name="life_stages_nymph" type="select" multiple="true" label="Select nymph life stage">
9
+ − 111 <option value="Total" selected="true">All</option>
+ − 112 <option value="Young">Young</option>
+ − 113 <option value="Old">Old</option>
+ − 114 </param>
+ − 115 </when>
13
+ − 116 <when value="no"/>
+ − 117 </conditional>
+ − 118 <conditional name="plot_adult_life_stage_cond">
+ − 119 <param name="plot_adult_life_stage" type="select" label="Plot adult life stage?">
+ − 120 <option value="yes" selected="true">Yes</option>
+ − 121 <option value="no">No</option>
+ − 122 </param>
+ − 123 <when value="yes">
17
+ − 124 <param name="life_stages_adult" type="select" multiple="true" label="Select adult life stage">
9
+ − 125 <option value="Total" selected="true">All</option>
+ − 126 <option value="Pre-vittelogenic">Pre-vittelogenic</option>
+ − 127 <option value="Vittelogenic">Vittelogenic</option>
+ − 128 <option value="Diapausing">Diapausing</option>
+ − 129 </param>
+ − 130 </when>
13
+ − 131 <when value="no"/>
9
+ − 132 </conditional>
+ − 133 <param name="plot_std_error" type="select" label="Plot standard error?">
+ − 134 <option value="yes" selected="True">Yes</option>
+ − 135 <option value="no">No</option>
0
+ − 136 </param>
+ − 137 </inputs>
+ − 138 <outputs>
33
+ − 139 <collection name="output_data_collection" type="list" label="${tool.name} (data), on ${on_string}">
42
+ − 140 <discover_datasets pattern="__name__" directory="output_data_dir" format="csv"/>
33
+ − 141 </collection>
+ − 142 <collection name="output_plots_collection" type="list" label="${tool.name} (plots), on ${on_string}">
42
+ − 143 <discover_datasets pattern="__name__" directory="output_plots_dir" format="pdf"/>
9
+ − 144 </collection>
0
+ − 145 </outputs>
+ − 146 <tests>
+ − 147 <test>
42
+ − 148 <param name="input_norm" value="30_year_normals.csv" ftype="csv"/>
+ − 149 <param name="merge_ytd_temperature_data" value="no"/>
+ − 150 <param name="replications" value="2"/>
+ − 151 <param name="plot_generations_separately" value="no"/>
+ − 152 <param name="plot_egg_life_stage" value="no"/>
+ − 153 <param name="life_stages_nymph" value="Young"/>
+ − 154 <param name="life_stages_adult" value="Pre-vittelogenic"/>
33
+ − 155 <output_collection name="output_data_collection" type="list">
+ − 156 <element name="04_combined_generations.csv" file="output_combined1.csv" ftype="csv" compare="contains"/>
+ − 157 </output_collection>
+ − 158 <output_collection name="output_plots_collection" type="list">
28
+ − 159 <element name="02_young_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 160 <element name="05_pre-vittelogenic_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 161 </output_collection>
+ − 162 </test>
+ − 163 <test>
42
+ − 164 <param name="input_norm" value="30_year_normals.csv" ftype="csv"/>
+ − 165 <param name="input_ytd" value="state_college_partial.csv" ftype="csv"/>
+ − 166 <param name="location" value="State College PA"/>
+ − 167 <param name="replications" value="2"/>
+ − 168 <param name="plot_generations_separately" value="no"/>
+ − 169 <param name="plot_egg_life_stage" value="no"/>
+ − 170 <param name="life_stages_nymph" value="Young"/>
+ − 171 <param name="life_stages_adult" value="Pre-vittelogenic"/>
+ − 172 <output_collection name="output_data_collection" type="list">
+ − 173 <element name="04_combined_generations.csv" file="output_combined1.csv" ftype="csv" compare="contains"/>
+ − 174 </output_collection>
+ − 175 <output_collection name="output_plots_collection" type="list">
+ − 176 <element name="02_young_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 177 <element name="05_pre-vittelogenic_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 178 </output_collection>
+ − 179 </test>
+ − 180 <test>
+ − 181 <param name="input_norm" value="30_year_normals.csv" ftype="csv"/>
+ − 182 <param name="input_ytd" value="state_college_ytd.csv" ftype="csv"/>
+ − 183 <param name="location" value="State College PA"/>
+ − 184 <param name="replications" value="2"/>
+ − 185 <param name="plot_generations_separately" value="no"/>
33
+ − 186 <output_collection name="output_data_collection" type="list">
+ − 187 <element name="04_combined_generations.csv" file="output_combined2.csv" ftype="csv" compare="contains"/>
+ − 188 </output_collection>
+ − 189 <output_collection name="output_plots_collection" type="list">
28
+ − 190 <element name="01_egg_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 191 <element name="04_total_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 192 <element name="08_total_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 193 <element name="09_total_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 194 </output_collection>
+ − 195 </test>
+ − 196 <test>
42
+ − 197 <param name="input_norm" value="30_year_normals.csv" ftype="csv"/>
+ − 198 <param name="input_ytd" value="state_college_partial.csv" ftype="csv"/>
+ − 199 <param name="location" value="State College PA"/>
+ − 200 <param name="replications" value="2"/>
+ − 201 <param name="plot_egg_life_stage" value="no"/>
+ − 202 <param name="life_stages_nymph" value="Old"/>
+ − 203 <param name="plot_adult_life_stage" value="no"/>
33
+ − 204 <output_collection name="output_data_collection" type="list">
+ − 205 <element name="01_generation_P.csv" file="output_p_3.csv" ftype="csv" compare="contains"/>
+ − 206 <element name="02_generation_F1.csv" file="output_f1_3.csv" ftype="csv" compare="contains"/>
+ − 207 <element name="03_generation_F2.csv" file="output_f2_3.csv" ftype="csv" compare="contains"/>
+ − 208 <element name="04_combined_generations.csv" file="output_combined3.csv" ftype="csv" compare="contains"/>
+ − 209 </output_collection>
+ − 210 <output_collection name="output_plots_collection" type="list">
28
+ − 211 <element name="03_old_nymph_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
22
+ − 212 </output_collection>
+ − 213 </test>
+ − 214 <test>
42
+ − 215 <param name="input_norm" value="30_year_normals.csv" ftype="csv"/>
+ − 216 <param name="input_ytd" value="state_college_ytd.csv" ftype="csv"/>
+ − 217 <param name="location" value="State College PA"/>
+ − 218 <param name="replications" value="2"/>
33
+ − 219 <output_collection name="output_data_collection" type="list">
+ − 220 <element name="01_generation_P.csv" file="output_p_4.csv" ftype="csv" compare="contains"/>
+ − 221 <element name="02_generation_F1.csv" file="output_f1_4.csv" ftype="csv" compare="contains"/>
+ − 222 <element name="03_generation_F2.csv" file="output_f2_4.csv" ftype="csv" compare="contains"/>
+ − 223 <element name="04_combined_generations.csv" file="output_combined4.csv" ftype="csv" compare="contains"/>
+ − 224 </output_collection>
+ − 225 <output_collection name="output_plots_collection" type="list">
28
+ − 226 <element name="01_egg_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 227 <element name="04_total_nymph_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 228 <element name="08_total_adult_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
+ − 229 <element name="09_total_pop_by_generation.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
9
+ − 230 </output_collection>
0
+ − 231 </test>
+ − 232 </tests>
+ − 233 <help>
+ − 234 **What it does**
6
+ − 235
0
+ − 236 Provides an agent-based stochastic model expressing stage-specific phenology and population dynamics for an insect species across geographic regions.
+ − 237
+ − 238 -----
+ − 239
+ − 240 **Required options**
+ − 241
42
+ − 242 * **30 year normals temperature data** - the dataset from your history containing the 30-year normals temperature data (available at http://pestwatch.psu.edu/ghcn).
+ − 243 * **Merge year-to-date temperature data with 30 year normals temperature data** - select Yes to merge a year-to-date temperature dataset from your history into the selected 30 year normals temperature data.
+ − 244
+ − 245 * **Year-to-date temperature data** - the dataset from your history containing the year-to-date temperature data (available at http://pestwatch.psu.edu/minmax).
+ − 246
0
+ − 247 * **Location** - the location associated with the selected temperature data.
7
+ − 248 * **Select insect** - currently only the Brown Marmorated Stink Bug can be analyzed.
0
+ − 249 * **Number of replications** - number of replications.
6
+ − 250 * **Number of insects with which to start each replication** - the analysis for each replication will start with this number of insects.
0
+ − 251 * **Critical photoperiod for diapause induction/termination** - critical photoperiod for diapause induction/termination.
+ − 252 * **Adjustment rate for egg mortality** - adjustment rate for egg mortality.
+ − 253 * **Adjustment rate for nymph mortality** - adjustment rate for nymph mortality.
+ − 254 * **Adjustment rate for adult mortality** - adjustment rate for adult mortality.
+ − 255 * **Adjustment oviposition rate** - adjustment oviposition rate.
+ − 256 * **Adjustment of minimum clutch size** - adjustment of minimum clutch size.
+ − 257 * **Adjustment of maximum clutch size** - adjustment of maximum clutch size
6
+ − 258 * **Adjustment of degree-days accumulation (egg->young nymph)** - adjustment of degree-days accumulation (egg->young nymph).
+ − 259 * **Adjustment of degree-days accumulation (young nymph->old nymph)** - adjustment of degree-days accumulation (young nymph->old nymph).
+ − 260 * **Adjustment of degree-days accumulation (old nymph->adult)** - adjustment of degree-days accumulation (old nymph->adult).
9
+ − 261 * **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
+ − 262 * **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.
+ − 263 * **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.
+ − 264
+ − 265 * **Select nymph life stage** - select the nymph life stage for plotting.
+ − 266
+ − 267 * **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.
+ − 268
+ − 269 * **Select adult life stage** - select the adult life stage for plotting.
+ − 270
6
+ − 271 * **Plot standard error** - add standard error lines to plot.
0
+ − 272 </help>
+ − 273 <citations>
+ − 274 <citation type="doi">10.3389/fphys.2016.00165</citation>
3
+ − 275 <citation type="doi">10.1175/JTECH-D-11-00103.1</citation>
+ − 276 <citation type="doi">10.7289/V5D21VHZ</citation>
0
+ − 277 </citations>
+ − 278 </tool>