galaxy-commits
Threads by month
- ----- 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
September 2010
- 1 participants
- 70 discussions
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dannon Baker <dannonbaker(a)me.com>
# Date 1283270353 14400
# Node ID ff9b7abb6b60850b014496b8756fef1f4440c0d7
# Parent b19a56845706a85e5124bd2dd26788752db9c8ef
# Parent 65edd8e2a3a8872252d9008ad2fe9dee7cbd5856
Merge.
1
0
galaxy-dist commit 568f8d3854e8: lims: adding a file missed in the previous commit
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1283286628 14400
# Node ID 568f8d3854e8fcae7f78fbe906971a2369c65c33
# Parent d9276a4a775a7582a51cedab7b7b2b315109c53f
lims: adding a file missed in the previous commit
--- /dev/null
+++ b/templates/requests/common/find.mako
@@ -0,0 +1,101 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<script type="text/javascript">
+$( function() {
+ $( "select[refresh_on_change='true']").change( function() {
+ var refresh = false;
+ var refresh_on_change_values = $( this )[0].attributes.getNamedItem( 'refresh_on_change_values' )
+ if ( refresh_on_change_values ) {
+ refresh_on_change_values = refresh_on_change_values.value.split( ',' );
+ var last_selected_value = $( this )[0].attributes.getNamedItem( 'last_selected_value' );
+ for( i= 0; i < refresh_on_change_values.length; i++ ) {
+ if ( $( this )[0].value == refresh_on_change_values[i] || ( last_selected_value && last_selected_value.value == refresh_on_change_values[i] ) ){
+ refresh = true;
+ break;
+ }
+ }
+ }
+ else {
+ refresh = true;
+ }
+ if ( refresh ){
+ $( "#find_request" ).submit();
+ }
+ });
+});
+</script>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ ${h.js("jquery.autocomplete", "autocomplete_tagging" )}
+</%def>
+
+<%def name="stylesheets()">
+ ${parent.stylesheets()}
+ ${h.css( "autocomplete_tagging" )}
+</%def>
+
+<br/>
+<br/>
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller=cntrller, cntrller=cntrller, action='list')}">
+ <span>Browse requests</span></a>
+ </li>
+</ul>
+
+<div class="toolForm">
+ <div class="toolFormTitle">Find samples</div>
+ <div class="toolFormBody">
+ <form name="find_request" id="find_request" action="${h.url_for( controller='requests_common', action='find', cntrller=cntrller)}" method="post" >
+ <div class="form-row">
+ <label>Find in sequencing requests in state:</label>
+ <select name="select_search_type">
+ <option value="In-Progress" selected>In-Progress</option>
+ <option value="Complete">Complete</option>
+ <option value="Both">Both</option>
+ </select>
+ </div>
+ <div class="form-row">
+ <label>Find by sample:</label>
+ <select name="search_type">
+ <option value="name" selected>name</option>
+ <option value="bar_code">barcode</option>
+ </select>
+ </div>
+ <div class="form-row">
+ <input type="text" name="search_string" size="40" value="">
+ <input type="submit" name="go_button" value="Go"/>
+ </div>
+ %if results:
+ <div class="form-row">
+ <label><i>${results}</i></label>
+ </div>
+ %endif
+ <div class="form-row">
+ %if samples:
+ %for s in samples:
+ <div class="form-row">
+ <a href="${h.url_for( controller=cntrller, action='list', operation='show', id=trans.security.encode_id(s.request.id))}"><label>Sequencing request: ${s.request.name} | Type: ${s.request.type.name} | State: ${s.request.state()}</label></a>
+ %if cntrller == 'requests_admin':
+ <i>User: ${s.request.user.email}</i>
+ %endif
+ <div class="toolParamHelp" style="clear: both;">
+ Sample: ${s.name}<br/>
+ Barcode: ${s.bar_code}<br/>
+ State: ${s.current_state().name}
+ </div>
+ </div>
+ <br/>
+ %endfor
+ %endif
+
+ </div>
+ </form>
+ </div>
+</div>
1
0
galaxy-dist commit 03d06d05bf62: Slight makeover to Galaxy tabs: (a) added published item links to 'Data Libraries' tab; (b) standardized personal item lists as 'Saved XXXs'; and (c) added defaults action for Visualization tab. Also extended tab generator function to handle the generation of all menu items and types.
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '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 1283291669 14400
# Node ID 03d06d05bf62a6444f1a652910708fde17fa189b
# Parent c472ac58348b0cd6d7e2040e4c5b2bfb4f42724e
Slight makeover to Galaxy tabs: (a) added published item links to 'Data Libraries' tab; (b) standardized personal item lists as 'Saved XXXs'; and (c) added defaults action for Visualization tab. Also extended tab generator function to handle the generation of all menu items and types.
--- a/templates/workflow/list_published.mako
+++ b/templates/workflow/list_published.mako
@@ -4,7 +4,7 @@
<%
self.has_left_panel=False
self.has_right_panel=False
- self.active_view="page"
+ self.active_view=""
self.message_box_visible=False
%></%def>
@@ -24,8 +24,6 @@
<%def name="center_panel()">
- ## <iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${h.url_for( controller="page", action="list" )}"></iframe>
-
<div style="overflow: auto; height: 100%;"><div class="page-container" style="padding: 10px;">
${h.to_unicode( grid )}
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -12,7 +12,10 @@
<table class="tab-group" border="0" cellspacing="0" style="margin: auto;"><tr>
- <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='' )">
+ <%def name="tab( id, display, href, target='_parent', visible=True, extra_class='', menu_options=None )">
+ ## Create a tab at the top of the panels. menu_options is a list of 2-elements lists of [name, link]
+ ## that are options in the menu.
+
<%
cls = "tab"
if extra_class:
@@ -23,120 +26,127 @@
if not visible:
style = "display: none;"
%>
- <td class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a></td>
+ <td class="${cls}" style="${style}"><a target="${target}" href="${href}">${display}</a>
+ %if menu_options:
+ <div class="submenu">
+ <ul>
+ %for menu_item in menu_options:
+ <li>
+ %if not menu_item:
+ <hr style="color: inherit; background-color: gray"/></li>
+ %else:
+ %if len ( menu_item ) == 1:
+ ${menu_item[0]}
+ %elif len ( menu_item ) == 2:
+ <% name, link = menu_item %>
+ <a href="${link}">${name}</a></li>
+ %else:
+ <% name, link, target = menu_item %>
+ <a target="${target}" href="${link}">${name}</a></li>
+ %endif
+ %endif
+ %endfor
+ </ul>
+ </div>
+ %endif
+ </td></%def>
- %if app.config.cloud_controller_instance:
- ${tab( "cloud", "Cloud", h.url_for( controller='/cloud', action='index' ))}
- %else:
- ${tab( "analysis", "Analyze Data", h.url_for( controller='/root', action='index' ))}
-
- ${tab( "workflow", "Workflow", h.url_for( controller='/workflow', action='index' ))}
-
- ${tab( "libraries", "Data Libraries", h.url_for( controller='/library', action='index' ))}
- %endif
+
+ ## Analyze data tab.
+ ${tab( "analysis", "Analyze Data", h.url_for( controller='/root', action='index' ) )}
+ ## Workflow tab.
+ ${tab( "workflow", "Workflow", h.url_for( controller='/workflow', action='index' ) )}
+
+ ## 'Shared Items' or Libraries tab.
+ <%
+ menu_options = [
+ [ 'Data Libraries', h.url_for( controller='/library', action='index') ],
+ None,
+ [ 'Published Histories', h.url_for( controller='/history', action='list_published' ) ],
+ [ 'Published Workflows', h.url_for( controller='/workflow', action='list_published' ) ],
+ [ 'Published Visualizations', h.url_for( controller='/visualization', action='list_published' ) ],
+ [ 'Published Pages', h.url_for( controller='/page', action='list_published' ) ]
+ ]
+ tab( "libraries", "Data Libraries", h.url_for( controller='/library', action='index'), menu_options=menu_options )
+ %>
+
+ ## Lab menu.
%if trans.user and trans.user.accessible_request_types(trans):
- <td class="tab">
- <a>Lab</a>
- <div class="submenu">
- <ul>
- <li><a href="${h.url_for( controller='/requests', action='index' )}">Sequencing requests</a></li>
- <li><a href="${h.url_for( controller='/requests_common', action='find', cntrller='requests' )}">Find samples</a></li>
- <li><a target="_blank" href="${app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" )}">Help</a></li>
- </ul>
- </div>
- </td>
+ menu_options = [
+ [ 'Sequencing Requests', h.url_for( controller='/requests', action='index' ) ],
+ [ 'Find Samples', h.url_for( controller='/requests_common', action='find' ) ],
+ [ 'Help', app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" )}, "galaxy_main" ],
+ ]
+ tab( "lab", "Lab", None, menu_options=menu_options )
%endif
+ ## Visualization menu.
%if app.config.get_bool( 'enable_tracks', False ):
- <%
- cls = "tab"
- if self.active_view == 'visualization':
- cls += " active"
- %>
- <td class="${cls}">
- Visualization
- <div class="submenu">
- <ul>
- <li><a href="${h.url_for( controller='/tracks', action='index' )}">New Track Browser</a></li>
- <li><hr style="color: inherit; background-color: gray"/></li>
- <li><a href="${h.url_for( controller='/visualization', action='list' )}">Saved Visualizations</a></li>
- </ul>
- </div>
- </td>
+ <%
+ menu_options = [
+ ['New Track Browser', h.url_for( controller='/tracks', action='index' ) ],
+ ['Saved Visualizations', h.url_for( controller='/visualization', action='list' ) ]
+ ]
+ tab( "visualization", "Visualization", h.url_for( controller='/visualization', action='list'), menu_options=menu_options )
+ %>
%endif
+ ## Admin tab.
${tab( "admin", "Admin", h.url_for( controller='/admin', action='index' ), extra_class="admin-only", visible=( trans.user and app.config.is_admin_user( trans.user ) ) )}
- <td class="tab">
- <a>Help</a>
- <div class="submenu">
- <ul>
- <li><a href="${app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" )}">Email comments, bug reports, or suggestions</a></li>
- <li><a target="_blank" href="${app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki" )}">Galaxy Wiki</a></li>
- <li><a target="_blank" href="${app.config.get( "screencasts_url", "http://galaxycast.org" )}">Video tutorials (screencasts)</a></li>
- <li><a target="_blank" href="${app.config.get( "citation_url", "http://bitbucket.org/galaxy/galaxy-central/wiki/Citations" )}">How to Cite Galaxy</a></li>
- </ul>
- </div>
- </td>
+ ## Help tab.
+ <%
+ menu_options = [
+ ['Email comments, bug reports, or suggestions', app.config.get( "bugs_email", "mailto:galaxy-bugs@bx.psu.edu" ) ],
+ ['Galaxy Wiki', app.config.get( "wiki_url", "http://bitbucket.org/galaxy/galaxy-central/wiki" ), "_blank" ],
+ ['Video tutorials (screencasts)', app.config.get( "screencasts_url", "http://galaxycast.org" ), "_blank" ],
+ ['How to Cite Galaxy', app.config.get( "screencasts_url", "http://bitbucket.org/galaxy/galaxy-central/wiki/Citations" ), "_blank" ]
+ ]
+ tab( "help", "Help", None, menu_options=menu_options)
+ %>
- ## User tab.
- <%
- cls = "tab"
- if self.active_view == 'user':
- cls += " active"
+ ## User tabs.
+ <%
+ # Menu for user who is not logged in.
+ menu_options = [ [ "Login", h.url_for( controller='/user', action='login' ), "galaxy_main" ] ]
+ if app.config.allow_user_creation:
+ menu_options.append( [ "Register", h.url_for( controller='/user', action='create' ), "galaxy_main" ] )
+ extra_class = "loggedout-only"
+ visible = ( trans.user == None )
+ tab( "user", "User", None, visible=visible, menu_options=menu_options )
+
+ # Menu for user who is logged in.
+ if trans.user:
+ email = trans.user.email
+ else:
+ email = ""
+ menu_options = [ [ '<li>Logged in as <span id="user-email">%s</span></li>' % email ] ]
+ if app.config.use_remote_user:
+ if app.config.remote_user_logout_href:
+ menu_options.append( [ 'Logout', app.config.remote_user_logout_href, "galaxy_main" ] )
+ else:
+ menu_options.append( [ 'Preferences', h.url_for( controller='/user', action='index' ), "galaxy_main" ] )
+ if app.config.get_bool( 'enable_tracks', False ):
+ menu_options.append( [ 'Custom Builds', h.url_for( controller='/user', action='dbkeys' ), "galaxy_main" ] )
+ if app.config.require_login:
+ logout_url = h.url_for( controller='/root', action='index', m_c='user', m_a='logout' )
+ else:
+ logout_url = h.url_for( controller='/user', action='logout' )
+ menu_options.append( [ 'Logout', logout_url, "_top" ] )
+ menu_options.append( None )
+ menu_options.append( [ 'Saved Histories', h.url_for( controller='/history', action='list' ), "galaxy_main" ] )
+ menu_options.append( [ 'Saved Datasets', h.url_for( controller='/dataset', action='list' ), "galaxy_main" ] )
+ if app.config.get_bool( 'enable_pages', False ):
+ menu_options.append( [ 'Saved Pages', h.url_for( controller='/page', action='list' ), "_top" ] )
+ if app.config.enable_api:
+ menu_options.append( [ 'API Keys', h.url_for( controller='/user', action='api_keys' ), "galaxy_main" ] )
+
+ extra_class = "loggedin-only"
+ visible = ( trans.user != None )
+ tab( "user", "User", None, visible=visible, menu_options=menu_options )
%>
- <td class="${cls}">
- <a>User</a>
- <%
- if trans.user:
- user_email = trans.user.email
- style1 = "display: none;"
- style2 = "";
- else:
- user_email = ""
- style1 = ""
- style2 = "display: none;"
- %>
- <div class="submenu">
- <ul class="loggedout-only" style="${style1}">
- <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='login' )}">Login</a></li>
- %if app.config.allow_user_creation:
- <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='create' )}">Register</a></li>
- %endif
- </ul>
- <ul class="loggedin-only" style="${style2}">
- <li>Logged in as <span id="user-email">${user_email}</span></li>
- %if app.config.use_remote_user:
- %if app.config.remote_user_logout_href:
- <li><a target="galaxy_main" href="${app.config.remote_user_logout_href}">Logout</a></li>
- %endif
- %else:
- <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='index' )}">Preferences</a></li>
- <%
- if app.config.require_login:
- logout_url = h.url_for( controller='/root', action='index', m_c='user', m_a='logout' )
- else:
- logout_url = h.url_for( controller='/user', action='logout' )
- %>
- %if app.config.get_bool( 'enable_tracks', False ):
- <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='dbkeys' )}">Custom Builds</a></li>
- %endif
- <li><a target="_top" href="${logout_url}">Logout</a></li>
- <li><hr style="color: inherit; background-color: gray"/></li>
- %endif
- <li><a target="galaxy_main" href="${h.url_for( controller='/history', action='list' )}">Histories</a></li>
- <li><a target="galaxy_main" href="${h.url_for( controller='/dataset', action='list' )}">Datasets</a></li>
- %if app.config.get_bool( 'enable_pages', False ):
- <li><a href="${h.url_for( controller='/page', action='list' )}">Pages</a></li>
- %endif
- %if app.config.enable_api:
- <li><a target="galaxy_main" href="${h.url_for( controller='/user', action='api_keys' )}">API Keys</a></li>
- %endif
- </ul>
- </div>
- </td></tr></table>
1
0
galaxy-dist commit c472ac58348b: lims: added search by request state to find samples page
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1283287548 14400
# Node ID c472ac58348b0cd6d7e2040e4c5b2bfb4f42724e
# Parent 568f8d3854e8fcae7f78fbe906971a2369c65c33
lims: added search by request state to find samples page
--- a/templates/requests/common/find.mako
+++ b/templates/requests/common/find.mako
@@ -55,8 +55,8 @@
<form name="find_request" id="find_request" action="${h.url_for( controller='requests_common', action='find', cntrller=cntrller)}" method="post" ><div class="form-row"><label>Find in sequencing requests in state:</label>
- <select name="select_search_type">
- <option value="In-Progress" selected>In-Progress</option>
+ <select name="request_state">
+ <option value="In Progress" selected>In-Progress</option><option value="Complete">Complete</option><option value="Both">Both</option></select>
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -1265,6 +1265,12 @@ class RequestsCommon( BaseController, Us
status = params.get( 'status', 'done' )
search_string = kwd.get( 'search_string', '' )
search_type = params.get( 'search_type', '' )
+ if params.get( 'request_state', 'In Progress' ) == 'Both':
+ request_states = ['In Progress', 'Complete']
+ else:
+ request_states = [params.get( 'request_state', 'In Progress' )]
+
+
samples_list = []
results = ''
if params.get('go_button', '') == 'Go':
@@ -1280,10 +1286,15 @@ class RequestsCommon( BaseController, Us
.all()
if cntrller == 'requests':
for s in samples:
- if s.request.user.id == trans.user.id:
+ if s.request.user.id == trans.user.id \
+ and s.request.state() in request_states\
+ and not s.request.deleted:
samples_list.append(s)
elif cntrller == 'requests_admin':
- samples_list = samples
+ for s in samples:
+ if not s.request.deleted \
+ and s.request.state() in request_states:
+ samples_list.append(s)
results = 'There are %i sequencing requests matching the search parameters.' % len(samples_list)
return trans.fill_template( '/requests/common/find.mako',
cntrller=cntrller,
1
0
galaxy-dist commit d9276a4a775a: lims: added 'find samples' feature
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1283286358 14400
# Node ID d9276a4a775a7582a51cedab7b7b2b315109c53f
# Parent ff9b7abb6b60850b014496b8756fef1f4440c0d7
lims: added 'find samples' feature
- basic search using sample name and barcode implemented
- Added menu items in masthead and admin menu
--- a/templates/webapps/galaxy/admin/index.mako
+++ b/templates/webapps/galaxy/admin/index.mako
@@ -116,6 +116,7 @@
<div class="toolSectionBg"><div class="toolTitle"><a href="${h.url_for( controller='requests_admin', action='manage_request_types' )}" target="galaxy_main">Manage request types</a></div><div class="toolTitle"><a href="${h.url_for( controller='requests_admin', action='list')}" target="galaxy_main">Manage requests</a></div>
+ <div class="toolTitle"><a href="${h.url_for( controller='requests_common', action='find', cntrller='requests_admin')}" target="galaxy_main">Find samples</a></div></div></div></div>
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -1253,5 +1253,49 @@ class RequestsCommon( BaseController, Us
dataset_files=sample.datasets,
message=message, status=status, files=[],
folder_path=folder_path )
+ #
+ # Find sequencing requests & samples
+ #
+ @web.expose
+ @web.require_admin
+ def find( self, trans, **kwd ):
+ params = util.Params( kwd )
+ cntrller = params.get( 'cntrller', 'requests' )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ search_string = kwd.get( 'search_string', '' )
+ search_type = params.get( 'search_type', '' )
+ samples_list = []
+ results = ''
+ if params.get('go_button', '') == 'Go':
+ if search_type == 'bar_code':
+ samples = trans.sa_session.query( trans.app.model.Sample ) \
+ .filter( and_( trans.app.model.Sample.table.c.deleted==False,
+ trans.app.model.Sample.table.c.bar_code.like(search_string) ) )\
+ .all()
+ elif search_type == 'name':
+ samples = trans.sa_session.query( trans.app.model.Sample ) \
+ .filter( and_( trans.app.model.Sample.table.c.deleted==False,
+ trans.app.model.Sample.table.c.name.like(search_string) ) )\
+ .all()
+ if cntrller == 'requests':
+ for s in samples:
+ if s.request.user.id == trans.user.id:
+ samples_list.append(s)
+ elif cntrller == 'requests_admin':
+ samples_list = samples
+ results = 'There are %i sequencing requests matching the search parameters.' % len(samples_list)
+ return trans.fill_template( '/requests/common/find.mako',
+ cntrller=cntrller,
+ samples=samples_list,
+ results=results )
+
+
+
+
+
+
+
+
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -82,6 +82,14 @@ class RequestsGrid( grids.Grid ):
class UserColumn( grids.TextColumn ):
def get_value(self, trans, grid, request):
return request.user.email
+ def sort( self, query, ascending ):
+ """ Sort column using case-insensitive alphabetical sorting on item's username. """
+ if ascending:
+ query = query.order_by( func.lower ( self.model_class.email ).asc() )
+ else:
+ query = query.order_by( func.lower( self.model_class.email ).desc() )
+ return query
+
# Grid definition
title = "Sequencing Requests"
template = "admin/requests/grid.mako"
@@ -119,12 +127,14 @@ class RequestsGrid( grids.Grid ):
link=( lambda item: iff( item.deleted, None, dict( operation="events", id=item.id ) ) ),
),
UserColumn( "User",
- #key='user.email',
- model_class=model.Request)
+ #key='owner',
+ model_class=model.User
+ #filterable="advanced"
+ )
]
columns.append( grids.MulticolFilterColumn( "Search",
- cols_to_filter=[ columns[0], columns[1] ],
+ cols_to_filter=[ columns[0], columns[1], columns[6] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -41,7 +41,8 @@
<a>Lab</a><div class="submenu"><ul>
- <li><a href="${h.url_for( controller='/requests', action='index' )}">Sequencing Requests</a></li>
+ <li><a href="${h.url_for( controller='/requests', action='index' )}">Sequencing requests</a></li>
+ <li><a href="${h.url_for( controller='/requests_common', action='find', cntrller='requests' )}">Find samples</a></li><li><a target="_blank" href="${app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rkchak/p/sts" )}">Help</a></li></ul></div>
1
0
galaxy-dist commit 65edd8e2a3a8: Fix for pdfnup blathering to stdout causing buildbot to barf
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User fubar: ross Lazarus at gmail period com
# Date 1283257544 14400
# Node ID 65edd8e2a3a8872252d9008ad2fe9dee7cbd5856
# Parent 7cc9329fd895049827d1bf5436f6aa11bf9d30ed
Fix for pdfnup blathering to stdout causing buildbot to barf
Small adjustment to file size delta for rgManQQ
--- a/tools/rgenetics/rgManQQ.xml
+++ b/tools/rgenetics/rgManQQ.xml
@@ -44,9 +44,9 @@
<param name='grey' value='0' /><output name='out_html' file='rgtestouts/rgManQQ/rgManQQtest1.html' ftype='html' lines_diff='30'><extra_files type="file" name='Allelep_manhattan.png' value='rgtestouts/rgManQQ/Allelep_manhattan.png' compare="sim_size"
- delta = "4000"/>
+ delta = "10000"/><extra_files type="file" name='Allelep_qqplot.png' value='rgtestouts/rgManQQ/Allelep_qqplot.png' compare="sim_size"
- delta = "4000" />
+ delta = "10000" /><extra_files type="file" name='rgManQQtest1.R' value='rgtestouts/rgManQQ/rgManQQtest1.R' compare="diff" lines_diff="160"/></output></test>
--- a/tools/rgenetics/rgManQQ.py
+++ b/tools/rgenetics/rgManQQ.py
@@ -52,6 +52,7 @@ manhattan = function(chrom=NULL,offset=N
lastbase=0
chrlist = unique(d$CHR)
nchr = length(chrlist) # may be any number?
+ if (nchr < 2) {
for (x in c(1:nchr)) {
i = chrlist[x] # need the chrom number - may not == index
if (x == 1) { # first time
@@ -62,8 +63,16 @@ manhattan = function(chrom=NULL,offset=N
d[d$CHR==i, ]$pos=d[d$CHR==i, ]$BP+lastbase
}
ticks=c(ticks, d[d$CHR==i, ]$pos[floor(length(d[d$CHR==i, ]$pos)/2)+1])
- }
- ticklim=c(min(d$pos),max(d$pos))
+ ticklim=c(min(d$pos),max(d$pos))
+ }
+ } else { # nchr >= 2
+ last = max(offset)
+ first = min(offset)
+ ticks = first
+ t = (last-first)/9 # units per tick
+ for (x in c(1:9)) ticks = c(ticks,round(x*t))
+ ticklim = c(first,last)
+ } # else
if (grey) {mycols=rep(c("gray10","gray60"),max(d$CHR))
} else {
mycols=rep(coloursTouse,max(d$CHR))
--- a/tools/rgenetics/rgQC.py
+++ b/tools/rgenetics/rgQC.py
@@ -270,6 +270,8 @@ def makePlots(markers=[],subjects=[],new
rpy.r.dev_off()
+ fdsto,stofile = tempfile.mkstemp()
+ sto = open(stofile,'w')
import rpy # delay to avoid rpy stdout chatter replacing galaxy file blurb
mog = 'mogrify'
pdfnup = 'pdfnup'
@@ -368,7 +370,7 @@ def makePlots(markers=[],subjects=[],new
expl = 'All %s QC Plots joined into a single pdf' % basename
vcl = '%s %s --outfile %s ' % (pdfjoin,filestojoin, fullafname)
# make single page pdf
- x=subprocess.Popen(vcl,shell=True,cwd=newfpath)
+ x=subprocess.Popen(vcl,shell=True,cwd=newfpath,stderr=sto,stdout=sto)
retval = x.wait()
row = [expl,afname,fullafname]
html.insert(0,row) # last rather than second
@@ -377,15 +379,17 @@ def makePlots(markers=[],subjects=[],new
expl = 'All %s QC Plots %d by %d to a page' % (basename,nup,nup)
vcl = '%s %s --nup %dx%d --frame true --outfile %s' % (pdfnup,afname,nup,nup,fullnfname)
# make thumbnail images
- x=subprocess.Popen(vcl,shell=True,cwd=newfpath)
+ x=subprocess.Popen(vcl,shell=True,cwd=newfpath,stderr=sto,stdout=sto)
retval = x.wait()
row = [expl,nfname,fullnfname]
html.insert(1,row) # this goes second
vcl = '%s -format jpg -resize %s %s' % (mog, mogresize, os.path.join(newfpath,'*.pdf'))
# make thumbnail images
- x=subprocess.Popen(vcl,shell=True,cwd=newfpath)
+ x=subprocess.Popen(vcl,shell=True,cwd=newfpath,stderr=sto,stdout=sto)
retval = x.wait()
- return html # elements for an ordered list of urls or whatever..
+ sto.close()
+ cruft = open(stofile,'r').readlines()
+ return html,cruft # elements for an ordered list of urls or whatever..
def RmakePlots(markers=[],subjects=[],newfpath='.',basename='test',nbreaks='100',nup=3,height=8,width=10,rexe=''):
@@ -1282,7 +1286,7 @@ if __name__ == "__main__":
s = '## starting plotpage, newfpath=%s,m=%s,s=%s/n' % (newfpath,markers[:2],subjects[:2])
alogf.write(s)
print s
- plotpage = makePlots(markers=markers,subjects=subjects,newfpath=newfpath,
+ plotpage,cruft = makePlots(markers=markers,subjects=subjects,newfpath=newfpath,
basename=basename,nbreaks=nbreaks,height=10,width=8,rgbin=rgbin)
#plotpage = RmakePlots(markers=markers,subjects=subjects,newfpath=newfpath,basename=basename,nbreaks=nbreaks,rexe=rexe)
@@ -1343,6 +1347,8 @@ if __name__ == "__main__":
lf.write('\n'.join(html))
lf.write('<h4>QC run log contents</h4>')
lf.write('<pre>%s</pre>' % (''.join(llog))) # plink logs
+ if len(cruft) > 0:
+ lf.write('<h2>Blather from pdfnup follows:</h2><pre>%s</pre>' % (''.join(cruft))) # pdfnup
lf.write('%s\n<hr>\n' % galhtmlpostfix)
lf.close()
1
0
galaxy-dist commit b19a56845706: Repacked workflow editor.
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Dannon Baker <dannonbaker(a)me.com>
# Date 1283270339 14400
# Node ID b19a56845706a85e5124bd2dd26788752db9c8ef
# Parent 1cd9009036f729c8d36fe40db6cbfd6508c3a635
Repacked workflow editor.
--- a/static/scripts/packed/galaxy.workflow_editor.canvas.js
+++ b/static/scripts/packed/galaxy.workflow_editor.canvas.js
@@ -1,1 +1,1 @@
-function Terminal(a){this.element=a;this.connectors=[]}$.extend(Terminal.prototype,{connect:function(a){this.connectors.push(a);if(this.node){this.node.changed()}},disconnect:function(a){this.connectors.splice($.inArray(a,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(a,b){b.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(a,b){b.destroy()})}});function OutputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}OutputTerminal.prototype=new Terminal();function InputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}InputTerminal.prototype=new Terminal();$.extend(InputTerminal.prototype,{can_accept:function(a){if(this.connectors.length<1){for(var c in this.datatypes){for(var b in a.datatypes){if(a.datatypes[b]=="input"||issubtype(a.datatypes[b],this.datatypes[c])){return true}}}}return false}});function Connector(b,a){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_col
or="#D8B365";if(b&&a){this.connect(b,a)}}$.extend(Connector.prototype,{connect:function(b,a){this.handle1=b;this.handle1.connect(this);this.handle2=a;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var d=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(this.canvas)}d.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var n=function(c){return $(c).offset().left-d.offset().left};var i=function(c){return $(c).offset().top-d.offset().top};var h=n(this.handle1.element)+5;var g=i(this.handle1.element)+5;var p=n(this.handle2.element)+5;var m=i(this.handle2.element)+5;var f=100;var k=Math.min(h,p);var a=Math.max(h,p);var j=Math.min(g,m);var t=Math.max(g,m);var b=Math.min(Math.max(Math.abs(t-j)/2,100),300);var o=k-f;var s=j-f;var q=a
-k+2*f;var l=t-j+2*f;this.canvas.style.left=o+"px";this.canvas.style.top=s+"px";this.canvas.setAttribute("width",q);this.canvas.setAttribute("height",l);h-=o;g-=s;p-=o;m-=s;var r=this.canvas.getContext("2d");r.lineCap="round";r.strokeStyle=this.outer_color;r.lineWidth=7;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke();r.strokeStyle=this.inner_color;r.lineWidth=5;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke()}});function Node(a){this.element=a;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(d,a,b){var c=this;$(d).each(function(){var f=this.terminal=new InputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dropstart",function(g){g.dragProxy.terminal.connectors[0].inner_color="#BBFFBB"}).bind("dropend",function(g){g.dragProxy.terminal.connectors[0].inner_color="#FFFFFF"}).bind("drop",function(g){(new Connector(g.dragTarget.terminal,g.dropTarget.terminal))
.redraw()}).bind("hover",function(){if(f.connectors.length>0){var g=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(){$.each(f.connectors,function(i,h){h.destroy()});g.remove()}))).bind("mouseleave",function(){$(this).remove()});g.css({top:$(this).offset().top-2,left:$(this).offset().left-g.width(),"padding-right":$(this).width()}).show()}});c.input_terminals[a]=f})},enable_output_terminal:function(d,a,b){var c=this;$(d).each(function(){var g=this;var f=this.terminal=new OutputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dragstart",function(j){var i=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").get(0);i.terminal=new OutputTerminal(i);var k=new Connector();k.dragging=true;k.connect(this.terminal,i.terminal);$.dropManage({filter:function(h){return this.terminal.can_accept(f)}}).addClas
s("input-terminal-active");return i}).bind("drag",function(i){var h=function(){var k=$(i.dragProxy).offsetParent().offset(),j=i.offsetX-k.left,l=i.offsetY-k.top;$(i.dragProxy).css({left:j,top:l});i.dragProxy.terminal.redraw();canvas_manager.update_viewport_overlay()};h();$("#canvas-container").get(0).scroll_panel.test(i,h)}).bind("dragend",function(h){h.dragProxy.terminal.connectors[0].destroy();$(h.dragProxy).remove();$.dropManage().removeClass("input-terminal-active");$("#canvas-container").get(0).scroll_panel.stop()});c.output_terminals[a]=f})},redraw:function(){$.each(this.input_terminals,function(a,b){b.redraw()});$.each(this.output_terminals,function(a,b){b.redraw()})},destroy:function(){$.each(this.input_terminals,function(a,b){b.destroy()});$.each(this.output_terminals,function(a,b){b.destroy()});workflow.remove_node(this);$(this.element).remove()},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){var a=this.element.get(0);(
function(b){b.removeChild(a);b.appendChild(a)})(a.parentNode);$(a).removeClass("toolForm-active")},init_field_data:function(g){var d=this.element;if(g.type){this.type=g.type}this.name=g.name;this.form_html=g.form_html;this.tool_state=g.tool_state;this.tool_errors=g.tool_errors;this.tooltip=g.tooltip?g.tooltip:"";this.annotation=g.annotation;this.post_job_actions=g.post_job_actions;this.workflow_outputs=g.workflow_outputs;if(this.tool_errors){d.addClass("tool-node-error")}else{d.removeClass("tool-node-error")}var c=this;var a=d.find(".toolFormBody");a.find("div").remove();var h=$("<div class='inputs'></div>").appendTo(a);$.each(g.data_inputs,function(j,b){var f=$("<div class='terminal input-terminal'></div>");c.enable_input_terminal(f,b.name,b.extensions);h.append($("<div class='form-row dataRow input-data-row' name='"+b.name+"'>"+b.label+"</div>").prepend(f))});if((g.data_inputs.length>0)&&(g.data_outputs.length>0)){a.append($("<div class='rule'></div>"))}$.each(g.data_outpu
ts,function(k,b){var j=$("<div class='terminal output-terminal'></div>");c.enable_output_terminal(j,b.name,b.extensions);var f=b.name;if(b.extensions.indexOf("input")<0){f=f+" ("+b.extensions+")"}a.append($("<div class='form-row dataRow'>"+f+"</div>").append(j))});workflow.node_changed(this)},update_field_data:function(f){var c=$(this.element),d=this;this.tool_state=f.tool_state;this.form_html=f.form_html;this.tool_errors=f.tool_errors;this.annotation=f.annotation;this.post_job_actions=$.parseJSON(f.post_job_actions);if(this.tool_errors){c.addClass("tool-node-error")}else{c.removeClass("tool-node-error")}var g=c.find("div.inputs");var b=$("<div class='inputs'></div>");var a=g.find("div.input-data-row");$.each(f.data_inputs,function(k,h){var j=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(j,h.name,h.extensions);g.find("div[name="+h.name+"]").each(function(){$(this).find(".input-terminal").each(function(){var i=this.terminal.connectors[0];if(i){j[0].
terminal.connectors[0]=i;i.handle2=j[0].terminal}});$(this).remove()});b.append($("<div class='form-row dataRow input-data-row' name='"+h.name+"'>"+h.label+"</div>").prepend(j))});g.replaceWith(b);g.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(d){var a=$(this.element).find(".toolFormBody");a.find("div").remove();var c="<div style='color: red; text-style: italic;'>"+d+"</div>";this.form_html=c;a.html(c);workflow.node_changed(this)},changed:function(){workflow.node_changed(this)}});function Workflow(a){this.canvas_container=a;this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false;this.active_form_has_changes=false}$.extend(Workflow.prototype,{add_node:function(a){a.id=this.id_counter;a.element.attr("id","wf-node-step-"+a.id);this.id_counter++;this.nodes[a.id]=a;this.has_changes=true;a.workflow=this},remove_node:function(a){if(this.active_node==a){this.clear_active_node()}delete this
.nodes[a.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(b,a){a.destroy();wf.remove_node(a)})},to_simple:function(){var a={};$.each(this.nodes,function(c,f){var g={};$.each(f.input_terminals,function(h,i){g[i.name]=null;$.each(i.connectors,function(j,k){g[i.name]={id:k.handle1.node.id,output_name:k.handle1.name}})});var b={};if(f.post_job_actions){$.each(f.post_job_actions,function(j,h){var k={job_id:h.id,action_type:h.action_type,output_name:h.output_name,action_arguments:h.action_arguments};b[h.action_type+h.output_name]=null;b[h.action_type+h.output_name]=k})}if(!f.workflow_outputs){f.workflow_outputs=[]}var d={id:f.id,type:f.type,tool_id:f.tool_id,tool_state:f.tool_state,tool_errors:f.tool_errors,input_connections:g,position:$(f.element).position(),annotation:f.annotation,post_job_actions:f.post_job_actions,workflow_outputs:f.workflow_outputs};a[f.id]=d});return{steps:a}},from_simple:function(a){wf=this;var b=0;wf.name=a.name;$.each(a.
steps,function(f,d){var c=prebuild_node("tool",d.name,d.tool_id);c.init_field_data(d);if(d.position){c.element.css({top:d.position.top,left:d.position.left})}c.id=d.id;wf.nodes[c.id]=c;b=Math.max(b,parseInt(f))});wf.id_counter=b+1;$.each(a.steps,function(f,d){var c=wf.nodes[f];$.each(d.input_connections,function(h,g){if(g){var i=wf.nodes[g.id];var j=new Connector();j.connect(i.output_terminals[g.output_name],c.input_terminals[h]);j.redraw()}})})},check_changes_in_active_form:function(){if(this.active_form_has_changes){this.has_changes=true;$("#right-content").find("form").submit();this.active_form_has_changes=false}},clear_active_node:function(){if(this.active_node){this.active_node.make_inactive();this.active_node=null}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(a){if(this.active_node!=a){this.check_changes_in_active_form();this.clear_active_node();parent.show_form_for_tool(a.form_html+a.tooltip,a);a.make_active();this.active_node=a}},no
de_changed:function(a){this.has_changes=true;if(this.active_node==a){this.check_changes_in_active_form();parent.show_form_for_tool(a.form_html+a.tooltip,a)}},layout:function(){this.check_changes_in_active_form();this.has_changes=true;var i={};var b={};$.each(this.nodes,function(l,k){if(i[l]===undefined){i[l]=0}if(b[l]===undefined){b[l]=[]}});$.each(this.nodes,function(l,k){$.each(k.input_terminals,function(m,n){$.each(n.connectors,function(p,q){var o=q.handle1.node;i[k.id]+=1;b[o.id].push(k.id)})})});node_ids_by_level=[];while(true){level_parents=[];for(var a in i){if(i[a]==0){level_parents.push(a)}}if(level_parents.length==0){break}node_ids_by_level.push(level_parents);for(var f in level_parents){var j=level_parents[f];delete i[j];for(var g in b[j]){i[b[j][g]]-=1}}}if(i.length){return}var d=this.nodes;var h=80;v_pad=30;var c=h;$.each(node_ids_by_level,function(k,l){l.sort(function(p,o){return $(d[p].element).position().top-$(d[o].element).position().top});var m=0;var n=v_pa
d;$.each(l,function(o,r){var q=d[r];var p=$(q.element);$(p).css({top:n,left:c});m=Math.max(m,$(p).width());n+=$(p).height()+v_pad});c+=m+h});$.each(d,function(k,l){l.redraw()})},bounds_for_all_nodes:function(){var d=Infinity,b=-Infinity,c=Infinity,a=-Infinity,f;$.each(this.nodes,function(h,g){e=$(g.element);f=e.position();d=Math.min(d,f.left);b=Math.max(b,f.left+e.width());c=Math.min(c,f.top);a=Math.max(a,f.top+e.width())});return{xmin:d,xmax:b,ymin:c,ymax:a}},fit_canvas_to_nodes:function(){var a=this.bounds_for_all_nodes();var f=this.canvas_container.position();var i=this.canvas_container.parent();var d=fix_delta(a.xmin,100);var h=fix_delta(a.ymin,100);d=Math.max(d,f.left);h=Math.max(h,f.top);var c=f.left-d;var g=f.top-h;var b=round_up(a.xmax+100,100)+d;var j=round_up(a.ymax+100,100)+h;b=Math.max(b,-c+i.width());j=Math.max(j,-g+i.height());this.canvas_container.css({left:c,top:g,width:b,height:j});this.canvas_container.children().each(function(){var k=$(this).position();$(t
his).css("left",k.left+d);$(this).css("top",k.top+h)})}});function fix_delta(a,b){if(a<b||a>3*b){new_pos=(Math.ceil(((a%b))/b)+1)*b;return(-(a-new_pos))}return 0}function round_up(a,b){return Math.ceil(a/b)*b}function prebuild_node(l,j,r){var i=$("<div class='toolForm toolFormInCanvas'></div>");var g=new Node(i);g.type=l;if(l=="tool"){g.tool_id=r}var n=$("<div class='toolFormTitle unselectable'>"+j+"</div>");i.append(n);i.css("left",$(window).scrollLeft()+20);i.css("top",$(window).scrollTop()+20);var m=$("<div class='toolFormBody'></div>");var h="<div><img height='16' align='middle' src='"+image_path+"/loading_small_white_bg.gif'/> loading tool info...</div>";m.append(h);g.form_html=h;i.append(m);var k=$("<div class='buttons' style='float: right;'></div>");k.append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(b){g.destroy()}).hover(function(){$(this).attr("src",image_path+"/delete_icon_dark.png")},function(){$(this).attr("src",image_path+"/delete_icon
.png")}));i.appendTo("#canvas-container");var d=$("#canvas-container").position();var c=$("#canvas-container").parent();var a=i.width();var q=i.height();i.css({left:(-d.left)+(c.width()/2)-(a/2),top:(-d.top)+(c.height()/2)-(q/2)});k.prependTo(n);a+=(k.width()+10);i.css("width",a);$(i).bind("dragstart",function(){workflow.activate_node(g)}).bind("dragend",function(){workflow.node_changed(this);workflow.fit_canvas_to_nodes();canvas_manager.draw_overview()}).bind("dragclickonly",function(){workflow.activate_node(g)}).bind("drag",function(o){var f=$(this).offsetParent().offset(),b=o.offsetX-f.left,p=o.offsetY-f.top;$(this).css({left:b,top:p});$(this).find(".terminal").each(function(){this.terminal.redraw()})});return g}var ext_to_type=null;var type_to_type=null;function issubtype(b,a){b=ext_to_type[b];a=ext_to_type[a];return(type_to_type[b])&&(a in type_to_type[b])}function populate_datatype_info(a){ext_to_type=a.ext_to_class_name;type_to_type=a.class_to_classes}function ScrollP
anel(a){this.panel=a}$.extend(ScrollPanel.prototype,{test:function(v,d){clearTimeout(this.timeout);var k=v.pageX,j=v.pageY,l=$(this.panel),c=l.position(),b=l.width(),i=l.height(),w=l.parent(),s=w.width(),a=w.height(),r=w.offset(),p=r.left,m=r.top,A=p+w.width(),u=m+w.height(),B=-(b-(s/2)),z=-(i-(a/2)),g=(s/2),f=(a/2),h=false,q=5,o=23;if(k-q<p){if(c.left<g){var n=Math.min(o,g-c.left);l.css("left",c.left+n);h=true}}else{if(k+q>A){if(c.left>B){var n=Math.min(o,c.left-B);l.css("left",c.left-n);h=true}}else{if(j-q<m){if(c.top<f){var n=Math.min(o,f-c.top);l.css("top",c.top+n);h=true}}else{if(j+q>u){if(c.top>z){var n=Math.min(o,c.top-B);l.css("top",(c.top-n)+"px");h=true}}}}}if(h){d();var l=this;this.timeout=setTimeout(function(){l.test(v,d)},50)}},stop:function(b,a){clearTimeout(this.timeout)}});function CanvasManager(b,a){this.cv=b;this.cc=this.cv.find("#canvas-container");this.oc=a.find("#overview-canvas");this.ov=a.find("#overview-viewport");this.init_drag()}$.extend(CanvasManag
er.prototype,{init_drag:function(){var b=this;var a=function(f,g){f=Math.min(f,b.cv.width()/2);f=Math.max(f,-b.cc.width()+b.cv.width()/2);g=Math.min(g,b.cv.height()/2);g=Math.max(g,-b.cc.height()+b.cv.height()/2);b.cc.css({left:f,top:g});b.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new ScrollPanel(this)});var d,c;this.cv.bind("dragstart",function(g){var h=$(this).offset();var f=b.cc.position();c=f.top-h.top;d=f.left-h.left}).bind("drag",function(f){a(f.offsetX+d,f.offsetY+c)}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});this.ov.bind("drag",function(k){var j=b.cc.width(),g=b.cc.height(),f=b.oc.width(),h=b.oc.height(),i=$(this).offsetParent().offset(),m=k.offsetX-i.left,l=k.offsetY-i.top;a(-(m/f*j),-(l/h*g))}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});$("#overview-border").bind("drag",function(g){var i=$(this).offsetParent();var h=i.offset();var f=Math.max(i.width()-(g.offsetX-h.left)
,i.height()-(g.offsetY-h.top));$(this).css({width:f,height:f});b.draw_overview()});$("#overview-border div").bind("drag",function(f){})},update_viewport_overlay:function(){var b=this.cc,f=this.cv,a=this.oc,c=this.ov,d=b.width(),j=b.height(),i=a.width(),g=a.height(),h=b.position();c.css({left:-(h.left/d*i),top:-(h.top/j*g),width:(f.width()/d*i)-2,height:(f.height()/j*g)-2})},draw_overview:function(){var j=$("#overview-canvas"),m=j.parent().parent().width(),i=j.get(0).getContext("2d"),d=$("#canvas-container").width(),l=$("#canvas-container").height();var g,a,k,f;var h=this.cv.width();var b=this.cv.height();if(d<h&&l<b){k=d/h*m;f=(m-k)/2;g=l/b*m;a=(m-g)/2}else{if(d<l){a=0;g=m;k=Math.ceil(g*d/l);f=(m-k)/2}else{k=m;f=0;g=Math.ceil(k*l/d);a=(m-g)/2}}j.parent().css({left:f,top:a,width:k,height:g});j.attr("width",k);j.attr("height",g);i.fillStyle="#D2C099";i.strokeStyle="#D8B365";i.lineWidth=1;$.each(workflow.nodes,function(t,q){var s=$(q.element),n=s.position(),c=n.left/d*k,r=n.top
/l*g,o=s.width()/d*k,p=s.height()/l*g;i.fillRect(c,r,o,p);i.strokeRect(c,r,o,p)});this.update_viewport_overlay()}});
+function Terminal(a){this.element=a;this.connectors=[]}$.extend(Terminal.prototype,{connect:function(a){this.connectors.push(a);if(this.node){this.node.changed()}},disconnect:function(a){this.connectors.splice($.inArray(a,this.connectors),1);if(this.node){this.node.changed()}},redraw:function(){$.each(this.connectors,function(a,b){b.redraw()})},destroy:function(){$.each(this.connectors.slice(),function(a,b){b.destroy()})}});function OutputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}OutputTerminal.prototype=new Terminal();function InputTerminal(a,b){Terminal.call(this,a);this.datatypes=b}InputTerminal.prototype=new Terminal();$.extend(InputTerminal.prototype,{can_accept:function(a){if(this.connectors.length<1){for(var c in this.datatypes){var f=new Array();f=f.concat(a.datatypes);if(a.node.post_job_actions){for(var d in a.node.post_job_actions){var g=a.node.post_job_actions[d];if(g.action_type=="ChangeDatatypeAction"&&(g.output_name==""||g.output_name==a.name)&&g.act
ion_arguments){f.push(g.action_arguments.newtype)}}}for(var b in f){if(f[b]=="input"||issubtype(f[b],this.datatypes[c])){return true}}}}return false}});function Connector(b,a){this.canvas=null;this.dragging=false;this.inner_color="#FFFFFF";this.outer_color="#D8B365";if(b&&a){this.connect(b,a)}}$.extend(Connector.prototype,{connect:function(b,a){this.handle1=b;this.handle1.connect(this);this.handle2=a;this.handle2.connect(this)},destroy:function(){if(this.handle1){this.handle1.disconnect(this)}if(this.handle2){this.handle2.disconnect(this)}$(this.canvas).remove()},redraw:function(){var d=$("#canvas-container");if(!this.canvas){this.canvas=document.createElement("canvas");if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(this.canvas)}d.append($(this.canvas));if(this.dragging){this.canvas.style.zIndex="300"}}var n=function(c){return $(c).offset().left-d.offset().left};var i=function(c){return $(c).offset().top-d.offset().top};var h=n(this.handle1.element)+5;var g=i(t
his.handle1.element)+5;var p=n(this.handle2.element)+5;var m=i(this.handle2.element)+5;var f=100;var k=Math.min(h,p);var a=Math.max(h,p);var j=Math.min(g,m);var t=Math.max(g,m);var b=Math.min(Math.max(Math.abs(t-j)/2,100),300);var o=k-f;var s=j-f;var q=a-k+2*f;var l=t-j+2*f;this.canvas.style.left=o+"px";this.canvas.style.top=s+"px";this.canvas.setAttribute("width",q);this.canvas.setAttribute("height",l);h-=o;g-=s;p-=o;m-=s;var r=this.canvas.getContext("2d");r.lineCap="round";r.strokeStyle=this.outer_color;r.lineWidth=7;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke();r.strokeStyle=this.inner_color;r.lineWidth=5;r.beginPath();r.moveTo(h,g);r.bezierCurveTo(h+b,g,p-b,m,p,m);r.stroke()}});function Node(a){this.element=a;this.input_terminals={};this.output_terminals={};this.tool_errors={}}$.extend(Node.prototype,{enable_input_terminal:function(d,a,b){var c=this;$(d).each(function(){var f=this.terminal=new InputTerminal(this,b);f.node=c;f.name=a;$(this).bind
("dropstart",function(g){g.dragProxy.terminal.connectors[0].inner_color="#BBFFBB"}).bind("dropend",function(g){g.dragProxy.terminal.connectors[0].inner_color="#FFFFFF"}).bind("drop",function(g){(new Connector(g.dragTarget.terminal,g.dropTarget.terminal)).redraw()}).bind("hover",function(){if(f.connectors.length>0){var g=$("<div class='callout'></div>").css({display:"none"}).appendTo("body").append($("<div class='buttons'></div>").append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(){$.each(f.connectors,function(i,h){h.destroy()});g.remove()}))).bind("mouseleave",function(){$(this).remove()});g.css({top:$(this).offset().top-2,left:$(this).offset().left-g.width(),"padding-right":$(this).width()}).show()}});c.input_terminals[a]=f})},enable_output_terminal:function(d,a,b){var c=this;$(d).each(function(){var g=this;var f=this.terminal=new OutputTerminal(this,b);f.node=c;f.name=a;$(this).bind("dragstart",function(j){workflow.check_changes_in_active_form();v
ar i=$('<div class="drag-terminal" style="position: absolute;"></div>').appendTo("#canvas-container").get(0);i.terminal=new OutputTerminal(i);var k=new Connector();k.dragging=true;k.connect(this.terminal,i.terminal);$.dropManage({filter:function(h){return this.terminal.can_accept(f)}}).addClass("input-terminal-active");return i}).bind("drag",function(i){var h=function(){var k=$(i.dragProxy).offsetParent().offset(),j=i.offsetX-k.left,l=i.offsetY-k.top;$(i.dragProxy).css({left:j,top:l});i.dragProxy.terminal.redraw();canvas_manager.update_viewport_overlay()};h();$("#canvas-container").get(0).scroll_panel.test(i,h)}).bind("dragend",function(h){h.dragProxy.terminal.connectors[0].destroy();$(h.dragProxy).remove();$.dropManage().removeClass("input-terminal-active");$("#canvas-container").get(0).scroll_panel.stop()});c.output_terminals[a]=f})},redraw:function(){$.each(this.input_terminals,function(a,b){b.redraw()});$.each(this.output_terminals,function(a,b){b.redraw()})},destroy:fun
ction(){$.each(this.input_terminals,function(a,b){b.destroy()});$.each(this.output_terminals,function(a,b){b.destroy()});workflow.remove_node(this);$(this.element).remove()},make_active:function(){$(this.element).addClass("toolForm-active")},make_inactive:function(){var a=this.element.get(0);(function(b){b.removeChild(a);b.appendChild(a)})(a.parentNode);$(a).removeClass("toolForm-active")},init_field_data:function(g){var d=this.element;if(g.type){this.type=g.type}this.name=g.name;this.form_html=g.form_html;this.tool_state=g.tool_state;this.tool_errors=g.tool_errors;this.tooltip=g.tooltip?g.tooltip:"";this.annotation=g.annotation;this.post_job_actions=g.post_job_actions;this.workflow_outputs=g.workflow_outputs;if(this.tool_errors){d.addClass("tool-node-error")}else{d.removeClass("tool-node-error")}var c=this;var a=d.find(".toolFormBody");a.find("div").remove();var h=$("<div class='inputs'></div>").appendTo(a);$.each(g.data_inputs,function(j,b){var f=$("<div class='terminal in
put-terminal'></div>");c.enable_input_terminal(f,b.name,b.extensions);h.append($("<div class='form-row dataRow input-data-row' name='"+b.name+"'>"+b.label+"</div>").prepend(f))});if((g.data_inputs.length>0)&&(g.data_outputs.length>0)){a.append($("<div class='rule'></div>"))}$.each(g.data_outputs,function(k,b){var j=$("<div class='terminal output-terminal'></div>");c.enable_output_terminal(j,b.name,b.extensions);var f=b.name;if(b.extensions.indexOf("input")<0){f=f+" ("+b.extensions+")"}a.append($("<div class='form-row dataRow'>"+f+"</div>").append(j))});workflow.node_changed(this)},update_field_data:function(f){var c=$(this.element),d=this;this.tool_state=f.tool_state;this.form_html=f.form_html;this.tool_errors=f.tool_errors;this.annotation=f.annotation;this.post_job_actions=$.parseJSON(f.post_job_actions);if(this.tool_errors){c.addClass("tool-node-error")}else{c.removeClass("tool-node-error")}var g=c.find("div.inputs");var b=$("<div class='inputs'></div>");var a=g.find("div.
input-data-row");$.each(f.data_inputs,function(k,h){var j=$("<div class='terminal input-terminal'></div>");d.enable_input_terminal(j,h.name,h.extensions);g.find("div[name="+h.name+"]").each(function(){$(this).find(".input-terminal").each(function(){var i=this.terminal.connectors[0];if(i){j[0].terminal.connectors[0]=i;i.handle2=j[0].terminal}});$(this).remove()});b.append($("<div class='form-row dataRow input-data-row' name='"+h.name+"'>"+h.label+"</div>").prepend(j))});g.replaceWith(b);g.find("div.input-data-row > .terminal").each(function(){this.terminal.destroy()});this.changed();this.redraw()},error:function(d){var a=$(this.element).find(".toolFormBody");a.find("div").remove();var c="<div style='color: red; text-style: italic;'>"+d+"</div>";this.form_html=c;a.html(c);workflow.node_changed(this)},changed:function(){workflow.node_changed(this)}});function Workflow(a){this.canvas_container=a;this.id_counter=0;this.nodes={};this.name=null;this.has_changes=false;this.active_fo
rm_has_changes=false}$.extend(Workflow.prototype,{add_node:function(a){a.id=this.id_counter;a.element.attr("id","wf-node-step-"+a.id);this.id_counter++;this.nodes[a.id]=a;this.has_changes=true;a.workflow=this},remove_node:function(a){if(this.active_node==a){this.clear_active_node()}delete this.nodes[a.id];this.has_changes=true},remove_all:function(){wf=this;$.each(this.nodes,function(b,a){a.destroy();wf.remove_node(a)})},to_simple:function(){var a={};$.each(this.nodes,function(c,f){var g={};$.each(f.input_terminals,function(h,i){g[i.name]=null;$.each(i.connectors,function(j,k){g[i.name]={id:k.handle1.node.id,output_name:k.handle1.name}})});var b={};if(f.post_job_actions){$.each(f.post_job_actions,function(j,h){var k={job_id:h.id,action_type:h.action_type,output_name:h.output_name,action_arguments:h.action_arguments};b[h.action_type+h.output_name]=null;b[h.action_type+h.output_name]=k})}if(!f.workflow_outputs){f.workflow_outputs=[]}var d={id:f.id,type:f.type,tool_id:f.tool_id
,tool_state:f.tool_state,tool_errors:f.tool_errors,input_connections:g,position:$(f.element).position(),annotation:f.annotation,post_job_actions:f.post_job_actions,workflow_outputs:f.workflow_outputs};a[f.id]=d});return{steps:a}},from_simple:function(a){wf=this;var b=0;wf.name=a.name;$.each(a.steps,function(f,d){var c=prebuild_node("tool",d.name,d.tool_id);c.init_field_data(d);if(d.position){c.element.css({top:d.position.top,left:d.position.left})}c.id=d.id;wf.nodes[c.id]=c;b=Math.max(b,parseInt(f))});wf.id_counter=b+1;$.each(a.steps,function(f,d){var c=wf.nodes[f];$.each(d.input_connections,function(h,g){if(g){var i=wf.nodes[g.id];var j=new Connector();j.connect(i.output_terminals[g.output_name],c.input_terminals[h]);j.redraw()}})})},check_changes_in_active_form:function(){if(this.active_form_has_changes){this.has_changes=true;$("#right-content").find("form").submit();this.active_form_has_changes=false}},clear_active_node:function(){if(this.active_node){this.active_node.mak
e_inactive();this.active_node=null}parent.show_form_for_tool("<div>No node selected</div>")},activate_node:function(a){if(this.active_node!=a){this.check_changes_in_active_form();this.clear_active_node();parent.show_form_for_tool(a.form_html+a.tooltip,a);a.make_active();this.active_node=a}},node_changed:function(a){this.has_changes=true;if(this.active_node==a){this.check_changes_in_active_form();parent.show_form_for_tool(a.form_html+a.tooltip,a)}},layout:function(){this.check_changes_in_active_form();this.has_changes=true;var i={};var b={};$.each(this.nodes,function(l,k){if(i[l]===undefined){i[l]=0}if(b[l]===undefined){b[l]=[]}});$.each(this.nodes,function(l,k){$.each(k.input_terminals,function(m,n){$.each(n.connectors,function(p,q){var o=q.handle1.node;i[k.id]+=1;b[o.id].push(k.id)})})});node_ids_by_level=[];while(true){level_parents=[];for(var a in i){if(i[a]==0){level_parents.push(a)}}if(level_parents.length==0){break}node_ids_by_level.push(level_parents);for(var f in lev
el_parents){var j=level_parents[f];delete i[j];for(var g in b[j]){i[b[j][g]]-=1}}}if(i.length){return}var d=this.nodes;var h=80;v_pad=30;var c=h;$.each(node_ids_by_level,function(k,l){l.sort(function(p,o){return $(d[p].element).position().top-$(d[o].element).position().top});var m=0;var n=v_pad;$.each(l,function(o,r){var q=d[r];var p=$(q.element);$(p).css({top:n,left:c});m=Math.max(m,$(p).width());n+=$(p).height()+v_pad});c+=m+h});$.each(d,function(k,l){l.redraw()})},bounds_for_all_nodes:function(){var d=Infinity,b=-Infinity,c=Infinity,a=-Infinity,f;$.each(this.nodes,function(h,g){e=$(g.element);f=e.position();d=Math.min(d,f.left);b=Math.max(b,f.left+e.width());c=Math.min(c,f.top);a=Math.max(a,f.top+e.width())});return{xmin:d,xmax:b,ymin:c,ymax:a}},fit_canvas_to_nodes:function(){var a=this.bounds_for_all_nodes();var f=this.canvas_container.position();var i=this.canvas_container.parent();var d=fix_delta(a.xmin,100);var h=fix_delta(a.ymin,100);d=Math.max(d,f.left);h=Math.max(h
,f.top);var c=f.left-d;var g=f.top-h;var b=round_up(a.xmax+100,100)+d;var j=round_up(a.ymax+100,100)+h;b=Math.max(b,-c+i.width());j=Math.max(j,-g+i.height());this.canvas_container.css({left:c,top:g,width:b,height:j});this.canvas_container.children().each(function(){var k=$(this).position();$(this).css("left",k.left+d);$(this).css("top",k.top+h)})}});function fix_delta(a,b){if(a<b||a>3*b){new_pos=(Math.ceil(((a%b))/b)+1)*b;return(-(a-new_pos))}return 0}function round_up(a,b){return Math.ceil(a/b)*b}function prebuild_node(l,j,r){var i=$("<div class='toolForm toolFormInCanvas'></div>");var g=new Node(i);g.type=l;if(l=="tool"){g.tool_id=r}var n=$("<div class='toolFormTitle unselectable'>"+j+"</div>");i.append(n);i.css("left",$(window).scrollLeft()+20);i.css("top",$(window).scrollTop()+20);var m=$("<div class='toolFormBody'></div>");var h="<div><img height='16' align='middle' src='"+image_path+"/loading_small_white_bg.gif'/> loading tool info...</div>";m.append(h);g.form_html=h;i
.append(m);var k=$("<div class='buttons' style='float: right;'></div>");k.append($("<img/>").attr("src",image_path+"/delete_icon.png").click(function(b){g.destroy()}).hover(function(){$(this).attr("src",image_path+"/delete_icon_dark.png")},function(){$(this).attr("src",image_path+"/delete_icon.png")}));i.appendTo("#canvas-container");var d=$("#canvas-container").position();var c=$("#canvas-container").parent();var a=i.width();var q=i.height();i.css({left:(-d.left)+(c.width()/2)-(a/2),top:(-d.top)+(c.height()/2)-(q/2)});k.prependTo(n);a+=(k.width()+10);i.css("width",a);$(i).bind("dragstart",function(){workflow.activate_node(g)}).bind("dragend",function(){workflow.node_changed(this);workflow.fit_canvas_to_nodes();canvas_manager.draw_overview()}).bind("dragclickonly",function(){workflow.activate_node(g)}).bind("drag",function(o){var f=$(this).offsetParent().offset(),b=o.offsetX-f.left,p=o.offsetY-f.top;$(this).css({left:b,top:p});$(this).find(".terminal").each(function(){this.t
erminal.redraw()})});return g}var ext_to_type=null;var type_to_type=null;function issubtype(b,a){b=ext_to_type[b];a=ext_to_type[a];return(type_to_type[b])&&(a in type_to_type[b])}function populate_datatype_info(a){ext_to_type=a.ext_to_class_name;type_to_type=a.class_to_classes}function ScrollPanel(a){this.panel=a}$.extend(ScrollPanel.prototype,{test:function(v,d){clearTimeout(this.timeout);var k=v.pageX,j=v.pageY,l=$(this.panel),c=l.position(),b=l.width(),i=l.height(),w=l.parent(),s=w.width(),a=w.height(),r=w.offset(),p=r.left,m=r.top,A=p+w.width(),u=m+w.height(),B=-(b-(s/2)),z=-(i-(a/2)),g=(s/2),f=(a/2),h=false,q=5,o=23;if(k-q<p){if(c.left<g){var n=Math.min(o,g-c.left);l.css("left",c.left+n);h=true}}else{if(k+q>A){if(c.left>B){var n=Math.min(o,c.left-B);l.css("left",c.left-n);h=true}}else{if(j-q<m){if(c.top<f){var n=Math.min(o,f-c.top);l.css("top",c.top+n);h=true}}else{if(j+q>u){if(c.top>z){var n=Math.min(o,c.top-B);l.css("top",(c.top-n)+"px");h=true}}}}}if(h){d();var l=thi
s;this.timeout=setTimeout(function(){l.test(v,d)},50)}},stop:function(b,a){clearTimeout(this.timeout)}});function CanvasManager(b,a){this.cv=b;this.cc=this.cv.find("#canvas-container");this.oc=a.find("#overview-canvas");this.ov=a.find("#overview-viewport");this.init_drag()}$.extend(CanvasManager.prototype,{init_drag:function(){var b=this;var a=function(f,g){f=Math.min(f,b.cv.width()/2);f=Math.max(f,-b.cc.width()+b.cv.width()/2);g=Math.min(g,b.cv.height()/2);g=Math.max(g,-b.cc.height()+b.cv.height()/2);b.cc.css({left:f,top:g});b.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new ScrollPanel(this)});var d,c;this.cv.bind("dragstart",function(g){var h=$(this).offset();var f=b.cc.position();c=f.top-h.top;d=f.left-h.left}).bind("drag",function(f){a(f.offsetX+d,f.offsetY+c)}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});this.ov.bind("drag",function(k){var j=b.cc.width(),g=b.cc.height(),f=b.oc.width(),h=b.oc.height(),i=$(this).of
fsetParent().offset(),m=k.offsetX-i.left,l=k.offsetY-i.top;a(-(m/f*j),-(l/h*g))}).bind("dragend",function(){workflow.fit_canvas_to_nodes();b.draw_overview()});$("#overview-border").bind("drag",function(g){var i=$(this).offsetParent();var h=i.offset();var f=Math.max(i.width()-(g.offsetX-h.left),i.height()-(g.offsetY-h.top));$(this).css({width:f,height:f});b.draw_overview()});$("#overview-border div").bind("drag",function(f){})},update_viewport_overlay:function(){var b=this.cc,f=this.cv,a=this.oc,c=this.ov,d=b.width(),j=b.height(),i=a.width(),g=a.height(),h=b.position();c.css({left:-(h.left/d*i),top:-(h.top/j*g),width:(f.width()/d*i)-2,height:(f.height()/j*g)-2})},draw_overview:function(){var j=$("#overview-canvas"),m=j.parent().parent().width(),i=j.get(0).getContext("2d"),d=$("#canvas-container").width(),l=$("#canvas-container").height();var g,a,k,f;var h=this.cv.width();var b=this.cv.height();if(d<h&&l<b){k=d/h*m;f=(m-k)/2;g=l/b*m;a=(m-g)/2}else{if(d<l){a=0;g=m;k=Math.ceil(g
*d/l);f=(m-k)/2}else{k=m;f=0;g=Math.ceil(k*l/d);a=(m-g)/2}}j.parent().css({left:f,top:a,width:k,height:g});j.attr("width",k);j.attr("height",g);i.fillStyle="#D2C099";i.strokeStyle="#D8B365";i.lineWidth=1;$.each(workflow.nodes,function(t,q){var s=$(q.element),n=s.position(),c=n.left/d*k,r=n.top/l*g,o=s.width()/d*k,p=s.height()/l*g;i.fillRect(c,r,o,p);i.strokeRect(c,r,o,p)});this.update_viewport_overlay()}});
--- a/lib/galaxy/web/framework/helpers/__init__.py
+++ b/lib/galaxy/web/framework/helpers/__init__.py
@@ -44,7 +44,7 @@ def js( *args ):
TODO: This has a hardcoded "?v=X" to defeat caching. This should be done
in a better way.
"""
- return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js?v=6" ) for name in args ] )
+ return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js?v=7" ) for name in args ] )
# Hashes
1
0
galaxy-dist commit 6b2dffb999d8: Fix for temporary name generation - now use mkstemp for the name and keep the filename
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User fubar: ross Lazarus at gmail period com
# Date 1283235958 14400
# Node ID 6b2dffb999d8595d410dc299fb512b76c35be39e
# Parent b7e13932acf9e58dee2bb3f2799e7e27402ffc63
Fix for temporary name generation - now use mkstemp for the name and keep the filename
at the end of the temporary name for tools where the extension matters
in tests
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -616,6 +616,16 @@ class TwillTestCase( unittest.TestCase )
hid = elem.get('hid')
hids.append(hid)
return hids
+
+ def makeTfname(self, fname=None):
+ """
+ safe temp name - preserve the file extension for tools that interpret it
+ """
+ suffix = os.path.split(fname)[-1] # ignore full path
+ fd,temp_prefix = tempfile.mkstemp(prefix='tmp',suffix=suffix)
+ return temp_prefix
+
+
def verify_dataset_correctness( self, filename, hid=None, wait=True, maxseconds=120, attributes=None ):
"""Verifies that the attributes and contents of a history item meet expectations"""
if wait:
@@ -645,7 +655,7 @@ class TwillTestCase( unittest.TestCase )
raise AssertionError( errmsg )
else:
local_name = self.get_filename( filename )
- temp_name = self.get_filename( '%s_temp' % filename ) #This is a terrible way to generate a temp name
+ temp_name = self.makeTfname(fname = filename)
self.home()
self.visit_page( "display?hid=" + hid )
data = self.last_page()
@@ -691,7 +701,7 @@ class TwillTestCase( unittest.TestCase )
local_name = self.get_filename( file_name )
if base_name is None:
base_name = os.path.split(file_name)[-1]
- temp_name = self.get_filename( '%s_temp' % file_name ) #This is a terrible way to generate a temp name
+ temp_name = self.makeTfname(fname = base_name)
self.visit_url( "%s/datasets/%s/display/%s" % ( self.url, self.security.encode_id( hda_id ), base_name ) )
data = self.last_page()
file( temp_name, 'wb' ).write( data )
@@ -720,7 +730,7 @@ class TwillTestCase( unittest.TestCase )
errmsg += str( err )
raise AssertionError( errmsg )
finally:
- os.remove( temp_name )
+ os.remove( temp_name )
def is_zipped( self, filename ):
if not zipfile.is_zipfile( filename ):
@@ -728,7 +738,7 @@ class TwillTestCase( unittest.TestCase )
return True
def is_binary( self, filename ):
- temp = open( temp_name, "U" )
+ temp = open( filename, "U" ) # why is this not filename? Where did temp_name come from
lineno = 0
for line in temp:
lineno += 1
1
0
galaxy-dist commit b7e13932acf9: Issue #380: Properly handle -n and -v options in Bowtie
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User Kelly Vincent <kpvincent(a)bx.psu.edu>
# Date 1283231072 14400
# Node ID b7e13932acf9e58dee2bb3f2799e7e27402ffc63
# Parent 1cd9009036f729c8d36fe40db6cbfd6508c3a635
Issue #380: Properly handle -n and -v options in Bowtie
--- a/tools/sr_mapping/bowtie_wrapper.py
+++ b/tools/sr_mapping/bowtie_wrapper.py
@@ -120,6 +120,7 @@ def __main__():
parser.add_option( '-H', '--suppressHeader', dest='suppressHeader', help='Suppress header' )
(options, args) = parser.parse_args()
stdout = ''
+
# make temp directory for placement of indices and copy reference file there if necessary
tmp_index_dir = tempfile.mkdtemp()
# get type of data (solid or solexa)
@@ -190,7 +191,7 @@ def __main__():
# clean up temp dir
if os.path.exists( tmp_index_dir ):
shutil.rmtree( tmp_index_dir )
- stop_err( 'Something is wrong with the indexing parameters and the indexing and alignment could not be run\n' + str( e ) )
+ stop_err( "Something is wrong with the indexing parameters and the indexing and alignment could not be run. Make sure you don't have any non-numeric values where they should be numeric.\n" + str( e ) )
ref_file = tempfile.NamedTemporaryFile( dir=tmp_index_dir )
ref_file_name = ref_file.name
ref_file.close()
@@ -259,7 +260,7 @@ def __main__():
trimL = '-3 %s' % options.trimL
else:
trimL = ''
- if options. mismatchSeed != 'None' and (options.mismatchSeed == '0' or options.mismatchSeed == '1' \
+ if options.mismatchSeed != 'None' and (options.mismatchSeed == '0' or options.mismatchSeed == '1' \
or options.mismatchSeed == '2' or options.mismatchSeed == '3'):
mismatchSeed = '-n %s' % options.mismatchSeed
else:
@@ -276,7 +277,7 @@ def __main__():
rounding = '--nomaqround'
else:
rounding = ''
- if options.maqSoapAlign != '-1':
+ if options.maqSoapAlign != '-1' and int( options.maqSoapAlign ) >= 0:
maqSoapAlign = '-v %s' % options.maqSoapAlign
else:
maqSoapAlign = ''
1
0
galaxy-dist commit 7cc9329fd895: Fixes to some rgenetics tests and test outputs
by commits-noreply@bitbucket.org 08 Sep '10
by commits-noreply@bitbucket.org 08 Sep '10
08 Sep '10
# HG changeset patch -- Bitbucket.org
# Project galaxy-dist
# URL http://bitbucket.org/galaxy/galaxy-dist/overview
# User fubar: ross Lazarus at gmail period com
# Date 1283236053 14400
# Node ID 7cc9329fd895049827d1bf5436f6aa11bf9d30ed
# Parent 6b2dffb999d8595d410dc299fb512b76c35be39e
Fixes to some rgenetics tests and test outputs
Some odd bugs in the new version of ggplot2 in R
Fixes to the Rrun function in rgutils
Binary file test-data/rgtestouts/rgManQQ/Allelep_manhattan.png has changed
--- a/tools/rgenetics/rgManQQ.py
+++ b/tools/rgenetics/rgManQQ.py
@@ -75,25 +75,25 @@ manhattan = function(chrom=NULL,offset=N
# only makes sense if genome wide is assumed - we could have a fine mapping region?
if (annotate) d.annotate=d[as.numeric(substr(d$SNP,3,100)) %in% SNPlist, ]
- plot=qplot(pos,logp,data=d, ylab=expression(-log[10](italic(p))) , colour=factor(CHR))
- plot=plot+scale_x_continuous(name="Chromosome", breaks=ticks, labels=(unique(d$CHR)))
- plot=plot+scale_y_continuous(limits=c(0,maxy), breaks=1:maxy, labels=1:maxy)
- plot=plot+scale_colour_manual(value=mycols)
- if (annotate) plot=plot + geom_point(data=d.annotate, colour=I("green3"))
- plot=plot + opts(legend.position = "none")
- plot=plot + opts(title=title)
- plot=plot+opts(
+ manplot=qplot(pos,logp,data=d, ylab=expression(-log[10](italic(p))) , colour=factor(CHR))
+ manplot=manplot+scale_x_continuous(name="Chromosome", breaks=ticks, labels=(unique(d$CHR)))
+ manplot=manplot+scale_y_continuous(limits=c(0,maxy), breaks=1:maxy, labels=1:maxy)
+ manplot=manplot+scale_colour_manual(value=mycols)
+ if (annotate) { manplot=manplot + geom_point(data=d.annotate, colour=I("green3")) }
+ manplot=manplot + opts(legend.position = "none")
+ manplot=manplot + opts(title=title)
+ manplot=manplot+opts(
panel.background=theme_blank(),
axis.text.x=theme_text(size=size.x.labels, colour="grey50"),
axis.text.y=theme_text(size=size.y.labels, colour="grey50"),
axis.ticks=theme_segment(colour=NA)
)
- #plot = plot + opts(panel.grid.y.minor=theme_blank(),panel.grid.y.major=theme_blank())
- #plot = plot + opts(panel.grid.major=theme_blank())
+ #manplot = manplot + opts(panel.grid.y.minor=theme_blank(),panel.grid.y.major=theme_blank())
+ #manplot = manplot + opts(panel.grid.major=theme_blank())
- if (suggestiveline) plot=plot+geom_hline(yintercept=suggestiveline,colour="blue", alpha=I(1/3))
- if (genomewideline) plot=plot+geom_hline(yintercept=genomewideline,colour="red")
- plot
+ if (suggestiveline) manplot=manplot+geom_hline(yintercept=suggestiveline,colour="blue", alpha=I(1/3))
+ if (genomewideline) manplot=manplot+geom_hline(yintercept=genomewideline,colour="red")
+ manplot
} else {
stop("Make sure your data frame contains columns CHR, BP, and P")
}
@@ -110,12 +110,12 @@ qq = function(pvector, title=NULL, spart
# ylab=expression(Observed~~-log[10](italic(p))), xlim=c(0,max(e)), ylim=c(0,max(e)))
# lines(e,e,col="red")
#You'll need ggplot2 installed to do the rest
- plot=qplot(e,o, xlim=c(0,max(e)), ylim=c(0,max(o))) + stat_abline(intercept=0,slope=1, col="red")
- plot=plot+opts(title=title)
- plot=plot+scale_x_continuous(name=expression(Expected~~-log[10](italic(p))))
- plot=plot+scale_y_continuous(name=expression(Observed~~-log[10](italic(p))))
+ qq=qplot(e,o, xlim=c(0,max(e)), ylim=c(0,max(o))) + stat_abline(intercept=0,slope=1, col="red")
+ qq=qq+opts(title=title)
+ qq=qq+scale_x_continuous(name=expression(Expected~~-log[10](italic(p))))
+ qq=qq+scale_y_continuous(name=expression(Observed~~-log[10](italic(p))))
if (spartan) plot=plot+opts(panel.background=theme_rect(col="grey50"), panel.grid.minor=theme_blank())
- plot
+ qq
}
"""
@@ -140,6 +140,7 @@ if (plen > 0) {
mytitle = paste('p=',cname,', ',title,sep='')
myfname = chartr(' ','_',cname)
myqqplot = qq(rawd[,pvalscolumn],title=mytitle)
+ ggsave(filename=paste(myfname,"qqplot.png",sep='_'),myqqplot,width=8,height=11)
print(paste('## qqplot on',cname,'done'))
if ((chromcolumn > 0) & (offsetcolumn > 0)) {
if (doreorder) {
@@ -151,13 +152,12 @@ if (plen > 0) {
print(paste('## manhattan on',cname,'starting',chromcolumn,offsetcolumn,pvalscolumn))
mymanplot= manhattan(chrom=rawd[,chromcolumn],offset=rawd[,offsetcolumn],pvals=rawd[,pvalscolumn],title=mytitle,grey=grey)
print(paste('## manhattan plot on',cname,'done'))
- ggsave(file=paste(myfname,"manhattan.png",sep='_'),mymanplot,width=11,height=8,dpi=100)
+ ggsave(filename=paste(myfname,"manhattan.png",sep='_'),mymanplot,width=11,height=8)
}
else {
print(paste('chrom column =',chromcolumn,'offset column = ',offsetcolumn,
'so no Manhattan plot - supply both chromosome and offset as numerics for Manhattan plots if required'))
}
- ggsave(file=paste(myfname,"qqplot.png",sep='_'),myqqplot,width=8,height=11,dpi=100)
}
else {
print(paste('pvalue column =',pvalscolumn,'Cannot parse it so no plots possible'))
@@ -177,9 +177,10 @@ def doManQQ(input_fname,chrom_col,offset
to make them do our bidding - and save the resulting code for posterity
this can be called externally, I guess...for QC eg?
"""
-
rcmd = '%s%s' % (rcode,rcode2 % (input_fname,chrom_col,offset_col,pval_cols,title,grey))
rlog,flist = RRun(rcmd=rcmd,title=ctitle,outdir=outdir)
+ rlog.append('## R script=')
+ rlog.append(rcmd)
return rlog,flist
--- a/test-data/rgtestouts/rgManQQ/rgManQQtest1.R
+++ b/test-data/rgtestouts/rgManQQ/rgManQQtest1.R
@@ -108,7 +108,7 @@ qq = function(pvector, title=NULL, spart
if (spartan) plot=plot+opts(panel.background=theme_rect(col="grey50"), panel.grid.minor=theme_blank())
plot
}
-rgqqMan = function(infile="/share/shared/galaxy/test-data/smallwgaP.xls",chromcolumn=2, offsetcolumn=3, pvalscolumns=c(6,8),
+rgqqMan = function(infile="/opt/galaxy/test-data/smallwgaP.xls",chromcolumn=2, offsetcolumn=3, pvalscolumns=c(8),
title="rgManQQtest1",grey=0) {
rawd = read.table(infile,head=T,sep=' ')
dn = names(rawd)
@@ -155,4 +155,4 @@ if (plen > 0) {
rgqqMan()
# execute with defaults as substituted
-#R script autogenerated by rgenetics/rgutils.py on 09/05/2010 21:23:26
+#R script autogenerated by rgenetics/rgutils.py on 30/08/2010 04:09:48
--- a/tools/rgenetics/rgGRR.py
+++ b/tools/rgenetics/rgGRR.py
@@ -78,7 +78,7 @@ class NullDevice:
pass
tempstderr = sys.stderr # save
-sys.stderr = NullDevice()
+#sys.stderr = NullDevice()
# need to avoid blather about deprecation and other strange stuff from scipy
# the current galaxy job runner assumes that
# the job is in error if anything appears on sys.stderr
--- a/test-data/rgtestouts/rgManQQ/rgManQQtest1.html
+++ b/test-data/rgtestouts/rgManQQ/rgManQQtest1.html
@@ -15,30 +15,21 @@
<tr><td><a href="Allelep_manhattan.png"><img src="Allelep_manhattan.png" alt="Allelep_manhattan.png hspace="10" width="400"><br>(Click to download image Allelep_manhattan.png)</a></td></tr><tr><td><a href="Allelep_qqplot.png"><img src="Allelep_qqplot.png" alt="Allelep_qqplot.png hspace="10" width="400"><br>(Click to download image Allelep_qqplot.png)</a></td></tr>
-<tr><td><a href="Armitagep_manhattan.png"><img src="Armitagep_manhattan.png" alt="Armitagep_manhattan.png hspace="10" width="400"><br>(Click to download image Armitagep_manhattan.png)</a></td></tr>
-<tr><td><a href="Armitagep_qqplot.png"><img src="Armitagep_qqplot.png" alt="Armitagep_qqplot.png hspace="10" width="400"><br>(Click to download image Armitagep_qqplot.png)</a></td></tr><tr><td><a href="rgManQQtest1.R">rgManQQtest1.R</a></td></tr>
+<tr><td><a href="rgManQQtest1.R.log">rgManQQtest1.R.log</a></td></tr></table><h3>R log follows below</h3><hr><pre>
-Loading required package: proto
-
-Loading required package: grid
-
Loading required package: reshape
Loading required package: plyr
-Loading required package: digest
+Loading required package: grid
-[1] "### 101 values read from /share/shared/galaxy/test-data/smallwgaP.xls read - now running plots"
+Loading required package: proto
-[1] "## qqplot on Armitagep done"
-
-[1] "## manhattan on Armitagep starting 2 3 6"
-
-[1] "## manhattan plot on Armitagep done"
+[1] "### 101 values read from /opt/galaxy/test-data/smallwgaP.xls read - now running plots"
[1] "## qqplot on Allelep done"
@@ -46,8 +37,166 @@ Loading required package: digest
[1] "## manhattan plot on Allelep done"
+## R script=
+
+# license not stated so I'm assuming LGPL is ok for my derived work?
+# generalised so 3 core fields passed as parameters ross lazarus March 24 2010 for rgenetics
+# Originally created as qqman with the following
+# attribution:
+#--------------
+# Stephen Turner
+# http://StephenTurner.us/
+# http://GettingGeneticsDone.blogspot.com/
+
+# Last updated: Tuesday, December 22, 2009
+# R code for making manhattan plots and QQ plots from plink output files.
+# With GWAS data this can take a lot of memory. Recommended for use on
+# 64bit machines only, for now.
+
+#
+
+library(ggplot2)
+
+coloursTouse = c('firebrick','darkblue','goldenrod','darkgreen')
+# not too fugly but need a colour expert please...
+
+
+manhattan = function(chrom=NULL,offset=NULL,pvals=NULL, title=NULL, max.y="max",
+ suggestiveline=0, genomewide=T, size.x.labels=9, size.y.labels=10, annotate=F, SNPlist=NULL,grey=0) {
+
+ if (annotate & is.null(SNPlist)) stop("You requested annotation but provided no SNPlist!")
+ genomewideline=NULL # was genomewideline=-log10(5e-8)
+ if (genomewide) { # use bonferroni since might be only a small region?
+ genomewideline = -log10(0.05/length(pvals)) }
+ d=data.frame(CHR=chrom,BP=offset,P=pvals)
+
+ #limit to only chrs 1-23?
+ d=d[d$CHR %in% 1:23, ]
+
+ if ("CHR" %in% names(d) & "BP" %in% names(d) & "P" %in% names(d) ) {
+ d=na.omit(d)
+ d=d[d$P>0 & d$P<=1, ]
+ d$logp = -log10(d$P)
+
+ d$pos=NA
+ ticks=NULL
+ lastbase=0
+ chrlist = unique(d$CHR)
+ nchr = length(chrlist) # may be any number?
+ for (x in c(1:nchr)) {
+ i = chrlist[x] # need the chrom number - may not == index
+ if (x == 1) { # first time
+ d[d$CHR==i, ]$pos=d[d$CHR==i, ]$BP
+ } else {
+ lastchr = chrlist[x-1] # previous whatever the list
+ lastbase=lastbase+tail(subset(d,CHR==lastchr)$BP, 1)
+ d[d$CHR==i, ]$pos=d[d$CHR==i, ]$BP+lastbase
+ }
+ ticks=c(ticks, d[d$CHR==i, ]$pos[floor(length(d[d$CHR==i, ]$pos)/2)+1])
+ }
+ ticklim=c(min(d$pos),max(d$pos))
+ if (grey) {mycols=rep(c("gray10","gray60"),max(d$CHR))
+ } else {
+ mycols=rep(coloursTouse,max(d$CHR))
+ }
+
+ if (max.y=="max") maxy=ceiling(max(d$logp)) else maxy=max.y
+ maxy = max(maxy,1.1*genomewideline)
+ # if (maxy<8) maxy=8
+ # only makes sense if genome wide is assumed - we could have a fine mapping region?
+ if (annotate) d.annotate=d[as.numeric(substr(d$SNP,3,100)) %in% SNPlist, ]
+
+ manplot=qplot(pos,logp,data=d, ylab=expression(-log[10](italic(p))) , colour=factor(CHR))
+ manplot=manplot+scale_x_continuous(name="Chromosome", breaks=ticks, labels=(unique(d$CHR)))
+ manplot=manplot+scale_y_continuous(limits=c(0,maxy), breaks=1:maxy, labels=1:maxy)
+ manplot=manplot+scale_colour_manual(value=mycols)
+ if (annotate) { manplot=manplot + geom_point(data=d.annotate, colour=I("green3")) }
+ manplot=manplot + opts(legend.position = "none")
+ manplot=manplot + opts(title=title)
+ manplot=manplot+opts(
+ panel.background=theme_blank(),
+ axis.text.x=theme_text(size=size.x.labels, colour="grey50"),
+ axis.text.y=theme_text(size=size.y.labels, colour="grey50"),
+ axis.ticks=theme_segment(colour=NA)
+ )
+ #manplot = manplot + opts(panel.grid.y.minor=theme_blank(),panel.grid.y.major=theme_blank())
+ #manplot = manplot + opts(panel.grid.major=theme_blank())
+
+ if (suggestiveline) manplot=manplot+geom_hline(yintercept=suggestiveline,colour="blue", alpha=I(1/3))
+ if (genomewideline) manplot=manplot+geom_hline(yintercept=genomewideline,colour="red")
+ manplot
+ } else {
+ stop("Make sure your data frame contains columns CHR, BP, and P")
+ }
+}
+
+
+
+qq = function(pvector, title=NULL, spartan=F) {
+ # Thanks to Daniel Shriner at NHGRI for providing this code for creating expected and observed values
+ o = -log10(sort(pvector,decreasing=F))
+ e = -log10( 1:length(o)/length(o) )
+ # you could use base graphics
+ # plot(e,o,pch=19,cex=0.25, xlab=expression(Expected~~-log[10](italic(p))),
+ # ylab=expression(Observed~~-log[10](italic(p))), xlim=c(0,max(e)), ylim=c(0,max(e)))
+ # lines(e,e,col="red")
+ #You'll need ggplot2 installed to do the rest
+ qq=qplot(e,o, xlim=c(0,max(e)), ylim=c(0,max(o))) + stat_abline(intercept=0,slope=1, col="red")
+ qq=qq+opts(title=title)
+ qq=qq+scale_x_continuous(name=expression(Expected~~-log[10](italic(p))))
+ qq=qq+scale_y_continuous(name=expression(Observed~~-log[10](italic(p))))
+ if (spartan) plot=plot+opts(panel.background=theme_rect(col="grey50"), panel.grid.minor=theme_blank())
+ qq
+}
+rgqqMan = function(infile="/opt/galaxy/test-data/smallwgaP.xls",chromcolumn=2, offsetcolumn=3, pvalscolumns=c(8),
+title="rgManQQtest1",grey=0) {
+rawd = read.table(infile,head=T,sep=' ')
+dn = names(rawd)
+cc = dn[chromcolumn]
+oc = dn[offsetcolumn]
+nams = c(cc,oc)
+plen = length(rawd[,1])
+doreorder=1
+print(paste('###',plen,'values read from',infile,'read - now running plots',sep=' '))
+if (plen > 0) {
+ for (pvalscolumn in pvalscolumns) {
+ if (pvalscolumn > 0)
+ {
+ cname = names(rawd)[pvalscolumn]
+ mytitle = paste('p=',cname,', ',title,sep='')
+ myfname = chartr(' ','_',cname)
+ myqqplot = qq(rawd[,pvalscolumn],title=mytitle)
+ print(paste('## qqplot on',cname,'done'))
+ if ((chromcolumn > 0) & (offsetcolumn > 0)) {
+ if (doreorder) {
+ rawd = rawd[do.call(order,rawd[nams]),]
+ # mmmf - suggested by http://onertipaday.blogspot.com/2007/08/sortingordering-dataframe-according…
+ # in case not yet ordered
+ doreorder = 0
+ }
+ print(paste('## manhattan on',cname,'starting',chromcolumn,offsetcolumn,pvalscolumn))
+ mymanplot= manhattan(chrom=rawd[,chromcolumn],offset=rawd[,offsetcolumn],pvals=rawd[,pvalscolumn],title=mytitle,grey=grey)
+ print(paste('## manhattan plot on',cname,'done'))
+ ggsave(filename=paste(myfname,"manhattan.png",sep='_'),mymanplot,width=11,height=8,dpi=100)
+ }
+ else {
+ print(paste('chrom column =',chromcolumn,'offset column = ',offsetcolumn,
+ 'so no Manhattan plot - supply both chromosome and offset as numerics for Manhattan plots if required'))
+ }
+ ggsave(filename=paste(myfname,"qqplot.png",sep='_'),myqqplot,width=8,height=11,dpi=100)
+ }
+ else {
+ print(paste('pvalue column =',pvalscolumn,'Cannot parse it so no plots possible'))
+ }
+ } # for pvalscolumn
+ } else { print('## Problem - no values available to plot - was there really a chromosome and offset column?') }
+}
+
+rgqqMan()
+# execute with defaults as substituted
+
</pre>
-<h3><a href="http://rgenetics.org">Rgenetics</a> tool rgManQQ.py run at 09/05/2010 21:23:34</h3>
+<h3><a href="http://rgenetics.org">Rgenetics</a> tool rgManQQ.py run at 30/08/2010 20:46:51</h3></div></body></html>
--- a/tools/rgenetics/rgManQQ.xml
+++ b/tools/rgenetics/rgManQQ.xml
@@ -42,14 +42,10 @@
<param name='chrom_col' value='1' /><param name='offset_col' value='2' /><param name='grey' value='0' />
- <output name='out_html' file='rgtestouts/rgManQQ/rgManQQtest1.html' ftype='html' lines_diff='17'>
- <extra_files type="file" name='Allelep_manhattan.png' value='rgtestouts/rgManQQ/Allelep_manhattan.png' compare="sim_size"
- delta = "4000" />
- <extra_files type="file" name='Allelep_qqplot.png' value='rgtestouts/rgManQQ/Allelep_qqplot.png' compare="sim_size"
- delta = "4000" />
- <extra_files type="file" name='Armitagep_manhattan.png' value='rgtestouts/rgManQQ/Armitagep_manhattan.png' compare="sim_size"
+ <output name='out_html' file='rgtestouts/rgManQQ/rgManQQtest1.html' ftype='html' lines_diff='30'>
+ <extra_files type="file" name='Allelep_manhattan.png' value='rgtestouts/rgManQQ/Allelep_manhattan.png' compare="sim_size"
delta = "4000"/>
- <extra_files type="file" name='Armitagep_qqplot.png' value='rgtestouts/rgManQQ/Armitagep_qqplot.png' compare="sim_size"
+ <extra_files type="file" name='Allelep_qqplot.png' value='rgtestouts/rgManQQ/Allelep_qqplot.png' compare="sim_size"
delta = "4000" /><extra_files type="file" name='rgManQQtest1.R' value='rgtestouts/rgManQQ/rgManQQtest1.R' compare="diff" lines_diff="160"/></output>
--- a/tools/rgenetics/rgutils.py
+++ b/tools/rgenetics/rgutils.py
@@ -122,32 +122,36 @@ def RRun(rcmd=[],outdir=None,title='myR'
tempout=False
rname = '%s.R' % title
stoname = '%s.R.log' % title
+ cwd = os.getcwd()
if outdir: # want a specific path
try:
os.makedirs(outdir) # might not be there yet...
except:
pass
- else:
- tempout = True
- outdir = tempfile.mkdtemp(prefix=title)
+ os.chdir(outdir)
if type(rcmd) == type([]):
script = '\n'.join(rcmd)
else: # string
script = rcmd
sto = file(stoname,'w')
- rscriptname = os.path.join(outdir,rname)
- rscript = file(rscriptname,'w')
+ rscript = file(rname,'w')
rscript.write(script)
rscript.write('\n#R script autogenerated by rgenetics/rgutils.py on %s\n' % timenow())
rscript.close()
- vcl = '%s --slave --vanilla < %s' % (rexe,rscriptname)
- x = subprocess.Popen(vcl,shell=True,stderr=sto,stdout=sto,cwd=outdir)
+ vcl = '%s --slave --vanilla < %s' % (rexe,rname)
+ if outdir:
+ x = subprocess.Popen(vcl,shell=True,stderr=sto,stdout=sto,cwd=outdir)
+ else:
+ x = subprocess.Popen(vcl,shell=True,stderr=sto,stdout=sto)
retval = x.wait()
sto.close()
rlog = file(stoname,'r').readlines()
if retval <> 0:
rlog.insert(0,'Nonzero exit code = %d' % retval) # indicate failure
- flist = os.listdir(outdir)
+ if outdir:
+ flist = os.listdir(outdir)
+ else:
+ flist = os.listdir(os.getcwd())
flist.sort
flist = [(x,x) for x in flist]
for i,x in enumerate(flist):
@@ -155,16 +159,8 @@ def RRun(rcmd=[],outdir=None,title='myR'
flist[i] = (x,'R script for %s' % title)
elif x == stoname:
flist[i] = (x,'R log for %s' % title)
- if tidy and tempout: # we used a temp one - fix that
- flist = os.listdir(outdir)
- for f in flist:
- if os.path.isdir(f):
- flist2 = os.listdir(f)
- for f2 in flist2:
- os.unlink(os.path.abspath(f2))
- else:
- os.unlink(os.path.abspath(f))
- os.rmdir(outdir)
+ if outdir:
+ os.chdir(cwd)
return rlog,flist # for html layout
def runPlink(bfn='bar',ofn='foo',logf=None,plinktasks=[],cd='./',vclbase = []):
--- a/tools/rgenetics/rgtest.sh
+++ b/tools/rgenetics/rgtest.sh
@@ -41,7 +41,7 @@ CL="python $TOOLPATH/$TOOL.py "$INPATH/s
#python /opt/galaxy/tools/rgenetics/rgManQQ.py /opt/galaxy/test-data/smallwgaP.xls rgManQQtest1
#/opt/galaxy/test-data/rgtestouts/rgManQQ/rgManQQtest1.html /opt/galaxy/test-data/rgtestouts/rgManQQ 1 2 5,7
echo "Testing $TOOL using $CL"
-python $TOOLPATH/$TOOL.py "$INPATH/smallwgaP.xls" $NPRE ${OUTPATH}/${NPRE}.html $OUTPATH 1 2 5,7 0
+python $TOOLPATH/$TOOL.py "$INPATH/smallwgaP.xls" $NPRE ${OUTPATH}/${NPRE}.html $OUTPATH 1 2 7 0
TOOL="rgfakePhe"
NPRE=${TOOL}test1
OUTPATH="$OROOT/$TOOL"
Binary file test-data/rgtestouts/rgManQQ/Allelep_qqplot.png has changed
1
0