|
0
|
1 <?xml version="1.0" encoding="UTF-8"?>
|
|
|
2 <macros>
|
|
|
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>
|
|
1
|
6 <requirement type="package" version="0.2.2">skewer</requirement>
|
|
0
|
7 </xml>
|
|
|
8 <xml name="stdio">
|
|
|
9 <stdio>
|
|
|
10 <regex match="XXX" source="stderr" level="warning" description="Check the tool log output file for more details."/>
|
|
|
11 </stdio>
|
|
|
12 </xml>
|
|
|
13 <!--Tool name-->
|
|
|
14 <xml name="tool_name">
|
|
|
15 <param type="select" name="tool_name" multiple="false" label="Tool name">
|
|
1
|
16 <option value="package" selected="false">skewer</option>
|
|
|
17 </param>
|
|
0
|
18 </xml>
|
|
|
19 <!--OPTION/ARGUMENT PAIRS and INPUT types-->
|
|
|
20 <!--input files-->
|
|
|
21 <xml name="option_argument_single_dataset">
|
|
|
22 <repeat name="option_argument_single_dataset_repeat" title="INPUT SINGLE DATASET" min="0" default="0">
|
|
|
23 <param type="text" name="flag" optional="true" label="flag"/>
|
|
|
24 <param name="value" type="data" optional="false" multiple="false" label="value"/>
|
|
|
25 </repeat>
|
|
|
26 </xml>
|
|
|
27 <xml name="option_argument_multiple_datasets">
|
|
|
28 <repeat name="option_argument_multiple_datasets_repeat" title="INPUT MULTIPLE DATASETS" min="0" default="0">
|
|
|
29 <param type="text" name="flag" optional="true" label="flag"/>
|
|
|
30 <param name="value" type="data" optional="false" multiple="true" label="value"/>
|
|
|
31 <param type="select" name="delimiter" multiple="false" label="file delimiter">
|
|
|
32 <option value=" " selected="false">space</option>
|
|
|
33 <option value="," selected="false">comma</option>
|
|
|
34 </param>
|
|
|
35 </repeat>
|
|
|
36 </xml>
|
|
|
37 <!--input path-->
|
|
|
38 <xml name="option_argument_path_relative_to_a_tool">
|
|
|
39 <repeat name="option_argument_path_relative_to_a_tool_repeat" title="INPUT PATH: path relative to a tool" min="0" default="0">
|
|
|
40 <param type="text" name="flag" optional="true" label="flag"/>
|
|
|
41 <param name="a_tool_output_dir" type="data" optional="false" multiple="false" label="a tool output directory"/>
|
|
|
42 <param type="text" name="value" optional="true" label="value"/>
|
|
|
43 </repeat>
|
|
|
44 </xml>
|
|
|
45 <xml name="option_argument_path_relative_to_this_tool">
|
|
|
46 <repeat name="option_argument_path_relative_to_this_tool_repeat" title="INPUT PATH: path relative to this tool" min="0" default="0">
|
|
|
47 <param type="text" name="flag" optional="true" label="flag"/>
|
|
|
48 <param type="text" name="value" optional="false" label="value"/>
|
|
|
49 <param type="select" name="path_type" multiple="false" label="path type">
|
|
|
50 <option value="file_path" selected="false">file path</option>
|
|
|
51 <option value="dir_path" selected="false">directory path</option>
|
|
|
52 </param>
|
|
|
53 </repeat>
|
|
|
54 </xml>
|
|
|
55 <!--input values: string, float and integer-->
|
|
|
56 <xml name="option_argument_string_float_integer">
|
|
|
57 <repeat name="option_argument_string_float_integer_repeat" title="INPUT VALUE: string/float/integer" min="0" default="0">
|
|
|
58 <param type="text" name="flag" label="flag"/>
|
|
|
59 <param type="text" name="value" label="value"/>
|
|
|
60 </repeat>
|
|
|
61 </xml>
|
|
|
62 <!--output set-->
|
|
|
63 <xml name="output_set">
|
|
|
64 <data format="html" name="report" label="${tool.name} report"/>
|
|
|
65 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/>
|
|
|
66 <data format="txt" name="tool_output_dir" label="${tool.name} output directory"/>
|
|
|
67 <data format="txt" name="tool_log" label="${tool.name} log"/>
|
|
|
68 </xml>
|
|
|
69 <!--shell command fragment-->
|
|
|
70 <xml name="shell_command">
|
|
|
71 <command><![CDATA[
|
|
|
72
|
|
|
73 ############ first, create a directory to store all files
|
|
|
74 mkdir -p $report.files_path && cd $report.files_path &&
|
|
|
75
|
|
|
76
|
|
|
77 ############ save the tool installation directory to an environment variable
|
|
|
78 export TOOL_INSTALL_DIR='${__tool_directory__}' &&
|
|
|
79
|
|
|
80
|
|
|
81 #########################
|
|
|
82 ##
|
|
|
83 ## save user input option/argument pairs into a file
|
|
|
84 ##
|
|
|
85 #########################
|
|
|
86
|
|
|
87 ## first line will be the header
|
|
|
88 echo 'type|flag|value|path_type' > options_and_arguments.txt &&
|
|
|
89
|
|
|
90 ############ tool_name
|
|
|
91 ##-t '$tool_name'
|
|
|
92 echo "tool_name|not available|${tool_name}|not available" >> options_and_arguments.txt &&
|
|
|
93
|
|
|
94 ####################################################
|
|
|
95 ## loop through repeats to get option/argument pairs
|
|
|
96 ####################################################
|
|
|
97
|
|
|
98 ############ option_argument_single_dataset
|
|
|
99 #for i in $option_argument_single_dataset_repeat:
|
|
|
100 #set $item = 'single_dataset|' + str($i.flag) + "|" + str($i.value) + "|"
|
|
|
101 echo '$item' >> options_and_arguments.txt &&
|
|
|
102 #end for
|
|
|
103
|
|
|
104 ############ option_argument_multiple_datasets
|
|
|
105 #for i in $option_argument_multiple_datasets_repeat:
|
|
|
106 #set $item = 'multiple_datasets|' + str($i.flag) + "|" + str($i.value).replace(',', str($i.delimiter)) + "|"
|
|
|
107 echo '$item' >> options_and_arguments.txt &&
|
|
|
108 #end for
|
|
|
109
|
|
|
110
|
|
|
111 ############ option_argument_path_relative_to_a_tool
|
|
|
112 #for i in $option_argument_path_relative_to_a_tool_repeat:
|
|
|
113 #set $item = 'path_relative_to_a_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.a_tool_output_dir)
|
|
|
114 echo '$item' >> options_and_arguments.txt &&
|
|
|
115 #end for
|
|
|
116
|
|
|
117 ############ option_argument_path_relative_to_this_tool
|
|
|
118 #for i in $option_argument_path_relative_to_this_tool_repeat:
|
|
|
119 #set $item = 'path_relative_to_this_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.path_type)
|
|
|
120 echo '$item' >> options_and_arguments.txt &&
|
|
|
121 #end for
|
|
|
122
|
|
|
123 ############ option_argument_string_float_integer
|
|
|
124 #for i in $option_argument_string_float_integer_repeat:
|
|
|
125 #set $item = 'value|' + str($i.flag) + "|" + str($i.value) + "|"
|
|
|
126 echo '$item' >> options_and_arguments.txt &&
|
|
|
127 #end for
|
|
|
128
|
|
|
129 ############ output_set
|
|
|
130 ## '$report'
|
|
|
131 ## '$report.files_path'
|
|
|
132 ## '$tool_help_doc'
|
|
|
133 ## '$tool_output_dir'
|
|
|
134 ## '$tool_log'
|
|
|
135 #######################
|
|
|
136 export REPORT='$report' &&
|
|
|
137 export REPORT_FILES_PATH='$report.files_path' &&
|
|
|
138 export TOOL_HELP_DOC='$tool_help_doc' &&
|
|
|
139 export TOOL_OUTPUT_DIR='$tool_output_dir' &&
|
|
|
140 export TOOL_LOG='$tool_log' &&
|
|
|
141
|
|
|
142
|
|
|
143 ############ run render R script to render R markdowns
|
|
|
144 Rscript '${__tool_directory__}/dynamic_tool_render.R'
|
|
|
145
|
|
|
146 ]]></command>
|
|
|
147 </xml>
|
|
|
148 <!--tool citations-->
|
|
|
149 <xml name="citations">
|
|
|
150 <citation type="bibtex"><![CDATA[
|
|
|
151 @article{allaire2016rmarkdown,
|
|
|
152 title={rmarkdown: Dynamic Documents for R, 2016},
|
|
|
153 author={Allaire, J and Cheng, Joe and Xie, Yihui and McPherson, Jonathan and Chang, Winston and Allen, Jeff
|
|
|
154 and Wickham, Hadley and Atkins, Aron and Hyndman, Rob},
|
|
|
155 journal={R package version 0.9},
|
|
|
156 volume={6},
|
|
|
157 year={2016}
|
|
|
158 }
|
|
|
159 ]]></citation>
|
|
|
160 <citation type="bibtex"><![CDATA[
|
|
|
161 @book{xie2015dynamic,
|
|
|
162 title={Dynamic Documents with R and knitr},
|
|
|
163 author={Xie, Yihui},
|
|
|
164 volume={29},
|
|
|
165 year={2015},
|
|
|
166 publisher={CRC Press}
|
|
|
167 }
|
|
|
168 ]]></citation>
|
|
|
169 </xml>
|
|
|
170 </macros>
|