# HG changeset patch # User fubar # Date 1409291444 14400 # Node ID 8d28e32c71ff6982dde394c324cae0b318dc0a4d # Parent 8603867451d8cbfc6cd29c14bf787fd692d3b15a Uploaded diff -r 8603867451d8 -r 8d28e32c71ff README.txt --- a/README.txt Thu Aug 28 06:18:31 2014 -0400 +++ b/README.txt Fri Aug 29 01:50:44 2014 -0400 @@ -16,6 +16,14 @@ freeze the supplied script into a new, ordinary Galaxy tool that runs it over a single input file, working just like any other Galaxy tool for your users. +If you use the Html output option, please ensure that sanitize_all_html is set to False and +uncommented in universe_wsgi.ini - it should show: + +# By default, all tool output served as 'text/html' will be sanitized +sanitize_all_html = False + +*More Detail* + To use the ToolFactory, you should have prepared a script to paste into a text box, and a small test input example ready to select from your history to test your new script. There is an example in each scripting language on the Tool Factory form. You can just @@ -40,31 +48,6 @@ Tool factory tools are perfect for workflow components. One input, one output, no variables. -*Reasons to read further* - -If you use Galaxy to support your research; - -You and fellow users are sometimes forced to take data out of Galaxy, process it with ugly -little perl/awk/sed/R... scripts and put it back; - -You do this when you can't do some transformation in Galaxy (the 90/10 rule); - -You don't have enough developer resources for wrapping dozens of even relatively simple tools; - -Your research and your institution would be far better off if those feral scripts were all tucked -safely in your local toolshed and Galaxy histories. - -*The good news* If it can be trivially scripted, it can be running safely in your -local Galaxy via your own local toolshed in a few minutes - with functional tests. - - -*Value proposition* The ToolFactory allows Galaxy to efficiently take over most of your lab's -dark script matter, making it reproducible in Galaxy and shareable through the ToolShed. - -That's what this tool does. You paste a simple script and the tool returns -a new, real Galaxy tool, ready to be installed from the local toolshed to local servers. -Scripts can be wrapped and online literally within minutes. - *To fully and safely exploit the awesome power* of this tool, Galaxy and the ToolShed, you should be a developer installing this tool on a private/personal/scratch local instance where you are an admin_user. Then, if you break it, you get to keep all the pieces @@ -72,9 +55,10 @@ ** Installation ** This is a Galaxy tool. You can install it most conveniently using the administrative "Search and browse tool sheds" link. -Find the Galaxy Test toolshed (not main) and search for the toolfactory repository. +Find the Galaxy Main toolshed at https://toolshed.g2.bx.psu.edu/ and search for the toolfactory repository. Open it and review the code and select the option to install it. +( If you can't get the tool that way, the xml and py files here need to be copied into a new tools subdirectory such as tools/toolfactory Your tool_conf.xml needs a new entry pointing to the xml file - something like:: @@ -85,11 +69,8 @@ If not already there (I just added it to datatypes_conf.xml.sample), please add: -to your local data_types_conf.xml. - -Ensure that html sanitization is set to False and uncommented in universe_wsgi.ini - -You'll have to restart the server for the new tool to be available. +to your local data_types_conf.xml. +) Of course, R, python, perl etc are needed on your path if you want to test scripts using those interpreters. Adding new ones to this tool code should be easy enough. Please make suggestions as bitbucket issues and code. @@ -137,18 +118,6 @@ Patches and suggestions welcome as bitbucket issues please? -long route to June 2012 product -derived from an integrated script model -called rgBaseScriptWrapper.py -Note to the unwary: - This tool allows arbitrary scripting on your Galaxy as the Galaxy user - There is nothing stopping a malicious user doing whatever they choose - Extremely dangerous!! - Totally insecure. So, trusted users only - - - - copyright ross lazarus (ross stop lazarus at gmail stop com) May 2012 all rights reserved diff -r 8603867451d8 -r 8d28e32c71ff rgToolFactory.py --- a/rgToolFactory.py Thu Aug 28 06:18:31 2014 -0400 +++ b/rgToolFactory.py Fri Aug 29 01:50:44 2014 -0400 @@ -7,6 +7,10 @@ # Licensed under the LGPL # suggestions for improvement and bug fixes welcome at https://bitbucket.org/fubar/galaxytoolfactory/wiki/Home # +# August 2014 +# merged John Chilton's citation addition and ideas from Marius van den Beek to enable arbitrary +# data types for input and output - thanks! +# # march 2014 # had to remove dependencies because cross toolshed dependencies are not possible - can't pre-specify a toolshed url for graphicsmagick and ghostscript # grrrrr - night before a demo @@ -197,8 +201,8 @@ a('-') # stdin a(opts.input_tab) a(opts.output_tab) - self.outFormats = 'tabular' # TODO make this an option at tool generation time - self.inputFormats = 'tabular,txt' # TODO make this an option at tool generation time + self.outputFormat = self.opts.output_format + self.inputFormats = self.opts.input_formats self.test1Input = '%s_test1_input.xls' % self.toolname self.test1Output = '%s_test1_output.xls' % self.toolname self.test1HTML = '%s_test1_output.html' % self.toolname @@ -290,17 +294,17 @@ tooltestsTabOnly = """ - + - + """ tooltestsHTMLOnly = """ - + @@ -309,15 +313,17 @@ """ tooltestsBoth = """ - + - + """ xdict = {} + xdict['outputFormat'] = self.outputFormat + xdict['inputFormats'] = self.inputFormats xdict['requirements'] = '' if self.opts.make_HTML: if self.opts.include_dependencies == "yes": @@ -383,7 +389,7 @@ xdict['command_outputs'] += ' --output_dir "./"' if self.opts.output_tab <> 'None': xdict['command_outputs'] += ' --output_tab "$tab_file"' - xdict['outputs'] += ' \n' % self.outFormats + xdict['outputs'] += ' \n' % self.outputFormat xdict['command'] = newCommand % xdict xmls = newXML % xdict xf = open(self.xmlfile,'w') @@ -693,7 +699,9 @@ a('--output_dir',default='./') a('--output_html',default=None) a('--input_tab',default="None") + a('--input_formats',default="tabular,text") a('--output_tab',default="None") + a('--output_format',default="tabular") a('--user_email',default='Unknown') a('--bad_user',default=None) a('--make_Tool',default=None) diff -r 8603867451d8 -r 8d28e32c71ff rgToolFactory.xml --- a/rgToolFactory.xml Thu Aug 28 06:18:31 2014 -0400 +++ b/rgToolFactory.xml Fri Aug 29 01:50:44 2014 -0400 @@ -12,6 +12,7 @@ --tool_name "$tool_name" --user_email "$__user_email__" #if $make_TAB.value=="yes": --output_tab "$tab_file" + --output_format "$output_format" #end if #if $makeMode.make_Tool=="yes": --make_Tool "$makeMode.make_Tool" @@ -33,12 +34,19 @@ #end if #if $input1 != 'None': --input_tab "$input1" + --input_formats "$input_formats" #end if #end if + + + + + @@ -80,8 +88,8 @@ help="Supply a DOI (e.g. 10.1111/j.1740-9713.2007.00258.x) that should be cited when this tool is used in published research." /> - + @@ -105,7 +113,8 @@ - + @@ -114,6 +123,7 @@ + - + make_TAB == "yes" -