Mercurial > repos > fubar > brokenandnotdeletablebyowneroradmin
comparison rgDynamicScriptWrapper.xml @ 0:fda8032fe989
Initial checkin of dynamic script runner. Goal is to add code to generate a new toolshed entry once the script works correctly
| author | ross lazarus ross.lazarus@gmail.com |
|---|---|
| date | Wed, 30 May 2012 22:36:34 +1000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:fda8032fe989 |
|---|---|
| 1 <tool id="rgDynamic1" name="Dynamic Script Runner" version="0.03"> | |
| 2 <description>DIY scripting</description> | |
| 3 <command interpreter="python"> | |
| 4 #if ( $__user_email__ not in ['rlazarus@bakeridi.edu.au','mziemann@bakeridi.edu.au','akaspi@bakeridi.edu.au'] ): | |
| 5 rgDynamicScriptWrapper.py --bad_user $__user_email__ | |
| 6 #else: | |
| 7 rgDynamicScriptWrapper.py --script_path "$runme" --interpreter "$interpreter" | |
| 8 --tool_name "$tool_name" --input_tab "$input1" --user_email "${__user_email__}" | |
| 9 #if $makeHTML.value=="yes": | |
| 10 --output_dir "$html_file.files_path" --output_html "$html_file" | |
| 11 #end if | |
| 12 #if $makeTAB.value=="yes": | |
| 13 --output_tab "$tab_file" | |
| 14 #end if | |
| 15 #end if | |
| 16 </command> | |
| 17 <inputs> | |
| 18 <param name="input1" type="data" format="tabular" label="Select an optional input tabular file from your history" optional="true" | |
| 19 help="Your script probably needs an input - but if not, this can be left unassigned"/> | |
| 20 <param name="tool_name" type="text" value="My dynamic script" size="80" label="Title for job outputs" help="Supply a meaningful name here to remind you what the outputs contain"/> | |
| 21 <param name="makeHTML" type="select" label="Create an HTML output with all script outputs collected together, with thumbnails of new PDF images, the script and a run log file" | |
| 22 help="This is useful for presenting complex outputs and is not needed if your script doesn't create anything other than a single tabular output"> | |
| 23 <option value="yes">Yes</option> | |
| 24 <option value="" selected="true">No</option> | |
| 25 </param> | |
| 26 <param name="makeTAB" type="select" label="Create a new tabular history output" | |
| 27 help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes"> | |
| 28 <option value="yes" selected="true">Yes</option> | |
| 29 <option value="">No</option> | |
| 30 </param> | |
| 31 <param name="interpreter" type="select" label="Select the interpreter for your code. This must be available on the path of the execution host"> | |
| 32 <option value="Rscript" selected="true">Rscript</option> | |
| 33 <option value="python">python</option> | |
| 34 <option value="perl (ugh)">perl</option> | |
| 35 </param> | |
| 36 <param name="dynScript" label="Your Script Goes Here" type="text" value="" area="True" size="8x80" width="80" | |
| 37 help="Expect FIRST CL parameter = the optional input tabular file path (or NONE if not specified). Ensure your script writes tabular output to the path in the SECOND command line parameter it gets."/> | |
| 38 </inputs> | |
| 39 <outputs> | |
| 40 <data format="tabular" name="tab_file" label="${tool_name}.xls"> | |
| 41 <filter> makeTAB=="yes" </filter> | |
| 42 </data> | |
| 43 <data format="html" name="html_file" label="${tool_name}.html"> | |
| 44 <filter> makeHTML=="yes" </filter> | |
| 45 </data> | |
| 46 </outputs> | |
| 47 <configfiles> | |
| 48 <configfile name="runme"> | |
| 49 ${dynScript} | |
| 50 </configfile> | |
| 51 </configfiles> | |
| 52 <help> | |
| 53 **What it does** | |
| 54 This tool enables a user to paste and submit an arbitrary R/python/perl script to run in Galaxy. | |
| 55 This is (extremely) insecure. | |
| 56 | |
| 57 **Restrictions** | |
| 58 This tool will ONLY work if your user id has been added to the local copy's list of permitted users. | |
| 59 Ask your friendly Galaxy administrator to edit this tool's source for you if you need this. | |
| 60 | |
| 61 **Note to system administrators** | |
| 62 Under no circumstances should you allow any user to use this tool unless you really, really trust them to do | |
| 63 no harm. | |
| 64 | |
| 65 **Use on public servers** | |
| 66 is STRONGLY discouraged for obvious reasons | |
| 67 | |
| 68 **Scripting conventions** | |
| 69 The pasted script will be executed. | |
| 70 It will get the path to the (optional) input tabular data file path or NONE if you do not select one | |
| 71 as the first command line parameter | |
| 72 | |
| 73 The script must write it's output as tab delimited text to the path found as the second command line parameter | |
| 74 Note that if an optional HTML output is selected, all the output files spewed by your script will be nicely presented as links to the user. | |
| 75 Any pdf images will automagically be converted to show thumbnails in that output. | |
| 76 This can be handy for complex scripts creating lots of output. | |
| 77 | |
| 78 **Simple Rscript example** | |
| 79 | |
| 80 A simple "filter" that takes an input file, does something and writes the results to a new tabular file might look like this:: | |
| 81 | |
| 82 ourargs = commandArgs(TRUE) | |
| 83 inf = ourargs[1] | |
| 84 outf = ourargs[2] | |
| 85 inp = read.table(inf,head=F,row.names=NULL,sep='\t') | |
| 86 inp[,5] = runif ( nrow(inp) ) | |
| 87 write.table(inp,outf, quote=FALSE, sep="\t",row.names=F,col.names=F) | |
| 88 | |
| 89 | |
| 90 </help> | |
| 91 | |
| 92 </tool> | |
| 93 | |
| 94 |
