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