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