0
|
1 <macros>
|
|
2
|
|
3 <xml name="rmarkdown_requirements">
|
|
4 <requirement type="package" version="1.15.0.6-0">pandoc</requirement>
|
|
5 <requirement type="package" version="1.6">r-rmarkdown</requirement>
|
|
6 <requirement type="package" version="1.2.1">r-tidyverse</requirement>
|
|
7 </xml>
|
|
8
|
|
9 <xml name="stdio">
|
|
10 <stdio>
|
|
11 <regex match="XXX" source="stderr" level="warning"
|
|
12 description="Check the tool log output file for more details."/>
|
|
13 </stdio>
|
|
14 </xml>
|
|
15
|
6
|
16 <xml name="function_components">
|
7
|
17 <repeat name="function_component_repeat" title="Call a function" min="1" default="1">
|
4
|
18 <expand macro="function_name" />
|
|
19 <expand macro="function_arguments" />
|
|
20 </repeat>
|
|
21 </xml>
|
|
22
|
0
|
23 <!--Tool name-->
|
|
24 <xml name="function_name">
|
4
|
25 <param type="select" name="function_name" multiple="false" label="==== Call function ====">
|
3
|
26 <option value="ggplot" selected="false">ggplot</option>
|
|
27 <option value="aes" selected="false">ggplot</option>
|
|
28 <option value="read.table" selected="false">read.table</option>
|
|
29 <option value="write.csv" selected="false">write.csv</option>
|
0
|
30 </param>
|
|
31 </xml>
|
|
32
|
|
33 <!--input values: string, float and integer-->
|
|
34 <xml name="function_arguments">
|
7
|
35 <repeat name="regular_argument_value" title="--------Argument value: from user input" min="0" default="0">
|
0
|
36 <param type="text" name="argument" label="argument" />
|
|
37 <param type="text" name="argument_value" label="argument value" />
|
2
|
38 <param type="select" name="argument_type" label="argument type">
|
|
39 <option value="string" selected="true">string</option>
|
|
40 <option value="numeric" selected="true">numeric</option>
|
|
41 <option value="boolean" selected="true">boolean</option>
|
|
42 </param>
|
0
|
43 </repeat>
|
7
|
44 <repeat name="rdata_argument_value" title="--------Argument value: from RData" min="0" default="0">
|
0
|
45 <param type="text" name="argument" label="argument" />
|
3
|
46 <param type="data" format="rdata" name="argument_value" optional="false" label="RData output" />
|
0
|
47 </repeat>
|
7
|
48 <repeat name="function_argument_value" title="--------Argument value: from function return" min="0" default="0">
|
3
|
49 <param type="text" name="argument" optional="false" label="argument" />
|
2
|
50 <expand macro="function_name" />
|
|
51 <expand macro="nested_function_arguments" />
|
0
|
52 </repeat>
|
6
|
53 <param type="select" name="connect_to_next_function" label="connect to next function">
|
0
|
54 <option value="%>%" selected="false">pipe (%>%)</option>
|
|
55 <option value="+" selected="false">plus (+)</option>
|
|
56 </param>
|
|
57 </xml>
|
|
58
|
|
59 <xml name="nested_function_arguments">
|
7
|
60 <repeat name="regular_argument_value" title="--------Argument value: from user input" min="0" default="0">
|
0
|
61 <param type="text" name="argument" label="argument" />
|
|
62 <param type="text" name="argument_value" label="argument value" />
|
2
|
63 <param type="select" name="argument_type" label="argument type">
|
|
64 <option value="string" selected="true">string</option>
|
|
65 <option value="numeric" selected="true">numeric</option>
|
|
66 <option value="boolean" selected="true">boolean</option>
|
|
67 </param>
|
0
|
68 </repeat>
|
7
|
69 <repeat name="rdata_argument_value" title="--------Argument value: from RData" min="0" default="0">
|
0
|
70 <param type="text" name="argument" label="argument" />
|
|
71 <param type="text" name="argument_value" label="RData output" />
|
|
72 </repeat>
|
|
73 </xml>
|
|
74
|
|
75 <!--<!–OPTION/ARGUMENT PAIRS and INPUT types–>-->
|
|
76 <!--<!–input files–>-->
|
|
77 <!--<xml name="option_argument_single_dataset">-->
|
|
78 <!--<repeat name="option_argument_single_dataset_repeat" title="INPUT DATA FROM HISTORY: single data set" min="0" default="0">-->
|
|
79 <!--<param type="text" name="flag" optional="true" label="flag" />-->
|
|
80 <!--<param name="value" type="data" optional="false" multiple="false" label="value"/>-->
|
|
81 <!--</repeat>-->
|
|
82 <!--</xml>-->
|
|
83
|
|
84 <!--<xml name="option_argument_multiple_datasets">-->
|
|
85 <!--<repeat name="option_argument_multiple_datasets_repeat" title="INPUT DATA FROM HISTORY: multiple data sets" min="0" default="0">-->
|
|
86 <!--<param type="text" name="flag" optional="true" label="flag" />-->
|
|
87 <!--<param name="value" type="data" optional="false" multiple="true" label="value"/>-->
|
|
88 <!--<param type="select" name="delimiter" multiple="false" label="file delimiter">-->
|
|
89 <!--<option value=" " selected="false">space</option>-->
|
|
90 <!--<option value="," selected="false">comma</option>-->
|
|
91 <!--</param>-->
|
|
92 <!--</repeat>-->
|
|
93 <!--</xml>-->
|
|
94
|
|
95 <!--<!–input path–>-->
|
|
96 <!--<xml name="option_argument_path_relative_to_a_tool">-->
|
|
97 <!--<repeat name="option_argument_path_relative_to_a_tool_repeat" title="INPUT DATA PATH: relative to a tool output directory" min="0" default="0">-->
|
|
98 <!--<param type="text" name="flag" optional="true" label="flag" />-->
|
|
99 <!--<param name="a_tool_output_dir" type="data" optional="false" multiple="false" label="a tool output directory"/>-->
|
|
100 <!--<param type="text" name="value" optional="true" label="value" />-->
|
|
101 <!--</repeat>-->
|
|
102 <!--</xml>-->
|
|
103 <!--<xml name="option_argument_path_relative_to_this_tool">-->
|
|
104 <!--<repeat name="option_argument_path_relative_to_this_tool_repeat" title="OUTPUT PATH: relative to this tool output directory" min="0" default="0">-->
|
|
105 <!--<param type="text" name="flag" optional="true" label="flag" />-->
|
|
106 <!--<param type="text" name="value" optional="false" label="value" />-->
|
|
107 <!--<param type="select" name="path_type" multiple="false" label="path type">-->
|
|
108 <!--<option value="file_path" selected="false">file path</option>-->
|
|
109 <!--<option value="dir_path" selected="false">directory path</option>-->
|
|
110 <!--</param>-->
|
|
111 <!--</repeat>-->
|
|
112 <!--</xml>-->
|
|
113
|
|
114
|
|
115
|
|
116 <!--output set-->
|
|
117 <xml name="output_set">
|
|
118 <data format="html" name="report" label="${tool.name} report"/>
|
|
119 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/>
|
|
120 <data format="txt" name="tool_output_dir" label="${tool.name} output directory"/>
|
|
121 <data format="txt" name="tool_log" label="${tool.name} log" />
|
|
122 </xml>
|
|
123
|
|
124
|
|
125 <!--shell command fragment-->
|
|
126 <xml name="shell_command">
|
|
127 <command><![CDATA[
|
|
128
|
|
129 ############ first, create a directory to store all files
|
|
130 mkdir -p $report.files_path &&
|
|
131
|
|
132
|
|
133 ############ save the tool installation directory to an environment variable
|
|
134 export TOOL_INSTALL_DIR='${__tool_directory__}' &&
|
|
135
|
|
136
|
|
137 #########################
|
|
138 ##
|
|
139 ## save user input option/argument pairs into a file
|
|
140 ##
|
|
141 #########################
|
|
142
|
|
143 ## first line will be the header
|
|
144 echo 'type|flag|value|path_type' > $report.files_path/options_and_arguments.txt &&
|
|
145
|
|
146 ############ function_name
|
|
147 ##-t '$function_name'
|
|
148 echo "function_name|not available|${function_name}|not available" >> $report.files_path/options_and_arguments.txt &&
|
|
149
|
|
150 ####################################################
|
|
151 ## loop through repeats to get option/argument pairs
|
|
152 ####################################################
|
|
153
|
|
154 ############ option_argument_single_dataset
|
|
155 #for i in $option_argument_single_dataset_repeat:
|
|
156 #set $item = 'single_dataset|' + str($i.flag) + "|" + str($i.value) + "|"
|
|
157 echo '$item' >> $report.files_path/options_and_arguments.txt &&
|
|
158 #end for
|
|
159
|
|
160 ############ option_argument_multiple_datasets
|
|
161 #for i in $option_argument_multiple_datasets_repeat:
|
|
162 #set $item = 'multiple_datasets|' + str($i.flag) + "|" + str($i.value).replace(',', str($i.delimiter)) + "|"
|
|
163 echo '$item' >> $report.files_path/options_and_arguments.txt &&
|
|
164 #end for
|
|
165
|
|
166
|
|
167 ############ option_argument_path_relative_to_a_tool
|
|
168 #for i in $option_argument_path_relative_to_a_tool_repeat:
|
|
169 #set $item = 'path_relative_to_a_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.a_tool_output_dir)
|
|
170 echo '$item' >> $report.files_path/options_and_arguments.txt &&
|
|
171 #end for
|
|
172
|
|
173 ############ option_argument_path_relative_to_this_tool
|
|
174 #for i in $option_argument_path_relative_to_this_tool_repeat:
|
|
175 #set $item = 'path_relative_to_this_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.path_type)
|
|
176 echo '$item' >> $report.files_path/options_and_arguments.txt &&
|
|
177 #end for
|
|
178
|
|
179 ############ option_argument_string_float_integer
|
|
180 #for i in $option_argument_string_float_integer_repeat:
|
|
181 #set $item = 'value|' + str($i.flag) + "|" + str($i.value) + "|"
|
|
182 echo '$item' >> $report.files_path/options_and_arguments.txt &&
|
|
183 #end for
|
|
184
|
|
185 ############ output_set
|
|
186 ## '$report'
|
|
187 ## '$report.files_path'
|
|
188 ## '$tool_help_doc'
|
|
189 ## '$tool_output_dir'
|
|
190 ## '$tool_log'
|
|
191 #######################
|
|
192 export REPORT='$report' &&
|
|
193 export REPORT_FILES_PATH='$report.files_path' &&
|
|
194 export TOOL_HELP_DOC='$tool_help_doc' &&
|
|
195 export TOOL_OUTPUT_DIR='$tool_output_dir' &&
|
|
196 export TOOL_LOG='$tool_log' &&
|
|
197
|
|
198
|
|
199 ############ run render R script to render R markdowns
|
|
200 Rscript '${__tool_directory__}/elastic_tool_render.R'
|
|
201
|
|
202 ]]></command>
|
|
203 </xml>
|
|
204
|
|
205 <!--tool citations-->
|
|
206 <xml name="citations">
|
|
207 <citation type="bibtex"><![CDATA[
|
|
208 @article{allaire2016rmarkdown,
|
|
209 title={rmarkdown: Dynamic Documents for R, 2016},
|
|
210 author={Allaire, J and Cheng, Joe and Xie, Yihui and McPherson, Jonathan and Chang, Winston and Allen, Jeff
|
|
211 and Wickham, Hadley and Atkins, Aron and Hyndman, Rob},
|
|
212 journal={R package version 0.9},
|
|
213 volume={6},
|
|
214 year={2016}
|
|
215 }
|
|
216 ]]></citation>
|
|
217 <citation type="bibtex"><![CDATA[
|
|
218 @book{xie2015elastic,
|
|
219 title={Dynamic Documents with R and knitr},
|
|
220 author={Xie, Yihui},
|
|
221 volume={29},
|
|
222 year={2015},
|
|
223 publisher={CRC Press}
|
|
224 }
|
|
225 ]]></citation>
|
|
226 </xml>
|
|
227 </macros>
|