4
|
1 <tool id="rgtf2" name="toolfactory" version="2.00" profile="16.04" >
|
|
2 <description>Scripts into tools v2.0</description>
|
|
3 <macros>
|
|
4 <xml name="singleText">
|
|
5 <param name="param_value" type="text" value="" label="Enter this parameter's default text value">
|
|
6 </param>
|
|
7 </xml>
|
|
8 <xml name="singleInt">
|
|
9 <param name="param_value" type="integer" value="" label="Enter this parameter's default integer value" >
|
|
10 </param>
|
|
11 </xml>
|
|
12 <xml name="singleFloat">
|
|
13 <param name="param_value" type="float" value="" label="Enter this parameter's default value">
|
|
14 </param>
|
|
15 </xml>
|
|
16 <xml name="singleBoolean">
|
|
17 <param name="param_value" type="boolean" value="" label="Enter this parameter's default value" />
|
|
18 <param name="truevalue" type="text" value="True" label="Command line value to emit when True" />
|
|
19 <param name="falsevalue" type="boolean" value="True" label="Command line value to emit when False" />
|
|
20 </xml>
|
|
21 <xml name="selectText">
|
|
22 <repeat name="selectTexts" title="Add each option to be presented in a text select box" min="2" default="2"
|
|
23 help="Each text added here will also have a value to be emitted on the command line when the text is chosen">
|
|
24 <param name="select_text" type="text" value="" label="Enter the explanatory text the user will see for this choice" >
|
|
25 </param>
|
|
26 <param name="select_value" type="text" value="" label="Enter the value for the command line when the user selects this option">
|
|
27 </param>
|
|
28 </repeat>
|
|
29 </xml>
|
|
30 <xml name="tool_metadata">
|
|
31 <param name="tool_version" label="Tool Version - bump this to warn users trying to redo old analyses" type="text" value="0.01"
|
|
32 help="If you change your script and regenerate the 'same' tool, you should inform Galaxy (and users) by changing (bumping is traditional) this number"/>
|
|
33 <param name="tool_desc" label="Tool Synopsis" type="text" value=""
|
|
34 help="Supply a brief tool description for the Galaxy tool menu entry" />
|
|
35 <param name="install" label="Attempt to install in the host Galaxy"
|
|
36 help="This will fail unless running in a very unusual configuration such as a specialised Docker container"
|
|
37 type="boolean" checked="True" truevalue="1" falsevalue="0" />
|
|
38 <conditional name="do_test">
|
|
39 <param name="run_test" label="Run planemo test on the new archive to add test outputs making a proper tool - takes time"
|
|
40 help="Archives must be run and updated using planemo to populate all the test outputs. Will be very quick if no dependencies (eg a bash script). May take a very long time depending on dependencies"
|
|
41 type="boolean" checked="False" truevalue="1" falsevalue="0" />
|
|
42 <when value="0">
|
|
43 <param name="tail" type="hidden" value="not_tested"/>
|
|
44 </when>
|
|
45 <when value="1">
|
|
46 <param name="tail" type="hidden" value="tested"/>
|
|
47 </when>
|
|
48 </conditional>
|
|
49 <param name="help_text" label="Tool form documentation and help text for users" type="text" area="true"
|
|
50 value="**What it Does**"
|
|
51 help="Supply user documentation to appear on the new tool form as reStructured text - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html" >
|
|
52 <sanitizer>
|
|
53 <valid initial="string.printable" />
|
|
54 <mapping initial="none"/>
|
|
55 </sanitizer>
|
|
56 </param>
|
|
57 <repeat name="citations" title="Citation">
|
|
58 <conditional name="citation_type">
|
|
59 <param name="type" type="select" display="radio" label="Citation Type">
|
|
60 <option value="doi">DOI</option>
|
|
61 <option value="bibtex">BibTeX</option>
|
|
62 </param>
|
|
63 <when value="doi">
|
|
64 <param name="doi" label="DOI" type="text" value=""
|
|
65 help="Supply a DOI (e.g. doi: 10.1111/j.1740-9713.2007.00258.x) to be cited when this tool is used in published research." />
|
|
66 </when>
|
|
67 <when value="bibtex">
|
|
68 <param name="bibtex" label="BibTex" type="text" area="true"
|
|
69 help="Supply a BibTex entry that should be cited when this tool is used in published research." value="" >
|
|
70 <sanitizer>
|
|
71 <valid initial="string.printable" />
|
|
72 <mapping initial="none"/>
|
|
73 </sanitizer>
|
|
74 </param>
|
|
75 </when>
|
|
76 </conditional>
|
|
77 </repeat>
|
|
78 </xml>
|
|
79 <xml name="io">
|
|
80 <section name="io" title="Input and output files" expanded="true">
|
|
81 <repeat name="history_inputs" title="Inputs" min="0"
|
|
82 help="Input data files to pass on the command line to the executable. USE SMALL SAMPLES for the new tool's test. Prompts will form a history item selector as input for users of this new tool">
|
|
83 <param name="input_files" type="data" format="data" label="Select an input file from your history" multiple="false"
|
|
84 help=""/>
|
|
85 <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"
|
|
86 help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml" value="tabular">
|
|
87 <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
|
|
88 <column name="value" index="0"/>
|
|
89 </options>
|
|
90 </param>
|
|
91 <param name="input_label" type="text" value="" label="This will become the user prompt for the form so please make it informative" >
|
|
92 </param>
|
|
93 <param name="input_help" type="text" value="" label="This will become help text on the form." >
|
|
94 </param>
|
|
95 <param name="input_CL" type="text" label="Positional: ordinal integer. Argparse: argument name. STDIN if the executable/script expects it"
|
|
96 help="If you will pass positional parameters, enter the integer ordinal for this parameter. If Argparse style, '--' will be prepended or '-' if single character" value="">
|
|
97 </param>
|
|
98 <param name="input_repeat" type="boolean" checked="False" truevalue="1" falsevalue="0" label="Allow user to repeat this input as many times as wanted - script/executable must parse these."/>
|
|
99 </repeat>
|
|
100 <repeat name="history_outputs" min="0" title="Outputs"
|
|
101 help="New history items output by the executable to appear in the user history after the tool runs. The name will become a history item for users of the new tool you are making containing one of it's outputs">
|
|
102 <param name="history_name" type="text" label="Output Name" optional="false"
|
|
103 help="Name used for this output in history. No spaces! Argparse will also use this name as --[name]">
|
|
104 <sanitizer invalid_char=" ">
|
|
105 <valid initial="string.ascii_letters,string.digits" >
|
|
106 <add value="_" />
|
|
107 </valid>
|
|
108 </sanitizer>
|
|
109 </param>
|
|
110 <param name="history_format" type="select" multiple="false" label="Select the datatype for this output"
|
|
111 help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml" value="tabular">
|
|
112 <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
|
|
113 <column name="value" index="0"/>
|
|
114 </options>
|
|
115 </param>
|
|
116 <param name="history_CL" type="text" label="Position"
|
|
117 help="Positional: ordinal integer or 'STDOUT' if '>' required. Otherwise ignored if argparse because name is used. If positional parameters, enter the integer ordinal expected for this parameter. If argparse, ignore unless STDOUT needed" value=""/>
|
|
118 <param name="history_test" type="text" label="Output test criteria"
|
|
119 help="Pass/fail decision criterion for this output compared to test generation. Available options are diff:[lines], sim_size:[delta (integer) or delta_frac (float)" value="diff:0"/>
|
|
120 </repeat>
|
|
121 <repeat name="collection_outputs" title="Output Collections" min="0"
|
|
122 help="New history collections to appear in the user history after the tool runs. Hides outputs not needed for downstream tools such as images and intermediate reports." default="0">
|
|
123 <param name="name" type="text" label="Name"
|
|
124 help="for new collection with all outputs not individually passed to history outputs. No spaces! Script MUST create and fill a directory with the same name and the tool test MUST be overwritten - see the plotter example for hints">
|
|
125 <sanitizer invalid_char="_">
|
|
126 <valid initial="string.ascii_letters,string.digits" >
|
|
127 <add value="_" />
|
|
128 </valid>
|
|
129 </sanitizer>
|
|
130 </param>
|
|
131 <param name="kind" type="select" multiple="false" label="Select the kind of collection for this output"
|
|
132 help="">
|
|
133 <option value="list" selected="true">List</option>
|
|
134 <option value="paired">Paired</option>
|
|
135 <option value="list:paired">List of paired</option>
|
|
136 </param>
|
|
137 <param name="label" type="text" label="Label for this collection" help="" value=""/>
|
|
138 <param name="discover" type="text" label="Discover datasets expression" help="__name_and_ext__ should catch all filenames with extensions" value="__name_and_ext__"/>
|
|
139 </repeat>
|
|
140
|
|
141 </section>
|
|
142 </xml>
|
|
143 <xml name="additparam">
|
|
144 <section name="addparam" title="Arguments" help="Executable or script settings passed on the command line other than I/O files" expanded="true">
|
|
145 <param name="edit_params" type="select" display="radio" label="Make these settings on the generated tool form user editable?"
|
|
146 help="If no, users will NOT be able to alter any additional parameters. If yes, these will appear on the tool form as text fields with no validation or sanitizing">
|
|
147 <option value="yes" selected="true">Yes, allow user to edit all additional parameters on the generated tool form</option>
|
|
148 <option value="no">No - use the fixed values for all additional parameters - no user editing</option>
|
|
149 </param>
|
|
150 <repeat name="additional_parameters" title="Command Line Paramters" min="0"
|
|
151 help="Command line settings for the user to pass to the executable. See examples below to see how these can be parsed by scripts in the various languages">
|
|
152 <param name="param_name" type="text" value="" label="Choose the name for this parameter - MUST not be blank!">
|
|
153 <sanitizer invalid_char="">
|
|
154 <valid initial="string.ascii_letters,string.digits"/>
|
|
155 <mapping initial="none"/>
|
|
156 </sanitizer>
|
|
157 </param>
|
|
158 <conditional name="ap_type">
|
|
159 <param name="param_type" type="select" label="Select the type for this parameter">
|
|
160 <option value="text" selected="true">Text string</option>
|
|
161 <option value="integer">Integer</option>
|
|
162 <option value="float">Float</option>
|
|
163 <option value="boolean">Boolean</option>
|
|
164 <option value="selecttext">Select text string</option>
|
|
165 </param>
|
|
166 <when value = "text">
|
|
167 <expand macro="singleText" />
|
|
168 </when>
|
|
169 <when value = "integer">
|
|
170 <expand macro="singleInt" />
|
|
171 </when>
|
|
172 <when value = "float">
|
|
173 <expand macro="singleFloat" />
|
|
174 </when>
|
|
175 <when value = "boolean">
|
|
176 <expand macro="singleBoolean" />
|
|
177 </when>
|
|
178 <when value = "selecttext">
|
|
179 <expand macro="selectText" />
|
|
180 </when>
|
|
181 </conditional>
|
|
182 <param name="param_label" type="text" value="" label="Enter this parameter's label for the form">
|
|
183 </param>
|
|
184 <param name="param_help" type="text" value="" label="Help for this parameter">
|
|
185 </param>
|
|
186 <param name="param_CL" type="text" label="Positional ordinal | argparse argument name"
|
|
187 help="Using positional parameters, enter the integer ordinal for this parameter on the command line. Using Argparse style, '--' will be prepended on the CL" value="" />
|
|
188 <param name="param_CLprefixed" type="text" label="Override the generated default argparse name prefix if not empty - eg ----foo if needed"
|
|
189 help="Some targets like Planemo expect an unadorned action like 'test' before --galaxy_root." value="" />
|
|
190 <param name="param_repeat" type="boolean" checked="False" truevalue="1" falsevalue="0" label="Allow user to repeat this as many times as needed." />
|
|
191 </repeat>
|
|
192 </section>
|
|
193 </xml>
|
|
194 </macros>
|
|
195
|
|
196 <requirements>
|
|
197 <requirement type="package" version="0.4.14">galaxyxml</requirement>
|
|
198 <requirement type="package" version="0.15.0">bioblend</requirement>
|
5
|
199 <requirement type="package" version="3.2.3">rsync</requirement>
|
4
|
200 </requirements>
|
|
201
|
|
202 <command detect_errors="exit_code"><![CDATA[
|
|
203 #import os
|
|
204 #set dev_env = os.environ.get('GALAXY_DEVELOPMENT_ENVIRONMENT', '0') == '1'
|
|
205 #if not $dev_env and ( $__user_email__ not in $__admin_users__ ):
|
|
206 python3 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__
|
|
207 #else:
|
|
208 python3 $__tool_directory__/ToolFactory.py
|
|
209 #if len(str($cl_suffix)) > 0:
|
|
210 --cl_user_suffix "$cl_suffix"
|
|
211 #end if
|
|
212 #if $cover.commover == "yes":
|
|
213 #if len(str($cover.command_override)) > 10:
|
|
214 --command_override "$commandoverride"
|
|
215 #end if
|
|
216 #if len(str($cover.test_override)) > 10:
|
|
217 --test_override "$testoverride"
|
|
218 #end if
|
|
219 #end if
|
|
220 #if $deps.packages > "":
|
|
221 --packages "$deps.packages"
|
|
222 #end if
|
|
223 #if $deps.usescript.choosescript == "yes":
|
|
224 --script_path "$runme"
|
|
225 --sysexe "$deps.usescript.scriptrunner"
|
|
226 #end if
|
|
227 --tool_name "$tool_name" --user_email "$__user_email__" --citations "$citeme" --parampass "$io_param.ppass.parampass"
|
|
228 --tool_desc "$tool_desc"
|
|
229 --tool_version "$tool_version"
|
|
230 --help_text "$helpme"
|
|
231 --new_tool "$new_tool"
|
|
232 #if $install:
|
|
233 --install
|
|
234 #end if
|
|
235 #if $do_test.run_test:
|
|
236 --run_test
|
|
237 #end if
|
|
238 #if $io_param.ppass.parampass != '0':
|
|
239 #if str($io_param.ppass.addparam.edit_params) == "yes":
|
|
240 --edit_additional_parameters
|
|
241 #end if
|
|
242 #for $apar in $io_param.ppass.addparam.additional_parameters:
|
|
243 #if $apar.ap_type.param_type=="selecttext":
|
|
244 --selecttext_parameters '{"name":"$apar.param_name", "label":"$apar.param_label", "help":"$apar.param_help",
|
|
245 "type":"$apar.ap_type.param_type","CL":"$apar.param_CL","override":"$apar.param_CLprefixed","value": [
|
|
246 #for $i,$st in enumerate($apar.ap_type.selectTexts):
|
|
247 "$st.select_value"
|
|
248 #if ($i < (len($apar.ap_type.selectTexts)-1)):
|
|
249 ,
|
|
250 #end if
|
|
251 #end for
|
|
252 ], "texts": [
|
|
253 #for $i,$st in enumerate($apar.ap_type.selectTexts):
|
|
254 "$st.select_text"
|
|
255 #if ($i < (len($apar.ap_type.selectTexts)-1)):
|
|
256 ,
|
|
257 #end if
|
|
258
|
|
259 #end for
|
|
260 ]
|
|
261 }'
|
|
262 #else:
|
|
263 --additional_parameters '{"name": "$apar.param_name", "value": "$apar.ap_type.param_value", "label": "$apar.param_label", "help": "$apar.param_help",
|
|
264 "type": "$apar.ap_type.param_type","CL": "$apar.param_CL","override": "$apar.param_CLprefixed", "repeat": "$apar.param_repeat"}'
|
|
265 #end if
|
|
266 #end for
|
|
267 #end if
|
|
268 #for $intab in $io_param.ppass.io.history_inputs:
|
|
269 --input_files '{"name": "$intab.input_files", "CL": "$intab.input_CL", "format": "$intab.input_formats", "label": "$intab.input_label", "help": "$intab.input_help", "repeat": "$intab.input_repeat"}'
|
|
270 #end for
|
|
271 #for $otab in $io_param.ppass.io.history_outputs:
|
|
272 --output_files '{"name": "$otab.history_name", "format": "$otab.history_format", "CL": "$otab.history_CL", "test": "$otab.history_test"}'
|
|
273 #end for
|
|
274 #for $collect in $io_param.ppass.io.collection_outputs:
|
|
275 --collection '{"name": "$collect.name", "kind": "$collect.kind", "discover": "$collect.discover", "label": "$collect.label"}'
|
|
276 #end for
|
|
277 --galaxy_root "$__root_dir__"
|
|
278 --tool_dir "$__tool_directory__"
|
|
279 #end if
|
|
280 ]]></command>
|
|
281 <configfiles>
|
|
282 <configfile name="runme">
|
|
283 $deps.usescript.dynScript
|
|
284 </configfile>
|
|
285 <configfile name="commandoverride">
|
|
286 #if $cover.commover == "yes" and len(str($cover.command_override).strip()) > 1:
|
|
287 $cover.command_override
|
|
288 #end if
|
|
289 </configfile>
|
|
290 <configfile name="testoverride">
|
|
291 #if $cover.commover == "yes" and len(str($cover.test_override).strip()) > 1:
|
|
292 $cover.test_override
|
|
293 #end if
|
|
294 </configfile>
|
|
295 <configfile name="helpme">
|
|
296 ${help_text}
|
|
297 </configfile>
|
|
298 <configfile name="citeme">
|
|
299
|
|
300 #for $citation in $citations:
|
|
301 #if $citation.citation_type.type == "bibtex":
|
|
302 **ENTRY**bibtex
|
|
303 ${citation.citation_type.bibtex}
|
|
304 #else
|
|
305 **ENTRY**doi
|
|
306 ${citation.citation_type.doi}
|
|
307 #end if
|
|
308 #end for
|
|
309
|
|
310 </configfile>
|
|
311 </configfiles>
|
|
312 <inputs>
|
|
313 <param name="tool_name" type="text" value="tool1" label="New tool ID and title for outputs"
|
|
314 help="Toolshed repository name. Choose thoughtfully to avoid namespace clashes with other tool writers. Lower case, digits and underscores only">
|
|
315 <sanitizer invalid_char="">
|
|
316 <valid initial="string.ascii_lowercase,string.digits">
|
|
317 <add value="_"/>
|
|
318 </valid>
|
|
319 </sanitizer>
|
|
320 </param>
|
|
321
|
|
322 <section name="deps" title="Dependencies, optional script and script interpreter" expanded="true">
|
|
323
|
|
324 <param name="packages" type="text" value="" label="Conda dependencies as package name[:version, name:version...]. These will always be available when this tool executes"
|
|
325 help="Use =[ver] or :[ver] for specific version - 'bwa=0.17.0'. Default is latest. Will be used every time the tool is (re)run. Only Conda is currently supported" />
|
|
326
|
|
327 <conditional name="usescript">
|
|
328 <param name="choosescript" type="select" display="radio" label="Supply a script for a dependency (e.g. python/R/bash) or a system executable such as Bash"
|
|
329 help = "For script interpreters like Python or bash, parameters and i/o specified below must match script's expectations - if you pass parameters, the script must deal with them">
|
|
330 <option value="no">No script required for this tool - just pass parameters on the command line to the first dependency listed above</option>
|
|
331 <option value="yes" selected="true">Yes, a script is ready to be pasted below</option>
|
|
332 </param>
|
|
333 <when value="no">
|
|
334 <param name="dynScript" type="hidden" value="" />
|
|
335 <param name="scriptrunner" type="hidden" value="" />
|
|
336 </when>
|
|
337 <when value="yes">
|
|
338 <param name="scriptrunner" type="text" value="" label="Interpreter for the script - eg bash or python. Can be one of the dependencies named above or a system executable"
|
|
339 help="Scripts are interpreted by the executable named here. For conda r-base, 'Rscript --vanilla' or for conda planemo, 'planemo test' for example">
|
|
340 </param>
|
|
341 <param name="dynScript" type="text" area="True" value="" label="Script for executable above to interpret. It can be one of the Conda dependency names "
|
|
342 help="Script must handle all i/o and parameters as specified below using the parameters and passing method chosen below">
|
|
343 <sanitizer>
|
|
344 <valid initial="string.printable"/>
|
|
345 <mapping initial="none"/>
|
|
346 </sanitizer>
|
|
347 </param>
|
|
348 </when>
|
|
349 </conditional>
|
|
350 </section>
|
|
351 <section name="io_param" title="Data file input, output and settings forming the executable or script command line" expanded="true">
|
|
352 <conditional name="ppass">
|
|
353 <param name="parampass" type="select" display="radio" label="Command line parameter passing method to use">
|
|
354 <option value="argparse" selected="true">Argparse: passed in the form of --clname value</option>
|
|
355 <option value="positional">Positional: Passed in the order of positional ordinals ...foo.bam bar.idx zot.xls</option>
|
|
356 <option value="0">Tool reads selected input file from STDIN and writes STDOUT with no parameters</option>
|
|
357 </param>
|
|
358 <when value="argparse">
|
|
359 <expand macro="io" />
|
|
360 <expand macro="additparam" />
|
|
361 </when>
|
|
362 <when value="positional">
|
|
363 <expand macro="io" />
|
|
364 <expand macro="additparam" />
|
|
365 </when>
|
|
366 <when value="0">
|
|
367 <expand macro="io"/>
|
|
368 </when>
|
|
369 </conditional>
|
|
370 </section>
|
|
371 <param name="cl_suffix" type="text" value="" label="Suffix for generated command line. Useful for bash post processing. Use override below to replace completely"
|
|
372 help="';' separated bash commands can be used here for post processing - added at end of autogenerated command line">
|
|
373 <sanitizer>
|
|
374 <valid initial="string.printable" />
|
|
375 <mapping initial="none"/>
|
|
376 </sanitizer>
|
|
377 </param>
|
|
378 <conditional name="cover">
|
|
379 <param name="commover" type="select" display="radio" label="Add Human wrought code to override the generated XML command and/or test section - DIY"
|
|
380 help = "For arbitrary and artfull command lines. All i/o and parameters must be passed. Choose No unless needed. Not for the faint of heart">
|
|
381 <option value="no" selected="true">No. Use automatically generated command/test XML </option>
|
|
382 <option value="yes">Yes. XML needed to override autogenerated command and/or test segments will be pasted below</option>
|
|
383 </param>
|
|
384 <when value="no">
|
|
385 <param name="command_override" type="hidden" value="" />
|
|
386 <param name="test_override" type="hidden" value="" />
|
|
387 </when>
|
|
388 <when value="yes">
|
|
389 <param name="command_override" type="text" area="True" value="" label="Optional. Human wrought command element override XML/template - e.g. for bwa"
|
|
390 help="For arbitrary and artfull command lines. All i/o and parameters must be passed. Leave blank unless needed. Not for the faint of heart">
|
|
391 <sanitizer>
|
|
392 <valid initial="string.printable"/>
|
|
393 <mapping initial="none"/>
|
|
394 </sanitizer>
|
|
395 </param>
|
|
396 <param name="test_override" type="text" area="True" value="" label="Optional. Human wrought test element override XML/template - e.g. for bwa"
|
|
397 help="For arbitrary and artfull scripts. Leave blank unless needed. Not for the faint of heart">
|
|
398 <sanitizer>
|
|
399 <valid initial="string.printable" />
|
|
400 <mapping initial="none"/>
|
|
401 </sanitizer>
|
|
402 </param>
|
|
403 </when>
|
|
404 </conditional>
|
|
405 <expand macro="tool_metadata" />
|
|
406 </inputs>
|
|
407 <outputs>
|
|
408 <data format="toolshed.gz" name="new_tool" label="${tool_name}_${do_test.tail}_toolshed.gz" />
|
|
409 <collection name="TF_run_report" type="list" label="${tool_name} test run outputs">
|
|
410 <filter>do_test['run_test']</filter>
|
|
411 <discover_datasets pattern="__name_and_ext__" directory="TF_run_report" />
|
|
412 </collection>
|
|
413 </outputs>
|
|
414 <tests>
|
|
415 <test>
|
|
416 <param name="user_email" value="admin@galaxy.org"/>
|
|
417 <param name="input_files" value="input1_sample" />
|
|
418 <param name="input_CL" value="1" />
|
|
419 <param name="input_formats" value="txt" />
|
|
420 <param name="input_label" value="input" />
|
|
421 <param name="input_help" value="help" />
|
|
422 <param name="tool_name" value="pyrevpos" />
|
|
423 <param name="parampass" value="positional" />
|
|
424 <param name="tool_version" value="0.01" />
|
|
425 <param name="tool_desc" value="positional reverse" />
|
|
426 <param name="help_text" value="help text goes here" />
|
|
427 <param name="packages" value="python"/>
|
|
428 <param name="history_name" value="output2" />
|
|
429 <param name="history_format" value="txt" />
|
|
430 <param name="history_CL" value="2" />
|
|
431 <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,'r').readlines(); o = open(outp,'w'); rs = [''.join(list(reversed(x.rstrip()))) for x in inlist]; o.write('\n'.join(rs)); o.close()"/>
|
|
432 <param name="choosescript" value="yes" />
|
|
433 <param name="script_path" value="$runme"/>
|
|
434 <param name="install" value="0"/>
|
|
435 <param name="run_test" value="1"/>
|
|
436 <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />
|
|
437 </test>
|
|
438 </tests>
|
|
439 <help>
|
|
440
|
|
441 .. class:: warningmark
|
|
442
|
|
443 **Details and attribution**
|
|
444 (see GTF_)
|
|
445
|
|
446 **Local Admins ONLY**
|
|
447 Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.
|
|
448
|
|
449 **If you find a bug**
|
|
450 Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_
|
|
451
|
|
452 **What it does**
|
|
453 This tool optionally generates normal workflow compatible first class Galaxy tools
|
|
454
|
|
455 Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.
|
|
456 Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.
|
|
457 Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.
|
|
458
|
|
459 Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.
|
|
460 These can be editable by the downstream user or baked in.
|
|
461
|
|
462 A new tarball compatible with any Galaxy toolshed is created in your history, however, it does not have the test prepared.
|
|
463 There is a separate tool you can run to update the archive after testing with Planemo
|
|
464
|
|
465 If the configuration in job_conf.xml allows tools to write to [galaxy_root]/tools, the new tool will be installed so you can view and test it locally.
|
|
466
|
|
467 .. class:: warningmark
|
|
468
|
|
469 **Note to system administrators**
|
|
470 This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.
|
|
471 Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.
|
|
472
|
|
473 .. class:: warningmark
|
|
474
|
|
475 **Use on public servers** is STRONGLY discouraged for obvious reasons
|
|
476
|
|
477 The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.
|
|
478 We recommend that you follow the good code hygiene practices associated with safe toolshed practices.
|
|
479
|
|
480 Here's a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:
|
|
481
|
|
482 ::
|
|
483
|
|
484 # reverse order of text by row
|
|
485 import sys
|
|
486 inp = sys.argv[1]
|
|
487 outp = sys.argv[2]
|
|
488 i = open(inp,'r').readlines()
|
|
489 o = open(outp,'w')
|
|
490 for row in i:
|
|
491 rs = row.rstrip()
|
|
492 rs = list(rs)
|
|
493 rs.reverse()
|
|
494 o.write(''.join(rs))
|
|
495 o.write('\n')
|
|
496 o.close()
|
|
497
|
|
498 With argparse style parameters:
|
|
499
|
|
500 ::
|
|
501
|
|
502 # reverse order of text by row
|
|
503 import argparse
|
|
504 parser = argparse.ArgumentParser()
|
|
505 a = parser.add_argument
|
|
506 a('--infile',default='')
|
|
507 a('--outfile',default=None)
|
|
508 args = parser.parse_args()
|
|
509 inp = args.infile
|
|
510 outp = args.outfile
|
|
511 i = open(inp,'r').readlines()
|
|
512 o = open(outp,'w')
|
|
513 for row in i:
|
|
514 rs = row.rstrip()
|
|
515 rs = list(rs)
|
|
516 rs.reverse()
|
|
517 o.write(''.join(rs))
|
|
518 o.write('\n')
|
|
519 o.close()
|
|
520
|
|
521 R script to draw some plots - use a collection.
|
|
522
|
|
523 ::
|
|
524
|
|
525
|
|
526 \# note this script takes NO input because it generates random data
|
|
527 dir.create('plots')
|
|
528 for (i in 1:10) {
|
|
529 foo = runif(100)
|
|
530 bar = rnorm(100)
|
|
531 bar = foo + 0.05*bar
|
|
532 pdf(paste('plots/yet',i,"anotherplot.pdf",sep='_'))
|
|
533 plot(foo,bar,main=paste("Foo by Bar plot \#",i),col="maroon", pch=3,cex=0.6)
|
|
534 dev.off()
|
|
535 foo = data.frame(a=runif(100),b=runif(100),c=runif(100),d=runif(100),e=runif(100),f=runif(100))
|
|
536 bar = as.matrix(foo)
|
|
537 pdf(paste('plots/yet',i,"anotherheatmap.pdf",sep='_'))
|
|
538 heatmap(bar,main='Random Heatmap')
|
|
539 dev.off()
|
|
540 }
|
|
541
|
|
542
|
|
543
|
|
544 Paper_
|
|
545
|
|
546 *Licensing*
|
|
547
|
|
548 Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
|
|
549 All rights reserved.
|
|
550 Licensed under the LGPL_
|
|
551
|
|
552 .. _LGPL: http://www.gnu.org/copyleft/lesser.html
|
|
553 .. _GTF: https://github.com/fubar2/toolfactory
|
|
554 .. _Paper: https://academic.oup.com/bioinformatics/article/28/23/3139/192853
|
|
555
|
|
556
|
|
557 </help>
|
|
558 <citations>
|
|
559 <citation type="doi">10.1093/bioinformatics/bts573</citation>
|
|
560 </citations>
|
|
561 </tool>
|
|
562
|
|
563
|