0
|
1 <tool id="ipm_date_interval" name="Extract date interval" version="1.1.0">
|
|
2 <description>from insect phenology model data</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="1.4.4">r-optparse</requirement>
|
|
5 </requirements>
|
|
6 <command detect_errors="exit_code"><![CDATA[
|
|
7 #import os
|
|
8 #set input_dir = 'input_dir'
|
|
9 #set output_data_dir = "output_data_dir"
|
|
10 #set output_plots_dir = "output_plots_dir"
|
|
11 #set error_file = $os.path.join($output_data_dir, "04_combined_generations.csv")
|
|
12 mkdir $input_dir &&
|
|
13 mkdir output_data_dir &&
|
|
14 mkdir output_plots_dir &&
|
|
15 #for $i in $input:
|
|
16 #set filename = $i.file_name
|
|
17 #set name = $i.name
|
|
18 ln -s $filename $input_dir/$name &&
|
|
19 #end for
|
|
20 Rscript '$__tool_directory__/extract_ipm_date_interval.R'
|
|
21 --end_date '$end_date'
|
|
22 --input_dir '$input_dir'
|
|
23 --plot_std_error $plot_std_error
|
|
24 --script_dir '$__tool_directory__'
|
|
25 --start_date '$start_date'
|
|
26 &>ipm_log.txt;
|
|
27 if [[ $? -ne 0 ]]; then
|
|
28 cp ipm_log.txt '$error_file';
|
|
29 exit 1;
|
|
30 fi]]></command>
|
|
31 <inputs>
|
|
32 <param name="input" type="data_collection" format="csv" collection_type="list" label="Insect phenology model data files" />
|
|
33 <param name="start_date" type="text" value="" label="Start date" help="Format must be yyyy-mm-dd">
|
|
34 <validator type="expression" message="Date must have the format yyyy-mm-dd">len(value.split('-')[0])==4 and int(value.split('-')[0]) and len(value.split('-')[1])==2 and int(value.split('-')[1]) and len(value.split('-')[2])==2 and int(value.split('-')[2])</validator>
|
|
35 </param>
|
|
36 <param name="end_date" type="text" value="" label="End date" help="Format must be yyyy-mm-dd">
|
|
37 <validator type="expression" message="Date must have the format yyyy-mm-dd">len(value.split('-')[0])==4 and int(value.split('-')[0]) and len(value.split('-')[1])==2 and int(value.split('-')[1]) and len(value.split('-')[2])==2 and int(value.split('-')[2])</validator>
|
|
38 </param>
|
|
39 <param name="plot_std_error" type="select" label="Plot standard error?">
|
|
40 <option value="yes" selected="True">Yes</option>
|
|
41 <option value="no">No</option>
|
|
42 </param>
|
|
43 </inputs>
|
|
44 <outputs>
|
|
45 <collection name="output_data_collection" type="list" label="${tool.name} (data), on ${on_string}">
|
|
46 <discover_datasets pattern="__name__" directory="output_data_dir" format="csv"/>
|
|
47 </collection>
|
|
48 <collection name="output_plots_collection" type="list" label="${tool.name} (plots), on ${on_string}">
|
|
49 <discover_datasets pattern="__name__" directory="output_plots_dir" format="pdf"/>
|
|
50 </collection>
|
|
51 </outputs>
|
|
52 <tests>
|
|
53 <test>
|
|
54 <param name="input">
|
|
55 <collection type="list">
|
|
56 <element name="04_combined_generations.csv"/>
|
|
57 </collection>
|
|
58 </param>
|
|
59 <param name="start_date" value="2017-04-01"/>
|
|
60 <param name="end_date" value="2017-04-15"/>
|
|
61 <output_collection name="output_data_collection" type="list">
|
|
62 <element name="04_combined_generations.csv" file="output_combined6.csv" ftype="csv" compare="contains"/>
|
|
63 </output_collection>
|
|
64 <!--
|
|
65 <output_collection name="output_plots_collection" type="list">
|
|
66 <element name="02_young_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
|
|
67 <element name="05_pre-vittelogenic_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
|
|
68 </output_collection>
|
|
69 -->
|
|
70 </test>
|
|
71 <test>
|
|
72 <param name="input">
|
|
73 <collection type="list">
|
|
74 <element name="04_combined_generations.csv"/>
|
|
75 </collection>
|
|
76 </param>
|
|
77 <param name="start_date" value="2017-01-01"/>
|
|
78 <param name="end_date" value="2017-01-15"/>
|
|
79 <output_collection name="output_data_collection" type="list">
|
|
80 <element name="04_combined_generations.csv" file="output_combined7.csv" ftype="csv" compare="contains"/>
|
|
81 </output_collection>
|
|
82 <!--
|
|
83 <output_collection name="output_plots_collection" type="list">
|
|
84 <element name="02_young_nymph_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
|
|
85 <element name="05_pre-vittelogenic_adult_pop.pdf" file="plot.pdf" ftype="pdf" compare="contains"/>
|
|
86 </output_collection>
|
|
87 -->
|
|
88 </test>
|
|
89 </tests>
|
|
90 <help>
|
|
91 **What it does**
|
|
92
|
|
93 Provides an agent-based stochastic model expressing stage-specific phenology and population dynamics for an insect species across geographic regions.
|
|
94
|
|
95 -----
|
|
96
|
|
97 **Required options**
|
|
98
|
|
99 * **Plot standard error** - add standard error lines to plot.
|
|
100 </help>
|
|
101 <citations>
|
|
102 <citation type="doi">10.3389/fphys.2016.00165</citation>
|
|
103 <citation type="doi">10.1175/JTECH-D-11-00103.1</citation>
|
|
104 <citation type="doi">10.7289/V5D21VHZ</citation>
|
|
105 </citations>
|
|
106 </tool>
|