|
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>
|
|
1
|
6 <requirement type="package" version="2.5.4a">star</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
|
|
|
16 <!--Tool name-->
|
|
|
17 <xml name="tool_name">
|
|
|
18 <param type="select" name="tool_name" multiple="false" label="Tool name">
|
|
|
19 <option value="STAR" selected="false">STAR</option>
|
|
|
20 </param>
|
|
|
21 </xml>
|
|
|
22
|
|
|
23 <!--OPTION/ARGUMENT PAIRS and INPUT types-->
|
|
|
24 <!--input files-->
|
|
|
25 <xml name="option_argument_one_dataset">
|
|
|
26 <repeat name="option_argument_one_dataset_repeat" title="OPTION and ARGUMENT: input one dataset" min="0" default="0">
|
|
|
27 <param type="text" name="flag" optional="true" label="flag" />
|
|
|
28 <param name="value" type="data" optional="true" multiple="false" label="value"/>
|
|
|
29 </repeat>
|
|
|
30 </xml>
|
|
|
31 <xml name="option_argument_multiple_datasets">
|
|
|
32 <repeat name="option_argument_multiple_datasets_repeat" title="OPTION and ARGUMENT: input multiple datasets" min="0" default="0">
|
|
|
33 <param type="text" name="flag" optional="true" label="flag" />
|
|
|
34 <param name="value" type="data" optional="true" multiple="true" label="value" />
|
|
|
35 </repeat>
|
|
|
36 </xml>
|
|
|
37 <xml name="option_argument_path_relative_to_upstream_tool">
|
|
|
38 <repeat name="option_argument_path_relative_to_upstream_tool_repeat" title="OPTION and ARGUMENT: path relative to upstream tool" min="0" default="0">
|
|
|
39 <param type="text" name="flag" optional="true" label="flag" />
|
|
|
40 <param name="upstream_tool_output_dir" type="data" optional="true" multiple="false" label="upstream tool output directory"/>
|
|
|
41 <param type="text" name="value" optional="true" label="value" />
|
|
|
42 </repeat>
|
|
|
43 </xml>
|
|
|
44
|
|
|
45 <!--input values: string, float and integer-->
|
|
|
46 <xml name="option_argument_string">
|
|
|
47 <repeat name="option_argument_string_repeat" title="OPTION and ARGUMENT: input string" min="0" default="0">
|
|
|
48 <param type="text" name="flag" label="flag" />
|
|
|
49 <param type="text" name="value" label="value" />
|
|
|
50 </repeat>
|
|
|
51 </xml>
|
|
|
52 <xml name="option_argument_float">
|
|
|
53 <repeat name="option_argument_float_repeat" title="OPTION and ARGUMENT: input float" min="0" default="0">
|
|
|
54 <param type="text" name="flag" label="flag" />
|
|
|
55 <param type="text" name="value" label="value" />
|
|
|
56 </repeat>
|
|
|
57 </xml>
|
|
|
58 <xml name="option_argument_integer">
|
|
|
59 <repeat name="option_argument_integer_repeat" title="OPTION and ARGUMENT: input integer" min="0" default="0">
|
|
|
60 <param type="text" name="flag" label="flag" />
|
|
|
61 <param type="text" name="value" label="value" />
|
|
|
62 </repeat>
|
|
|
63 </xml>
|
|
|
64
|
|
|
65 <!--output set-->
|
|
|
66 <xml name="output_set">
|
|
|
67 <data format="html" name="report" label="${tool.name} report"/>
|
|
|
68 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/>
|
|
|
69 <data format="txt" name="tool_output_dir" label="${tool.name} output directory"/>
|
|
|
70 <data format="txt" name="tool_log" label="${tool.name} log" />
|
|
|
71 </xml>
|
|
|
72
|
|
|
73
|
|
|
74 <!--shell command fragment-->
|
|
|
75 <xml name="shell_command">
|
|
|
76 <command><![CDATA[
|
|
|
77
|
|
|
78 ############ first, create a directory to store all files
|
|
|
79 mkdir -p $report.files_path && cd $report.files_path &&
|
|
|
80
|
|
|
81
|
|
|
82 ############ save the tool installation directory to an environment variable
|
|
|
83 export TOOL_INSTALL_DIR='${__tool_directory__}' &&
|
|
|
84
|
|
|
85
|
|
|
86 #########################
|
|
|
87 ##
|
|
|
88 ## save user input option/argument pairs into a file
|
|
|
89 ##
|
|
|
90 #########################
|
|
|
91
|
|
|
92 ## first line will be the header
|
|
|
93 echo 'type|flag|value' > options_and_arguments.txt &&
|
|
|
94
|
|
|
95 ############ tool_name
|
|
|
96 ##-t '$tool_name'
|
|
|
97 echo "tool_name|tool_flag|${tool_name}" >> options_and_arguments.txt &&
|
|
|
98
|
|
|
99 ####################################################
|
|
|
100 ## loop through repeats to get option/argument pairs
|
|
|
101 ####################################################
|
|
|
102
|
|
|
103 ############ option_argument_one_dataset
|
|
|
104 #for i in $option_argument_one_dataset_repeat:
|
|
|
105 #set $item = 'one_dataset|' + str($i.flag) + "|" + str($i.value)
|
|
|
106 echo '$item' >> options_and_arguments.txt &&
|
|
|
107 #end for
|
|
|
108
|
|
|
109 ############ option_argument_multiple_datasets
|
|
|
110 #for i in $option_argument_multiple_datasets_repeat:
|
|
|
111 #set $item = 'multiple_datasets|' + str($i.flag) + "|" + str($i.value)
|
|
|
112 echo '$item' >> options_and_arguments.txt &&
|
|
|
113 #end for
|
|
|
114
|
|
|
115 ############ option_argument_path_relative_to_upstream_tool
|
|
|
116 #for i in $option_argument_path_relative_to_upstream_tool_repeat:
|
|
|
117 #set $item = 'path_relative_to_upstream_tool|' + str($i.flag) + "|" + str($i.value)
|
|
|
118 echo '$item' >> options_and_arguments.txt &&
|
|
|
119 #end for
|
|
|
120
|
|
|
121 ############ option_argument_string
|
|
|
122 #for i in $option_argument_string_repeat:
|
|
|
123 #set $item = 'string|' + str($i.flag) + "|" + str($i.value)
|
|
|
124 echo '$item' >> options_and_arguments.txt &&
|
|
|
125 #end for
|
|
|
126
|
|
|
127 ############ option_argument_float
|
|
|
128 #for i in $option_argument_float_repeat:
|
|
|
129 #set $item = 'float|' + str($i.flag) + "|" + str($i.value)
|
|
|
130 echo '$item' >> options_and_arguments.txt &&
|
|
|
131 #end for
|
|
|
132
|
|
|
133
|
|
|
134 ############ option_argument_integer
|
|
|
135 #for i in $option_argument_integer_repeat:
|
|
|
136 #set $item = 'integer|' + str($i.flag) + "|" + str($i.value)
|
|
|
137 echo '$item' >> options_and_arguments.txt &&
|
|
|
138 #end for
|
|
|
139
|
|
|
140
|
|
|
141 ############ output_set
|
|
|
142 ## '$report'
|
|
|
143 ## '$report.files_path'
|
|
|
144 ## '$tool_help_doc'
|
|
|
145 ## '$tool_output_dir'
|
|
|
146 ## '$tool_log'
|
|
|
147 #######################
|
|
|
148 export REPORT='$report' &&
|
|
|
149 export REPORT_FILES_PATH='$report.files_path' &&
|
|
|
150 export TOOL_HELP_DOC='$tool_help_doc' &&
|
|
|
151 export TOOL_OUTPUT_DIR='$tool_output_dir' &&
|
|
|
152 export TOOL_LOG='$tool_log' &&
|
|
|
153
|
|
|
154
|
|
|
155 ############ save tool files path to a tool output so that it can be accessed from galaxy history
|
|
|
156 echo '$report.files_path' > $tool_output_dir &&
|
|
|
157
|
|
|
158 ############ run render R script to render R markdowns
|
|
|
159 Rscript '${__tool_directory__}/dynamic_tool_render.R'
|
|
|
160
|
|
|
161 ]]></command>
|
|
|
162 </xml>
|
|
|
163
|
|
|
164 <!--tool citations-->
|
|
|
165 <xml name="citations">
|
|
|
166 <citation type="bibtex"><![CDATA[
|
|
|
167 @article{allaire2016rmarkdown,
|
|
|
168 title={rmarkdown: Dynamic Documents for R, 2016},
|
|
|
169 author={Allaire, J and Cheng, Joe and Xie, Yihui and McPherson, Jonathan and Chang, Winston and Allen, Jeff
|
|
|
170 and Wickham, Hadley and Atkins, Aron and Hyndman, Rob},
|
|
|
171 journal={R package version 0.9},
|
|
|
172 volume={6},
|
|
|
173 year={2016}
|
|
|
174 }
|
|
|
175 ]]></citation>
|
|
|
176 <citation type="bibtex"><![CDATA[
|
|
|
177 @book{xie2015dynamic,
|
|
|
178 title={Dynamic Documents with R and knitr},
|
|
|
179 author={Xie, Yihui},
|
|
|
180 volume={29},
|
|
|
181 year={2015},
|
|
|
182 publisher={CRC Press}
|
|
|
183 }
|
|
|
184 ]]></citation>
|
|
|
185 </xml>
|
|
|
186 </macros> |