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