Mercurial > repos > fubar > brokenandnotdeletablebyowneroradmin
comparison rgToolFactory.xml @ 7:7221619caefa
Updated name and added crude gzip generator for toolshed
TODO: add tests and new XML tool descriptor as soon as Greg has it nailed down.
| author | ross lazarus ross.lazarus@gmail.com |
|---|---|
| date | Sat, 02 Jun 2012 10:43:08 +1000 |
| parents | |
| children | 220885b2d7ee |
comparison
equal
deleted
inserted
replaced
| 6:78044a3d4a21 | 7:7221619caefa |
|---|---|
| 1 <tool id="rgTF" name="Tool Factory" version="0.04"> | |
| 2 <description>Makes scripts into tools</description> | |
| 3 <command interpreter="python"> | |
| 4 #if ( $__user_email__ not in ['ross.lazarus@gmail.com',] ): | |
| 5 rgToolFactory.py --bad_user $__user_email__ | |
| 6 #else: | |
| 7 rgToolFactory.py --script_path "$runme" --interpreter "$interpreter" | |
| 8 --tool_name "$tool_name" --input_tab "$input1" --user_email "${__user_email__}" | |
| 9 #if $makeHTML.value=="yes" or $makeTool.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 #if $makeTool.value=="yes": | |
| 16 --makeTool "$makeTool" | |
| 17 #end if | |
| 18 #end if | |
| 19 </command> | |
| 20 <inputs> | |
| 21 <param name="input1" type="data" format="tabular" label="Select an optional input tabular file from your history" optional="true" | |
| 22 help="Your script probably needs an input - but if not, this can be left unassigned"/> | |
| 23 <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"/> | |
| 24 <param name="makeTool" type="select" label="Create a tar.gz file ready for local toolshed entry" | |
| 25 help="Ready to deploy securely! with tests eventually"> | |
| 26 <option value="yes">Yes</option> | |
| 27 <option value="" selected="true">Not yet, it's still broken</option> | |
| 28 </param> | |
| 29 <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" | |
| 30 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"> | |
| 31 <option value="yes">Yes</option> | |
| 32 <option value="" selected="true">No</option> | |
| 33 </param> | |
| 34 <param name="makeTAB" type="select" label="Create a new tabular history output" | |
| 35 help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes"> | |
| 36 <option value="yes" selected="true">Yes</option> | |
| 37 <option value="">No</option> | |
| 38 </param> | |
| 39 <param name="interpreter" type="select" label="Select the interpreter for your code. This must be available on the path of the execution host"> | |
| 40 <option value="Rscript" selected="true">Rscript</option> | |
| 41 <option value="python">python</option> | |
| 42 <option value="perl (ugh)">perl</option> | |
| 43 </param> | |
| 44 <param name="dynScript" label="Your Script Goes Here" type="text" value="" area="True" size="8x80" width="80" | |
| 45 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."/> | |
| 46 </inputs> | |
| 47 <outputs> | |
| 48 <data format="tabular" name="tab_file" label="${tool_name}.xls"> | |
| 49 <filter> makeTAB=="yes" </filter> | |
| 50 </data> | |
| 51 <data format="html" name="html_file" label="${tool_name}.html"> | |
| 52 <filter> makeHTML=="yes" or makeTool=="yes"</filter> | |
| 53 </data> | |
| 54 </outputs> | |
| 55 <configfiles> | |
| 56 <configfile name="runme"> | |
| 57 ${dynScript} | |
| 58 </configfile> | |
| 59 </configfiles> | |
| 60 <help> | |
| 61 **What it does** | |
| 62 This tool enables a user to paste and submit an arbitrary R/python/perl script to run in Galaxy. | |
| 63 This is (extremely) insecure. | |
| 64 | |
| 65 **Restrictions** | |
| 66 This tool will ONLY work if your user id has been added to the local copy's list of permitted users. | |
| 67 Ask your friendly Galaxy administrator to edit this tool's source for you if you need this. | |
| 68 | |
| 69 **Note to system administrators** | |
| 70 Under no circumstances should you allow any user to use this tool unless you really, really trust them to do | |
| 71 no harm. | |
| 72 | |
| 73 **Use on public servers** | |
| 74 is STRONGLY discouraged for obvious reasons | |
| 75 | |
| 76 **Scripting conventions** | |
| 77 The pasted script will be executed. | |
| 78 It will get the path to the (optional) input tabular data file path or NONE if you do not select one | |
| 79 as the first command line parameter | |
| 80 | |
| 81 The script must write it's output as tab delimited text to the path found as the second command line parameter | |
| 82 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. | |
| 83 Any pdf images will automagically be converted to show thumbnails in that output. | |
| 84 This can be handy for complex scripts creating lots of output. | |
| 85 | |
| 86 **Simple Rscript example** | |
| 87 | |
| 88 A simple "filter" that takes an input file, does something and writes the results to a new tabular file might look like this:: | |
| 89 | |
| 90 ourargs = commandArgs(TRUE) | |
| 91 inf = ourargs[1] | |
| 92 outf = ourargs[2] | |
| 93 inp = read.table(inf,head=F,row.names=NULL,sep='\t') | |
| 94 outp = t(inp) | |
| 95 write.table(outp,outf, quote=FALSE, sep="\t",row.names=F,col.names=F) | |
| 96 | |
| 97 </help> | |
| 98 | |
| 99 </tool> | |
| 100 | |
| 101 |
