mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Add a new <data_type_translation> tag set to data_source tools that enable the translation of an unsupported data type to a supported one in Galaxy ( currently only used in UCSC ). Also some tweaks to the jobs reports.
This commit is contained in:
@@ -242,6 +242,19 @@ class Tool:
|
||||
remote_name = req_param.get( "remote_name" )
|
||||
trans_list.append( req_param.get( "galaxy_name" ) )
|
||||
trans_list.append( req_param.get( "missing" ) )
|
||||
if req_param.get( "galaxy_name" ) == "data_type":
|
||||
# The req_param tag for data_type is special in that it can contain another tag set like
|
||||
# <data_type_translation>
|
||||
# <format galaxy_format="tabular" remote_format="selectedFields" />
|
||||
# </data_type_translation>
|
||||
format_trans = req_param.find( "data_type_translation" )
|
||||
if format_trans is not None:
|
||||
format_trans_dict = {}
|
||||
for format in format_trans.findall( "format" ):
|
||||
remote_format = format.get( "remote_format" )
|
||||
galaxy_format = format.get( "galaxy_format" )
|
||||
format_trans_dict[ remote_format ] = galaxy_format
|
||||
trans_list.append( format_trans_dict )
|
||||
self.param_trans_dict[ remote_name ] = trans_list
|
||||
# Command line (template). Optional for tools that do not invoke a local program
|
||||
command = root.find("command")
|
||||
|
||||
@@ -155,7 +155,17 @@ class Params:
|
||||
if tool and tool.tool_type == 'data_source':
|
||||
if key in tool.param_trans_dict:
|
||||
new_key = tool.param_trans_dict[ key ][0]
|
||||
if not value:
|
||||
if new_key == 'data_type':
|
||||
try:
|
||||
# The Galaxy "data_type entry is special in that it can include the ability
|
||||
# to translate the format to a Galaxy supported format. In the dict, this entry
|
||||
# looks something like: {'hgta_outputType': ['data_type', 'bed', {'selectedFields': 'tabular'}] }
|
||||
format_trans_dict = tool.param_trans_dict[ key ][2]
|
||||
if value in format_trans_dict:
|
||||
new_value = format_trans_dict[ value ]
|
||||
except:
|
||||
pass
|
||||
if not value and not new_value:
|
||||
new_value = tool.param_trans_dict[ key ][1]
|
||||
if key not in self.NEVER_SANITIZE and sanitize:
|
||||
self.__dict__[ new_key ] = sanitize_param( new_value )
|
||||
|
||||
@@ -91,8 +91,7 @@ class Jobs( BaseController ):
|
||||
year_label = start_date.strftime( "%Y" )
|
||||
q = sa.select( ( sa.func.date( galaxy.model.Job.table.c.create_time ).label( 'date' ),
|
||||
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
|
||||
whereclause = sa.and_( sa.or_( galaxy.model.Job.table.c.state == 'error',
|
||||
galaxy.model.Job.table.c.state == 'deleted' ),
|
||||
whereclause = sa.and_( galaxy.model.Job.table.c.state == 'error',
|
||||
galaxy.model.Job.table.c.create_time >= start_date,
|
||||
galaxy.model.Job.table.c.create_time < end_date ),
|
||||
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
|
||||
@@ -134,8 +133,7 @@ class Jobs( BaseController ):
|
||||
galaxy.model.Job.table.c.info,
|
||||
( galaxy.model.User.table.c.email ).label( 'user_email' ),
|
||||
galaxy.model.GalaxySession.table.c.remote_addr ),
|
||||
whereclause = sa.and_( sa.or_( galaxy.model.Job.table.c.state == 'error',
|
||||
galaxy.model.Job.table.c.state == 'deleted' ),
|
||||
whereclause = sa.and_( galaxy.model.Job.table.c.state == 'error',
|
||||
galaxy.model.Job.table.c.create_time >= start_date,
|
||||
galaxy.model.Job.table.c.create_time < end_date ),
|
||||
from_obj = [ sa.outerjoin( galaxy.model.Job.table,
|
||||
@@ -305,8 +303,7 @@ class Jobs( BaseController ):
|
||||
msg = ''
|
||||
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ).label( 'date' ),
|
||||
sa.func.count( galaxy.model.Job.table.c.id ).label( 'total_jobs' ) ),
|
||||
whereclause = sa.or_( galaxy.model.Job.table.c.state == 'error',
|
||||
galaxy.model.Job.table.c.state == 'deleted' ),
|
||||
whereclause = galaxy.model.Job.table.c.state == 'error',
|
||||
from_obj = [ galaxy.model.Job.table ],
|
||||
group_by = [ sa.func.date_trunc( 'month', sa.func.date( galaxy.model.Job.table.c.create_time ) ) ],
|
||||
order_by = [ sa.desc( 'date' ) ] )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<%def name="main_body()">
|
||||
<div class="reportBody">
|
||||
<h3 align="center">Jobs In Error Per Month ( includes jobs deleted before finishing )</h3>
|
||||
<h3 align="center">Jobs In Error Per Month</h3>
|
||||
<h4 align="center">Click Month to view the number of jobs in error for each day of that month</h4>
|
||||
%if msg:
|
||||
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
|
||||
@@ -11,7 +11,7 @@
|
||||
%endif
|
||||
<table align="center" width="60%" class="colored">
|
||||
%if len( jobs ) == 0:
|
||||
<tr><td colspan="2">There are no jobs in the deleted or error state</td></tr>
|
||||
<tr><td colspan="2">There are no jobs in the error state</td></tr>
|
||||
%else:
|
||||
<tr class="header">
|
||||
<td>Month</td>
|
||||
|
||||
@@ -10,15 +10,13 @@
|
||||
%endif
|
||||
<table align="center" width="60%" class="colored">
|
||||
%if len( jobs ) == 0:
|
||||
<tr><td colspan="5">There are no jobs in the deleted or error state for ${day_label}, ${month_label} ${day_of_month}, ${year_label}</td></tr>
|
||||
<tr><td colspan="5">There are no jobs in the error state for ${day_label}, ${month_label} ${day_of_month}, ${year_label}</td></tr>
|
||||
%else:
|
||||
%for job in jobs:
|
||||
<%
|
||||
state = job[0]
|
||||
if state == 'error':
|
||||
rowdef = '<tr class="headererror">'
|
||||
elif state == 'deleted':
|
||||
rowdef = '<tr class="headerdeleted">'
|
||||
else:
|
||||
rowdef = '<tr class="headerunknown">'
|
||||
%>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<%def name="main_body()">
|
||||
<div class="reportBody">
|
||||
<h3 align="center">Jobs in Error for ${month_label} ${year_label} ( includes jobs deleted before finishing )</h3>
|
||||
<h3 align="center">Jobs in Error for ${month_label} ${year_label}</h3>
|
||||
<h4 align="center">Click Jobs in Error to view jobs in error for that day</h4>
|
||||
%if msg:
|
||||
<table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
|
||||
@@ -11,7 +11,7 @@
|
||||
%endif
|
||||
<table align="center" width="60%" class="colored">
|
||||
%if len( jobs ) == 0:
|
||||
<tr><td colspan="3">There are no jobs in error for ${month_label} ${year_label}</td></tr>
|
||||
<tr><td colspan="3">There are no jobs in the error state for ${month_label} ${year_label}</td></tr>
|
||||
%else:
|
||||
<tr class="header">
|
||||
<td>Day</td>
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
<request_param galaxy_name="organism" remote_name="org" missing="unknown species" />
|
||||
<request_param galaxy_name="table" remote_name="hgta_track" missing="unknown table" />
|
||||
<request_param galaxy_name="description" remote_name="hgta_regionType" missing="no description" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" >
|
||||
<data_type_translation>
|
||||
<format galaxy_format="tabular" remote_format="selectedFields" />
|
||||
</data_type_translation>
|
||||
</request_param>
|
||||
</request_param_translation>
|
||||
<uihints minwidth="800"/>
|
||||
<outputs>
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
<request_param galaxy_name="organism" remote_name="org" missing="unknown species" />
|
||||
<request_param galaxy_name="table" remote_name="hgta_track" missing="" />
|
||||
<request_param galaxy_name="description" remote_name="hgta_regionType" missing="" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" >
|
||||
<data_type_translation>
|
||||
<format galaxy_format="tabular" remote_format="selectedFields" />
|
||||
</data_type_translation>
|
||||
</request_param>
|
||||
</request_param_translation>
|
||||
<uihints minwidth="800"/>
|
||||
<outputs>
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
<request_param galaxy_name="organism" remote_name="org" missing="unknown species" />
|
||||
<request_param galaxy_name="table" remote_name="hgta_track" missing="" />
|
||||
<request_param galaxy_name="description" remote_name="hgta_regionType" missing="" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" />
|
||||
<request_param galaxy_name="data_type" remote_name="hgta_outputType" missing="bed" >
|
||||
<data_type_translation>
|
||||
<format galaxy_format="tabular" remote_format="selectedFields" />
|
||||
</data_type_translation>
|
||||
</request_param>
|
||||
</request_param_translation>
|
||||
<uihints minwidth="800"/>
|
||||
<outputs>
|
||||
|
||||
Reference in New Issue
Block a user