33
|
1 Note as at August 8 2020
|
|
2
|
|
3 Until a PR is accepted, galaxyxml requires a small tweak - you will need to install
|
|
4 ```
|
|
5 https://github.com/fubar2/galaxyxml
|
|
6 ```
|
|
7 instead into the virtualenv used to run galaxy and when using planemo, the
|
|
8
|
|
9 ```
|
|
10 --skip_venv
|
|
11 ```
|
|
12
|
|
13 flag must be used.
|
|
14
|
|
15
|
|
16 *WARNING before you start*
|
30
|
17
|
32
|
18 Install this tool on a private Galaxy ONLY
|
|
19 Please NEVER on a public or production instance
|
|
20
|
|
21 Updated august 2014 by John Chilton adding citation support
|
30
|
22
|
32
|
23 Updated august 8 2014 to fix bugs reported by Marius van den Beek
|
30
|
24
|
|
25 Please cite the resource at
|
|
26 http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
|
|
27 if you use this tool in your published work.
|
|
28
|
32
|
29 **Short Story**
|
30
|
30
|
|
31 This is an unusual Galaxy tool capable of generating new Galaxy tools.
|
|
32 It works by exposing *unrestricted* and therefore extremely dangerous scripting
|
|
33 to all designated administrators of the host Galaxy server, allowing them to
|
|
34 run scripts in R, python, sh and perl over multiple selected input data sets,
|
|
35 writing a single new data set as output.
|
|
36
|
32
|
37 *You have a working r/python/perl/bash script or any executable with positional or argparse style parameters*
|
30
|
38
|
32
|
39 It can be turned into an ordinary Galaxy tool in minutes, using a Galaxy tool.
|
30
|
40
|
|
41
|
32
|
42 **Automated generation of new Galaxy tools for installation into any Galaxy**
|
30
|
43
|
32
|
44 A test is generated using small sample test data inputs and parameter settings you supply.
|
|
45 Once the test case outputs have been produced, they can be used to build a
|
|
46 new Galaxy tool. The supplied script or executable is baked as a requirement
|
|
47 into a new, ordinary Galaxy tool, fully workflow compatible out of the box.
|
|
48 Generated tools are installed via a tool shed by an administrator
|
30
|
49 and work exactly like all other Galaxy tools for your users.
|
|
50
|
32
|
51 **More Detail**
|
30
|
52
|
|
53 To use the ToolFactory, you should have prepared a script to paste into a
|
32
|
54 text box, or have a package in mind and a small test input example ready to select from your history
|
30
|
55 to test your new script.
|
|
56
|
33
|
57 ```planemo test --no_cleanup --no_dependency_resolution --skip_venv --galaxy_root ~/galaxy ~/rossgit/toolfactory``` works for me
|
32
|
58
|
30
|
59 There is an example in each scripting language on the Tool Factory form. You
|
|
60 can just cut and paste these to try it out - remember to select the right
|
|
61 interpreter please. You'll also need to create a small test data set using
|
|
62 the Galaxy history add new data tool.
|
|
63
|
|
64 If the script fails somehow, use the "redo" button on the tool output in
|
|
65 your history to recreate the form complete with broken script. Fix the bug
|
|
66 and execute again. Rinse, wash, repeat.
|
|
67
|
|
68 Once the script runs sucessfully, a new Galaxy tool that runs your script
|
|
69 can be generated. Select the "generate" option and supply some help text and
|
|
70 names. The new tool will be generated in the form of a new Galaxy datatype
|
33
|
71 *tgz* - as the name suggests, it's an archive ready to upload to a
|
30
|
72 Galaxy ToolShed as a new tool repository.
|
|
73
|
33
|
74 Until tgz is added to the galaxy distribution datatypes you will need to add the following:
|
|
75 <datatype extension="tgz" type="galaxy.datatypes.binary:Binary" subclass="true" mimetype="multipart/x-gzip" display_in_upload="true" />
|
|
76
|
|
77 to::
|
|
78 [galaxyroot]/config/datatypes_conf.xml
|
|
79
|
30
|
80 Once it's in a ToolShed, it can be installed into any local Galaxy server
|
|
81 from the server administrative interface.
|
|
82
|
|
83 Once the new tool is installed, local users can run it - each time, the script
|
|
84 that was supplied when it was built will be executed with the input chosen
|
|
85 from the user's history. In other words, the tools you generate with the
|
|
86 ToolFactory run just like any other Galaxy tool,but run your script every time.
|
|
87
|
|
88 Tool factory tools are perfect for workflow components. One input, one output,
|
|
89 no variables.
|
|
90
|
|
91 *To fully and safely exploit the awesome power* of this tool,
|
|
92 Galaxy and the ToolShed, you should be a developer installing this
|
|
93 tool on a private/personal/scratch local instance where you are an
|
|
94 admin_user. Then, if you break it, you get to keep all the pieces see
|
|
95 https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home
|
|
96
|
32
|
97 **Installation**
|
30
|
98 This is a Galaxy tool. You can install it most conveniently using the
|
|
99 administrative "Search and browse tool sheds" link. Find the Galaxy Main
|
|
100 toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory
|
|
101 repository. Open it and review the code and select the option to install it.
|
|
102
|
32
|
103 If you can't get the tool that way, the xml and py files here need to be
|
|
104 copied into a new tools
|
|
105 subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry
|
|
106 pointing to the xml
|
|
107 file - something like::
|
30
|
108
|
|
109 <section name="Tool building tools" id="toolbuilders">
|
|
110 <tool file="toolfactory/rgToolFactory.xml"/>
|
|
111 </section>
|
32
|
112
|
|
113 If not already there,
|
30
|
114 please add:
|
|
115 <datatype extension="toolshed.gz" type="galaxy.datatypes.binary:Binary"
|
|
116 mimetype="multipart/x-gzip" subclass="True" />
|
|
117 to your local data_types_conf.xml.
|
|
118
|
|
119
|
32
|
120 **Restricted execution**
|
30
|
121
|
|
122 The tool factory tool itself will then be usable ONLY by admin users -
|
|
123 people with IDs in admin_users in universe_wsgi.ini **Yes, that's right. ONLY
|
|
124 admin_users can run this tool** Think about it for a moment. If allowed to
|
|
125 run any arbitrary script on your Galaxy server, the only thing that would
|
|
126 impede a miscreant bent on destroying all your Galaxy data would probably
|
|
127 be lack of appropriate technical skills.
|
|
128
|
32
|
129 **What it does**
|
|
130
|
|
131 This is a tool factory for simple scripts in python, R and
|
30
|
132 perl currently. Functional tests are automatically generated. How cool is that.
|
|
133
|
|
134 LIMITED to simple scripts that read one input from the history. Optionally can
|
|
135 write one new history dataset, and optionally collect any number of outputs
|
|
136 into links on an autogenerated HTML index page for the user to navigate -
|
|
137 useful if the script writes images and output files - pdf outputs are shown
|
|
138 as thumbnails and R's bloated pdf's are shrunk with ghostscript so that and
|
|
139 imagemagik need to be available.
|
|
140
|
|
141 Generated tools can be edited and enhanced like any Galaxy tool, so start
|
|
142 small and build up since a generated script gets you a serious leg up to a
|
|
143 more complex one.
|
|
144
|
32
|
145 **What you do**
|
|
146
|
|
147 You paste and run your script, you fix the syntax errors and
|
30
|
148 eventually it runs. You can use the redo button and edit the script before
|
|
149 trying to rerun it as you debug - it works pretty well.
|
|
150
|
|
151 Once the script works on some test data, you can generate a toolshed compatible
|
|
152 gzip file containing your script ready to run as an ordinary Galaxy tool in
|
|
153 a repository on your local toolshed. That means safe and largely automated
|
|
154 installation in any production Galaxy configured to use your toolshed.
|
|
155
|
32
|
156 **Generated tool Security**
|
|
157
|
|
158 Once you install a generated tool, it's just
|
30
|
159 another tool - assuming the script is safe. They just run normally and their
|
|
160 user cannot do anything unusually insecure but please, practice safe toolshed.
|
32
|
161 Read the code before you install any tool. Especially this one - it is really scary.
|
30
|
162
|
32
|
163 **Send Code**
|
30
|
164
|
|
165 Patches and suggestions welcome as bitbucket issues please?
|
|
166
|
32
|
167 **Attribution**
|
30
|
168
|
|
169 Creating re-usable tools from scripts: The Galaxy Tool Factory
|
|
170 Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
|
|
171 Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
|
|
172
|
|
173 http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&keytype=ref
|
|
174
|
|
175 **Licensing**
|
32
|
176
|
30
|
177 Copyright Ross Lazarus 2010
|
|
178 ross lazarus at g mail period com
|
|
179
|
|
180 All rights reserved.
|
|
181
|
|
182 Licensed under the LGPL
|
|
183
|
32
|
184 **Obligatory screenshot**
|
30
|
185
|
32
|
186 http://bitbucket.org/fubar/galaxytoolmaker/src/fda8032fe989/images/dynamicScriptTool.png
|
30
|
187
|