Scripts into toolspythonlxml
#if $interexe.interpreter != "Executable" and $interexe.interpreter != "system" :
${interexe.dynScript}
#else:
$tool_name
#end if
#if $makeMode.make_Tool == "yes":
${makeMode.help_text}
#else
$tool_name help goes here
#end if
#if $makeMode.make_Tool == "yes":
#for $citation in $makeMode.citations:
#if $citation.citation_type.type == "bibtex":
**ENTRY**bibtex
${citation.citation_type.bibtex}
#else
**ENTRY**doi
${citation.citation_type.doi}
#end if
#end for
#end if
makeMode['make_Tool'] == "yes"
.. class:: warningmark
**Details and attribution**
(see GTF_)
**Local Admins ONLY**
Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.
**If you find a bug**
Please raise an issue, or even better, submit a pull request fixing it, on the github repository GTF_
**What it does**
This tool optionally generates normal workflow compatible first class Galaxy tools
Generated tools can run existing binary packages that become requirements, existing scripts, or new scripts pasted into this tool form.
Pasted scripts are written so they are part of the new tool and cannot be adjusted by the downstream user.
Binary packages are managed by the dependency subsystem - conda usually, so anything in bioconda or conda_forge is available for example.
Any number of parameters can be built into the new tool form for passing in to the script or executable at runtime.
These can be editable by the downstream user or baked in.
When you run this tool, your executable or script and supplied parameter values will be run to produce a canonical
set of outputs - these are used to construct a test for the new tool.
If tool generation is required, a new tarball compatible with any Galaxy toolshed is created.
It can be unpacked in your galaxy/tools directory and manually added to tool_conf.xml, or
installed into any toolshed from where it can be installed into your Galaxy.
.. class:: warningmark
**Note to system administrators**
This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.
Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.
.. class:: warningmark
**Use on public servers** is STRONGLY discouraged for obvious reasons
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.
We recommend that you follow the good code hygiene practices associated with safe toolshed practices.
Here's a sample python script that can be cut and pasted into the tool form, suitable for positional parameter passing:
::
# reverse order of text by row
import sys
inp = sys.argv[1]
outp = sys.argv[2]
i = open(inp,'r').readlines()
o = open(outp,'w')
for row in i:
rs = row.rstrip()
rs = list(rs)
rs.reverse()
o.write(''.join(rs))
o.write('\n')
o.close()
With argparse style parameters:
::
# reverse order of text by row
import argparse
parser = argparse.ArgumentParser()
a = parser.add_argument
a('--infile',default='')
a('--outfile',default=None)
args = parser.parse_args()
inp = args.infile
outp = args.outfile
i = open(inp,'r').readlines()
o = open(outp,'w')
for row in i:
rs = row.rstrip()
rs = list(rs)
rs.reverse()
o.write(''.join(rs))
o.write('\n')
o.close()
Paper_ :
Creating re-usable tools from scripts: The Galaxy Tool Factory
Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
**Licensing**
Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
All rights reserved.
Licensed under the LGPL_
.. _LGPL: http://www.gnu.org/copyleft/lesser.html
.. _GTF: https://github.com/fubar2/toolfactory
.. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573
10.1093/bioinformatics/bts573