comparison toolfactory/rgToolFactory2.xml @ 63:b3254219d4fb draft

Uploaded
author fubar
date Tue, 10 Nov 2020 02:33:46 +0000
parents 881bd8c81ac9
children 30847b2e105d
comparison
equal deleted inserted replaced
62:881bd8c81ac9 63:b3254219d4fb
1 <tool id="rgtf2" name="toolfactory" version="2.01" profile="16.04" > 1 <tool id="rgtf2" name="toolfactory" version="2.00" profile="16.04" >
2 <description>Scripts into tools v2.0</description> 2 <description>Scripts into tools v2.0</description>
3 <macros> 3 <macros>
4 <xml name="tool_metadata"> 4 <xml name="tool_metadata">
5 <param name="tool_version" label="Tool Version - bump this to warn users trying to redo old analyses" type="text" value="0.01" 5 <param name="tool_version" label="Tool Version - bump this to warn users trying to redo old analyses" type="text" value="0.01"
6 help="If you change your script and regenerate the 'same' tool, you should inform Galaxy (and users) by changing (bumping is traditional) this number"/> 6 help="If you change your script and regenerate the 'same' tool, you should inform Galaxy (and users) by changing (bumping is traditional) this number"/>
54 <sanitizer invalid_char=""> 54 <sanitizer invalid_char="">
55 <valid initial="string.printable"> <remove value='~~~'/> </valid> 55 <valid initial="string.printable"> <remove value='~~~'/> </valid>
56 <mapping initial="none"/> 56 <mapping initial="none"/>
57 </sanitizer> 57 </sanitizer>
58 </param> 58 </param>
59 <param name="input_help" type="text" value="parameter_help" label="This will become help text on the form." 59 <param name="input_help" type="text" value="" label="This will become help text on the form."
60 help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation"> 60 help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation">
61 <sanitizer invalid_char=""> 61 <sanitizer invalid_char="">
62 <valid initial="string.printable"> <remove value='~~~'/> </valid> 62 <valid initial="string.printable"> <remove value='~~~'/> </valid>
63 <mapping initial="none"/> 63 <mapping initial="none"/>
64 </sanitizer> 64 </sanitizer>
83 </repeat> 83 </repeat>
84 </xml> 84 </xml>
85 <xml name="additparam"> 85 <xml name="additparam">
86 <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?" 86 <param name="edit_params" type="select" display="radio" label="Add any additional parameters to the generated tool form so they are user editable?"
87 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"> 87 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">
88 <option value="yes">Yes, allow user to edit all additional parameters on the generated tool form</option> 88 <option value="yes" selected="true">Yes, allow user to edit all additional parameters on the generated tool form</option>
89 <option value="no" selected="true">No - use the fixed values for all additional parameters - no user editing</option> 89 <option value="no">No - use the fixed values for all additional parameters - no user editing</option>
90 </param> 90 </param>
91 91
92 <repeat name="additional_parameters" title="Pass additional parameters to the script" 92 <repeat name="additional_parameters" title="Pass additional parameters to the script"
93 help="See examples below to see how these can be parsed by scripts in the various languages"> 93 help="See examples below to see how these can be parsed by scripts in the various languages">
94 <param name="param_name" type="text" value="parameter_name" label="Choose the name for this parameter"> 94 <param name="param_name" type="text" value="" label="Choose the name for this parameter - MUST not be blank!">
95 <sanitizer invalid_char=""> 95 <sanitizer invalid_char="">
96 <valid initial="string.letters,string.digits"/> 96 <valid initial="string.letters,string.digits"/>
97 <mapping initial="none"/> 97 <mapping initial="none"/>
98 </sanitizer> 98 </sanitizer>
99 </param> 99 </param>
107 <sanitizer invalid_char=""> 107 <sanitizer invalid_char="">
108 <valid initial="string.printable"> <remove value='~~~'/> </valid> 108 <valid initial="string.printable"> <remove value='~~~'/> </valid>
109 <mapping initial="none"/> 109 <mapping initial="none"/>
110 </sanitizer> 110 </sanitizer>
111 </param> 111 </param>
112 <param name="param_label" type="text" value="parameter_label" label="Enter this parameter's label for the form" 112 <param name="param_label" type="text" value="" label="Enter this parameter's label for the form"
113 help="Note that '~~~' is an internal delimiter so must not appear in this text field - please work around this technical limitation" > 113 help="Note that '~~~' is an internal delimiter so must not appear in this text field - please work around this technical limitation" >
114 <sanitizer invalid_char=""> 114 <sanitizer invalid_char="">
115 <valid initial="string.printable"> <remove value='~~~'/> </valid> 115 <valid initial="string.printable"> <remove value='~~~'/> </valid>
116 <mapping initial="none"/> 116 <mapping initial="none"/>
117 </sanitizer> 117 </sanitizer>
118 </param> 118 </param>
119 <param name="param_help" type="text" value="parameter_help" label="Help for this parameter" 119 <param name="param_help" type="text" value="" label="Help for this parameter"
120 help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" > 120 help="Note that three consecutive ~ cannot be used in this text field - please work around this technical limitation" >
121 <sanitizer invalid_char=""> 121 <sanitizer invalid_char="">
122 <valid initial="string.printable"> <remove value='~~~'/> </valid> 122 <valid initial="string.printable"> <remove value='~~~'/> </valid>
123 <mapping initial="none"/> 123 <mapping initial="none"/>
124 </sanitizer> 124 </sanitizer>
132 </macros> 132 </macros>
133 133
134 <requirements> 134 <requirements>
135 <requirement type="package" version="0.72.0" >planemo</requirement> 135 <requirement type="package" version="0.72.0" >planemo</requirement>
136 <requirement type="package" version="0.4.11" >galaxyxml</requirement> 136 <requirement type="package" version="0.4.11" >galaxyxml</requirement>
137
137 </requirements> 138 </requirements>
138 139
139 <command ><![CDATA[ 140 <command ><![CDATA[
140 #import os 141 #import os
141 #set dev_env = os.environ.get('GALAXY_DEVELOPMENT_ENVIRONMENT', '0') == '1' 142 #set dev_env = os.environ.get('GALAXY_DEVELOPMENT_ENVIRONMENT', '0') == '1'
142 #if not $dev_env and ( $__user_email__ not in $__admin_users__ ): 143 #if not $dev_env and ( $__user_email__ not in $__admin_users__ ):
143 python3 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__ 144 python3 $__tool_directory__/rgToolFactory2.py --bad_user $__user_email__
152 #end if 153 #end if
153 #if len(str($cover.test_override)) > 10: 154 #if len(str($cover.test_override)) > 10:
154 --test_override "$testoverride" 155 --test_override "$testoverride"
155 #end if 156 #end if
156 #end if 157 #end if
157 #if $interexe.dependency_model == "managed": 158 --packages "$packages"
158 --packages "$interexe.packages" 159 #if $usescript.choosescript == "yes":
159 #else: 160 --script_path "$runme"
160 --sysexe "$interexe.sysexe" 161 --sysexe "$usescript.scriptrunner"
161 #end if 162 #end if
162 --tool_name="$tool_name" --user_email="$__user_email__" --citations="$citeme" --parampass="$ppass.parampass" 163 --tool_name="$tool_name" --user_email="$__user_email__" --citations="$citeme" --parampass="$ppass.parampass"
163 #if $usescript.choosescript == "yes": 164
164 --script_path "$runme"
165 #end if
166 #if str($makeMode.make_Tool)!="runonly": 165 #if str($makeMode.make_Tool)!="runonly":
167 --make_Tool="$makeMode.make_Tool" 166 --make_Tool="$makeMode.make_Tool"
168 --tool_desc="$makeMode.tool_desc" 167 --tool_desc="$makeMode.tool_desc"
169 --tool_version="$makeMode.tool_version" 168 --tool_version="$makeMode.tool_version"
170 --help_text="$helpme" 169 --help_text="$helpme"
171 --new_tool="$new_tool" 170 --new_tool="$new_tool"
171 --toolshed_api_key="$makeMode.toolshed_apikey"
172 --galaxy_api_key="$makeMode.galaxy_apikey"
173 --toolshed_url="$makeMode.toolshed_url"
174 --galaxy_url="$makeMode.galaxy_url"
172 #end if 175 #end if
173 #if $ppass.parampass != '0': 176 #if $ppass.parampass != '0':
174 #if str($ppass.edit_params) == "yes": 177 #if str($ppass.edit_params) == "yes":
175 --edit_additional_parameters 178 --edit_additional_parameters
176 #end if 179 #end if
182 --input_files="$intab.input_files~~~$intab.input_CL~~~$intab.input_formats~~~$intab.input_label~~~$intab.input_help" 185 --input_files="$intab.input_files~~~$intab.input_CL~~~$intab.input_formats~~~$intab.input_label~~~$intab.input_help"
183 #end for 186 #end for
184 #for $otab in $ppass.history_outputs: 187 #for $otab in $ppass.history_outputs:
185 --output_files "$otab.history_name~~~$otab.history_format~~~$otab.history_CL~~~$otab.history_test" 188 --output_files "$otab.history_name~~~$otab.history_format~~~$otab.history_CL~~~$otab.history_test"
186 #end for 189 #end for
187 --galaxy_root="$__root_dir__" 190 --galaxy_root "$__root_dir__"
188 #end if 191 #end if
189 ]]></command> 192 ]]></command>
190 <configfiles> 193 <configfiles>
191 <configfile name="runme"> 194 <configfile name="runme">
192 $usescript.dynScript 195 $usescript.dynScript
193 </configfile> 196 </configfile>
194 <configfile name="commandoverride"> 197 <configfile name="commandoverride">
195 #if $cover.commover == "yes" and len(str($cover.command_override).strip()) > 1: 198 #if $cover.commover == "yes" and len(str($cover.command_override).strip()) > 1:
196 $cover.command_override 199 $cover.command_override
197 #end if 200 #end if
198 </configfile> 201 </configfile>
199 <configfile name="testoverride"> 202 <configfile name="testoverride">
200 #if $cover.commover == "yes" and len(str($cover.test_override).strip()) > 1: 203 #if $cover.commover == "yes" and len(str($cover.test_override).strip()) > 1:
201 $cover.test_override 204 $cover.test_override
202 #end if 205 #end if
203 </configfile> 206 </configfile>
204 <configfile name="helpme"> 207 <configfile name="helpme">
205 #if $makeMode.make_Tool != "runonly": 208 #if $makeMode.make_Tool != "runonly":
206 ${makeMode.help_text} 209 ${makeMode.help_text}
207 #else 210 #else
208 $tool_name help goes here 211 $tool_name help goes here
229 <valid initial="string.letters,string.digits"> 232 <valid initial="string.letters,string.digits">
230 <add value="_"/> 233 <add value="_"/>
231 </valid> 234 </valid>
232 </sanitizer> 235 </sanitizer>
233 </param> 236 </param>
234 237 <param name="packages" type="text" value="" label="Conda dependencies as package name[:version, name:version...]. These will always be available when this tool executes"
235 <conditional name="interexe"> 238 optional="false" help="Use :[ver] for specific version - 'bwa:0.17.0'. Default is latest. Will be used every time the tool is (re)run. Only Conda is currently supported" />
236 <param name="dependency_model" type="select" label="Dependency model: Conda managed external dependency or existing system executable" 239
237 help = "If managed, the supplied package will become a requirement so must match the tool dependency resolver package name in conda."> 240 <conditional name="usescript">
238 <option value="managed" selected="true" >Use Conda managed dependencies for scripting (python, R,....) or command line packages (bwa,samtools)</option> 241 <param name="choosescript" type="select" display="radio" label="Supply a script to either a dependency (e.g. python/R/bash) or a system executable such as Bash"
239 <option value="system" >Use a non-dependency managed system executable for scripting like bash or command line driven like sed or awk</option> 242 help = "For script interpreters like Python or bash. Parameters and i/o specified below must match script's expectations - if you pass parameters, the script must deal with them">
243 <option value="no" selected="true">No script required for this tool - just pass parameters on the command line to the first dependency listed above</option>
244 <option value="yes">Yes, a script is ready to be pasted below</option>
240 </param> 245 </param>
241 <when value="managed">
242 <param name="packages" type="text" value="" label="Package name[:version, name:version...] for Conda. First (e.g. python) will be called on generated command line"
243 optional="false" help="Use :[ver] for specific version - 'bwa:0.17.0'. Default is latest. Will be used every time the tool is (re)run." />
244 <param name="sysexe" type="hidden" value="" />
245 </when>
246 <when value="system">
247 <param name="sysexe" type="text" value="" label="System executable to run. OS version - not Conda managed" optional="false"
248 help=".e.g bash, awk or other standard and relatively invariant unix utilities"/>
249 <param name="packages" type="hidden" value="" />
250 </when>
251 </conditional>
252 <conditional name="usescript">
253 <param name="choosescript" type="select" display="radio" label="Run a supplied script if the dependency reads one (e.g. python/R/bash)"
254 help = "For script interpreters like Python or bash. Parameters and i/o below must match script's expectations">
255 <option value="no" selected="true">No script required for the first dependency above - just parameters on the command line</option>
256 <option value="yes">Yes, a script is ready to be pasted below for the chosen package</option>
257 </param>
258 <when value="no"> 246 <when value="no">
259 <param name="dynScript" type="hidden" value="" /> 247 <param name="dynScript" type="hidden" value="" />
248 <param name="scriptrunner" type="hidden" value="" />
260 </when> 249 </when>
261 <when value="yes"> 250 <when value="yes">
262 <param name="dynScript" type="text" area="True" value="" label="Script for first dependency above (e.g. python) to interpret. " 251 <param name="scriptrunner" type="text" value="" label="Interpreter for the script pasted below - eg bash or python. Can be one of the dependencies named above or a system executable"
252 help="Scripts are interpreted by the executable named here. Use bash for bash scripts, or a conda dependency such as R or Python for those scripts">
253 <sanitizer invalid_char="">
254 <valid initial="string.letters,string.digits">
255 <add value="_"/>
256 </valid>
257 </sanitizer>
258 </param>
259 <param name="dynScript" type="text" area="True" value="" label="Script for executable below to interpret. It can be one of the Conda dependency names "
263 help="Script must handle all i/o and parameters as specified below using the parameters and passing method chosen below"> 260 help="Script must handle all i/o and parameters as specified below using the parameters and passing method chosen below">
264 <sanitizer> 261 <sanitizer>
265 <valid initial="string.printable"> 262 <valid initial="string.printable">
266 </valid> 263 </valid>
267 <mapping initial="none"/> 264 <mapping initial="none"/>
268 </sanitizer> 265 </sanitizer>
269 </param> 266 </param>
270 </when> 267 </when>
271 </conditional> 268 </conditional>
269
272 <conditional name="ppass"> 270 <conditional name="ppass">
273 <param name="parampass" type="select" display="radio" label="Command line parameter passing method to use"> 271 <param name="parampass" type="select" display="radio" label="Command line parameter passing method to use">
274 <option value="argparse" selected="true">Argparse: passed in the form of --clname value</option> 272 <option value="argparse" selected="true">Argparse: passed in the form of --clname value</option>
275 <option value="positional">Positional: Passed in the order of positional ordinals ...foo.bam bar.idx zot.xls</option> 273 <option value="positional">Positional: Passed in the order of positional ordinals ...foo.bam bar.idx zot.xls</option>
276 <option value="0">Tool reads selected input file from STDIN and writes STDOUT with no parameters</option> 274 <option value="0">Tool reads selected input file from STDIN and writes STDOUT with no parameters</option>
292 <conditional name="cover"> 290 <conditional name="cover">
293 <param name="commover" type="select" display="radio" label="Add Human wrought code to override the generated XML command and/or test section - DIY" 291 <param name="commover" type="select" display="radio" label="Add Human wrought code to override the generated XML command and/or test section - DIY"
294 help = "For arbitrary and artfull command lines. All i/o and parameters must be passed. Choose No unless needed. Not for the faint of heart"> 292 help = "For arbitrary and artfull command lines. All i/o and parameters must be passed. Choose No unless needed. Not for the faint of heart">
295 <option value="no" selected="true">No. Use automatically generated command/test XML </option> 293 <option value="no" selected="true">No. Use automatically generated command/test XML </option>
296 <option value="yes">Yes. XML needed to override autogenerated command and/or test segments will be pasted below</option> 294 <option value="yes">Yes. XML needed to override autogenerated command and/or test segments will be pasted below</option>
297 </param> 295 </param>
298 <when value="no"> 296 <when value="no">
299 <param name="command_override" type="hidden" value="" /> 297 <param name="command_override" type="hidden" value="" />
300 <param name="test_override" type="hidden" value="" /> 298 <param name="test_override" type="hidden" value="" />
301 </when> 299 </when>
302 <when value="yes"> 300 <when value="yes">
313 <sanitizer> 311 <sanitizer>
314 <valid initial="string.printable"> 312 <valid initial="string.printable">
315 </valid> 313 </valid>
316 <mapping initial="none"/> 314 <mapping initial="none"/>
317 </sanitizer> 315 </sanitizer>
318 </param> 316 </param>
319 </when> 317 </when>
320 </conditional> 318 </conditional>
321 319
322 <conditional name="makeMode"> 320 <conditional name="makeMode">
323 <param name="make_Tool" type="select" display="radio" label="Choose the steps you want to run. The TF Docker container is recommended for local installation" 321 <param name="make_Tool" type="select" display="radio" label="Choose the steps you want to run. The TF Docker container is recommended for local installation"
324 help="Testing and installation in this Galaxy are optional" > 322 help="Installation in this Galaxy is optional" >
325 <option value="runonly">Run this configuration in Galaxy (will run Planemo if command or test override in play)</option>
326 <option value="generate">Generate a toolshed ready archive.</option>
327 <option value="gentest" selected="true">Test with planemo after generating.</option> 323 <option value="gentest" selected="true">Test with planemo after generating.</option>
328 <option value="gentestinstall">Install in this Galaxy after generation and testing. Must have local ToolShed as in the TF Docker container</option> 324 <option value="gentestinstall">Install in this Galaxy after generation and testing. Must have local ToolShed as in the TF Docker container</option>
329 </param> 325 </param>
330 <when value="runonly"/> 326 <when value="gentest">
331 <when value="generate"> 327 <param name="galaxy_apikey" value="" type="hidden" ></param>
328 <param name="toolshed_apikey" value="" type="hidden" ></param>
329 <param name="galaxy_url" value="" type="hidden" ></param>
330 <param name="toolshed_url" value="" type="hidden" ></param>
332 <expand macro="tool_metadata" /> 331 <expand macro="tool_metadata" />
333 </when> 332 </when>
334 <when value="gentest">
335 <expand macro="tool_metadata" />
336 </when>
337 <when value="gentestinstall"> 333 <when value="gentestinstall">
334 <param name="galaxy_url" type="text" value="http://localhost:8080" label="URL for the Galaxy server where the new tool should be installed"
335 help="Default is localhost">
336 <sanitizer>
337 <valid initial="string.printable">
338 </valid>
339 <mapping initial="none"/>
340 </sanitizer>
341 </param>
342 <param name="galaxy_apikey" type="text" value="" label="API key for the Galaxy to install the new tool"
343 help="Cut and paste from the admin user properties screen">
344 <sanitizer>
345 <valid initial="string.letters,string.digits">
346 </valid>
347 <mapping initial="none"/>
348 </sanitizer>
349 </param>
350 <param name="toolshed_url" type="text" value="http://localhost:9009" label="URL for the Toolshed where the new tool should be installed"
351 help="Default value is localhost:9009">
352 <sanitizer>
353 <valid initial="string.printable">
354 </valid>
355 <mapping initial="none"/>
356 </sanitizer>
357 </param>
358 <param name="toolshed_apikey" type="text" value="" label="API key for the local toolshed to use when installing the tool"
359 help="Cut and paste from the admin user properties screen">
360 <sanitizer>
361 <valid initial="string.letters,string.digits">
362 </valid>
363 <mapping initial="none"/>
364 </sanitizer>
365 </param>
366
338 <expand macro="tool_metadata" /> 367 <expand macro="tool_metadata" />
339 </when> 368 </when>
340 </conditional> 369 </conditional>
341 370
342 </inputs> 371 </inputs>
370 <param name="history_CL" value="2" /> 399 <param name="history_CL" value="2" />
371 <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,'r').readlines(); o = open(outp,'w'); rs = [''.join(list(reversed(x.rstrip()))) for x in inlist]; o.write('\n'.join(rs)); o.close()"/> 400 <param name="dynScript" value="import sys; inp = sys.argv[1]; outp = sys.argv[2]; inlist = open(inp,'r').readlines(); o = open(outp,'w'); rs = [''.join(list(reversed(x.rstrip()))) for x in inlist]; o.write('\n'.join(rs)); o.close()"/>
372 <param name="choosescript" value="yes" /> 401 <param name="choosescript" value="yes" />
373 <param name="script_path" value="$runme"/> 402 <param name="script_path" value="$runme"/>
374 <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" /> 403 <output name="new_tool" file="toolfactory_pyrevpos_tgz_sample" compare="sim_size" delta="6000" />
404
375 </test> 405 </test>
376 </tests> 406 </tests>
377 <help> 407 <help>
378 408
379 .. class:: warningmark 409 .. class:: warningmark
459 o.write('\n') 489 o.write('\n')
460 o.close() 490 o.close()
461 491
462 492
463 493
464 Paper_ 494 Paper_
465 495
466 *Licensing* 496 *Licensing*
467 497
468 Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012 498 Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
469 All rights reserved. 499 All rights reserved.