annotate rgToolFactory2.xml @ 13:00777b83aaca draft

Uploaded
author fubar
date Thu, 15 Jan 2015 07:43:13 -0500
parents
children dd6cf2ddaac7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
00777b83aaca Uploaded
fubar
parents:
diff changeset
1 <tool id="rgTF2" name="Tool Factory Two" version="1.16">
00777b83aaca Uploaded
fubar
parents:
diff changeset
2 <description>Scripts into tools</description>
00777b83aaca Uploaded
fubar
parents:
diff changeset
3 <requirements>
00777b83aaca Uploaded
fubar
parents:
diff changeset
4 <requirement type="package" version="9.10">ghostscript</requirement>
00777b83aaca Uploaded
fubar
parents:
diff changeset
5 <requirement type="package" version="1.3.20">graphicsmagick</requirement>
00777b83aaca Uploaded
fubar
parents:
diff changeset
6 </requirements>
00777b83aaca Uploaded
fubar
parents:
diff changeset
7 <code file="getlocalrpackages.py"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
8 <command interpreter="python">
00777b83aaca Uploaded
fubar
parents:
diff changeset
9 #if ( $__user_email__ not in $__admin_users__ ):
00777b83aaca Uploaded
fubar
parents:
diff changeset
10 rgToolFactory2.py --bad_user $__user_email__
00777b83aaca Uploaded
fubar
parents:
diff changeset
11 #else:
00777b83aaca Uploaded
fubar
parents:
diff changeset
12 rgToolFactory2.py --script_path "$runme" --interpreter "$interp.interpreter"
00777b83aaca Uploaded
fubar
parents:
diff changeset
13 --tool_name "$tool_name" --user_email "$__user_email__" --citations "$citeme"
00777b83aaca Uploaded
fubar
parents:
diff changeset
14 --envshpath "$interp.envpath"
00777b83aaca Uploaded
fubar
parents:
diff changeset
15
00777b83aaca Uploaded
fubar
parents:
diff changeset
16 #if $make_TAB.value=="yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
17 --output_tab "$output1"
00777b83aaca Uploaded
fubar
parents:
diff changeset
18 --output_format "$output_format"
00777b83aaca Uploaded
fubar
parents:
diff changeset
19 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
20 #if $makeMode.make_Tool=="yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
21 --make_Tool "$makeMode.make_Tool"
00777b83aaca Uploaded
fubar
parents:
diff changeset
22 --tool_desc "$makeMode.tool_desc"
00777b83aaca Uploaded
fubar
parents:
diff changeset
23 --tool_version "$makeMode.tool_version"
00777b83aaca Uploaded
fubar
parents:
diff changeset
24 --new_tool "$new_tool"
00777b83aaca Uploaded
fubar
parents:
diff changeset
25 --help_text "$helpme"
00777b83aaca Uploaded
fubar
parents:
diff changeset
26 #if $make_HTML.value=="yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
27 #if $makeMode.include_deps.value=="yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
28 --include_dependencies "yes"
00777b83aaca Uploaded
fubar
parents:
diff changeset
29 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
30 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
31 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
32 #if $additional_parameters != 'None':
00777b83aaca Uploaded
fubar
parents:
diff changeset
33 #if $edit_params.value == "yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
34 --edit_additional_parameters
00777b83aaca Uploaded
fubar
parents:
diff changeset
35 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
36 #for i in $additional_parameters:
00777b83aaca Uploaded
fubar
parents:
diff changeset
37 --additional_parameters "$i.param_name,$i.param_value,$i.param_label,$i.param_help,$i.param_type"
00777b83aaca Uploaded
fubar
parents:
diff changeset
38 #end for
00777b83aaca Uploaded
fubar
parents:
diff changeset
39 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
40 #if $make_HTML.value=="yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
41 --output_dir "$html_file.files_path" --output_html "$html_file" --make_HTML "yes"
00777b83aaca Uploaded
fubar
parents:
diff changeset
42 #else:
00777b83aaca Uploaded
fubar
parents:
diff changeset
43 --output_dir "."
00777b83aaca Uploaded
fubar
parents:
diff changeset
44 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
45 #if len($input_tab) != 0:
00777b83aaca Uploaded
fubar
parents:
diff changeset
46 --input_formats "$input_formats"
00777b83aaca Uploaded
fubar
parents:
diff changeset
47 #for $intab in $input_tab:
00777b83aaca Uploaded
fubar
parents:
diff changeset
48 #if $intab.ext != 'data':
00777b83aaca Uploaded
fubar
parents:
diff changeset
49 --input_tab "${intab},${intab.name}"
00777b83aaca Uploaded
fubar
parents:
diff changeset
50 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
51 #end for
00777b83aaca Uploaded
fubar
parents:
diff changeset
52 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
53 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
54 </command>
00777b83aaca Uploaded
fubar
parents:
diff changeset
55 <inputs>
00777b83aaca Uploaded
fubar
parents:
diff changeset
56 <param name="input_tab" type="data" label="Select one or more input file(s) from your history" optional="true" size="120" multiple="true"
00777b83aaca Uploaded
fubar
parents:
diff changeset
57 help="Use the multiple input widget (above/right of input box) for multiple inputs - your script MUST be ready to parse the command line right - see samples below"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
58 <param name="input_formats" type="select" multiple="true" label="Select the datatype(s) that your tool/script accepts as input"
00777b83aaca Uploaded
fubar
parents:
diff changeset
59 help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml">
00777b83aaca Uploaded
fubar
parents:
diff changeset
60 <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
00777b83aaca Uploaded
fubar
parents:
diff changeset
61 <column name="value" index="0"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
62 </options>
00777b83aaca Uploaded
fubar
parents:
diff changeset
63 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
64 <param name="tool_name" type="text" value="My dynamic script" label="New tool ID and title for outputs" size="60"
00777b83aaca Uploaded
fubar
parents:
diff changeset
65 help="This will become the toolshed repository name so please choose thoughtfully to avoid namespace clashes with other tool writers">
00777b83aaca Uploaded
fubar
parents:
diff changeset
66 <sanitizer invalid_char="">
00777b83aaca Uploaded
fubar
parents:
diff changeset
67 <valid initial="string.letters,string.digits">
00777b83aaca Uploaded
fubar
parents:
diff changeset
68 <add value="_"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
69 </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
70 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
71 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
72 <conditional name="makeMode">
00777b83aaca Uploaded
fubar
parents:
diff changeset
73 <param name="make_Tool" type="select" label="Generate new tool as a tar.gz file ready to upload to a toolshed repository"
00777b83aaca Uploaded
fubar
parents:
diff changeset
74 help="Generate a toolshed archive - upload to a toolshed from where it can be auto-installed via the Galaxy admin functions"
00777b83aaca Uploaded
fubar
parents:
diff changeset
75 size="60">
00777b83aaca Uploaded
fubar
parents:
diff changeset
76 <option value="yes">Generate a Galaxy ToolShed compatible toolshed.gz</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
77 <option value="" selected="true">No. Just run the script please</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
78 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
79 <when value = "yes">
00777b83aaca Uploaded
fubar
parents:
diff changeset
80 <param name="tool_version" label="Tool Version - bump this to warn users trying to redo old analyses" type="text" value="0.01"
00777b83aaca Uploaded
fubar
parents:
diff changeset
81 help="If you change your script and regenerate the 'same' tool, you should inform Galaxy (and users) by changing (bumping is traditional) this number"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
82 <param name="tool_desc" label="Tool Description" type="text" value="" size="40"
00777b83aaca Uploaded
fubar
parents:
diff changeset
83 help="Supply a brief tool description for the Galaxy tool menu entry (optional - appears after the tool name)" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
84 <param name="help_text" label="Tool form documentation and help text for users" type="text" area="true"
00777b83aaca Uploaded
fubar
parents:
diff changeset
85 size="8x120" value="**What it Does**"
00777b83aaca Uploaded
fubar
parents:
diff changeset
86 help="Supply the brief user documentation to appear on the new tool form as reStructured text - http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html" >
00777b83aaca Uploaded
fubar
parents:
diff changeset
87 <sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
88 <valid initial="string.printable">
00777b83aaca Uploaded
fubar
parents:
diff changeset
89 </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
90 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
91 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
92 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
93 <repeat name="citations" title="Citation">
00777b83aaca Uploaded
fubar
parents:
diff changeset
94 <conditional name="citation_type">
00777b83aaca Uploaded
fubar
parents:
diff changeset
95 <param name="type" type="select" label="Citation Type">
00777b83aaca Uploaded
fubar
parents:
diff changeset
96 <option value="doi">DOI</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
97 <option value="bibtex">BibTeX</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
98 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
99 <when value="doi">
00777b83aaca Uploaded
fubar
parents:
diff changeset
100 <param name="doi" label="DOI" type="text" value=""
00777b83aaca Uploaded
fubar
parents:
diff changeset
101 help="Supply a DOI (e.g. doi: 10.1111/j.1740-9713.2007.00258.x) that should be cited when this tool is used in published research." />
00777b83aaca Uploaded
fubar
parents:
diff changeset
102 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
103 <when value="bibtex">
00777b83aaca Uploaded
fubar
parents:
diff changeset
104 <param name="bibtex" label="BibTex" type="text" area="true" size="8x120"
00777b83aaca Uploaded
fubar
parents:
diff changeset
105 help="Supply a BibTex entry that should be cited when this tool is used in published research." value="" >
00777b83aaca Uploaded
fubar
parents:
diff changeset
106 <sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
107 <valid initial="string.printable">
00777b83aaca Uploaded
fubar
parents:
diff changeset
108 </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
109 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
110 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
111 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
112 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
113 </conditional>
00777b83aaca Uploaded
fubar
parents:
diff changeset
114 </repeat>
00777b83aaca Uploaded
fubar
parents:
diff changeset
115 <param name="include_deps" type="select" label="Include ghostscript and graphicsmagick dependencies in generated tool" size="60"
00777b83aaca Uploaded
fubar
parents:
diff changeset
116 help="If an HTML file is being created, including dependencies is recommended. Otherwise this setting has no effect">
00777b83aaca Uploaded
fubar
parents:
diff changeset
117 <option value="">Rely on system ghostscript and graphicsmagick rather than include these as dependencies</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
118 <option value="yes" selected="true">Include dependencies so target installations will always work if HTML is being generated</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
119 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
120 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
121 <when value = "">
00777b83aaca Uploaded
fubar
parents:
diff changeset
122 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
123 </conditional>
00777b83aaca Uploaded
fubar
parents:
diff changeset
124 <param name="make_HTML" type="select" label="Create an HTML report with links to every output file your script writes to the current directory" size="60"
00777b83aaca Uploaded
fubar
parents:
diff changeset
125 help="Recommended for presenting complex outputs in an accessible manner. Turn off for simple tools so they just create one output">
00777b83aaca Uploaded
fubar
parents:
diff changeset
126 <option value="yes">Yes, arrange and link all output files written by my script to the current directory as an HTML page</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
127 <option value="" selected="true">No, no HTML output file thanks</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
128 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
129 <param name="make_TAB" type="select" label="Create a new (default tabular) history output with or without an HTML file specified above"
00777b83aaca Uploaded
fubar
parents:
diff changeset
130 help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes">
00777b83aaca Uploaded
fubar
parents:
diff changeset
131 <option value="yes" selected="true">My script writes to a new history output</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
132 <option value="">I do not want a new history output file</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
133 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
134 <param name="output_format" type="select" multiple="false" label="Select the datatype that your tool/script emits as output"
00777b83aaca Uploaded
fubar
parents:
diff changeset
135 help="If your datatype is not listed here, it has to be added in galaxy's datatypes_conf.xml">
00777b83aaca Uploaded
fubar
parents:
diff changeset
136 <options from_parameter="tool.app.datatypes_registry.upload_file_formats">
00777b83aaca Uploaded
fubar
parents:
diff changeset
137 <column name="value" index="0"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
138 </options>
00777b83aaca Uploaded
fubar
parents:
diff changeset
139 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
140 <conditional name="interp">
00777b83aaca Uploaded
fubar
parents:
diff changeset
141 <param name="interpreter" type="select" label="Select the interpreter for your code. This must be available on the path of the execution host">
00777b83aaca Uploaded
fubar
parents:
diff changeset
142 <option value="Rscript" selected="true">Rscript</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
143 <option value="python">python</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
144 <option value="perl">perl</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
145 <option value="bash">bash</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
146 <option value="sh">sh</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
147 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
148 <when value="Rscript">
00777b83aaca Uploaded
fubar
parents:
diff changeset
149 <param name="envpath" type="select" label="Interpreter to use" dynamic_options="find_packages(prefix='package_r_')"
00777b83aaca Uploaded
fubar
parents:
diff changeset
150 help = "Select the R interpreter to use when running this code - should show all installed tool shed package_r_..." />
00777b83aaca Uploaded
fubar
parents:
diff changeset
151 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
152 <when value="python">
00777b83aaca Uploaded
fubar
parents:
diff changeset
153 <param name="envpath" type="select" label="Interpreter to use" dynamic_options="find_packages(prefix='package_python_')"
00777b83aaca Uploaded
fubar
parents:
diff changeset
154 help = "Select the python dependency to use when running this code - should show all installed tool shed package_python_..." />
00777b83aaca Uploaded
fubar
parents:
diff changeset
155 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
156 <when value="perl">
00777b83aaca Uploaded
fubar
parents:
diff changeset
157 <param name="envpath" type="select" label="Interpreter to use" dynamic_options="find_packages(prefix='package_perl_')"
00777b83aaca Uploaded
fubar
parents:
diff changeset
158 help = "Select the Perl interpreter to use when running this code - should show all installed tool shed package_perl_..." />
00777b83aaca Uploaded
fubar
parents:
diff changeset
159 </when>
00777b83aaca Uploaded
fubar
parents:
diff changeset
160 </conditional>
00777b83aaca Uploaded
fubar
parents:
diff changeset
161 <param name="edit_params" type="select" label="Add all additional parameters to the generated tool form so they are user editable?"
00777b83aaca Uploaded
fubar
parents:
diff changeset
162 help="If no (default), 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">
00777b83aaca Uploaded
fubar
parents:
diff changeset
163 <option value="yes">Yes, allow user to edit all additional parameters on the generated tool form</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
164 <option value="no" selected="true">No - use the fixed values for all additional parameters - no user editing</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
165 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
166 <repeat name="additional_parameters" title="Pass additional parameters to the script"
00777b83aaca Uploaded
fubar
parents:
diff changeset
167 help="See examples below to see how these can be parsed by scripts in the various languages">
00777b83aaca Uploaded
fubar
parents:
diff changeset
168 <param name="param_name" type="text" value="parameter_name" label="Choose the name for this parameter" size="60">
00777b83aaca Uploaded
fubar
parents:
diff changeset
169 <sanitizer invalid_char="">
00777b83aaca Uploaded
fubar
parents:
diff changeset
170 <valid initial="string.letters,string.digits"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
171 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
172 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
173 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
174 <param name="param_type" type="select" label="Select the type for this parameter">
00777b83aaca Uploaded
fubar
parents:
diff changeset
175 <option value="text" selected="true">text</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
176 <option value="integer">integer</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
177 <option value="float">float</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
178 <option value="file">file</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
179 <option value="library_data">library_data</option>
00777b83aaca Uploaded
fubar
parents:
diff changeset
180 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
181 <param name="param_value" type="text" value="parameter_value" label="Enter this parameter's default value" size="60"
00777b83aaca Uploaded
fubar
parents:
diff changeset
182 help="Note that commas and double quotes cannot be used in this text field - please work around this technical limitation" >
00777b83aaca Uploaded
fubar
parents:
diff changeset
183 <sanitizer invalid_char="">
00777b83aaca Uploaded
fubar
parents:
diff changeset
184 <valid initial="string.printable"> <remove value=','/> <remove value='"'/> </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
185 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
186 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
187 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
188 <param name="param_label" type="text" value="parameter_label" label="Enter this parameter's label for the form" size="60"
00777b83aaca Uploaded
fubar
parents:
diff changeset
189 help="Note that commas and double quotes cannot be used in this text field - please creatively work around this technical limitation" >
00777b83aaca Uploaded
fubar
parents:
diff changeset
190 <sanitizer invalid_char="">
00777b83aaca Uploaded
fubar
parents:
diff changeset
191 <valid initial="string.printable"> <remove value=','/> <remove value='"'/> </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
192 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
193 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
194 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
195 <param name="param_help" type="text" value="parameter_help" label="Help for this parameter"
00777b83aaca Uploaded
fubar
parents:
diff changeset
196 help="Note that commas and double quotes cannot be used in this text field - please work around this technical limitation" size="60">
00777b83aaca Uploaded
fubar
parents:
diff changeset
197 <sanitizer invalid_char="">
00777b83aaca Uploaded
fubar
parents:
diff changeset
198 <valid initial="string.printable"> <remove value=','/> <remove value='"'/> </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
199 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
200 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
201 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
202 </repeat>
00777b83aaca Uploaded
fubar
parents:
diff changeset
203 <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="" area="True" size="20x120"
00777b83aaca Uploaded
fubar
parents:
diff changeset
204 help="Script must deal with three command line parameters: please cut and paste from examples below for the appropriate scripting language">
00777b83aaca Uploaded
fubar
parents:
diff changeset
205 <sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
206 <valid initial="string.printable">
00777b83aaca Uploaded
fubar
parents:
diff changeset
207 </valid>
00777b83aaca Uploaded
fubar
parents:
diff changeset
208 <mapping initial="none"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
209 </sanitizer>
00777b83aaca Uploaded
fubar
parents:
diff changeset
210 </param>
00777b83aaca Uploaded
fubar
parents:
diff changeset
211 </inputs>
00777b83aaca Uploaded
fubar
parents:
diff changeset
212 <outputs>
00777b83aaca Uploaded
fubar
parents:
diff changeset
213 <data name="output1" label="${tool_name}.${output_format}" format="tabular" metadata_source="input_tab">
00777b83aaca Uploaded
fubar
parents:
diff changeset
214 <filter>make_TAB=="yes"</filter>
00777b83aaca Uploaded
fubar
parents:
diff changeset
215 <actions>
00777b83aaca Uploaded
fubar
parents:
diff changeset
216 <action type="format">
00777b83aaca Uploaded
fubar
parents:
diff changeset
217 <option type="from_param" name="output_format" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
218 </action>
00777b83aaca Uploaded
fubar
parents:
diff changeset
219 </actions>
00777b83aaca Uploaded
fubar
parents:
diff changeset
220 </data>
00777b83aaca Uploaded
fubar
parents:
diff changeset
221 <data format="html" name="html_file" label="${tool_name}.html">
00777b83aaca Uploaded
fubar
parents:
diff changeset
222 <filter>make_HTML == "yes"</filter>
00777b83aaca Uploaded
fubar
parents:
diff changeset
223 </data>
00777b83aaca Uploaded
fubar
parents:
diff changeset
224 <data format="toolshed.gz" name="new_tool" label="${tool_name}.toolshed.gz">
00777b83aaca Uploaded
fubar
parents:
diff changeset
225 <filter>makeMode['make_Tool'] == "yes"</filter>
00777b83aaca Uploaded
fubar
parents:
diff changeset
226 </data>
00777b83aaca Uploaded
fubar
parents:
diff changeset
227 </outputs>
00777b83aaca Uploaded
fubar
parents:
diff changeset
228 <configfiles>
00777b83aaca Uploaded
fubar
parents:
diff changeset
229 <configfile name="runme">$dynScript</configfile>
00777b83aaca Uploaded
fubar
parents:
diff changeset
230 <configfile name="helpme">
00777b83aaca Uploaded
fubar
parents:
diff changeset
231 #if $makeMode.make_Tool == "yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
232 ${makeMode.help_text}
00777b83aaca Uploaded
fubar
parents:
diff changeset
233 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
234 </configfile>
00777b83aaca Uploaded
fubar
parents:
diff changeset
235 <configfile name="citeme">
00777b83aaca Uploaded
fubar
parents:
diff changeset
236 #if $makeMode.make_Tool == "yes":
00777b83aaca Uploaded
fubar
parents:
diff changeset
237 #for $citation in $makeMode.citations:
00777b83aaca Uploaded
fubar
parents:
diff changeset
238 #if $citation.citation_type.type == "bibtex":
00777b83aaca Uploaded
fubar
parents:
diff changeset
239 **ENTRY**bibtex
00777b83aaca Uploaded
fubar
parents:
diff changeset
240 ${citation.citation_type.bibtex}
00777b83aaca Uploaded
fubar
parents:
diff changeset
241 #else
00777b83aaca Uploaded
fubar
parents:
diff changeset
242 **ENTRY**doi
00777b83aaca Uploaded
fubar
parents:
diff changeset
243 ${citation.citation_type.doi}
00777b83aaca Uploaded
fubar
parents:
diff changeset
244 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
245 #end for
00777b83aaca Uploaded
fubar
parents:
diff changeset
246 #end if
00777b83aaca Uploaded
fubar
parents:
diff changeset
247 </configfile>
00777b83aaca Uploaded
fubar
parents:
diff changeset
248 </configfiles>
00777b83aaca Uploaded
fubar
parents:
diff changeset
249 <tests>
00777b83aaca Uploaded
fubar
parents:
diff changeset
250 <test>
00777b83aaca Uploaded
fubar
parents:
diff changeset
251 <param name='input_tab' value='tf2_test_in.xls' ftype='tabular' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
252 <param name='tool_name' value='tf2_test' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
253 <param name='make_Tool' value='yes' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
254 <param name='tool_version' value='0.01' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
255 <param name="tool_desc" value='testing_tf2' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
256 <param name="help_text" value='help text goes here' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
257 <param name='include_deps' value='yes' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
258 <param name="make_HTML" value="yes" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
259 <param name="make_TAB" value="yes" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
260 <param name="output_format" value="tabular" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
261 <param name="input_formats" value="tabular" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
262 <param name="interpreter" value='python' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
263 <param name="envpath" value='system' />
00777b83aaca Uploaded
fubar
parents:
diff changeset
264 <param name="runme" value="tf2_test_runme.py"/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
265 <output name='output1' file='tf2_test_out.xls' compare='diff' lines_diff = '10'/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
266 <output name='html_file' file="tf2_test.html" compare='diff' lines_diff = '10'/>
00777b83aaca Uploaded
fubar
parents:
diff changeset
267 <output name='new_tool' file="tf2_test.toolshed.gz" compare="sim_size" delta="20" />
00777b83aaca Uploaded
fubar
parents:
diff changeset
268 </test>
00777b83aaca Uploaded
fubar
parents:
diff changeset
269 </tests>
00777b83aaca Uploaded
fubar
parents:
diff changeset
270 <help>
00777b83aaca Uploaded
fubar
parents:
diff changeset
271
00777b83aaca Uploaded
fubar
parents:
diff changeset
272 .. class:: warningmark
00777b83aaca Uploaded
fubar
parents:
diff changeset
273
00777b83aaca Uploaded
fubar
parents:
diff changeset
274 **Details and attribution**
00777b83aaca Uploaded
fubar
parents:
diff changeset
275 (see GTF_)
00777b83aaca Uploaded
fubar
parents:
diff changeset
276
00777b83aaca Uploaded
fubar
parents:
diff changeset
277 **Local Admins ONLY**
00777b83aaca Uploaded
fubar
parents:
diff changeset
278 Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.
00777b83aaca Uploaded
fubar
parents:
diff changeset
279
00777b83aaca Uploaded
fubar
parents:
diff changeset
280 **If you find a bug**
00777b83aaca Uploaded
fubar
parents:
diff changeset
281 Please raise an issue at the bitbucket repository GTFI_
00777b83aaca Uploaded
fubar
parents:
diff changeset
282
00777b83aaca Uploaded
fubar
parents:
diff changeset
283 **What it does**
00777b83aaca Uploaded
fubar
parents:
diff changeset
284 This tool enables a user to paste and submit an arbitrary R/python/perl script to Galaxy passing
00777b83aaca Uploaded
fubar
parents:
diff changeset
285 any number of input files and their metadata names to the script for use in (eg) summaries or reports.
00777b83aaca Uploaded
fubar
parents:
diff changeset
286 This allows quick generation of tools capable of taking some arbitrary number of user selected inputs
00777b83aaca Uploaded
fubar
parents:
diff changeset
287 for the "reduce" step of a map-reduce HPC model.
00777b83aaca Uploaded
fubar
parents:
diff changeset
288
00777b83aaca Uploaded
fubar
parents:
diff changeset
289 **Input options**
00777b83aaca Uploaded
fubar
parents:
diff changeset
290 This version allows multiple input file selected from the history - their paths and metadata names
00777b83aaca Uploaded
fubar
parents:
diff changeset
291 are provided to your script - see the examples below for each scripting language. Python uses argparse.
00777b83aaca Uploaded
fubar
parents:
diff changeset
292 Rscript uses some code to create all the command line variables. Parameters are injected into the bash/sh
00777b83aaca Uploaded
fubar
parents:
diff changeset
293 execution environment so they magically "appear" as $ prefixed variables and will also be found on the
00777b83aaca Uploaded
fubar
parents:
diff changeset
294 command line as parameters to be parsed if that's your preference.
00777b83aaca Uploaded
fubar
parents:
diff changeset
295 Note that additional parameters are NOT presented to the user of the generated tool but are frozen with the script.
00777b83aaca Uploaded
fubar
parents:
diff changeset
296 If there's demand, it would not be too hard to add them to the generated script...
00777b83aaca Uploaded
fubar
parents:
diff changeset
297
00777b83aaca Uploaded
fubar
parents:
diff changeset
298 **Output options**
00777b83aaca Uploaded
fubar
parents:
diff changeset
299 Optional script outputs include one single new history tabular file and for scripts that create multiple file reports
00777b83aaca Uploaded
fubar
parents:
diff changeset
300 or analyses, an Html page linking every file and image created by the script can be automatically generated.
00777b83aaca Uploaded
fubar
parents:
diff changeset
301
00777b83aaca Uploaded
fubar
parents:
diff changeset
302 **Tool Generation option**
00777b83aaca Uploaded
fubar
parents:
diff changeset
303 Once the script is working with test data, this tool will optionally generate a new Galaxy tool in a Tool Shed (gzip) repository file
00777b83aaca Uploaded
fubar
parents:
diff changeset
304 ready to upload to your local toolshed for sharing and installation.
00777b83aaca Uploaded
fubar
parents:
diff changeset
305 Provide a small sample input when you run generate the tool because it will become the input for the generated functional test.
00777b83aaca Uploaded
fubar
parents:
diff changeset
306
00777b83aaca Uploaded
fubar
parents:
diff changeset
307 .. class:: warningmark
00777b83aaca Uploaded
fubar
parents:
diff changeset
308
00777b83aaca Uploaded
fubar
parents:
diff changeset
309 **Note to system administrators**
00777b83aaca Uploaded
fubar
parents:
diff changeset
310 This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.
00777b83aaca Uploaded
fubar
parents:
diff changeset
311 Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.
00777b83aaca Uploaded
fubar
parents:
diff changeset
312
00777b83aaca Uploaded
fubar
parents:
diff changeset
313 .. class:: warningmark
00777b83aaca Uploaded
fubar
parents:
diff changeset
314
00777b83aaca Uploaded
fubar
parents:
diff changeset
315 **Use on public servers** is STRONGLY discouraged for obvious reasons
00777b83aaca Uploaded
fubar
parents:
diff changeset
316
00777b83aaca Uploaded
fubar
parents:
diff changeset
317 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.
00777b83aaca Uploaded
fubar
parents:
diff changeset
318 We recommend that you follow the good code hygiene practices associated with safe toolshed.
00777b83aaca Uploaded
fubar
parents:
diff changeset
319
00777b83aaca Uploaded
fubar
parents:
diff changeset
320 **Scripting conventions** The pasted script will be executed with the path to the (optional) input tabular data file path or NONE if you do not select one, and the path to the optional
00777b83aaca Uploaded
fubar
parents:
diff changeset
321 output file or None if none is wanted, as the first and second command line parameters. The script must deal appropriately with these - see Rscript examples below.
00777b83aaca Uploaded
fubar
parents:
diff changeset
322 Note that if an optional HTML output is selected, all the output files created by the script will be nicely presented as links, with pdf images linked as thumbnails in that output.
00777b83aaca Uploaded
fubar
parents:
diff changeset
323 This can be handy for complex scripts creating lots of output.
00777b83aaca Uploaded
fubar
parents:
diff changeset
324
00777b83aaca Uploaded
fubar
parents:
diff changeset
325 <![CDATA[
00777b83aaca Uploaded
fubar
parents:
diff changeset
326
00777b83aaca Uploaded
fubar
parents:
diff changeset
327 **Multiple inputs**
00777b83aaca Uploaded
fubar
parents:
diff changeset
328
00777b83aaca Uploaded
fubar
parents:
diff changeset
329 Your script will receive up to 3 named parameters
00777b83aaca Uploaded
fubar
parents:
diff changeset
330 INPATHS is a comma separated list of input file paths
00777b83aaca Uploaded
fubar
parents:
diff changeset
331 INNAMES is a comma separated list of input file names in the same order
00777b83aaca Uploaded
fubar
parents:
diff changeset
332 OUTPATH is optional if a file is being generated, your script should write there
00777b83aaca Uploaded
fubar
parents:
diff changeset
333 Your script should open and write files in the provided working directory if you are using the Html
00777b83aaca Uploaded
fubar
parents:
diff changeset
334 automatic presentation option.
00777b83aaca Uploaded
fubar
parents:
diff changeset
335
00777b83aaca Uploaded
fubar
parents:
diff changeset
336 Python script command lines will have --INPATHS and --additional_arguments etc. to make it easy to use argparse
00777b83aaca Uploaded
fubar
parents:
diff changeset
337
00777b83aaca Uploaded
fubar
parents:
diff changeset
338 Rscript will need to use commandArgs(TRUE) - see the example below - additional arguments will
00777b83aaca Uploaded
fubar
parents:
diff changeset
339 appear as themselves - eg foo="bar" will mean that foo is defined as "bar" for the script.
00777b83aaca Uploaded
fubar
parents:
diff changeset
340
00777b83aaca Uploaded
fubar
parents:
diff changeset
341 Bash and sh will see any additional parameters on their command lines and the 3 named parameters
00777b83aaca Uploaded
fubar
parents:
diff changeset
342 in their environment magically - well, using env on the CL
00777b83aaca Uploaded
fubar
parents:
diff changeset
343
00777b83aaca Uploaded
fubar
parents:
diff changeset
344 ***python***::
00777b83aaca Uploaded
fubar
parents:
diff changeset
345
00777b83aaca Uploaded
fubar
parents:
diff changeset
346 # argparse for 3 possible comma separated lists
00777b83aaca Uploaded
fubar
parents:
diff changeset
347 # additional parameters need to be parsed !
00777b83aaca Uploaded
fubar
parents:
diff changeset
348 # then echo parameters to the output file
00777b83aaca Uploaded
fubar
parents:
diff changeset
349 import sys
00777b83aaca Uploaded
fubar
parents:
diff changeset
350 import argparse
00777b83aaca Uploaded
fubar
parents:
diff changeset
351 argp=argparse.ArgumentParser()
00777b83aaca Uploaded
fubar
parents:
diff changeset
352 argp.add_argument('--INNAMES',default=None)
00777b83aaca Uploaded
fubar
parents:
diff changeset
353 argp.add_argument('--INPATHS',default=None)
00777b83aaca Uploaded
fubar
parents:
diff changeset
354 argp.add_argument('--OUTPATH',default=None)
00777b83aaca Uploaded
fubar
parents:
diff changeset
355 argp.add_argument('--additional_parameters',default=[],action="append")
00777b83aaca Uploaded
fubar
parents:
diff changeset
356 argp.add_argument('otherargs', nargs=argparse.REMAINDER)
00777b83aaca Uploaded
fubar
parents:
diff changeset
357 args = argp.parse_args()
00777b83aaca Uploaded
fubar
parents:
diff changeset
358 f= open(args.OUTPATH,'w')
00777b83aaca Uploaded
fubar
parents:
diff changeset
359 s = '### args=%s\n' % str(args)
00777b83aaca Uploaded
fubar
parents:
diff changeset
360 f.write(s)
00777b83aaca Uploaded
fubar
parents:
diff changeset
361 s = 'sys.argv=%s\n' % sys.argv
00777b83aaca Uploaded
fubar
parents:
diff changeset
362 f.write(s)
00777b83aaca Uploaded
fubar
parents:
diff changeset
363 f.close()
00777b83aaca Uploaded
fubar
parents:
diff changeset
364
00777b83aaca Uploaded
fubar
parents:
diff changeset
365
00777b83aaca Uploaded
fubar
parents:
diff changeset
366
00777b83aaca Uploaded
fubar
parents:
diff changeset
367 ***Rscript***::
00777b83aaca Uploaded
fubar
parents:
diff changeset
368
00777b83aaca Uploaded
fubar
parents:
diff changeset
369 # tool factory Rscript parser suggested by Forester
00777b83aaca Uploaded
fubar
parents:
diff changeset
370 # http://www.r-bloggers.com/including-arguments-in-r-cmd-batch-mode/
00777b83aaca Uploaded
fubar
parents:
diff changeset
371 # additional parameters will appear in the ls() below - they are available
00777b83aaca Uploaded
fubar
parents:
diff changeset
372 # to your script
00777b83aaca Uploaded
fubar
parents:
diff changeset
373 # echo parameters to the output file
00777b83aaca Uploaded
fubar
parents:
diff changeset
374 ourargs = commandArgs(TRUE)
00777b83aaca Uploaded
fubar
parents:
diff changeset
375 if(length(ourargs)==0){
00777b83aaca Uploaded
fubar
parents:
diff changeset
376 print("No arguments supplied.")
00777b83aaca Uploaded
fubar
parents:
diff changeset
377 }else{
00777b83aaca Uploaded
fubar
parents:
diff changeset
378 for(i in 1:length(ourargs)){
00777b83aaca Uploaded
fubar
parents:
diff changeset
379 eval(parse(text=ourargs[[i]]))
00777b83aaca Uploaded
fubar
parents:
diff changeset
380 }
00777b83aaca Uploaded
fubar
parents:
diff changeset
381 sink(OUTPATH)
00777b83aaca Uploaded
fubar
parents:
diff changeset
382 cat('INPATHS=',INPATHS,'\n')
00777b83aaca Uploaded
fubar
parents:
diff changeset
383 cat('INNAMES=',INNAMES,'\n')
00777b83aaca Uploaded
fubar
parents:
diff changeset
384 cat('OUTPATH=',OUTPATH,'\n')
00777b83aaca Uploaded
fubar
parents:
diff changeset
385 x=ls()
00777b83aaca Uploaded
fubar
parents:
diff changeset
386 cat('all objects=',x,'\n')
00777b83aaca Uploaded
fubar
parents:
diff changeset
387 sink()
00777b83aaca Uploaded
fubar
parents:
diff changeset
388 }
00777b83aaca Uploaded
fubar
parents:
diff changeset
389 sessionInfo()
00777b83aaca Uploaded
fubar
parents:
diff changeset
390 print.noquote(date())
00777b83aaca Uploaded
fubar
parents:
diff changeset
391
00777b83aaca Uploaded
fubar
parents:
diff changeset
392
00777b83aaca Uploaded
fubar
parents:
diff changeset
393 ***bash/sh***::
00777b83aaca Uploaded
fubar
parents:
diff changeset
394
00777b83aaca Uploaded
fubar
parents:
diff changeset
395 # tool factory sets up these environmental variables
00777b83aaca Uploaded
fubar
parents:
diff changeset
396 # this example writes those to the output file
00777b83aaca Uploaded
fubar
parents:
diff changeset
397 # additional params appear on command line
00777b83aaca Uploaded
fubar
parents:
diff changeset
398 if [ ! -f "$OUTPATH" ] ; then
00777b83aaca Uploaded
fubar
parents:
diff changeset
399 touch "$OUTPATH"
00777b83aaca Uploaded
fubar
parents:
diff changeset
400 fi
00777b83aaca Uploaded
fubar
parents:
diff changeset
401 echo "INPATHS=$INPATHS" >> "$OUTPATH"
00777b83aaca Uploaded
fubar
parents:
diff changeset
402 echo "INNAMES=$INNAMES" >> "$OUTPATH"
00777b83aaca Uploaded
fubar
parents:
diff changeset
403 echo "OUTPATH=$OUTPATH" >> "$OUTPATH"
00777b83aaca Uploaded
fubar
parents:
diff changeset
404 echo "CL=$@" >> "$OUTPATH"
00777b83aaca Uploaded
fubar
parents:
diff changeset
405
00777b83aaca Uploaded
fubar
parents:
diff changeset
406 ***perl***::
00777b83aaca Uploaded
fubar
parents:
diff changeset
407
00777b83aaca Uploaded
fubar
parents:
diff changeset
408 (my $INPATHS,my $INNAMES,my $OUTPATH ) = @ARGV;
00777b83aaca Uploaded
fubar
parents:
diff changeset
409 open(my $fh, '>', $OUTPATH) or die "Could not open file '$OUTPATH' $!";
00777b83aaca Uploaded
fubar
parents:
diff changeset
410 print $fh "INPATHS=$INPATHS\n INNAMES=$INNAMES\n OUTPATH=$OUTPATH\n";
00777b83aaca Uploaded
fubar
parents:
diff changeset
411 close $fh;
00777b83aaca Uploaded
fubar
parents:
diff changeset
412
00777b83aaca Uploaded
fubar
parents:
diff changeset
413
00777b83aaca Uploaded
fubar
parents:
diff changeset
414 ]]>
00777b83aaca Uploaded
fubar
parents:
diff changeset
415
00777b83aaca Uploaded
fubar
parents:
diff changeset
416
00777b83aaca Uploaded
fubar
parents:
diff changeset
417
00777b83aaca Uploaded
fubar
parents:
diff changeset
418 Paper_ :
00777b83aaca Uploaded
fubar
parents:
diff changeset
419
00777b83aaca Uploaded
fubar
parents:
diff changeset
420 Creating re-usable tools from scripts: The Galaxy Tool Factory
00777b83aaca Uploaded
fubar
parents:
diff changeset
421 Ross Lazarus; Antony Kaspi; Mark Ziemann; The Galaxy Team
00777b83aaca Uploaded
fubar
parents:
diff changeset
422 Bioinformatics 2012; doi: 10.1093/bioinformatics/bts573
00777b83aaca Uploaded
fubar
parents:
diff changeset
423
00777b83aaca Uploaded
fubar
parents:
diff changeset
424 **Licensing**
00777b83aaca Uploaded
fubar
parents:
diff changeset
425
00777b83aaca Uploaded
fubar
parents:
diff changeset
426 Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
00777b83aaca Uploaded
fubar
parents:
diff changeset
427 All rights reserved.
00777b83aaca Uploaded
fubar
parents:
diff changeset
428 Licensed under the LGPL_
00777b83aaca Uploaded
fubar
parents:
diff changeset
429
00777b83aaca Uploaded
fubar
parents:
diff changeset
430 .. _LGPL: http://www.gnu.org/copyleft/lesser.html
00777b83aaca Uploaded
fubar
parents:
diff changeset
431 .. _GTF: https://bitbucket.org/fubar/galaxytoolfactory
00777b83aaca Uploaded
fubar
parents:
diff changeset
432 .. _GTFI: https://bitbucket.org/fubar/galaxytoolfactory/issues
00777b83aaca Uploaded
fubar
parents:
diff changeset
433 .. _Paper: http://bioinformatics.oxfordjournals.org/cgi/reprint/bts573?ijkey=lczQh1sWrMwdYWJ&amp;keytype=ref
00777b83aaca Uploaded
fubar
parents:
diff changeset
434
00777b83aaca Uploaded
fubar
parents:
diff changeset
435
00777b83aaca Uploaded
fubar
parents:
diff changeset
436 </help>
00777b83aaca Uploaded
fubar
parents:
diff changeset
437 <citations>
00777b83aaca Uploaded
fubar
parents:
diff changeset
438 <citation type="doi">10.1093/bioinformatics/bts573</citation>
00777b83aaca Uploaded
fubar
parents:
diff changeset
439 </citations>
00777b83aaca Uploaded
fubar
parents:
diff changeset
440 </tool>
00777b83aaca Uploaded
fubar
parents:
diff changeset
441
00777b83aaca Uploaded
fubar
parents:
diff changeset
442