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