annotate README.txt @ 26:db35d39e1de9 draft

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