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