Hello Alexander, Thanks very much for your contribution. This was included in change set 3228:6741f6000e03 which is now available in the distribution. On Dec 18, 2009, at 11:02 AM, Alexander Rose wrote:
Hi,
(i'm using current galaxy_dist r3173:f7dee0438854)
when you have a tool in galaxy that creates multiple output datasets, the order in which you define them in the xml file is not preserved in the history.
I believe this is because galaxy collects the output objects in a dict. I made some changes (see the diff below) to use an odict() instead.
However this works only partially, the tool gets executed and the order of the output datasets is preserved, but instead of the message you normally see after executing a tool an error is raised (see below).
I don't know what went wrong and where, I particularly don't understand how the message.mako template works.
Alex
* Error
URL: http://127.0.0.1:8080/tool_runner/index File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ WebError-0.8a-py2.5.egg/weberror/evalexception/middleware.py', line 364 in respond File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Paste-1.6-py2.5.egg/paste/debug/prints.py', line 98 in __call__ environ, self.app) File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Paste-1.6-py2.5.egg/paste/wsgilib.py', line 539 in intercept_output app_iter = application(environ, replacement_start_response) File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Beaker-1.4-py2.5.egg/beaker/middleware.py', line 152 in __call__ File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Paste-1.6-py2.5.egg/paste/recursive.py', line 80 in __call__ return self.application(environ, start_response) File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Paste-1.6-py2.5.egg/paste/httpexceptions.py', line 632 in __call__ return self.application(environ, start_response) File '/Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/web/framework/ base.py', line 125 in __call__ body = self.call_body_method( method, trans, kwargs ) File '/Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/web/framework/ base.py', line 144 in call_body_method return method( trans, **kwargs ) File '/Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/web/ controllers/tool_runner.py', line 59 in index return trans.fill_template( template, history=history, toolbox=toolbox, tool=tool, util=util, add_frame=add_frame, **vars ) File '/Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/web/framework/ __init__.py', line 593 in fill_template return self.fill_template_mako( filename, **kwargs ) File '/Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/web/framework/ __init__.py', line 604 in fill_template_mako return template.render( **data ) File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Mako-0.2.5-py2.5.egg/mako/template.py', line 133 in render File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Mako-0.2.5-py2.5.egg/mako/runtime.py', line 364 in _render File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Mako-0.2.5-py2.5.egg/mako/runtime.py', line 381 in _render_context File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Mako-0.2.5-py2.5.egg/mako/runtime.py', line 414 in _exec_template File '/Users/alexrose/mc-galaxy/galaxy_dist/database/ compiled_templates/base.mako.py', line 37 in render_body __M_writer(unicode(next.body())) File '/Users/alexrose/mc-galaxy/galaxy_dist/eggs/py2.5-noplatform/ Mako-0.2.5-py2.5.egg/mako/runtime.py', line 255 in <lambda> File '/Users/alexrose/mc-galaxy/galaxy_dist/database/ compiled_templates/message.mako.py', line 45 in render_body __M_writer(unicode(_(message))) File '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/gettext.py', line 400 in ugettext tmsg = self._catalog.get(message, missing) TypeError: unhashable instance
* Diff
Index: /Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/tools/ __init__.py --- a/lib/galaxy/tools/__init__.py Wed Dec 16 17:10:05 2009 +0100 +++ b/lib/galaxy/tools/__init__.py Fri Dec 18 16:20:53 2009 +0100 @@ -427,7 +427,7 @@ # Parse tool help self.parse_help( root ) # Description of outputs produced by an invocation of the tool - self.outputs = {} + self.outputs = odict() out_elem = root.find("outputs") if out_elem: for data_elem in out_elem.findall("data"): Index: /Users/alexrose/mc-galaxy/galaxy_dist/lib/galaxy/tools/ actions/__init__.py --- a/lib/galaxy/tools/actions/__init__.py Wed Dec 16 17:10:05 2009 +0100 +++ b/lib/galaxy/tools/actions/__init__.py Fri Dec 18 16:20:53 2009 +0100 @@ -7,6 +7,7 @@ from galaxy.jobs import JOB_OK import galaxy.tools from types import * +from galaxy.util.odict import odict
import logging log = logging.getLogger( __name__ ) @@ -117,7 +118,7 @@ input_values[ input.name ] = galaxy.tools.SelectToolParameterWrapper( input, input_values[ input.name ], tool.app, other_values = incoming ) else: input_values[ input.name ] = galaxy.tools.InputValueWrapper( input, input_values[ input.name ], incoming ) - out_data = {} + out_data = odict() # Collect any input datasets from the incoming parameters inp_data = self.collect_input_datasets( tool, incoming, trans )
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu