1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/2cd1bacf5e04/
changeset: 2cd1bacf5e04
user: greg
date: 2012-03-12 15:20:56
summary: Handle tool versions with job reruns.
affected #: 3 files
diff -r e1c0cd5ed76766e4bf18f5342bf6cd395fca4732 -r 2cd1bacf5e0463bd804bf5fc7ac79a3ddf142937 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -241,7 +241,7 @@
os.close( fd )
shutil.move( filename, os.path.abspath( self.integrated_tool_panel_config ) )
os.chmod( self.integrated_tool_panel_config, 0644 )
- def get_tool( self, tool_id, tool_version=None ):
+ def get_tool( self, tool_id, tool_version=None, get_all_versions=False ):
"""Attempt to locate a tool in the tool box."""
if tool_id in self.tools_by_id:
tool = self.tools_by_id[ tool_id ]
@@ -252,6 +252,12 @@
tv = self.__get_tool_version( tool_id )
if tv:
tool_version_ids = tv.get_version_ids( self.app )
+ if get_all_versions:
+ available_tool_versions = []
+ for tool_version_id in tool_version_ids:
+ if tool_version_id in self.tools_by_id:
+ available_tool_versions.append( self.tools_by_id[ tool_version_id ] )
+ return available_tool_versions
for tool_version_id in tool_version_ids:
if tool_version_id in self.tools_by_id:
tool = self.tools_by_id[ tool_version_id ]
diff -r e1c0cd5ed76766e4bf18f5342bf6cd395fca4732 -r 2cd1bacf5e0463bd804bf5fc7ac79a3ddf142937 lib/galaxy/web/controllers/tool_runner.py
--- a/lib/galaxy/web/controllers/tool_runner.py
+++ b/lib/galaxy/web/controllers/tool_runner.py
@@ -109,16 +109,49 @@
raise Exception("Failed to get job information for dataset hid %d" % data.hid)
# Get the tool object
tool_id = job.tool_id
+ tool_version = job.tool_version
try:
# Load the tool
toolbox = self.get_toolbox()
- tool = toolbox.get_tool( tool_id )
+ tools = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=True )
+ if len( tools ) > 1:
+ tool_id_select_field = self.build_tool_id_select_field( tools, tool_id )
+ for tool in tools:
+ if tool.id == tool_id:
+ break
+ else:
+ tool = tools[ 0 ]
+ tool_id_version_message = 'This job was initially run with tool id "%s", version "%s", and multiple derivations ' % ( job.tool_id, job.tool_version )
+ tool_id_version_message += 'of this tool are available. Rerun the job with the selected tool or choose another derivation of the tool.'
+ else:
+ tool_id_select_field = None
+ tool = tools[ 0 ]
+ if tool.id == job.tool_id and tool.version == job.tool_version:
+ tool_id_version_message = ''
+ elif tool.id == job.tool_id:
+ if job.tool_version == None:
+ # For some reason jobs don't always keep track of the tool version.
+ tool_id_version_message = ''
+ else:
+ if len( tools ) > 1:
+ tool_id_version_message = 'This job was initially run with tool version "%s", which is not currently available. ' % job.tool_version
+ tool_id_version_message += 'You can rerun the job with the selected tool or choose another derivation of the tool.'
+ else:
+ tool_id_version_message = 'This job was initially run with tool version "%s", which is not currently available. ' % job.tool_version
+ tool_id_version_message += 'You can rerun the job with this tool version, which is a derivation of the original tool.'
+ else:
+ if len( tools ) > 1:
+ tool_id_version_message = 'This job was initially run with tool version "%s", which is not currently available. ' % job.tool_version
+ tool_id_version_message += 'You can rerun the job with the selected tool or choose another derivation of the tool.'
+ else:
+ tool_id_version_message = 'This job was initially run with tool id "%s", version "%s", which is not ' % ( job.tool_id, job.tool_version )
+ tool_id_version_message += 'currently available. You can rerun the job with this tool, which is a derivation of the original tool.'
assert tool is not None, 'Requested tool has not been loaded.'
except:
- #this is expected, so not an exception
+ # This is expected so not an exception.
+ tool_id_version_message = ''
error( "This dataset was created by an obsolete tool (%s). Can't re-run." % tool_id )
- # Can't rerun upload, external data sources, et cetera. Workflow
- # compatible will proxy this for now
+ # Can't rerun upload, external data sources, et cetera. Workflow compatible will proxy this for now
if not tool.is_workflow_compatible:
error( "The '%s' tool does not currently support rerunning." % tool.name )
# Get the job's parameters
@@ -163,7 +196,30 @@
if from_noframe is not None:
add_frame.wiki_url = trans.app.config.wiki_url
add_frame.from_noframe = True
- return trans.fill_template( "tool_form.mako", history=history, toolbox=toolbox, tool=tool, util=util, add_frame=add_frame, **vars )
+ return trans.fill_template( "tool_form.mako",
+ history=history,
+ toolbox=toolbox,
+ tool_id_select_field=tool_id_select_field,
+ tool=tool,
+ util=util,
+ add_frame=add_frame,
+ tool_id_version_message=tool_id_version_message,
+ **vars )
+ def build_tool_id_select_field( self, tools, selected_tool_id ):
+ """Build a SelectField whose options are the ids for the received list of tools."""
+ options = []
+ refresh_on_change_values = []
+ for tool in tools:
+ options.append( ( tool.id, tool.id ) )
+ refresh_on_change_values.append( tool.id )
+ select_field = SelectField( name='tool_id', refresh_on_change=True, refresh_on_change_values=refresh_on_change_values )
+ for option_tup in options:
+ selected = option_tup[0] == selected_tool_id
+ if selected:
+ select_field.add_option( option_tup[0], option_tup[1], selected=True )
+ else:
+ select_field.add_option( option_tup[0], option_tup[1] )
+ return select_field
@web.expose
def redirect( self, trans, redirect_url=None, **kwd ):
if not redirect_url:
@@ -251,7 +307,6 @@
datasets.append( create_dataset( 'Pasted Entry' ) )
break
return [ d.id for d in datasets ]
-
@web.expose
def upload_async_message( self, trans, **kwd ):
# might be more appropriate in a different controller
diff -r e1c0cd5ed76766e4bf18f5342bf6cd395fca4732 -r 2cd1bacf5e0463bd804bf5fc7ac79a3ddf142937 templates/tool_form.mako
--- a/templates/tool_form.mako
+++ b/templates/tool_form.mako
@@ -1,4 +1,5 @@
<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" /><%namespace file="/base_panels.mako" import="overlay" /><%def name="stylesheets()">
@@ -274,10 +275,11 @@
assert len(tool.action) == 2
tool_url = tool.action[0] + h.url_for(tool.action[1])
%>
-%if message:
- <div class="errormessage">${message}</div>
- <br/>
+
+%if tool_id_version_message:
+ ${render_msg( tool_id_version_message, 'error' )}
%endif
+
<div class="toolForm" id="${tool.id}">
%if tool.has_multiple_pages:
<div class="toolFormTitle">${tool.name} (step ${tool_state.page+1} of ${tool.npages})</div>
@@ -286,7 +288,18 @@
%endif
<div class="toolFormBody"><form id="tool_form" name="tool_form" action="${tool_url}" enctype="${tool.enctype}" target="${tool.target}" method="${tool.method}">
- <input type="hidden" name="tool_id" value="${tool.id}">
+ %if tool_id_select_field:
+ <div class="form-row">
+ <label>Tool id:</label>
+ ${tool_id_select_field.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ Select a different derivation of this tool to rerun the job.
+ </div>
+ </div>
+ <div style="clear: both"></div>
+ %else:
+ <input type="hidden" name="tool_id" value="${tool.id}">
+ %endif
<input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
%if tool.display_by_page[tool_state.page]:
${trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) )}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/e1c0cd5ed767/
changeset: e1c0cd5ed767
user: jgoecks
date: 2012-03-09 22:11:21
summary: Clean up temp files.
affected #: 1 file
diff -r 3c32b4a448c6d042d39eb2225ddfe2476a18de0f -r e1c0cd5ed76766e4bf18f5342bf6cd395fca4732 tools/extract/extract_genomic_dna.py
--- a/tools/extract/extract_genomic_dna.py
+++ b/tools/extract/extract_genomic_dna.py
@@ -279,5 +279,10 @@
if skipped_lines:
# Error message includes up to the first 10 skipped lines.
print 'Skipped %d invalid lines, 1st is #%d, "%s"' % ( skipped_lines, first_invalid_line, '\n'.join( invalid_lines[:10] ) )
+
+ # Clean up temp file.
+ if fasta_file:
+ os.remove( seq_path )
+ os.remove( tmp_name )
if __name__ == "__main__": __main__()
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/3c32b4a448c6/
changeset: 3c32b4a448c6
user: dannon
date: 2012-03-08 20:05:40
summary: Workflows: Add run workflow directly to the editor's menu.
affected #: 1 file
diff -r 796d08ce13d092321a1c629fcb66ea225676da99 -r 3c32b4a448c6d042d39eb2225ddfe2476a18de0f templates/workflow/editor.mako
--- a/templates/workflow/editor.mako
+++ b/templates/workflow/editor.mako
@@ -236,6 +236,9 @@
make_popupmenu( $("#workflow-options-button"), {
"Save" : save_current_workflow,
+ "Run": function() {
+ window.location = "${h.url_for( controller='root', action='index', workflow_id=trans.security.encode_id(stored.id))}";
+ },
##"Create New" : create_new_workflow_dialog,
"Edit Attributes" : edit_workflow_attributes,
##"Edit Workflow Outputs": edit_workflow_outputs,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/91a437977be1/
changeset: 91a437977be1
user: jgoecks
date: 2012-03-08 17:09:14
summary: Enable fasta_to_len conversion to use only first word in title; this is standards compliant and used by default for automatic conversion.
affected #: 2 files
diff -r 5ffd9f8983538741cf0597e6e61ccc70256ad585 -r 91a437977be1b1ae6eabd510e553f86f86f74ac0 lib/galaxy/datatypes/converters/fasta_to_len.py
--- a/lib/galaxy/datatypes/converters/fasta_to_len.py
+++ b/lib/galaxy/datatypes/converters/fasta_to_len.py
@@ -9,7 +9,7 @@
assert sys.version_info[:2] >= ( 2, 4 )
-def compute_fasta_length( fasta_file, out_file, keep_first_char ):
+def compute_fasta_length( fasta_file, out_file, keep_first_char, keep_first_word=False ):
infile = fasta_file
out = open( out_file, 'w')
@@ -32,6 +32,8 @@
continue
if line[0] == '>':
if first_entry == False:
+ if keep_first_word:
+ fasta_title = fasta_title.split()[0]
out.write( "%s\t%d\n" % ( fasta_title[ 1:keep_first_char ], seq_len ) )
else:
first_entry = False
@@ -41,8 +43,10 @@
seq_len += len(line)
# last fasta-entry
+ if keep_first_word:
+ fasta_title = fasta_title.split()[0]
out.write( "%s\t%d\n" % ( fasta_title[ 1:keep_first_char ], seq_len ) )
out.close()
-if __name__ == "__main__" :
- compute_fasta_length( sys.argv[1], sys.argv[2], sys.argv[3] )
\ No newline at end of file
+if __name__ == "__main__" :
+ compute_fasta_length( sys.argv[1], sys.argv[2], sys.argv[3], True )
\ No newline at end of file
diff -r 5ffd9f8983538741cf0597e6e61ccc70256ad585 -r 91a437977be1b1ae6eabd510e553f86f86f74ac0 tools/fasta_tools/fasta_compute_length.py
--- a/tools/fasta_tools/fasta_compute_length.py
+++ b/tools/fasta_tools/fasta_compute_length.py
@@ -6,4 +6,4 @@
import sys
from galaxy.datatypes.converters.fasta_to_len import compute_fasta_length
-compute_fasta_length( sys.argv[1], sys.argv[2], sys.argv[3])
\ No newline at end of file
+compute_fasta_length( sys.argv[1], sys.argv[2], sys.argv[3], False )
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/04ff82b2ce0c/
changeset: 04ff82b2ce0c
user: jgoecks
date: 2012-03-08 14:37:20
summary: Add necessary space after threads option in Cuffmerge.
affected #: 1 file
diff -r 40f1816d685794f4a2ddb139ca25803f2da9b0de -r 04ff82b2ce0c9e4788e87691ef871c078b47a424 tools/ngs_rna/cuffmerge_wrapper.py
--- a/tools/ngs_rna/cuffmerge_wrapper.py
+++ b/tools/ngs_rna/cuffmerge_wrapper.py
@@ -82,7 +82,7 @@
# Add options.
if options.num_threads:
- cmd += ( " -p %i" % int ( options.num_threads ) )
+ cmd += ( " -p %i " % int ( options.num_threads ) )
if options.ref_annotation:
cmd += " -g %s " % options.ref_annotation
if options.use_seq_data:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/40f1816d6857/
changeset: 40f1816d6857
user: greg
date: 2012-03-07 19:35:34
summary: Fix for populating the tool panel and generating the integrated_tool_panel.xml file.
affected #: 1 file
diff -r 1d73ef1ce3cd9040a808511c0f69ae04a514d635 -r 40f1816d685794f4a2ddb139ca25803f2da9b0de lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -72,6 +72,13 @@
self.init_tools( config_filename )
except:
log.exception( "Error loading tools defined in config %s", config_filename )
+ if self.integrated_tool_panel_config_has_contents:
+ # Load self.tool_panel based on the order in self.integrated_tool_panel.
+ self.load_tool_panel()
+ # Always write the current in-memory integrated_tool_panel to the integrated_tool_panel.xml file.
+ # This will cover cases where the Galaxy administrator manually edited one or more of the tool panel
+ # config files, adding or removing locally developed tools or workflows.
+ self.write_integrated_tool_panel_config_file()
def init_tools( self, config_filename ):
"""
Read the configuration file and load each tool. The following tags are currently supported:
@@ -121,13 +128,6 @@
tool_path=tool_path,
config_elems=config_elems )
self.shed_tool_confs.append( shed_tool_conf_dict )
- if self.integrated_tool_panel_config_has_contents:
- # Load self.tool_panel based on the order in self.integrated_tool_panel.
- self.load_tool_panel()
- # Always write the current in-memory integrated_tool_panel to the integrated_tool_panel.xml file.
- # This will cover cases where the Galaxy administrator manually edited one or more of the tool panel
- # config files, adding or removing locally developed tools or workflows.
- self.write_integrated_tool_panel_config_file()
def load_tool_panel( self ):
for key, val in self.integrated_tool_panel.items():
if key.startswith( 'tool_' ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.