comparison toolfactory/rgToolFactory2.xml @ 0:06d2d758e5da draft

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