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>
|
8
|
6 <requirement type="package" version="1.1.1">r-tidyverse</requirement>
|
0
|
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">
|
8
|
18 <param type="select" name="function_name" multiple="false" label="==== Call function ====">
|
|
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>
|
|
23 </param>
|
4
|
24 <expand macro="function_arguments" />
|
8
|
25 <param type="select" name="operator" label="connect to next function">
|
|
26 <option value="%>%" selected="false">pipe (%>%)</option>
|
|
27 <option value="+" selected="false">plus (+)</option>
|
|
28 </param>
|
4
|
29 </repeat>
|
|
30 </xml>
|
|
31
|
0
|
32 <xml name="function_arguments">
|
8
|
33 <repeat name="regular_argument_value" title="Argument value: from user input" min="0" default="0">
|
0
|
34 <param type="text" name="argument" label="argument" />
|
|
35 <param type="text" name="argument_value" label="argument value" />
|
2
|
36 <param type="select" name="argument_type" label="argument type">
|
|
37 <option value="string" selected="true">string</option>
|
8
|
38 <option value="numeric" selected="false">numeric</option>
|
|
39 <option value="boolean" selected="false">boolean</option>
|
|
40 <option value="variable" selected="false">variable</option>
|
2
|
41 </param>
|
0
|
42 </repeat>
|
8
|
43 <repeat name="rdata_argument_value" title="Argument value: from RData" min="0" default="0">
|
0
|
44 <param type="text" name="argument" label="argument" />
|
8
|
45 <param type="data" format="rdata" name="argument_value" optional="false" label="RData output" />
|
0
|
46 </repeat>
|
|
47 </xml>
|
|
48
|
|
49
|
|
50 <!--output set-->
|
|
51 <xml name="output_set">
|
|
52 <data format="html" name="report" label="${tool.name} report"/>
|
|
53 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/>
|
|
54 <data format="txt" name="tool_log" label="${tool.name} log" />
|
|
55 </xml>
|
|
56
|
|
57
|
|
58 <!--shell command fragment-->
|
|
59 <xml name="shell_command">
|
|
60 <command><![CDATA[
|
|
61
|
8
|
62 ############ 1. create a directory to store all files
|
0
|
63 mkdir -p $report.files_path &&
|
|
64
|
|
65
|
8
|
66 ############ 2. save the tool installation directory to an environment variable
|
0
|
67 export TOOL_INSTALL_DIR='${__tool_directory__}' &&
|
|
68
|
|
69
|
8
|
70 ############ 3. save user inputs into arguments.txt
|
0
|
71
|
8
|
72 ############ 3.1 table header
|
|
73 echo 'function|input_type|argument|argument_value|argument_value_type|operator' > $report.files_path/arguments.txt &&
|
0
|
74
|
|
75
|
8
|
76 ############ 3.2 loop through function component repeat
|
|
77 #for $fun_component in $function_components:
|
|
78 #for reg_arg in $fun_component.regular_argument_value
|
|
79 echo '$fun_component.function_name|regular|$reg_arg.argument|$arg_arg.argument_value|$arg_arg.argument_value_type|$fun_component.operator' >> $report.files_path/arguments.txt &&
|
|
80 #end for
|
0
|
81
|
8
|
82 #for rdata_arg in $fun_component.rdata_argument_value
|
|
83 echo '$fun_component.function_name|rdata|$rdata_arg.argument|$arg_arg.argument_value|rdata|$fun_component.operator' >> $report.files_path/arguments.txt &&
|
|
84 #end for
|
0
|
85
|
|
86 ############ output_set
|
|
87 ## '$report'
|
|
88 ## '$report.files_path'
|
|
89 ## '$tool_help_doc'
|
|
90 ## '$tool_log'
|
|
91 #######################
|
|
92 export REPORT='$report' &&
|
|
93 export REPORT_FILES_PATH='$report.files_path' &&
|
|
94 export TOOL_HELP_DOC='$tool_help_doc' &&
|
|
95 export TOOL_LOG='$tool_log' &&
|
|
96
|
|
97
|
|
98 ############ run render R script to render R markdowns
|
|
99 Rscript '${__tool_directory__}/elastic_tool_render.R'
|
|
100
|
|
101 ]]></command>
|
|
102 </xml>
|
|
103
|
|
104 <!--tool citations-->
|
|
105 <xml name="citations">
|
|
106 <citation type="bibtex"><![CDATA[
|
|
107 @article{allaire2016rmarkdown,
|
|
108 title={rmarkdown: Dynamic Documents for R, 2016},
|
|
109 author={Allaire, J and Cheng, Joe and Xie, Yihui and McPherson, Jonathan and Chang, Winston and Allen, Jeff
|
|
110 and Wickham, Hadley and Atkins, Aron and Hyndman, Rob},
|
|
111 journal={R package version 0.9},
|
|
112 volume={6},
|
|
113 year={2016}
|
|
114 }
|
|
115 ]]></citation>
|
|
116 <citation type="bibtex"><![CDATA[
|
|
117 @book{xie2015elastic,
|
|
118 title={Dynamic Documents with R and knitr},
|
|
119 author={Xie, Yihui},
|
|
120 volume={29},
|
|
121 year={2015},
|
|
122 publisher={CRC Press}
|
|
123 }
|
|
124 ]]></citation>
|
|
125 </xml>
|
|
126 </macros>
|