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