Mercurial > repos > fubar > brokenandnotdeletablebyowneroradmin
view rgToolFactory.xml @ 8:220885b2d7ee
End to end test works. Add tests next
author | ross lazarus ross.lazarus@gmail.com |
---|---|
date | Sat, 02 Jun 2012 20:02:11 +1000 |
parents | 7221619caefa |
children | e09c76551bed |
line wrap: on
line source
<tool id="rgTF" name="Tool Factory" version="0.04"> <description>Makes scripts into tools</description> <command interpreter="python"> #if ( $__user_email__ not in ['ross.lazarus@gmail.com',] ): rgToolFactory.py --bad_user $__user_email__ #else: rgToolFactory.py --script_path "$runme" --interpreter "$interpreter" --tool_name "$tool_name" --input_tab "$input1" #if $make_HTML.value=="yes" or $factory.make_Tool=="yes": --output_dir "$html_file.files_path" --output_html "$html_file" #end if #if $make_HTML.value=="yes": --make_HTML "yes" #end if #if $make_TAB.value=="yes": --output_tab "$tab_file" #end if #if $factory.make_Tool=="yes": --make_Tool "$factory.make_Tool" --help_text "$helpme" --tool_desc "$factory.tool_desc" #end if #end if </command> <inputs> <param name="input1" type="data" format="tabular" label="Select an optional input tabular file from your history" optional="true" help="Your script probably needs an input - but if not, this can be left unassigned"/> <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"/> <conditional name="factory"> <param name="make_Tool" type="select" label="Create a tar.gz file ready for local toolshed entry" help="Ready to deploy securely!"> <option value="yes">Yes</option> <option value="" selected="true">Not yet, it's still broken</option> </param> <when value = "yes"> <param name="tool_desc" type="text" width="120" value="" help="Supply a brief tool description for the Galaxy tool menu entry (optional - appears after the tool name)" /> <param name="help_text" type="text" area="true" size="8x80" width="120" value="**What it Does**" help="Supply the brief user documentation to appear on the new tool form as reStructured text" > <sanitizer> <valid initial="string.printable"> </valid> <mapping initial="none"/> </sanitizer> </param> </when> </conditional> <param name="make_HTML" 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" 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"> <option value="yes">Yes</option> <option value="" selected="true">No</option> </param> <param name="make_TAB" type="select" label="Create a new tabular history output" help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes"> <option value="yes" selected="true">Yes</option> <option value="">No</option> </param> <param name="interpreter" type="select" label="Select the interpreter for your code. This must be available on the path of the execution host"> <option value="Rscript" selected="true">Rscript</option> <option value="python">python</option> <option value="perl (ugh)">perl</option> </param> <param name="dynScript" label="Your Script Goes Here" type="text" value="" area="True" size="8x80" width="80" 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."> <sanitizer> <valid initial="string.printable"> </valid> <mapping initial="none"/> </sanitizer> </param> </inputs> <outputs> <data format="tabular" name="tab_file" label="${tool_name}.xls"> <filter> make_TAB=="yes" </filter> </data> <data format="html" name="html_file" label="${tool_name}.html"> <filter> make_HTML=="yes" or make_Tool=="yes"</filter> </data> </outputs> <configfiles> <configfile name="runme"> ${dynScript} </configfile> #if $factory.make_Tool == "yes": <configfile name="helpme"> $factory.help_text </configfile> #end if </configfiles> <help> **What it does** This tool enables a user to paste and submit an arbitrary R/python/perl script to run in Galaxy. This is (extremely) insecure. **Restrictions** This tool will ONLY work if your user id has been added to the local copy's list of permitted users. Ask your friendly Galaxy administrator to edit this tool's source for you if you need this. **Note to system administrators** Under no circumstances should you allow any user to use this tool unless you really, really trust them to do no harm. **Use on public servers** is STRONGLY discouraged for obvious reasons **Scripting conventions** The pasted script will be executed. It will get the path to the (optional) input tabular data file path or NONE if you do not select one as the first command line parameter The script must write it's output as tab delimited text to the path found as the second command line parameter 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. Any pdf images will automagically be converted to show thumbnails in that output. This can be handy for complex scripts creating lots of output. **Simple Rscript example** A simple "filter" that takes an input file, does something and writes the results to a new tabular file might look like this:: ourargs = commandArgs(TRUE) inf = ourargs[1] outf = ourargs[2] inp = read.table(inf,head=F,row.names=NULL,sep='\t') outp = t(inp) write.table(outp,outf, quote=FALSE, sep="\t",row.names=F,col.names=F) </help> </tool>