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