galaxy-commits
Threads by month
- ----- 2025 -----
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions

galaxy-dist commit 21ddc9f843be: Prevent workflow forms from being submitted twice when dynamic options are refreshed, resulting in AJAX error and inability to savewq
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1275690470 14400
# Node ID 21ddc9f843be29515ea6f260a73a710288606104
# Parent 56e2793886dc2d1547bb86f32a13d0e365f8fecd
Prevent workflow forms from being submitted twice when dynamic options are refreshed, resulting in AJAX error and inability to savewq
--- a/templates/workflow/editor.mako
+++ b/templates/workflow/editor.mako
@@ -328,6 +328,7 @@
type: 'POST',
dataType: 'json',
success: function( data ) {
+ workflow.active_form_has_changes = false;
node.update_field_data( data );
},
beforeSubmit: function( data ) {
1
0

galaxy-dist commit a76d05bb41e1: Fixes and enhancements to the reports webapp:
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275672554 14400
# Node ID a76d05bb41e1c1f1eeaa93a18289eeed1213199b
# Parent dd69c382eff1d3c0c160bc3ec392b06671317fd0
Fixes and enhancements to the reports webapp:
0) The report that is initially displayed is now the number of jobs per day for the current month rather than the grid displaying all jobs for today.
1) Eliminate eagerloading when querying jobs so that queries are much faster
2) Fix the disk space ( system ) report, and add a new feature that displays all active ( undeleted ) hda and ldda pointers to a specific dataset.
3) Standardize request parameters so that queries can more easily be built using parameters from the request.
4) A few other miscellaneous bug fixes in the reports.
--- a/templates/webapps/reports/registered_users.mako
+++ b/templates/webapps/reports/registered_users.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/templates/webapps/reports/jobs_user_per_month.mako
+++ b/templates/webapps/reports/jobs_user_per_month.mako
@@ -4,7 +4,7 @@
<% from galaxy import util %>
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
@@ -27,7 +27,7 @@
<tr class="tr">
%endif
<td>${job[2]} ${job[3]}</td>
- <td><a href="${h.url_for( controller='jobs', action='user_for_month', email=email, month=job[0] )}">${job[1]}</a></td>
+ <td><a href="${h.url_for( controller='jobs', action='user_for_month', email=email, specified_date=job[0]+'-01' )}">${job[1]}</a></td></tr><% ctr += 1 %>
%endfor
--- a/lib/galaxy/webapps/reports/controllers/jobs.py
+++ b/lib/galaxy/webapps/reports/controllers/jobs.py
@@ -63,7 +63,7 @@ class SpecifiedDateListGrid( grids.Grid
model_class=model.User,
link=( lambda item: dict( operation="user_per_month", id=item.id, webapp="reports" ) ),
attach_popup=False ),
- grids.StateColumn( "All", key="state", model_class=model.Job, visible=False, filterable="advanced" )
+ grids.StateColumn( "state", key="state", model_class=model.Job, visible=False, filterable="advanced" )
]
columns.append( grids.MulticolFilterColumn( "Search",
cols_to_filter=[ columns[1], columns[2] ],
@@ -78,45 +78,59 @@ class SpecifiedDateListGrid( grids.Grid
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
- return trans.sa_session.query( self.model_class )
+ return trans.sa_session.query( self.model_class ) \
+ .enable_eagerloads( False )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
- return trans.sa_session.query( self.model_class ).filter( and_( self.model_class.table.c.create_time >= start_date,
- self.model_class.table.c.create_time < end_date ) )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( and_( self.model_class.table.c.create_time >= start_date,
+ self.model_class.table.c.create_time < end_date ) ) \
+ .enable_eagerloads( False )
class SpecifiedDateInErrorListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
- return trans.sa_session.query( self.model_class ).filter( self.model_class.table.c.state == model.Job.states.ERROR )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( self.model_class.table.c.state == model.Job.states.ERROR ) \
+ .enable_eagerloads( False )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
- return trans.sa_session.query( self.model_class ).filter( and_( self.model_class.table.c.state == model.Job.states.ERROR,
- self.model_class.table.c.create_time >= start_date,
- self.model_class.table.c.create_time < end_date ) )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( and_( self.model_class.table.c.state == model.Job.states.ERROR,
+ self.model_class.table.c.create_time >= start_date,
+ self.model_class.table.c.create_time < end_date ) ) \
+ .enable_eagerloads( False )
class AllUnfinishedListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
specified_date = kwd.get( 'specified_date', 'All' )
if specified_date == 'All':
- return trans.sa_session.query( self.model_class ).filter( not_( or_( model.Job.table.c.state == model.Job.states.OK,
- model.Job.table.c.state == model.Job.states.ERROR,
- model.Job.table.c.state == model.Job.states.DELETED ) ) )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( not_( or_( model.Job.table.c.state == model.Job.states.OK,
+ model.Job.table.c.state == model.Job.states.ERROR,
+ model.Job.table.c.state == model.Job.states.DELETED ) ) ) \
+ .enable_eagerloads( False )
year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
- return trans.sa_session.query( self.model_class ).filter( and_( not_( or_( model.Job.table.c.state == model.Job.states.OK,
- model.Job.table.c.state == model.Job.states.ERROR,
- model.Job.table.c.state == model.Job.states.DELETED ) ),
- self.model_class.table.c.create_time >= start_date,
- self.model_class.table.c.create_time < end_date ) )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( and_( not_( or_( model.Job.table.c.state == model.Job.states.OK,
+ model.Job.table.c.state == model.Job.states.ERROR,
+ model.Job.table.c.state == model.Job.states.DELETED ) ),
+ self.model_class.table.c.create_time >= start_date,
+ self.model_class.table.c.create_time < end_date ) ) \
+ .enable_eagerloads( False )
class UserForMonthListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
email = util.restore_text( kwd.get( 'email', '' ) )
- year, month = map( int, kwd.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ specified_month = specified_date[ :7 ]
+ year, month = map( int, specified_month.split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
return trans.sa_session.query( model.Job ) \
@@ -127,19 +141,22 @@ class UserForMonthListGrid( SpecifiedDat
model.User.table.c.email == email,
model.Job.table.c.create_time >= start_date,
model.Job.table.c.create_time < end_date ) ) \
- .order_by( desc( model.Job.table.c.create_time ) )
+ .enable_eagerloads( False )
class ToolForMonthListGrid( SpecifiedDateListGrid ):
def build_initial_query( self, trans, **kwd ):
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ specified_month = specified_date[ :7 ]
tool_id = util.restore_text( kwd.get( 'tool_id', '' ) )
- year, month = map( int, kwd.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
+ year, month = map( int, specified_month.split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
- return trans.sa_session.query( model.Job ) \
- .filter( and_( model.Job.table.c.tool_id == tool_id,
- model.Job.table.c.create_time >= start_date,
- model.Job.table.c.create_time < end_date ) ) \
- .order_by( desc( model.Job.table.c.create_time ) )
+ return trans.sa_session.query( self.model_class ) \
+ .filter( and_( self.model_class.table.c.tool_id == tool_id,
+ self.model_class.table.c.create_time >= start_date,
+ self.model_class.table.c.create_time < end_date ) ) \
+ .enable_eagerloads( False )
class Jobs( BaseController ):
@@ -158,8 +175,7 @@ class Jobs( BaseController ):
action='job_info',
**kwd ) )
if operation == "tool_per_month":
- # The received id is the job id, so we need to get the id of the user
- # that submitted the job.
+ # The received id is the job id, so we need to get the jobs tool_id.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
@@ -194,8 +210,7 @@ class Jobs( BaseController ):
action='job_info',
**kwd ) )
if operation == "tool_per_month":
- # The received id is the job id, so we need to get the id of the user
- # that submitted the job.
+ # The received id is the job id, so we need to get the jobs tool_id.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
@@ -222,7 +237,10 @@ class Jobs( BaseController ):
params = util.Params( kwd )
message = ''
monitor_email = params.get( 'monitor_email', 'monitor(a)bx.psu.edu' )
- year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ specified_month = specified_date[ :7 ]
+ year, month = map( int, specified_month.split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
@@ -254,7 +272,10 @@ class Jobs( BaseController ):
def specified_month_in_error( self, trans, **kwd ):
params = util.Params( kwd )
message = ''
- year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ specified_month = specified_date[ :7 ]
+ year, month = map( int, specified_month.split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
@@ -289,8 +310,7 @@ class Jobs( BaseController ):
action='job_info',
**kwd ) )
if operation == "tool_per_month":
- # The received id is the job id, so we need to get the id of the user
- # that submitted the job.
+ # The received id is the job id, so we need to get the jobs tool_id.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
@@ -332,7 +352,9 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
- return trans.fill_template( '/webapps/reports/jobs_per_month_all.mako', jobs=jobs, message=message )
+ return trans.fill_template( '/webapps/reports/jobs_per_month_all.mako',
+ jobs=jobs,
+ message=message )
@web.expose
def per_month_in_error( self, trans, **kwd ):
params = util.Params( kwd )
@@ -349,7 +371,9 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
- return trans.fill_template( '/webapps/reports/jobs_per_month_in_error.mako', jobs=jobs, message=message )
+ return trans.fill_template( '/webapps/reports/jobs_per_month_in_error.mako',
+ jobs=jobs,
+ message=message )
@web.expose
def per_user( self, trans, **kwd ):
params = util.Params( kwd )
@@ -398,8 +422,7 @@ class Jobs( BaseController ):
action='job_info',
**kwd ) )
if operation == "tool_per_month":
- # The received id is the job id, so we need to get the id of the user
- # that submitted the job.
+ # The received id is the job id, so we need to get the jobs tool_id.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
@@ -434,12 +457,15 @@ class Jobs( BaseController ):
for row in q.execute():
jobs.append( ( row.tool_id,
row.total_jobs ) )
- return trans.fill_template( '/webapps/reports/jobs_per_tool.mako', jobs=jobs, message=message )
+ return trans.fill_template( '/webapps/reports/jobs_per_tool.mako',
+ jobs=jobs,
+ message=message )
@web.expose
def tool_per_month( self, trans, **kwd ):
params = util.Params( kwd )
message = ''
tool_id = params.get( 'tool_id', 'Add a column1' )
+ specified_date = params.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( model.Job.table.c.create_time ) ).label( 'date' ),
sa.func.count( model.Job.table.c.id ).label( 'total_jobs' ) ),
whereclause = model.Job.table.c.tool_id == tool_id,
@@ -452,7 +478,11 @@ class Jobs( BaseController ):
row.total_jobs,
row.date.strftime( "%B" ),
row.date.strftime( "%Y" ) ) )
- return trans.fill_template( '/webapps/reports/jobs_tool_per_month.mako', tool_id=tool_id, jobs=jobs, message=message )
+ return trans.fill_template( '/webapps/reports/jobs_tool_per_month.mako',
+ specified_date=specified_date,
+ tool_id=tool_id,
+ jobs=jobs,
+ message=message )
@web.expose
def tool_for_month( self, trans, **kwd ):
if 'operation' in kwd:
@@ -462,8 +492,7 @@ class Jobs( BaseController ):
action='job_info',
**kwd ) )
if operation == "tool_per_month":
- # The received id is the job id, so we need to get the id of the user
- # that submitted the job.
+ # The received id is the job id, so we need to get the jobs tool_id.
job_id = kwd.get( 'id', None )
job = get_job( trans, job_id )
kwd[ 'tool_id' ] = job.tool_id
@@ -497,7 +526,10 @@ class Jobs( BaseController ):
.one()
# TODO: for some reason the job_info.id is not the same as job_id in the template, so we need to pass job_id
# This needs to be fixed ASAP!
- return trans.fill_template( '/webapps/reports/job_info.mako', job_id=job_id, job_info=job_info, message=message )
+ return trans.fill_template( '/webapps/reports/job_info.mako',
+ job_id=job_id,
+ job_info=job_info,
+ message=message )
@web.expose
def per_domain( self, trans, **kwd ):
# TODO: rewrite using alchemy
--- a/templates/webapps/reports/system.mako
+++ b/templates/webapps/reports/system.mako
@@ -1,13 +1,17 @@
<%inherit file="/base.mako"/><%namespace file="/message.mako" import="render_msg" />
+<%
+ from galaxy.web.framework.helpers import time_ago
+%>
+
%if message:
${render_msg( message, 'done' )}
%endif
<div class="toolForm"><h3 align="center">Old Histories and Datasets</h3>
- <table align="center" width="70%" class="border" cellpadding="5" cellspacing="5">
+ <table align="center" width="90%" class="border" cellpadding="5" cellspacing="5"><tr><td><form method="post" action="system">
@@ -33,10 +37,14 @@
</td></tr></table>
- <br clear="left" /><br />
+ <br clear="left" /><h3 align="center">Current Disk Space Where Datasets are Stored</h3>
- <table align="center" width="60%" class="colored">
- <tr><td colspan="5"><div class="toolFormTitle">Disk Usage for ${file_path}</div></td></tr>
+ <table align="center" width="90%" class="colored">
+ <tr>
+ <td colspan="5">
+ <b>Disk Usage for ${file_path}</b>
+ </td>
+ </tr><tr class="header"><td>File System</td><td>Disk Size</td>
@@ -51,16 +59,16 @@
<td>${disk_usage[3]}</td><td>${disk_usage[4]}</td></tr>
- %if len( datasets ) == 0:
- <tr class="header"><td colspan="5">There are no datasets larger than ${file_size_str}</td></tr>
- %else:
- <tr><td colspan="5"><div class="toolFormTitle">${len( datasets )} largest datasets over ${file_size_str}</div></td></tr>
+ </table>
+ <br clear="left" />
+ %if datasets.count() > 0:
+ <h3 align="center">${datasets.count()} largest unpurged data files over ${file_size_str}</h3>
+ <table align="center" width="90%" class="colored"><tr class="header"><td>File</td><td>Last Updated</td>
- <td>History ID</td><td>Deleted</td>
- <td>Size on Disk</td>
+ <td>File Size</td></tr><% ctr = 0 %>
%for dataset in datasets:
@@ -69,14 +77,19 @@
%else:
<tr class="tr">
%endif
- <td>dataset_${dataset[0]}.dat</td>
- <td>${dataset[1]}</td>
- <td>${dataset[2]}</td>
- <td>${dataset[3]}</td>
- <td>${dataset[4]}</td>
+ <td>
+ <% dataset_label = 'dataset%d_.dat' % dataset.id %>
+ <a href="${h.url_for( controller='system', action='dataset_info', id=trans.security.encode_id( dataset.id ) )}">${dataset_label}</a>
+ </td>
+ <td>${time_ago( dataset.update_time )}</td>
+ <td>${dataset.deleted}</td>
+ <td>${dataset.file_size}</td></tr><% ctr += 1 %>
%endfor
- %endif
- </table>
+ </table>
+ <br clear="left" />
+ %else:
+ <h3 align="center">There are no unpurged data files larger than ${file_size_str}</h3>
+ %endif
</div>
--- /dev/null
+++ b/templates/webapps/reports/dataset_info.mako
@@ -0,0 +1,119 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%
+ from galaxy.web.framework.helpers import time_ago
+ from galaxy.web.controllers.library_common import get_containing_library_from_library_dataset
+%>
+
+%if message:
+ ${render_msg( message, 'done' )}
+%endif
+
+<div class="toolForm">
+ <h3 align="center">Dataset Information</h3>
+ <div class="toolFormBody">
+ <div class="form-row">
+ <label>Date uploaded:</label>
+ ${time_ago( dataset.create_time )}
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>Last updated:</label>
+ ${time_ago( dataset.update_time )}
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>File size:</label>
+ ${dataset.get_size( nice_size=True )}
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>State:</label>
+ ${dataset.state}
+ <div style="clear: both"></div>
+ </div>
+ </div>
+</div>
+%if associated_hdas:
+ <p/>
+ <b>Active (undeleted) history items that use this library dataset's disk file</b>
+ <div class="toolForm">
+ <table class="grid">
+ <thead>
+ <tr>
+ <th>History</th>
+ <th>History Item</th>
+ <th>Last Updated</th>
+ <th>User</th>
+ </tr>
+ </thead>
+ %for hda in associated_hdas:
+ <tr>
+ <td>${hda.history.get_display_name()}</td>
+ <td>${hda.get_display_name()}</td>
+ <td>${time_ago( hda.update_time )}</td>
+ <td>
+ %if hda.history.user:
+ ${hda.history.user.email}
+ %else:
+ anonymous
+ %endif
+ </td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ <p/>
+%endif
+%if associated_lddas:
+ <p/>
+ <b>Other active (undeleted) library datasets that use this library dataset's disk file</b>
+ <div class="toolForm">
+ <table class="grid">
+ <thead>
+ <tr>
+ <th>Library</th>
+ <th>Folder</th>
+ <th>Library Dataset</th>
+ <th>Last Updated</th>
+ <th>Uploaded By</th>
+ </tr>
+ </thead>
+ %for ldda in associated_lddas:
+ <% containing_library = get_containing_library_from_library_dataset( trans, ldda.library_dataset ) %>
+ <tr>
+ <td>
+ <%
+ if containing_library:
+ library_display_name = containing_library.get_display_name()
+ else:
+ library_display_name = 'error finding library'
+ %>
+ ${library_display_name}
+ </td>
+ <td>
+ <%
+ library_dataset = ldda.library_dataset
+ folder = library_dataset.folder
+ folder_display_name = folder.get_display_name()
+ if folder_display_name == library_display_name:
+ folder_display_name = 'library root'
+ %>
+ ${folder_display_name}
+ </td>
+ <td>${ldda.get_display_name()}</td>
+ <td>${time_ago( ldda.update_time )}</td>
+ <td>
+ %if ldda.user:
+ ${ldda.user.email}
+ %else:
+ anonymous
+ %endif
+ </td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ <p/>
+%endif
--- a/templates/webapps/reports/jobs_per_user.mako
+++ b/templates/webapps/reports/jobs_per_user.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -432,13 +432,19 @@ class Dataset( object ):
path = os.path.join( os.path.join( self.file_path, *directory_hash_id( self.id ) ), "dataset_%d_files" % self.id )
# Make path absolute
return os.path.abspath( path )
- def get_size( self ):
+ def get_size( self, nice_size=False ):
"""Returns the size of the data on disk"""
if self.file_size:
- return self.file_size
+ if nice_size:
+ return galaxy.datatypes.data.nice_size( self.file_size )
+ else:
+ return self.file_size
else:
try:
- return os.path.getsize( self.file_name )
+ if nice_size:
+ return galaxy.datatypes.data.nice_size( os.path.getsize( self.file_name ) )
+ else:
+ return os.path.getsize( self.file_name )
except OSError:
return 0
def set_size( self ):
--- a/templates/webapps/reports/jobs_specified_month_in_error.mako
+++ b/templates/webapps/reports/jobs_specified_month_in_error.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/templates/webapps/reports/jobs_per_tool.mako
+++ b/templates/webapps/reports/jobs_per_tool.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/templates/webapps/reports/users_last_access_date.mako
+++ b/templates/webapps/reports/users_last_access_date.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/templates/webapps/reports/jobs_per_month_in_error.mako
+++ b/templates/webapps/reports/jobs_per_month_in_error.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
@@ -24,7 +24,7 @@
%else:
<tr class="tr">
%endif
- <td><a href="${h.url_for( controller='jobs', action='specified_month_in_error', month=job[0] )}">${job[2]} ${job[3]}</a></td>
+ <td><a href="${h.url_for( controller='jobs', action='specified_month_in_error', specified_date=job[0]+'-01' )}">${job[2]} ${job[3]}</a></td><td>${job[1]}</td></tr><% ctr += 1 %>
--- a/lib/galaxy/webapps/reports/controllers/system.py
+++ b/lib/galaxy/webapps/reports/controllers/system.py
@@ -1,10 +1,6 @@
import operator, os
from datetime import datetime, timedelta
from galaxy.web.base.controller import *
-#import pkg_resources
-#pkg_resources.require( "SQLAlchemy >= 0.4" )
-#from sqlalchemy.orm import eagerload
-#from sqlalchemy import desc
from galaxy import model
from galaxy.model.orm import *
import logging
@@ -44,7 +40,6 @@ class System( BaseController ):
deleted_histories_days=deleted_histories_days,
deleted_datasets_days=deleted_datasets_days,
message=message )
-
def userless_histories( self, trans, **kwd ):
"""The number of userless histories and associated datasets that have not been updated for the specified number of days."""
params = util.Params( kwd )
@@ -54,11 +49,6 @@ class System( BaseController ):
cutoff_time = datetime.utcnow() - timedelta( days=userless_histories_days )
history_count = 0
dataset_count = 0
- #h = self.app.model.History
- #where = ( h.table.c.user_id==None ) & ( h.table.c.deleted=='f' ) & ( h.table.c.update_time < cutoff_time )
- #histories = h.query().filter( where ).options( eagerload( 'datasets' ) )
-
- #for history in histories:
for history in trans.sa_session.query( model.History ) \
.filter( and_( model.History.table.c.user_id == None,
model.History.table.c.deleted == True,
@@ -71,7 +61,6 @@ class System( BaseController ):
else:
message = "Enter the number of days."
return str( userless_histories_days ), message
-
def deleted_histories( self, trans, **kwd ):
"""
The number of histories that were deleted more than the specified number of days ago, but have not yet been purged.
@@ -104,7 +93,6 @@ class System( BaseController ):
else:
message = "Enter the number of days."
return str( deleted_histories_days ), message
-
def deleted_datasets( self, trans, **kwd ):
"""The number of datasets that were deleted more than the specified number of days ago, but have not yet been purged."""
params = util.Params( kwd )
@@ -128,6 +116,25 @@ class System( BaseController ):
else:
message = "Enter the number of days."
return str( deleted_datasets_days ), message
+ @web.expose
+ def dataset_info( self, trans, **kwd ):
+ params = util.Params( kwd )
+ message = ''
+ dataset = trans.sa_session.query( model.Dataset ).get( trans.security.decode_id( kwd.get( 'id', '' ) ) )
+ # Get all associated hdas and lddas that use the same disk file.
+ associated_hdas = trans.sa_session.query( trans.model.HistoryDatasetAssociation ) \
+ .filter( and_( trans.model.HistoryDatasetAssociation.deleted == False,
+ trans.model.HistoryDatasetAssociation.dataset_id == dataset.id ) ) \
+ .all()
+ associated_lddas = trans.sa_session.query( trans.model.LibraryDatasetDatasetAssociation ) \
+ .filter( and_( trans.model.LibraryDatasetDatasetAssociation.deleted == False,
+ trans.model.LibraryDatasetDatasetAssociation.dataset_id == dataset.id ) ) \
+ .all()
+ return trans.fill_template( '/webapps/reports/dataset_info.mako',
+ dataset=dataset,
+ associated_hdas=associated_hdas,
+ associated_lddas=associated_lddas,
+ message=message )
def get_disk_usage( self, file_path ):
df_cmd = 'df -h ' + file_path
is_sym_link = os.path.islink( file_path )
@@ -163,13 +170,13 @@ class System( BaseController ):
def disk_usage( self, trans, **kwd ):
file_path = trans.app.config.file_path
disk_usage = self.get_disk_usage( file_path )
- min_file_size = 2**32 # 4 Gb
+ #min_file_size = 2**32 # 4 Gb
+ min_file_size = 0
file_size_str = nice_size( min_file_size )
- datasets = []
- for dataset in trans.sa_session.query( model.Dataset ) \
- .filter( model.Dataset.table.c.file_size > min_file_size ) \
- .order_by( desc( model.Dataset.table.c.file_size ) ):
- datasets.append( ( dataset.id, str( dataset.update_time )[0:10], dataset.history.history_id, dataset.deleted, dataset.file_size ) )
+ datasets = trans.sa_session.query( model.Dataset ) \
+ .filter( and_( model.Dataset.table.c.purged == False,
+ model.Dataset.table.c.file_size > min_file_size ) ) \
+ .order_by( desc( model.Dataset.table.c.file_size ) )
return file_path, disk_usage, datasets, file_size_str
def nice_size( size ):
--- a/lib/galaxy/webapps/reports/controllers/users.py
+++ b/lib/galaxy/webapps/reports/controllers/users.py
@@ -13,14 +13,12 @@ log = logging.getLogger( __name__ )
class Users( BaseController ):
@web.expose
def registered_users( self, trans, **kwd ):
- params = util.Params( kwd )
- message = params.get( 'message', '' )
+ message = util.restore_text( kwd.get( 'message', '' ) )
num_users = trans.sa_session.query( galaxy.model.User ).count()
return trans.fill_template( '/webapps/reports/registered_users.mako', num_users=num_users, message=message )
@web.expose
def registered_users_per_month( self, trans, **kwd ):
- params = util.Params( kwd )
- message = params.get( 'message', '' )
+ message = util.restore_text( kwd.get( 'message', '' ) )
q = sa.select( ( sa.func.date_trunc( 'month', sa.func.date( galaxy.model.User.table.c.create_time ) ).label( 'date' ),
sa.func.count( galaxy.model.User.table.c.id ).label( 'num_users' ) ),
from_obj = [ galaxy.model.User.table ],
@@ -29,15 +27,19 @@ class Users( BaseController ):
users = []
for row in q.execute():
users.append( ( row.date.strftime( "%Y-%m" ),
- row.num_users,
- row.date.strftime( "%B" ),
- row.date.strftime( "%Y" ) ) )
- return trans.fill_template( '/webapps/reports/registered_users_per_month.mako', users=users, message=message )
+ row.num_users,
+ row.date.strftime( "%B" ),
+ row.date.strftime( "%Y" ) ) )
+ return trans.fill_template( '/webapps/reports/registered_users_per_month.mako',
+ users=users,
+ message=message )
@web.expose
def specified_month( self, trans, **kwd ):
- params = util.Params( kwd )
- message = params.get( 'message', '' )
- year, month = map( int, params.get( 'month', datetime.utcnow().strftime( "%Y-%m" ) ).split( "-" ) )
+ message = util.restore_text( kwd.get( 'message', '' ) )
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ specified_month = specified_date[ :7 ]
+ year, month = map( int, specified_month.split( "-" ) )
start_date = date( year, month, 1 )
end_date = start_date + timedelta( days=calendar.monthrange( year, month )[1] )
month_label = start_date.strftime( "%B" )
@@ -63,9 +65,10 @@ class Users( BaseController ):
message=message )
@web.expose
def specified_date( self, trans, **kwd ):
- params = util.Params( kwd )
- message = params.get( 'message', '' )
- year, month, day = map( int, params.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) ).split( "-" ) )
+ message = util.restore_text( kwd.get( 'message', '' ) )
+ # If specified_date is not received, we'll default to the current month
+ specified_date = kwd.get( 'specified_date', datetime.utcnow().strftime( "%Y-%m-%d" ) )
+ year, month, day = map( int, specified_date.split( "-" ) )
start_date = date( year, month, day )
end_date = start_date + timedelta( days=1 )
day_of_month = start_date.strftime( "%d" )
@@ -91,9 +94,8 @@ class Users( BaseController ):
message=message )
@web.expose
def last_access_date( self, trans, **kwd ):
- params = util.Params( kwd )
- message = params.get( 'message', '' )
- not_logged_in_for_days = params.get( 'not_logged_in_for_days', 90 )
+ message = util.restore_text( kwd.get( 'message', '' ) )
+ not_logged_in_for_days = kwd.get( 'not_logged_in_for_days', 90 )
if not not_logged_in_for_days:
not_logged_in_for_days = 0
cutoff_time = datetime.utcnow() - timedelta( days=int( not_logged_in_for_days ) )
--- a/templates/webapps/reports/registered_users_specified_month.mako
+++ b/templates/webapps/reports/registered_users_specified_month.mako
@@ -24,7 +24,7 @@
%else:
<tr class="tr">
%endif
- <td><a href="${h.url_for( controller='users', action='specified_date', specified_date=user[0], day_label=user[3], month_label=month_label, year_label=year_label, day_of_month=user[1] )}">${user[3]}, ${month_label} ${user[1]}, ${year_label}</a></td>
+ <td><a href="${h.url_for( controller='users', action='specified_date', specified_date=user[0] )}">${user[3]}, ${month_label} ${user[1]}, ${year_label}</a></td><td>${user[2]}</td></tr><% ctr += 1 %>
--- a/templates/webapps/reports/index.mako
+++ b/templates/webapps/reports/index.mako
@@ -73,14 +73,14 @@
</div><div class="toolSectionBody"><div class="toolSectionBg">
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='today_all' )}">Number of jobs today</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_all' )}">Number of jobs per day for current month</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_in_error' )}">Number of jobs in error per day for current month</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='today_all' )}">Today's jobs</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_all' )}">Jobs per day this month</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='specified_month_in_error' )}">Jobs in error per day this month</a></div><div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='all_unfinished' )}">All unfinished jobs</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_all' )}">Number of jobs per month</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_in_error' )}">Number of jobs in error per month</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_user' )}">Number of jobs per user</a></div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_tool' )}">Number of jobs per tool</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_all' )}">Jobs per month</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_month_in_error' )}">Jobs in error per month</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_user' )}">Jobs per user</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='jobs', action='per_tool' )}">Jobs per tool</a></div></div></div><div class="toolSectionPad"></div>
@@ -101,7 +101,7 @@
</div><div class="toolSectionBody"><div class="toolSectionBg">
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='system', action='index' )}">Disk space, old histories and datasets</a></div>
+ <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='system', action='index' )}">Disk space maintenance</a></div></div></div></div>
@@ -110,6 +110,6 @@
</%def><%def name="center_panel()">
- <% center_url = h.url_for( controller='jobs', action='today_all' ) %>
+ <% center_url = h.url_for( controller='jobs', action='specified_month_all' ) %><iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe></%def>
--- a/templates/webapps/reports/jobs_per_domain.mako
+++ b/templates/webapps/reports/jobs_per_domain.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/lib/galaxy/web/controllers/library_common.py
+++ b/lib/galaxy/web/controllers/library_common.py
@@ -1904,15 +1904,14 @@ def branch_deleted( folder ):
def get_containing_library_from_library_dataset( trans, library_dataset ):
"""Given a library_dataset, get the containing library"""
folder = library_dataset.folder
- parent = folder
while folder.parent:
- parent = folder.parent
- # We have parent set to the library's root folder, which has the
- # same name as the library
+ folder = folder.parent
+ # We have folder set to the library's root folder, which has the same name as the library
for library in trans.sa_session.query( trans.model.Library ) \
.filter( and_( trans.model.Library.table.c.deleted == False,
- trans.model.Library.table.c.name == parent.name ) ):
- if library.root_folder == parent:
+ trans.model.Library.table.c.name == folder.name ) ):
+ # Just to double-check
+ if library.root_folder == folder:
return library
return None
--- a/templates/webapps/reports/jobs_tool_per_month.mako
+++ b/templates/webapps/reports/jobs_tool_per_month.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
@@ -25,7 +25,7 @@
<tr class="tr">
%endif
<td>${job[2]} ${job[3]}</td>
- <td><a href="${h.url_for( controller='jobs', action='tool_for_month', tool_id=tool_id, month=job[0] )}">${job[1]}</a></td>
+ <td><a href="${h.url_for( controller='jobs', action='tool_for_month', tool_id=tool_id, specified_date=job[0]+'-01' )}">${job[1]}</a></td></tr><% ctr += 1 %>
%endfor
--- a/templates/webapps/reports/registered_users_per_month.mako
+++ b/templates/webapps/reports/registered_users_per_month.mako
@@ -24,7 +24,7 @@
%else:
<tr class="tr">
%endif
- <td><a href="${h.url_for( controller='users', action='specified_month', month=user[0], month_label=user[2].strip(), year_label=user[3] )}">${user[2]} ${user[3]}</a></td>
+ <td><a href="${h.url_for( controller='users', action='specified_month', specified_date=user[0]+'-01' )}">${user[2]} ${user[3]}</a></td><td>${user[1]}</td></tr><% ctr += 1 %>
--- a/templates/webapps/reports/jobs_specified_month_all.mako
+++ b/templates/webapps/reports/jobs_specified_month_all.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
--- a/templates/webapps/reports/jobs_per_month_all.mako
+++ b/templates/webapps/reports/jobs_per_month_all.mako
@@ -2,7 +2,7 @@
<%namespace file="/message.mako" import="render_msg" />
%if message:
- ${render_msg( message, status )}
+ ${render_msg( message, 'done' )}
%endif
<div class="toolForm">
@@ -26,7 +26,7 @@
%else:
<tr class="tr">
%endif
- <td><a href="${h.url_for( controller='jobs', action='specified_month_all', month=job[0] )}">${job[4]} ${job[5]}</a></td>
+ <td><a href="${h.url_for( controller='jobs', action='specified_month_all', specified_date=job[0]+'-01' )}">${job[4]} ${job[5]}</a></td><td>${job[1]}</td><td>${job[2]}</td><td>${job[3]}</td>
1
0

galaxy-dist commit 6dde140d0cfd: I forgot to change the disk file size from 0 back to 4 gb for the systems report before may last commit.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275676257 14400
# Node ID 6dde140d0cfd53820f9cbb83bbb44338ac8bd6aa
# Parent a76d05bb41e1c1f1eeaa93a18289eeed1213199b
I forgot to change the disk file size from 0 back to 4 gb for the systems report before may last commit.
--- a/lib/galaxy/webapps/reports/controllers/system.py
+++ b/lib/galaxy/webapps/reports/controllers/system.py
@@ -170,8 +170,7 @@ class System( BaseController ):
def disk_usage( self, trans, **kwd ):
file_path = trans.app.config.file_path
disk_usage = self.get_disk_usage( file_path )
- #min_file_size = 2**32 # 4 Gb
- min_file_size = 0
+ min_file_size = 2**32 # 4 Gb
file_size_str = nice_size( min_file_size )
datasets = trans.sa_session.query( model.Dataset ) \
.filter( and_( model.Dataset.table.c.purged == False,
1
0

galaxy-dist commit 84880085415b: Add the ratmine datasource tool to main's tool config.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275677102 14400
# Node ID 84880085415b7b53ead611ccffee39b0ab9e0d4b
# Parent 6dde140d0cfd53820f9cbb83bbb44338ac8bd6aa
Add the ratmine datasource tool to main's tool config.
--- a/tool_conf.xml.main
+++ b/tool_conf.xml.main
@@ -10,6 +10,7 @@
<tool file="data_source/gramene_mart.xml" /><tool file="data_source/flymine.xml" /><tool file="data_source/fly_modencode.xml" />
+ <tool file="data_source/ratmine.xml" /><tool file="data_source/worm_modencode.xml" /><tool file="data_source/wormbase.xml" /><tool file="data_source/eupathdb.xml" />
1
0

galaxy-dist commit dd69c382eff1: lims: added new feature where the datasets are be automatically renamed using a setting with the request_type. This makes solves the same dataset name problem on SOLiD
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1275671936 14400
# Node ID dd69c382eff1d3c0c160bc3ec392b06671317fd0
# Parent d01207f24908bc3f6d5323689f0aa46557f4d254
lims: added new feature where the datasets are be automatically renamed using a setting with the request_type. This makes solves the same dataset name problem on SOLiD
--- a/templates/admin/requests/create_request_type.mako
+++ b/templates/admin/requests/create_request_type.mako
@@ -70,6 +70,15 @@
<input type="text" name="data_dir" value="" size="40"/></div><div class="form-row">
+ <label>Add experiment name and the sample name to the dataset name?</label>
+ ${rename_dataset_selectbox.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ The datasets are renamed by prepending the experiment name and the sample name to the dataset name. <br/>This
+ makes sure that dataset names remain unique in Galaxy even when they have the
+ same name in the sequencer.
+ </div>
+ </div>
+ <div class="form-row"><div style="float: left; width: 250px; margin-right: 10px;"><input type="hidden" name="new" value="submitted" size="40"/></div>
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1476,6 +1476,9 @@ class RequestEvent( object ):
self.comment = comment
class RequestType( object ):
+ rename_dataset_options = Bunch( NO = 'Do not rename',
+ SAMPLE_NAME = 'Preprend sample name',
+ EXPERIMENT_AND_SAMPLE_NAME = 'Prepend experiment and sample name')
permitted_actions = get_permitted_actions( filter='REQUEST_TYPE' )
def __init__(self, name=None, desc=None, request_form=None, sample_form=None,
datatx_info=None):
--- a/templates/admin/requests/view_request_type.mako
+++ b/templates/admin/requests/view_request_type.mako
@@ -62,6 +62,15 @@
<input type="text" name="data_dir" value="${request_type.datatx_info.get('data_dir', '')}" size="40"/></div><div class="form-row">
+ <label>Add experiment name and the sample name to the dataset name?</label>
+ ${rename_dataset_selectbox.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ The datasets are renamed by prepending the experiment name and the sample name to the dataset name. <br/>This
+ makes sure that dataset names remain unique in Galaxy even when they have the
+ same name in the sequencer.
+ </div>
+ </div>
+ <div class="form-row"><input type="submit" name="save_changes" value="Save changes"/></div></form>
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -221,7 +221,6 @@ class RequestsAdmin( BaseController ):
@web.json
def get_file_details( self, trans, id=None, file=None, folder_path=None ):
- print >> sys.stderr, 'get_file_details', id, file
def print_ticks(d):
pass
# Avoid caching
@@ -1623,7 +1622,7 @@ class RequestsAdmin( BaseController ):
else:
sample.dataset_files.append(dict(filepath=filepath,
status=sample.transfer_status.NOT_STARTED,
- name=filepath.split('/')[-1],
+ name=self.__dataset_name(sample, filepath.split('/')[-1]),
error_msg='',
size=sample.dataset_size(filepath)))
trans.sa_session.add( sample )
@@ -1638,7 +1637,16 @@ class RequestsAdmin( BaseController ):
action='show_datatx_page',
sample_id=trans.security.encode_id(sample.id),
folder_path=folder_path))
-
+
+ def __dataset_name(self, sample, filepath):
+ name = filepath.split('/')[-1]
+ opt = sample.request.type.datatx_info.get('rename_dataset', sample.request.type.rename_dataset_options.NO)
+ if opt == sample.request.type.rename_dataset_options.NO:
+ return name
+ elif opt == sample.request.type.rename_dataset_options.SAMPLE_NAME:
+ return sample.name+'_'+name
+ elif opt == sample.request.type.rename_dataset_options.EXPERIMENT_AND_SAMPLE_NAME:
+ return sample.request.name+'_'+sample.name+'_'+name
def __setup_datatx_user(self, trans, library, folder):
'''
This method sets up the datatx user:
@@ -1830,7 +1838,8 @@ class RequestsAdmin( BaseController ):
return trans.fill_template( '/admin/requests/view_request_type.mako',
request_type=rt,
forms=get_all_forms( trans ),
- states_list=rt.states )
+ states_list=rt.states,
+ rename_dataset_selectbox=self.__rename_dataset_selectbox(trans, rt) )
def __view_form(self, trans, **kwd):
try:
fd = trans.sa_session.query( trans.app.model.FormDefinition ).get( trans.security.decode_id(kwd['id']) )
@@ -1855,7 +1864,8 @@ class RequestsAdmin( BaseController ):
rt_info_widgets=rt_info,
rt_states_widgets=rt_states,
message=message,
- status=status)
+ status=status,
+ rename_dataset_selectbox=self.__rename_dataset_selectbox(trans))
elif params.get( 'remove_state_button', False ):
rt_info, rt_states = self.__create_request_type_form(trans, **kwd)
index = int(params.get( 'remove_state_button', '' ).split(" ")[2])
@@ -1864,7 +1874,8 @@ class RequestsAdmin( BaseController ):
rt_info_widgets=rt_info,
rt_states_widgets=rt_states,
message=message,
- status=status)
+ status=status,
+ rename_dataset_selectbox=self.__rename_dataset_selectbox(trans))
elif params.get( 'save_request_type', False ):
rt, message = self.__save_request_type(trans, **kwd)
if not rt:
@@ -1888,7 +1899,8 @@ class RequestsAdmin( BaseController ):
rt.datatx_info = dict(host=util.restore_text( params.get( 'host', '' ) ),
username=util.restore_text( params.get( 'username', '' ) ),
password=params.get( 'password', '' ),
- data_dir=util.restore_text( params.get( 'data_dir', '' ) ))
+ data_dir=util.restore_text( params.get( 'data_dir', '' ) ),
+ rename_dataset=util.restore_text( params.get('rename_dataset', False) ))
trans.sa_session.add( rt )
trans.sa_session.flush()
return trans.response.send_redirect( web.url_for( controller='requests_admin',
@@ -1903,7 +1915,8 @@ class RequestsAdmin( BaseController ):
rt_info_widgets=rt_info,
rt_states_widgets=rt_states,
message=message,
- status=status)
+ status=status,
+ rename_dataset_selectbox=self.__rename_dataset_selectbox(trans))
def __create_request_type_form(self, trans, **kwd):
request_forms=get_all_forms( trans,
filter=dict(deleted=False),
@@ -1949,6 +1962,19 @@ class RequestsAdmin( BaseController ):
break
return rt_info, rt_states
+ def __rename_dataset_selectbox(self, trans, rt=None):
+ if rt:
+ sel_opt = rt.datatx_info.get('rename_dataset', trans.app.model.RequestType.rename_dataset_options.NO)
+ else:
+ sel_opt = trans.app.model.RequestType.rename_dataset_options.NO
+ rename_dataset_selectbox = SelectField('rename_dataset')
+ for opt, opt_name in trans.app.model.RequestType.rename_dataset_options.items():
+ if sel_opt == opt_name:
+ rename_dataset_selectbox.add_option(opt_name, opt_name, selected=True)
+ else:
+ rename_dataset_selectbox.add_option(opt_name, opt_name)
+ return rename_dataset_selectbox
+
def __save_request_type(self, trans, **kwd):
params = util.Params( kwd )
rt = trans.app.model.RequestType()
@@ -1960,7 +1986,8 @@ class RequestsAdmin( BaseController ):
rt.datatx_info = dict(host=util.restore_text( params.get( 'host', '' ) ),
username=util.restore_text( params.get( 'username', '' ) ),
password=params.get( 'password', '' ),
- data_dir=util.restore_text( params.get( 'data_dir', '' ) ))
+ data_dir=util.restore_text( params.get( 'data_dir', '' ) ),
+ rename_dataset=util.restore_text( params.get('rename_dataset', '') ))
trans.sa_session.add( rt )
trans.sa_session.flush()
# set sample states
--- a/templates/admin/requests/get_data.mako
+++ b/templates/admin/requests/get_data.mako
@@ -55,6 +55,8 @@
<h2>Data transfer from Sequencer</h2><h3>Sample "${sample.name}" of Request "${sample.request.name}"</h3>
+<br/>
+<br/><ul class="manage-table-actions">
%if sample.request.submitted() and sample.inprogress_dataset_files():
@@ -131,7 +133,7 @@
<input type="submit" name="open_folder" value="Open folder"/><input type="submit" name="folder_up" value="Up"/></div>
- <div class="form-row">
+ <div class="form-row"><select name="files_list" id="files_list" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" onChange="display_file_details(${sample.id}, '${folder_path}')" multiple>
%for index, f in enumerate(files):
<option value="${f}">${f}</option>
1
0

galaxy-dist commit d01207f24908: Add a temporary fix to grid_common.mako, eliminating the use of the categorical-filter style for grid StateColumns so that the request will not be mangled before it reaches the server. Added several TODOs in the grid Javascript code outlining the problem.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275671670 14400
# Node ID d01207f24908bc3f6d5323689f0aa46557f4d254
# Parent d285c65c66d3d49f3ddd998fe2d28b60996581f1
Add a temporary fix to grid_common.mako, eliminating the use of the categorical-filter style for grid StateColumns so that the request will not be mangled before it reaches the server. Added several TODOs in the grid Javascript code outlining the problem.
--- a/templates/grid_common.mako
+++ b/templates/grid_common.mako
@@ -1,5 +1,5 @@
<%!
- from galaxy.web.framework.helpers.grids import TextColumn, GridColumnFilter
+ from galaxy.web.framework.helpers.grids import TextColumn, StateColumn, GridColumnFilter
from galaxy.web.framework.helpers import iff
%>
@@ -15,81 +15,110 @@
<td align="left" style="padding-left: 10px">${column_label}:</td>
%endif
<td>
- %if isinstance(column, TextColumn):
- <form class="text-filter-form" column_key="${column.key}" action="${url( dict() )}" method="get" >
- ## Carry forward filtering criteria with hidden inputs.
- %for temp_column in grid.columns:
- %if temp_column.key in cur_filter_dict:
- <% value = cur_filter_dict[ temp_column.key ] %>
- %if value != "All":
+ %if isinstance(column, TextColumn):
+ <form class="text-filter-form" column_key="${column.key}" action="${url( dict() )}" method="get" >
+ ## Carry forward filtering criteria with hidden inputs.
+ %for temp_column in grid.columns:
+ %if temp_column.key in cur_filter_dict:
+ <% value = cur_filter_dict[ temp_column.key ] %>
+ %if value != "All":
+ <%
+ if isinstance( temp_column, TextColumn ):
+ value = h.to_json_string( value )
+ %>
+ <input type="hidden" id="${temp_column.key}" name="f-${temp_column.key}" value='${value}'/>
+ %endif
+ %endif
+ %endfor
+
+ ## Print current filtering criteria and links to delete.
+ <span id="${column.key}-filtering-criteria">
+ %if column.key in cur_filter_dict:
+ <% column_filter = cur_filter_dict[column.key] %>
+ %if isinstance( column_filter, basestring ):
+ %if column_filter != "All":
+ <span class='text-filter-val'>
+ ${cur_filter_dict[column.key]}
+ <% filter_all = GridColumnFilter( "", { column.key : "All" } ) %>
+ <a href="${url( filter_all.get_url_args() )}"><img src="${h.url_for('/static/images/delete_tag_icon_gray.png')}"/></a>
+ </span>
+ %endif
+ %elif isinstance( column_filter, list ):
+ %for i, filter in enumerate( column_filter ):
+ %if i > 0:
+ ,
+ %endif
+ <span class='text-filter-val'>${filter}
+ <%
+ new_filter = list( column_filter )
+ del new_filter[ i ]
+ new_column_filter = GridColumnFilter( "", { column.key : h.to_json_string( new_filter ) } )
+ %>
+ <a href="${url( new_column_filter.get_url_args() )}"><img src="${h.url_for('/static/images/delete_tag_icon_gray.png')}"/></a>
+ </span>
+ %endfor
+ %endif
+ %endif
+ </span>
+ ## Print input field for column.
+ <span>
+ <% value = iff( column.filterable == "standard", column.label.lower(), "") %>
+ <input class="no-padding-or-margin" id="input-${column.key}-filter" name="f-${column.key}" type="text" value="${value}" size="15"/>
+ <input class='submit-image' type='image' src='${h.url_for('/static/images/mag_glass.png')}' alt='Filter'/>
+ </span>
+ </form>
+ ######################
+ ## TODO: eliminate this elif condition when the categorical-filter style in grid_common.mako is fixed to that it no
+ ## longer mangles the request by eliminating parameters from it before it reaches the server. Since the categorical-filter
+ ## style is not used here, paging will not work...
+ ######################
+ %elif isinstance( column, StateColumn ):
+ kwargs: ${kwargs}<br/>
+ <span id="${column.key}-filtering-criteria">
+ %for i, filter in enumerate( column.get_accepted_filters() ):
+ <%
+ # HACK: we know that each filter will have only a single argument, so get that single argument.
+ for key, arg in filter.args.items():
+ filter_key = key
+ filter_arg = arg
+ %>
+ %if i > 0:
+ |
+ %endif
+ %if column.key in cur_filter_dict and column.key in filter.args and cur_filter_dict[column.key] == filter.args[column.key]:
+ <span class="categorical-filter ${column.key}-filter current-filter">${filter.label}</span>
+ %else:
<%
- if isinstance( temp_column, TextColumn ):
- value = h.to_json_string( value )
+ my_dict = {}
+ my_dict.update( kwargs )
+ my_dict.update( filter.get_url_args() )
%>
- <input type="hidden" id="${temp_column.key}" name="f-${temp_column.key}" value='${value}'/>
+ <a href="${url( my_dict )}" filter_key="${filter_key}" filter_val="${filter_arg}">${filter.label}</a>
%endif
- %endif
- %endfor
-
- ## Print current filtering criteria and links to delete.
+ %endfor
+ </span>
+ %else:
<span id="${column.key}-filtering-criteria">
- %if column.key in cur_filter_dict:
- <% column_filter = cur_filter_dict[column.key] %>
- %if isinstance( column_filter, basestring ):
- %if column_filter != "All":
- <span class='text-filter-val'>
- ${cur_filter_dict[column.key]}
- <% filter_all = GridColumnFilter( "", { column.key : "All" } ) %>
- <a href="${url( filter_all.get_url_args() )}"><img src="${h.url_for('/static/images/delete_tag_icon_gray.png')}"/></a>
+ %for i, filter in enumerate( column.get_accepted_filters() ):
+ <%
+ # HACK: we know that each filter will have only a single argument, so get that single argument.
+ for key, arg in filter.args.items():
+ filter_key = key
+ filter_arg = arg
+ %>
+ %if i > 0:
+ |
+ %endif
+ %if column.key in cur_filter_dict and column.key in filter.args and cur_filter_dict[column.key] == filter.args[column.key]:
+ <span class="categorical-filter ${column.key}-filter current-filter">${filter.label}</span>
+ %else:
+ <span class="categorical-filter ${column.key}-filter">
+ <a href="${url( filter.get_url_args() )}" filter_key="${filter_key}" filter_val="${filter_arg}">${filter.label}</a></span>
%endif
- %elif isinstance( column_filter, list ):
- %for i, filter in enumerate( column_filter ):
- %if i > 0:
- ,
- %endif
- <span class='text-filter-val'>${filter}
- <%
- new_filter = list( column_filter )
- del new_filter[ i ]
- new_column_filter = GridColumnFilter( "", { column.key : h.to_json_string( new_filter ) } )
- %>
- <a href="${url( new_column_filter.get_url_args() )}"><img src="${h.url_for('/static/images/delete_tag_icon_gray.png')}"/></a>
- </span>
- %endfor
-
- %endif
- %endif
+ %endfor
</span>
- ## Print input field for column.
- <span>
- <% value = iff( column.filterable == "standard", column.label.lower(), "") %>
- <input class="no-padding-or-margin" id="input-${column.key}-filter" name="f-${column.key}" type="text" value="${value}" size="15"/>
- <input class='submit-image' type='image' src='${h.url_for('/static/images/mag_glass.png')}' alt='Filter'/>
- </span>
- </form>
- %else:
- <span id="${column.key}-filtering-criteria">
- %for i, filter in enumerate( column.get_accepted_filters() ):
- <%
- # HACK: we know that each filter will have only a single argument, so get that single argument.
- for key, arg in filter.args.items():
- filter_key = key
- filter_arg = arg
- %>
- %if i > 0:
- |
- %endif
- %if column.key in cur_filter_dict and column.key in filter.args and cur_filter_dict[column.key] == filter.args[column.key]:
- <span class="categorical-filter ${column.key}-filter current-filter">${filter.label}</span>
- %else:
- <span class="categorical-filter ${column.key}-filter">
- <a href="${url( filter.get_url_args() )}" filter_key="${filter_key}" filter_val="${filter_arg}">${filter.label}</a>
- </span>
- %endif
- %endfor
- </span>
- %endif
+ %endif
</td></tr></%def>
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -161,6 +161,16 @@
});
// Initialize categorical filters.
+ // ####################
+ // TODO: This style is used in grid_common.mako to wrap the links created for certain GridColumn
+ // subclasses ( e.g., DeletedColumn, StateColumn, etc ) where the link labels are generated in the
+ // class's get_accepted_filters() method. The problem is that when the link is clicked, this style
+ // will eliminate all request parameters except for those that are included in the cur_filter_dict
+ // dictionary that is used to build the url_args variable in this template. This process needs to
+ // be corrected so that the only changes made to the request are updating the values of parameters
+ // in the request with the new values obtained from cur_filter_dict, leaving all remaining request
+ // parameters alone. There is another related TODO in the set_categorical_filter() function below.
+ // ####################
$('.categorical-filter > a').each( function() {
$(this).click( function() {
var filter_key = $(this).attr('filter_key');
@@ -397,6 +407,11 @@
}
// Set new value for categorical filter.
+ // ####################
+ // TODO: this function mangles the initial request by eliminating many of the request parameters
+ // before calling update_grid(). This needs to be fixed - see the TODO in the categorical-filter
+ // style above.
+ // ####################
function set_categorical_filter(name, new_value) {
// Update filter hyperlinks to reflect new filter value.
var category_filter = categorical_filters[name];
@@ -423,7 +438,7 @@
$(this).append(t);
}
});
-
+
// Update grid.
url_args["f-" + name] = new_value;
go_page_one();
@@ -498,7 +513,7 @@
var href_parms = href_parms_str.split("&");
var operation = null;
var id = -1;
- var webapp = 'galaxy'
+ var webapp = 'galaxy';
for (var index = 0; index < href_parms.length; index++) {
if (href_parms[index].indexOf('operation') != -1) {
// Found operation parm; get operation value.
1
0

galaxy-dist commit d285c65c66d3: BUGFIX: Removed console.logs from page and workflow editors.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dannon Baker <dannon.baker(a)emory.edu>
# Date 1275663873 14400
# Node ID d285c65c66d3d49f3ddd998fe2d28b60996581f1
# Parent f22b57fa537f9c2f3c458bf513bce2bd155239d1
BUGFIX: Removed console.logs from page and workflow editors.
--- a/templates/workflow/editor.mako
+++ b/templates/workflow/editor.mako
@@ -123,7 +123,7 @@
});
$(document).ajaxError( function ( e, x ) {
- console.log( e, x );
+ // console.log( e, x );
var message = x.responseText || x.statusText || "Could not connect to server";
show_modal( "Server error", message, { "Ignore error" : hide_modal } );
return false;
--- a/templates/page/editor.mako
+++ b/templates/page/editor.mako
@@ -573,7 +573,7 @@
$(function(){
## Generic error handling
$(document).ajaxError( function ( e, x ) {
- console.log( e, x );
+ // console.log( e, x );
var message = x.responseText || x.statusText || "Could not connect to server";
show_modal( "Server error", message, { "Ignore error" : hide_modal } );
return false;
1
0

galaxy-dist commit e924fd0ed017: trackster: Implemented drag-zooming by letting you drag a region in the top label track (where chrom position is shown). Refactored to not use zoom levels anymore.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kanwei Li <kanwei(a)gmail.com>
# Date 1275602338 14400
# Node ID e924fd0ed0174300161577c30936c649d2cd2d08
# Parent d25af565d085e19dccb8f20c857e633397e5da08
trackster: Implemented drag-zooming by letting you drag a region in the top label track (where chrom position is shown). Refactored to not use zoom levels anymore.
--- a/static/welcome.html
+++ b/static/welcome.html
@@ -7,7 +7,7 @@
</head><body><div class="document">
- <div class="warningmessagelarge">
+ <div class="donemessagelarge"><strong>Hello world! It's running...</strong><hr>
To customize this page edit <code>static/welcome.html</code>
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmenu
(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString().t
oLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).split(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(a){if(typeof jQuery().autocomplete=="undefined"){return}if(a===undefined){a=20}$("select").each(function(){var d=$(this);if(d.find("option").length<a){return}if(d.attr("multiple")==true){return}var j=d.attr("value");var b=$("<input type='text' class='text-and-autocomplete-select'></input>");b.attr("size",40);b.attr("name",d.attr("name"));b.attr("id",d.attr("id"));b.click(function(){var k=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",k);$(this).select()});var e=[];var g={};d.children("option").ea
ch(function(){var l=$(this).text();var k=$(this).attr("value");e.push(l);g[l]=k;g[k]=k;if(k==j){b.attr("value",l)}});if(j==""||j=="?"){b.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};b.autocomplete(e,f);d.replaceWith(b);var i=function(){var l=b.attr("value");var k=g[l];if(k!==null&&k!==undefined){b.attr("value",k)}else{if(j!=""){b.attr("value",j)}else{b.attr("value","?")}}};b.parents("form").submit(function(){i()});$(document).bind("convert_dbkeys",function(){i()});if(d.attr("refresh_on_change")=="true"){var c=d.attr("refresh_on_change_values");if(c!==undefined){c=c.split(",")}var h=function(){var m=b.attr("value");var l=g[m];if(l!==null&&l!==undefined){refresh=false;if(c!==undefined){for(var k=0;k<c.length;k++){if(l==c[k]){refresh=true;break}}}else{refresh=true}if(refresh){b.attr("value",l);b.parents("for
m").submit()}}};b.bind("result",h);b.keyup(function(k){h()})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jSto
re.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){
if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
+$(document).ready(function(){replace_big_select_inputs()});$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function ensure_popup_helper(){if($("#popup-helper").length===0){$("<div id='popup-helper'/>").css({background:"white",opacity:0,zIndex:15000,position:"absolute",top:0,left:0,width:"100%",height:"100%"}).appendTo("body").hide()}}function attach_popupmenu(b,d){var a=function(){d.unbind().hide();$("#popup-helper").unbind("click.popupmenu").hide()};var c=function(g){$("#popup-helper").bind("click.popupmenu",a).show();d.click(a).css({left:0,top:-1000}).show();var f=g.pageX-d.width()/2;f=Math.min(f,$(document).scrollLeft()+$(window).width()-$(d).width()-20);f=Math.max(f,$(document).scrollLeft()+20);d.css({top:g.pageY-5,left:f});return false};$(b).click(c)}function make_popupmenu
(c,b){ensure_popup_helper();var a=$("<ul id='"+c.attr("id")+"-menu'></ul>");$.each(b,function(f,e){if(e){$("<li/>").html(f).click(e).appendTo(a)}else{$("<li class='head'/>").html(f).appendTo(a)}});var d=$("<div class='popmenu-wrapper'>");d.append(a).append("<div class='overlay-border'>").css("position","absolute").appendTo("body").hide();attach_popupmenu(c,d)}function make_popup_menus(){jQuery("div[popupmenu]").each(function(){var c={};$(this).find("a").each(function(){var b=$(this).attr("confirm"),d=$(this).attr("href"),e=$(this).attr("target");c[$(this).text()]=function(){if(!b||confirm(b)){var g=window;if(e=="_parent"){g=window.parent}else{if(e=="_top"){g=window.top}}g.location=d}}});var a=$("#"+$(this).attr("popupmenu"));make_popupmenu(a,c);$(this).remove();a.addClass("popup").show()})}function array_length(b){if(b.length){return b.length}var c=0;for(var a in b){c++}return c}function naturalSort(i,g){var n=/(-?[0-9\.]+)/g,j=i.toString().toLowerCase()||"",f=g.toString().t
oLowerCase()||"",k=String.fromCharCode(0),l=j.replace(n,k+"$1"+k).split(k),e=f.replace(n,k+"$1"+k).split(k),d=(new Date(j)).getTime(),m=d?(new Date(f)).getTime():null;if(m){if(d<m){return -1}else{if(d>m){return 1}}}for(var h=0,c=Math.max(l.length,e.length);h<c;h++){oFxNcL=parseFloat(l[h])||l[h];oFyNcL=parseFloat(e[h])||e[h];if(oFxNcL<oFyNcL){return -1}else{if(oFxNcL>oFyNcL){return 1}}}return 0}function replace_big_select_inputs(a){if(typeof jQuery().autocomplete=="undefined"){return}if(a===undefined){a=20}$("select").each(function(){var d=$(this);if(d.find("option").length<a){return}if(d.attr("multiple")==true){return}var j=d.attr("value");var b=$("<input type='text' class='text-and-autocomplete-select'></input>");b.attr("size",40);b.attr("name",d.attr("name"));b.attr("id",d.attr("id"));b.click(function(){var k=$(this).attr("value");$(this).attr("value","Loading...");$(this).showAllInCache();$(this).attr("value",k);$(this).select()});var e=[];var g={};d.children("option").ea
ch(function(){var l=$(this).text();var k=$(this).attr("value");e.push(l);g[l]=k;g[k]=k;if(k==j){b.attr("value",l)}});if(j==""||j=="?"){b.attr("value","Click to Search or Select")}if(d.attr("name")=="dbkey"){e=e.sort(naturalSort)}var f={selectFirst:false,autoFill:false,mustMatch:false,matchContains:true,max:1000,minChars:0,hideForLessThanMinChars:false};b.autocomplete(e,f);d.replaceWith(b);var i=function(){var l=b.attr("value");var k=g[l];if(k!==null&&k!==undefined){b.attr("value",k)}else{if(j!=""){b.attr("value",j)}else{b.attr("value","?")}}};b.parents("form").submit(function(){i()});$(document).bind("convert_dbkeys",function(){i()});if(d.attr("refresh_on_change")=="true"){var c=d.attr("refresh_on_change_values");if(c!==undefined){c=c.split(",")}var h=function(){var m=b.attr("value");var l=g[m];if(l!==null&&l!==undefined){refresh=false;if(c!==undefined){for(var k=0;k<c.length;k++){if(l==c[k]){refresh=true;break}}}else{refresh=true}if(refresh){b.attr("value",l);b.parents("for
m").submit()}}};b.bind("result",h);b.keyup(function(k){h()})}})}function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).live("click",function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text(k)}else{j=$("<input type='text'></input>").attr({value:k,size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){l.text(o);if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStore.store("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jSto
re.remove("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id;var h=$(this).children("div.historyItemBody");var i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){var k=$.jStore.store("history_expand_state");if(k){delete k[j];$.jStore.store("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){var k=$.jStore.store("history_expand_state");if(k===undefined){k={}}k[j]=true;$.jStore.store("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStore.store("history_expand_state");if(h===undefined){h={}}$("div.historyItemBody:visible").each(function(){
if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStore.store("history_expand_state",h)}).show()};if(a){b()}else{$.jStore.init("galaxy");$.jStore.engineReady(function(){b()})}}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}$(document).ready(function(){$("a[confirm]").click(function(){return confirm($(this).attr("confirm"))});if($.fn.tipsy){$(".tooltip").tipsy({gravity:"s"})}make_popup_menus()});
--- a/static/scripts/packed/trackster.js
+++ b/static/scripts/packed/trackster.js
@@ -1,1 +1,1 @@
-var DEBUG=false;var DENSITY=200,FEATURE_LEVELS=10,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src="/static/images/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src="/static/images/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src="/static/images/visualization/strand_right_inv.png";right_img_inv.onload=function(){RIGHT_STRAND_INV=CONTEXT.createPattern(
right_img_inv,"repeat")};var left_img_inv=new Image();left_img_inv.src="/static/images/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(b,d,c,a){this.vis_id=c;this.dbkey=a;this.title=d;this.chrom=b;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.center=(this.max_high-this.max_low)/2;this.zoom_factor=3;this.zoom_level=
0;this.track_id_counter=0;this.has_changes=false};$.extend(View.prototype,{add_track:function(a){a.view=this;a.track_id=this.track_id_counter;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[this.tracks.indexOf(a)]},update_options:function(){this.has_changes=true;var b=$("ul#sortable-ul").sortable("toArray");for(var c in b){var e=b[c].split("_li")[0].split("track_")[1];$("#viewport").append($("#track_"+e))}for(var d in view.tracks){var a=view.tracks[d];if(a&&a.update_options){a.update_options(d)}}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.center=this.center=(this.max_high-this.max_low)/2;this.zoom_level=0;$(".yaxislabel").remove()},redraw:function(f){this.span=this.max_high-this.max_low;var d=th
is.span/Math.pow(this.zoom_factor,this.zoom_level),b=this.center-(d/2),e=b+d;if(b<0){b=0;e=b+d}else{if(e>this.max_high){e=this.max_high;b=e-d}}this.low=Math.floor(b);this.high=Math.ceil(e);this.center=Math.round(this.low+(this.high-this.low)/2);this.resolution=Math.pow(10,Math.ceil(Math.log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));$("#overview-box").css({left:(this.low/this.span)*$("#overview-viewport").width(),width:Math.max(12,((this.high-this.low)/this.span)*$("#overview-viewport").width())}).show();$("#low").val(commatize(this.low));$("#high").val(commatize(this.high));if(!f){for(var c=0,a=this.tracks.length;c<a;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,a=this.label_tracks.length;c<a;c++){this.label_tracks[c].draw()}}},zoom_in:function(a,b){if(this.max_high===0||this.high-this.low<30){return}if(a){this.cente
r=a/b.width()*(this.high-this.low)+this.low}this.zoom_level+=1;this.redraw()},zoom_out:function(){if(this.max_high===0){return}if(this.zoom_level<=0){this.zoom_level=0;return}this.zoom_level-=1;this.redraw()}});var Track=function(a,b){this.name=a;this.parent_element=b;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div />").addClass("track").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.content_div.css("height","30px");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div
.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0);'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var i=this.view.low,e=this.view.high,f=e-i,d=this.vi
ew.resolution;if(DEBUG){$("#debug").text(d+" "+this.view.zoom_res)}var k=$("<div style='position: relative;'></div>"),l=this.content_div.width()/f,h;this.content_div.children(":first").remove();this.content_div.append(k),this.max_height=0;var a=Math.floor(i/d/DENSITY);while((a*DENSITY*d)<e){var j=this.content_div.width()+"_"+this.view.zoom_level+"_"+a;var c=this.tile_cache.get(j);if(c){var g=a*DENSITY*d;var b=(g-i)*l;if(this.left_offset){b-=this.left_offset}c.css({left:b});k.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,j,i,e,a,d,k,l)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)}});var LabelTrack=function(a){Track.call(this,null,a)
;this.track_type="LabelTrack";this.hidden=true;this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var LineTrack=function(c,a,b){this.track_type="LineTrack";Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.height_px=100;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(b.min_value!==undefined){this.prefs.min_value=b.min_value}if(b.max_value!==undefined){this.prefs.max_value=b.max_va
lue}if(b.mode!==undefined){this.prefs.mode=b.mode}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_range=undefined;this.init_each({stats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_value))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(a.prefs.min_value);var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(a.prefs.max_value);d.css({position:"relative",top:"25px",left:"10px"})
;d.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+55+"px",left:"10px"});e.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSITY*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},success:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,i){console.log(h,g,i)}})}},draw_tile:function(p,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,
n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.prefs.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}var u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(n){var a=$("<div />").addClass("form-row");var h="track_"+n+"_minval",l=$("<label></label>").attr("for",h).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),m=$("<input></input>").attr("id",h).val(b),k="track_
"+n+"_maxval",g=$("<label></label>").attr("for",k).text("Max value:"),j=(this.prefs.max_value===undefined?"":this.prefs.max_value),f=$("<input></input>").attr("id",k).val(j),e="track_"+n+"_mode",d=$("<label></label>").attr("for",e).text("Display mode:"),i=(this.prefs.mode===undefined?"Line":this.prefs.mode),c=$('<select id="'+e+'"><option value="Line" id="mode_Line">Line</option><option value="Filled" id="mode_Filled">Filled</option><option value="Intensity" id="mode_Intensity">Intensity</option></select>');c.children("#mode_"+i).attr("selected","selected");return a.append(l).append(m).append(g).append(f).append(d).append(c)},update_options:function(d){var a=$("#track_"+d+"_minval").val(),c=$("#track_"+d+"_maxval").val(),b=$("#track_"+d+"_mode option:selected").val();if(a!==this.prefs.min_value||c!==this.prefs.max_value||b!==this.prefs.mode){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(c);this.prefs.mode=b;this.vertical_range=this.prefs.max_value-this.p
refs.min_value;$("#linetrack_"+d+"_minval").text(this.prefs.min_value);$("#linetrack_"+d+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var FeatureTrack=function(c,a,b){this.track_type="FeatureTrack";Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.height_px=100;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=3;this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.prefs={block_color:"black",label_color:"black",show_counts:false};if(b.block_color!==undefined){this.prefs.block_color=b.block_color}if(b.label_color!==undefined){this.prefs.label_color=b.label_color}if(b.show_counts!==undefined){this.prefs.show_counts=b.show_counts}};$.ex
tend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.max_low+"_"+a.view.max_high;a.mode="Auto";if(a.mode_div){a.mode_div.remove()}this.init_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution},function(d){a.mode_div=$("<div class='right-float menubutton popup' />").text("Display Mode");a.header_div.append(a.mode_div);a.mode="Auto";var c=function(e){a.mode_div.text(e);a.mode=e;a.tile_cache.clear();a.draw()};make_popupmenu(a.mode_div,{Auto:function(){c("Auto")},Dense:function(){c("Dense")},Squish:function(){c("Squish")},Pack:function(){c("Pack")}});a.data_cache.set(b,d);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:fu
nction(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=1/a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z=[],l=0,b=$("<canvas></canvas>").get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;break}}}if(p){if(this.s_e_by_tile[a][v]===unde
fined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,g,f,m,b,d,k,e,i){n.textAlign="center";var j=Math.round(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>g){n.fillStyle=this.prefs.block_color;n.fillRect(k,i+1,e,9);n.fillStyle="#eee";for(var h=0,l=d.length;h<l;h++){if(b+h>=f&&b+h<=m){var a=Math.floor(Math.max(0,(b+h-f)*o));n.fillText(d[h],a+this.left_offset+j,i+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,i+4,e,3)}},draw_tile:function(X,h,n,al){var E=h*DENSITY*X,ad=(h+1)*DENSITY*X,D=DENSITY*X;var ae=E+"_"+ad;var z=this.data_cache.get(ae);if(z===undefined){this.data_queue[[E,ad]]=true;this.get_data(E,ad);return}var a=Math.ceil(D*al),L=$("<canvas class='tile'></canvas>"),Z=this.prefs.label_color,f=this.prefs.block_color,m=this.mode,V=(m==="Squish")||(m==="Dense")&&(m!=="Pack")||(m==="Auto"&&(z.extra_info==="no_detail")),P=this.left_offset,ak,s,a
m;if(z.dataset_type==="summary_tree"){s=30}else{if(m==="Dense"){s=15;am=10}else{am=(V?this.vertical_nodetail_px:this.vertical_detail_px);s=this.incremental_slots(this.view.zoom_res,z.data,V,m)*am+15;ak=this.inc_slots[this.view.zoom_res]}}L.css({position:"absolute",top:0,left:(E-this.view.low)*al-P});L.get(0).width=a+P;L.get(0).height=s;n.parent().css("height",Math.max(this.height_px,s)+"px");var A=L.get(0).getContext("2d"),ai=A.measureText("A").width;A.fillStyle=f;A.font=this.default_font;A.textAlign="right";if(z.dataset_type=="summary_tree"){var K,H=55,ac=255-H,g=ac*2/3,R=z.data,C=z.max,l=z.avg;if(R.length>2){var b=Math.ceil((R[1][0]-R[0][0])*al)}else{var b=50}for(var ag=0,w=R.length;ag<w;ag++){var T=Math.ceil((R[ag][0]-E)*al);var S=R[ag][1];if(!S){continue}K=Math.floor(ac-(S/C)*ac);A.fillStyle="rgb("+K+","+K+","+K+")";A.fillRect(T+P,0,b,20);if(this.prefs.show_counts){if(K>g){A.fillStyle="black"}else{A.fillStyle="#ddd"}A.textAlign="center";A.fillText(R[ag][1],T+P+(b/2),12)}
}n.append(L);return L}var aj=z.data;var af=0;for(var ag=0,w=aj.length;ag<w;ag++){var M=aj[ag],J=M[0],ah=M[1],U=M[2],F=M[3];if(ah<=ad&&U>=E){var W=Math.floor(Math.max(0,(ah-E)*al)),B=Math.ceil(Math.min(a,Math.max(0,(U-E)*al))),Q=(m==="Dense"?0:ak[J]*am);if(z.dataset_type==="bai"){A.fillStyle=f;if(M[4] instanceof Array){var t=Math.floor(Math.max(0,(M[4][0]-E)*al)),I=Math.ceil(Math.min(a,Math.max(0,(M[4][1]-E)*al))),r=Math.floor(Math.max(0,(M[5][0]-E)*al)),p=Math.ceil(Math.min(a,Math.max(0,(M[5][1]-E)*al)));if(M[4][1]>=E&&M[4][0]<=ad){this.rect_or_text(A,al,ai,E,ad,M[4][0],M[4][2],t+P,I-t,Q)}if(M[5][1]>=E&&M[5][0]<=ad){this.rect_or_text(A,al,ai,E,ad,M[5][0],M[5][2],r+P,p-r,Q)}if(r>I){A.fillStyle="#999";A.fillRect(I+P,Q+5,r-I,1)}}else{A.fillStyle=f;this.rect_or_text(A,al,ai,E,ad,ah,F,W+P,B-W,Q)}if(m!=="Dense"&&!V&&ah>E){A.fillStyle=this.prefs.label_color;if(h===0&&W-A.measureText(F).width<0){A.textAlign="left";A.fillText(J,B+2+P,Q+8)}else{A.textAlign="right";A.fillText(J,W-2+P,Q
+8)}A.fillStyle=f}}else{if(z.dataset_type==="interval_index"){if(V){A.fillRect(W+P,Q+5,B-W,1)}else{var v=M[4],O=M[5],Y=M[6],e=M[7];var u,aa,G=null,an=null;if(O&&Y){G=Math.floor(Math.max(0,(O-E)*al));an=Math.ceil(Math.min(a,Math.max(0,(Y-E)*al)))}if(m!=="Dense"&&F!==undefined&&ah>E){A.fillStyle=Z;if(h===0&&W-A.measureText(F).width<0){A.textAlign="left";A.fillText(F,B+2+P,Q+8)}else{A.textAlign="right";A.fillText(F,W-2+P,Q+8)}A.fillStyle=f}if(e){if(v){if(v=="+"){A.fillStyle=RIGHT_STRAND}else{if(v=="-"){A.fillStyle=LEFT_STRAND}}A.fillRect(W+P,Q,B-W,10);A.fillStyle=f}for(var ae=0,d=e.length;ae<d;ae++){var o=e[ae],c=Math.floor(Math.max(0,(o[0]-E)*al)),N=Math.ceil(Math.min(a,Math.max((o[1]-E)*al)));if(c>N){continue}u=5;aa=3;A.fillRect(c+P,Q+aa,N-c,u);if(G!==undefined&&!(c>an||N<G)){u=9;aa=1;var ab=Math.max(c,G),q=Math.min(N,an);A.fillRect(ab+P,Q+aa,q-ab,u)}}}else{u=9;aa=1;A.fillRect(W+P,Q+aa,B-W,u);if(M.strand){if(M.strand=="+"){A.fillStyle=RIGHT_STRAND_INV}else{if(M.strand=="-"){A
.fillStyle=LEFT_STRAND_INV}}A.fillRect(W+P,Q,B-W,10);A.fillStyle=prefs.block_color}}}}}af++}}n.append(L);return L},gen_options:function(i){var a=$("<div />").addClass("form-row");var e="track_"+i+"_block_color",k=$("<label />").attr("for",e).text("Block color:"),l=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),j="track_"+i+"_label_color",g=$("<label />").attr("for",j).text("Text color:"),h=$("<input />").attr("id",j).attr("name",j).val(this.prefs.label_color),f="track_"+i+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(k).append(l).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selected").val(),a=$("#track_"+e+"_show_count").attr("che
cked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;this.tile_cache.clear();this.draw()}}});var ReadTrack=function(c,a,b){FeatureTrack.call(this,c,a,b);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
+var DENSITY=200,FEATURE_LEVELS=10,DATA_ERROR="There was an error in indexing this dataset. ",DATA_NOCONVERTER="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",DATA_NONE="No data for this chrom/contig.",DATA_PENDING="Currently indexing... please wait",DATA_LOADING="Loading data...",CACHED_TILES_FEATURE=10,CACHED_TILES_LINE=30,CACHED_DATA=5,CONTEXT=$("<canvas></canvas>").get(0).getContext("2d"),RIGHT_STRAND,LEFT_STRAND;var right_img=new Image();right_img.src="/static/images/visualization/strand_right.png";right_img.onload=function(){RIGHT_STRAND=CONTEXT.createPattern(right_img,"repeat")};var left_img=new Image();left_img.src="/static/images/visualization/strand_left.png";left_img.onload=function(){LEFT_STRAND=CONTEXT.createPattern(left_img,"repeat")};var right_img_inv=new Image();right_img_inv.src="/static/images/visualization/strand_right_inv.png";right_img_inv.onload=function(){RIGHT_STRAND_INV=CONTEXT.createPattern(right_img_inv,"r
epeat")};var left_img_inv=new Image();left_img_inv.src="/static/images/visualization/strand_left_inv.png";left_img_inv.onload=function(){LEFT_STRAND_INV=CONTEXT.createPattern(left_img_inv,"repeat")};var Cache=function(a){this.num_elements=a;this.clear()};$.extend(Cache.prototype,{get:function(b){var a=this.key_ary.indexOf(b);if(a!=-1){this.key_ary.splice(a,1);this.key_ary.push(b)}return this.obj_cache[b]},set:function(b,c){if(!this.obj_cache[b]){if(this.key_ary.length>=this.num_elements){var a=this.key_ary.shift();delete this.obj_cache[a]}this.key_ary.push(b)}this.obj_cache[b]=c;return c},clear:function(){this.obj_cache={};this.key_ary=[]}});var View=function(b,d,c,a){this.vis_id=c;this.dbkey=a;this.title=d;this.chrom=b;this.tracks=[];this.label_tracks=[];this.max_low=0;this.max_high=0;this.track_id_counter=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.reset()};$.extend(View.prototype,{add_track:function(a){a.view=this;a.track_id=this.track_id_count
er;this.tracks.push(a);if(a.init){a.init()}a.container_div.attr("id","track_"+a.track_id);this.track_id_counter+=1},add_label_track:function(a){a.view=this;this.label_tracks.push(a)},remove_track:function(a){this.has_changes=true;a.container_div.fadeOut("slow",function(){$(this).remove()});delete this.tracks[this.tracks.indexOf(a)]},update_options:function(){this.has_changes=true;var b=$("ul#sortable-ul").sortable("toArray");for(var c in b){var e=b[c].split("_li")[0].split("track_")[1];$("#viewport").append($("#track_"+e))}for(var d in view.tracks){var a=view.tracks[d];if(a&&a.update_options){a.update_options(d)}}},reset:function(){this.low=this.max_low;this.high=this.max_high;$(".yaxislabel").remove()},redraw:function(f){var d=this.high-this.low,b=this.low,e=this.high;if(b<this.max_low){b=this.max_low}if(e>this.max_high){e=this.max_high}if(d<this.min_separation){e=b+this.min_separation}this.low=Math.floor(b);this.high=Math.ceil(e);this.resolution=Math.pow(10,Math.ceil(Math.
log((this.high-this.low)/200)/Math.LN10));this.zoom_res=Math.pow(FEATURE_LEVELS,Math.max(0,Math.ceil(Math.log(this.resolution,FEATURE_LEVELS)/Math.log(FEATURE_LEVELS))));$("#overview-box").css({left:(this.low/(this.max_high-this.max_low))*$("#overview-viewport").width(),width:Math.max(12,(this.high-this.low)/(this.max_high-this.max_low)*$("#overview-viewport").width())}).show();$("#low").val(commatize(this.low));$("#high").val(commatize(this.high));if(!f){for(var c=0,a=this.tracks.length;c<a;c++){if(this.tracks[c]&&this.tracks[c].enabled){this.tracks[c].draw()}}for(var c=0,a=this.label_tracks.length;c<a;c++){this.label_tracks[c].draw()}}},zoom_in:function(b,c){if(this.max_high===0||this.high-this.low<this.min_separation){return}var d=this.high-this.low,e=d/2+this.low,a=(d/this.zoom_factor)/2;if(b){e=b/c.width()*(this.high-this.low)+this.low}this.low=Math.round(e-a);this.high=Math.round(e+a);this.redraw()},zoom_out:function(){if(this.max_high===0){return}var b=this.high-this.
low,c=b/2+this.low,a=(b*this.zoom_factor)/2;this.low=Math.round(c-a);this.high=Math.round(c+a);this.redraw()}});var Track=function(a,b){this.name=a;this.parent_element=b;this.init_global()};$.extend(Track.prototype,{init_global:function(){this.header_div=$("<div class='track-header'>").text(this.name);this.content_div=$("<div class='track-content'>");this.container_div=$("<div />").addClass("track").append(this.header_div).append(this.content_div);this.parent_element.append(this.container_div)},init_each:function(c,b){var a=this;a.enabled=false;a.data_queue={};a.tile_cache.clear();a.data_cache.clear();a.content_div.css("height","30px");if(!a.content_div.text()){a.content_div.text(DATA_LOADING)}a.container_div.removeClass("nodata error pending");if(a.view.chrom){$.getJSON(data_url,c,function(d){if(!d||d==="error"||d.kind==="error"){a.container_div.addClass("error");a.content_div.text(DATA_ERROR);if(d.message){var f=a.view.tracks.indexOf(a);var e=$("<a href='javascript:void(0)
;'></a>").attr("id",f+"_error");e.text("Click to view error");$("#"+f+"_error").live("click",function(){show_modal("Trackster Error","<pre>"+d.message+"</pre>",{Close:hide_modal})});a.content_div.append(e)}}else{if(d==="no converter"){a.container_div.addClass("error");a.content_div.text(DATA_NOCONVERTER)}else{if(d.data!==undefined&&(d.data===null||d.data.length===0)){a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}else{if(d==="pending"){a.container_div.addClass("pending");a.content_div.text(DATA_PENDING);setTimeout(function(){a.init()},5000)}else{a.content_div.text("");a.content_div.css("height",a.height_px+"px");a.enabled=true;b(d);a.draw()}}}}})}else{a.container_div.addClass("nodata");a.content_div.text(DATA_NONE)}}});var TiledTrack=function(){};$.extend(TiledTrack.prototype,Track.prototype,{draw:function(){var i=this.view.low,e=this.view.high,f=e-i,d=this.view.resolution;var k=$("<div style='position: relative;'></div>"),l=this.content_div.width()/f,h;thi
s.content_div.children(":first").remove();this.content_div.append(k),this.max_height=0;var a=Math.floor(i/d/DENSITY);while((a*DENSITY*d)<e){var j=this.content_div.width()+"_"+l+"_"+a;var c=this.tile_cache.get(j);if(c){var g=a*DENSITY*d;var b=(g-i)*l;if(this.left_offset){b-=this.left_offset}c.css({left:b});k.append(c);this.max_height=Math.max(this.max_height,c.height());this.content_div.css("height",this.max_height+"px")}else{this.delayed_draw(this,j,i,e,a,d,k,l)}a+=1}},delayed_draw:function(c,e,a,f,b,d,g,h){setTimeout(function(){if(!(a>c.view.high||f<c.view.low)){tile_element=c.draw_tile(d,b,g,h);if(tile_element){c.tile_cache.set(e,tile_element);c.max_height=Math.max(c.max_height,tile_element.height());c.content_div.css("height",c.max_height+"px")}}},50)}});var LabelTrack=function(a){Track.call(this,null,a);this.track_type="LabelTrack";this.hidden=true;this.container_div.addClass("label-track")};$.extend(LabelTrack.prototype,Track.prototype,{draw:function(){var c=this.view,d
=c.high-c.low,g=Math.floor(Math.pow(10,Math.floor(Math.log(d)/Math.log(10)))),a=Math.floor(c.low/g)*g,e=this.content_div.width(),b=$("<div style='position: relative; height: 1.3em;'></div>");while(a<c.high){var f=(a-c.low)/d*e;b.append($("<div class='label'>"+commatize(a)+"</div>").css({position:"absolute",left:f-1}));a+=g}this.content_div.children(":first").remove();this.content_div.append(b)}});var LineTrack=function(c,a,b){this.track_type="LineTrack";Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.height_px=100;this.dataset_id=a;this.data_cache=new Cache(CACHED_DATA);this.tile_cache=new Cache(CACHED_TILES_LINE);this.prefs={min_value:undefined,max_value:undefined,mode:"Line"};if(b.min_value!==undefined){this.prefs.min_value=b.min_value}if(b.max_value!==undefined){this.prefs.max_value=b.max_value}if(b.mode!==undefined){this.prefs.mode=b.mode}};$.extend(LineTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.tracks.indexOf(a);a.vertical_ran
ge=undefined;this.init_each({stats:true,chrom:a.view.chrom,low:null,high:null,dataset_id:a.dataset_id},function(c){a.container_div.addClass("line-track");data=c.data;if(isNaN(parseFloat(a.prefs.min_value))||isNaN(parseFloat(a.prefs.max_value))){a.prefs.min_value=data.min;a.prefs.max_value=data.max;$("#track_"+b+"_minval").val(a.prefs.min_value);$("#track_"+b+"_maxval").val(a.prefs.max_value)}a.vertical_range=a.prefs.max_value-a.prefs.min_value;a.total_frequency=data.total_frequency;$("#linetrack_"+b+"_minval").remove();$("#linetrack_"+b+"_maxval").remove();var e=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_minval").text(a.prefs.min_value);var d=$("<div />").addClass("yaxislabel").attr("id","linetrack_"+b+"_maxval").text(a.prefs.max_value);d.css({position:"relative",top:"25px",left:"10px"});d.prependTo(a.container_div);e.css({position:"relative",top:a.height_px+55+"px",left:"10px"});e.prependTo(a.container_div)})},get_data:function(d,b){var c=this,a=b*DENSIT
Y*d,f=(b+1)*DENSITY*d,e=d+"_"+b;if(!c.data_queue[e]){c.data_queue[e]=true;$.ajax({url:data_url,dataType:"json",data:{chrom:this.view.chrom,low:a,high:f,dataset_id:this.dataset_id,resolution:this.view.resolution},success:function(g){data=g.data;c.data_cache.set(e,data);delete c.data_queue[e];c.draw()},error:function(h,g,i){console.log(h,g,i)}})}},draw_tile:function(p,r,c,e){if(this.vertical_range===undefined){return}var s=r*DENSITY*p,a=DENSITY*p,b=$("<canvas class='tile'></canvas>"),v=p+"_"+r;if(this.data_cache.get(v)===undefined){this.get_data(p,r);return}var j=this.data_cache.get(v);if(j===null){return}b.css({position:"absolute",top:0,left:(s-this.view.low)*e});b.get(0).width=Math.ceil(a*e);b.get(0).height=this.height_px;var o=b.get(0).getContext("2d"),k=false,l=this.prefs.min_value,g=this.prefs.max_value,n=this.vertical_range,t=this.total_frequency,d=this.height_px,m=this.prefs.mode;o.beginPath();if(data.length>1){var f=Math.ceil((data[1][0]-data[0][0])*e)}else{var f=10}va
r u,h;for(var q=0;q<data.length;q++){u=(data[q][0]-s)*e;h=data[q][1];if(m=="Intensity"){if(h===null){continue}if(h<=l){h=l}else{if(h>=g){h=g}}h=255-Math.floor((h-l)/n*255);o.fillStyle="rgb("+h+","+h+","+h+")";o.fillRect(u,0,f,this.height_px)}else{if(h===null){if(k&&m==="Filled"){o.lineTo(u,d)}k=false;continue}else{if(h<=l){h=l}else{if(h>=g){h=g}}h=Math.round(d-(h-l)/n*d);if(k){o.lineTo(u,h)}else{k=true;if(m==="Filled"){o.moveTo(u,d);o.lineTo(u,h)}else{o.moveTo(u,h)}}}}}if(m==="Filled"){if(k){o.lineTo(u,d)}o.fill()}else{o.stroke()}c.append(b);return b},gen_options:function(n){var a=$("<div />").addClass("form-row");var h="track_"+n+"_minval",l=$("<label></label>").attr("for",h).text("Min value:"),b=(this.prefs.min_value===undefined?"":this.prefs.min_value),m=$("<input></input>").attr("id",h).val(b),k="track_"+n+"_maxval",g=$("<label></label>").attr("for",k).text("Max value:"),j=(this.prefs.max_value===undefined?"":this.prefs.max_value),f=$("<input></input>").attr("id",k).val(
j),e="track_"+n+"_mode",d=$("<label></label>").attr("for",e).text("Display mode:"),i=(this.prefs.mode===undefined?"Line":this.prefs.mode),c=$('<select id="'+e+'"><option value="Line" id="mode_Line">Line</option><option value="Filled" id="mode_Filled">Filled</option><option value="Intensity" id="mode_Intensity">Intensity</option></select>');c.children("#mode_"+i).attr("selected","selected");return a.append(l).append(m).append(g).append(f).append(d).append(c)},update_options:function(d){var a=$("#track_"+d+"_minval").val(),c=$("#track_"+d+"_maxval").val(),b=$("#track_"+d+"_mode option:selected").val();if(a!==this.prefs.min_value||c!==this.prefs.max_value||b!==this.prefs.mode){this.prefs.min_value=parseFloat(a);this.prefs.max_value=parseFloat(c);this.prefs.mode=b;this.vertical_range=this.prefs.max_value-this.prefs.min_value;$("#linetrack_"+d+"_minval").text(this.prefs.min_value);$("#linetrack_"+d+"_maxval").text(this.prefs.max_value);this.tile_cache.clear();this.draw()}}});var
FeatureTrack=function(c,a,b){this.track_type="FeatureTrack";Track.call(this,c,$("#viewport"));TiledTrack.call(this);this.height_px=100;this.container_div.addClass("feature-track");this.dataset_id=a;this.zo_slots={};this.show_labels_scale=0.001;this.showing_details=false;this.vertical_detail_px=10;this.vertical_nodetail_px=3;this.default_font="9px Monaco, Lucida Console, monospace";this.left_offset=200;this.inc_slots={};this.data_queue={};this.s_e_by_tile={};this.tile_cache=new Cache(CACHED_TILES_FEATURE);this.data_cache=new Cache(20);this.prefs={block_color:"black",label_color:"black",show_counts:false};if(b.block_color!==undefined){this.prefs.block_color=b.block_color}if(b.label_color!==undefined){this.prefs.label_color=b.label_color}if(b.show_counts!==undefined){this.prefs.show_counts=b.show_counts}};$.extend(FeatureTrack.prototype,TiledTrack.prototype,{init:function(){var a=this,b=a.view.max_low+"_"+a.view.max_high;a.mode="Auto";if(a.mode_div){a.mode_div.remove()}this.ini
t_each({low:a.view.max_low,high:a.view.max_high,dataset_id:a.dataset_id,chrom:a.view.chrom,resolution:this.view.resolution},function(d){a.mode_div=$("<div class='right-float menubutton popup' />").text("Display Mode");a.header_div.append(a.mode_div);a.mode="Auto";var c=function(e){a.mode_div.text(e);a.mode=e;a.tile_cache.clear();a.draw()};make_popupmenu(a.mode_div,{Auto:function(){c("Auto")},Dense:function(){c("Dense")},Squish:function(){c("Squish")},Pack:function(){c("Pack")}});a.data_cache.set(b,d);a.draw()})},get_data:function(a,d){var b=this,c=a+"_"+d;if(!b.data_queue[c]){b.data_queue[c]=true;$.getJSON(data_url,{chrom:b.view.chrom,low:a,high:d,dataset_id:b.dataset_id,resolution:this.view.resolution,mode:this.mode},function(e){b.data_cache.set(c,e);delete b.data_queue[c];b.draw()})}},incremental_slots:function(a,h,c,r){if(!this.inc_slots[a]){this.inc_slots[a]={};this.inc_slots[a].w_scale=1/a;this.inc_slots[a].mode=r;this.s_e_by_tile[a]={}}var n=this.inc_slots[a].w_scale,z
=[],l=0,b=$("<canvas></canvas>").get(0).getContext("2d"),o=this.view.max_low;var B=[];if(this.inc_slots[a].mode!==r){delete this.inc_slots[a];this.inc_slots[a]={mode:r,w_scale:n};delete this.s_e_by_tile[a];this.s_e_by_tile[a]={}}for(var w=0,x=h.length;w<x;w++){var g=h[w],m=g[0];if(this.inc_slots[a][m]!==undefined){l=Math.max(l,this.inc_slots[a][m]);B.push(this.inc_slots[a][m])}else{z.push(w)}}for(var w=0,x=z.length;w<x;w++){var g=h[z[w]],m=g[0],s=g[1],d=g[2],q=g[3],e=Math.floor((s-o)*n),f=Math.ceil((d-o)*n);if(q!==undefined&&!c){var t=b.measureText(q).width;if(e-t<0){f+=t}else{e-=t}}var v=0;while(true){var p=true;if(this.s_e_by_tile[a][v]!==undefined){for(var u=0,A=this.s_e_by_tile[a][v].length;u<A;u++){var y=this.s_e_by_tile[a][v][u];if(f>y[0]&&e<y[1]){p=false;break}}}if(p){if(this.s_e_by_tile[a][v]===undefined){this.s_e_by_tile[a][v]=[]}this.s_e_by_tile[a][v].push([e,f]);this.inc_slots[a][m]=v;l=Math.max(l,v);break}v++}}return l},rect_or_text:function(n,o,g,f,m,b,d,k,e,i){
n.textAlign="center";var j=Math.round(o/2);if((this.mode==="Pack"||this.mode==="Auto")&&d!==undefined&&o>g){n.fillStyle=this.prefs.block_color;n.fillRect(k,i+1,e,9);n.fillStyle="#eee";for(var h=0,l=d.length;h<l;h++){if(b+h>=f&&b+h<=m){var a=Math.floor(Math.max(0,(b+h-f)*o));n.fillText(d[h],a+this.left_offset+j,i+9)}}}else{n.fillStyle=this.prefs.block_color;n.fillRect(k,i+4,e,3)}},draw_tile:function(X,h,n,al){var E=h*DENSITY*X,ad=(h+1)*DENSITY*X,D=DENSITY*X;var ae=E+"_"+ad;var z=this.data_cache.get(ae);if(z===undefined){this.data_queue[[E,ad]]=true;this.get_data(E,ad);return}var a=Math.ceil(D*al),L=$("<canvas class='tile'></canvas>"),Z=this.prefs.label_color,f=this.prefs.block_color,m=this.mode,V=(m==="Squish")||(m==="Dense")&&(m!=="Pack")||(m==="Auto"&&(z.extra_info==="no_detail")),P=this.left_offset,ak,s,am;if(z.dataset_type==="summary_tree"){s=30}else{if(m==="Dense"){s=15;am=10}else{am=(V?this.vertical_nodetail_px:this.vertical_detail_px);s=this.incremental_slots(this.view
.zoom_res,z.data,V,m)*am+15;ak=this.inc_slots[this.view.zoom_res]}}L.css({position:"absolute",top:0,left:(E-this.view.low)*al-P});L.get(0).width=a+P;L.get(0).height=s;n.parent().css("height",Math.max(this.height_px,s)+"px");var A=L.get(0).getContext("2d"),ai=A.measureText("A").width;A.fillStyle=f;A.font=this.default_font;A.textAlign="right";if(z.dataset_type=="summary_tree"){var K,H=55,ac=255-H,g=ac*2/3,R=z.data,C=z.max,l=z.avg;if(R.length>2){var b=Math.ceil((R[1][0]-R[0][0])*al)}else{var b=50}for(var ag=0,w=R.length;ag<w;ag++){var T=Math.ceil((R[ag][0]-E)*al);var S=R[ag][1];if(!S){continue}K=Math.floor(ac-(S/C)*ac);A.fillStyle="rgb("+K+","+K+","+K+")";A.fillRect(T+P,0,b,20);if(this.prefs.show_counts){if(K>g){A.fillStyle="black"}else{A.fillStyle="#ddd"}A.textAlign="center";A.fillText(R[ag][1],T+P+(b/2),12)}}n.append(L);return L}var aj=z.data;var af=0;for(var ag=0,w=aj.length;ag<w;ag++){var M=aj[ag],J=M[0],ah=M[1],U=M[2],F=M[3];if(ah<=ad&&U>=E){var W=Math.floor(Math.max(0,(ah
-E)*al)),B=Math.ceil(Math.min(a,Math.max(0,(U-E)*al))),Q=(m==="Dense"?0:ak[J]*am);if(z.dataset_type==="bai"){A.fillStyle=f;if(M[4] instanceof Array){var t=Math.floor(Math.max(0,(M[4][0]-E)*al)),I=Math.ceil(Math.min(a,Math.max(0,(M[4][1]-E)*al))),r=Math.floor(Math.max(0,(M[5][0]-E)*al)),p=Math.ceil(Math.min(a,Math.max(0,(M[5][1]-E)*al)));if(M[4][1]>=E&&M[4][0]<=ad){this.rect_or_text(A,al,ai,E,ad,M[4][0],M[4][2],t+P,I-t,Q)}if(M[5][1]>=E&&M[5][0]<=ad){this.rect_or_text(A,al,ai,E,ad,M[5][0],M[5][2],r+P,p-r,Q)}if(r>I){A.fillStyle="#999";A.fillRect(I+P,Q+5,r-I,1)}}else{A.fillStyle=f;this.rect_or_text(A,al,ai,E,ad,ah,F,W+P,B-W,Q)}if(m!=="Dense"&&!V&&ah>E){A.fillStyle=this.prefs.label_color;if(h===0&&W-A.measureText(F).width<0){A.textAlign="left";A.fillText(J,B+2+P,Q+8)}else{A.textAlign="right";A.fillText(J,W-2+P,Q+8)}A.fillStyle=f}}else{if(z.dataset_type==="interval_index"){if(V){A.fillRect(W+P,Q+5,B-W,1)}else{var v=M[4],O=M[5],Y=M[6],e=M[7];var u,aa,G=null,an=null;if(O&&Y){G=Math.
floor(Math.max(0,(O-E)*al));an=Math.ceil(Math.min(a,Math.max(0,(Y-E)*al)))}if(m!=="Dense"&&F!==undefined&&ah>E){A.fillStyle=Z;if(h===0&&W-A.measureText(F).width<0){A.textAlign="left";A.fillText(F,B+2+P,Q+8)}else{A.textAlign="right";A.fillText(F,W-2+P,Q+8)}A.fillStyle=f}if(e){if(v){if(v=="+"){A.fillStyle=RIGHT_STRAND}else{if(v=="-"){A.fillStyle=LEFT_STRAND}}A.fillRect(W+P,Q,B-W,10);A.fillStyle=f}for(var ae=0,d=e.length;ae<d;ae++){var o=e[ae],c=Math.floor(Math.max(0,(o[0]-E)*al)),N=Math.ceil(Math.min(a,Math.max((o[1]-E)*al)));if(c>N){continue}u=5;aa=3;A.fillRect(c+P,Q+aa,N-c,u);if(G!==undefined&&!(c>an||N<G)){u=9;aa=1;var ab=Math.max(c,G),q=Math.min(N,an);A.fillRect(ab+P,Q+aa,q-ab,u)}}}else{u=9;aa=1;A.fillRect(W+P,Q+aa,B-W,u);if(M.strand){if(M.strand=="+"){A.fillStyle=RIGHT_STRAND_INV}else{if(M.strand=="-"){A.fillStyle=LEFT_STRAND_INV}}A.fillRect(W+P,Q,B-W,10);A.fillStyle=prefs.block_color}}}}}af++}}n.append(L);return L},gen_options:function(i){var a=$("<div />").addClass("for
m-row");var e="track_"+i+"_block_color",k=$("<label />").attr("for",e).text("Block color:"),l=$("<input />").attr("id",e).attr("name",e).val(this.prefs.block_color),j="track_"+i+"_label_color",g=$("<label />").attr("for",j).text("Text color:"),h=$("<input />").attr("id",j).attr("name",j).val(this.prefs.label_color),f="track_"+i+"_show_count",c=$("<label />").attr("for",f).text("Show summary counts"),b=$('<input type="checkbox" style="float:left;"></input>').attr("id",f).attr("name",f).attr("checked",this.prefs.show_counts),d=$("<div />").append(b).append(c);return a.append(k).append(l).append(g).append(h).append(d)},update_options:function(e){var b=$("#track_"+e+"_block_color").val(),d=$("#track_"+e+"_label_color").val(),c=$("#track_"+e+"_mode option:selected").val(),a=$("#track_"+e+"_show_count").attr("checked");if(b!==this.prefs.block_color||d!==this.prefs.label_color||a!==this.prefs.show_counts){this.prefs.block_color=b;this.prefs.label_color=d;this.prefs.show_counts=a;th
is.tile_cache.clear();this.draw()}}});var ReadTrack=function(c,a,b){FeatureTrack.call(this,c,a,b);this.track_type="ReadTrack";this.vertical_detail_px=10;this.vertical_nodetail_px=5};$.extend(ReadTrack.prototype,TiledTrack.prototype,FeatureTrack.prototype,{});
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -1,7 +1,6 @@
/* Trackster
2010, James Taylor, Kanwei Li
*/
-var DEBUG = false;
var DENSITY = 200,
FEATURE_LEVELS = 10,
@@ -37,15 +36,6 @@ left_img_inv.onload = function() {
LEFT_STRAND_INV = CONTEXT.createPattern(left_img_inv, "repeat");
};
-function commatize( number ) {
- number += ''; // Convert to string
- var rgx = /(\d+)(\d{3})/;
- while (rgx.test(number)) {
- number = number.replace(rgx, '$1' + ',' + '$2');
- }
- return number;
-}
-
var Cache = function( num_elements ) {
this.num_elements = num_elements;
this.clear();
@@ -87,11 +77,11 @@ var View = function( chrom, title, vis_i
this.label_tracks = [];
this.max_low = 0;
this.max_high = 0;
- this.center = (this.max_high - this.max_low) / 2;
+ this.track_id_counter = 0;
this.zoom_factor = 3;
- this.zoom_level = 0;
- this.track_id_counter = 0;
+ this.min_separation = 30;
this.has_changes = false;
+ this.reset();
};
$.extend( View.prototype, {
add_track: function ( track ) {
@@ -129,27 +119,24 @@ var View = function( chrom, title, vis_i
reset: function() {
this.low = this.max_low;
this.high = this.max_high;
- this.center = this.center = (this.max_high - this.max_low) / 2;
- this.zoom_level = 0;
$(".yaxislabel").remove();
},
redraw: function(nodraw) {
- this.span = this.max_high - this.max_low;
- var span = this.span / Math.pow(this.zoom_factor, this.zoom_level),
- low = this.center - (span / 2),
- high = low + span;
+ var span = this.high - this.low,
+ low = this.low,
+ high = this.high;
- if (low < 0) {
- low = 0;
- high = low + span;
-
- } else if (high > this.max_high) {
+ if (low < this.max_low) {
+ low = this.max_low;
+ }
+ if (high > this.max_high) {
high = this.max_high;
- low = high - span;
+ }
+ if (span < this.min_separation) {
+ high = low + this.min_separation;
}
this.low = Math.floor(low);
this.high = Math.ceil(high);
- this.center = Math.round( this.low + (this.high - this.low) / 2 );
// 10^log10(range / DENSITY) Close approximation for browser window, assuming DENSITY = window width
this.resolution = Math.pow( 10, Math.ceil( Math.log( (this.high - this.low) / 200 ) / Math.LN10 ) );
@@ -157,9 +144,9 @@ var View = function( chrom, title, vis_i
// Overview
$("#overview-box").css( {
- left: ( this.low / this.span ) * $("#overview-viewport").width(),
+ left: ( this.low / (this.max_high - this.max_low) ) * $("#overview-viewport").width(),
// Minimum width for usability
- width: Math.max( 12, ( ( this.high - this.low ) / this.span ) * $("#overview-viewport").width() )
+ width: Math.max( 12, (this.high - this.low)/(this.max_high - this.max_low) * $("#overview-viewport").width() )
}).show();
$("#low").val( commatize(this.low) );
$("#high").val( commatize(this.high) );
@@ -174,26 +161,29 @@ var View = function( chrom, title, vis_i
}
}
},
- zoom_in: function ( point, container ) {
- if (this.max_high === 0 || this.high - this.low < 30) {
+ zoom_in: function (point, container) {
+ if (this.max_high === 0 || this.high - this.low < this.min_separation) {
return;
}
-
- if ( point ) {
- this.center = point / container.width() * (this.high - this.low) + this.low;
+ var span = this.high - this.low,
+ cur_center = span / 2 + this.low,
+ new_half = (span / this.zoom_factor) / 2;
+ if (point) {
+ cur_center = point / container.width() * (this.high - this.low) + this.low;
}
- this.zoom_level += 1;
+ this.low = Math.round(cur_center - new_half);
+ this.high = Math.round(cur_center + new_half);
this.redraw();
},
zoom_out: function () {
if (this.max_high === 0) {
return;
}
- if (this.zoom_level <= 0) {
- this.zoom_level = 0;
- return;
- }
- this.zoom_level -= 1;
+ var span = this.high - this.low,
+ cur_center = span / 2 + this.low,
+ new_half = (span * this.zoom_factor) / 2;
+ this.low = Math.round(cur_center - new_half);
+ this.high = Math.round(cur_center + new_half);
this.redraw();
}
});
@@ -269,8 +259,6 @@ var TiledTrack = function() {
high = this.view.high,
range = high - low,
resolution = this.view.resolution;
-
- if (DEBUG) { $("#debug").text(resolution + " " + this.view.zoom_res); }
var parent_element = $("<div style='position: relative;'></div>"),
w_scale = this.content_div.width() / range,
@@ -283,7 +271,7 @@ var TiledTrack = function() {
var tile_index = Math.floor( low / resolution / DENSITY );
while ( ( tile_index * DENSITY * resolution ) < high ) {
// Check in cache
- var key = this.content_div.width() + '_' + this.view.zoom_level + '_' + tile_index;
+ var key = this.content_div.width() + '_' + w_scale + '_' + tile_index;
var cached = this.tile_cache.get(key);
if ( cached ) {
// console.log("cached tile " + tile_index);
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -454,6 +454,15 @@ function init_history_items(historywrapp
}
}
+function commatize( number ) {
+ number += ''; // Convert to string
+ var rgx = /(\d+)(\d{3})/;
+ while (rgx.test(number)) {
+ number = number.replace(rgx, '$1' + ',' + '$2');
+ }
+ return number;
+}
+
$(document).ready( function() {
// Links with confirmation
$( "a[confirm]" ).click( function() {
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -32,11 +32,11 @@
<div class="unified-panel-header" unselectable="on"><div class="unified-panel-header-inner">Trackster Visualization | ${config['title']}
<a id="save-button" class="panel-header-button right-float" href="javascript:void(0);">Save</a>
- <a id="refresh-button" class="panel-header-button right-float" href="javascript:void(0);">Refresh</a>
+ <a id="refresh-button" class="panel-header-button right-float" href="javascript:void(0);" onclick="view.update_options();return false;">Refresh</a></div></div><div id="content">
- <div id="top-labeltrack"></div>
+ <div id="top-labeltrack" style="position: relative;"></div><div id="viewport-container" style="overflow-x: hidden; overflow-y: auto;"><div id="viewport"></div></div>
@@ -63,7 +63,6 @@
<img src="${h.url_for('/static/images/fugue/magnifier-zoom-out.png')}" /></a></form>
- <div id="debug" style="float: right"></div></div></div></div>
@@ -146,6 +145,9 @@
});
$("#content").bind("mousewheel", function( e, delta ) {
+ if (Math.abs(delta) < 0.5) {
+ return;
+ }
if (delta > 0) {
view.zoom_in(e.pageX, $("#viewport-container"));
} else {
@@ -166,19 +168,19 @@
this.current_x = e.offsetX;
var delta_chrom = Math.round(delta / $(document).width() * view.span);
- view.center += delta_chrom;
+ view.high += delta_chrom;
+ view.low += delta_chrom;
view.redraw();
});
// To adjust the size of the viewport to fit the fixed-height footer
var refresh = function( e ) {
- $("#viewport-container").height( $(window).height() - 120 );
+ $("#viewport-container").height( $(window).height() - 100 );
$("#nav-container").width( $("#center").width() );
view.redraw();
};
$(window).bind( "resize", function(e) { refresh(e); } );
- $("#right-border").bind( "click", function(e) { refresh(e); } );
- $("#right-border").bind( "dragend", function(e) { refresh(e); } );
+ $("#right-border").bind( "click dragend", function(e) { refresh(e); } );
$(window).trigger( "resize" );
$("#viewport-container").bind( "dragstart", function( e ) {
@@ -195,8 +197,9 @@
this.current_height = e.clientY;
this.current_x = e.offsetX;
- var delta_chrom = Math.round(delta / $(document).width() * (view.high - view.low));
- view.center -= delta_chrom;
+ var delta_chrom = Math.round(delta / $("#viewport-container").width() * (view.high - view.low));
+ view.high -= delta_chrom;
+ view.low -= delta_chrom;
view.redraw();
});
@@ -286,6 +289,35 @@
view.add_label_track( new LabelTrack( $("#top-labeltrack") ) );
view.add_label_track( new LabelTrack( $("#nav-labeltrack") ) );
+ $("#top-labeltrack").bind( "dragstart", function(e) {
+ this.drag_origin_x = e.clientX;
+ this.drag_origin_pos = e.clientX / $("#viewport-container").width() * (view.high - view.low) + view.low;
+ this.drag_div = $("<div />").css( {
+ "height": $("#viewport-container").height(), "top": "0px", "position": "absolute",
+ "background-color": "#cfc", "border": "1px solid #6a6", "opacity": 0.5
+ } ).appendTo( $(this) );
+ }).bind( "drag", function(e) {
+ var min = Math.min(e.clientX, this.drag_origin_x),
+ max = Math.max(e.clientX, this.drag_origin_x),
+ span = (view.high - view.low),
+ width = $("#viewport-container").width();
+
+ $("#low").val(commatize(Math.round(min / width * span) + view.low));
+ $("#high").val(commatize(Math.round(max / width * span) + view.low));
+ this.drag_div.css( { "left": min + "px", "width": (max - min) + "px" } );
+ }).bind( "dragend", function(e) {
+ var min = Math.min(e.clientX, this.drag_origin_x),
+ max = Math.max(e.clientX, this.drag_origin_x),
+ span = (view.high - view.low),
+ width = $("#viewport-container").width(),
+ old_low = view.low;
+
+ view.low = Math.round(min / width * span) + old_low;
+ view.high = Math.round(max / width * span) + old_low;
+ this.drag_div.remove();
+ view.redraw();
+ });
+
$.ajax({
url: "${h.url_for( action='chroms' )}",
%if config.get('vis_id'):
--- a/static/trackster.css
+++ b/static/trackster.css
@@ -111,7 +111,6 @@
.label-track {
/* font-weight: bold; */
/* font-size: 10px; */
-
}
.label-track .label {
border-left: solid #999 1px;
1
0

galaxy-dist commit f0c8355714e2: Update cufflinks wrapper and tests. Expression output files are now tabular and all outputs are evaluated in functional test.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1275657576 14400
# Node ID f0c8355714e2b1fc1f70026485a4b24843609b2a
# Parent e924fd0ed0174300161577c30936c649d2cd2d08
Update cufflinks wrapper and tests. Expression output files are now tabular and all outputs are evaluated in functional test.
--- a/tools/ngs_rna/cufflinks_wrapper.xml
+++ b/tools/ngs_rna/cufflinks_wrapper.xml
@@ -50,12 +50,15 @@
</inputs><outputs>
- <data format="expr" name="genes_expression" label="${tool.name} on ${on_string}: gene expression"/>
- <data format="expr" name="transcripts_expression" label="${tool.name} on ${on_string}: transcript expression"/>
+ <data format="tabular" name="genes_expression" label="${tool.name} on ${on_string}: gene expression"/>
+ <data format="tabular" name="transcripts_expression" label="${tool.name} on ${on_string}: transcript expression"/><data format="gtf" name="assembled_isoforms" label="${tool.name} on ${on_string}: assembled transcripts"/></outputs><tests>
+ <!--
+ Simple test that uses test data included with cufflinks.
+ --><test><param name="sPaired" value="single"/><param name="input" value="cufflinks_in.sam"/>
@@ -65,12 +68,9 @@
<param name="pre_mrna_fraction" value="0.05"/><param name="min_map_quality" value="0"/><param name="use_ref" value="No"/>
- <output name="assembled_isoforms" file="cufflinks_out1.gtf"/>
- <!--
- Can't test these right now b/c .expr files aren't recognized. Need to add them?
<output name="genes_expression" format="tabular" file="cufflinks_out3.expr"/><output name="transcripts_expression" format="tabular" file="cufflinks_out2.expr"/>
- -->
+ <output name="assembled_isoforms" file="cufflinks_out1.gtf"/></test></tests>
1
0

galaxy-dist commit f22b57fa537f: Filter datasets grid so that datasets in deleted histories are not shown.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1275658986 14400
# Node ID f22b57fa537f9c2f3c458bf513bce2bd155239d1
# Parent f0c8355714e2b1fc1f70026485a4b24843609b2a
Filter datasets grid so that datasets in deleted histories are not shown.
--- a/lib/galaxy/web/controllers/dataset.py
+++ b/lib/galaxy/web/controllers/dataset.py
@@ -133,8 +133,9 @@ class HistoryDatasetAssociationListGrid(
num_rows_per_page = 50
def apply_query_filter( self, trans, query, **kwargs ):
# To filter HDAs by user, need to join HDA and History table and then filter histories by user. This is necessary because HDAs do not have
- # a user relation.
- return query.select_from( model.HistoryDatasetAssociation.table.join( model.History.table ) ).filter( model.History.user == trans.user )
+ # a user relation. TODO: move the base of this query to build_initial_query.
+ # Summary: filter by user, and deleted==False for both dataset and history
+ return query.select_from( model.HistoryDatasetAssociation.table.join( model.History.table ) ).filter( model.History.user == trans.user ).filter( self.model_class.deleted==False ).filter( model.History.deleted==False)
class DatasetInterface( BaseController, UsesAnnotations, UsesHistoryDatasetAssociation ):
1
0

galaxy-dist commit d25af565d085: Bug fix for importing a history archive.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1275599071 14400
# Node ID d25af565d085e19dccb8f20c857e633397e5da08
# Parent 170e2688d37043c9f1c4349f15d29ce6dd43e88b
Bug fix for importing a history archive.
--- a/lib/galaxy/web/controllers/history.py
+++ b/lib/galaxy/web/controllers/history.py
@@ -454,7 +454,7 @@ class HistoryController( BaseController,
# Security check: make sure that members are relative, not absolute.
for tarinfo in history_archive_file.getmembers():
- if tarinfo.name.startswith("/") or tarinfo.name.startswith(".."):
+ if tarinfo.name.startswith("/") or tarinfo.name.find("..") != -1:
return trans.show_error_message( 'Error importing history archive: archive file is invalid.' )
# Unpack archive in temporary directory.
1
0

galaxy-dist commit e4d2a5c24b05: Minor fix for changing datatype test.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1275586314 14400
# Node ID e4d2a5c24b05e164dc37918574d7078f07fc6b67
# Parent 6d218af7906af1f9524d02f785885bf1fd508f16
Minor fix for changing datatype test.
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -626,7 +626,7 @@ class TwillTestCase( unittest.TestCase )
self.check_page_for_string( 'This will change the datatype of the existing dataset but' )
tc.fv( 'change_datatype', 'datatype', datatype )
tc.submit( 'change' )
- self.check_page_for_string( 'Edit Attributes' )
+ self.check_page_for_string( 'Changed the type of dataset' )
self.home()
def copy_history_item( self, source_dataset_ids='', target_history_ids=[], all_target_history_ids=[],
deleted_history_ids=[] ):
@@ -2080,4 +2080,3 @@ class TwillTestCase( unittest.TestCase )
def add_tag( self, item_id, item_class, context, new_tag, check_str='' ):
self.visit_url( "%s/tag/add_tag_async?item_id=%s&item_class=%s&context=%s&new_tag=%s" % \
( self.url, item_id, item_class, context, new_tag ) )
-
1
0

galaxy-dist commit 170e2688d370: Improvements to history import/export archive: (a) use python tar file support (which may be more widely available than pax) and (b) perform some simple security checks to ensure that uploaded archive files are not malicious.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1275595159 14400
# Node ID 170e2688d37043c9f1c4349f15d29ce6dd43e88b
# Parent e4d2a5c24b05e164dc37918574d7078f07fc6b67
Improvements to history import/export archive: (a) use python tar file support (which may be more widely available than pax) and (b) perform some simple security checks to ensure that uploaded archive files are not malicious.
--- a/lib/galaxy/web/controllers/history.py
+++ b/lib/galaxy/web/controllers/history.py
@@ -9,7 +9,7 @@ from galaxy.util.sanitize_html import sa
from galaxy.tools.actions import upload_common
from galaxy.tags.tag_handler import GalaxyTagHandler
from sqlalchemy.sql.expression import ClauseElement
-import webhelpers, logging, operator, tempfile, subprocess, shutil
+import webhelpers, logging, operator, tempfile, subprocess, shutil, tarfile
from datetime import datetime
from cgi import escape
@@ -449,17 +449,18 @@ class HistoryController( BaseController,
if archived_history is not None:
# Import archived history.
- try:
- archive_file = archived_history.file
-
+ try:
+ history_archive_file = tarfile.open( archived_history.file.name )
+
+ # Security check: make sure that members are relative, not absolute.
+ for tarinfo in history_archive_file.getmembers():
+ if tarinfo.name.startswith("/") or tarinfo.name.startswith(".."):
+ return trans.show_error_message( 'Error importing history archive: archive file is invalid.' )
+
# Unpack archive in temporary directory.
temp_output_dir = tempfile.mkdtemp()
- cmd = "pax -z -r < %s " % archive_file.name
- temp_stderr_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
- temp_stderr = open( temp_stderr_name, 'wb' )
- proc = subprocess.Popen( args=cmd, shell=True, cwd=temp_output_dir, stderr=temp_stderr.fileno() )
- returncode = proc.wait()
- temp_stderr.close()
+ history_archive_file.extractall( path=temp_output_dir )
+ history_archive_file.close()
# Read history attributes.
history_attr_in = open( '%s/%s' % ( temp_output_dir, 'history_attrs.txt'), 'rb' )
@@ -625,24 +626,14 @@ class HistoryController( BaseController,
os.rename( datasets_attrs_file_name, new_name )
datasets_attrs_file_name = new_name
- # Write temp file with all files to archive. These files are (a) history attributes file; (b) datasets attributes file; and (c)
- # datasets files.
- archive_list_file_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
- archive_list_out = open( archive_list_file_name, 'w' )
- archive_list_out.write( '%s\n' % history_attrs_file_name )
- archive_list_out.write( '%s\n' % datasets_attrs_file_name )
- for dataset in datasets:
- archive_list_out.write( '%s\n' % dataset.file_name )
- archive_list_out.close()
-
- # Use 'pax' to create compressed tar archive of history's datasets. -s options uses a regular expression to replace path
- # information.
- cmd = "pax -w -s ',.*history_attrs.txt,history_attrs.txt,' -s ',.*datasets_attrs.txt,datasets_attrs.txt,' -s ',/.*/,datasets/,' -x tar -z -f %s.tar.gz < %s" % ( trans.security.encode_id( history.id ), archive_list_file_name )
- temp_stderr_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
- temp_stderr = open( temp_stderr_name, 'wb' )
- proc = subprocess.Popen( args=cmd, shell=True, cwd=history_export_dir_name, stderr=temp_stderr.fileno() )
- returncode = proc.wait()
- temp_stderr.close()
+ # Write files to archive: (a) history attributes file; (b) datasets attributes file; and (c) datasets files.
+ history_archive_name = '%s/%s.tar.gz' % ( history_export_dir_name, trans.security.encode_id( history.id ) )
+ history_archive = tarfile.open( history_archive_name, "w:gz" )
+ history_archive.add( history_attrs_file_name, arcname="history_attrs.txt" )
+ history_archive.add( datasets_attrs_file_name, arcname="datasets_attrs.txt" )
+ for i, dataset in enumerate( datasets ) :
+ history_archive.add( dataset.file_name, arcname="datasets/%s" % datasets_attrs[i]['file_name'] )
+ history_archive.close()
# Remove temp directory.
if os.path.exists( temp_output_dir ):
@@ -652,14 +643,13 @@ class HistoryController( BaseController,
return trans.show_error_message( 'Error creating history archive. ' + str( e ) )
# Stream archive.
- archive_file_name = '%s/%s.tar.gz' % ( history_export_dir_name, trans.security.encode_id( history.id ) )
- if os.path.exists( archive_file_name ):
+ if os.path.exists( history_archive_name ):
valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
hname = history.name
hname = ''.join(c in valid_chars and c or '_' for c in hname)[0:150]
trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy-History-%s.tar.gz" % ( hname )
trans.response.set_content_type( 'application/x-gzip' )
- return open( archive_file_name )
+ return open( history_archive_name )
else:
return
1
0

galaxy-dist commit a12eeed213ff: Resync Annotation Profiler tests to current cached data.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dan Blankenberg <dan(a)bx.psu.edu>
# Date 1275511239 14400
# Node ID a12eeed213ff6d8581073ad77914b12dfc26f9bd
# Parent 1dba26a363abfb488b8021f3c86c75651fce81b0
Resync Annotation Profiler tests to current cached data.
--- a/test-data/annotation_profiler_1.out
+++ b/test-data/annotation_profiler_1.out
@@ -1,8 +1,8 @@
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + multiz17way 1700000 1
-chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + knownAlt 14617 57
+chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + mrna 1476531 12
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + multiz28way 1700000 1
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + refGene 1247808 15
-chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + mrna 1476531 12
+chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + knownAlt 14617 57
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + affyGnf1h 16218 2
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + snp126 8224 7262
chr22 30128507 31828507 uc003bnx.1_cds_2_0_chr22_29227_f 0 + acembly 1532618 20
--- a/tools/annotation_profiler/annotation_profiler.xml
+++ b/tools/annotation_profiler/annotation_profiler.xml
@@ -27,14 +27,14 @@
<param name="input1" value="4.bed" dbkey="hg18"/><param name="keep_empty" value=""/><param name="summary" value=""/>
- <param name="table_names" value="acembly,affyGnf1h,affyHuEx1,knownAlt,knownGene,mrna,multiz17way,multiz28way,refGene,snp126"/>
+ <param name="table_names" value="acembly,affyGnf1h,knownAlt,knownGene,mrna,multiz17way,multiz28way,refGene,snp126"/><output name="out_file1" file="annotation_profiler_1.out" /></test><test><param name="input1" value="3.bed" dbkey="hg18"/><param name="keep_empty" value=""/><param name="summary" value="Summary"/>
- <param name="table_names" value="acembly,affyGnf1h,affyHuEx1,knownAlt,knownGene,mrna,multiz17way,multiz28way,refGene,snp126"/>
+ <param name="table_names" value="acembly,affyGnf1h,knownAlt,knownGene,mrna,multiz17way,multiz28way,refGene,snp126"/><output name="out_file1" file="annotation_profiler_2.out" /></test></tests>
--- a/test-data/annotation_profiler_2.out
+++ b/test-data/annotation_profiler_2.out
@@ -1,9 +1,9 @@
#tableName tableChromosomeCoverage tableChromosomeCount tableRegionCoverage tableRegionCount allIntervalCount allIntervalSize allCoverage allTableRegionsOverlaped allIntervalsOverlapingTable nrIntervalCount nrIntervalSize nrCoverage nrTableRegionsOverlaped nrIntervalsOverlapingTable
multiz17way 1232617592 115 107496500 7 25 2178864 2178864 25 25 24 2178828 2178828 7 24
-knownAlt 8647368 20213 766619 1630 25 2178864 5612 31 11 24 2178828 5612 31 11
+mrna 610115393 8453 53577685 617 25 2178864 1904380 38 24 24 2178828 1904344 33 23
multiz28way 1233785185 143 107466479 10 25 2178864 2178864 25 25 24 2178828 2178828 8 24
refGene 496767116 7324 46112187 488 25 2178864 1677947 30 23 24 2178828 1677911 27 22
-mrna 610115393 8453 53577685 617 25 2178864 1904380 38 24 24 2178828 1904344 33 23
+knownAlt 8647368 20213 766619 1630 25 2178864 5612 31 11 24 2178828 5612 31 11
affyGnf1h 24034558 3995 2446754 307 25 2178864 191851 9 6 24 2178828 191851 9 6
snp126 5297125 4456213 382226 331523 25 2178864 9205 7074 25 24 2178828 9205 7074 24
acembly 710938193 13800 63146381 938 25 2178864 1903560 35 24 24 2178828 1903524 30 23
1
0

galaxy-dist commit ea2658d131b4: Fix for LibraryDatasetDatasetAssociation objects when created by importing a history item iinto a library, the copied_from_history_dataset_association_id will now be kept.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275503088 14400
# Node ID ea2658d131b4c54fca14cdf2b5a66fbf128eaf40
# Parent cea1569d9efd3f89188f455e9eb101ac3ce48594
Fix for LibraryDatasetDatasetAssociation objects when created by importing a history item iinto a library, the copied_from_history_dataset_association_id will now be kept.
Add a get_display_name() method to the LibraryDatasetDatasetAssociation class.
Fix for the test_forms_and_requests.py functional test script, purge all created libraries created during the tests so following test runs will test correctly.
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -932,7 +932,7 @@ class LibraryFolder( object ):
return [ ld for ld in self.datasets if not ld.library_dataset_dataset_association.dataset.deleted ]
@property
def active_datasets( self ):
- # This needs to be a list
+ # This needs to be a list
return [ ld.library_dataset_dataset_association.dataset for ld in self.datasets if not ld.library_dataset_dataset_association.deleted ]
def get_display_name( self ):
# Library folder name can be either a string or a unicode object. If string,
@@ -997,8 +997,10 @@ class LibraryDatasetDatasetAssociation(
# FIXME: sa_session is must be passed to DataSetInstance if the create_dataset
# parameter in kwd is True so that the new object can be flushed. Is there a better way?
DatasetInstance.__init__( self, sa_session=sa_session, **kwd )
- self.copied_from_history_dataset_association = copied_from_history_dataset_association
- self.copied_from_library_dataset_dataset_association = copied_from_library_dataset_dataset_association
+ if copied_from_history_dataset_association:
+ self.copied_from_history_dataset_association_id = copied_from_history_dataset_association.id
+ if copied_from_library_dataset_dataset_association:
+ self.copied_from_library_dataset_dataset_association_id = copied_from_library_dataset_dataset_association.id
self.library_dataset = library_dataset
self.user = user
def to_history_dataset_association( self, target_history, parent_id = None, add_to_history = False ):
@@ -1085,6 +1087,15 @@ class LibraryDatasetDatasetAssociation(
else:
return template.get_widgets( trans.user )
return []
+ def get_display_name( self ):
+ """
+ LibraryDatasetDatasetAssociation name can be either a string or a unicode object.
+ If string, convert to unicode object assuming 'utf-8' format.
+ """
+ ldda_name = self.name
+ if isinstance( ldda_name, str ):
+ ldda_name = unicode( ldda_name, 'utf-8' )
+ return ldda_name
class LibraryInfoAssociation( object ):
def __init__( self, library, form_definition, info, inheritable=False ):
--- a/test/functional/test_forms_and_requests.py
+++ b/test/functional/test_forms_and_requests.py
@@ -382,6 +382,16 @@ class TestFormsAndRequests( TwillTestCas
sa_session.delete( a )
sa_session.flush()
##################
+ # Purge all libraries
+ ##################
+ for library in [ library_one ]:
+ self.delete_library_item( 'library_admin',
+ self.security.encode_id( library.id ),
+ self.security.encode_id( library.id ),
+ library.name,
+ item_type='library' )
+ self.purge_library( self.security.encode_id( library.id ), library.name )
+ ##################
# Eliminate all non-private roles
##################
for role in [ role_one, role_two ]:
1
0

galaxy-dist commit 6d218af7906a: Add history import and export functionality to Galaxy. Options for exporting the current history to a file or importing a history from a file are now listed in the history options menu. Also modified the form builder to support file inputs.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User jeremy goecks <jeremy.goecks(a)emory.edu>
# Date 1275581854 14400
# Node ID 6d218af7906af1f9524d02f785885bf1fd508f16
# Parent a12eeed213ff6d8581073ad77914b12dfc26f9bd
Add history import and export functionality to Galaxy. Options for exporting the current history to a file or importing a history from a file are now listed in the history options menu. Also modified the form builder to support file inputs.
--- a/templates/root/index.mako
+++ b/templates/root/index.mako
@@ -35,12 +35,19 @@
"Show structure": function() {
galaxy_main.location = "${h.url_for( controller='history', action='display_structured' )}";
},
+ "Export to File": function() {
+ galaxy_main.location = "${h.url_for( controller='history', action='export_archive' )}";
+ },
"Delete": function()
{
if ( confirm( "Really delete the current history?" ) )
{
galaxy_main.location = "${h.url_for( controller='history', action='delete_current' )}";
}
+ },
+ "Other Actions": null,
+ "Import from File": function() {
+ galaxy_main.location = "${h.url_for( controller='history', action='import_archive' )}";
}
});
});
--- a/templates/form.mako
+++ b/templates/form.mako
@@ -55,7 +55,18 @@
<div class="form" style="margin: 1em"><div class="form-title">${form.title}</div><div class="form-body">
- <form name="${form.name}" action="${form.action}" method="post" >
+ <%
+ has_file_input = False
+ for input in form.inputs:
+ if input.type == 'file':
+ has_file_input = True
+ break
+ %>
+ <form name="${form.name}" action="${form.action}" method="post"
+ %if has_file_input:
+ enctype="multipart/form-data"
+ %endif
+ >
%for input in form.inputs:
<%
cls = "form-row"
--- /dev/null
+++ b/database/export/info.txt
@@ -0,0 +1,1 @@
+This folder contains the data that can be exported.
--- a/lib/galaxy/web/controllers/history.py
+++ b/lib/galaxy/web/controllers/history.py
@@ -6,9 +6,10 @@ from galaxy.model.mapping import desc
from galaxy.model.orm import *
from galaxy.util.json import *
from galaxy.util.sanitize_html import sanitize_html
+from galaxy.tools.actions import upload_common
from galaxy.tags.tag_handler import GalaxyTagHandler
from sqlalchemy.sql.expression import ClauseElement
-import webhelpers, logging, operator
+import webhelpers, logging, operator, tempfile, subprocess, shutil
from datetime import datetime
from cgi import escape
@@ -441,6 +442,226 @@ class HistoryController( BaseController,
self.add_item_annotation( trans, history, new_annotation )
trans.sa_session.flush()
return new_annotation
+
+ @web.expose
+ def import_archive( self, trans, archived_history=None ):
+ """ Import a history. """
+
+ if archived_history is not None:
+ # Import archived history.
+ try:
+ archive_file = archived_history.file
+
+ # Unpack archive in temporary directory.
+ temp_output_dir = tempfile.mkdtemp()
+ cmd = "pax -z -r < %s " % archive_file.name
+ temp_stderr_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
+ temp_stderr = open( temp_stderr_name, 'wb' )
+ proc = subprocess.Popen( args=cmd, shell=True, cwd=temp_output_dir, stderr=temp_stderr.fileno() )
+ returncode = proc.wait()
+ temp_stderr.close()
+
+ # Read history attributes.
+ history_attr_in = open( '%s/%s' % ( temp_output_dir, 'history_attrs.txt'), 'rb' )
+ history_attr_str = ''
+ buffsize = 1048576
+ try:
+ while True:
+ history_attr_str += history_attr_in.read( buffsize )
+ if not history_attr_str or len( history_attr_str ) % buffsize != 0:
+ break
+ except OverflowError:
+ pass
+ history_attrs = from_json_string( history_attr_str )
+
+ # Create history.
+ # TODO: set tags, annotations.
+ new_history = model.History( name='imported: %s' % history_attrs['name'].encode( 'utf-8' ), user=trans.user )
+ trans.sa_session.add( new_history )
+ trans.sa_session.flush()
+ # TODO: Ignore hid_counter for now since it just artificially increases the hid for all the history's HDAs.
+ #new_history.hid_counter = history_attrs['hid_counter']
+ new_history.genome_build = history_attrs['genome_build']
+ trans.sa_session.flush()
+
+ # Read datasets attributes.
+ datasets_attr_in = open( '%s/%s' % ( temp_output_dir, 'datasets_attrs.txt'), 'rb' )
+ datasets_attr_str = ''
+ buffsize = 1048576
+ try:
+ while True:
+ datasets_attr_str += datasets_attr_in.read( buffsize )
+ if not datasets_attr_str or len( datasets_attr_str ) % buffsize != 0:
+ break
+ except OverflowError:
+ pass
+ datasets_attrs = from_json_string( datasets_attr_str )
+
+ # Create datasets.
+ for dataset_attrs in datasets_attrs:
+ metadata = dataset_attrs['metadata']
+
+ # Create dataset and HDA.
+ hda = trans.app.model.HistoryDatasetAssociation( name = dataset_attrs['name'].encode( 'utf-8' ),
+ extension = dataset_attrs['extension'],
+ hid = dataset_attrs['hid'],
+ info = dataset_attrs['info'].encode( 'utf-8' ),
+ blurb = dataset_attrs['blurb'],
+ peek = dataset_attrs['peek'],
+ designation = dataset_attrs['designation'],
+ visible = dataset_attrs['visible'],
+ dbkey = metadata['dbkey'],
+ metadata = metadata,
+ history = new_history,
+ create_dataset = True,
+ sa_session = trans.sa_session )
+ hda.state = hda.states.OK
+ trans.sa_session.add( hda )
+ trans.sa_session.flush()
+ new_history.add_dataset( hda, genome_build = None )
+ permissions = trans.app.security_agent.history_get_default_permissions( new_history )
+ trans.app.security_agent.set_all_dataset_permissions( hda.dataset, permissions )
+ trans.sa_session.flush()
+
+ # Copy dataset data.
+ temp_dataset_name = '%s/datasets/%s' % ( temp_output_dir, dataset_attrs['file_name'] )
+ shutil.copyfile( temp_dataset_name, hda.file_name )
+
+ # TODO: set tags, annotations.
+
+ # Cleanup.
+ if os.path.exists( temp_output_dir ):
+ shutil.rmtree( temp_output_dir )
+
+ return trans.show_ok_message( message="History '%s' has been imported. " % history_attrs['name'] )
+ except Exception, e:
+ return trans.show_error_message( 'Error importing history archive. ' + str( e ) )
+
+
+ return trans.show_form(
+ web.FormBuilder( web.url_for(), "Import a History from an Archive", submit_text="Submit" )
+ .add_input( "file", "Archived History File", "archived_history", value=None, error=None )
+ )
+
+ @web.expose
+ def export_archive( self, trans, id=None ):
+ """ Export a history. """
+
+ # Get history to export.
+ if id:
+ history = self.get_history( trans, id, check_ownership=False, check_accessible=True )
+ else:
+ # Use current history.
+ history = trans.history
+
+ if not history:
+ return trans.show_error_message( "This history does not exist or you cannot export this history." )
+
+ history_export_dir_name = "./database/export"
+ archive_file_name = '%s/%s.tar.gz' % ( history_export_dir_name, trans.security.encode_id( history.id ) )
+ # TODO: for now, always create archive when exporting; this is for debugging purposes.
+ if True:
+ # Condition for only creating an archive when history is newer than archive:
+ #not os.path.exists ( archive_file_name ) or datetime.utcfromtimestamp( os.path.getmtime( archive_file_name ) ) < history.update_time:
+
+ # Create archive and stream back to client.
+
+ # Simple method to convert strings to unicode in utf-8 format. Method should be used for all user input.
+ def unicode_wrangler( a_string ):
+ a_string_type = type ( a_string )
+ if a_string_type is str:
+ return unicode( a_string, 'utf-8' )
+ elif a_string_type is unicode:
+ return a_string.encode( 'utf-8' )
+
+ try:
+ # Use temporary directory for temp output files.
+ temp_output_dir = tempfile.mkdtemp()
+
+ # Write history attributes to file.
+ # TODO: include tags, annotations.
+ history_attrs = {
+ "create_time" : history.create_time.__str__(),
+ "update_time" : history.update_time.__str__(),
+ "name" : unicode_wrangler( history.name ),
+ "hid_counter" : history.hid_counter,
+ "genome_build" : history.genome_build
+ }
+ history_attrs_file_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
+ history_attrs_out = open( history_attrs_file_name, 'w' )
+ history_attrs_out.write( to_json_string( history_attrs ) )
+ history_attrs_out.close()
+ new_name = '%s/%s' % ( temp_output_dir, "history_attrs.txt" )
+ os.rename( history_attrs_file_name, new_name )
+ history_attrs_file_name = new_name
+
+ # Write datasets' attributes to file.
+ # TODO: include tags, annotations.
+ datasets = self.get_history_datasets( trans, history )
+ datasets_attrs = []
+ for dataset in datasets:
+ attribute_dict = {
+ "create_time" : dataset.create_time.__str__(),
+ "update_time" : dataset.update_time.__str__(),
+ "hid" : dataset.hid,
+ "name" : unicode_wrangler( dataset.name ),
+ "info" : unicode_wrangler( dataset.info ),
+ "blurb" : dataset.blurb,
+ "peek" : dataset.peek,
+ "extension" : dataset.extension,
+ "metadata" : dict( dataset.metadata.items() ),
+ "parent_id" : dataset.parent_id,
+ "designation" : dataset.designation,
+ "deleted" : dataset.deleted,
+ "visible" : dataset.visible,
+ "file_name" : dataset.file_name.split('/')[-1]
+ }
+ datasets_attrs.append( attribute_dict )
+ datasets_attrs_file_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
+ datasets_attrs_out = open( datasets_attrs_file_name, 'w' )
+ datasets_attrs_out.write( to_json_string( datasets_attrs ) )
+ datasets_attrs_out.close()
+ new_name = '%s/%s' % ( temp_output_dir, "datasets_attrs.txt" )
+ os.rename( datasets_attrs_file_name, new_name )
+ datasets_attrs_file_name = new_name
+
+ # Write temp file with all files to archive. These files are (a) history attributes file; (b) datasets attributes file; and (c)
+ # datasets files.
+ archive_list_file_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
+ archive_list_out = open( archive_list_file_name, 'w' )
+ archive_list_out.write( '%s\n' % history_attrs_file_name )
+ archive_list_out.write( '%s\n' % datasets_attrs_file_name )
+ for dataset in datasets:
+ archive_list_out.write( '%s\n' % dataset.file_name )
+ archive_list_out.close()
+
+ # Use 'pax' to create compressed tar archive of history's datasets. -s options uses a regular expression to replace path
+ # information.
+ cmd = "pax -w -s ',.*history_attrs.txt,history_attrs.txt,' -s ',.*datasets_attrs.txt,datasets_attrs.txt,' -s ',/.*/,datasets/,' -x tar -z -f %s.tar.gz < %s" % ( trans.security.encode_id( history.id ), archive_list_file_name )
+ temp_stderr_name = tempfile.NamedTemporaryFile( dir=temp_output_dir ).name
+ temp_stderr = open( temp_stderr_name, 'wb' )
+ proc = subprocess.Popen( args=cmd, shell=True, cwd=history_export_dir_name, stderr=temp_stderr.fileno() )
+ returncode = proc.wait()
+ temp_stderr.close()
+
+ # Remove temp directory.
+ if os.path.exists( temp_output_dir ):
+ shutil.rmtree( temp_output_dir )
+
+ except Exception, e:
+ return trans.show_error_message( 'Error creating history archive. ' + str( e ) )
+
+ # Stream archive.
+ archive_file_name = '%s/%s.tar.gz' % ( history_export_dir_name, trans.security.encode_id( history.id ) )
+ if os.path.exists( archive_file_name ):
+ valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ hname = history.name
+ hname = ''.join(c in valid_chars and c or '_' for c in hname)[0:150]
+ trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy-History-%s.tar.gz" % ( hname )
+ trans.response.set_content_type( 'application/x-gzip' )
+ return open( archive_file_name )
+ else:
+ return
@web.expose
@web.json
1
0

galaxy-dist commit 1dba26a363ab: Enhancements for the library dataset information page: display all metadata elements, and if in the admin view, display all undeleted history items and other undeleted library datasets that use the current library dataset's disk file.
by commits-noreply@bitbucket.org 07 Jun '10
by commits-noreply@bitbucket.org 07 Jun '10
07 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Greg Von Kuster <greg(a)bx.psu.edu>
# Date 1275503359 14400
# Node ID 1dba26a363abfb488b8021f3c86c75651fce81b0
# Parent ea2658d131b4c54fca14cdf2b5a66fbf128eaf40
Enhancements for the library dataset information page: display all metadata elements, and if in the admin view, display all undeleted history items and other undeleted library datasets that use the current library dataset's disk file.
--- a/templates/library/common/common.mako
+++ b/templates/library/common/common.mako
@@ -11,9 +11,9 @@
can_modify = trans.app.security_agent.can_modify_library_item( current_user_roles, item )
%>
%if widgets:
- <p/>
- <div class="toolForm">
- %if editable and ( cntrller=='library_admin' or trans.app.security_agent.can_modify_library_item( current_user_roles, item ) ):
+ %if editable and ( cntrller=='library_admin' or trans.app.security_agent.can_modify_library_item( current_user_roles, item ) ):
+ <p/>
+ <div class="toolForm"><div class="toolFormTitle">
%if inherited:
Other information <i>- this is an inherited template and is not required to be used with this ${item_type}</i>
@@ -54,20 +54,23 @@
</div></form></div>
- %else:
- <% contents = False %>
- %for i, field in enumerate( widgets ):
- %if field[ 'widget' ].value:
- <%
- contents = True
- break
- %>
- %endif
- %endfor
- %if contents:
- <div class="toolForm">
- <div class="toolFormTitle">Other information about ${item.name}</div>
- <div class="toolFormBody">
+ </div>
+ <p/>
+ %else:
+ <% contents = False %>
+ %for i, field in enumerate( widgets ):
+ %if field[ 'widget' ].value:
+ <%
+ contents = True
+ break
+ %>
+ %endif
+ %endfor
+ %if contents:
+ <p/>
+ <div class="toolForm">
+ <div class="toolFormTitle">Other information about ${item.name}</div>
+ <div class="toolFormBody">
%for i, field in enumerate( widgets ):
%if field[ 'widget' ].value:
<div class="form-row">
@@ -81,9 +84,10 @@
%endif
%endfor
</div>
- %endif
+ </div>
+ <p/>
%endif
- </div>
+ %endif
%endif
</%def>
--- a/lib/galaxy/web/controllers/library_common.py
+++ b/lib/galaxy/web/controllers/library_common.py
@@ -523,6 +523,20 @@ class LibraryCommon( BaseController ):
message=util.sanitize_text( message ),
status='error' ) )
library = trans.sa_session.query( trans.app.model.Library ).get( trans.security.decode_id( library_id ) )
+ if cntrller == 'library_admin':
+ # Get all associated hdas and lddas that use the same disk file.
+ associated_hdas = trans.sa_session.query( trans.model.HistoryDatasetAssociation ) \
+ .filter( and_( trans.model.HistoryDatasetAssociation.deleted == False,
+ trans.model.HistoryDatasetAssociation.dataset_id == ldda.dataset_id ) ) \
+ .all()
+ associated_lddas = trans.sa_session.query( trans.model.LibraryDatasetDatasetAssociation ) \
+ .filter( and_( trans.model.LibraryDatasetDatasetAssociation.deleted == False,
+ trans.model.LibraryDatasetDatasetAssociation.dataset_id == ldda.dataset_id,
+ trans.model.LibraryDatasetDatasetAssociation.id != ldda.id ) ) \
+ .all()
+ else:
+ associated_hdas = []
+ associated_lddas = []
# See if we have any associated templates
widgets = []
info_association, inherited = ldda.get_info_association()
@@ -534,6 +548,8 @@ class LibraryCommon( BaseController ):
use_panels=use_panels,
ldda=ldda,
library=library,
+ associated_hdas=associated_hdas,
+ associated_lddas=associated_lddas,
show_deleted=show_deleted,
widgets=widgets,
current_user_roles=current_user_roles,
@@ -702,15 +718,15 @@ class LibraryCommon( BaseController ):
if error:
status = 'error'
trans.response.send_redirect( web.url_for( controller='library_common',
- action='upload_library_dataset',
- cntrller=cntrller,
- library_id=library_id,
- folder_id=folder_id,
- replace_id=replace_id,
- upload_option=upload_option,
- show_deleted=show_deleted,
- message=util.sanitize_text( message ),
- status='error' ) )
+ action='upload_library_dataset',
+ cntrller=cntrller,
+ library_id=library_id,
+ folder_id=folder_id,
+ replace_id=replace_id,
+ upload_option=upload_option,
+ show_deleted=show_deleted,
+ message=util.sanitize_text( message ),
+ status='error' ) )
else:
# See if we have any inherited templates, but do not inherit contents.
@@ -722,13 +738,13 @@ class LibraryCommon( BaseController ):
template_id = 'None'
widgets = []
created_outputs_dict = trans.webapp.controllers[ 'library_common' ].upload_dataset( trans,
- cntrller=cntrller,
- library_id=library_id,
- folder_id=folder_id,
- template_id=template_id,
- widgets=widgets,
- replace_dataset=replace_dataset,
- **kwd )
+ cntrller=cntrller,
+ library_id=library_id,
+ folder_id=folder_id,
+ template_id=template_id,
+ widgets=widgets,
+ replace_dataset=replace_dataset,
+ **kwd )
if created_outputs_dict:
total_added = len( created_outputs_dict.keys() )
ldda_id_list = [ str( v.id ) for k, v in created_outputs_dict.items() ]
@@ -1094,6 +1110,8 @@ class LibraryCommon( BaseController ):
library = trans.sa_session.query( trans.app.model.Library ).get( trans.security.decode_id( library_id ) )
roles = trans.app.security_agent.get_legitimate_roles( trans, library, cntrller )
return trans.fill_template( "/library/common/upload.mako",
+ action='add_history_datasets_to_library',
+ cntrller=cntrller,
upload_option=upload_option,
library_id=library_id,
folder_id=folder_id,
@@ -1877,9 +1895,24 @@ def activatable_folders_and_lddas( trans
.all()
return folders, lddas
def branch_deleted( folder ):
- # Return True if a folder belongs to a branc that has been deleted
+ # Return True if a folder belongs to a branch that has been deleted
if folder.deleted:
return True
if folder.parent:
return branch_deleted( folder.parent )
return False
+def get_containing_library_from_library_dataset( trans, library_dataset ):
+ """Given a library_dataset, get the containing library"""
+ folder = library_dataset.folder
+ parent = folder
+ while folder.parent:
+ parent = folder.parent
+ # We have parent set to the library's root folder, which has the
+ # same name as the library
+ for library in trans.sa_session.query( trans.model.Library ) \
+ .filter( and_( trans.model.Library.table.c.deleted == False,
+ trans.model.Library.table.c.name == parent.name ) ):
+ if library.root_folder == parent:
+ return library
+ return None
+
--- a/templates/library/common/ldda_info.mako
+++ b/templates/library/common/ldda_info.mako
@@ -3,7 +3,8 @@
<%namespace file="/library/common/common.mako" import="render_template_info" /><%
from galaxy import util
- from galaxy.web.controllers.library_common import branch_deleted
+ from galaxy.web.controllers.library_common import branch_deleted, get_containing_library_from_library_dataset
+ from galaxy.web.framework.helpers import time_ago
if ldda == ldda.library_dataset.library_dataset_dataset_association:
current_version = True
@@ -64,11 +65,13 @@
%endif
</div><div class="toolFormBody">
- <div class="form-row">
- <label>Message:</label>
- <pre>${ldda.message}</pre>
- <div style="clear: both"></div>
- </div>
+ %if ldda.message:
+ <div class="form-row">
+ <label>Message:</label>
+ <pre>${ldda.message}</pre>
+ <div style="clear: both"></div>
+ </div>
+ %endif
<div class="form-row"><label>Uploaded by:</label>
${uploaded_by}
@@ -80,6 +83,11 @@
<div style="clear: both"></div></div><div class="form-row">
+ <label>File size:</label>
+ ${ldda.get_size( nice_size=True )}
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row"><label>Data type:</label>
${ldda.ext}
<div style="clear: both"></div>
@@ -97,6 +105,20 @@
<div class="form-row"><div>${ldda.blurb}</div></div>
+ %for name, spec in ldda.metadata.spec.items():
+ <div class="form-row">
+ <label>${spec.desc.replace( ' (click box & select)', '' )}:</label>
+ <%
+ metadata_val = ldda.metadata.get( name )
+ if isinstance( metadata_val, trans.model.MetadataFile ):
+ metadata_val = metadata_val.file_name
+ elif isinstance( metadata_val, list ):
+ metadata_val = ', '.join( metadata_val )
+ %>
+ ${metadata_val}
+ <div style="clear: both"></div>
+ </div>
+ %endfor
%if ldda.peek != "no peek":
<div class="form-row"><div id="info${ldda.id}" class="historyItemBody">
@@ -110,6 +132,79 @@
%if widgets:
${render_template_info( cntrller=cntrller, item_type='ldda', library_id=library_id, widgets=widgets, info_association=info_association, inherited=inherited, folder_id=trans.security.encode_id( ldda.library_dataset.folder.id ), ldda_id=trans.security.encode_id( ldda.id ), editable=False )}
%endif
+%if cntrller == 'library_admin':
+ %if associated_hdas:
+ <p/>
+ <b>History items that use this library dataset's disk file</b>
+ <div class="toolForm">
+ <table class="grid">
+ <thead>
+ <tr>
+ <th>History</th>
+ <th>History Item</th>
+ <th>Last Updated</th>
+ <th>User</th>
+ </tr>
+ </thead>
+ %for hda in associated_hdas:
+ <tr>
+ <td><a target="_blank" href="${h.url_for( controller='history', action='view', id=trans.security.encode_id( hda.history.id ) )}">${hda.history.get_display_name()}</a></td>
+ <td>${hda.get_display_name()}</td>
+ <td>${time_ago( hda.update_time )}</td>
+ <td>
+ %if hda.history.user:
+ ${hda.history.user.email}
+ %else:
+ anonymous
+ %endif
+ </td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ <p/>
+ %endif
+ %if associated_lddas:
+ <p/>
+ <b>Other library datasets that use this library dataset's disk file</b>
+ <div class="toolForm">
+ <table class="grid">
+ <thead>
+ <tr>
+ <th>Library</th>
+ <th>Library Folder</th>
+ <th>Library Dataset</th>
+ <th>Last Updated</th>
+ <th>User</th>
+ </tr>
+ </thead>
+ %for copied_ldda in associated_lddas:
+ <% containing_library = get_containing_library_from_library_dataset( trans, copied_ldda.library_dataset ) %>
+ <tr>
+ <td>
+ %if containing_library:
+ <a href="${h.url_for( controller='library_common', action='browse_library', id=trans.security.encode_id( containing_library.id ), cntrller=cntrller, use_panels=use_panels )}">${containing_library.get_display_name()}</a>
+ %else:
+ error finding library
+ %endif
+ </td>
+ <td>${copied_ldda.library_dataset.folder.get_display_name()}</td>
+ <td>${copied_ldda.get_display_name()}</td>
+ <td>${time_ago( copied_ldda.update_time )}</td>
+ <td>
+ %if copied_ldda.user:
+ ${copied_ldda.user.email}
+ %else:
+ anonymous
+ %endif
+ </td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ <p/>
+ %endif
+%endif
%if current_version:
<% expired_lddas = [ e_ldda for e_ldda in ldda.library_dataset.expired_datasets ] %>
%if expired_lddas:
1
0

galaxy-dist commit cea1569d9efd: add fly_modencode, worm_modencode, and wormbase tools to main
by commits-noreply@bitbucket.org 01 Jun '10
by commits-noreply@bitbucket.org 01 Jun '10
01 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1275405570 14400
# Node ID cea1569d9efd3f89188f455e9eb101ac3ce48594
# Parent f65470ca24068dfb7e8c4539e2c30f64402224c1
add fly_modencode, worm_modencode, and wormbase tools to main
--- a/tool_conf.xml.main
+++ b/tool_conf.xml.main
@@ -9,6 +9,9 @@
<tool file="data_source/biomart.xml" /><tool file="data_source/gramene_mart.xml" /><tool file="data_source/flymine.xml" />
+ <tool file="data_source/fly_modencode.xml" />
+ <tool file="data_source/worm_modencode.xml" />
+ <tool file="data_source/wormbase.xml" /><tool file="data_source/eupathdb.xml" /><tool file="data_source/encode_db.xml" /><tool file="data_source/epigraph_import.xml" />
1
0

galaxy-dist commit bf51b81ec7b2: Add missing location files for buildbot
by commits-noreply@bitbucket.org 01 Jun '10
by commits-noreply@bitbucket.org 01 Jun '10
01 Jun '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Nate Coraor <nate(a)bx.psu.edu>
# Date 1274977347 14400
# Node ID bf51b81ec7b25d05676a408d0d12e773d538ef10
# Parent fbb990ec01fa7ee3bd9b13ea3f610c8463ad64b8
Add missing location files for buildbot
--- a/buildbot_setup.sh
+++ b/buildbot_setup.sh
@@ -25,6 +25,7 @@ case "$OSTYPE" in
esac
LINKS="
+/galaxy/data/location/add_scores.loc
/galaxy/data/location/alignseq.loc
/galaxy/data/annotation_profiler
/galaxy/data/annotation_profiler/annotation_profiler.loc
@@ -35,6 +36,7 @@ LINKS="
/galaxy/data/location/bowtie_indices.loc
/galaxy/data/location/bowtie_indices_color.loc
/galaxy/data/location/bwa_index.loc
+/galaxy/data/location/codingSnps.loc
/galaxy/data/location/encode_datasets.loc
/galaxy/home/universe/encode_feature_partitions
/galaxy/data/location/lastz_seqs.loc
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/58108ced520b
changeset: 3820:58108ced520b
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon May 24 16:11:13 2010 -0400
description:
Committed mod_zip code from the wrong repo
diffstat:
lib/galaxy/web/controllers/library_common.py | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diffs (48 lines):
diff -r d1624544bc55 -r 58108ced520b lib/galaxy/web/controllers/library_common.py
--- a/lib/galaxy/web/controllers/library_common.py Mon May 24 16:00:03 2010 -0400
+++ b/lib/galaxy/web/controllers/library_common.py Mon May 24 16:11:13 2010 -0400
@@ -1267,7 +1267,7 @@
for fname, relpath in self.files.items():
size = os.stat( fname ).st_size
quoted_fname = urllib.quote_plus( fname, '/' )
- rval += '- %i %s%s %s\n' % ( size, self.url_base, quoted_fname, relpath )
+ rval += '- %i %s%s %s\r\n' % ( size, self.url_base, quoted_fname, relpath )
return rval
# Perform an action on a list of library datasets.
params = util.Params( kwd )
@@ -1429,6 +1429,8 @@
message = "Unable to create archive for download, please report this error"
status = 'error'
if not error:
+ lname = trans.sa_session.query( trans.app.model.Library ).get( trans.security.decode_id( library_id ) ).name
+ fname = lname.replace( ' ', '_' ) + '_files'
if action == 'zip':
archive.close()
tmpfh = open( tmpf )
@@ -1443,21 +1445,21 @@
status = 'error'
if not error:
trans.response.set_content_type( "application/x-zip-compressed" )
- trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (outfname,outext)
+ trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (fname,outext)
return tmpfh
elif action == 'ngxzip':
- #trans.response.set_content_type( "application/x-zip-compressed" )
- #trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (outfname,outext)
+ trans.response.set_content_type( "application/x-zip-compressed" )
+ trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (fname,outext)
trans.response.headers[ "X-Archive-Files" ] = "zip"
return archive
else:
trans.response.set_content_type( "application/x-tar" )
- trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (outfname,outext)
+ trans.response.headers[ "Content-Disposition" ] = "attachment; filename=%s.%s" % (fname,outext)
archive.wsgi_status = trans.response.wsgi_status()
archive.wsgi_headeritems = trans.response.wsgi_headeritems()
return archive.stream
else: # unknown action
- message = '### unknown action = %s in act_on_multiple_datasets' % action
+ message = '### unknown action = %s in act_on_multiple_datasets' % action
return trans.response.send_redirect( web.url_for( controller='library_common',
action='browse_library',
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/d1624544bc55
changeset: 3819:d1624544bc55
user: rc
date: Mon May 24 16:00:03 2010 -0400
description:
lims: ui fixes in adding samples
diffstat:
lib/galaxy/web/controllers/requests.py | 63 +++++++++++++++----------
lib/galaxy/web/controllers/requests_admin.py | 63 +++++++++++++++----------
templates/admin/requests/show_request.mako | 52 ++++++++++++++------
templates/requests/show_request.mako | 69 +++++++++++++++++----------
test/base/twilltestcase.py | 6 +-
5 files changed, 159 insertions(+), 94 deletions(-)
diffs (388 lines):
diff -r f7525fb463e0 -r d1624544bc55 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Mon May 24 15:33:55 2010 -0400
+++ b/lib/galaxy/web/controllers/requests.py Mon May 24 16:00:03 2010 -0400
@@ -288,7 +288,7 @@
sample_copy=self.__copy_sample(current_samples),
details='hide', edit_mode=util.restore_text( params.get( 'edit_mode', 'False' ) ),
message=message, status=status )
- def __library_widgets(self, trans, user, sample_index, libraries, sample=None, **kwd):
+ def __library_widgets(self, trans, user, sample_index, libraries, sample=None, lib_id=None, folder_id=None, **kwd):
'''
This method creates the data library & folder selectbox for creating &
editing samples. First we get a list of all the libraries accessible to
@@ -298,7 +298,8 @@
'''
params = util.Params( kwd )
# data library selectbox
- lib_id = params.get( "sample_%i_library_id" % sample_index, 'none' )
+ if not lib_id:
+ lib_id = params.get( "sample_%i_library_id" % sample_index, 'none' )
selected_lib = None
if sample and lib_id == 'none':
if sample.library:
@@ -317,7 +318,7 @@
lib_widget.add_option('Select one', 'none')
# all the libraries available to the selected user
for lib, hidden_folder_ids in libraries.items():
- if str(lib.id) == lib_id:
+ if str(lib.id) == str(lib_id):
lib_widget.add_option(lib.name, lib.id, selected=True)
selected_lib, selected_hidden_folder_ids = lib, hidden_folder_ids.split(',')
else:
@@ -338,7 +339,10 @@
else:
current_fid = params.get( "sample_%i_folder_id" % sample_index, 'none' )
else:
- current_fid = 'none'
+ if folder_id:
+ current_fid = folder_id
+ else:
+ current_fid = 'none'
# first option
if lib_id == 'none':
folder_widget.add_option('Select one', 'none', selected=True)
@@ -479,29 +483,38 @@
# if the user has selected a sample no. to copy then copy the contents
# of the src sample to the new sample else an empty sample
src_sample_index = int(params.get( 'copy_sample', -1 ))
+ # get the number of new copies of the src sample
+ num_sample_to_copy = int(params.get( 'num_sample_to_copy', 1 ))
if src_sample_index == -1:
- # empty sample
- lib_widget, folder_widget = self.__library_widgets(trans, request.user,
- len(current_samples),
- libraries, None, **kwd)
- current_samples.append(dict(name='Sample_%i' % (len(current_samples)+1),
- barcode='',
- library=None,
- folder=None,
- field_values=['' for field in request.type.sample_form.fields],
- lib_widget=lib_widget,
- folder_widget=folder_widget))
+ for ns in range(num_sample_to_copy):
+ # empty sample
+ lib_widget, folder_widget = self.__library_widgets(trans, request.user,
+ len(current_samples),
+ libraries, None, **kwd)
+ current_samples.append(dict(name='Sample_%i' % (len(current_samples)+1),
+ barcode='',
+ library=None,
+ folder=None,
+ field_values=['' for field in request.type.sample_form.fields],
+ lib_widget=lib_widget,
+ folder_widget=folder_widget))
else:
- lib_widget, folder_widget = self.__library_widgets(trans, request.user,
- len(current_samples),
- libraries, None, **kwd)
- current_samples.append(dict(name=current_samples[src_sample_index]['name']+'_%i' % (len(current_samples)+1),
- barcode='',
- library_id='none',
- folder_id='none',
- field_values=[val for val in current_samples[src_sample_index]['field_values']],
- lib_widget=lib_widget,
- folder_widget=folder_widget))
+ src_library_id = current_samples[src_sample_index]['lib_widget'].get_selected()[1]
+ src_folder_id = current_samples[src_sample_index]['folder_widget'].get_selected()[1]
+ for ns in range(num_sample_to_copy):
+ lib_widget, folder_widget = self.__library_widgets(trans, request.user,
+ len(current_samples),
+ libraries, sample=None,
+ lib_id=src_library_id,
+ folder_id=src_folder_id,
+ **kwd)
+ current_samples.append(dict(name=current_samples[src_sample_index]['name']+'_%i' % (len(current_samples)+1),
+ barcode='',
+ library_id='none',
+ folder_id='none',
+ field_values=[val for val in current_samples[src_sample_index]['field_values']],
+ lib_widget=lib_widget,
+ folder_widget=folder_widget))
return trans.fill_template( '/requests/show_request.mako',
request=request,
request_details=self.request_details(trans, request.id),
diff -r f7525fb463e0 -r d1624544bc55 lib/galaxy/web/controllers/requests_admin.py
--- a/lib/galaxy/web/controllers/requests_admin.py Mon May 24 15:33:55 2010 -0400
+++ b/lib/galaxy/web/controllers/requests_admin.py Mon May 24 16:00:03 2010 -0400
@@ -805,7 +805,7 @@
sample_copy=self.__copy_sample(current_samples),
details='hide', edit_mode=util.restore_text( params.get( 'edit_mode', 'False' ) ),
message=message, status=status )
- def __library_widgets(self, trans, user, sample_index, libraries, sample=None, **kwd):
+ def __library_widgets(self, trans, user, sample_index, libraries, sample=None, lib_id=None, folder_id=None, **kwd):
'''
This method creates the data library & folder selectbox for creating &
editing samples. First we get a list of all the libraries accessible to
@@ -815,7 +815,8 @@
'''
params = util.Params( kwd )
# data library selectbox
- lib_id = params.get( "sample_%i_library_id" % sample_index, 'none' )
+ if not lib_id:
+ lib_id = params.get( "sample_%i_library_id" % sample_index, 'none' )
selected_lib = None
if sample and lib_id == 'none':
if sample.library:
@@ -834,7 +835,7 @@
lib_widget.add_option('Select one', 'none')
# all the libraries available to the selected user
for lib, hidden_folder_ids in libraries.items():
- if str(lib.id) == lib_id:
+ if str(lib.id) == str(lib_id):
lib_widget.add_option(lib.name, lib.id, selected=True)
selected_lib, selected_hidden_folder_ids = lib, hidden_folder_ids.split(',')
else:
@@ -855,7 +856,10 @@
else:
current_fid = params.get( "sample_%i_folder_id" % sample_index, 'none' )
else:
- current_fid = 'none'
+ if folder_id:
+ current_fid = folder_id
+ else:
+ current_fid = 'none'
# first option
if lib_id == 'none':
folder_widget.add_option('Select one', 'none', selected=True)
@@ -995,29 +999,38 @@
# if the user has selected a sample no. to copy then copy the contents
# of the src sample to the new sample else an empty sample
src_sample_index = int(params.get( 'copy_sample', -1 ))
+ # get the number of new copies of the src sample
+ num_sample_to_copy = int(params.get( 'num_sample_to_copy', 1 ))
if src_sample_index == -1:
- # empty sample
- lib_widget, folder_widget = self.__library_widgets(trans, request.user,
- len(current_samples),
- libraries, None, **kwd)
- current_samples.append(dict(name='Sample_%i' % (len(current_samples)+1),
- barcode='',
- library=None,
- folder=None,
- field_values=['' for field in request.type.sample_form.fields],
- lib_widget=lib_widget,
- folder_widget=folder_widget))
+ for ns in range(num_sample_to_copy):
+ # empty sample
+ lib_widget, folder_widget = self.__library_widgets(trans, request.user,
+ len(current_samples),
+ libraries, None, **kwd)
+ current_samples.append(dict(name='Sample_%i' % (len(current_samples)+1),
+ barcode='',
+ library=None,
+ folder=None,
+ field_values=['' for field in request.type.sample_form.fields],
+ lib_widget=lib_widget,
+ folder_widget=folder_widget))
else:
- lib_widget, folder_widget = self.__library_widgets(trans, request.user,
- len(current_samples),
- libraries, None, **kwd)
- current_samples.append(dict(name=current_samples[src_sample_index]['name']+'_%i' % (len(current_samples)+1),
- barcode='',
- library_id='none',
- folder_id='none',
- field_values=[val for val in current_samples[src_sample_index]['field_values']],
- lib_widget=lib_widget,
- folder_widget=folder_widget))
+ src_library_id = current_samples[src_sample_index]['lib_widget'].get_selected()[1]
+ src_folder_id = current_samples[src_sample_index]['folder_widget'].get_selected()[1]
+ for ns in range(num_sample_to_copy):
+ lib_widget, folder_widget = self.__library_widgets(trans, request.user,
+ len(current_samples),
+ libraries, sample=None,
+ lib_id=src_library_id,
+ folder_id=src_folder_id,
+ **kwd)
+ current_samples.append(dict(name=current_samples[src_sample_index]['name']+'_%i' % (len(current_samples)+1),
+ barcode='',
+ library_id='none',
+ folder_id='none',
+ field_values=[val for val in current_samples[src_sample_index]['field_values']],
+ lib_widget=lib_widget,
+ folder_widget=folder_widget))
return trans.fill_template( '/admin/requests/show_request.mako',
request=request,
request_details=self.request_details(trans, request.id),
diff -r f7525fb463e0 -r d1624544bc55 templates/admin/requests/show_request.mako
--- a/templates/admin/requests/show_request.mako Mon May 24 15:33:55 2010 -0400
+++ b/templates/admin/requests/show_request.mako Mon May 24 16:00:03 2010 -0400
@@ -444,8 +444,7 @@
%else:
<label>There are no samples.</label>
%endif
- </div>
-
+ </div>
%if request.samples and request.submitted():
<script type="text/javascript">
// Updater
@@ -458,25 +457,23 @@
<tbody>
<tr>
<div class="form-row">
+
+ %if request.unsubmitted():
+ <td>
+ %if current_samples:
+ <label>Copy </label>
+ <input type="integer" name="num_sample_to_copy" value="1" size="3"/>
+ <label>sample(s) from sample</label>
+ ${sample_copy.get_html()}
+ %endif
+ <input type="submit" name="add_sample_button" value="Add New"/>
+ </td>
+ %endif
<td>
%if current_samples:
<input type="submit" name="edit_samples_button" value="Edit samples"/>
%endif
</td>
- %if request.unsubmitted():
- <td>
- <label>Import from csv file</label>
- <input type="file" name="file_data" />
- <input type="submit" name="import_samples_button" value="Import samples"/>
- </td>
- <td>
- %if current_samples:
- <label>Copy from sample</label>
- ${sample_copy.get_html()}
- %endif
- <input type="submit" name="add_sample_button" value="Add New"/>
- </td>
- %endif
</div>
</tr>
</tbody>
@@ -504,3 +501,26 @@
<input type="hidden" name="request_id" value="${request.id}" />
</form>
</div>
+
+<br/>
+
+%if request.unsubmitted():
+<div class="toolForm">
+ <div class="form-row">
+ <div class="msg_list">
+ <h4 class="msg_head"><u>Import Samples</u></h4>
+ <div class="msg_body">
+ <label>Import from csv file</label>
+ <input type="file" name="file_data" />
+ <input type="submit" name="import_samples_button" value="Import samples"/>
+ <br/>
+ <div class="toolParamHelp" style="clear: both;">
+ The csv file must be in the following format:<br/>
+ SampleName,DataLibrary,DataLibraryFolder,FieldValue1,FieldValue2...
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+%endif
+
diff -r f7525fb463e0 -r d1624544bc55 templates/requests/show_request.mako
--- a/templates/requests/show_request.mako Mon May 24 15:33:55 2010 -0400
+++ b/templates/requests/show_request.mako Mon May 24 16:00:03 2010 -0400
@@ -364,31 +364,28 @@
%endif
</div>
%if request.unsubmitted() and edit_mode == 'False':
- <table class="grid">
- <tbody>
- <tr>
- <div class="form-row">
- <td>
- %if current_samples:
- <input type="submit" name="edit_samples_button" value="Edit samples"/>
- %endif
- </td>
- <td>
- <label>Import from csv file</label>
- <input type="file" name="file_data" />
- <input type="submit" name="import_samples_button" value="Import samples"/>
- </td>
- <td>
- %if current_samples:
- <label>Copy from sample</label>
- ${sample_copy.get_html()}
- %endif
- <input type="submit" name="add_sample_button" value="Add New"/>
- </td>
- </div>
- </tr>
- </tbody>
- </table>
+ <table class="grid">
+ <tbody>
+ <tr>
+ <div class="form-row">
+ <td>
+ %if current_samples:
+ <label>Copy </label>
+ <input type="integer" name="num_sample_to_copy" value="1" size="3"/>
+ <label>sample(s) from sample</label>
+ ${sample_copy.get_html()}
+ %endif
+ <input type="submit" name="add_sample_button" value="Add New"/>
+ </td>
+ <td>
+ %if current_samples:
+ <input type="submit" name="edit_samples_button" value="Edit samples"/>
+ %endif
+ </td>
+ </div>
+ </tr>
+ </tbody>
+ </table>
%endif
%if request.unsubmitted() and (request.samples or current_samples):
<div class="form-row">
@@ -407,3 +404,25 @@
<input type="hidden" name="request_id" value="${request.id}" />
</form>
</div>
+
+
+<br/>
+%if request.unsubmitted():
+<div class="toolForm">
+ <div class="form-row">
+ <div class="msg_list">
+ <h4 class="msg_head"><u>Import Samples</u></h4>
+ <div class="msg_body">
+ <label>Import from csv file</label>
+ <input type="file" name="file_data" />
+ <input type="submit" name="import_samples_button" value="Import samples"/>
+ <br/>
+ <div class="toolParamHelp" style="clear: both;">
+ The csv file must be in the following format:<br/>
+ SampleName,DataLibrary,DataLibraryFolder,FieldValue1,FieldValue2...
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+%endif
diff -r f7525fb463e0 -r d1624544bc55 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon May 24 15:33:55 2010 -0400
+++ b/test/base/twilltestcase.py Mon May 24 16:00:03 2010 -0400
@@ -1572,14 +1572,14 @@
self.check_page_for_string( 'There are no samples.' )
# this redundant stmt below is add so that the second form in
# the page gets selected
- tc.fv( "2", "request_id", request_id )
+ tc.fv( "3", "request_id", request_id )
for sample_index, sample in enumerate(samples):
tc.submit( "add_sample_button" )
self.check_page_for_string( 'Sequencing Request "%s"' % request_name )
sample_name, fields = sample
- tc.fv( "2", "sample_%i_name" % sample_index, sample_name )
+ tc.fv( "3", "sample_%i_name" % sample_index, sample_name )
for field_index, field_value in enumerate(fields):
- tc.fv( "2", "sample_%i_field_%i" % ( sample_index, field_index ), field_value )
+ tc.fv( "3", "sample_%i_field_%i" % ( sample_index, field_index ), field_value )
tc.submit( "save_samples_button" )
for sample_name, fields in samples:
self.check_page_for_string( sample_name )
1
0

25 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/f7525fb463e0
changeset: 3818:f7525fb463e0
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Mon May 24 15:33:55 2010 -0400
description:
Allow FASTQ Groomer/parser to work on tab-delimited decimal scores.
diffstat:
lib/galaxy_utils/sequence/fastq.py | 11 ++++++++---
test-data/sanger_full_range_as_tab_decimal_sanger.fastqsanger | 8 ++++++++
tools/fastq/fastq_groomer.xml | 11 ++++++++++-
3 files changed, 26 insertions(+), 4 deletions(-)
diffs (72 lines):
diff -r 86fe916dbdb5 -r f7525fb463e0 lib/galaxy_utils/sequence/fastq.py
--- a/lib/galaxy_utils/sequence/fastq.py Mon May 24 15:10:31 2010 -0400
+++ b/lib/galaxy_utils/sequence/fastq.py Mon May 24 15:33:55 2010 -0400
@@ -41,7 +41,12 @@
def convert_color_to_base_space( cls, sequence ):
return cls.color_space_converter.to_base_space( sequence )
def is_ascii_encoded( self ):
- return ' ' not in self.quality #as per fastq definition only decimal quality strings can have spaces in them (and must have a trailing space)
+ #as per fastq definition only decimal quality strings can have spaces (and TABs for our purposes) in them (and must have a trailing space)
+ if ' ' in self.quality:
+ return False
+ if '\t' in self.quality:
+ return False
+ return True
def get_ascii_quality_scores( self ):
if self.is_ascii_encoded():
return list( self.quality )
@@ -49,7 +54,7 @@
quality = self.quality.rstrip() #decimal scores should have a trailing space
if quality:
try:
- return [ chr( int( val ) + self.ascii_min - self.quality_min ) for val in quality.split( ' ' ) ]
+ return [ chr( int( val ) + self.ascii_min - self.quality_min ) for val in quality.split() ]
except ValueError, e:
raise ValueError( 'Error Parsing quality String. ASCII quality strings cannot contain spaces (%s): %s' % ( self.quality, e ) )
else:
@@ -60,7 +65,7 @@
else:
quality = self.quality.rstrip() #decimal scores should have a trailing space
if quality:
- return [ int( val ) for val in quality.split( ' ' ) if val.strip() ]
+ return [ int( val ) for val in quality.split() if val.strip() ]
else:
return []
def convert_read_to_format( self, format, force_quality_encoding = None ):
diff -r 86fe916dbdb5 -r f7525fb463e0 test-data/sanger_full_range_as_tab_decimal_sanger.fastqsanger
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sanger_full_range_as_tab_decimal_sanger.fastqsanger Mon May 24 15:33:55 2010 -0400
@@ -0,0 +1,8 @@
+@FAKE0001 Original version has PHRED scores from 0 to 93 inclusive (in that order)
+ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTAC
++
+0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
+@FAKE0002 Original version has PHRED scores from 93 to 0 inclusive (in that order)
+CATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCATGCA
++
+93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
diff -r 86fe916dbdb5 -r f7525fb463e0 tools/fastq/fastq_groomer.xml
--- a/tools/fastq/fastq_groomer.xml Mon May 24 15:10:31 2010 -0400
+++ b/tools/fastq/fastq_groomer.xml Mon May 24 15:33:55 2010 -0400
@@ -1,4 +1,4 @@
-<tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.2">
+<tool id="fastq_groomer" name="FASTQ Groomer" version="1.0.3">
<description>convert between various FASTQ quality formats</description>
<command interpreter="python">fastq_groomer.py '$input_file' '$input_type' '$output_file'
#if str( $options_type['options_type_selector'] ) == 'basic':
@@ -288,6 +288,15 @@
<param name="summarize_input" value="summarize_input" />
<output name="output_file" file="sanger_full_range_as_decimal_sanger.fastqsanger" />
</test>
+ <test>
+ <param name="input_file" value="sanger_full_range_as_tab_decimal_sanger.fastqsanger" ftype="fastq" />
+ <param name="input_type" value="sanger" />
+ <param name="options_type_selector" value="advanced" />
+ <param name="output_type" value="sanger" />
+ <param name="force_quality_encoding" value="ascii" />
+ <param name="summarize_input" value="summarize_input" />
+ <output name="output_file" file="sanger_full_range_original_sanger.fastqsanger" />
+ </test>
<!-- Solexa, range -5 - 62 -->
<test>
<param name="input_file" value="solexa_full_range_as_decimal_solexa.fastqsolexa" ftype="fastq" />
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/86fe916dbdb5
changeset: 3817:86fe916dbdb5
user: rc
date: Mon May 24 15:10:31 2010 -0400
description:
fixed the status message box layout in grid
diffstat:
templates/grid_base.mako | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 8833ebe82ed1 -r 86fe916dbdb5 templates/grid_base.mako
--- a/templates/grid_base.mako Mon May 24 15:08:57 2010 -0400
+++ b/templates/grid_base.mako Mon May 24 15:10:31 2010 -0400
@@ -679,7 +679,12 @@
<tr>
<td width="75%">${self.render_grid_header( grid )}</td>
<td></td>
- <td width="25%" id="grid-message" valign="top">${render_message( message, status )}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td width="100%" id="grid-message" valign="top">${render_message( message, status )}</td>
+ <td></td>
+ <td></td>
</tr>
</table>
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/8833ebe82ed1
changeset: 3816:8833ebe82ed1
user: rc
date: Mon May 24 15:08:57 2010 -0400
description:
sff_converter tool functional test
diffstat:
test-data/2.sff | 0
test-data/sff_converter_fasta.dat | 6 ++
test-data/sff_converter_fastq.dat | 12 +++++
test-data/sff_converter_qual.dat | 6 ++
test-data/sff_converter_xml_1.dat | 18 ++++++++
test-data/sff_converter_xml_2.dat | 18 ++++++++
tools/filters/sff_extractor.xml | 83 +++++++++++++++++++++++--------------
7 files changed, 111 insertions(+), 32 deletions(-)
diffs (176 lines):
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/2.sff
Binary file test-data/2.sff has changed
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/sff_converter_fasta.dat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sff_converter_fasta.dat Mon May 24 15:08:57 2010 -0400
@@ -0,0 +1,6 @@
+>GGOQ6K301BJT46
+gactACACGTAGTATAAGCTAAATGTTGGAGAGGATGCTGTAATCAACGTTTTGTGTCTCCTTACAGGACACCAGCTGATTTGGAGGTCATCCAATATAAACCTGGCTGGAACTTGCTATGGTTAGGAGAGCTATGAATGGAAGAGATAATTCCATTATTTAATAAGGCTACAGACAAATTAGGACAAGAAGCAGCTATTAGATTATTTAGTGCTAGCACACCTAAATAGAGAGAGATAAATTCATTAGACTTTTTGCTAttttattgacttttggagagacagtatttaaagtaccaaatcccagaggttgcctatgttggtggtgttgcaagctctattattggcgattgcaatctaccttatccataagttctgcttagagattatttgttattaattttcatctacatcaataaatataggacagtaaggattttgtacaaaatagacaatgggataggtaccagaagaggacagaggaattactggtattttgatatagactacactaacgtacgtacgtaggaattttaaccgggg
+>GGOQ6K301AWPXS
+gactACGTACACACTGGAATAAAATGGAGTTTTCATACTAGAGATTATTATATGGGCTATGTAAAAGAACTAGTAGCAGGATCTAGCACACCAGACAGCCTAAGACTGTATATTTTATATAAGCAACCCGTTATGGCATGGGAAATATCGCCCAGGGTTAAAAAATTTTAACAAGGAATGGCCTTTTTGTAAATATGTGGATAAAAAACAGGGTTCATGTGGGATGATATTGAAAAACAAAAGATTTGCGTAGGAGGAGAAATATCACCAGGATGGGGACCTGGAATGGTTGGCATAGCAAATAAAAGCCTTTAGTTGTGGGGAGAGAAAAATCGAGGCAACTCCTGTTATGATTATAAGAGAAGAGATAGATCCCAAAAAATGGTGTGGAGATTGTTGGAATTTAATGTGTCTTAGAAACTCACCTCCAGGAACGTTGTCAAAGACTCGCTATGTTGGCATGTGGACGGaaagactaaatgttggagaggatgctgtatcaacgttttgttgtcgtccttacacggacaccagctgtagttgtctgtagnttttaccggg
+>GGOQ6K301A8J46
+gactACTATACGAGTCTGCCAATCTTCTTCACTCATCCCCTTCAGGAAGAGTGCAGGGTTCTGGGACTCTCCGTATGTGCCTCCTAGGTACAAGAAAATATCCCCTCTCTTCATCCTTTAATAACACTGATCCTTGTCCCCAATACTCTACTCTCATTGGTCCTTTCCAATTTTTGTCTTTTTTGATCTTTATAGTAAATCCACTGACCTTGCAATTTGCTTGGAATTTGAGAAAAATAATCCTGTATTCTTAATGATTCTTGTTGTGTTAATAATTCATATGGGGGCCATTCCCCCTATTCTACCCCTTTGTTTAAAATTAAGGCAATGCAGAGCGAGAGCCAAAGCATTGTCTAAAGATGTTGTTTCAGGCAAAAACTTCTGAATCCAACACTTTAAAGTATTATTggcattttcaaccaaagcttgagtattgagggttgcctggtattccaaatttatgttttattccctatgtaattgtagtaaaccttcctattttttgattttctaaaatttggtccctattgttctgtttgctagttctgtaactattatgagtccaacctgtttagg
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/sff_converter_fastq.dat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sff_converter_fastq.dat Mon May 24 15:08:57 2010 -0400
@@ -0,0 +1,12 @@
+@GGOQ6K301BJT46
+gactACACGTAGTATAAGCTAAATGTTGGAGAGGATGCTGTAATCAACGTTTTGTGTCTCCTTACAGGACACCAGCTGATTTGGAGGTCATCCAATATAAACCTGGCTGGAACTTGCTATGGTTAGGAGAGCTATGAATGGAAGAGATAATTCCATTATTTAATAAGGCTACAGACAAATTAGGACAAGAAGCAGCTATTAGATTATTTAGTGCTAGCACACCTAAATAGAGAGAGATAAATTCATTAGACTTTTTGCTAttttattgacttttggagagacagtatttaaagtaccaaatcccagaggttgcctatgttggtggtgttgcaagctctattattggcgattgcaatctaccttatccataagttctgcttagagattatttgttattaattttcatctacatcaataaatataggacagtaaggattttgtacaaaatagacaatgggataggtaccagaagaggacagaggaattactggtattttgatatagactacactaacgtacgtacgtaggaattttaaccgggg
++
+FFFFFFFFFFFFFFFIIIIIHHHHHFFBBBFEDDFFFFFHHGFFFFFFF????FFFFFFDDFFFFF<==<ADDDDDDAC8::DCDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDDDFFFFFFFFFFFFFFFFFFFFFFA@@FFFFFFDD?????AAAAAB=??ADAACFFFFFDDDFFFFFFFFFDDDD544??8888000<2449=:<<?@841114?>AAAA?:::A???DBBA:::A?A//...::33,,,,------,,,,;;:89=9:9733...2223//9<688<444<AA::::8::BBAA@@>>>43434<4444449??@AA@BBBA:8:<A998<?4448<<<<244<3338<<>:884433822255,,,3--3,,,,,,,,,3774,,,33043///0,,,,,,,,,,,,111,,,,,),0....0),,,.,,,,,,,143.,,,.---86---20787777870206433,,,,,0,,,,,,,0..,,,...3,,,,-44444489965225666----
+@GGOQ6K301AWPXS
+gactACGTACACACTGGAATAAAATGGAGTTTTCATACTAGAGATTATTATATGGGCTATGTAAAAGAACTAGTAGCAGGATCTAGCACACCAGACAGCCTAAGACTGTATATTTTATATAAGCAACCCGTTATGGCATGGGAAATATCGCCCAGGGTTAAAAAATTTTAACAAGGAATGGCCTTTTTGTAAATATGTGGATAAAAAACAGGGTTCATGTGGGATGATATTGAAAAACAAAAGATTTGCGTAGGAGGAGAAATATCACCAGGATGGGGACCTGGAATGGTTGGCATAGCAAATAAAAGCCTTTAGTTGTGGGGAGAGAAAAATCGAGGCAACTCCTGTTATGATTATAAGAGAAGAGATAGATCCCAAAAAATGGTGTGGAGATTGTTGGAATTTAATGTGTCTTAGAAACTCACCTCCAGGAACGTTGTCAAAGACTCGCTATGTTGGCATGTGGACGGaaagactaaatgttggagaggatgctgtatcaacgttttgttgtcgtccttacacggacaccagctgtagttgtctgtagnttttaccggg
++
+FFFFFFFFFFFFFDDDFFD@3333BAA?95558HFFFFFHIIIIIIIHIIIHH?;;A???940000836?AAABDFFFFFFFFFFFFA@@FFFFFFFFFF===?<?????88111119??????ADCCCCAAAAAAAAB555:::?>CFD==;A<9966,,,,,,,,,,,,=887766=;;22-----<466694?ABAAAD666666D7FFFFFFFFFF666FFFF?;;:A;<<75B....D7333<@A@?888<AA==;;<7@><;;<688<00009<>???<<<===<<897==73...3----:99666:>7996/////-<<11202>??AA=:55448BBB===AAADDDDDAA>>===DB@>9723000,,,,,,300004;;><<:99666666.,,,,/7600,,,9922/33000020.00011742---223380220786646770---0331.00..,,,,,,0,,,,,,,..0144330,,,0.0,,,,,,,,,,,)),,,,,,1..,,,,,,,...,,,,,,.,,,,,,,,,,,,!//,--226::
+@GGOQ6K301A8J46
+gactACTATACGAGTCTGCCAATCTTCTTCACTCATCCCCTTCAGGAAGAGTGCAGGGTTCTGGGACTCTCCGTATGTGCCTCCTAGGTACAAGAAAATATCCCCTCTCTTCATCCTTTAATAACACTGATCCTTGTCCCCAATACTCTACTCTCATTGGTCCTTTCCAATTTTTGTCTTTTTTGATCTTTATAGTAAATCCACTGACCTTGCAATTTGCTTGGAATTTGAGAAAAATAATCCTGTATTCTTAATGATTCTTGTTGTGTTAATAATTCATATGGGGGCCATTCCCCCTATTCTACCCCTTTGTTTAAAATTAAGGCAATGCAGAGCGAGAGCCAAAGCATTGTCTAAAGATGTTGTTTCAGGCAAAAACTTCTGAATCCAACACTTTAAAGTATTATTggcattttcaaccaaagcttgagtattgagggttgcctggtattccaaatttatgttttattccctatgtaattgtagtaaaccttcctattttttgattttctaaaatttggtccctattgttctgtttgctagttctgtaactattatgagtccaacctgtttagg
++
+FFFFFFFFFFFFFFFIIIIIIIIIIIIIIIIIIIIIFFFFIIIIIIIIIIIIFHFFFFFFFF:::DFFFFFFFFFFFFFDDDFFFFAAABBDD=3333=7B::99?7BBBBBA?4400088/0008??BDDDDFFFFDDBBFFFFFFFFFFFFFFFFFFFFFF???DDB@--,,,=/7,,,,,-::==68<BAFFFFFFFDDDFFFFFFFFFDDD???FFFFDBA>999?94/////>34=;;?>?ABBB5666=BBBB?><=<<986....255---3==8,,,,,--357,,,,-8766=<=2444000977757664400554444<<?@@BDDDDDAAA???AAAAA555:???D<??>DD===DD88833553B443238<76654222....,07/166622///345429:<8888022263,,,.1300,,,00,0034413..,,,,-330-,000207..2220202.344.0.0.00027:----8://22--00,,,,,),,,,,,,00-000.0..00,,,0,,,.0430,,,.2022611...143,,,,,,,,,,000000
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/sff_converter_qual.dat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sff_converter_qual.dat Mon May 24 15:08:57 2010 -0400
@@ -0,0 +1,6 @@
+>GGOQ6K301BJT46
+37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 40 40 40 40 40 39 39 39 39 39 37 37 33 33 33 37 36 35 35 37 37 37 37 37 39 39 38 37 37 37 37 37 37 37 30 30 30 30 37 37 37 37 37 37 35 35 37 37 37 37 37 27 28 28 27 32 35 35 35 35 35 35 32 34 23 25 25 35 34 35 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 35 35 35 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 32 31 31 37 37 37 37 37 37 35 35 30 30 30 30 30 32 32 32 32 32 33 28 30 30 32 35 32 32 34 37 37 37 37 37 35 35 35 37 37 37 37 37 37 37 37 37 35 35 35 35 20 19 19 30 30 23 23 23 23 15 15 15 27 17 19 19 24 28 25 27 27 30 31 23 19 16 16 16 19 30 29 32 32 32 32 30 25 25 25 32 30 30 30 35 33 33 32 25 25 25 32 30 32 14 14 13 13 13 25 25 18 18 11 11 11 11 12 12 12 12 12 12 11 11 11 11 26 26 25 23 24 28 24 25 24 22 18 18 13 13 13 17 17 17 18 14 14 24 27 21 23 23 27 19 19 19 27 32 32 25 25 25 25 23 25 25 33 33 32 32 31 31 29 29 29 19 18 19 18 19 27 1!
9 19 19 19 19 19 24 30 30 31 32 32 31 33 33 33 32 25 23 25 27 32 24 24 23 27 30 19 19 19 23 27 27 27 27 17 19 19 27 18 18 18 23 27 27 29 25 23 23 19 19 18 18 23 17 17 17 20 20 11 11 11 18 12 12 18 11 11 11 11 11 11 11 11 11 18 22 22 19 11 11 11 18 18 15 19 18 14 14 14 15 11 11 11 11 11 11 11 11 11 11 11 11 16 16 16 11 11 11 11 11 8 11 15 13 13 13 13 15 8 11 11 11 13 11 11 11 11 11 11 11 16 19 18 13 11 11 11 13 12 12 12 23 21 12 12 12 17 15 22 23 22 22 22 22 23 22 15 17 15 21 19 18 18 11 11 11 11 11 15 11 11 11 11 11 11 11 15 13 13 11 11 11 13 13 13 18 11 11 11 11 12 19 19 19 19 19 19 23 24 24 21 20 17 17 20 21 21 21 12 12 12 12
+>GGOQ6K301AWPXS
+37 37 37 37 37 37 37 37 37 37 37 37 37 35 35 35 37 37 35 31 18 18 18 18 33 32 32 30 24 20 20 20 23 39 37 37 37 37 37 39 40 40 40 40 40 40 40 39 40 40 40 39 39 30 26 26 32 30 30 30 24 19 15 15 15 15 23 18 21 30 32 32 32 33 35 37 37 37 37 37 37 37 37 37 37 37 37 32 31 31 37 37 37 37 37 37 37 37 37 37 28 28 28 30 27 30 30 30 30 30 23 23 16 16 16 16 16 24 30 30 30 30 30 30 32 35 34 34 34 34 32 32 32 32 32 32 32 32 33 20 20 20 25 25 25 30 29 34 37 35 28 28 26 32 27 24 24 21 21 11 11 11 11 11 11 11 11 11 11 11 11 28 23 23 22 22 21 21 28 26 26 17 17 12 12 12 12 12 27 19 21 21 21 24 19 30 32 33 32 32 32 35 21 21 21 21 21 21 35 22 37 37 37 37 37 37 37 37 37 37 21 21 21 37 37 37 37 30 26 26 25 32 26 27 27 22 20 33 13 13 13 13 35 22 18 18 18 27 31 32 31 30 23 23 23 27 32 32 28 28 26 26 27 22 31 29 27 26 26 27 21 23 23 27 15 15 15 15 24 27 29 30 30 30 27 27 27 28 28 28 27 27 23 24 22 28 28 22 18 13 13 13 18 12 12 12 12 25 24 24 21 21 21 25 29 22 24 24 21 14 14 14 14 14 12 27 27 16 16 1!
7 15 17 29 30 30 32 32 28 25 20 20 19 19 23 33 33 33 28 28 28 32 32 32 35 35 35 35 35 32 32 29 29 28 28 28 35 33 31 29 24 22 17 18 15 15 15 11 11 11 11 11 11 18 15 15 15 15 19 26 26 29 27 27 25 24 24 21 21 21 21 21 21 13 11 11 11 11 14 22 21 15 15 11 11 11 24 24 17 17 14 18 18 15 15 15 15 17 15 13 15 15 15 16 16 22 19 17 12 12 12 17 17 18 18 23 15 17 17 15 22 23 21 21 19 21 22 22 15 12 12 12 15 18 18 16 13 15 15 13 13 11 11 11 11 11 11 15 11 11 11 11 11 11 11 13 13 15 16 19 19 18 18 15 11 11 11 15 13 15 11 11 11 11 11 11 11 11 11 11 11 8 8 11 11 11 11 11 11 16 13 13 11 11 11 11 11 11 11 13 13 13 11 11 11 11 11 11 13 11 11 11 11 11 11 11 11 11 11 11 11 0 14 14 11 12 12 17 17 21 25 25
+>GGOQ6K301A8J46
+37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 37 37 37 37 40 40 40 40 40 40 40 40 40 40 40 40 37 39 37 37 37 37 37 37 37 37 25 25 25 35 37 37 37 37 37 37 37 37 37 37 37 37 37 35 35 35 37 37 37 37 32 32 32 33 33 35 35 28 18 18 18 18 28 22 33 25 25 24 24 30 22 33 33 33 33 33 32 30 19 19 15 15 15 23 23 14 15 15 15 23 30 30 33 35 35 35 35 37 37 37 37 35 35 33 33 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 30 30 30 35 35 33 31 12 12 11 11 11 28 14 22 11 11 11 11 11 12 25 25 28 28 21 23 27 33 32 37 37 37 37 37 37 37 35 35 35 37 37 37 37 37 37 37 37 37 35 35 35 30 30 30 37 37 37 37 35 33 32 29 24 24 24 30 24 19 14 14 14 14 14 29 18 19 28 26 26 30 29 30 32 33 33 33 20 21 21 21 28 33 33 33 33 30 29 27 28 27 27 24 23 21 13 13 13 13 17 20 20 12 12 12 18 28 28 23 11 11 11 11 11 12 12 18 20 22 11 11 11 11 12 23 22 21 21 28 27 28 17 19 19 19 15 15 15 24 22 22 22 20 22 21 21 19 19 15 15 20 20 19 19 19 19 2!
7 27 30 31 31 33 35 35 35 35 35 32 32 32 30 30 30 32 32 32 32 32 20 20 20 25 30 30 30 35 27 30 30 29 35 35 28 28 28 35 35 23 23 23 18 18 20 20 18 33 19 19 18 17 18 23 27 22 21 21 20 19 17 17 17 13 13 13 13 11 15 22 14 16 21 21 21 17 17 14 14 14 18 19 20 19 17 24 25 27 23 23 23 23 15 17 17 17 21 18 11 11 11 13 16 18 15 15 11 11 11 15 15 11 15 15 18 19 19 16 18 13 13 11 11 11 11 12 18 18 15 12 11 15 15 15 17 15 22 13 13 17 17 17 15 17 15 17 13 18 19 19 13 15 13 15 13 15 15 15 17 22 25 12 12 12 12 23 25 14 14 17 17 12 12 15 15 11 11 11 11 11 8 11 11 11 11 11 11 11 15 15 12 15 15 15 13 15 13 13 15 15 11 11 11 15 11 11 11 13 15 19 18 15 11 11 11 13 17 15 17 17 21 16 16 13 13 13 16 19 18 11 11 11 11 11 11 11 11 11 11 15 15 15 15 15 15
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/sff_converter_xml_1.dat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sff_converter_xml_1.dat Mon May 24 15:08:57 2010 -0400
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<trace_volume>
+ <trace>
+ <trace_name>GGOQ6K301BJT46</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>260</clip_vector_right>
+ </trace>
+ <trace>
+ <trace_name>GGOQ6K301AWPXS</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>470</clip_vector_right>
+ </trace>
+ <trace>
+ <trace_name>GGOQ6K301A8J46</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>408</clip_vector_right>
+ </trace>
+</trace_volume>
diff -r cbacbb736899 -r 8833ebe82ed1 test-data/sff_converter_xml_2.dat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/sff_converter_xml_2.dat Mon May 24 15:08:57 2010 -0400
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<trace_volume>
+ <trace>
+ <trace_name>GGOQ6K301BJT46</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>260</clip_vector_right>
+ </trace>
+ <trace>
+ <trace_name>GGOQ6K301AWPXS</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>470</clip_vector_right>
+ </trace>
+ <trace>
+ <trace_name>GGOQ6K301A8J46</trace_name>
+ <clip_vector_left>5</clip_vector_left>
+ <clip_vector_right>408</clip_vector_right>
+ </trace>
+</trace_volume>
diff -r cbacbb736899 -r 8833ebe82ed1 tools/filters/sff_extractor.xml
--- a/tools/filters/sff_extractor.xml Mon May 24 15:05:55 2010 -0400
+++ b/tools/filters/sff_extractor.xml Mon May 24 15:08:57 2010 -0400
@@ -1,39 +1,58 @@
<tool id="Sff_extractor" name="SFF converter" version="1.0.0">
- <description></description>
- <command interpreter="python">
- #if str($fastq_output) == "fastq_false" #sff_extract.py $clip --seq_file=$out_file3 --qual_file=$out_file4 --xml_file=$out_file2 $input
- #elif str($fastq_output) == "fastq_true" #sff_extract.py $clip --fastq --seq_file=$out_file1 --xml_file=$out_file2 $input
- #end if#
- </command>
- <inputs>
- <param format="sff" name="input" type="data" label="Extract from this dataset"/>
- <param name="clip" type="select" label="Completely remove ends with low qual and/or adaptor sequence">
- <option value="">No</option>
- <option value="--clip">Yes</option>
- </param>
- <param name="fastq_output" type="boolean" truevalue="fastq_true" falsevalue="fastq_false" checked="False" label="Do you want FASTQ file instead of FASTA + FASTA quality file?" />
- </inputs>
- <outputs>
- <data format="fastq" name="out_file1" >
- <filter>fastq_output is True</filter>
- </data>
- <data format="xml" name="out_file2">
- </data>
- <data format="fasta" name="out_file3">
- <filter>fastq_output is False</filter>
- </data>
- <data format="qual" name="out_file4">
- <filter>fastq_output is False</filter>
- </data>
- </outputs>
- <help>
+ <description></description>
+ <command interpreter="python">
+ #if str($fastq_output) == "fastq_false" #sff_extract.py $clip --seq_file=$out_file3 --qual_file=$out_file4 --xml_file=$out_file2 $input
+ #elif str($fastq_output) == "fastq_true" #sff_extract.py $clip --fastq --seq_file=$out_file1 --xml_file=$out_file2 $input
+ #end if#
+ </command>
+ <inputs>
+ <param format="sff" name="input" type="data" label="Extract from this dataset"/>
+ <param name="clip" type="select" label="Completely remove ends with low qual and/or adaptor sequence">
+ <option value="">No</option>
+ <option value="--clip">Yes</option>
+ </param>
+ <param name="fastq_output" type="boolean" truevalue="fastq_true" falsevalue="fastq_false" checked="False" label="Do you want FASTQ file instead of FASTA + FASTA quality file?" />
+ </inputs>
+ <outputs>
+ <data format="fastq" name="out_file1" >
+ <filter>fastq_output is True</filter>
+ </data>
+ <data format="xml" name="out_file2">
+ </data>
+ <data format="fasta" name="out_file3">
+ <filter>fastq_output is False</filter>
+ </data>
+ <data format="qual" name="out_file4">
+ <filter>fastq_output is False</filter>
+ </data>
+ </outputs>
+ <tests>
+ <test>
+ <param name="input" value="2.sff"/>
+ <param name="clip" value=""/>
+ <param name="fastq_output" value="false"/>
+ <output name="out_file2" file="sff_converter_xml_1.dat"/>
+ <output name="out_file3" file="sff_converter_fasta.dat"/>
+ <output name="out_file4" file="sff_converter_qual.dat"/>
+ </test>
+ <test>
+ <param name="input" value="2.sff"/>
+ <param name="clip" value=""/>
+ <param name="fastq_output" value="true"/>
+ <output name="out_file1" file="sff_converter_fastq.dat"/>
+ <output name="out_file2" file="sff_converter_xml_2.dat"/>
+ </test>
+ </tests>
+ <help>
+
**What it does**
This tool extracts data from the 454 Sequencer SFF format and creates three files containing the:
- Sequences (FASTA),
- Qualities (QUAL) and
- Clippings (XML)
- </help>
+Sequences (FASTA),
+Qualities (QUAL) and
+Clippings (XML)
+
+ </help>
</tool>
1
0

25 May '10
details: http://www.bx.psu.edu/hg/galaxy/rev/cbacbb736899
changeset: 3815:cbacbb736899
user: Dan Blankenberg <dan(a)bx.psu.edu>
date: Mon May 24 15:05:55 2010 -0400
description:
Minor cleanup for ensembl display applications and fastq masker tool.
diffstat:
display_applications/ensembl/ensembl_gff.xml | 6 ++----
display_applications/ensembl/ensembl_interval_as_bed.xml | 6 ++----
tool_conf.xml.main | 1 +
tools/fastq/fastq_masker_by_quality.py | 2 +-
4 files changed, 6 insertions(+), 9 deletions(-)
diffs (69 lines):
diff -r 6056caca2503 -r cbacbb736899 display_applications/ensembl/ensembl_gff.xml
--- a/display_applications/ensembl/ensembl_gff.xml Mon May 24 14:50:20 2010 -0400
+++ b/display_applications/ensembl/ensembl_gff.xml Mon May 24 15:05:55 2010 -0400
@@ -18,8 +18,7 @@
<param type="data" name="gff_file" url="galaxy_${DATASET_HASH}.gff" />
<param type="template" name="site_organism" strip="True" >
- #set index = $site_dbkeys.index( $gff_file.dbkey )
- $site_organisms[ $index ]
+ $site_organisms[ $site_dbkeys.index( $gff_file.dbkey ) ]
</param>
<param type="template" name="position" strip="True" >
#set line_count = 0
@@ -82,8 +81,7 @@
<param type="data" name="gff_file" url="galaxy_${DATASET_HASH}.gff" />
<param type="template" name="site_organism" strip="True" >
- #set index = $site_dbkeys.index( $gff_file.dbkey )
- $site_organisms[ $index ]
+ $site_organisms[ $site_dbkeys.index( $gff_file.dbkey ) ]
</param>
<param type="template" name="position" strip="True" >
#set line_count = 0
diff -r 6056caca2503 -r cbacbb736899 display_applications/ensembl/ensembl_interval_as_bed.xml
--- a/display_applications/ensembl/ensembl_interval_as_bed.xml Mon May 24 14:50:20 2010 -0400
+++ b/display_applications/ensembl/ensembl_interval_as_bed.xml Mon May 24 15:05:55 2010 -0400
@@ -18,8 +18,7 @@
<param type="data" name="bed_file" url="galaxy_${DATASET_HASH}.bed" format="bedstrict"/>
<param type="template" name="site_organism" strip="True" >
- #set index = $site_dbkeys.index( $bed_file.dbkey )
- $site_organisms[ $index ]
+ $site_organisms[ $site_dbkeys.index( $bed_file.dbkey ) ]
</param>
<param type="template" name="position" strip="True" >
#set line_count = 0
@@ -82,8 +81,7 @@
<param type="data" name="bed_file" url="galaxy_${DATASET_HASH}.bed" format="bedstrict"/>
<param type="template" name="site_organism" strip="True" >
- #set index = $site_dbkeys.index( $bed_file.dbkey )
- $site_organisms[ $index ]
+ $site_organisms[ $site_dbkeys.index( $bed_file.dbkey ) ]
</param>
<param type="template" name="position" strip="True" >
#set line_count = 0
diff -r 6056caca2503 -r cbacbb736899 tool_conf.xml.main
--- a/tool_conf.xml.main Mon May 24 14:50:20 2010 -0400
+++ b/tool_conf.xml.main Mon May 24 15:05:55 2010 -0400
@@ -298,6 +298,7 @@
<tool file="fastq/fastq_filter.xml" />
<tool file="fastq/fastq_trimmer.xml" />
<tool file="fastq/fastq_trimmer_by_quality.xml" />
+ <tool file="fastq/fastq_masker_by_quality.xml" />
<tool file="fastq/fastq_manipulation.xml" />
<tool file="fastq/fastq_to_fasta.xml" />
<tool file="fastq/fastq_to_tabular.xml" />
diff -r 6056caca2503 -r cbacbb736899 tools/fastq/fastq_masker_by_quality.py
--- a/tools/fastq/fastq_masker_by_quality.py Mon May 24 14:50:20 2010 -0400
+++ b/tools/fastq/fastq_masker_by_quality.py Mon May 24 15:05:55 2010 -0400
@@ -46,7 +46,7 @@
def main():
usage = "usage: %prog [options] input_file output_file"
parser = OptionParser( usage=usage )
- parser.add_option( '-f', '--format', dest='format', type='choice', default='sanger', choices=( 'sanger', 'cssanger', 'solexa', 'illumina' ), help='FASTQ variant type' )
+ parser.add_option( '-f', '--format', dest='format', type='choice', default='sanger', choices=( 'sanger', 'solexa', 'illumina' ), help='FASTQ variant type' )
parser.add_option( '-m', '--mask_character', dest='mask_character', default='N', help='Mask Character to use' )
parser.add_option( '-c', '--score_comparison', type="choice", dest='score_comparison', default='le', choices=('gt','ge','eq','lt', 'le', 'ne' ), help='Mask base when score is' )
parser.add_option( '-s', '--quality_score', type="float", dest='quality_score', default='0', help='Quality Score' )
1
0