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