Mercurial > repos > mingchen0919 > elastic_r_tidyverse
comparison elastic_r_package_wrappers_macros.xml @ 8:ea3271940757 draft
planemo upload
author | mingchen0919 |
---|---|
date | Tue, 27 Mar 2018 23:42:53 -0400 |
parents | 01eaa66fcc2e |
children | 06f38d3febdc |
comparison
equal
deleted
inserted
replaced
7:01eaa66fcc2e | 8:ea3271940757 |
---|---|
1 <macros> | 1 <macros> |
2 | 2 |
3 <xml name="rmarkdown_requirements"> | 3 <xml name="rmarkdown_requirements"> |
4 <requirement type="package" version="1.15.0.6-0">pandoc</requirement> | 4 <requirement type="package" version="1.15.0.6-0">pandoc</requirement> |
5 <requirement type="package" version="1.6">r-rmarkdown</requirement> | 5 <requirement type="package" version="1.6">r-rmarkdown</requirement> |
6 <requirement type="package" version="1.2.1">r-tidyverse</requirement> | 6 <requirement type="package" version="1.1.1">r-tidyverse</requirement> |
7 </xml> | 7 </xml> |
8 | 8 |
9 <xml name="stdio"> | 9 <xml name="stdio"> |
10 <stdio> | 10 <stdio> |
11 <regex match="XXX" source="stderr" level="warning" | 11 <regex match="XXX" source="stderr" level="warning" |
13 </stdio> | 13 </stdio> |
14 </xml> | 14 </xml> |
15 | 15 |
16 <xml name="function_components"> | 16 <xml name="function_components"> |
17 <repeat name="function_component_repeat" title="Call a function" min="1" default="1"> | 17 <repeat name="function_component_repeat" title="Call a function" min="1" default="1"> |
18 <expand macro="function_name" /> | 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> | |
19 <expand macro="function_arguments" /> | 24 <expand macro="function_arguments" /> |
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> | |
20 </repeat> | 29 </repeat> |
21 </xml> | 30 </xml> |
22 | 31 |
23 <!--Tool name--> | |
24 <xml name="function_name"> | |
25 <param type="select" name="function_name" multiple="false" label="==== Call function ===="> | |
26 <option value="ggplot" selected="false">ggplot</option> | |
27 <option value="aes" selected="false">ggplot</option> | |
28 <option value="read.table" selected="false">read.table</option> | |
29 <option value="write.csv" selected="false">write.csv</option> | |
30 </param> | |
31 </xml> | |
32 | |
33 <!--input values: string, float and integer--> | |
34 <xml name="function_arguments"> | 32 <xml name="function_arguments"> |
35 <repeat name="regular_argument_value" title="--------Argument value: from user input" min="0" default="0"> | 33 <repeat name="regular_argument_value" title="Argument value: from user input" min="0" default="0"> |
36 <param type="text" name="argument" label="argument" /> | 34 <param type="text" name="argument" label="argument" /> |
37 <param type="text" name="argument_value" label="argument value" /> | 35 <param type="text" name="argument_value" label="argument value" /> |
38 <param type="select" name="argument_type" label="argument type"> | 36 <param type="select" name="argument_type" label="argument type"> |
39 <option value="string" selected="true">string</option> | 37 <option value="string" selected="true">string</option> |
40 <option value="numeric" selected="true">numeric</option> | 38 <option value="numeric" selected="false">numeric</option> |
41 <option value="boolean" selected="true">boolean</option> | 39 <option value="boolean" selected="false">boolean</option> |
40 <option value="variable" selected="false">variable</option> | |
42 </param> | 41 </param> |
43 </repeat> | 42 </repeat> |
44 <repeat name="rdata_argument_value" title="--------Argument value: from RData" min="0" default="0"> | 43 <repeat name="rdata_argument_value" title="Argument value: from RData" min="0" default="0"> |
45 <param type="text" name="argument" label="argument" /> | 44 <param type="text" name="argument" label="argument" /> |
46 <param type="data" format="rdata" name="argument_value" optional="false" label="RData output" /> | 45 <param type="data" format="rdata" name="argument_value" optional="false" label="RData output" /> |
47 </repeat> | 46 </repeat> |
48 <repeat name="function_argument_value" title="--------Argument value: from function return" min="0" default="0"> | |
49 <param type="text" name="argument" optional="false" label="argument" /> | |
50 <expand macro="function_name" /> | |
51 <expand macro="nested_function_arguments" /> | |
52 </repeat> | |
53 <param type="select" name="connect_to_next_function" label="connect to next function"> | |
54 <option value="%>%" selected="false">pipe (%>%)</option> | |
55 <option value="+" selected="false">plus (+)</option> | |
56 </param> | |
57 </xml> | 47 </xml> |
58 | |
59 <xml name="nested_function_arguments"> | |
60 <repeat name="regular_argument_value" title="--------Argument value: from user input" min="0" default="0"> | |
61 <param type="text" name="argument" label="argument" /> | |
62 <param type="text" name="argument_value" label="argument value" /> | |
63 <param type="select" name="argument_type" label="argument type"> | |
64 <option value="string" selected="true">string</option> | |
65 <option value="numeric" selected="true">numeric</option> | |
66 <option value="boolean" selected="true">boolean</option> | |
67 </param> | |
68 </repeat> | |
69 <repeat name="rdata_argument_value" title="--------Argument value: from RData" min="0" default="0"> | |
70 <param type="text" name="argument" label="argument" /> | |
71 <param type="text" name="argument_value" label="RData output" /> | |
72 </repeat> | |
73 </xml> | |
74 | |
75 <!--<!–OPTION/ARGUMENT PAIRS and INPUT types–>--> | |
76 <!--<!–input files–>--> | |
77 <!--<xml name="option_argument_single_dataset">--> | |
78 <!--<repeat name="option_argument_single_dataset_repeat" title="INPUT DATA FROM HISTORY: single data set" min="0" default="0">--> | |
79 <!--<param type="text" name="flag" optional="true" label="flag" />--> | |
80 <!--<param name="value" type="data" optional="false" multiple="false" label="value"/>--> | |
81 <!--</repeat>--> | |
82 <!--</xml>--> | |
83 | |
84 <!--<xml name="option_argument_multiple_datasets">--> | |
85 <!--<repeat name="option_argument_multiple_datasets_repeat" title="INPUT DATA FROM HISTORY: multiple data sets" min="0" default="0">--> | |
86 <!--<param type="text" name="flag" optional="true" label="flag" />--> | |
87 <!--<param name="value" type="data" optional="false" multiple="true" label="value"/>--> | |
88 <!--<param type="select" name="delimiter" multiple="false" label="file delimiter">--> | |
89 <!--<option value=" " selected="false">space</option>--> | |
90 <!--<option value="," selected="false">comma</option>--> | |
91 <!--</param>--> | |
92 <!--</repeat>--> | |
93 <!--</xml>--> | |
94 | |
95 <!--<!–input path–>--> | |
96 <!--<xml name="option_argument_path_relative_to_a_tool">--> | |
97 <!--<repeat name="option_argument_path_relative_to_a_tool_repeat" title="INPUT DATA PATH: relative to a tool output directory" min="0" default="0">--> | |
98 <!--<param type="text" name="flag" optional="true" label="flag" />--> | |
99 <!--<param name="a_tool_output_dir" type="data" optional="false" multiple="false" label="a tool output directory"/>--> | |
100 <!--<param type="text" name="value" optional="true" label="value" />--> | |
101 <!--</repeat>--> | |
102 <!--</xml>--> | |
103 <!--<xml name="option_argument_path_relative_to_this_tool">--> | |
104 <!--<repeat name="option_argument_path_relative_to_this_tool_repeat" title="OUTPUT PATH: relative to this tool output directory" min="0" default="0">--> | |
105 <!--<param type="text" name="flag" optional="true" label="flag" />--> | |
106 <!--<param type="text" name="value" optional="false" label="value" />--> | |
107 <!--<param type="select" name="path_type" multiple="false" label="path type">--> | |
108 <!--<option value="file_path" selected="false">file path</option>--> | |
109 <!--<option value="dir_path" selected="false">directory path</option>--> | |
110 <!--</param>--> | |
111 <!--</repeat>--> | |
112 <!--</xml>--> | |
113 | |
114 | 48 |
115 | 49 |
116 <!--output set--> | 50 <!--output set--> |
117 <xml name="output_set"> | 51 <xml name="output_set"> |
118 <data format="html" name="report" label="${tool.name} report"/> | 52 <data format="html" name="report" label="${tool.name} report"/> |
119 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/> | 53 <data format="txt" name="tool_help_doc" label="${tool.name} help doc"/> |
120 <data format="txt" name="tool_output_dir" label="${tool.name} output directory"/> | |
121 <data format="txt" name="tool_log" label="${tool.name} log" /> | 54 <data format="txt" name="tool_log" label="${tool.name} log" /> |
122 </xml> | 55 </xml> |
123 | 56 |
124 | 57 |
125 <!--shell command fragment--> | 58 <!--shell command fragment--> |
126 <xml name="shell_command"> | 59 <xml name="shell_command"> |
127 <command><![CDATA[ | 60 <command><![CDATA[ |
128 | 61 |
129 ############ first, create a directory to store all files | 62 ############ 1. create a directory to store all files |
130 mkdir -p $report.files_path && | 63 mkdir -p $report.files_path && |
131 | 64 |
132 | 65 |
133 ############ save the tool installation directory to an environment variable | 66 ############ 2. save the tool installation directory to an environment variable |
134 export TOOL_INSTALL_DIR='${__tool_directory__}' && | 67 export TOOL_INSTALL_DIR='${__tool_directory__}' && |
135 | 68 |
136 | 69 |
137 ######################### | 70 ############ 3. save user inputs into arguments.txt |
138 ## | |
139 ## save user input option/argument pairs into a file | |
140 ## | |
141 ######################### | |
142 | 71 |
143 ## first line will be the header | 72 ############ 3.1 table header |
144 echo 'type|flag|value|path_type' > $report.files_path/options_and_arguments.txt && | 73 echo 'function|input_type|argument|argument_value|argument_value_type|operator' > $report.files_path/arguments.txt && |
145 | |
146 ############ function_name | |
147 ##-t '$function_name' | |
148 echo "function_name|not available|${function_name}|not available" >> $report.files_path/options_and_arguments.txt && | |
149 | |
150 #################################################### | |
151 ## loop through repeats to get option/argument pairs | |
152 #################################################### | |
153 | |
154 ############ option_argument_single_dataset | |
155 #for i in $option_argument_single_dataset_repeat: | |
156 #set $item = 'single_dataset|' + str($i.flag) + "|" + str($i.value) + "|" | |
157 echo '$item' >> $report.files_path/options_and_arguments.txt && | |
158 #end for | |
159 | |
160 ############ option_argument_multiple_datasets | |
161 #for i in $option_argument_multiple_datasets_repeat: | |
162 #set $item = 'multiple_datasets|' + str($i.flag) + "|" + str($i.value).replace(',', str($i.delimiter)) + "|" | |
163 echo '$item' >> $report.files_path/options_and_arguments.txt && | |
164 #end for | |
165 | 74 |
166 | 75 |
167 ############ option_argument_path_relative_to_a_tool | 76 ############ 3.2 loop through function component repeat |
168 #for i in $option_argument_path_relative_to_a_tool_repeat: | 77 #for $fun_component in $function_components: |
169 #set $item = 'path_relative_to_a_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.a_tool_output_dir) | 78 #for reg_arg in $fun_component.regular_argument_value |
170 echo '$item' >> $report.files_path/options_and_arguments.txt && | 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 && |
171 #end for | 80 #end for |
172 | 81 |
173 ############ option_argument_path_relative_to_this_tool | 82 #for rdata_arg in $fun_component.rdata_argument_value |
174 #for i in $option_argument_path_relative_to_this_tool_repeat: | 83 echo '$fun_component.function_name|rdata|$rdata_arg.argument|$arg_arg.argument_value|rdata|$fun_component.operator' >> $report.files_path/arguments.txt && |
175 #set $item = 'path_relative_to_this_tool|' + str($i.flag) + "|" + str($i.value) + "|" + str($i.path_type) | 84 #end for |
176 echo '$item' >> $report.files_path/options_and_arguments.txt && | |
177 #end for | |
178 | |
179 ############ option_argument_string_float_integer | |
180 #for i in $option_argument_string_float_integer_repeat: | |
181 #set $item = 'value|' + str($i.flag) + "|" + str($i.value) + "|" | |
182 echo '$item' >> $report.files_path/options_and_arguments.txt && | |
183 #end for | |
184 | 85 |
185 ############ output_set | 86 ############ output_set |
186 ## '$report' | 87 ## '$report' |
187 ## '$report.files_path' | 88 ## '$report.files_path' |
188 ## '$tool_help_doc' | 89 ## '$tool_help_doc' |
189 ## '$tool_output_dir' | |
190 ## '$tool_log' | 90 ## '$tool_log' |
191 ####################### | 91 ####################### |
192 export REPORT='$report' && | 92 export REPORT='$report' && |
193 export REPORT_FILES_PATH='$report.files_path' && | 93 export REPORT_FILES_PATH='$report.files_path' && |
194 export TOOL_HELP_DOC='$tool_help_doc' && | 94 export TOOL_HELP_DOC='$tool_help_doc' && |
195 export TOOL_OUTPUT_DIR='$tool_output_dir' && | |
196 export TOOL_LOG='$tool_log' && | 95 export TOOL_LOG='$tool_log' && |
197 | 96 |
198 | 97 |
199 ############ run render R script to render R markdowns | 98 ############ run render R script to render R markdowns |
200 Rscript '${__tool_directory__}/elastic_tool_render.R' | 99 Rscript '${__tool_directory__}/elastic_tool_render.R' |