galaxy-commits
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- 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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5a09adb8c393/
Changeset: 5a09adb8c393
User: dan
Date: 2013-06-26 17:44:09
Summary: Fix for sniff.handle_uploaded_dataset_file broken in 7605:8bccff9db86973c924b17a4251573e25af7618a4 affects handling of data_source binary files.
Affected #: 1 file
diff -r d4372175b7fcf2b61a1e6c8caeb1a1b5dc891e60 -r 5a09adb8c39363a32aa373658635cf20ae2cc718 lib/galaxy/datatypes/sniff.py
--- a/lib/galaxy/datatypes/sniff.py
+++ b/lib/galaxy/datatypes/sniff.py
@@ -6,6 +6,7 @@
from galaxy import util
from galaxy.datatypes.checkers import *
from encodings import search_function as encodings_search_function
+from binary import Binary
log = logging.getLogger(__name__)
https://bitbucket.org/galaxy/galaxy-central/commits/f35d85e4b4d5/
Changeset: f35d85e4b4d5
Branch: stable
User: dan
Date: 2013-06-26 17:44:09
Summary: Fix for sniff.handle_uploaded_dataset_file broken in 7605:8bccff9db86973c924b17a4251573e25af7618a4 affects handling of data_source binary files.
Affected #: 1 file
diff -r 5a8069419967cfdb2157482ad239f75624354b78 -r f35d85e4b4d582cd50aee062bb1c2eaf89b131c2 lib/galaxy/datatypes/sniff.py
--- a/lib/galaxy/datatypes/sniff.py
+++ b/lib/galaxy/datatypes/sniff.py
@@ -6,6 +6,7 @@
from galaxy import util
from galaxy.datatypes.checkers import *
from encodings import search_function as encodings_search_function
+from binary import Binary
log = logging.getLogger(__name__)
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Fix Scratchbook Scrolling
by commits-noreply@bitbucket.org 26 Jun '13
by commits-noreply@bitbucket.org 26 Jun '13
26 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d4372175b7fc/
Changeset: d4372175b7fc
User: guerler
Date: 2013-06-26 17:04:54
Summary: Fix Scratchbook Scrolling
Affected #: 1 file
diff -r 870ed28587032d80fd955ca31c94bf0977f86165 -r d4372175b7fcf2b61a1e6c8caeb1a1b5dc891e60 static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -161,17 +161,20 @@
/*if (!this.is_mobile())
{*/
this.events = {
+ // global page events
'mousedown' : 'event_frame_mouse_down',
- 'mousedown .f-close' : 'event_frame_close',
- 'mousedown .f-pin' : 'event_frame_lock',
'mousemove' : 'event_frame_mouse_move',
'mouseup' : 'event_frame_mouse_up',
'mouseleave' : 'event_frame_mouse_up',
+ 'mousewheel' : 'event_panel_scroll',
+ 'DOMMouseScroll' : 'event_panel_scroll',
+
+ // events fixed to elements
+ 'mousedown .f-close' : 'event_frame_close',
+ 'mousedown .f-pin' : 'event_frame_lock',
'mousedown .galaxy-frame-active' : 'event_panel_active',
'mousedown .galaxy-frame-load' : 'event_panel_load',
'mousedown .galaxy-frame-background' : 'event_panel_load',
- 'mousewheel' : 'event_panel_scroll',
- 'DOMMouseScroll' : 'event_panel_scroll',
'mousedown .galaxy-frame-scroll-up' : 'event_panel_scroll_up',
'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down'
};
@@ -421,6 +424,10 @@
// scroll
event_panel_scroll: function(e)
{
+ // check
+ if (this.event.type !== null || !this.visible)
+ return;
+
// get wheel delta
var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3;
@@ -431,12 +438,22 @@
// scroll up
event_panel_scroll_up: function()
{
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // scroll up
this.panel_scroll(-this.options.scroll);
},
// scroll down
event_panel_scroll_down: function()
{
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // scroll down
this.panel_scroll(this.options.scroll);
},
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/870ed2858703/
Changeset: 870ed2858703
User: guerler
Date: 2013-06-25 20:09:50
Summary: Fix Galaxy CSS utility
Affected #: 1 file
diff -r 75bc22eefbd917b15d118ebbbe01cb2e01864c0d -r 870ed28587032d80fd955ca31c94bf0977f86165 static/scripts/utils/galaxy.css.js
--- a/static/scripts/utils/galaxy.css.js
+++ b/static/scripts/utils/galaxy.css.js
@@ -28,7 +28,7 @@
function load_file (url)
{
// check if css is already available
- if (!$('link[href="' + url + '"]').length)
+ if (!$('link[href^="' + url + '"]').length)
$('<link href="' + url + '" rel="stylesheet">').appendTo('head');
};
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Update Galaxy Frames CSS
by commits-noreply@bitbucket.org 25 Jun '13
by commits-noreply@bitbucket.org 25 Jun '13
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/75bc22eefbd9/
Changeset: 75bc22eefbd9
User: guerler
Date: 2013-06-25 16:52:30
Summary: Update Galaxy Frames CSS
Affected #: 1 file
diff -r f51a4898866a51cfe93c26cf36346a4678a4ca59 -r 75bc22eefbd917b15d118ebbbe01cb2e01864c0d static/style/blue/galaxy.frame.css
--- a/static/style/blue/galaxy.frame.css
+++ b/static/style/blue/galaxy.frame.css
@@ -1,4 +1,7 @@
-body {background: #000000}
+/*
+ galaxy-frames generic styles
+*/
+
.f-corner
{
-moz-border-radius: 4px;
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Fix issue with change_directory action where the target folder would be appended to the full path twice.
by commits-noreply@bitbucket.org 25 Jun '13
by commits-noreply@bitbucket.org 25 Jun '13
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f51a4898866a/
Changeset: f51a4898866a
User: Dave Bouvier
Date: 2013-06-25 16:44:27
Summary: Fix issue with change_directory action where the target folder would be appended to the full path twice.
Affected #: 1 file
diff -r e4a8cdf0b3722bbce79a55e5ed7e70306f39885a -r f51a4898866a51cfe93c26cf36346a4678a4ca59 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -313,9 +313,8 @@
extract = action_dict.get( 'extract', False )
common_util.url_download( current_dir, filename, url, extract=extract )
elif action_type == 'change_directory':
- target_directory = os.path.realpath( os.path.join( current_dir, dir, action_dict[ 'directory' ] ) )
- current_working_dir = os.path.realpath( dir )
- if target_directory.startswith( current_working_dir ) and os.path.exists( target_directory ):
+ target_directory = os.path.realpath( os.path.join( current_dir, action_dict[ 'directory' ] ) )
+ if target_directory.startswith( os.path.realpath( current_dir ) ) and os.path.exists( target_directory ):
dir = target_directory
else:
log.error( 'Invalid or nonexistent directory %s specified, ignoring change_directory action.', target_directory )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix the Galaxy API for installing tool shed repositories when attempting to install a repository that was previously installed but is not longer in the installed state.
by commits-noreply@bitbucket.org 25 Jun '13
by commits-noreply@bitbucket.org 25 Jun '13
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e4a8cdf0b372/
Changeset: e4a8cdf0b372
User: greg
Date: 2013-06-25 15:51:26
Summary: Fix the Galaxy API for installing tool shed repositories when attempting to install a repository that was previously installed but is not longer in the installed state.
Affected #: 1 file
diff -r 1cbd7fb4e7e1350a489534779545534d82607db7 -r e4a8cdf0b3722bbce79a55e5ed7e70306f39885a lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -266,11 +266,7 @@
action='show',
id=trans.security.encode_id( tool_shed_repository.id ) )
installed_tool_shed_repositories.append( tool_shed_repository_dict )
- elif message:
- log.error( message, exc_info=True )
- trans.response.status = 500
- return dict( status='error', error=message )
- elif not created_or_updated_tool_shed_repositories and not message:
+ else:
# We're attempting to install more than 1 repository, and all of them have already been installed.
return dict( status='error', error='All repositories that you are attempting to install have been previously installed.' )
# Display the list of installed repositories.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix recently introduced bug when the download_file action tag implementation was enhanced. This is related to installing tool dependencies along with a tool shed repository.
by commits-noreply@bitbucket.org 25 Jun '13
by commits-noreply@bitbucket.org 25 Jun '13
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1cbd7fb4e7e1/
Changeset: 1cbd7fb4e7e1
User: greg
Date: 2013-06-25 14:56:23
Summary: Fix recently introduced bug when the download_file action tag implementation was enhanced. This is related to installing tool dependencies along with a tool shed repository.
Affected #: 1 file
diff -r 05528b8aa8a1decc291f582b34265918c68f798e -r 1cbd7fb4e7e1350a489534779545534d82607db7 lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -194,7 +194,7 @@
# Download a single file to the working directory.
filtered_actions = actions[ 1: ]
url = action_dict[ 'url' ]
- if action_dict[ 'target_filename' ]:
+ if 'target_filename' in action_dict:
# Sometimes compressed archives extracts their content to a folder other than the default defined file name. Using this
# attribute will ensure that the file name is set appropriately and can be located after download, decompression and extraction.
filename = action_dict[ 'target_filename' ]
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix for browsing a tool dependency installed with a tol shed repository.
by commits-noreply@bitbucket.org 25 Jun '13
by commits-noreply@bitbucket.org 25 Jun '13
25 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/05528b8aa8a1/
Changeset: 05528b8aa8a1
User: greg
Date: 2013-06-25 12:57:32
Summary: Fix for browsing a tool dependency installed with a tol shed repository.
Affected #: 2 files
diff -r 80dcf7e41b4aec1d5608c05c870a634651af2924 -r 05528b8aa8a1decc291f582b34265918c68f798e lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -155,7 +155,8 @@
def browse_tool_dependency( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_dependency = tool_dependency_util.get_tool_dependency( trans, kwd[ 'id' ] )
+ tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd )
+ tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_ids[ 0 ] )
if tool_dependency.in_error_state:
message = "This tool dependency is not installed correctly (see the <b>Tool dependency installation error</b> below). "
message += "Choose <b>Uninstall this tool dependency</b> from the <b>Repository Actions</b> menu, correct problems "
@@ -1166,6 +1167,18 @@
initiate_repository_installation_ids=encoded_repository_ids,
reinstalling=True )
+ @web.expose
+ @web.require_admin
+ def repair_repository( self, trans, **kwd ):
+ """
+ Inspect the repository dependency hierarchy for a specified repository and attempt to make sure they are all properly installed as well as
+ each repository's tool dependencies.
+ """
+ message = kwd.get( 'message', '' )
+ status = kwd.get( 'status', 'done' )
+ repository_id = kwd[ 'id' ]
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+
@web.json
def repository_installation_status_updates( self, trans, ids=None, status_list=None ):
# Avoid caching
diff -r 80dcf7e41b4aec1d5608c05c870a634651af2924 -r 05528b8aa8a1decc291f582b34265918c68f798e templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -863,7 +863,7 @@
${tool_dependency.name | h}
%elif trans.webapp.name == 'galaxy' and tool_dependency.tool_dependency_id:
%if tool_dependency.repository_id and tool_dependency.installation_status in [ trans.model.ToolDependency.installation_status.INSTALLED ]:
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.tool_dependency_id ), repository_id=trans.security.encode_id( tool_dependency.repository_id ) )}">
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}">
${tool_dependency.name | h}
</a>
%elif tool_dependency.installation_status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Visualizations registry: decompose get_visualzations into both single vis check and all registered check
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/80dcf7e41b4a/
Changeset: 80dcf7e41b4a
User: carlfeberhard
Date: 2013-06-24 23:47:29
Summary: Visualizations registry: decompose get_visualzations into both single vis check and all registered check
Affected #: 1 file
diff -r 208bb69cae38e31f60ae9650c3cc261bfda7b079 -r 80dcf7e41b4aec1d5608c05c870a634651af2924 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -98,11 +98,44 @@
"""
self.listings = VisualizationsConfigParser.parse( self.configuration_filepath )
- #TODO: def get_visualization( self, trans, visualization_name, target_object ):
- # """
- # Is the visualization with the given `visualization_name` applicable
- # to the `target_object`?
- # """
+ def get_visualization( self, trans, visualization_name, target_object ):
+ """
+ Return data to build a url to the visualization with the given
+ `visualization_name` if it's applicable to `target_object` or
+ `None` if it's not.
+ """
+ # a little weird to pass trans because this registry is part of the trans.app
+ listing_data = self.listings.get( visualization_name, None )
+ if not listing_data:
+ return None
+
+ data_sources = listing_data[ 'data_sources' ]
+ for data_source in data_sources:
+ # currently a model class is required
+ model_class = data_source[ 'model_class' ]
+ if not isinstance( target_object, model_class ):
+ continue
+
+ # tests are optional - default is the above class test
+ tests = data_source[ 'tests' ]
+ if tests and not self.is_object_applicable( trans, target_object, tests ):
+ continue
+
+ param_data = data_source[ 'to_params' ]
+ url = self.get_visualization_url( trans, target_object, visualization_name, param_data )
+ link_text = listing_data.get( 'link_text', None )
+ if not link_text:
+ # default to visualization name, titlecase, and replace underscores
+ link_text = visualization_name.title().replace( '_', ' ' )
+ render_location = listing_data.get( 'render_location' )
+ # remap some of these vars for direct use in ui.js, PopupMenu (e.g. text->html)
+ return {
+ 'href' : url,
+ 'html' : link_text,
+ 'target': render_location
+ }
+
+ return None
# -- building links to visualizations from objects --
def get_visualizations( self, trans, target_object ):
@@ -111,36 +144,11 @@
the urls to call in order to render the visualizations.
"""
#TODO:?? a list of objects? YAGNI?
- # a little weird to pass trans because this registry is part of the trans.app
applicable_visualizations = []
- for vis_name, listing_data in self.listings.items():
-
- data_sources = listing_data[ 'data_sources' ]
- for data_source in data_sources:
- # currently a model class is required
- model_class = data_source[ 'model_class' ]
- if not isinstance( target_object, model_class ):
- continue
-
- # tests are optional - default is the above class test
- tests = data_source[ 'tests' ]
- if tests and not self.is_object_applicable( trans, target_object, tests ):
- continue
-
- param_data = data_source[ 'to_params' ]
- url = self.get_visualization_url( trans, target_object, vis_name, param_data )
- link_text = listing_data.get( 'link_text', None )
- if not link_text:
- # default to visualization name, titlecase, and replace underscores
- link_text = vis_name.title().replace( '_', ' ' )
- render_location = listing_data.get( 'render_location' )
- # remap some of these vars for direct use in ui.js, PopupMenu (e.g. text->html)
- applicable_visualizations.append({
- 'href' : url,
- 'html' : link_text,
- 'target': render_location
- })
-
+ for vis_name in self.listings:
+ url_data = self.get_visualization( trans, vis_name, target_object )
+ if url_data:
+ applicable_visualizations.append( url_data )
return applicable_visualizations
def is_object_applicable( self, trans, target_object, data_source_tests ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Clean up support for installing a tool shed repository that is not in the installed state.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/208bb69cae38/
Changeset: 208bb69cae38
User: greg
Date: 2013-06-24 22:50:05
Summary: Clean up support for installing a tool shed repository that is not in the installed state.
Affected #: 4 files
diff -r 93e9f520616ce9bc066c5e43a0e4d9d977a94192 -r 208bb69cae38e31f60ae9650c3cc261bfda7b079 lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -216,13 +216,8 @@
tool_path=tool_path,
tool_shed_url=tool_shed_url )
# Create the tool_shed_repository database records and gather additional information for repository installation.
- created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts, message = \
+ created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
repository_util.handle_tool_shed_repositories( trans, installation_dict, using_api=True )
- if message and len( repo_info_dicts ) == 1:
- # We're attempting to install a single repository that has already been installed into this Galaxy instance.
- log.error( message, exc_info=True )
- trans.response.status = 500
- return dict( status='error', error=message )
if created_or_updated_tool_shed_repositories:
# Build the dictionary of information necessary for installing the repositories.
installation_dict = dict( created_or_updated_tool_shed_repositories=created_or_updated_tool_shed_repositories,
diff -r 93e9f520616ce9bc066c5e43a0e4d9d977a94192 -r 208bb69cae38e31f60ae9650c3cc261bfda7b079 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -884,15 +884,8 @@
tool_panel_section=tool_panel_section,
tool_path=tool_path,
tool_shed_url=tool_shed_url )
- created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts, message = \
+ created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
repository_util.handle_tool_shed_repositories( trans, installation_dict, using_api=False )
- if message and len( repo_info_dicts ) == 1:
- # We're undoubtedly attempting to install a repository that has been previously installed.
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='browse_repositories',
- message=message,
- status='error' ) )
-
if created_or_updated_tool_shed_repositories:
installation_dict = dict( created_or_updated_tool_shed_repositories=created_or_updated_tool_shed_repositories,
filtered_repo_info_dicts=filtered_repo_info_dicts,
@@ -1126,7 +1119,7 @@
repository_dependencies=repository_dependencies )
repo_info_dicts.append( repo_info_dict )
# Make sure all tool_shed_repository records exist.
- created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts, message = \
+ created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
repository_dependency_util.create_repository_dependency_objects( trans=trans,
tool_path=tool_path,
tool_shed_url=tool_shed_url,
diff -r 93e9f520616ce9bc066c5e43a0e4d9d977a94192 -r 208bb69cae38e31f60ae9650c3cc261bfda7b079 lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -358,7 +358,7 @@
tool_panel_section = installation_dict[ 'tool_panel_section' ]
tool_path = installation_dict[ 'tool_path' ]
tool_shed_url = installation_dict[ 'tool_shed_url' ]
- created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts, message = \
+ created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
repository_dependency_util.create_repository_dependency_objects( trans=trans,
tool_path=tool_path,
tool_shed_url=tool_shed_url,
@@ -368,11 +368,7 @@
no_changes_checked=no_changes_checked,
tool_panel_section=tool_panel_section,
new_tool_panel_section=new_tool_panel_section )
- if message and len( repo_info_dicts ) == 1 and not using_api:
- installed_tool_shed_repository = created_or_updated_tool_shed_repositories[ 0 ]
- message += 'Click <a href="%s">here</a> to manage the repository. ' % \
- ( web.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( installed_tool_shed_repository.id ) ) )
- return created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts, message
+ return created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts
def initiate_repository_installation( trans, installation_dict ):
# The following installation_dict entries are all required.
diff -r 93e9f520616ce9bc066c5e43a0e4d9d977a94192 -r 208bb69cae38e31f60ae9650c3cc261bfda7b079 lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -103,7 +103,6 @@
the dependency relationships between installed repositories. This method is called when new repositories are being installed into a Galaxy
instance and when uninstalled repositories are being reinstalled.
"""
- message = ''
# The following list will be maintained within this method to contain all created or updated tool shed repositories, including repository dependencies
# that may not be installed.
all_created_or_updated_tool_shed_repositories = []
@@ -241,7 +240,7 @@
filtered_repo_info_dicts.append( repo_info_dict )
# Build repository dependency relationships even if the user chose to not install repository dependencies.
build_repository_dependency_relationships( trans, all_repo_info_dicts, all_created_or_updated_tool_shed_repositories )
- return created_or_updated_tool_shed_repositories, tool_panel_section_keys, all_repo_info_dicts, filtered_repo_info_dicts, message
+ return created_or_updated_tool_shed_repositories, tool_panel_section_keys, all_repo_info_dicts, filtered_repo_info_dicts
def generate_message_for_invalid_repository_dependencies( metadata_dict ):
"""Return the error message associated with an invalid repository dependency for display in the caller."""
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: Dave Bouvier: Fix bug with installing tool dependencies when new_file_path is not set in the Galaxy configuration file.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/93e9f520616c/
Changeset: 93e9f520616c
User: Dave Bouvier
Date: 2013-06-24 22:30:23
Summary: Fix bug with installing tool dependencies when new_file_path is not set in the Galaxy configuration file.
Affected #: 1 file
diff -r be547fe12a1e1b02bc4c7e79834739c590797526 -r 93e9f520616ce9bc066c5e43a0e4d9d977a94192 lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
@@ -240,13 +240,13 @@
if istar( file_path ):
# <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1…</action>
extract_tar( file_path, install_dir )
- dir = tar_extraction_directory( install_dir, file_path )
+ dir = tar_extraction_directory( install_dir, downloaded_file_name )
elif isjar( file_path ):
dir = os.path.curdir
elif iszip( file_path ):
# <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-to…</action>
zip_archive_extracted = extract_zip( file_path, install_dir )
- dir = zip_extraction_directory( install_dir, file_path )
+ dir = zip_extraction_directory( install_dir, downloaded_file_name )
else:
dir = install_dir
else:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fixes for managing an installed tool shed repository's tool dependencies.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/be547fe12a1e/
Changeset: be547fe12a1e
User: greg
Date: 2013-06-24 22:03:59
Summary: Fixes for managing an installed tool shed repository's tool dependencies.
Affected #: 5 files
diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -482,9 +482,7 @@
def install_tool_dependencies( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) )
- if not tool_dependency_ids:
- tool_dependency_ids = util.listify( kwd.get( 'id', None ) )
+ tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd )
tool_dependencies = []
for tool_dependency_id in tool_dependency_ids:
tool_dependency = tool_dependency_util.get_tool_dependency( trans, tool_dependency_id )
@@ -731,11 +729,11 @@
kwd[ 'status' ] = 'error'
installed_tool_dependencies_select_field = suc.build_tool_dependencies_select_field( trans,
tool_shed_repository=tool_shed_repository,
- name='tool_dependency_ids',
+ name='inst_td_ids',
uninstalled=False )
uninstalled_tool_dependencies_select_field = suc.build_tool_dependencies_select_field( trans,
tool_shed_repository=tool_shed_repository,
- name='tool_dependency_ids',
+ name='uninstalled_tool_dependency_ids',
uninstalled=True )
return trans.fill_template( '/admin/tool_shed_repository/manage_repository_tool_dependencies.mako',
repository=tool_shed_repository,
@@ -1517,7 +1515,7 @@
def uninstall_tool_dependencies( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) )
+ tool_dependency_ids = tool_dependency_util.get_tool_dependency_ids( as_string=False, **kwd )
if not tool_dependency_ids:
tool_dependency_ids = util.listify( kwd.get( 'id', None ) )
tool_dependencies = []
diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 lib/tool_shed/util/tool_dependency_util.py
--- a/lib/tool_shed/util/tool_dependency_util.py
+++ b/lib/tool_shed/util/tool_dependency_util.py
@@ -220,9 +220,16 @@
def get_tool_dependency_ids( as_string=False, **kwd ):
tool_dependency_id = kwd.get( 'tool_dependency_id', None )
- tool_dependency_ids = util.listify( kwd.get( 'tool_dependency_ids', None ) )
- if not tool_dependency_ids:
- tool_dependency_ids = util.listify( kwd.get( 'id', None ) )
+ if 'tool_dependency_ids' in kwd:
+ tool_dependency_ids = util.listify( kwd[ 'tool_dependency_ids' ] )
+ elif 'id' in kwd:
+ tool_dependency_ids = util.listify( kwd[ 'id' ] )
+ elif 'inst_td_ids' in kwd:
+ tool_dependency_ids = util.listify( kwd[ 'inst_td_ids' ] )
+ elif 'uninstalled_tool_dependency_ids' in kwd:
+ tool_dependency_ids = util.listify( kwd[ 'uninstalled_tool_dependency_ids' ] )
+ else:
+ tool_dependency_ids = []
if tool_dependency_id and tool_dependency_id not in tool_dependency_ids:
tool_dependency_ids.append( tool_dependency_id )
if as_string:
diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
@@ -44,7 +44,7 @@
<tr><td>
%if tool_dependency.status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
- <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', id=trans.security.encode_id( tool_dependency.id ) )}">
+ <a target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', operation='browse', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ) )}">
${tool_dependency.name}
</a>
%else:
@@ -66,7 +66,7 @@
</div><div style="clear: both"></div><div class="form-row">
- <input type="checkbox" id="checkAll" name="select_all_uninstalled_tool_dependencies_checkbox" value="true" onclick="checkAllFields('tool_dependency_ids');"/><input type="hidden" name="select_all_uninstalled_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b>
+ <input type="checkbox" id="checkAllUninstalled" name="select_all_uninstalled_tool_dependencies_checkbox" value="true" onclick="checkAllFields( 'uninstalled_tool_dependency_ids', 'checkAllUninstalled' );"/><input type="hidden" name="select_all_uninstalled_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b></div><div style="clear: both"></div><div class="form-row">
@@ -87,7 +87,7 @@
</div><div style="clear: both"></div><div class="form-row">
- <input type="checkbox" id="checkAll" name="select_all_installed_tool_dependencies_checkbox" value="true" onclick="checkAllFields('tool_dependency_ids');"/><input type="hidden" name="select_all_installed_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b>
+ <input type="checkbox" id="checkAllInstalled" name="select_all_installed_tool_dependencies_checkbox" value="true" onclick="checkAllFields( 'inst_td_ids', 'checkAllInstalled' );"/><input type="hidden" name="select_all_installed_tool_dependencies_checkbox" value="true"/><b>Select/unselect all tool dependencies</b></div><div style="clear: both"></div><div class="form-row">
diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/webapps/tool_shed/common/common.mako
--- a/templates/webapps/tool_shed/common/common.mako
+++ b/templates/webapps/tool_shed/common/common.mako
@@ -1,8 +1,15 @@
-<%def name="common_misc_javascripts()">
+<%def name="common_misc_javascripts( element_id=None )"><script type="text/javascript">
- function checkAllFields( name )
+ function checkAllFields( name, element_id=element_id )
{
- var chkAll = document.getElementById( 'checkAll' );
+ if ( element_id )
+ {
+ chkAll = document.getElementById( element_id );
+ }
+ else
+ {
+ var chkAll = document.getElementById( 'checkAll' );
+ }
var checks = document.getElementsByTagName( 'input' );
var boxLength = checks.length;
var allChecked = false;
diff -r b16265a28cfce30b5678dad9551f08bfdc538ad3 -r be547fe12a1e1b02bc4c7e79834739c590797526 templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -862,12 +862,12 @@
%if row_is_header:
${tool_dependency.name | h}
%elif trans.webapp.name == 'galaxy' and tool_dependency.tool_dependency_id:
- %if tool_dependency.repository_id and tool_dependency.installation_status == 'Installed':
+ %if tool_dependency.repository_id and tool_dependency.installation_status in [ trans.model.ToolDependency.installation_status.INSTALLED ]:
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_tool_dependency', id=trans.security.encode_id( tool_dependency.tool_dependency_id ), repository_id=trans.security.encode_id( tool_dependency.repository_id ) )}">
${tool_dependency.name | h}
</a>
- %elif tool_dependency.installation_status != 'Installed':
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', id=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}">
+ %elif tool_dependency.installation_status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository_tool_dependencies', tool_dependency_ids=trans.security.encode_id( tool_dependency.tool_dependency_id ) )}">
${tool_dependency.name}
</a>
%else:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/22e18808fc58/
Changeset: 22e18808fc58
User: Dave Bouvier
Date: 2013-06-24 21:41:59
Summary: Add support for optionally extracting a file downloaded with the download_file tool dependency action. Add a change_directory action.
Affected #: 3 files
diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py
@@ -216,7 +216,7 @@
return os.path.abspath( file_path )
raise ValueError( 'Could not find path to file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) )
-def url_download( install_dir, downloaded_file_name, download_url ):
+def url_download( install_dir, downloaded_file_name, download_url, extract=True ):
file_path = os.path.join( install_dir, downloaded_file_name )
src = None
dst = None
@@ -236,7 +236,22 @@
src.close()
if dst:
dst.close()
- return os.path.abspath( file_path )
+ if extract:
+ if istar( file_path ):
+ # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1…</action>
+ extract_tar( file_path, install_dir )
+ dir = tar_extraction_directory( install_dir, file_path )
+ elif isjar( file_path ):
+ dir = os.path.curdir
+ elif iszip( file_path ):
+ # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-to…</action>
+ zip_archive_extracted = extract_zip( file_path, install_dir )
+ dir = zip_extraction_directory( install_dir, file_path )
+ else:
+ dir = install_dir
+ else:
+ dir = install_dir
+ return dir
def zip_extraction_directory( file_path, file_name ):
"""Try to return the correct extraction directory."""
diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py
@@ -180,19 +180,7 @@
downloaded_filename = action_dict[ 'target_filename' ]
else:
downloaded_filename = os.path.split( url )[ -1 ]
- downloaded_file_path = common_util.url_download( work_dir, downloaded_filename, url )
- if common_util.istar( downloaded_file_path ):
- # <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1…</action>
- common_util.extract_tar( downloaded_file_path, work_dir )
- dir = common_util.tar_extraction_directory( work_dir, downloaded_filename )
- elif common_util.isjar( downloaded_file_path ):
- dir = os.path.curdir
- elif common_util.iszip( downloaded_file_path ):
- # <action type="download_by_url">http://downloads.sourceforge.net/project/picard/picard-tools/1.56/picard-to…</action>
- zip_archive_extracted = common_util.extract_zip( downloaded_file_path, work_dir )
- dir = common_util.zip_extraction_directory( work_dir, downloaded_filename )
- else:
- dir = os.path.curdir
+ dir = common_util.url_download( work_dir, downloaded_filename, url, extract=True )
elif action_type == 'shell_command':
# <action type="shell_command">git clone --recursive git://github.com/ekg/freebayes.git</action>
# Eliminate the shell_command clone action so remaining actions can be processed correctly.
@@ -227,10 +215,10 @@
if not os.path.exists( full_path_to_dir ):
os.makedirs( full_path_to_dir )
# The package has been down-loaded, so we can now perform all of the actions defined for building it.
- with lcd( dir ):
- for action_tup in filtered_actions:
+ for action_tup in filtered_actions:
+ current_dir = os.path.abspath( os.path.join( work_dir, dir ) )
+ with lcd( current_dir ):
action_type, action_dict = action_tup
- current_dir = os.path.abspath( os.path.join( work_dir, dir ) )
if action_type == 'make_directory':
common_util.make_directory( full_path=action_dict[ 'full_path' ] )
elif action_type == 'move_directory_files':
@@ -316,13 +304,21 @@
if return_code:
return
elif action_type == 'download_file':
- # Download a single file to the current directory.
+ # Download a single file to the current working directory.
url = action_dict[ 'url' ]
- if action_dict[ 'target_filename' ]:
+ if 'target_filename' in action_dict:
filename = action_dict[ 'target_filename' ]
else:
filename = url.split( '/' )[ -1 ]
- common_util.url_download( current_dir, filename, url )
+ extract = action_dict.get( 'extract', False )
+ common_util.url_download( current_dir, filename, url, extract=extract )
+ elif action_type == 'change_directory':
+ target_directory = os.path.realpath( os.path.join( current_dir, dir, action_dict[ 'directory' ] ) )
+ current_working_dir = os.path.realpath( dir )
+ if target_directory.startswith( current_working_dir ) and os.path.exists( target_directory ):
+ dir = target_directory
+ else:
+ log.error( 'Invalid or nonexistent directory %s specified, ignoring change_directory action.', target_directory )
def log_results( command, fabric_AttributeString, file_path ):
"""
diff -r 69797172b07930e2751dd2fe7a6e317f1e68a769 -r 22e18808fc582fba8ae3d71c8f9556792354c1be lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
--- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
+++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py
@@ -13,6 +13,7 @@
from tool_shed.util import xml_util
from galaxy.model.orm import and_
from galaxy.web import url_for
+from galaxy.util import asbool
log = logging.getLogger( __name__ )
@@ -390,15 +391,19 @@
# <action type="download_by_url">http://sourceforge.net/projects/samtools/files/samtools/0.1.18/samtools-0.1…</action>
if action_elem.text:
action_dict[ 'url' ] = action_elem.text
- if 'target_filename' in action_elem.attrib:
- action_dict[ 'target_filename' ] = action_elem.attrib[ 'target_filename' ]
+ target_filename = action_elem.get( 'target_filename', None )
+ if target_filename:
+ action_dict[ 'target_filename' ] = target_filename
else:
continue
elif action_type == 'download_file':
# <action type="download_file">http://effectors.org/download/version/TTSS_GUI-1.0.1.jar</action>
if action_elem.text:
action_dict[ 'url' ] = action_elem.text
- action_dict[ 'target_filename' ] = action_elem.attrib.get( 'target_filename', None )
+ target_filename = action_elem.get( 'target_filename', None )
+ if target_filename:
+ action_dict[ 'target_filename' ] = target_filename
+ action_dict[ 'extract' ] = asbool( action_elem.get( 'extract', False ) )
else:
continue
elif action_type == 'make_directory':
@@ -407,6 +412,12 @@
action_dict[ 'full_path' ] = evaluate_template( action_elem.text )
else:
continue
+ elif action_type == 'change_directory':
+ # <action type="change_directory">PHYLIP-3.6b</action>
+ if action_elem.text:
+ action_dict[ 'directory' ] = action_elem.text
+ else:
+ continue
elif action_type in [ 'move_directory_files', 'move_file' ]:
# <action type="move_file">
# <source>misc/some_file</source>
https://bitbucket.org/galaxy/galaxy-central/commits/b16265a28cfc/
Changeset: b16265a28cfc
User: Dave Bouvier
Date: 2013-06-24 21:43:14
Summary: Add the threadpool_kill_thread_limit option to universe_wsgi.ini.sample.
Affected #: 1 file
diff -r 22e18808fc582fba8ae3d71c8f9556792354c1be -r b16265a28cfce30b5678dad9551f08bfdc538ad3 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -40,6 +40,9 @@
# Number of threads in the web server thread pool.
#threadpool_workers = 10
+# Set the number of seconds a thread can work before you should kill it (assuming it will never finish) to 3 hours.
+threadpool_kill_thread_limit = 10800
+
# ---- Filters --------------------------------------------------------------
# Filters sit between Galaxy and the HTTP server.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Add new packed scripts
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/69797172b079/
Changeset: 69797172b079
User: carlfeberhard
Date: 2013-06-24 21:08:23
Summary: Add new packed scripts
Affected #: 2 files
diff -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 -r 69797172b07930e2751dd2fe7a6e317f1e68a769 static/scripts/packed/galaxy.frame.js
--- /dev/null
+++ b/static/scripts/packed/galaxy.frame.js
@@ -0,0 +1,1 @@
+define(["utils/galaxy.css","libs/backbone/backbone-relational"],function(b){b.load_file("/static/style/galaxy.frame.css");b.load_file("/static/style/base.css");var a=Backbone.View.extend({el:"#everything",el_header:"#masthead",options:{frame:{cols:6,rows:3},rows:1000,cell:130,margin:5,scroll:5,top_min:40,frame_max:10},cols:0,top:0,top_max:0,frame_counter:0,frame_counter_id:0,frame_list:[],galaxy_frame_shadow:null,visible:false,active:false,initialize:function(d){if(d){this.options=_.defaults(d,this.options)}this.top=this.top_max=this.options.top_min;$(this.el).append(this.frame_template_background());$(this.el).append(this.frame_template_menu());$(this.el_header).append(this.frame_template_load());var e="#galaxy-frame-shadow";$(this.el).append(this.frame_template_shadow(e.substring(1)));this.galaxy_frame_shadow={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_resize(this.galaxy_frame_shadow,{width:0,height:0});this.frame_list[e]=this.galaxy_frame_shadow;this.panel_refresh();this.event_initialize();var c=this;$(window).resize(function(){c.panel_refresh()});window.onbeforeunload=function(){if(c.frame_counter>0){return"You opened "+c.frame_counter+" frame(s) which will be lost."}}},is_mobile:function(){return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)},event:{type:null,target:null,xy:null},event_initialize:function(){this.events={mousedown:"event_frame_mouse_down","mousedown .f-close":"event_frame_close","mousedown .f-pin":"event_frame_lock",mousemove:"event_frame_mouse_move",mouseup:"event_frame_mouse_up",mouseleave:"event_frame_mouse_up","mousedown .galaxy-frame-active":"event_panel_active","mousedown .galaxy-frame-load":"event_panel_load","mousedown .galaxy-frame-background":"event_panel_load",mousewheel:"event_panel_scroll",DOMMouseScroll:"event_panel_scroll","mousedown .galaxy-frame-scroll-up":"event_panel_scroll_up","mousedown .galaxy-frame-scroll-down":"event_panel_scroll_down"};this.delegateEvents(this.events)},event_frame_mouse_down:function(c){c.preventDefault();if(this.event.type!==null){return}if($(c.target).hasClass("f-header")||$(c.target).hasClass("f-title")){this.event.type="drag"}if($(c.target).hasClass("f-resize")){this.event.type="resize"}if(this.event.type===null){return}this.event.target=this.event_get_frame(c.target);if(this.event.target.grid_lock){this.event.type=null;return}this.event.xy={x:c.originalEvent.pageX,y:c.originalEvent.pageY};this.frame_drag_start(this.event.target)},event_frame_mouse_move:function(i){if(this.event.type!="drag"&&this.event.type!="resize"){return}var g={x:i.originalEvent.pageX,y:i.originalEvent.pageY};var d={x:g.x-this.event.xy.x,y:g.y-this.event.xy.y};this.event.xy=g;var h=this.frame_screen(this.event.target);if(this.event.type=="resize"){h.width+=d.x;h.height+=d.y;var f=this.options.cell-this.options.margin-1;h.width=Math.max(h.width,f);h.height=Math.max(h.height,f);this.frame_resize(this.event.target,h);h.width=this.to_grid_coord("width",h.width)+1;h.height=this.to_grid_coord("height",h.height)+1;h.width=this.to_pixel_coord("width",h.width);h.height=this.to_pixel_coord("height",h.height);this.frame_resize(this.galaxy_frame_shadow,h);this.frame_insert(this.galaxy_frame_shadow,{top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)})}if(this.event.type=="drag"){h.left+=d.x;h.top+=d.y;this.frame_offset(this.event.target,h);var c={top:this.to_grid_coord("top",h.top),left:this.to_grid_coord("left",h.left)};if(c.left!==0){c.left++}this.frame_insert(this.galaxy_frame_shadow,c)}},event_frame_mouse_up:function(c){if(this.event.type!="drag"&&this.event.type!="resize"){return}this.frame_drag_stop(this.event.target);this.event.type=null},event_frame_close:function(d){if(this.event.type!==null){return}var f=this.event_get_frame(d.target);var c=this;$(f.id).fadeOut("fast",function(){$(f.id).remove();delete c.frame_list[f.id];c.frame_counter--;c.panel_refresh(true);c.panel_animation_complete();if(c.visible&&c.frame_counter==0){c.panel_show_hide()}})},event_frame_lock:function(c){if(this.event.type!==null){return}var d=this.event_get_frame(c.target);if(d.grid_lock){d.grid_lock=false;$(d.id).find(".f-pin").removeClass("f-toggle");$(d.id).find(".f-header").removeClass("f-not-allowed");$(d.id).find(".f-title").removeClass("f-not-allowed");$(d.id).find(".f-resize").show();$(d.id).find(".f-close").show()}else{d.grid_lock=true;$(d.id).find(".f-pin").addClass("f-toggle");$(d.id).find(".f-header").addClass("f-not-allowed");$(d.id).find(".f-title").addClass("f-not-allowed");$(d.id).find(".f-resize").hide();$(d.id).find(".f-close").hide()}},event_panel_load:function(){if(this.event.type!==null){return}this.panel_show_hide()},event_panel_active:function(){if(this.event.type!==null){return}this.panel_active_disable()},event_panel_scroll:function(c){var d=c.originalEvent.detail?c.originalEvent.detail:c.originalEvent.wheelDelta/-3;this.panel_scroll(d)},event_panel_scroll_up:function(){this.panel_scroll(-this.options.scroll)},event_panel_scroll_down:function(){this.panel_scroll(this.options.scroll)},event_get_frame:function(c){return this.frame_list["#"+$(c).closest(".galaxy-frame").attr("id")]},frame_drag_start:function(d){this.frame_focus(d,true);var c=this.frame_screen(d);this.frame_resize(this.galaxy_frame_shadow,c);this.frame_grid(this.galaxy_frame_shadow,d.grid_location);d.grid_location=null;$(this.galaxy_frame_shadow.id).show();$(".f-cover").show()},frame_drag_stop:function(d){this.frame_focus(d,false);var c=this.frame_screen(this.galaxy_frame_shadow);this.frame_resize(d,c);this.frame_grid(d,this.galaxy_frame_shadow.grid_location,true);this.galaxy_frame_shadow.grid_location=null;$(this.galaxy_frame_shadow.id).hide();$(".f-cover").hide();this.panel_animation_complete()},to_grid_coord:function(e,d){var c=(e=="width"||e=="height")?1:-1;if(e=="top"){d-=this.top}return parseInt((d+c*this.options.margin)/this.options.cell,10)},to_pixel_coord:function(e,f){var c=(e=="width"||e=="height")?1:-1;var d=(f*this.options.cell)-c*this.options.margin;if(e=="top"){d+=this.top}return d},to_grid:function(c){return{top:this.to_grid_coord("top",c.top),left:this.to_grid_coord("left",c.left),width:this.to_grid_coord("width",c.width),height:this.to_grid_coord("height",c.height)}},to_pixel:function(c){return{top:this.to_pixel_coord("top",c.top),left:this.to_pixel_coord("left",c.left),width:this.to_pixel_coord("width",c.width),height:this.to_pixel_coord("height",c.height)}},is_collision:function(e){function c(h,g){return !(h.left>g.left+g.width-1||h.left+h.width-1<g.left||h.top>g.top+g.height-1||h.top+h.height-1<g.top)}for(var d in this.frame_list){var f=this.frame_list[d];if(f.grid_location===null){continue}if(c(e,f.grid_location)){return true}}return false},location_rank:function(c){return(c.top*this.cols)+c.left},menu_refresh:function(){$(".galaxy-frame-load .number").text(this.frame_counter);if(this.frame_counter==0){$(".galaxy-frame-load").hide()}else{$(".galaxy-frame-load").show()}if(this.top==this.options.top_min){$(".galaxy-frame-scroll-up").hide()}else{$(".galaxy-frame-scroll-up").show()}if(this.top==this.top_max){$(".galaxy-frame-scroll-down").hide()}else{$(".galaxy-frame-scroll-down").show()}},panel_animation_complete:function(){var c=this;$(".galaxy-frame").promise().done(function(){c.panel_scroll(0,true)})},panel_refresh:function(c){this.cols=parseInt($(window).width()/this.options.cell,10)+1;this.frame_insert(null,null,c)},panel_scroll:function(h,c){var e=this.top-this.options.scroll*h;e=Math.max(e,this.top_max);e=Math.min(e,this.options.top_min);if(this.top!=e){for(var d in this.frame_list){var g=this.frame_list[d];if(g.grid_location!==null){var f={top:g.screen_location.top-(this.top-e),left:g.screen_location.left};this.frame_offset(g,f,c)}}this.top=e}this.menu_refresh()},panel_show_hide:function(){if(this.visible){this.visible=false;for(var c in this.frame_list){$(this.frame_list[c].id).fadeOut("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");$(".galaxy-frame-background").hide();$(".galaxy-frame-menu").hide()}else{this.visible=true;for(var c in this.frame_list){$(this.frame_list[c].id).fadeIn("fast")}$(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");$(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");$(this.galaxy_frame_shadow.id).hide();$(".galaxy-frame-background").show();this.menu_refresh()}},panel_active_disable:function(){if(this.active){this.active=false;$(".galaxy-frame-active .icon").removeClass("f-toggle")}else{this.active=true;$(".galaxy-frame-active .icon").addClass("f-toggle")}},frame_new:function(d){if(!this.active){if(d.center){var c=$(window.parent.document).find("iframe#galaxy_main");c.attr("src",d.content)}else{window.location=d.content}return}var e="#galaxy-frame-"+(this.frame_counter_id++);if($(e).length===0&&this.options.frame_max>this.frame_counter){this.top=this.options.top_min;d.width=this.to_pixel_coord("width",this.options.frame.cols);d.height=this.to_pixel_coord("height",this.options.frame.rows);$(this.el).append(this.frame_template(e.substring(1),d.title,d.type,d.content));var f={id:e,screen_location:{},grid_location:{},grid_rank:null,grid_lock:false};this.frame_counter++;this.frame_list[e]=f;this.frame_resize(f,{width:d.width,height:d.height});this.frame_insert(f,{top:0,left:0},true);if(!this.visible){this.panel_show_hide()}}else{alert("You have reached the maximum number of allowed frames ("+this.options.frame_max+").")}},frame_insert:function(j,c,e){var d=[];if(j){j.grid_location=null;d.push([j,this.location_rank(c)])}var g=null;for(g in this.frame_list){var h=this.frame_list[g];if(h.grid_location!==null&&!h.grid_lock){h.grid_location=null;d.push([h,h.grid_rank])}}d.sort(function(k,f){var m=k[1];var l=f[1];return m<l?-1:(m>l?1:0)});for(g=0;g<d.length;g++){this.frame_place(d[g][0],e)}this.top_max=0;for(var g in this.frame_list){var j=this.frame_list[g];if(j.grid_location!==null){this.top_max=Math.max(this.top_max,j.grid_location.top+j.grid_location.height)}}this.top_max=$(window).height()-this.top_max*this.options.cell-2*this.options.margin;this.top_max=Math.min(this.top_max,this.options.top_min);this.menu_refresh()},frame_place:function(k,d){k.grid_location=null;var h=this.to_grid(this.frame_screen(k));var c=false;for(var f=0;f<this.options.rows;f++){for(var e=0;e<Math.max(1,this.cols-h.width);e++){h.top=f;h.left=e;if(!this.is_collision(h)){c=true;break}}if(c){break}}if(c){this.frame_grid(k,h,d)}else{console.log("Grid dimensions exceeded.")}},frame_focus:function(e,c){var d=parseInt(b.get_attribute("galaxy-frame","z-index"))+(c?1:0);$(e.id).css("z-index",d)},frame_offset:function(f,e,d){f.screen_location.left=e.left;f.screen_location.top=e.top;if(d){this.frame_focus(f,true);var c=this;$(f.id).animate({top:e.top,left:e.left},"fast",function(){c.frame_focus(f,false)})}else{$(f.id).css({top:e.top,left:e.left})}},frame_resize:function(d,c){$(d.id).css({width:c.width,height:c.height});d.screen_location.width=c.width;d.screen_location.height=c.height},frame_grid:function(e,c,d){e.grid_location=c;this.frame_offset(e,this.to_pixel(c),d);e.grid_rank=this.location_rank(c)},frame_screen:function(d){var c=d.screen_location;return{top:c.top,left:c.left,width:c.width,height:c.height}},frame_template:function(f,e,c,d){if(!e){e=""}if(c=="url"){d='<iframe scrolling="auto" class="f-iframe" src="'+d+'"></iframe>'}return'<div id="'+f+'" class="galaxy-frame f-corner"><div class="f-header f-corner"><span class="f-title">'+e+'</span><span class="f-icon f-pin fa-icon-pushpin"></span><span class="f-icon f-close fa-icon-trash"></span></div><div class="f-content f-corner">'+d+'<div class="f-cover"></div></div><span class="f-resize f-icon f-corner fa-icon-resize-full"></span></div>'},frame_template_shadow:function(c){return'<div id="'+c+'" class="galaxy-frame-shadow f-corner"></div>'},frame_template_background:function(){return'<div class="galaxy-frame-background"></div>'},frame_template_load:function(){return'<div class="galaxy-frame-load f-corner"><div class="number f-corner">0</div><div class="icon fa-icon-2x"></div></div><div class="galaxy-frame-active f-corner"><div class="icon fa-icon-2x fa-icon-th"></div></div>'},frame_template_menu:function(){return'<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div><div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>'}});return{GalaxyFrameManager:a}});
\ No newline at end of file
diff -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 -r 69797172b07930e2751dd2fe7a6e317f1e68a769 static/scripts/packed/utils/galaxy.css.js
--- /dev/null
+++ b/static/scripts/packed/utils/galaxy.css.js
@@ -0,0 +1,1 @@
+define(["libs/underscore"],function(a){function b(g,d){var e=$('<div class="'+g+'"></div>');e.appendTo(":eq(0)");var f=e.css(d).replace(/[^-\d\.]/g,"");e.remove();return f}function c(d){if(!$('link[href="'+d+'"]').length){$('<link href="'+d+'" rel="stylesheet">').appendTo("head")}}return{load_file:c,get_attribute:b}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: data providers: add data to factory decorator to allow datasets api to parse query strings into provider settings; datasets API: allow new providers to be used in raw_data; clean up and pack scripts
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/72b02995c8b1/
Changeset: 72b02995c8b1
User: carlfeberhard
Date: 2013-06-24 20:06:16
Summary: data providers: add data to factory decorator to allow datasets api to parse query strings into provider settings; datasets API: allow new providers to be used in raw_data; clean up and pack scripts
Affected #: 20 files
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/binary.py
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -267,25 +267,25 @@
# bam does not use '#' to indicate comments/headers - we need to strip out those headers from the std. providers
#TODO:?? seems like there should be an easier way to do/inherit this - metadata.comment_char?
#TODO: incorporate samtools options to control output: regions first, then flags, etc.
- @dataproviders.decorators.dataprovider_factory( 'line' )
+ @dataproviders.decorators.dataprovider_factory( 'line', dataproviders.line.FilteredLineDataProvider.settings )
def line_dataprovider( self, dataset, **settings ):
samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
settings[ 'comment_char' ] = '@'
return dataproviders.line.FilteredLineDataProvider( samtools_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'regex-line' )
+ @dataproviders.decorators.dataprovider_factory( 'regex-line', dataproviders.line.RegexLineDataProvider.settings )
def regex_line_dataprovider( self, dataset, **settings ):
samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
settings[ 'comment_char' ] = '@'
return dataproviders.line.RegexLineDataProvider( samtools_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'column' )
+ @dataproviders.decorators.dataprovider_factory( 'column', dataproviders.column.ColumnarDataProvider.settings )
def column_dataprovider( self, dataset, **settings ):
samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
settings[ 'comment_char' ] = '@'
return dataproviders.column.ColumnarDataProvider( samtools_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'map' )
+ @dataproviders.decorators.dataprovider_factory( 'map', dataproviders.column.MapDataProvider.settings )
def map_dataprovider( self, dataset, **settings ):
samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset )
settings[ 'comment_char' ] = '@'
@@ -293,30 +293,30 @@
# these can't be used directly - may need BamColumn, BamMap (Bam metadata -> column/map)
# OR - see genomic_region_dataprovider
- #(a)dataproviders.decorators.dataprovider_factory( 'dataset-column' )
+ #(a)dataproviders.decorators.dataprovider_factory( 'dataset-column', dataproviders.column.ColumnarDataProvider.settings )
#def dataset_column_dataprovider( self, dataset, **settings ):
# settings[ 'comment_char' ] = '@'
# return super( Sam, self ).dataset_column_dataprovider( dataset, **settings )
- #(a)dataproviders.decorators.dataprovider_factory( 'dataset-map' )
+ #(a)dataproviders.decorators.dataprovider_factory( 'dataset-map', dataproviders.column.MapDataProvider.settings )
#def dataset_map_dataprovider( self, dataset, **settings ):
# settings[ 'comment_char' ] = '@'
# return super( Sam, self ).dataset_map_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'header' )
+ @dataproviders.decorators.dataprovider_factory( 'header', dataproviders.line.RegexLineDataProvider.settings )
def header_dataprovider( self, dataset, **settings ):
# in this case we can use an option of samtools view to provide just what we need (w/o regex)
samtools_source = dataproviders.dataset.SamtoolsDataProvider( dataset, '-H' )
return dataproviders.line.RegexLineDataProvider( samtools_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'id-seq-qual' )
+ @dataproviders.decorators.dataprovider_factory( 'id-seq-qual', dataproviders.column.MapDataProvider.settings )
def id_seq_qual_dataprovider( self, dataset, **settings ):
settings[ 'indeces' ] = [ 0, 9, 10 ]
settings[ 'column_types' ] = [ 'str', 'str', 'str' ]
settings[ 'column_names' ] = [ 'id', 'seq', 'qual' ]
return self.map_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region', dataproviders.column.ColumnarDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
# GenomicRegionDataProvider currently requires a dataset as source - may not be necc.
#TODO:?? consider (at least) the possible use of a kwarg: metadata_source (def. to source.dataset),
@@ -330,7 +330,7 @@
settings[ 'column_types' ] = [ 'str', 'int', 'int' ]
return self.column_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map', dataproviders.column.MapDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'indeces' ] = [ 2, 3, 3 ]
settings[ 'column_types' ] = [ 'str', 'int', 'int' ]
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/data.py
--- a/lib/galaxy/datatypes/data.py
+++ b/lib/galaxy/datatypes/data.py
@@ -593,7 +593,6 @@
Base dataprovider factory for all datatypes that returns the proper provider
for the given `data_format` or raises a `NoProviderAvailable`.
"""
- #TODO:?? is this handling super class providers?
if self.has_dataprovider( data_format ):
return self.dataproviders[ data_format ]( self, dataset, **settings )
raise dataproviders.exceptions.NoProviderAvailable( self, data_format )
@@ -603,12 +602,12 @@
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.base.DataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'chunk' )
+ @dataproviders.decorators.dataprovider_factory( 'chunk', dataproviders.chunk.ChunkDataProvider.settings )
def chunk_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.chunk.ChunkDataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'chunk64' )
+ @dataproviders.decorators.dataprovider_factory( 'chunk64', dataproviders.chunk.Base64ChunkDataProvider.settings )
def chunk64_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.chunk.Base64ChunkDataProvider( dataset_source, **settings )
@@ -785,7 +784,7 @@
split = classmethod(split)
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'line' )
+ @dataproviders.decorators.dataprovider_factory( 'line', dataproviders.line.FilteredLineDataProvider.settings )
def line_dataprovider( self, dataset, **settings ):
"""
Returns an iterator over the dataset's lines (that have been `strip`ed)
@@ -794,7 +793,7 @@
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.line.FilteredLineDataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'regex-line' )
+ @dataproviders.decorators.dataprovider_factory( 'regex-line', dataproviders.line.RegexLineDataProvider.settings )
def regex_line_dataprovider( self, dataset, **settings ):
"""
Returns an iterator over the dataset's lines
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/base.py
--- a/lib/galaxy/datatypes/dataproviders/base.py
+++ b/lib/galaxy/datatypes/dataproviders/base.py
@@ -22,8 +22,13 @@
icorporate existing visualization/dataproviders
some of the sources (esp. in datasets) don't need to be re-created
+YAGNI: InterleavingMultiSourceDataProvider, CombiningMultiSourceDataProvider
-YAGNI: InterleavingMultiSourceDataProvider, CombiningMultiSourceDataProvider
+datasets API entry point:
+ kwargs should be parsed from strings 2 layers up (in the DatasetsAPI) - that's the 'proper' place for that.
+ but how would it know how/what to parse if it doesn't have access to the classes used in the provider?
+ Building a giant list by sweeping all possible dprov classes doesn't make sense
+ For now - I'm burying them in the class __init__s - but I don't like that
"""
import logging
@@ -31,6 +36,31 @@
# ----------------------------------------------------------------------------- base classes
+class HasSettings( type ):
+ """
+ Metaclass for data providers that allows defining and inheriting
+ a dictionary named 'settings'.
+
+ Useful for allowing class level access to expected variable types
+ passed to class `__init__` functions so they can be parsed from a query string.
+ """
+ # yeah - this is all too acrobatic
+ def __new__( cls, name, base_classes, attributes ):
+ settings = {}
+ # get settings defined in base classes
+ for base_class in base_classes:
+ base_settings = getattr( base_class, 'settings', None )
+ if base_settings:
+ settings.update( base_settings )
+ # get settings defined in this class
+ new_settings = attributes.pop( 'settings', None )
+ if new_settings:
+ settings.update( new_settings )
+ attributes[ 'settings' ] = settings
+ return type.__new__( cls, name, base_classes, attributes )
+
+
+# ----------------------------------------------------------------------------- base classes
class DataProvider( object ):
"""
Base class for all data providers. Data providers:
@@ -39,6 +69,12 @@
(c) do not allow write methods
(but otherwise implement the other file object interface methods)
"""
+ # a definition of expected types for keyword arguments sent to __init__
+ # useful for controlling how query string dictionaries can be parsed into correct types for __init__
+ # empty in this base class
+ __metaclass__ = HasSettings
+ settings = {}
+
def __init__( self, source, **kwargs ):
"""
:param source: the source that this iterator will loop over.
@@ -130,13 +166,16 @@
- `num_valid_data_read`: how many data have been returned from `filter`.
- `num_data_returned`: how many data has this provider yielded.
"""
+ # not useful here - we don't want functions over the query string
+ #settings.update({ 'filter_fn': 'function' })
+
def __init__( self, source, filter_fn=None, **kwargs ):
"""
:param filter_fn: a lambda or function that will be passed a datum and
return either the (optionally modified) datum or None.
"""
super( FilteredDataProvider, self ).__init__( source, **kwargs )
- self.filter_fn = filter_fn
+ self.filter_fn = filter_fn if hasattr( filter_fn, '__call__' ) else None
# count how many data we got from the source
self.num_data_read = 0
# how many valid data have we gotten from the source
@@ -179,6 +218,12 @@
Useful for grabbing sections from a source (e.g. pagination).
"""
+ # define the expected types of these __init__ arguments so they can be parsed out from query strings
+ settings = {
+ 'limit' : 'int',
+ 'offset': 'int'
+ }
+
#TODO: may want to squash this into DataProvider
def __init__( self, source, offset=0, limit=None, **kwargs ):
"""
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/chunk.py
--- a/lib/galaxy/datatypes/dataproviders/chunk.py
+++ b/lib/galaxy/datatypes/dataproviders/chunk.py
@@ -26,6 +26,10 @@
"""
MAX_CHUNK_SIZE = 2**16
DEFAULT_CHUNK_SIZE = MAX_CHUNK_SIZE
+ settings = {
+ 'chunk_index' : 'int',
+ 'chunk_size' : 'int'
+ }
#TODO: subclass from LimitedOffsetDataProvider?
# see web/framework/base.iterate_file, util/__init__.file_reader, and datatypes.tabular
@@ -38,8 +42,8 @@
(gen. in bytes).
"""
super( ChunkDataProvider, self ).__init__( source, **kwargs )
- self.chunk_size = chunk_size
- self.chunk_pos = chunk_index * self.chunk_size
+ self.chunk_size = int( chunk_size )
+ self.chunk_pos = int( chunk_index ) * self.chunk_size
def validate_source( self, source ):
"""
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/column.py
--- a/lib/galaxy/datatypes/dataproviders/column.py
+++ b/lib/galaxy/datatypes/dataproviders/column.py
@@ -29,6 +29,14 @@
the same number of columns as the number of indeces asked for (even if they
are filled with None).
"""
+ settings = {
+ 'indeces' : 'list:int',
+ 'column_count' : 'int',
+ 'column_types' : 'list:str',
+ 'parse_columns' : 'bool',
+ 'deliminator' : 'str'
+ }
+
def __init__( self, source, indeces=None,
column_count=None, column_types=None, parsers=None, parse_columns=True,
deliminator='\t', **kwargs ):
@@ -91,11 +99,11 @@
# how/whether to parse each column value
self.parsers = {}
if parse_columns:
- self.parsers = self._get_default_parsers()
+ self.parsers = self.get_default_parsers()
# overwrite with user desired parsers
self.parsers.update( parsers or {} )
- def _get_default_parsers( self ):
+ def get_default_parsers( self ):
"""
Return parser dictionary keyed for each columnar type
(as defined in datatypes).
@@ -132,7 +140,7 @@
#'gffstrand': # -, +, ?, or '.' for None, etc.
}
- def _parse_value( self, val, type ):
+ def parse_value( self, val, type ):
"""
Attempt to parse and return the given value based on the given type.
@@ -153,7 +161,7 @@
return None
return val
- def _get_column_type( self, index ):
+ def get_column_type( self, index ):
"""
Get the column type for the parser from `self.column_types` or `None`
if the type is unavailable.
@@ -165,18 +173,18 @@
except IndexError, ind_err:
return None
- def _parse_column_at_index( self, columns, parser_index, index ):
+ def parse_column_at_index( self, columns, parser_index, index ):
"""
Get the column type for the parser from `self.column_types` or `None`
if the type is unavailable.
"""
try:
- return self._parse_value( columns[ index ], self._get_column_type( parser_index ) )
+ return self.parse_value( columns[ index ], self.get_column_type( parser_index ) )
# if a selected index is not within columns, return None
except IndexError, index_err:
return None
- def _parse_columns_from_line( self, line ):
+ def parse_columns_from_line( self, line ):
"""
Returns a list of the desired, parsed columns.
:param line: the line to parse
@@ -188,13 +196,13 @@
selected_indeces = self.selected_column_indeces or list( xrange( len( all_columns ) ) )
parsed_columns = []
for parser_index, column_index in enumerate( selected_indeces ):
- parsed_columns.append( self._parse_column_at_index( all_columns, parser_index, column_index ) )
+ parsed_columns.append( self.parse_column_at_index( all_columns, parser_index, column_index ) )
return parsed_columns
def __iter__( self ):
parent_gen = super( ColumnarDataProvider, self ).__iter__()
for line in parent_gen:
- columns = self._parse_columns_from_line( line )
+ columns = self.parse_columns_from_line( line )
yield columns
#TODO: implement column filters here and not below - flatten hierarchy
@@ -223,6 +231,10 @@
.. note: that the subclass constructors are passed kwargs - so they're
params (limit, offset, etc.) are also applicable here.
"""
+ settings = {
+ 'column_names' : 'list:str',
+ }
+
def __init__( self, source, column_names=None, **kwargs ):
"""
:param column_names: an ordered list of strings that will be used as the keys
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/dataset.py
--- a/lib/galaxy/datatypes/dataproviders/dataset.py
+++ b/lib/galaxy/datatypes/dataproviders/dataset.py
@@ -141,7 +141,7 @@
"""
# metadata columns are 1-based indeces
column = getattr( self.dataset.metadata, name )
- return ( column - 1 ) if isinstance( column, int ) else None
+ return ( column - 1 ) if ( isinstance( column, int ) and column > 0 ) else None
def get_genomic_region_indeces( self, check=False ):
"""
@@ -271,6 +271,12 @@
"""
# dictionary keys when named_columns=True
COLUMN_NAMES = [ 'chrom', 'start', 'end' ]
+ settings = {
+ 'chrom_column' : 'int',
+ 'start_column' : 'int',
+ 'end_column' : 'int',
+ 'named_columns' : 'bool',
+ }
def __init__( self, dataset, chrom_column=None, start_column=None, end_column=None, named_columns=False, **kwargs ):
"""
@@ -333,6 +339,14 @@
'chrom', 'start', 'end' (and 'strand' and 'name' if available).
"""
COLUMN_NAMES = [ 'chrom', 'start', 'end', 'strand', 'name' ]
+ settings = {
+ 'chrom_column' : 'int',
+ 'start_column' : 'int',
+ 'end_column' : 'int',
+ 'strand_column' : 'int',
+ 'name_column' : 'int',
+ 'named_columns' : 'bool',
+ }
def __init__( self, dataset, chrom_column=None, start_column=None, end_column=None,
strand_column=None, name_column=None, named_columns=False, **kwargs ):
@@ -349,25 +363,40 @@
dataset_source = DatasetDataProvider( dataset )
# get genomic indeces and add strand and name
+ self.column_names = []
+ indeces = []
+ #TODO: this is sort of involved and oogly
if chrom_column == None:
chrom_column = dataset_source.get_metadata_column_index_by_name( 'chromCol' )
+ if chrom_column != None:
+ self.column_names.append( 'chrom' )
+ indeces.append( chrom_column )
if start_column == None:
start_column = dataset_source.get_metadata_column_index_by_name( 'startCol' )
+ if start_column != None:
+ self.column_names.append( 'start' )
+ indeces.append( start_column )
if end_column == None:
end_column = dataset_source.get_metadata_column_index_by_name( 'endCol' )
+ if end_column != None:
+ self.column_names.append( 'end' )
+ indeces.append( end_column )
if strand_column == None:
strand_column = dataset_source.get_metadata_column_index_by_name( 'strandCol' )
+ if strand_column != None:
+ self.column_names.append( 'strand' )
+ indeces.append( strand_column )
if name_column == None:
name_column = dataset_source.get_metadata_column_index_by_name( 'nameCol' )
- indeces = [ chrom_column, start_column, end_column, strand_column, name_column ]
+ if name_column != None:
+ self.column_names.append( 'name' )
+ indeces.append( name_column )
+
kwargs.update({ 'indeces' : indeces })
-
if not kwargs.get( 'column_types', None ):
kwargs.update({ 'column_types' : dataset_source.get_metadata_column_types( indeces=indeces ) })
self.named_columns = named_columns
- if self.named_columns:
- self.column_names = self.COLUMN_NAMES
super( IntervalDataProvider, self ).__init__( dataset_source, **kwargs )
@@ -390,6 +419,10 @@
sequence: <joined lines of nucleotide/amino data>
}
"""
+ settings = {
+ 'ids' : 'list:str',
+ }
+
def __init__( self, source, ids=None, **kwargs ):
"""
:param ids: optionally return only ids (and sequences) that are in this list.
@@ -419,6 +452,10 @@
sequence: <joined lines of nucleotide/amino data>
}
"""
+ settings = {
+ 'ids' : 'list:str',
+ }
+
def __init__( self, source, ids=None, **kwargs ):
"""
:param ids: optionally return only ids (and sequences) that are in this list.
@@ -445,6 +482,10 @@
Class that returns chrom, pos, data from a wiggle source.
"""
COLUMN_NAMES = [ 'chrom', 'pos', 'value' ]
+ settings = {
+ 'named_columns' : 'bool',
+ 'column_names' : 'list:str',
+ }
def __init__( self, source, named_columns=False, column_names=None, **kwargs ):
"""
@@ -483,6 +524,10 @@
Class that returns chrom, pos, data from a wiggle source.
"""
COLUMN_NAMES = [ 'chrom', 'pos', 'value' ]
+ settings = {
+ 'named_columns' : 'bool',
+ 'column_names' : 'list:str',
+ }
def __init__( self, source, chrom, start, end, named_columns=False, column_names=None, **kwargs ):
"""
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/decorators.py
--- a/lib/galaxy/datatypes/dataproviders/decorators.py
+++ b/lib/galaxy/datatypes/dataproviders/decorators.py
@@ -87,17 +87,40 @@
# log.debug( '\t\t ', fn.__doc__ )
return cls
-def dataprovider_factory( name ):
+def dataprovider_factory( name, settings=None ):
"""
- Wraps a class method and marks it as a dataprovider factory.
+ Wraps a class method and marks it as a dataprovider factory and creates a
+ function to parse query strings to __init__ arguments as the
+ `parse_query_string_settings` attribute of the factory function.
+
+ An example use of the `parse_query_string_settings`:
+ ..example::
+ kwargs = dataset.datatype.dataproviders[ provider ].parse_query_string_settings( query_kwargs )
+ return list( dataset.datatype.dataprovider( dataset, provider, **kwargs ) )
:param name: what name/key to register the factory under in `cls.dataproviders`
- :param type: any hashable var
+ :type name: any hashable var
+ :param settings: dictionary containing key/type pairs for parsing query strings
+ to __init__ arguments
+ :type settings: dictionary
"""
+ #TODO:?? use *args for settings allowing mulitple dictionaries
+ # make a function available through the name->provider dispatch to parse query strings
+ # callable like:
+ # settings_dict = dataproviders[ provider_name ].parse_query_string_settings( query_kwargs )
+ #TODO: ugh - overly complicated but the best I could think of
+ def parse_query_string_settings( query_kwargs ):
+ return _parse_query_string_settings( query_kwargs, settings )
+
#log.debug( 'dataprovider:', name )
def named_dataprovider_factory( func ):
#log.debug( 'named_dataprovider_factory:', name, '->', func.__name__ )
setattr( func, _DATAPROVIDER_METHOD_NAME_KEY, name )
+
+ setattr( func, 'parse_query_string_settings', parse_query_string_settings )
+ setattr( func, 'settings', settings )
+ #TODO: I want a way to inherit settings from the previous provider( this_name ) instead of defining over and over
+
#log.debug( '\t setting:', getattr( func, _DATAPROVIDER_METHOD_NAME_KEY ) )
@wraps( func )
def wrapped_dataprovider_factory( self, *args, **kwargs ):
@@ -105,3 +128,38 @@
return func( self, *args, **kwargs )
return wrapped_dataprovider_factory
return named_dataprovider_factory
+
+def _parse_query_string_settings( query_kwargs, settings=None ):
+ """
+ Parse the values in `query_kwargs` from strings to the proper types
+ listed in the same key in `settings`.
+ """
+ def list_from_query_string( s ):
+ # assume csv
+ return s.split( ',' )
+
+ parsers = {
+ 'int' : int,
+ 'float' : float,
+ 'bool' : bool,
+ 'list:str' : lambda s: list_from_query_string( s ),
+ 'list:int' : lambda s: [ int( i ) for i in list_from_query_string( s ) ],
+ }
+ settings = settings or {}
+ # yay! yet another set of query string parsers! <-- sarcasm
+ # work through the keys in settings finding matching keys in query_kwargs
+ # if found in both, get the expected/needed type from settings and store the new parsed value
+ # if we can't parse it (no parser, bad value), delete the key from query_kwargs so the provider will use the defaults
+ for key in settings:
+ if key in query_kwargs:
+ #TODO: this would be the place to sanitize any strings
+ query_value = query_kwargs[ key ]
+ needed_type = settings[ key ]
+ try:
+ query_kwargs[ key ] = parsers[ needed_type ]( query_value )
+ except ( KeyError, ValueError ):
+ del query_kwargs[ key ]
+
+ #TODO:?? do we want to remove query_kwarg entries NOT in settings?
+ return query_kwargs
+
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/dataproviders/line.py
--- a/lib/galaxy/datatypes/dataproviders/line.py
+++ b/lib/galaxy/datatypes/dataproviders/line.py
@@ -27,6 +27,12 @@
to return.
"""
DEFAULT_COMMENT_CHAR = '#'
+ settings = {
+ 'string_lines' : 'bool',
+ 'provide_blank' : 'bool',
+ 'comment_char' : 'str',
+ }
+
def __init__( self, source, strip_lines=True, provide_blank=False, comment_char=DEFAULT_COMMENT_CHAR, **kwargs ):
"""
:param strip_lines: remove whitespace from the beginning an ending
@@ -78,6 +84,11 @@
.. note:: the regex matches are effectively OR'd (if **any** regex matches
the line it is considered valid and will be provided).
"""
+ settings = {
+ 'regex_list' : 'list:str',
+ 'invert' : 'bool',
+ }
+
def __init__( self, source, regex_list=None, invert=False, **kwargs ):
"""
:param regex_list: list of strings or regular expression strings that will
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/interval.py
--- a/lib/galaxy/datatypes/interval.py
+++ b/lib/galaxy/datatypes/interval.py
@@ -334,20 +334,24 @@
return None
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.GenomicRegionDataProvider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.genomic_region_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'interval' )
+ @dataproviders.decorators.dataprovider_factory( 'interval',
+ dataproviders.dataset.IntervalDataProvider.settings )
def interval_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.IntervalDataProvider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'interval-map' )
+ @dataproviders.decorators.dataprovider_factory( 'interval-map',
+ dataproviders.dataset.IntervalDataProvider.settings )
def interval_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.interval_dataprovider( dataset, **settings )
@@ -809,20 +813,24 @@
# ------------- Dataproviders
# redefine bc super is Tabular
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.GenomicRegionDataProvider( dataset, 0, 3, 4, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.genomic_region_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'interval' )
+ @dataproviders.decorators.dataprovider_factory( 'interval',
+ dataproviders.dataset.IntervalDataProvider.settings )
def interval_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.IntervalDataProvider( dataset, 0, 3, 4, 6, 2, **settings )
- @dataproviders.decorators.dataprovider_factory( 'interval-map' )
+ @dataproviders.decorators.dataprovider_factory( 'interval-map',
+ dataproviders.dataset.IntervalDataProvider.settings )
def interval_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.interval_dataprovider( dataset, **settings )
@@ -1193,12 +1201,12 @@
return resolution
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'wiggle' )
+ @dataproviders.decorators.dataprovider_factory( 'wiggle', dataproviders.dataset.WiggleDataProvider.settings )
def wiggle_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.dataset.WiggleDataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'wiggle-map' )
+ @dataproviders.decorators.dataprovider_factory( 'wiggle-map', dataproviders.dataset.WiggleDataProvider.settings )
def wiggle_map_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
settings[ 'named_columns' ] = True
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/sequence.py
--- a/lib/galaxy/datatypes/sequence.py
+++ b/lib/galaxy/datatypes/sequence.py
@@ -15,8 +15,6 @@
from galaxy import util
from sniff import *
-from galaxy.datatypes import dataproviders
-
import pkg_resources
pkg_resources.require("simplejson")
import simplejson
@@ -399,15 +397,6 @@
f.close()
_count_split = classmethod(_count_split)
- def provider( self, dataset, data_format, **settings ):
- from galaxy.dataproviders import dataset as dataset_providers
-
- if data_format == 'id_seq':
- source = dataset_providers.DatasetDataProvider( dataset )
- return dataset_providers.FastaDataProvider( source, **settings )
-
- return super( Fasta, self ).provider( dataset, data_format, **settings )
-
class csFasta( Sequence ):
""" Class representing the SOLID Color-Space sequence ( csfasta ) """
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/datatypes/tabular.py
--- a/lib/galaxy/datatypes/tabular.py
+++ b/lib/galaxy/datatypes/tabular.py
@@ -345,26 +345,25 @@
return vizs
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'column' )
+ @dataproviders.decorators.dataprovider_factory( 'column', dataproviders.column.ColumnarDataProvider.settings )
def column_dataprovider( self, dataset, **settings ):
"""Uses column settings that are passed in"""
- print 'Tabular.comment_char:', settings.get( 'comment_char', None )
-
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.column.ColumnarDataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'dataset-column' )
+ @dataproviders.decorators.dataprovider_factory( 'dataset-column',
+ dataproviders.column.ColumnarDataProvider.settings )
def dataset_column_dataprovider( self, dataset, **settings ):
"""Attempts to get column settings from dataset.metadata"""
return dataproviders.dataset.DatasetColumnarDataProvider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'map' )
+ @dataproviders.decorators.dataprovider_factory( 'map', dataproviders.column.MapDataProvider.settings )
def map_dataprovider( self, dataset, **settings ):
"""Uses column settings that are passed in"""
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
return dataproviders.column.MapDataProvider( dataset_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'dataset-map' )
+ @dataproviders.decorators.dataprovider_factory( 'dataset-map', dataproviders.column.MapDataProvider.settings )
def dataset_map_dataprovider( self, dataset, **settings ):
"""Attempts to get column settings from dataset.metadata"""
return dataproviders.dataset.DatasetMapDataProvider( dataset, **settings )
@@ -502,55 +501,58 @@
# ------------- Dataproviders
# sam does not use '#' to indicate comments/headers - we need to strip out those headers from the std. providers
#TODO:?? seems like there should be an easier way to do this - metadata.comment_char?
- @dataproviders.decorators.dataprovider_factory( 'line' )
+ @dataproviders.decorators.dataprovider_factory( 'line', dataproviders.line.FilteredLineDataProvider.settings )
def line_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).line_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'regex-line' )
+ @dataproviders.decorators.dataprovider_factory( 'regex-line', dataproviders.line.RegexLineDataProvider.settings )
def regex_line_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).regex_line_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'column' )
+ @dataproviders.decorators.dataprovider_factory( 'column', dataproviders.column.ColumnarDataProvider.settings )
def column_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).column_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'dataset-column' )
+ @dataproviders.decorators.dataprovider_factory( 'dataset-column',
+ dataproviders.column.ColumnarDataProvider.settings )
def dataset_column_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).dataset_column_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'map' )
+ @dataproviders.decorators.dataprovider_factory( 'map', dataproviders.column.MapDataProvider.settings )
def map_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).map_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'dataset-map' )
+ @dataproviders.decorators.dataprovider_factory( 'dataset-map', dataproviders.column.MapDataProvider.settings )
def dataset_map_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return super( Sam, self ).dataset_map_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'header' )
+ @dataproviders.decorators.dataprovider_factory( 'header', dataproviders.line.RegexLineDataProvider.settings )
def header_dataprovider( self, dataset, **settings ):
dataset_source = dataproviders.dataset.DatasetDataProvider( dataset )
headers_source = dataproviders.line.RegexLineDataProvider( dataset_source, regex_list=[ '^@' ] )
return dataproviders.line.RegexLineDataProvider( headers_source, **settings )
- @dataproviders.decorators.dataprovider_factory( 'id-seq-qual' )
+ @dataproviders.decorators.dataprovider_factory( 'id-seq-qual', map_dataprovider.settings )
def id_seq_qual_dataprovider( self, dataset, **settings ):
# provided as an example of a specified column map (w/o metadata)
settings[ 'indeces' ] = [ 0, 9, 10 ]
settings[ 'column_names' ] = [ 'id', 'seq', 'qual' ]
return self.map_dataprovider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return dataproviders.dataset.GenomicRegionDataProvider( dataset, 2, 3, 3, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'comment_char' ] = '@'
return dataproviders.dataset.GenomicRegionDataProvider( dataset, 2, 3, 3, True, **settings )
@@ -621,11 +623,13 @@
return False
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.GenomicRegionDataProvider( dataset, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.genomic_region_dataprovider( dataset, **settings )
@@ -668,11 +672,13 @@
dataset.metadata.sample_names = line.split()[ 9: ]
# ------------- Dataproviders
- @dataproviders.decorators.dataprovider_factory( 'genomic-region' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_dataprovider( self, dataset, **settings ):
return dataproviders.dataset.GenomicRegionDataProvider( dataset, 0, 1, 1, **settings )
- @dataproviders.decorators.dataprovider_factory( 'genomic-region-map' )
+ @dataproviders.decorators.dataprovider_factory( 'genomic-region-map',
+ dataproviders.dataset.GenomicRegionDataProvider.settings )
def genomic_region_map_dataprovider( self, dataset, **settings ):
settings[ 'named_columns' ] = True
return self.genomic_region_dataprovider( dataset, **settings )
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/visualization/data_providers/registry.py
--- a/lib/galaxy/visualization/data_providers/registry.py
+++ b/lib/galaxy/visualization/data_providers/registry.py
@@ -32,7 +32,7 @@
"bigwig": genome.BigWigDataProvider,
"bigbed": genome.BigBedDataProvider,
- "column": ColumnDataProvider
+ "column_with_stats": ColumnDataProvider
}
def get_data_provider( self, trans, name=None, source='data', raw=False, original_dataset=None ):
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/visualization/registry.py
--- a/lib/galaxy/visualization/registry.py
+++ b/lib/galaxy/visualization/registry.py
@@ -15,22 +15,27 @@
log = logging.getLogger( __name__ )
__TODO__ = """
- BUGS:
- anon users clicking a viz link gets 'must be' msg in galaxy_main (w/ masthead)
- should not show visualizations (no icon)?
- newick files aren't being sniffed prop? - datatype is txt
+BUGS:
+ anon users clicking a viz link gets 'must be' msg in galaxy_main (w/ masthead)
+ should not show visualizations (no icon)?
+ newick files aren't being sniffed prop? - datatype is txt
- have parsers create objects instead of dicts
- allow data_sources with no model_class but have tests (isAdmin, etc.)
- maybe that's an instance of User model_class?
- some confused vocabulary in docs, var names
- tests:
- anding, grouping, not
- data_sources:
- lists of
- add description element to visualization.
+have parsers create objects instead of dicts
+allow data_sources with no model_class but have tests (isAdmin, etc.)
+ maybe that's an instance of User model_class?
+some confused vocabulary in docs, var names
+tests:
+ anding, grouping, not
+data_sources:
+ lists of
+add description element to visualization.
+
+TESTS to add:
+ has dataprovider
+ user is admin
"""
+# ------------------------------------------------------------------- the registry
class VisualizationsRegistry( object ):
"""
Main responsibilities are:
@@ -93,6 +98,12 @@
"""
self.listings = VisualizationsConfigParser.parse( self.configuration_filepath )
+ #TODO: def get_visualization( self, trans, visualization_name, target_object ):
+ # """
+ # Is the visualization with the given `visualization_name` applicable
+ # to the `target_object`?
+ # """
+
# -- building links to visualizations from objects --
def get_visualizations( self, trans, target_object ):
"""
@@ -151,10 +162,11 @@
# convert datatypes to their actual classes (for use with isinstance)
test_result = trans.app.datatypes_registry.get_datatype_class_by_name( test_result )
if not test_result:
- # warn if can't find class, but continue
+ # warn if can't find class, but continue (with other tests)
log.warn( 'visualizations_registry cannot find class (%s) for applicability test', test_result )
continue
+ #NOTE: tests are OR'd, if any test passes - the visualization can be applied
if test_fn( target_object, test_result ):
#log.debug( 'test passed' )
return True
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 lib/galaxy/webapps/galaxy/api/datasets.py
--- a/lib/galaxy/webapps/galaxy/api/datasets.py
+++ b/lib/galaxy/webapps/galaxy/api/datasets.py
@@ -6,6 +6,7 @@
from galaxy.web.base.controller import BaseAPIController, UsesVisualizationMixin, UsesHistoryDatasetAssociationMixin
from galaxy.web.base.controller import UsesHistoryMixin
from galaxy.web.framework.helpers import is_true
+from galaxy.datatypes import dataproviders
import logging
log = logging.getLogger( __name__ )
@@ -217,10 +218,24 @@
return msg
registry = trans.app.data_provider_registry
+
# allow the caller to specifiy which provider is used
- if provider and provider in registry.dataset_type_name_to_data_provider:
- data_provider = registry.dataset_type_name_to_data_provider[ provider ]( dataset )
- # or have it look up by datatype
+ # pulling from the original providers if possible, then the new providers
+ if provider:
+ if provider in registry.dataset_type_name_to_data_provider:
+ data_provider = registry.dataset_type_name_to_data_provider[ provider ]( dataset )
+
+ elif dataset.datatype.has_dataprovider( provider ):
+ kwargs = dataset.datatype.dataproviders[ provider ].parse_query_string_settings( kwargs )
+ # use dictionary to allow more than the data itself to be returned (data totals, other meta, etc.)
+ return {
+ 'data': list( dataset.datatype.dataprovider( dataset, provider, **kwargs ) )
+ }
+
+ else:
+ raise dataproviders.exceptions.NoProviderAvailable( dataset.datatype, provider )
+
+ # no provider name: look up by datatype
else:
data_provider = registry.get_data_provider( trans, raw=True, original_dataset=dataset )
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 static/scripts/mvc/visualizations/scatterplotControlForm.js
--- a/static/scripts/mvc/visualizations/scatterplotControlForm.js
+++ b/static/scripts/mvc/visualizations/scatterplotControlForm.js
@@ -562,7 +562,7 @@
var params = {
data_type : 'raw_data',
- provider : 'column',
+ provider : 'column_with_stats',
columns : '[' + columns + ']'
};
this.log( '\t data settings (url params):', params );
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){(new b(i)).render()},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,initialize:function(i){var j=i.model.attributes.metadata.attributes;if(typeof j.chromCol==="undefined"||typeof j.startCol==="undefined"||typeof j.endCol==="undefined"){console.log("TabularButtonTrackster : Metadata for column identification is missing.")}else{this.col.chrom=j.chromCol-1;this.col.start=j.startCol-1;this.col.end=j.endCol-1}if(this.col.chrom===null){return}if(typeof i.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=i.model.attributes.id}if(typeof i.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=i.model.attributes.url_viz}if(typeof i.model.attributes.genome_build!=="undefined"){this.genome_build=i.model.attributes.genome_build}},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(m){if(this.col.chrom===null){return}var q=$(m.target).parent();var n=q.children().eq(this.col.chrom).html();var i=q.children().eq(this.col.start).html();var k=q.children().eq(this.col.end).html();if(n!==""&&i!==""&&k!==""){var p={dataset_id:this.dataset_id,gene_region:n+":"+i+"-"+k};var l=q.offset();var j=l.left-10;var o=l.top;$("#btn_viz").css({position:"fixed",top:o+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,p,this.genome_build));$("#btn_viz").show()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.location=i+"/trackster?"+$.param(k)})}})},"View in new visualization":function(){n.location=i+"/trackster?"+$.param(k)}})}});return false}},render:function(){var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ No newline at end of file
+define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i,{silent:true})},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){(new b(i)).render()},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,initialize:function(i){var j=i.model.attributes.metadata.attributes;if(typeof j.chromCol==="undefined"||typeof j.startCol==="undefined"||typeof j.endCol==="undefined"){console.log("TabularButtonTrackster : Metadata for column identification is missing.")}else{this.col.chrom=j.chromCol-1;this.col.start=j.startCol-1;this.col.end=j.endCol-1}if(this.col.chrom===null){return}if(typeof i.model.attributes.id==="undefined"){console.log("TabularButtonTrackster : Dataset identification is missing.")}else{this.dataset_id=i.model.attributes.id}if(typeof i.model.attributes.url_viz==="undefined"){console.log("TabularButtonTrackster : Url for visualization controller is missing.")}else{this.url_viz=i.model.attributes.url_viz}if(typeof i.model.attributes.genome_build!=="undefined"){this.genome_build=i.model.attributes.genome_build}},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(m){if(this.col.chrom===null){return}var q=$(m.target).parent();var n=q.children().eq(this.col.chrom).html();var i=q.children().eq(this.col.start).html();var k=q.children().eq(this.col.end).html();if(n!==""&&i!==""&&k!==""){var p={dataset_id:this.dataset_id,gene_region:n+":"+i+"-"+k};var l=q.offset();var j=l.left-10;var o=l.top;$("#btn_viz").css({position:"fixed",top:o+"px",left:j+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,p,this.genome_build));$("#btn_viz").show()}},btn_viz_hide:function(){$("#btn_viz").hide()},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.frame_manager.frame_new({title:"Trackster",type:"url",content:i+"/trackster?"+$.param(k)});n.hide_modal()})}})},"View in new visualization":function(){var o=i+"/trackster?"+$.param(k);n.frame_manager.frame_new({title:"Trackster",type:"url",content:o});n.hide_modal()}})}});return false}},render:function(){var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide()}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new f({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}});
\ No newline at end of file
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("View data");a.href=this.urls.display}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
+var HDABaseView=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){if(a.logger){this.logger=this.model.logger=a.logger}this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urlTemplates=a.urlTemplates;this.expanded=a.expanded||false;this.model.bind("change",function(c,d){var b=_.without(_.keys(d.changes),"display_apps","display_types");if(b.length){this.render()}else{if(this.expanded){this._render_displayApps()}}},this)},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("<div/>").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);this.urls=this._renderUrls(this.urlTemplates,this.model.toJSON());a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this._setUpBehaviors(a);this.body=$(this._render_body());a.append(this.body);this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b._renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b._renderMetaDownloadUrls(e,a)}else{try{c[f]=_.template(e,a)}catch(g){throw (b+"._renderUrls error: "+g+"\n rendering:"+e+"\n with "+JSON.stringify(a))}}}});return c},_renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},_setUpBehaviors:function(a){a=a||this.$el;make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"})},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('<div class="historyItemTitleBar" style="overflow: hidden"></div>');a.append(this._render_titleButtons());a.append('<span class="state-icon"></span>');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("View data");a.href="javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', center: true, content: '"+this.urls.display+"'});"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("<div/>").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a.trim())},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayAppArea:function(){return $("<div/>").addClass("display-apps")},_render_displayApps:function(c){c=c||this.$el;var d=c.find("div.display-apps"),a=this.model.get("display_types"),b=this.model.get("display_apps");if((!this.model.hasData())||(!c||!c.length)||(!d.length)){return}d.html(null);if(!_.isEmpty(a)){d.append(HDABaseView.templates.displayApps({displayApps:a}))}if(!_.isEmpty(b)){d.append(HDABaseView.templates.displayApps({displayApps:b}))}},_render_peek:function(){var a=this.model.get("peek");if(!a){return null}return $("<div/>").append($("<pre/>").attr("id","peek"+this.model.get("id")).addClass("peek").append(a))},_render_body:function(){var a=$("<div/>").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: none");if(this.expanded){this._render_body_html(a);a.css("display","block")}return a},_render_body_html:function(a){a.html("");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NEW:this._render_body_new(a);break;case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.PAUSED:this._render_body_paused(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'))}a.append('<div style="clear: both"></div>');this._setUpBehaviors(a)},_render_body_new:function(b){var a=_l("This is a new dataset and not all of its data are available yet");b.append($("<div>"+_l(a)+"</div>"))},_render_body_not_viewable:function(a){a.append($("<div>"+_l("You do not have permission to view dataset")+"</div>"))},_render_body_uploading:function(a){a.append($("<div>"+_l("Dataset is uploading")+"</div>"))},_render_body_queued:function(a){a.append($("<div>"+_l("Job is waiting to run")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_paused:function(a){a.append($("<div>"+_l("Job is paused. Use the history menu to resume")+"</div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("<div>"+_l("Job is currently running")+"</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("<div>"+this.model.get("misc_blurb")+"</div>"))}a.append((_l("An error occurred with this dataset")+": <i>"+$.trim(this.model.get("misc_info"))+"</i>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("<div>"+_l("The job creating this dataset was cancelled before completion")+".</div>");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("<div>"+_l("Metadata is being auto-detected")+".</div>"))},_render_body_empty:function(a){a.append($("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(_.extend(this.model.toJSON(),{urls:this.urls}))));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('<div class="clear"/>');a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this;this.expanded=(a===undefined)?(!this.body.is(":visible")):(a);if(this.expanded){b._render_body_html(b.body);this.body.slideDown("fast",function(){b.trigger("body-expanded",b.model.get("id"))})}else{this.body.slideUp("fast",function(){b.trigger("body-collapsed",b.model.get("id"))})}},remove:function(b){var a=this;this.$el.fadeOut("fast",function(){a.$el.remove();a.off();if(b){b()}})},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetadata"],displayApps:Handlebars.templates["template-hda-displayApps"]};
\ No newline at end of file
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){a.trigger("error",_l("Unable to purge this dataset"),h,g,i)})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){window.parent.location=f+"/"+h+"?"+$.param(g)}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",_l("Tagging failed"),g,e,f)},success:function(e){b.html(e);b.find(".tooltip").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this+".loadAndDisplayAnnotation",b);var d=this.$el.find(".annotation-area"),c=d.find(".annotation-elt"),a=this.urls.annotation.set;if(d.is(":hidden")){if(!jQuery.trim(c.html())){$.ajax({url:this.urls.annotation.get,error:function(){view.log("Annotation failed",xhr,status,error);view.trigger("error",_l("Annotation failed"),xhr,status,error)},success:function(e){if(e===""){e="<em>"+_l("Describe or add notes to dataset")+"</em>"}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){var d=$(window.parent.document).find("iframe#galaxy_main"),c=a+"/scatterplot?"+$.param(b);d.attr("src",c);$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(_l("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.show_modal(_l("View Data in a New or Saved Visualization"),"",{Cancel:function(){f.hide_modal()},"View in saved visualization":function(){f.show_modal(_l("Add Data to Saved Visualization"),e,{Cancel:function(){f.hide_modal()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){var g=$(this).val();c.id=g;f.location=a+"/trackster?"+$.param(c)})}})},"View in new visualization":function(){f.location=a+"/trackster?"+$.param(c)}})}});return false}};
\ No newline at end of file
+var HDAEditView=HDABaseView.extend(LoggableMixin).extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_setUpBehaviors:function(c){HDABaseView.prototype._setUpBehaviors.call(this,c);var a=this,b=this.urls.purge,d=c.find("#historyItemPurger-"+this.model.get("id"));if(d){d.attr("href",["javascript","void(0)"].join(":"));d.click(function(e){var f=jQuery.ajax(b);f.success(function(i,g,h){a.model.set("purged",true);a.trigger("purged",a)});f.error(function(h,g,i){a.trigger("error",_l("Unable to purge this dataset"),h,g,i)})})}},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleButtons:function(){var a=$('<div class="historyItemButtons"></div>');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a=this,b=a.urls["delete"],c={title:_l("Delete"),href:b,id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete",on_click:function(){$.ajax({url:b,type:"POST",error:function(){a.$el.show()},success:function(){a.model.set({deleted:true})}})}};if(this.model.get("deleted")||this.model.get("purged")){c={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(c)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var a=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(a))){this.visualizationsButton=null;return null}if(_.isObject(a[0])){return this._render_visualizationsFrameworkButton(a)}if(!this.urls.visualization){this.visualizationsButton=null;return null}var c=this.model.get("dbkey"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(c){g.dbkey=c}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:this.urls.visualization,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){parent.frame_manager.frame_new({title:"Visualization",type:"url",content:f+"/"+h+"?"+$.param(g)})}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_visualizationsFrameworkButton:function(a){if(!(this.model.hasData())||!(a&&!_.isEmpty(a))){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),icon_class:"chart_curve"})});var c=this.visualizationsButton.render().$el;c.addClass("visualize-icon");if(_.keys(a).length===1){c.attr("title",_.keys(a)[0]);c.attr("href",_.values(a)[0])}else{var d=[];_.each(a,function(e){d.push(e)});var b=new PopupMenu(c,d)}return c},_render_secondaryActionButtons:function(b){var c=$("<div/>"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})).trim())},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('<div class="clear"/>');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayAppArea());this._render_displayApps(a);a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var a=this,d=this.$el.find(".tag-area"),b=d.find(".tag-elt");if(d.is(":hidden")){if(!jQuery.trim(b.html())){$.ajax({url:this.urls.tags.get,error:function(g,e,f){a.log("Tagging failed",g,e,f);a.trigger("error",_l("Tagging failed"),g,e,f)},success:function(e){b.html(e);b.find(".tooltip").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this+".loadAndDisplayAnnotation",b);var d=this.$el.find(".annotation-area"),c=d.find(".annotation-elt"),a=this.urls.annotation.set;if(d.is(":hidden")){if(!jQuery.trim(c.html())){$.ajax({url:this.urls.annotation.get,error:function(){view.log("Annotation failed",xhr,status,error);view.trigger("error",_l("Annotation failed"),xhr,status,error)},success:function(e){if(e===""){e="<em>"+_l("Describe or add notes to dataset")+"</em>"}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){parent.frame_manager.frame_new({title:"Scatterplot",type:"url",content:a+"/scatterplot?"+$.param(b),center:true});$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d["f-dbkey"]=b}$.ajax({url:a+"/list_tracks?"+$.param(d),dataType:"html",error:function(){alert(_l("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.show_modal(_l("View Data in a New or Saved Visualization"),"",{Cancel:function(){f.hide_modal()},"View in saved visualization":function(){f.show_modal(_l("Add Data to Saved Visualization"),e,{Cancel:function(){f.hide_modal()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){var g=$(this).val();c.id=g;f.hide_modal();f.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})})}})},"View in new visualization":function(){f.hide_modal();f.frame_manager.frame_new({title:"Trackster",type:"url",content:a+"/trackster?"+$.param(c)})}})}});return false}};
\ No newline at end of file
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 static/scripts/packed/mvc/visualizations/scatterplotControlForm.js
--- a/static/scripts/packed/mvc/visualizations/scatterplotControlForm.js
+++ b/static/scripts/packed/mvc/visualizations/scatterplotControlForm.js
@@ -1,1 +1,1 @@
-var ScatterplotControlForm=BaseView.extend(LoggableMixin).extend({className:"scatterplot-control-form",dataLoadDelay:4000,dataLoadSize:5000,loadingIndicatorImage:"loading_small_white_bg.gif",fetchMsg:"Fetching data...",renderMsg:"Rendering...",initialize:function(a){this.log(this+".initialize, attributes:",a);this.dataset=null;this.chartConfig=null;this.chart=null;this.loader=null;this.$dataControl=null;this.$chartControl=null;this.$statsDisplay=null;this.$chartDisplay=null;this.dataFetch=null;this.initializeFromAttributes(a);this.initializeChart(a);this.initializeDataLoader(a)},initializeFromAttributes:function(a){if(!a||!a.dataset){throw ("ScatterplotView requires a dataset")}else{this.dataset=a.dataset}if(jQuery.type(this.dataset.metadata_column_types)==="string"){this.dataset.metadata_column_types=this.dataset.metadata_column_types.split(", ")}this.log("\t dataset:",this.dataset);if(this.dataset.comment_lines&&this.dataset.comment_lines.length){var b=this.dataset.comment_lines[0],c=b.split("\t");if(c.length===this.dataset.metadata_column_types.length){this.possibleHeaders=c}}if(!a.apiDatasetsURL){throw ("ScatterplotView requires a apiDatasetsURL")}else{this.dataURL=a.apiDatasetsURL+"/"+this.dataset.id+"?"}this.log("\t dataURL:",this.dataURL)},initializeChart:function(a){this.chartConfig=a.chartConfig||{};this.log("\t initial chartConfig:",this.chartConfig);this.chart=new TwoVarScatterplot(this.chartConfig);this.chartConfig=this.chart.config},initializeDataLoader:function(b){var a=this;this.loader=new LazyDataLoader({url:null,start:b.start||0,total:b.total||this.dataset.metadata_data_lines,delay:this.dataLoadDelay,size:this.dataLoadSize,buildUrl:function(d,c){return this.url+"&"+jQuery.param({start_val:d,max_vals:c})}});$(this.loader).bind("error",function(e,c,d){a.log("ERROR:",c,d);alert("ERROR fetching data:\n"+c+"\n"+d);a.hideLoadingIndicator()})},render:function(){this.log(this+".render");this.$el.append(ScatterplotControlForm.templates.mainLayout({loadingIndicatorImagePath:galaxy_paths.get("image_path")+"/"+this.loadingIndicatorImage,message:""}));this.$dataControl=this._render_dataControl();this.$chartControl=this._render_chartControl();this.$statsDisplay=this.$el.find(".tab-pane#stats-display");this.$chartDisplay=this._render_chartDisplay();if(this.chartConfig.xColumn&&this.chartConfig.yColumn){this.renderChart()}this.$el.find(".tooltip").tooltip();return this},_render_dataControl:function(){var b=this,a=[],e=[],c=(this.possibleHeaders&&this.$dataControl)?(this.$dataControl.find("#first-line-header-checkbox").is(":checked")):(false);_.each(this.dataset.metadata_column_types,function(i,g){var h=g+1,f="column "+h;if(b.dataset.metadata_column_names){f=b.dataset.metadata_column_names[g]}else{if(c){f=b.possibleHeaders[g]}}a.push({index:h,name:f});if(i==="int"||i==="float"){e.push({index:h,name:f})}});var d=this.$el.find(".tab-pane#data-control");d.html(ScatterplotControlForm.templates.dataControl({allColumns:a,numericColumns:e,possibleHeaders:(this.possibleHeaders)?(this.possibleHeaders.join(", ")):(""),usePossibleHeaders:c}));if(!this.dataset.metadata_column_names&&this.possibleHeaders){d.find("#first-line-header").show()}d.find("#X-select").val(this.chartConfig.xColumn);d.find("#Y-select").val(this.chartConfig.yColumn);if(this.chartConfig.idColumn!==undefined){d.find("#include-id-checkbox").attr("checked",true).trigger("change");d.find("#ID-select").val(this.chartConfig.idColumn)}return d},_render_chartControl:function(){var a=this,b=this.$el.find(".tab-pane#chart-control"),c={datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,step:20},height:{min:200,max:800,step:20}};b.append(ScatterplotControlForm.templates.chartControl(this.chartConfig));b.find(".numeric-slider-input").each(function(){var f=$(this),e=f.find(".slider-output"),g=f.find(".slider"),h=f.attr("id");function d(){var j=$(this),i=j.slider("value");e.text(i)}g.slider(_.extend(c[h],{value:a.chartConfig[h],change:d,slide:d}))});return b},_render_chartDisplay:function(){var a=this.$el.find(".tab-pane#chart-display");a.append(ScatterplotControlForm.templates.chartDisplay(this.chartConfig));return a},events:{"change #include-id-checkbox":"toggleThirdColumnSelector","change #first-line-header-checkbox":"rerenderDataControl","click #data-control #render-button":"renderChart","click #chart-control #render-button":"changeChartSettings"},toggleThirdColumnSelector:function(){this.$el.find('select[name="ID"]').parent().toggle()},rerenderDataControl:function(){this.$dataControl=this._render_dataControl()},showLoadingIndicator:function(b,c){b=b||"";var a=this.$el.find("div#loading-indicator");messageBox=a.find(".loading-message");if(a.is(":visible")){if(b){messageBox.fadeOut("fast",function(){messageBox.text(b);messageBox.fadeIn("fast",c)})}else{c()}}else{if(b){messageBox.text(b)}a.fadeIn("fast",c)}},hideLoadingIndicator:function(a){this.$el.find("div#loading-indicator").fadeOut("fast",a)},renderChart:function(){this.log(this+".renderChart");this.data=null;this.meta=null;_.extend(this.chartConfig,this.getChartSettings());this.log("\t chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);this.loader.url=this.dataURL+"&"+jQuery.param(this.getDataSettings());this.log("\t loader: total lines:",this.loader.total," url:",this.loader.url);var a=this;$(this.loader).bind("loaded.new",function(c,b){a.log(a+" loaded.new",b);a.postProcessDataFetchResponse(b);a.log("\t postprocessed data:",a.data);a.log("\t postprocessed meta:",a.meta);a.showLoadingIndicator(a.renderMsg,function(){a.chart.render(a.data,a.meta);a.renderStats(a.data,a.meta);a.hideLoadingIndicator()})});$(this.loader).bind("complete",function(b,c){a.log(a+" complete",c);$(a.loader).unbind()});a.showLoadingIndicator(a.fetchMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.loader.load()})},renderStats:function(){this.log(this+".renderStats");this.$statsDisplay.html(ScatterplotControlForm.templates.statsDisplay({stats:[{name:"Count",xval:this.meta[0].count,yval:this.meta[1].count},{name:"Min",xval:this.meta[0].min,yval:this.meta[1].min},{name:"Max",xval:this.meta[0].max,yval:this.meta[1].max},{name:"Sum",xval:this.meta[0].sum,yval:this.meta[1].sum},{name:"Mean",xval:this.meta[0].mean,yval:this.meta[1].mean},{name:"Median",xval:this.meta[0].median,yval:this.meta[1].median}]}))},changeChartSettings:function(){var a=this;newChartSettings=this.getChartSettings();_.extend(this.chartConfig,newChartSettings);this.log("this.chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);if(a.data&&a.meta){a.showLoadingIndicator(a.renderMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.chart.render(a.data,a.meta);a.hideLoadingIndicator()})}else{this.renderChart()}},postProcessDataFetchResponse:function(a){this.postProcessData(a.data);this.postProcessMeta(a.meta)},postProcessData:function(b){var a=this;if(a.data){_.each(b,function(d,c){a.data[c]=a.data[c].concat(d)})}else{a.data=b}},postProcessMeta:function(c){var a=this,b=this.dataset.metadata_column_types;if(a.meta){_.each(c,function(e,d){var i=a.meta[d],g=b[d];i.count+=(e.count)?(e.count):(0);if((g==="int")||(g==="float")){i.min=Math.min(e.min,i.min);i.max=Math.max(e.max,i.max);i.sum=e.sum+i.sum;i.mean=(i.count)?(i.sum/i.count):(null);var f=a.data[d].slice().sort(),h=Math.floor(f.length/2);if(f.length%2===0){i.median=((f[h]+f[(h+1)])/2)}else{i.median=f[h]}}})}else{a.meta=c}},getDataSettings:function(){var b=this.getColumnSelections(),a=[];this.log("\t columnSelections:",b);a=[b.X.colIndex-1,b.Y.colIndex-1];if(this.$dataControl.find("#include-id-checkbox").attr("checked")){a.push(b.ID.colIndex-1)}var c={data_type:"raw_data",provider:"column",columns:"["+a+"]"};this.log("\t data settings (url params):",c);return c},getColumnSelections:function(){var a={};this.$dataControl.find("div.column-select select").each(function(){var b=$(this),c=b.val();a[b.attr("name")]={colIndex:c,colName:b.children('[value="'+c+'"]').text()}});return a},getChartSettings:function(){var c={},d=this.getColumnSelections();c.datapointSize=this.$chartControl.find("#datapointSize.numeric-slider-input").find(".slider").slider("value");c.width=this.$chartControl.find("#width.numeric-slider-input").find(".slider").slider("value");c.height=this.$chartControl.find("#height.numeric-slider-input").find(".slider").slider("value");var b=this.$chartControl.find("input#X-axis-label").val(),a=this.$chartControl.find("input#Y-axis-label").val();c.xLabel=(b==="X")?(d.X.colName):(b);c.yLabel=(a==="Y")?(d.Y.colName):(a);c.animDuration=(this.$chartControl.find("#animate-chart").is(":checked"))?(this.chart.defaults.animDuration):(0);this.log("\t chartSettings:",c);return c},toString:function(){return"ScatterplotControlForm("+((this.dataset)?(this.dataset.id):(""))+")"}});ScatterplotControlForm.templates={mainLayout:Handlebars.templates["template-visualization-scatterplotControlForm"],dataControl:Handlebars.templates["template-visualization-dataControl"],chartControl:Handlebars.templates["template-visualization-chartControl"],statsDisplay:Handlebars.templates["template-visualization-statsDisplay"],chartDisplay:Handlebars.templates["template-visualization-chartDisplay"]};
\ No newline at end of file
+var ScatterplotControlForm=BaseView.extend(LoggableMixin).extend({className:"scatterplot-control-form",dataLoadDelay:4000,dataLoadSize:5000,loadingIndicatorImage:"loading_small_white_bg.gif",fetchMsg:"Fetching data...",renderMsg:"Rendering...",initialize:function(a){this.log(this+".initialize, attributes:",a);this.dataset=null;this.chartConfig=null;this.chart=null;this.loader=null;this.$dataControl=null;this.$chartControl=null;this.$statsDisplay=null;this.$chartDisplay=null;this.dataFetch=null;this.initializeFromAttributes(a);this.initializeChart(a);this.initializeDataLoader(a)},initializeFromAttributes:function(a){if(!a||!a.dataset){throw ("ScatterplotView requires a dataset")}else{this.dataset=a.dataset}if(jQuery.type(this.dataset.metadata_column_types)==="string"){this.dataset.metadata_column_types=this.dataset.metadata_column_types.split(", ")}this.log("\t dataset:",this.dataset);if(this.dataset.comment_lines&&this.dataset.comment_lines.length){var b=this.dataset.comment_lines[0],c=b.split("\t");if(c.length===this.dataset.metadata_column_types.length){this.possibleHeaders=c}}if(!a.apiDatasetsURL){throw ("ScatterplotView requires a apiDatasetsURL")}else{this.dataURL=a.apiDatasetsURL+"/"+this.dataset.id+"?"}this.log("\t dataURL:",this.dataURL)},initializeChart:function(a){this.chartConfig=a.chartConfig||{};this.log("\t initial chartConfig:",this.chartConfig);this.chart=new TwoVarScatterplot(this.chartConfig);this.chartConfig=this.chart.config},initializeDataLoader:function(b){var a=this;this.loader=new LazyDataLoader({url:null,start:b.start||0,total:b.total||this.dataset.metadata_data_lines,delay:this.dataLoadDelay,size:this.dataLoadSize,buildUrl:function(d,c){return this.url+"&"+jQuery.param({start_val:d,max_vals:c})}});$(this.loader).bind("error",function(e,c,d){a.log("ERROR:",c,d);alert("ERROR fetching data:\n"+c+"\n"+d);a.hideLoadingIndicator()})},render:function(){this.log(this+".render");this.$el.append(ScatterplotControlForm.templates.mainLayout({loadingIndicatorImagePath:galaxy_paths.get("image_path")+"/"+this.loadingIndicatorImage,message:""}));this.$dataControl=this._render_dataControl();this.$chartControl=this._render_chartControl();this.$statsDisplay=this.$el.find(".tab-pane#stats-display");this.$chartDisplay=this._render_chartDisplay();if(this.chartConfig.xColumn&&this.chartConfig.yColumn){this.renderChart()}this.$el.find(".tooltip").tooltip();return this},_render_dataControl:function(){var b=this,a=[],e=[],c=(this.possibleHeaders&&this.$dataControl)?(this.$dataControl.find("#first-line-header-checkbox").is(":checked")):(false);_.each(this.dataset.metadata_column_types,function(i,g){var h=g+1,f="column "+h;if(b.dataset.metadata_column_names){f=b.dataset.metadata_column_names[g]}else{if(c){f=b.possibleHeaders[g]}}a.push({index:h,name:f});if(i==="int"||i==="float"){e.push({index:h,name:f})}});var d=this.$el.find(".tab-pane#data-control");d.html(ScatterplotControlForm.templates.dataControl({allColumns:a,numericColumns:e,possibleHeaders:(this.possibleHeaders)?(this.possibleHeaders.join(", ")):(""),usePossibleHeaders:c}));if(!this.dataset.metadata_column_names&&this.possibleHeaders){d.find("#first-line-header").show()}d.find("#X-select").val(this.chartConfig.xColumn);d.find("#Y-select").val(this.chartConfig.yColumn);if(this.chartConfig.idColumn!==undefined){d.find("#include-id-checkbox").attr("checked",true).trigger("change");d.find("#ID-select").val(this.chartConfig.idColumn)}return d},_render_chartControl:function(){var a=this,b=this.$el.find(".tab-pane#chart-control"),c={datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,step:20},height:{min:200,max:800,step:20}};b.append(ScatterplotControlForm.templates.chartControl(this.chartConfig));b.find(".numeric-slider-input").each(function(){var f=$(this),e=f.find(".slider-output"),g=f.find(".slider"),h=f.attr("id");function d(){var j=$(this),i=j.slider("value");e.text(i)}g.slider(_.extend(c[h],{value:a.chartConfig[h],change:d,slide:d}))});return b},_render_chartDisplay:function(){var a=this.$el.find(".tab-pane#chart-display");a.append(ScatterplotControlForm.templates.chartDisplay(this.chartConfig));return a},events:{"change #include-id-checkbox":"toggleThirdColumnSelector","change #first-line-header-checkbox":"rerenderDataControl","click #data-control #render-button":"renderChart","click #chart-control #render-button":"changeChartSettings"},toggleThirdColumnSelector:function(){this.$el.find('select[name="ID"]').parent().toggle()},rerenderDataControl:function(){this.$dataControl=this._render_dataControl()},showLoadingIndicator:function(b,c){b=b||"";var a=this.$el.find("div#loading-indicator");messageBox=a.find(".loading-message");if(a.is(":visible")){if(b){messageBox.fadeOut("fast",function(){messageBox.text(b);messageBox.fadeIn("fast",c)})}else{c()}}else{if(b){messageBox.text(b)}a.fadeIn("fast",c)}},hideLoadingIndicator:function(a){this.$el.find("div#loading-indicator").fadeOut("fast",a)},renderChart:function(){this.log(this+".renderChart");this.data=null;this.meta=null;_.extend(this.chartConfig,this.getChartSettings());this.log("\t chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);this.loader.url=this.dataURL+"&"+jQuery.param(this.getDataSettings());this.log("\t loader: total lines:",this.loader.total," url:",this.loader.url);var a=this;$(this.loader).bind("loaded.new",function(c,b){a.log(a+" loaded.new",b);a.postProcessDataFetchResponse(b);a.log("\t postprocessed data:",a.data);a.log("\t postprocessed meta:",a.meta);a.showLoadingIndicator(a.renderMsg,function(){a.chart.render(a.data,a.meta);a.renderStats(a.data,a.meta);a.hideLoadingIndicator()})});$(this.loader).bind("complete",function(b,c){a.log(a+" complete",c);$(a.loader).unbind()});a.showLoadingIndicator(a.fetchMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.loader.load()})},renderStats:function(){this.log(this+".renderStats");this.$statsDisplay.html(ScatterplotControlForm.templates.statsDisplay({stats:[{name:"Count",xval:this.meta[0].count,yval:this.meta[1].count},{name:"Min",xval:this.meta[0].min,yval:this.meta[1].min},{name:"Max",xval:this.meta[0].max,yval:this.meta[1].max},{name:"Sum",xval:this.meta[0].sum,yval:this.meta[1].sum},{name:"Mean",xval:this.meta[0].mean,yval:this.meta[1].mean},{name:"Median",xval:this.meta[0].median,yval:this.meta[1].median}]}))},changeChartSettings:function(){var a=this;newChartSettings=this.getChartSettings();_.extend(this.chartConfig,newChartSettings);this.log("this.chartConfig:",this.chartConfig);this.chart.updateConfig(this.chartConfig,false);if(a.data&&a.meta){a.showLoadingIndicator(a.renderMsg,function(){a.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show");a.chart.render(a.data,a.meta);a.hideLoadingIndicator()})}else{this.renderChart()}},postProcessDataFetchResponse:function(a){this.postProcessData(a.data);this.postProcessMeta(a.meta)},postProcessData:function(b){var a=this;if(a.data){_.each(b,function(d,c){a.data[c]=a.data[c].concat(d)})}else{a.data=b}},postProcessMeta:function(c){var a=this,b=this.dataset.metadata_column_types;if(a.meta){_.each(c,function(e,d){var i=a.meta[d],g=b[d];i.count+=(e.count)?(e.count):(0);if((g==="int")||(g==="float")){i.min=Math.min(e.min,i.min);i.max=Math.max(e.max,i.max);i.sum=e.sum+i.sum;i.mean=(i.count)?(i.sum/i.count):(null);var f=a.data[d].slice().sort(),h=Math.floor(f.length/2);if(f.length%2===0){i.median=((f[h]+f[(h+1)])/2)}else{i.median=f[h]}}})}else{a.meta=c}},getDataSettings:function(){var b=this.getColumnSelections(),a=[];this.log("\t columnSelections:",b);a=[b.X.colIndex-1,b.Y.colIndex-1];if(this.$dataControl.find("#include-id-checkbox").attr("checked")){a.push(b.ID.colIndex-1)}var c={data_type:"raw_data",provider:"column_with_stats",columns:"["+a+"]"};this.log("\t data settings (url params):",c);return c},getColumnSelections:function(){var a={};this.$dataControl.find("div.column-select select").each(function(){var b=$(this),c=b.val();a[b.attr("name")]={colIndex:c,colName:b.children('[value="'+c+'"]').text()}});return a},getChartSettings:function(){var c={},d=this.getColumnSelections();c.datapointSize=this.$chartControl.find("#datapointSize.numeric-slider-input").find(".slider").slider("value");c.width=this.$chartControl.find("#width.numeric-slider-input").find(".slider").slider("value");c.height=this.$chartControl.find("#height.numeric-slider-input").find(".slider").slider("value");var b=this.$chartControl.find("input#X-axis-label").val(),a=this.$chartControl.find("input#Y-axis-label").val();c.xLabel=(b==="X")?(d.X.colName):(b);c.yLabel=(a==="Y")?(d.Y.colName):(a);c.animDuration=(this.$chartControl.find("#animate-chart").is(":checked"))?(this.chart.defaults.animDuration):(0);this.log("\t chartSettings:",c);return c},toString:function(){return"ScatterplotControlForm("+((this.dataset)?(this.dataset.id):(""))+")"}});ScatterplotControlForm.templates={mainLayout:Handlebars.templates["template-visualization-scatterplotControlForm"],dataControl:Handlebars.templates["template-visualization-dataControl"],chartControl:Handlebars.templates["template-visualization-chartControl"],statsDisplay:Handlebars.templates["template-visualization-statsDisplay"],chartDisplay:Handlebars.templates["template-visualization-chartDisplay"]};
\ No newline at end of file
diff -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba -r 72b02995c8b188b8efe9b3ac4c5996e972e596f1 visualizations_conf.xml.sample
--- a/visualizations_conf.xml.sample
+++ b/visualizations_conf.xml.sample
@@ -84,30 +84,30 @@
(e.g. hda_ldda can be 'hda' or 'ldda' and modifies/informs dataset_id to fetch an HDA or LDDA)
--><!ELEMENT param (#PCDATA)>
- <!-- param tells the registry how to parse the query string param back into a resource/data_source.
- For example, if a query string has "dataset_id=NNN" and the type is 'dataset', the registry
- will attempt to fetch the hda with id of NNN from the database and pass it to the template.
- (text): the query string param key this source will be parsed from (e.g. dataset_id)
- REQUIRED
- type: the type of the resource.
- Can be: str (DEFAULT), bool, int, float, json, visualization, dbkey, dataset, or hda_ldda.
- default: if a param is not passed on the query string (and is not required) OR the given param
- fails to parse, this value is used instead.
- DEFAULT: None
- required: set this to true if the param is required for the template. Rendering will with an error
- if the param hasn't been sent.
- DEFAULT: false
- csv: set this to true if the param is a comma separated list. The registry will attempt to
- parse each value as the given type and send the result as a list to the template.
- DEFAULT: false
- constrain_to: (currently unused) constain a param to a set of values, error if not valid.
- DEFAULT: don't constrain
- var_name_in_template: a new name for the resource/variable to use in the template. E.g. an initial
- query string param key might be 'dataset_id' in the URL, the registry parses it into an HDA,
- and if var_name_in_template is set to 'hda', the template will be able to access the HDA
- with the variable name 'hda' (as in hda.title).
- DEFAULT: keep the original query string name
- -->
+ <!-- param tells the registry how to parse the query string param back into a resource/data_source.
+ For example, if a query string has "dataset_id=NNN" and the type is 'dataset', the registry
+ will attempt to fetch the hda with id of NNN from the database and pass it to the template.
+ (text): the query string param key this source will be parsed from (e.g. dataset_id)
+ REQUIRED
+ type: the type of the resource.
+ Can be: str (DEFAULT), bool, int, float, json, visualization, dbkey, dataset, or hda_ldda.
+ default: if a param is not passed on the query string (and is not required) OR the given param
+ fails to parse, this value is used instead.
+ DEFAULT: None
+ required: set this to true if the param is required for the template. Rendering will with an error
+ if the param hasn't been sent.
+ DEFAULT: false
+ csv: set this to true if the param is a comma separated list. The registry will attempt to
+ parse each value as the given type and send the result as a list to the template.
+ DEFAULT: false
+ constrain_to: (currently unused) constain a param to a set of values, error if not valid.
+ DEFAULT: don't constrain
+ var_name_in_template: a new name for the resource/variable to use in the template. E.g. an initial
+ query string param key might be 'dataset_id' in the URL, the registry parses it into an HDA,
+ and if var_name_in_template is set to 'hda', the template will be able to access the HDA
+ with the variable name 'hda' (as in hda.title).
+ DEFAULT: keep the original query string name
+ --><!ATTLIST param
type CDATA #IMPLIED
default CDATA #IMPLIED
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8ea772733c97/
Changeset: 8ea772733c97
User: guerler
Date: 2013-06-24 19:47:06
Summary: Update: Scratchbook
Affected #: 3 files
diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba static/scripts/galaxy.frame.js
--- a/static/scripts/galaxy.frame.js
+++ b/static/scripts/galaxy.frame.js
@@ -735,7 +735,6 @@
// untoggle
$(".galaxy-frame-active .icon").removeClass("f-toggle");
-
} else {
// activate
this.active = true;
@@ -1034,7 +1033,7 @@
'<div class="number f-corner">0</div>' +
'<div class="icon fa-icon-2x"></div>' +
'</div>'+
- '<div title="Enable/Disable Scratchbook Viewer" class="galaxy-frame-active f-corner">' +
+ '<div class="galaxy-frame-active f-corner">' +
'<div class="icon fa-icon-2x fa-icon-th"></div>' +
'</div>';
},
diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -239,8 +239,25 @@
* @returns {jQuery} rendered DOM
*/
_render_visualizationsButton : function(){
+ var visualizations = this.model.get( 'visualizations' );
+ if( ( !this.model.hasData() )
+ || ( _.isEmpty( visualizations ) ) ){
+ this.visualizationsButton = null;
+ return null;
+ }
+
+ //TODO: this is a bridge to allow the framework to be switched off
+ // remove this fn and use the other when fully integrated
+ if( _.isObject( visualizations[0] ) ){
+ return this._render_visualizationsFrameworkButton( visualizations );
+ }
+
+ if( !this.urls.visualization ){
+ this.visualizationsButton = null;
+ return null;
+ }
+
var dbkey = this.model.get( 'dbkey' ),
- visualizations = this.model.get( 'visualizations' ),
visualization_url = this.urls.visualization,
popup_menu_dict = {},
params = {
@@ -250,17 +267,10 @@
// Add dbkey to params if it exists.
if( dbkey ){ params.dbkey = dbkey; }
- if( !( this.model.hasData() )
- || !( visualizations && visualizations.length )
- || !( visualization_url ) ){
- this.visualizationsButton = null;
- return null;
- }
-
// render the icon from template
this.visualizationsButton = new IconButtonView({ model : new IconButton({
title : _l( 'Visualize' ),
- href : visualization_url,
+ href : this.urls.visualization,
icon_class : 'chart_curve'
})});
var $icon = this.visualizationsButton.render().$el;
@@ -278,15 +288,14 @@
case 'scatterplot':
return create_scatterplot_action_fn( visualization_url, params );
default:
- return function(){
- // add widget
+ return function(){// add widget
parent.frame_manager.frame_new(
{
title : "Visualization",
type : "url",
content : visualization_url + '/' + visualization + '?' + $.param( params )
});
- };
+ };
}
}
@@ -306,6 +315,40 @@
}
return $icon;
},
+
+ /** Render an icon-button or popupmenu of links based on the applicable visualizations
+ * @returns {jQuery} rendered DOM
+ */
+ _render_visualizationsFrameworkButton : function( visualizations ){
+ if( !( this.model.hasData() )
+ || !( visualizations && !_.isEmpty( visualizations ) ) ){
+ this.visualizationsButton = null;
+ return null;
+ }
+
+ // render the icon from template
+ this.visualizationsButton = new IconButtonView({ model : new IconButton({
+ title : _l( 'Visualize' ),
+ icon_class : 'chart_curve'
+ })});
+ var $icon = this.visualizationsButton.render().$el;
+ $icon.addClass( 'visualize-icon' ); // needed?
+
+ // No need for popup menu because there's a single visualization.
+ if( _.keys( visualizations ).length === 1 ) {
+ $icon.attr( 'title', _.keys( visualizations )[0] );
+ $icon.attr( 'href', _.values( visualizations )[0] );
+
+ // >1: Populate menu dict with visualization fns, make the popupmenu
+ } else {
+ var popup_menu_options = [];
+ _.each( visualizations, function( linkData ) {
+ popup_menu_options.push( linkData );
+ });
+ var popup = new PopupMenu( $icon, popup_menu_options );
+ }
+ return $icon;
+ },
// ......................................................................... secondary actions
/** Render secondary actions: currently tagging and annotation (if user is allowed).
@@ -567,7 +610,6 @@
//TODO: should be imported from scatterplot.js OR abstracted to 'load this in the galaxy_main frame'
function create_scatterplot_action_fn( url, params ){
action = function() {
-
// add widget
parent.frame_manager.frame_new(
{
@@ -657,4 +699,4 @@
//==============================================================================
//return {
// HDAView : HDAView,
-//};});
+//};});
\ No newline at end of file
diff -r a27c1c3a628bc0167981865b82442fc790bd8406 -r 8ea772733c979a4d5578ba4c8c31dd3f47cc32ba templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -150,7 +150,7 @@
[_('New Track Browser'), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});"],
[_('Saved Visualizations'), "javascript:frame_manager.frame_new({ type: 'url', content : '/visualization/list'});" ]
]
- tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});", menu_options=menu_options )
+ tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/list'});", menu_options=menu_options )
%>
## Cloud menu.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Galaxy Scratchbook plugin. Allows to display multiple Trackster visualization on a single page.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a27c1c3a628b/
Changeset: a27c1c3a628b
User: guerler
Date: 2013-06-24 18:23:56
Summary: Galaxy Scratchbook plugin. Allows to display multiple Trackster visualization on a single page.
Affected #: 10 files
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/scripts/galaxy.frame.js
--- /dev/null
+++ b/static/scripts/galaxy.frame.js
@@ -0,0 +1,1055 @@
+/*
+ galaxy frames v2.0
+*/
+
+// dependencies
+define(["utils/galaxy.css", "libs/backbone/backbone-relational"], function(css) {
+
+// load required css files
+css.load_file("/static/style/galaxy.frame.css");
+css.load_file("/static/style/base.css");
+
+// frame manager
+var GalaxyFrameManager = Backbone.View.extend(
+{
+ // base element
+ el: '#everything',
+
+ // master head
+ el_header : '#masthead',
+
+ // defaults inputs
+ options:
+ {
+ // default frame size
+ frame:
+ {
+ cols : 6,
+ rows : 3
+ },
+
+ // maximum number of rows
+ rows: 1000,
+
+ // cell size in px
+ cell: 130,
+
+ // margin
+ margin: 5,
+
+ // scroll speed
+ scroll: 5,
+
+ // minimum top
+ top_min: 40,
+
+ // maximum number of frames
+ frame_max: 10
+ },
+
+ // number of columns
+ cols: 0,
+
+ // scroll/element top
+ top: 0,
+
+ // maximum viewport
+ top_max: 0,
+
+ // frame counter
+ frame_counter: 0,
+
+ // frame counter
+ frame_counter_id: 0,
+
+ // frame list
+ frame_list: [],
+
+ // frame shadow
+ galaxy_frame_shadow: null,
+
+ // frame panel visible
+ visible: false,
+
+ // frame active/disabled
+ active: false,
+
+ // initialize
+ initialize : function(options)
+ {
+ // read in defaults
+ if (options)
+ this.options = _.defaults(options, this.options);
+
+ // initialize top
+ this.top = this.top_max = this.options.top_min;
+
+ // load background
+ $(this.el).append(this.frame_template_background());
+
+ // load menu buttons
+ $(this.el).append(this.frame_template_menu());
+
+ // load load button
+ $(this.el_header).append(this.frame_template_load());
+
+ //
+ // define shadow frame
+ //
+ var id_shadow = '#galaxy-frame-shadow';
+
+ // add shadow template
+ $(this.el).append(this.frame_template_shadow(id_shadow.substring(1)));
+
+ // initialize frame
+ this.galaxy_frame_shadow = {
+ id : id_shadow,
+ screen_location : {},
+ grid_location : {},
+ grid_rank : null,
+ grid_lock : false
+ };
+
+ // initialize size
+ this.frame_resize(this.galaxy_frame_shadow, {width: 0, height: 0});
+
+ // add shadow to frame list
+ this.frame_list[id_shadow] = this.galaxy_frame_shadow;
+
+ // initialize panel
+ this.panel_refresh();
+
+ // link events
+ this.event_initialize();
+
+ // catch window resize event
+ var self = this;
+ $(window).resize(function ()
+ {
+ self.panel_refresh();
+ });
+
+ // catch window close
+ window.onbeforeunload = function()
+ {
+ if (self.frame_counter > 0)
+ return "You opened " + self.frame_counter + " frame(s) which will be lost.";
+ };
+ },
+
+ // check for mobile devices
+ is_mobile: function()
+ {
+ return navigator.userAgent.match(/mobile|(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i);
+ },
+
+ /*
+ EVENT HANDLING
+ */
+
+ // event
+ event:
+ {
+ type : null,
+ target : null,
+ xy : null
+ },
+
+ // events
+ event_initialize: function()
+ {
+ /*if (!this.is_mobile())
+ {*/
+ this.events = {
+ 'mousedown' : 'event_frame_mouse_down',
+ 'mousedown .f-close' : 'event_frame_close',
+ 'mousedown .f-pin' : 'event_frame_lock',
+ 'mousemove' : 'event_frame_mouse_move',
+ 'mouseup' : 'event_frame_mouse_up',
+ 'mouseleave' : 'event_frame_mouse_up',
+ 'mousedown .galaxy-frame-active' : 'event_panel_active',
+ 'mousedown .galaxy-frame-load' : 'event_panel_load',
+ 'mousedown .galaxy-frame-background' : 'event_panel_load',
+ 'mousewheel' : 'event_panel_scroll',
+ 'DOMMouseScroll' : 'event_panel_scroll',
+ 'mousedown .galaxy-frame-scroll-up' : 'event_panel_scroll_up',
+ 'mousedown .galaxy-frame-scroll-down' : 'event_panel_scroll_down'
+ };
+ /*} else {
+ this.events = {
+ 'touchstart' : 'event_frame_mouse_down',
+ 'touchstart .f-close' : 'event_frame_close',
+ 'touchstart .f-pin' : 'event_frame_lock',
+ 'touchmove' : 'event_frame_mouse_move',
+ 'touchend' : 'event_frame_mouse_up',
+ 'touchleave' : 'event_mouse_up',
+ 'touchstart .galaxy-frame-load' : 'event_frame_load'
+ };
+ };*/
+
+ // delegate
+ this.delegateEvents(this.events);
+ },
+
+ // drag start
+ event_frame_mouse_down: function (e)
+ {
+ // prevent text selection
+ e.preventDefault();
+
+ // skip if event is already active
+ if (this.event.type !== null)
+ return;
+
+ // check for drag event
+ if ($(e.target).hasClass('f-header') ||
+ $(e.target).hasClass('f-title'))
+ this.event.type = 'drag';
+
+ // check for resize event
+ if ($(e.target).hasClass('f-resize'))
+ this.event.type = 'resize';
+
+ // skip if no event has to be handled
+ if (this.event.type === null)
+ return;
+
+ // identify frame
+ this.event.target = this.event_get_frame(e.target);
+
+ // check if frame is locked
+ if (this.event.target.grid_lock)
+ {
+ this.event.type = null;
+ return;
+ }
+
+ // backup event details
+ this.event.xy = {x: e.originalEvent.pageX, y: e.originalEvent.pageY};
+
+ // prepare drag/resize
+ this.frame_drag_start(this.event.target);
+ },
+
+ // mouse move event
+ event_frame_mouse_move: function (e)
+ {
+ // check
+ if (this.event.type != 'drag' && this.event.type != 'resize')
+ return;
+
+ // current position
+ var event_xy_new = {x: e.originalEvent.pageX , y: e.originalEvent.pageY};
+
+ // position delta
+ var event_xy_delta =
+ {
+ x : event_xy_new.x - this.event.xy.x,
+ y : event_xy_new.y - this.event.xy.y
+ };
+
+ // update
+ this.event.xy = event_xy_new;
+
+ // object position / size
+ var p = this.frame_screen (this.event.target);
+
+ // resize event
+ if (this.event.type == 'resize')
+ {
+ // update
+ p.width += event_xy_delta.x;
+ p.height += event_xy_delta.y;
+
+ // check size
+ var min_dim = this.options.cell - this.options.margin - 1;
+ p.width = Math.max(p.width, min_dim);
+ p.height = Math.max(p.height, min_dim);
+
+ // apply resize to frame
+ this.frame_resize(this.event.target, p);
+
+ // break down to grid coordinates
+ p.width = this.to_grid_coord('width', p.width) + 1;
+ p.height = this.to_grid_coord('height', p.height) + 1;
+
+ // transfer back to pixels
+ p.width = this.to_pixel_coord('width', p.width);
+ p.height = this.to_pixel_coord('height', p.height);
+
+ // apply
+ this.frame_resize(this.galaxy_frame_shadow, p);
+
+ // fix position
+ this.frame_insert(this.galaxy_frame_shadow, {
+ top : this.to_grid_coord('top', p.top),
+ left : this.to_grid_coord('left', p.left)
+ });
+ }
+
+ // drag event
+ if (this.event.type == 'drag')
+ {
+ // update
+ p.left += event_xy_delta.x;
+ p.top += event_xy_delta.y;
+
+ // apply
+ this.frame_offset(this.event.target, p);
+
+ // get location of shadow
+ var l = {
+ top : this.to_grid_coord('top', p.top),
+ left : this.to_grid_coord('left', p.left)
+ };
+
+ // increase priority of current frame
+ if (l.left !== 0)
+ l.left++;
+
+ // fix position
+ this.frame_insert(this.galaxy_frame_shadow, l);
+ }
+ },
+
+ // mouse up
+ event_frame_mouse_up: function (e)
+ {
+ // check
+ if (this.event.type != 'drag' && this.event.type != 'resize')
+ return;
+
+ // stop
+ this.frame_drag_stop(this.event.target);
+
+ // reset event
+ this.event.type = null;
+ },
+
+ // drag start
+ event_frame_close: function (e)
+ {
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // get frame
+ var frame = this.event_get_frame(e.target);
+ var self = this;
+
+ // fade out
+ $(frame.id).fadeOut('fast', function()
+ {
+ // remove element
+ $(frame.id).remove();
+
+ // remove from dictionary
+ delete self.frame_list[frame.id];
+
+ // reduce frame counter
+ self.frame_counter--;
+
+ // reload
+ self.panel_refresh(true);
+
+ // refresh scroll state once all animations completed
+ self.panel_animation_complete();
+
+ // hide if no frames left
+ if (self.visible && self.frame_counter == 0)
+ self.panel_show_hide();
+ });
+ },
+
+ // drag start
+ event_frame_lock: function (e)
+ {
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // get frame
+ var frame = this.event_get_frame(e.target);
+
+ // check
+ if (frame.grid_lock)
+ {
+ // unlock
+ frame.grid_lock = false;
+
+ // remove class
+ $(frame.id).find('.f-pin').removeClass('f-toggle');
+ $(frame.id).find('.f-header').removeClass('f-not-allowed');
+ $(frame.id).find('.f-title').removeClass('f-not-allowed');
+ $(frame.id).find('.f-resize').show();
+ $(frame.id).find('.f-close').show();
+ } else {
+ // lock
+ frame.grid_lock = true;
+
+ // add class
+ $(frame.id).find('.f-pin').addClass('f-toggle');
+ $(frame.id).find('.f-header').addClass('f-not-allowed');
+ $(frame.id).find('.f-title').addClass('f-not-allowed');
+ $(frame.id).find('.f-resize').hide();
+ $(frame.id).find('.f-close').hide();
+ }
+ },
+
+ // show/hide panel
+ event_panel_load: function ()
+ {
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // load panel
+ this.panel_show_hide();
+ },
+
+ // activate/disable panel
+ event_panel_active: function ()
+ {
+ // check
+ if (this.event.type !== null)
+ return;
+
+ // load panel
+ this.panel_active_disable();
+ },
+
+ // scroll
+ event_panel_scroll: function(e)
+ {
+ // get wheel delta
+ var delta = e.originalEvent.detail ? e.originalEvent.detail : e.originalEvent.wheelDelta / -3;
+
+ // refresh panel
+ this.panel_scroll(delta);
+ },
+
+ // scroll up
+ event_panel_scroll_up: function()
+ {
+ this.panel_scroll(-this.options.scroll);
+ },
+
+ // scroll down
+ event_panel_scroll_down: function()
+ {
+ this.panel_scroll(this.options.scroll);
+ },
+
+ // identify
+ event_get_frame: function(target)
+ {
+ return this.frame_list['#' + $(target).closest('.galaxy-frame').attr('id')];
+ },
+
+ /*
+ FRAME EVENTS START/STOP
+ */
+
+ // drag start
+ frame_drag_start : function (frame)
+ {
+ // set focus
+ this.frame_focus(frame, true);
+
+ // get current dimensions
+ var p = this.frame_screen (frame);
+
+ // initialize shadow
+ this.frame_resize(this.galaxy_frame_shadow, p);
+ this.frame_grid(this.galaxy_frame_shadow, frame.grid_location);
+
+ // reset location
+ frame.grid_location = null;
+
+ // show shadow
+ $(this.galaxy_frame_shadow.id).show();
+
+ // load frame cover
+ $('.f-cover').show();
+ },
+
+ // drag stop
+ frame_drag_stop : function (frame)
+ {
+ // remove focus
+ this.frame_focus(frame, false);
+
+ // get new dimensions
+ var p = this.frame_screen(this.galaxy_frame_shadow);
+
+ // update frame
+ this.frame_resize(frame, p);
+ this.frame_grid(frame, this.galaxy_frame_shadow.grid_location, true);
+
+ // reset location of shadow
+ this.galaxy_frame_shadow.grid_location = null;
+
+ // hide shadow
+ $(this.galaxy_frame_shadow.id).hide();
+
+ // hide frame cover
+ $('.f-cover').hide();
+
+ // refresh scroll state once all animations completed
+ this.panel_animation_complete();
+ },
+
+ /*
+ GRID/PIXEL CONVERTER
+ */
+
+ // converts a pixel coordinate to grids
+ to_grid_coord: function (type, px)
+ {
+ // determine sign
+ var sign = (type == 'width' || type == 'height') ? 1 : -1;
+
+ if (type == 'top') px -= this.top;
+
+ // return
+ return parseInt((px + sign * this.options.margin) / this.options.cell, 10);
+ },
+
+ // converts a grid coordinate to pixels
+ to_pixel_coord: function (type, g)
+ {
+ // determine sign
+ var sign = (type == 'width' || type == 'height') ? 1 : -1;
+
+ // return
+ var px = (g * this.options.cell) - sign * this.options.margin;
+
+ if (type == 'top') px += this.top;
+
+ return px;
+ },
+
+ // get grid coordinates
+ to_grid: function (px)
+ {
+ // full set
+ return {
+ top : this.to_grid_coord('top', px.top),
+ left : this.to_grid_coord('left', px.left),
+ width : this.to_grid_coord('width', px.width),
+ height : this.to_grid_coord('height', px.height)
+ };
+ },
+
+ // get pixel coordinates
+ to_pixel: function(g)
+ {
+ return {
+ top : this.to_pixel_coord('top', g.top),
+ left : this.to_pixel_coord('left', g.left),
+ width : this.to_pixel_coord('width', g.width),
+ height : this.to_pixel_coord('height', g.height)
+ };
+ },
+
+ /*
+ COLLISION DETECTION
+ */
+
+ // check collision
+ is_collision: function(g)
+ {
+ // is collision pair
+ function is_collision_pair (a, b)
+ {
+ return !(a.left > b.left + b.width - 1 || a.left + a.width - 1 < b.left ||
+ a.top > b.top + b.height - 1 || a.top + a.height - 1 < b.top);
+ }
+
+ // search
+ for (var i in this.frame_list)
+ {
+ // get frame
+ var frame = this.frame_list[i];
+
+ // skip
+ if (frame.grid_location === null)
+ continue;
+
+ // check if g collides with frame
+ if (is_collision_pair (g, frame.grid_location))
+ return true;
+ }
+
+ // return
+ return false;
+ },
+
+ // location/grid rank
+ location_rank: function(loc)
+ {
+ return (loc.top * this.cols) + loc.left;
+ },
+
+ /*
+ ONSCREEN MENU
+ */
+
+ // update frame counter
+ menu_refresh: function()
+ {
+ // update on screen counter
+ $(".galaxy-frame-load .number").text(this.frame_counter);
+
+ // check
+ if(this.frame_counter == 0)
+ $(".galaxy-frame-load").hide();
+ else
+ $(".galaxy-frame-load").show();
+
+ // scroll up possible?
+ if (this.top == this.options.top_min)
+ $(".galaxy-frame-scroll-up").hide();
+ else
+ $(".galaxy-frame-scroll-up").show();
+
+ // scroll down possible?
+ if (this.top == this.top_max)
+ $(".galaxy-frame-scroll-down").hide();
+ else
+ $(".galaxy-frame-scroll-down").show();
+ },
+
+ /*
+ PANEL/WINDOW FUNCTIONS
+ */
+
+ // panel on animation complete / frames not moving
+ panel_animation_complete: function()
+ {
+ var self = this;
+ $(".galaxy-frame").promise().done(function() {self.panel_scroll(0, true)});
+ },
+
+ // refresh panel
+ panel_refresh: function(animate)
+ {
+ // get current size
+ this.cols = parseInt($(window).width() / this.options.cell, 10) + 1;
+
+ // recalculate frame positions
+ this.frame_insert(null, null, animate);
+ },
+
+ // update scroll
+ panel_scroll: function(delta, animate)
+ {
+ // new top value
+ var top_new = this.top - this.options.scroll * delta;
+
+ // update top
+ top_new = Math.max(top_new, this.top_max);
+ top_new = Math.min(top_new, this.options.top_min);
+
+ // update screen if necessary
+ if (this.top != top_new)
+ {
+ // update screen
+ for (var i in this.frame_list)
+ {
+ // get frame
+ var frame = this.frame_list[i];
+
+ // skip
+ if (frame.grid_location !== null)
+ {
+ var screen_location = {
+ top : frame.screen_location.top - (this.top - top_new),
+ left : frame.screen_location.left
+ }
+ this.frame_offset(frame, screen_location, animate);
+ }
+ }
+
+ // update top value
+ this.top = top_new;
+ }
+
+ // refresh
+ this.menu_refresh();
+ },
+
+ // show or hide panel
+ panel_show_hide: function()
+ {
+ // check
+ if (this.visible)
+ {
+ // hide
+ this.visible = false;
+
+ // hide
+ for (var i in this.frame_list)
+ $(this.frame_list[i].id).fadeOut('fast');
+
+ // add class
+ $(".galaxy-frame-load .icon").addClass("fa-icon-eye-close");
+ $(".galaxy-frame-load .icon").removeClass("fa-icon-eye-open");
+
+ // hide background
+ $(".galaxy-frame-background").hide();
+
+ // hide menu
+ $(".galaxy-frame-menu").hide();
+ } else {
+ // show
+ this.visible = true;
+
+ // show
+ for (var i in this.frame_list)
+ $(this.frame_list[i].id).fadeIn('fast');
+
+ // add class
+ $(".galaxy-frame-load .icon").addClass("fa-icon-eye-open");
+ $(".galaxy-frame-load .icon").removeClass("fa-icon-eye-close");
+
+ // hide shadow
+ $(this.galaxy_frame_shadow.id).hide();
+
+ // show background
+ $(".galaxy-frame-background").show();
+
+ // show menu
+ this.menu_refresh();
+ }
+ },
+
+ // show or hide panel
+ panel_active_disable: function()
+ {
+ // check
+ if (this.active)
+ {
+ // disable
+ this.active = false;
+
+ // untoggle
+ $(".galaxy-frame-active .icon").removeClass("f-toggle");
+
+ } else {
+ // activate
+ this.active = true;
+
+ // toggle
+ $(".galaxy-frame-active .icon").addClass("f-toggle");
+ }
+ },
+
+ /*
+ FRAME FUNCTIONS
+ */
+ // adds and displays a new frame/window
+ frame_new: function(options)
+ {
+ // validate
+ if (!this.active)
+ {
+ // load frame in main window
+ if (options.center)
+ {
+ var galaxy_main = $( window.parent.document ).find( 'iframe#galaxy_main' );
+ galaxy_main.attr( 'src', options.content );
+ } else
+ window.location = options.content;
+
+ // stop
+ return;
+ }
+
+ // generate frame identifier
+ var frame_id = '#galaxy-frame-' + (this.frame_counter_id++);
+
+ // check if frame exists
+ if ($(frame_id).length === 0 && this.options.frame_max > this.frame_counter)
+ {
+ // reset top
+ this.top = this.options.top_min;
+
+ // set dimensions
+ options.width = this.to_pixel_coord('width', this.options.frame.cols);
+ options.height = this.to_pixel_coord('height', this.options.frame.rows);
+
+ // append
+ $(this.el).append(this.frame_template(frame_id.substring(1), options.title, options.type, options.content));
+
+ // construct a new frame
+ var frame = {
+ id : frame_id,
+ screen_location : {},
+ grid_location : {},
+ grid_rank : null,
+ grid_lock : false
+ };
+
+ // increase frame counter
+ this.frame_counter++;
+
+ // add to frame list
+ this.frame_list[frame_id] = frame;
+
+ // resize
+ this.frame_resize(frame, {width: options.width, height: options.height});
+
+ // place frame
+ this.frame_insert(frame, {top: 0, left: 0}, true);
+
+ // show frames if hidden
+ if (!this.visible)
+ this.panel_show_hide();
+ } else
+ alert("You have reached the maximum number of allowed frames (" + this.options.frame_max + ").");
+ },
+
+ // frame insert at given location
+ frame_insert: function(frame, new_loc, animate)
+ {
+ // define
+ var place_list = [];
+
+ // frame to place
+ if (frame)
+ {
+ // reset grid location
+ frame.grid_location = null;
+
+ // set first one to be placed
+ place_list.push([frame, this.location_rank(new_loc)]);
+ }
+
+ // search
+ var i = null;
+ for (i in this.frame_list)
+ {
+ // get frame
+ var f = this.frame_list[i];
+
+ // check
+ if (f.grid_location !== null && !f.grid_lock)
+ {
+ // reset grid location
+ f.grid_location = null;
+
+ // set up for placement
+ place_list.push([f, f.grid_rank]);
+ }
+ }
+
+ // sort place list by rank
+ place_list.sort(function(a, b)
+ {
+ var i = a[1];
+ var j = b[1];
+ return i < j ? -1 : (i > j ? 1 : 0);
+ });
+
+ // place
+ for (i = 0; i < place_list.length; i++)
+ this.frame_place(place_list[i][0], animate);
+
+ // identify maximum viewport size
+ this.top_max = 0;
+ for (var i in this.frame_list)
+ {
+ // get frame
+ var frame = this.frame_list[i];
+
+ // skip
+ if (frame.grid_location !== null)
+ this.top_max = Math.max(this.top_max, frame.grid_location.top + frame.grid_location.height);
+ }
+
+ // mesh maximum top with window size and margin
+ this.top_max = $(window).height() - this.top_max * this.options.cell - 2 * this.options.margin;
+
+ // fix value
+ this.top_max = Math.min(this.top_max, this.options.top_min);
+
+ // panel menu
+ this.menu_refresh();
+ },
+
+ // naive frame place
+ frame_place: function(frame, animate)
+ {
+ // reset grid location
+ frame.grid_location = null;
+
+ // grid coordinates of new frame
+ var g = this.to_grid(this.frame_screen(frame));
+
+ // try grid coordinates
+ var done = false;
+ for (var i = 0; i < this.options.rows; i++)
+ {
+ // ensure that the first grid column is checked despite limited window space
+ for (var j = 0; j < Math.max(1, this.cols - g.width); j++)
+ {
+ // coordinates
+ g.top = i;
+ g.left = j;
+
+ // no collision
+ if (!this.is_collision(g))
+ {
+ done = true;
+ break;
+ }
+ }
+
+ // break
+ if (done)
+ break;
+ }
+
+ // check if valid spot was found
+ if (done)
+ this.frame_grid(frame, g, animate);
+ else
+ console.log("Grid dimensions exceeded.");
+ },
+
+ // focus
+ frame_focus: function(frame, has_focus)
+ {
+ // get new z-value
+ var z = parseInt(css.get_attribute('galaxy-frame', 'z-index')) + (has_focus ? 1 : 0);
+
+ // update
+ $(frame.id).css('z-index', z);
+ },
+
+ // new left/top position frame
+ frame_offset: function(frame, p, animate)
+ {
+ // update screen location
+ frame.screen_location.left = p.left;
+ frame.screen_location.top = p.top;
+
+ // animate
+ if (animate)
+ {
+ // set focus on animated
+ this.frame_focus(frame, true);
+
+ // prepare for callback
+ var self = this;
+
+ // animate and remove focus
+ $(frame.id).animate({top: p.top, left: p.left}, 'fast', function()
+ {
+ // remove focus
+ self.frame_focus(frame, false);
+ });
+ } else
+ // update css
+ $(frame.id).css({top: p.top, left: p.left});
+ },
+
+ // resize frame
+ frame_resize: function(frame, p)
+ {
+ // update css
+ $(frame.id).css({width: p.width, height: p.height});
+
+ // update descriptor
+ frame.screen_location.width = p.width;
+ frame.screen_location.height = p.height;
+ },
+
+ // new grid location
+ frame_grid: function (frame, l, animate)
+ {
+ // update grid location
+ frame.grid_location = l;
+
+ // place frame
+ this.frame_offset(frame, this.to_pixel(l), animate);
+
+ // update grid rank
+ frame.grid_rank = this.location_rank(l);
+ },
+
+ // get frame dimensions
+ frame_screen: function(frame)
+ {
+ var p = frame.screen_location;
+ return {top: p.top, left: p.left, width: p.width, height: p.height};
+ },
+
+ /*
+ HTML TEMPLATES
+ */
+
+ // fill regular frame template
+ frame_template: function(id, title, type, content)
+ {
+ // check title
+ if (!title)
+ title = '';
+
+ // identify content type
+ if (type == 'url')
+ content = '<iframe scrolling="auto" class="f-iframe" src="' + content + '"></iframe>';
+
+ // load template
+ return '<div id="' + id + '" class="galaxy-frame f-corner">' +
+ '<div class="f-header f-corner">' +
+ '<span class="f-title">' + title + '</span>' +
+ '<span class="f-icon f-pin fa-icon-pushpin"></span>' +
+ '<span class="f-icon f-close fa-icon-trash"></span>' +
+ '</div>' +
+ '<div class="f-content f-corner">' + content +
+ '<div class="f-cover"></div>' +
+ '</div>' +
+ '<span class="f-resize f-icon f-corner fa-icon-resize-full"></span>' +
+ '</div>';
+ },
+
+ // fill shadow template
+ frame_template_shadow: function(id)
+ {
+ return '<div id="' + id + '" class="galaxy-frame-shadow f-corner"></div>';
+ },
+
+ // fill background template in order to cover underlying iframes
+ frame_template_background: function()
+ {
+ return '<div class="galaxy-frame-background"></div>';
+ },
+
+ // fill load button template
+ frame_template_load: function()
+ {
+ return '<div class="galaxy-frame-load f-corner">' +
+ '<div class="number f-corner">0</div>' +
+ '<div class="icon fa-icon-2x"></div>' +
+ '</div>'+
+ '<div title="Enable/Disable Scratchbook Viewer" class="galaxy-frame-active f-corner">' +
+ '<div class="icon fa-icon-2x fa-icon-th"></div>' +
+ '</div>';
+ },
+
+ // fill menu button template
+ frame_template_menu: function()
+ {
+ return '<div class="galaxy-frame-scroll-up galaxy-frame-menu fa-icon-chevron-up fa-icon-2x"></div>' +
+ '<div class="galaxy-frame-scroll-down galaxy-frame-menu fa-icon-chevron-down fa-icon-2x"></div>';
+ }
+});
+
+// return
+return {
+ GalaxyFrameManager: GalaxyFrameManager
+};
+
+});
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -367,13 +367,34 @@
$(parent.document).find('input[name=id]:checked').each(function() {
var vis_id = $(this).val();
dataset_params.id = vis_id;
- parent.location = vis_url + "/trackster?" + $.param(dataset_params);
+
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Trackster",
+ type : "url",
+ content : vis_url + "/trackster?" + $.param(dataset_params)
+ });
+
+ // hide
+ parent.hide_modal();
});
}
});
},
"View in new visualization": function() {
- parent.location = vis_url + "/trackster?" + $.param(dataset_params);
+ var url = vis_url + "/trackster?" + $.param(dataset_params);
+
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Trackster",
+ type : "url",
+ content : url
+ });
+
+ // hide
+ parent.hide_modal();
}
});
}
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -237,7 +237,7 @@
} else {
displayBtnData.title = _l( 'View data' );
- displayBtnData.href = this.urls.display;
+ displayBtnData.href = "javascript:parent.frame_manager.frame_new({title: 'Data Viewer', type: 'url', center: true, content: '" + this.urls.display + "'});";
}
this.displayButton = new IconButtonView({ model : new IconButton( displayBtnData ) });
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -239,25 +239,8 @@
* @returns {jQuery} rendered DOM
*/
_render_visualizationsButton : function(){
- var visualizations = this.model.get( 'visualizations' );
- if( ( !this.model.hasData() )
- || ( _.isEmpty( visualizations ) ) ){
- this.visualizationsButton = null;
- return null;
- }
-
- //TODO: this is a bridge to allow the framework to be switched off
- // remove this fn and use the other when fully integrated
- if( _.isObject( visualizations[0] ) ){
- return this._render_visualizationsFrameworkButton( visualizations );
- }
-
- if( !this.urls.visualization ){
- this.visualizationsButton = null;
- return null;
- }
-
var dbkey = this.model.get( 'dbkey' ),
+ visualizations = this.model.get( 'visualizations' ),
visualization_url = this.urls.visualization,
popup_menu_dict = {},
params = {
@@ -267,10 +250,17 @@
// Add dbkey to params if it exists.
if( dbkey ){ params.dbkey = dbkey; }
+ if( !( this.model.hasData() )
+ || !( visualizations && visualizations.length )
+ || !( visualization_url ) ){
+ this.visualizationsButton = null;
+ return null;
+ }
+
// render the icon from template
this.visualizationsButton = new IconButtonView({ model : new IconButton({
title : _l( 'Visualize' ),
- href : this.urls.visualization,
+ href : visualization_url,
icon_class : 'chart_curve'
})});
var $icon = this.visualizationsButton.render().$el;
@@ -289,7 +279,14 @@
return create_scatterplot_action_fn( visualization_url, params );
default:
return function(){
- window.parent.location = visualization_url + '/' + visualization + '?' + $.param( params ); };
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Visualization",
+ type : "url",
+ content : visualization_url + '/' + visualization + '?' + $.param( params )
+ });
+ };
}
}
@@ -309,40 +306,6 @@
}
return $icon;
},
-
- /** Render an icon-button or popupmenu of links based on the applicable visualizations
- * @returns {jQuery} rendered DOM
- */
- _render_visualizationsFrameworkButton : function( visualizations ){
- if( !( this.model.hasData() )
- || !( visualizations && !_.isEmpty( visualizations ) ) ){
- this.visualizationsButton = null;
- return null;
- }
-
- // render the icon from template
- this.visualizationsButton = new IconButtonView({ model : new IconButton({
- title : _l( 'Visualize' ),
- icon_class : 'chart_curve'
- })});
- var $icon = this.visualizationsButton.render().$el;
- $icon.addClass( 'visualize-icon' ); // needed?
-
- // No need for popup menu because there's a single visualization.
- if( _.keys( visualizations ).length === 1 ) {
- $icon.attr( 'title', _.keys( visualizations )[0] );
- $icon.attr( 'href', _.values( visualizations )[0] );
-
- // >1: Populate menu dict with visualization fns, make the popupmenu
- } else {
- var popup_menu_options = [];
- _.each( visualizations, function( linkData ) {
- popup_menu_options.push( linkData );
- });
- var popup = new PopupMenu( $icon, popup_menu_options );
- }
- return $icon;
- },
// ......................................................................... secondary actions
/** Render secondary actions: currently tagging and annotation (if user is allowed).
@@ -604,9 +567,16 @@
//TODO: should be imported from scatterplot.js OR abstracted to 'load this in the galaxy_main frame'
function create_scatterplot_action_fn( url, params ){
action = function() {
- var galaxy_main = $( window.parent.document ).find( 'iframe#galaxy_main' ),
- final_url = url + '/scatterplot?' + $.param(params);
- galaxy_main.attr( 'src', final_url );
+
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Scatterplot",
+ type : "url",
+ content : url + '/scatterplot?' + $.param(params),
+ center : true
+ });
+
//TODO: this needs to go away
$( 'div.popmenu-wrapper' ).remove();
return false;
@@ -650,13 +620,32 @@
$(parent.document).find('input[name=id]:checked').each(function() {
var vis_id = $(this).val();
dataset_params.id = vis_id;
- parent.location = vis_url + "/trackster?" + $.param(dataset_params);
+
+ // hide modal
+ parent.hide_modal();
+
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Trackster",
+ type : "url",
+ content : vis_url + "/trackster?" + $.param(dataset_params)
+ });
});
}
});
},
"View in new visualization": function() {
- parent.location = vis_url + "/trackster?" + $.param(dataset_params);
+ // hide modal
+ parent.hide_modal();
+
+ // add widget
+ parent.frame_manager.frame_new(
+ {
+ title : "Trackster",
+ type : "url",
+ content : vis_url + "/trackster?" + $.param(dataset_params)
+ });
}
});
}
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/scripts/utils/galaxy.css.js
--- /dev/null
+++ b/static/scripts/utils/galaxy.css.js
@@ -0,0 +1,41 @@
+/**
+ * Galaxy CSS utilities
+*/
+
+// dependencies
+define(["libs/underscore"], function(_) {
+
+// get css value
+function get_attribute (classname, name)
+{
+ // place dummy element
+ var el = $('<div class="' + classname + '"></div>');
+
+ // required append
+ el.appendTo(':eq(0)');
+
+ // get value
+ var value = el.css(name).replace(/[^-\d\.]/g, '');
+
+ // remove element
+ el.remove();
+
+ // return css value
+ return value;
+}
+
+// load css
+function load_file (url)
+{
+ // check if css is already available
+ if (!$('link[href="' + url + '"]').length)
+ $('<link href="' + url + '" rel="stylesheet">').appendTo('head');
+};
+
+// return
+return {
+ load_file : load_file,
+ get_attribute : get_attribute
+};
+
+});
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/style/blue/galaxy.frame.css
--- /dev/null
+++ b/static/style/blue/galaxy.frame.css
@@ -0,0 +1,214 @@
+body {background: #000000}
+.f-corner
+{
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+
+.f-toggle
+{
+ color: #BCC800;
+}
+
+/*
+ galaxy-frames
+*/
+
+.galaxy-frame-background
+{
+ z-index : 14000;
+ position : absolute;
+ display : none;
+ top : 0px;
+ left : 0px;
+ height : 100%;
+ width : 100%;
+ opacity : 0.6;
+ background : #11131A;
+ overflow : auto;
+}
+
+.galaxy-frame-shadow
+{
+ z-index : 14001;
+ position : absolute;
+ display : none;
+ top : 0px;
+ left : 0px;
+ opacity : 0.5;
+ background : #2C3143;
+ border : 1px solid #EEEEEE;
+}
+
+.galaxy-frame
+{
+ z-index : 14002;
+ overflow : hidden;
+ position : absolute;
+ top : 0px;
+ left : 0px;
+ height : 100%;
+ width : 100%;
+ opacity : 1.0;
+ background : #FFFFFF;
+ border : 1px solid #D0D0D0;
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,0.3);
+}
+/*
+ panel menu button
+*/
+.galaxy-frame-menu
+{
+ z-index : 14003;
+ position : absolute;
+ cursor : pointer;
+ color : #BCC800;
+ right : 10px;
+}
+
+.galaxy-frame-scroll-up
+{
+ top : 50px;
+}
+
+.galaxy-frame-scroll-down
+{
+ bottom : 20px;
+}
+
+/*
+ panel active button
+*/
+.galaxy-frame-active
+{
+ z-index : 34010;
+ position : absolute;
+ top : 8px;
+ right : 120px;
+ padding : 0px 0px 0px 0px;
+ cursor : pointer;
+ color : #D0D0D0;
+}
+
+/*
+ panel load button
+*/
+.galaxy-frame-load
+{
+ z-index : 34010;
+ position : absolute;
+ top : 6px;
+ right : 165px;
+ padding : 0px 0px 0px 0px;
+ cursor : pointer;
+ color : #BCC800;
+}
+
+.galaxy-frame-load .number
+{
+ position : absolute;
+ font-weight : bold;
+ font-size : 12px;
+ font-family : Verdana, Arial;
+ top : 8px;
+ left : 26px;
+}
+
+/*
+ frame components
+*/
+.galaxy-frame .f-content
+{
+ position : absolute;
+ overflow : hidden;
+ background : #FFFFFF;
+ border : none;
+ top : 24px;
+ bottom : 3px;
+ left : 3px;
+ right : 3px;
+}
+
+.galaxy-frame .f-cover
+{
+ position : absolute;
+ display : none;
+ top : 0px;
+ left : 0px;
+ height : 100%;
+ width : 100%;
+ opacity : 0.0;
+ background : #FFFFFF;
+}
+
+.galaxy-frame .f-iframe
+{
+ border : none;
+ width : 100%;
+ height : 100%;
+}
+
+.galaxy-frame .f-header
+{
+ height : 17px;
+ margin : 2px;
+ cursor : pointer;
+ border : 1px solid #000000;
+ background : #2C3143;
+ color : #FFFFFF;
+ font-weight : bold;
+}
+
+.galaxy-frame .f-title
+{
+ position : absolute;
+ top : 4px;
+ left : 16px;
+ right : 16px;
+ font-size : 12px;
+ font-family : Verdana, Arial;
+ text-align : center;
+}
+
+/*
+ frame icons
+*/
+
+.galaxy-frame .f-icon
+{
+ position : absolute;
+ cursor : pointer;
+ font-style : normal;
+}
+
+.galaxy-frame .f-not-allowed
+{
+ cursor : not-allowed;
+}
+
+.galaxy-frame .f-close
+{
+ right : 5px;
+ top : 4px;
+}
+
+.galaxy-frame .f-pin
+{
+ left : 6px;
+ top : 4px;
+}
+
+.galaxy-frame .f-resize
+{
+ right : 0px;
+ bottom : 0px;
+ background : #FFFFFF;
+ width : 16px;
+ height : 16px;
+ color : #2C3143;
+ right : 0px;
+ bottom : 0px;
+ text-align : center;
+ line-height : 16px;
+ border : 0px solid #2C3143;
+}
\ No newline at end of file
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 static/style/blue/galaxy.frame.masthead.css
--- /dev/null
+++ b/static/style/blue/galaxy.frame.masthead.css
@@ -0,0 +1,19 @@
+#masthead
+{
+ display: none;
+}
+
+#messagebox
+{
+ display: none;
+}
+
+#center
+{
+ top: 0 !important;
+}
+
+#right
+{
+ top: 0 !important;
+}
\ No newline at end of file
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -59,7 +59,8 @@
'libs/backbone/backbone',
'libs/backbone/backbone-relational',
'libs/handlebars.runtime',
- 'galaxy.base'
+ 'galaxy.base',
+ 'libs/require'
)}
${h.templates(
@@ -71,6 +72,28 @@
)}
<script type="text/javascript">
+ ## check if its in a galaxy iframe
+ function is_in_galaxy_frame()
+ {
+ var iframes = parent.document.getElementsByTagName("iframe");
+ for (var i=0, len=iframes.length; i < len; ++i)
+ if (document == iframes[i].contentDocument || self == iframes[i].contentWindow)
+ return $(iframes[i]).hasClass('f-iframe');
+ return false;
+ };
+
+ ## load css
+ function load_css (url)
+ {
+ ## check if css is already available
+ if (!$('link[href="' + url + '"]').length)
+ $('<link href="' + url + '" rel="stylesheet">').appendTo('head');
+ };
+
+ ## load additional style sheet
+ if (is_in_galaxy_frame())
+ load_css('/static/style/galaxy.frame.masthead.css');
+
// console protection
window.console = window.console || {
log : function(){},
@@ -93,6 +116,20 @@
sweepster_url: '${h.url_for( controller="/visualization", action="sweepster" )}',
visualization_url: '${h.url_for( controller="/visualization", action="save" )}',
});
+
+ ## configure require
+ require.config({
+ baseUrl: "${h.url_for('/static/scripts') }",
+ shim: {
+ "libs/underscore": { exports: "_" },
+ "libs/backbone/backbone": { exports: "Backbone" },
+ "libs/backbone/backbone-relational": ["libs/backbone/backbone"]
+ }
+ });
+
+ ## frame manager
+ var frame_manager = null;
+ require(['galaxy.frame'], function(frame) { this.frame_manager = new frame.GalaxyFrameManager(); });
</script></%def>
@@ -276,7 +313,7 @@
</div></noscript>
%endif
- <div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; min-width: 600px;">
+ <div id="everything" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
## Background displays first
<div id="background"></div>
## Layer iframes over backgrounds
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -142,13 +142,15 @@
tab( "lab", "Lab", None, menu_options=menu_options, visible=( trans.user and ( trans.user.requests or trans.app.security_agent.get_accessible_request_types( trans, trans.user ) ) ) )
%>
+
+
## Visualization menu.
<%
menu_options = [
- [_('New Track Browser'), h.url_for( controller='/visualization', action='trackster' ) ],
- [_('Saved Visualizations'), h.url_for( controller='/visualization', action='list' ) ]
+ [_('New Track Browser'), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});"],
+ [_('Saved Visualizations'), "javascript:frame_manager.frame_new({ type: 'url', content : '/visualization/list'});" ]
]
- tab( "visualization", _("Visualization"), h.url_for( controller='/visualization', action='list'), menu_options=menu_options )
+ tab( "visualization", _("Visualization"), "javascript:frame_manager.frame_new({title: 'Trackster', type: 'url', content: '/visualization/trackster'});", menu_options=menu_options )
%>
## Cloud menu.
diff -r 7538c4cb86dcb9383ece63152f623d3c5e517256 -r a27c1c3a628bc0167981865b82442fc790bd8406 templates/webapps/galaxy/tracks/browser.mako
--- a/templates/webapps/galaxy/tracks/browser.mako
+++ b/templates/webapps/galaxy/tracks/browser.mako
@@ -64,7 +64,7 @@
$("#center .unified-panel-header-inner").append(ui.buttonMenu.$el);
// Hide bookmarks by default right now.
- parent.force_right_panel("hide");
+ force_right_panel("hide");
// Resize view when showing/hiding right panel (bookmarks for now).
$("#right-border").click(function() { view.resize_window(); });
@@ -118,6 +118,7 @@
function init_editor() {
$("#title").text(view.name + " (" + view.dbkey + ")");
+ if (!is_in_galaxy_frame())
window.onbeforeunload = function() {
if (view.has_changes) {
return "There are unsaved changes to your visualization which will be lost.";
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ff8ac1441d90/
Changeset: ff8ac1441d90
User: nsoranzo
Date: 2013-06-24 14:15:46
Summary: Use sam_fa_indexes tool data table instead of searching the dbkey in sam_fa_indices.loc
Also remove some unused imports.
Affected #: 5 files
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 tools/samtools/sam_pileup.py
--- a/tools/samtools/sam_pileup.py
+++ b/tools/samtools/sam_pileup.py
@@ -8,8 +8,7 @@
-o, --output1=o: Output pileup
-R, --ref=R: Reference file type
-n, --ownFile=n: User-supplied fasta reference file
- -d, --dbkey=d: dbkey of user-supplied file
- -x, --indexDir=x: Index directory
+ -g, --index=g: Path of the indexed reference genome
-b, --bamIndex=b: BAM index file
-s, --lastCol=s: Print the mapping quality as the last column
-i, --indels=i: Only output lines containing indels
@@ -31,24 +30,9 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-def check_seq_file( dbkey, GALAXY_DATA_INDEX_DIR ):
- seqFile = '%s/sam_fa_indices.loc' % GALAXY_DATA_INDEX_DIR
- seqPath = ''
- for line in open( seqFile ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seqPath = fields[2].strip()
- break
- return seqPath
-
def __main__():
#Parse Command Line
options, args = doc_optparse.parse( __doc__ )
- seqPath = check_seq_file( options.dbkey, options.indexDir )
# output version # of tool
try:
tmp = tempfile.NamedTemporaryFile().name
@@ -77,7 +61,6 @@
tmpf1 = tempfile.NamedTemporaryFile( dir=tmpDir )
tmpf1_name = tmpf1.name
tmpf1.close()
- tmpf1fai_name = '%s.fai' % tmpf1_name
#link bam and bam index to working directory (can't move because need to leave original)
os.symlink( options.input1, tmpf0bam_name )
os.symlink( options.bamIndex, tmpf0bambai_name )
@@ -100,9 +83,9 @@
try:
#index reference if necessary and prepare pileup command
if options.ref == 'indexed':
- if not os.path.exists( "%s.fai" % seqPath ):
- raise Exception, "No sequences are available for '%s', request them by reporting this error." % options.dbkey
- cmd = cmd % ( opts, seqPath, tmpf0bam_name, options.output1 )
+ if not os.path.exists( "%s.fai" % options.index ):
+ raise Exception, "Indexed genome %s not present, request it by reporting this error." % options.index
+ cmd = cmd % ( opts, options.index, tmpf0bam_name, options.output1 )
elif options.ref == 'history':
os.symlink( options.ownFile, tmpf1_name )
cmdIndex = 'samtools faidx %s' % ( tmpf1_name )
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 tools/samtools/sam_pileup.xml
--- a/tools/samtools/sam_pileup.xml
+++ b/tools/samtools/sam_pileup.xml
@@ -1,4 +1,4 @@
-<tool id="sam_pileup" name="Generate pileup" version="1.1.1">
+<tool id="sam_pileup" name="Generate pileup" version="1.1.2"><description>from BAM dataset</description><requirements><requirement type="package" version="0.1.16">samtools</requirement>
@@ -11,10 +11,8 @@
#if $refOrHistory.reference == "history":
--ownFile=$refOrHistory.ownFile
#else:
- --ownFile="None"
+ --index=${refOrHistory.index.fields.path}
#end if
- --dbkey=${input1.metadata.dbkey}
- --indexDir=${GALAXY_DATA_INDEX_DIR}
--bamIndex=${input1.metadata.bam_index}
--lastCol=$lastCol
--indels=$indels
@@ -41,7 +39,13 @@
<when value="indexed"><param name="input1" type="data" format="bam" label="Select the BAM file to generate the pileup file for"><validator type="unspecified_build" />
- <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
+ </param>
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input1" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options></param></when><when value="history">
@@ -100,6 +104,7 @@
--><param name="reference" value="indexed" /><param name="input1" value="sam_pileup_in1.bam" ftype="bam" dbkey="equCab2" />
+ <param name="index" value="chr_m" /><param name="lastCol" value="no" /><param name="indels" value="no" /><param name="mapCap" value="60" />
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 tools/samtools/sam_to_bam.py
--- a/tools/samtools/sam_to_bam.py
+++ b/tools/samtools/sam_to_bam.py
@@ -3,43 +3,24 @@
Converts SAM data to sorted BAM data.
usage: sam_to_bam.py [options]
--input1: SAM file to be converted
- --dbkey: dbkey value
+ --index: path of the indexed reference genome
--ref_file: Reference file if choosing from history
--output1: output dataset in bam format
- --index_dir: GALAXY_DATA_INDEX_DIR
"""
-import optparse, os, sys, subprocess, tempfile, shutil, gzip
-from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from bx.cookbook import doc_optparse
-from galaxy import util
+import optparse, os, sys, subprocess, tempfile, shutil
def stop_err( msg ):
sys.stderr.write( '%s\n' % msg )
sys.exit()
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option( '', '--input1', dest='input1', help='The input SAM dataset' )
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index', dest='index', help='The path of the indexed reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
parser.add_option( '', '--output1', dest='output1', help='The output BAM dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
( options, args ) = parser.parse_args()
# output version # of tool
@@ -61,24 +42,17 @@
except:
sys.stdout.write( 'Could not determine Samtools version\n' )
- cached_seqs_pointer_file = '%s/sam_fa_indices.loc' % options.index_dir
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
tmp_dir = tempfile.mkdtemp()
if not options.ref_file or options.ref_file == 'None':
# We're using locally cached reference sequences( e.g., /galaxy/data/equCab2/sam_index/equCab2.fa ).
# The indexes for /galaxy/data/equCab2/sam_index/equCab2.fa will be contained in
# a file named /galaxy/data/equCab2/sam_index/equCab2.fa.fai
- fai_index_file_base = seq_path
- fai_index_file_path = '%s.fai' % seq_path
+ fai_index_file_path = '%s.fai' % options.index
if not os.path.exists( fai_index_file_path ):
#clean up temp files
if os.path.exists( tmp_dir ):
shutil.rmtree( tmp_dir )
- stop_err( 'No sequences are available for build (%s), request them by reporting this error.' % options.dbkey )
+ stop_err( 'Indexed genome %s not present, request it by reporting this error.' % options.index )
else:
try:
# Create indexes for history reference ( e.g., ~/database/files/000/dataset_1.dat ) using samtools faidx, which will:
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 tools/samtools/sam_to_bam.xml
--- a/tools/samtools/sam_to_bam.xml
+++ b/tools/samtools/sam_to_bam.xml
@@ -1,4 +1,4 @@
-<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.2">
+<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.3"><description>converts SAM format to BAM format</description><requirements><requirement type="package">samtools</requirement>
@@ -7,13 +7,11 @@
sam_to_bam.py
--input1=$source.input1
#if $source.index_source == "history":
- --dbkey=${ref_file.metadata.dbkey}
--ref_file=$source.ref_file
#else
- --dbkey=${input1.metadata.dbkey}
+ --index=${source.index.fields.path}
#end if
--output1=$output1
- --index_dir=${GALAXY_DATA_INDEX_DIR}
</command><inputs><conditional name="source">
@@ -22,13 +20,19 @@
<option value="history">History</option></param><when value="cached">
- <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
+ <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM file to convert">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
+ </param>
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input1" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options></param></when><when value="history">
- <param name="input1" type="data" format="sam" label="Convert SAM file" />
+ <param name="input1" type="data" format="sam" label="SAM file to convert" /><param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" /></when></conditional>
@@ -76,6 +80,7 @@
--><param name="index_source" value="cached" /><param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
+ <param name="index" value="chr_m" /><output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /></test></tests>
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 tools/samtools/samtools_mpileup.xml
--- a/tools/samtools/samtools_mpileup.xml
+++ b/tools/samtools/samtools_mpileup.xml
@@ -1,4 +1,4 @@
-<tool id="samtools_mpileup" name="MPileup" version="0.0.1">
+<tool id="samtools_mpileup" name="MPileup" version="0.0.2"><description>SNP and indel caller</description><requirements><requirement type="package">samtools</requirement>
@@ -59,22 +59,22 @@
</param><when value="cached"><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="value" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
+ </param></repeat><param name="ref_file" type="select" label="Using reference genome"><options from_data_table="sam_fa_indexes">
- <!-- <filter type="data_meta" key="dbkey" ref="input_bam" column="value"/> does not yet work in a repeat...-->
+ <!-- <filter type="data_meta" ref="input_bam" key="dbkey" column="1" /> does not yet work in a repeat...--></options></param></when><when value="history"><!-- FIX ME!!!! --><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file" >
- <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue."/>
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file">
+ <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue." />
+ </param></repeat><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
https://bitbucket.org/galaxy/galaxy-central/commits/6769c6ef2ae1/
Changeset: 6769c6ef2ae1
User: nsoranzo
Date: 2013-06-24 14:17:42
Summary: Use sam_fa_indexes tool data table instead of searching the dbkey in sam_fa_indices.loc also in Cufflinks wrappers
Affected #: 8 files
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffcompare_wrapper.py
--- a/tools/ngs_rna/cuffcompare_wrapper.py
+++ b/tools/ngs_rna/cuffcompare_wrapper.py
@@ -8,20 +8,6 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -30,8 +16,7 @@
parser.add_option( '-s', dest='use_seq_data', action="store_true", help='Causes cuffcompare to look into for fasta files with the underlying genomic sequences (one file per contig) against which your reads were aligned for some optional classification functions. For example, Cufflinks transcripts consisting mostly of lower-case bases are classified as repeats. Note that <seq_dir> must contain one fasta file per reference chromosome, and each file must be named after the chromosome, and have a .fa or .fasta extension.')
# Wrapper / Galaxy options.
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -60,21 +45,16 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffcompare_wrapper.xml
--- a/tools/ngs_rna/cuffcompare_wrapper.xml
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffcompare" name="Cuffcompare" version="0.0.5">
+<tool id="cuffcompare" name="Cuffcompare" version="0.0.6"><!-- Wrapper supports Cuffcompare versions v1.3.0 and newer --><description>compare assembled transcripts to a reference annotation and track Cufflinks transcripts across multiple experiments</description><requirements>
@@ -17,14 +17,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${seq_data.seq_source.index.fields.path}
#end if
- --dbkey=${first_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -66,7 +64,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ b/tools/ngs_rna/cuffdiff_wrapper.py
@@ -35,20 +35,6 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -83,8 +69,7 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -123,21 +108,16 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
+<tool id="cuffdiff" name="Cuffdiff" version="0.0.6"><!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements>
@@ -42,14 +42,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${bias_correction.seq_source.index.fields.path}
#end if
- --dbkey=${gtf_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Inputs.
@@ -131,7 +129,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cufflinks_wrapper.py
--- a/tools/ngs_rna/cufflinks_wrapper.py
+++ b/tools/ngs_rna/cufflinks_wrapper.py
@@ -10,20 +10,6 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -52,8 +38,7 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Global model.
@@ -82,21 +67,16 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cufflinks_wrapper.xml
--- a/tools/ngs_rna/cufflinks_wrapper.xml
+++ b/tools/ngs_rna/cufflinks_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cufflinks" name="Cufflinks" version="0.0.5">
+<tool id="cufflinks" name="Cufflinks" version="0.0.6"><!-- Wrapper supports Cufflinks versions v1.3.0 and newer --><description>transcript assembly and FPKM (RPKM) estimates for RNA-Seq data</description><requirements>
@@ -28,14 +28,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${bias_correction.seq_source.index.fields.path}
#end if
- --dbkey=${input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Multi-read correct?
@@ -66,15 +64,15 @@
<when value="No"></when><when value="Use reference annotation"><param format="gff3,gtf" name="reference_annotation_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
- <when value="Use reference annotation guide">
+ </when>
+ <when value="Use reference annotation guide"><param format="gff3,gtf" name="reference_annotation_guide_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
+ </when></conditional><conditional name="bias_correction"><param name="do_bias_correction" type="select" label="Perform Bias Correction" help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates."><option value="No" selected="true">No</option>
- <option value="Yes">Yes</option>
+ <option value="Yes">Yes</option></param><when value="Yes"><conditional name="seq_source">
@@ -82,7 +80,14 @@
<option value="cached" selected="true">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffmerge_wrapper.py
--- a/tools/ngs_rna/cuffmerge_wrapper.py
+++ b/tools/ngs_rna/cuffmerge_wrapper.py
@@ -8,20 +8,6 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -31,8 +17,7 @@
# Wrapper / Galaxy options.
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -61,21 +46,16 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r ff8ac1441d909237bcac94f18aa7db3df61e6be9 -r 6769c6ef2ae18b120b208c63474f8877865128c6 tools/ngs_rna/cuffmerge_wrapper.xml
--- a/tools/ngs_rna/cuffmerge_wrapper.xml
+++ b/tools/ngs_rna/cuffmerge_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffmerge" name="Cuffmerge" version="0.0.5">
+<tool id="cuffmerge" name="Cuffmerge" version="0.0.6"><!-- Wrapper supports Cuffmerge versions 1.3 and newer --><description>merge together several Cufflinks assemblies</description><requirements>
@@ -16,14 +16,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${seq_data.seq_source.index.fields.path}
#end if
- --dbkey=${first_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -64,7 +62,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
https://bitbucket.org/galaxy/galaxy-central/commits/af20b15f7eda/
Changeset: af20b15f7eda
User: nsoranzo
Date: 2013-04-18 19:25:55
Summary: Add new loc file for SAMtools indexes to support genome variants
Affected #: 2 files
diff -r 6769c6ef2ae18b120b208c63474f8877865128c6 -r af20b15f7eda2332313933055c87056ef9af252a tool-data/sam_fa_new_indices.loc.sample
--- /dev/null
+++ b/tool-data/sam_fa_new_indices.loc.sample
@@ -0,0 +1,30 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of Samtools indexed sequences data files. You will need
+#to create these data files and then create a sam_fa_new_indices.loc file
+#similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The sam_fa_new_indices.loc
+#file has this format (white space characters are TAB characters):
+#
+# <unique_build_id><dbkey><display_name><file_base_path>
+#
+#So, for example, if you had hg19 Canonical indexed stored in
+#
+# /depot/data2/galaxy/hg19/sam/,
+#
+#then the sam_fa_new_indices.loc entry would look like this:
+#
+#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
+#
+#and your /depot/data2/galaxy/hg19/sam/ directory
+#would contain hg19canon.fa and hg19canon.fa.fai files.
+#
+#Your sam_fa_new_indices.loc file should include an entry per line for
+#each index set you have stored. The file in the path does actually
+#exist, but it should never be directly used. Instead, the name serves
+#as a prefix for the index file. For example:
+#
+#hg18canon hg18 Human (Homo sapiens): hg18 Canonical /depot/data2/galaxy/hg18/sam/hg18canon.fa
+#hg18full hg18 Human (Homo sapiens): hg18 Full /depot/data2/galaxy/hg18/sam/hg18full.fa
+#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
+#hg19full hg19 Human (Homo sapiens): hg19 Full /depot/data2/galaxy/hg19/sam/hg19full.fa
+
diff -r 6769c6ef2ae18b120b208c63474f8877865128c6 -r af20b15f7eda2332313933055c87056ef9af252a tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample
+++ b/tool_data_table_conf.xml.sample
@@ -55,10 +55,26 @@
<columns>value, name, path</columns><file path="tool-data/perm_color_index.loc" /></table>
- <!-- Location of SAMTools indexes and other files -->
- <table name="sam_fa_indexes" comment_char="#">
+ <!-- Location of SAMTools indexes and other files (new version)
+ Warning: until Galaxy release_2013.06.03 the format of this
+ table was:
+
<columns>line_type, value, path</columns><file path="tool-data/sam_fa_indices.loc" />
+
+ If you are updating your tool_data_table_conf.xml to the current
+ version you should first migrate your
+ tool-data/sam_fa_indices.loc file to a new
+ tool-data/sam_fa_new_indices.loc file with the format specified
+ below, which is explained in the relative sample file
+ tool-data/sam_fa_new_indices.loc.sample .
+ By using the new format it is possible to let the user choose
+ among multiple indexed genome variants having the same dbkey,
+ e.g. hg19canon vs. hg19full variants for hg19 dbkey.
+ -->
+ <table name="sam_fa_indexes" comment_char="#">
+ <columns>value, dbkey, name, path</columns>
+ <file path="tool-data/sam_fa_new_indices.loc" /></table><!-- Location of Picard dict file and other files --><table name="picard_indexes" comment_char="#">
https://bitbucket.org/galaxy/galaxy-central/commits/7538c4cb86dc/
Changeset: 7538c4cb86dc
User: jgoecks
Date: 2013-06-24 16:37:12
Summary: Merged in nsoranzo/galaxy-central (pull request #188)
New loc file for SAMtools indexes to support genome variants (backward compatible)
Affected #: 15 files
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tool-data/sam_fa_new_indices.loc.sample
--- /dev/null
+++ b/tool-data/sam_fa_new_indices.loc.sample
@@ -0,0 +1,30 @@
+#This is a sample file distributed with Galaxy that enables tools
+#to use a directory of Samtools indexed sequences data files. You will need
+#to create these data files and then create a sam_fa_new_indices.loc file
+#similar to this one (store it in this directory) that points to
+#the directories in which those files are stored. The sam_fa_new_indices.loc
+#file has this format (white space characters are TAB characters):
+#
+# <unique_build_id><dbkey><display_name><file_base_path>
+#
+#So, for example, if you had hg19 Canonical indexed stored in
+#
+# /depot/data2/galaxy/hg19/sam/,
+#
+#then the sam_fa_new_indices.loc entry would look like this:
+#
+#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
+#
+#and your /depot/data2/galaxy/hg19/sam/ directory
+#would contain hg19canon.fa and hg19canon.fa.fai files.
+#
+#Your sam_fa_new_indices.loc file should include an entry per line for
+#each index set you have stored. The file in the path does actually
+#exist, but it should never be directly used. Instead, the name serves
+#as a prefix for the index file. For example:
+#
+#hg18canon hg18 Human (Homo sapiens): hg18 Canonical /depot/data2/galaxy/hg18/sam/hg18canon.fa
+#hg18full hg18 Human (Homo sapiens): hg18 Full /depot/data2/galaxy/hg18/sam/hg18full.fa
+#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /depot/data2/galaxy/hg19/sam/hg19canon.fa
+#hg19full hg19 Human (Homo sapiens): hg19 Full /depot/data2/galaxy/hg19/sam/hg19full.fa
+
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tool_data_table_conf.xml.sample
--- a/tool_data_table_conf.xml.sample
+++ b/tool_data_table_conf.xml.sample
@@ -55,10 +55,26 @@
<columns>value, name, path</columns><file path="tool-data/perm_color_index.loc" /></table>
- <!-- Location of SAMTools indexes and other files -->
- <table name="sam_fa_indexes" comment_char="#">
+ <!-- Location of SAMTools indexes and other files (new version)
+ Warning: until Galaxy release_2013.06.03 the format of this
+ table was:
+
<columns>line_type, value, path</columns><file path="tool-data/sam_fa_indices.loc" />
+
+ If you are updating your tool_data_table_conf.xml to the current
+ version you should first migrate your
+ tool-data/sam_fa_indices.loc file to a new
+ tool-data/sam_fa_new_indices.loc file with the format specified
+ below, which is explained in the relative sample file
+ tool-data/sam_fa_new_indices.loc.sample .
+ By using the new format it is possible to let the user choose
+ among multiple indexed genome variants having the same dbkey,
+ e.g. hg19canon vs. hg19full variants for hg19 dbkey.
+ -->
+ <table name="sam_fa_indexes" comment_char="#">
+ <columns>value, dbkey, name, path</columns>
+ <file path="tool-data/sam_fa_new_indices.loc" /></table><!-- Location of Picard dict file and other files --><table name="picard_indexes" comment_char="#">
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffcompare_wrapper.py
--- a/tools/ngs_rna/cuffcompare_wrapper.py
+++ b/tools/ngs_rna/cuffcompare_wrapper.py
@@ -8,20 +8,6 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -30,8 +16,7 @@
parser.add_option( '-s', dest='use_seq_data', action="store_true", help='Causes cuffcompare to look into for fasta files with the underlying genomic sequences (one file per contig) against which your reads were aligned for some optional classification functions. For example, Cufflinks transcripts consisting mostly of lower-case bases are classified as repeats. Note that <seq_dir> must contain one fasta file per reference chromosome, and each file must be named after the chromosome, and have a .fa or .fasta extension.')
# Wrapper / Galaxy options.
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -60,21 +45,16 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffcompare_wrapper.xml
--- a/tools/ngs_rna/cuffcompare_wrapper.xml
+++ b/tools/ngs_rna/cuffcompare_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffcompare" name="Cuffcompare" version="0.0.5">
+<tool id="cuffcompare" name="Cuffcompare" version="0.0.6"><!-- Wrapper supports Cuffcompare versions v1.3.0 and newer --><description>compare assembled transcripts to a reference annotation and track Cufflinks transcripts across multiple experiments</description><requirements>
@@ -17,14 +17,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${seq_data.seq_source.index.fields.path}
#end if
- --dbkey=${first_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -66,7 +64,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffdiff_wrapper.py
--- a/tools/ngs_rna/cuffdiff_wrapper.py
+++ b/tools/ngs_rna/cuffdiff_wrapper.py
@@ -35,20 +35,6 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -83,8 +69,7 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -123,21 +108,16 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffdiff_wrapper.xml
--- a/tools/ngs_rna/cuffdiff_wrapper.xml
+++ b/tools/ngs_rna/cuffdiff_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffdiff" name="Cuffdiff" version="0.0.5">
+<tool id="cuffdiff" name="Cuffdiff" version="0.0.6"><!-- Wrapper supports Cuffdiff versions 2.1.0-2.1.1 --><description>find significant changes in transcript expression, splicing, and promoter use</description><requirements>
@@ -42,14 +42,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${bias_correction.seq_source.index.fields.path}
#end if
- --dbkey=${gtf_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Inputs.
@@ -131,7 +129,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cufflinks_wrapper.py
--- a/tools/ngs_rna/cufflinks_wrapper.py
+++ b/tools/ngs_rna/cufflinks_wrapper.py
@@ -10,20 +10,6 @@
sys.stderr.write( "%s\n" % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -52,8 +38,7 @@
# Bias correction options.
parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Global model.
@@ -82,21 +67,16 @@
# If doing bias correction, set/link to sequence file.
if options.do_bias_correction:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cufflinks_wrapper.xml
--- a/tools/ngs_rna/cufflinks_wrapper.xml
+++ b/tools/ngs_rna/cufflinks_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cufflinks" name="Cufflinks" version="0.0.5">
+<tool id="cufflinks" name="Cufflinks" version="0.0.6"><!-- Wrapper supports Cufflinks versions v1.3.0 and newer --><description>transcript assembly and FPKM (RPKM) estimates for RNA-Seq data</description><requirements>
@@ -28,14 +28,12 @@
## Bias correction?
#if $bias_correction.do_bias_correction == "Yes":
- -b
+ -b
#if $bias_correction.seq_source.index_source == "history":
--ref_file=$bias_correction.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${bias_correction.seq_source.index.fields.path}
#end if
- --dbkey=${input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Multi-read correct?
@@ -66,15 +64,15 @@
<when value="No"></when><when value="Use reference annotation"><param format="gff3,gtf" name="reference_annotation_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
- <when value="Use reference annotation guide">
+ </when>
+ <when value="Use reference annotation guide"><param format="gff3,gtf" name="reference_annotation_guide_file" type="data" label="Reference Annotation" help="Gene annotation dataset in GTF or GFF3 format."/>
- </when>
+ </when></conditional><conditional name="bias_correction"><param name="do_bias_correction" type="select" label="Perform Bias Correction" help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates."><option value="No" selected="true">No</option>
- <option value="Yes">Yes</option>
+ <option value="Yes">Yes</option></param><when value="Yes"><conditional name="seq_source">
@@ -82,7 +80,14 @@
<option value="cached" selected="true">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffmerge_wrapper.py
--- a/tools/ngs_rna/cuffmerge_wrapper.py
+++ b/tools/ngs_rna/cuffmerge_wrapper.py
@@ -8,20 +8,6 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
@@ -31,8 +17,7 @@
# Wrapper / Galaxy options.
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+ parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
# Outputs.
@@ -61,21 +46,16 @@
# Set/link to sequence file.
if options.use_seq_data:
- if options.ref_file != 'None':
+ if options.ref_file:
# Sequence data from history.
# Create symbolic link to ref_file so that index will be created in working directory.
seq_path = "ref.fa"
os.symlink( options.ref_file, seq_path )
else:
# Sequence data from loc file.
- cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
- if seq_path == '':
- stop_err( 'No sequence data found for dbkey %s, so sequence data cannot be used.' % options.dbkey )
+ if not os.path.exists( options.index ):
+ stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+ seq_path = options.index
# Build command.
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/ngs_rna/cuffmerge_wrapper.xml
--- a/tools/ngs_rna/cuffmerge_wrapper.xml
+++ b/tools/ngs_rna/cuffmerge_wrapper.xml
@@ -1,4 +1,4 @@
-<tool id="cuffmerge" name="Cuffmerge" version="0.0.5">
+<tool id="cuffmerge" name="Cuffmerge" version="0.0.6"><!-- Wrapper supports Cuffmerge versions 1.3 and newer --><description>merge together several Cufflinks assemblies</description><requirements>
@@ -16,14 +16,12 @@
## Use sequence data?
#if $seq_data.use_seq_data == "Yes":
- -s
+ -s
#if $seq_data.seq_source.index_source == "history":
--ref_file=$seq_data.seq_source.ref_file
#else:
- --ref_file="None"
+ --index=${seq_data.seq_source.index.fields.path}
#end if
- --dbkey=${first_input.metadata.dbkey}
- --index_dir=${GALAXY_DATA_INDEX_DIR}
#end if
## Outputs.
@@ -64,7 +62,14 @@
<option value="cached">Locally cached</option><option value="history">History</option></param>
- <when value="cached"></when>
+ <when value="cached">
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="first_input" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options>
+ </param>
+ </when><when value="history"><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/samtools/sam_pileup.py
--- a/tools/samtools/sam_pileup.py
+++ b/tools/samtools/sam_pileup.py
@@ -8,8 +8,7 @@
-o, --output1=o: Output pileup
-R, --ref=R: Reference file type
-n, --ownFile=n: User-supplied fasta reference file
- -d, --dbkey=d: dbkey of user-supplied file
- -x, --indexDir=x: Index directory
+ -g, --index=g: Path of the indexed reference genome
-b, --bamIndex=b: BAM index file
-s, --lastCol=s: Print the mapping quality as the last column
-i, --indels=i: Only output lines containing indels
@@ -31,24 +30,9 @@
sys.stderr.write( '%s\n' % msg )
sys.exit()
-def check_seq_file( dbkey, GALAXY_DATA_INDEX_DIR ):
- seqFile = '%s/sam_fa_indices.loc' % GALAXY_DATA_INDEX_DIR
- seqPath = ''
- for line in open( seqFile ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seqPath = fields[2].strip()
- break
- return seqPath
-
def __main__():
#Parse Command Line
options, args = doc_optparse.parse( __doc__ )
- seqPath = check_seq_file( options.dbkey, options.indexDir )
# output version # of tool
try:
tmp = tempfile.NamedTemporaryFile().name
@@ -77,7 +61,6 @@
tmpf1 = tempfile.NamedTemporaryFile( dir=tmpDir )
tmpf1_name = tmpf1.name
tmpf1.close()
- tmpf1fai_name = '%s.fai' % tmpf1_name
#link bam and bam index to working directory (can't move because need to leave original)
os.symlink( options.input1, tmpf0bam_name )
os.symlink( options.bamIndex, tmpf0bambai_name )
@@ -100,9 +83,9 @@
try:
#index reference if necessary and prepare pileup command
if options.ref == 'indexed':
- if not os.path.exists( "%s.fai" % seqPath ):
- raise Exception, "No sequences are available for '%s', request them by reporting this error." % options.dbkey
- cmd = cmd % ( opts, seqPath, tmpf0bam_name, options.output1 )
+ if not os.path.exists( "%s.fai" % options.index ):
+ raise Exception, "Indexed genome %s not present, request it by reporting this error." % options.index
+ cmd = cmd % ( opts, options.index, tmpf0bam_name, options.output1 )
elif options.ref == 'history':
os.symlink( options.ownFile, tmpf1_name )
cmdIndex = 'samtools faidx %s' % ( tmpf1_name )
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/samtools/sam_pileup.xml
--- a/tools/samtools/sam_pileup.xml
+++ b/tools/samtools/sam_pileup.xml
@@ -1,4 +1,4 @@
-<tool id="sam_pileup" name="Generate pileup" version="1.1.1">
+<tool id="sam_pileup" name="Generate pileup" version="1.1.2"><description>from BAM dataset</description><requirements><requirement type="package" version="0.1.16">samtools</requirement>
@@ -11,10 +11,8 @@
#if $refOrHistory.reference == "history":
--ownFile=$refOrHistory.ownFile
#else:
- --ownFile="None"
+ --index=${refOrHistory.index.fields.path}
#end if
- --dbkey=${input1.metadata.dbkey}
- --indexDir=${GALAXY_DATA_INDEX_DIR}
--bamIndex=${input1.metadata.bam_index}
--lastCol=$lastCol
--indels=$indels
@@ -41,7 +39,13 @@
<when value="indexed"><param name="input1" type="data" format="bam" label="Select the BAM file to generate the pileup file for"><validator type="unspecified_build" />
- <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
+ </param>
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input1" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options></param></when><when value="history">
@@ -100,6 +104,7 @@
--><param name="reference" value="indexed" /><param name="input1" value="sam_pileup_in1.bam" ftype="bam" dbkey="equCab2" />
+ <param name="index" value="chr_m" /><param name="lastCol" value="no" /><param name="indels" value="no" /><param name="mapCap" value="60" />
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/samtools/sam_to_bam.py
--- a/tools/samtools/sam_to_bam.py
+++ b/tools/samtools/sam_to_bam.py
@@ -3,43 +3,24 @@
Converts SAM data to sorted BAM data.
usage: sam_to_bam.py [options]
--input1: SAM file to be converted
- --dbkey: dbkey value
+ --index: path of the indexed reference genome
--ref_file: Reference file if choosing from history
--output1: output dataset in bam format
- --index_dir: GALAXY_DATA_INDEX_DIR
"""
-import optparse, os, sys, subprocess, tempfile, shutil, gzip
-from galaxy import eggs
-import pkg_resources; pkg_resources.require( "bx-python" )
-from bx.cookbook import doc_optparse
-from galaxy import util
+import optparse, os, sys, subprocess, tempfile, shutil
def stop_err( msg ):
sys.stderr.write( '%s\n' % msg )
sys.exit()
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
- seq_path = ''
- for line in open( cached_seqs_pointer_file ):
- line = line.rstrip( '\r\n' )
- if line and not line.startswith( '#' ) and line.startswith( 'index' ):
- fields = line.split( '\t' )
- if len( fields ) < 3:
- continue
- if fields[1] == dbkey:
- seq_path = fields[2].strip()
- break
- return seq_path
-
def __main__():
#Parse Command Line
parser = optparse.OptionParser()
parser.add_option( '', '--input1', dest='input1', help='The input SAM dataset' )
- parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
+ parser.add_option( '', '--index', dest='index', help='The path of the indexed reference genome' )
parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
parser.add_option( '', '--output1', dest='output1', help='The output BAM dataset' )
- parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
( options, args ) = parser.parse_args()
# output version # of tool
@@ -61,24 +42,17 @@
except:
sys.stdout.write( 'Could not determine Samtools version\n' )
- cached_seqs_pointer_file = '%s/sam_fa_indices.loc' % options.index_dir
- if not os.path.exists( cached_seqs_pointer_file ):
- stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
- # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
- # and the equCab2.fa file will contain fasta sequences.
- seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
tmp_dir = tempfile.mkdtemp()
if not options.ref_file or options.ref_file == 'None':
# We're using locally cached reference sequences( e.g., /galaxy/data/equCab2/sam_index/equCab2.fa ).
# The indexes for /galaxy/data/equCab2/sam_index/equCab2.fa will be contained in
# a file named /galaxy/data/equCab2/sam_index/equCab2.fa.fai
- fai_index_file_base = seq_path
- fai_index_file_path = '%s.fai' % seq_path
+ fai_index_file_path = '%s.fai' % options.index
if not os.path.exists( fai_index_file_path ):
#clean up temp files
if os.path.exists( tmp_dir ):
shutil.rmtree( tmp_dir )
- stop_err( 'No sequences are available for build (%s), request them by reporting this error.' % options.dbkey )
+ stop_err( 'Indexed genome %s not present, request it by reporting this error.' % options.index )
else:
try:
# Create indexes for history reference ( e.g., ~/database/files/000/dataset_1.dat ) using samtools faidx, which will:
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/samtools/sam_to_bam.xml
--- a/tools/samtools/sam_to_bam.xml
+++ b/tools/samtools/sam_to_bam.xml
@@ -1,4 +1,4 @@
-<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.2">
+<tool id="sam_to_bam" name="SAM-to-BAM" version="1.1.3"><description>converts SAM format to BAM format</description><requirements><requirement type="package">samtools</requirement>
@@ -7,13 +7,11 @@
sam_to_bam.py
--input1=$source.input1
#if $source.index_source == "history":
- --dbkey=${ref_file.metadata.dbkey}
--ref_file=$source.ref_file
#else
- --dbkey=${input1.metadata.dbkey}
+ --index=${source.index.fields.path}
#end if
--output1=$output1
- --index_dir=${GALAXY_DATA_INDEX_DIR}
</command><inputs><conditional name="source">
@@ -22,13 +20,19 @@
<option value="history">History</option></param><when value="cached">
- <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM File to Convert">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_file" filename="sam_fa_indices.loc" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." line_startswith="index" />
+ <param name="input1" type="data" format="sam" metadata_name="dbkey" label="SAM file to convert">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
+ </param>
+ <param name="index" type="select" label="Using reference genome">
+ <options from_data_table="sam_fa_indexes">
+ <filter type="data_meta" ref="input1" key="dbkey" column="1" />
+ <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
+ </options></param></when><when value="history">
- <param name="input1" type="data" format="sam" label="Convert SAM file" />
+ <param name="input1" type="data" format="sam" label="SAM file to convert" /><param name="ref_file" type="data" format="fasta" metadata_name="dbkey" label="Using reference file" /></when></conditional>
@@ -76,6 +80,7 @@
--><param name="index_source" value="cached" /><param name="input1" value="sam_to_bam_in1.sam" ftype="sam" dbkey="chrM" />
+ <param name="index" value="chr_m" /><output name="output1" file="sam_to_bam_out2.bam" ftype="bam" /></test></tests>
diff -r fc9b51ce979861604abaa9da6b15977f1238957d -r 7538c4cb86dcb9383ece63152f623d3c5e517256 tools/samtools/samtools_mpileup.xml
--- a/tools/samtools/samtools_mpileup.xml
+++ b/tools/samtools/samtools_mpileup.xml
@@ -1,4 +1,4 @@
-<tool id="samtools_mpileup" name="MPileup" version="0.0.1">
+<tool id="samtools_mpileup" name="MPileup" version="0.0.2"><description>SNP and indel caller</description><requirements><requirement type="package">samtools</requirement>
@@ -59,22 +59,22 @@
</param><when value="cached"><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file">
- <validator type="unspecified_build" />
- <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="value" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file">
+ <validator type="unspecified_build" />
+ <validator type="dataset_metadata_in_data_table" table_name="sam_fa_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." /><!-- fixme!!! this needs to be a select -->
+ </param></repeat><param name="ref_file" type="select" label="Using reference genome"><options from_data_table="sam_fa_indexes">
- <!-- <filter type="data_meta" key="dbkey" ref="input_bam" column="value"/> does not yet work in a repeat...-->
+ <!-- <filter type="data_meta" ref="input_bam" key="dbkey" column="1" /> does not yet work in a repeat...--></options></param></when><when value="history"><!-- FIX ME!!!! --><repeat name="input_bams" title="BAM file" min="1">
- <param name="input_bam" type="data" format="bam" label="BAM file" >
- <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue."/>
- </param>
+ <param name="input_bam" type="data" format="bam" label="BAM file">
+ <validator type="metadata" check="bam_index" message="Metadata missing, click the pencil icon in the history item and use the auto-detect feature to correct this issue." />
+ </param></repeat><param name="ref_file" type="data" format="fasta" label="Using reference file" /></when>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix for managing tool dependencies for an installed tool shed repository.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fc9b51ce9798/
Changeset: fc9b51ce9798
User: greg
Date: 2013-06-24 16:36:01
Summary: Fix for managing tool dependencies for an installed tool shed repository.
Affected #: 1 file
diff -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 -r fc9b51ce979861604abaa9da6b15977f1238957d templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
@@ -35,7 +35,7 @@
else:
error_message = ''
if not can_install:
- if tool_dependency.status not in [ trans.model.ToolDependency.installation_status.INSTALLED ]:
+ if tool_dependency.status in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
can_install = True
if not can_uninstall:
if tool_dependency.status not in [ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Enhance the Galaxy API for installing tool shed repositories to make sure the tool_dependency_dir setting is defined in the Galaxy configuration file if installing tool dependencies along with repositories.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dc6e0347edff/
Changeset: dc6e0347edff
User: greg
Date: 2013-06-24 15:47:46
Summary: Enhance the Galaxy API for installing tool shed repositories to make sure the tool_dependency_dir setting is defined in the Galaxy configuration file if installing tool dependencies along with repositories.
Affected #: 1 file
diff -r acc4a2270e6a45ec03976fd53fb7b55da7b3fabc -r dc6e0347edffb96fe4e633b362ad21a9f5a83e81 lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -179,6 +179,11 @@
# Get the information about the Galaxy components (e.g., tool pane section, tool config file, etc) that will contain the repository information.
install_repository_dependencies = payload.get( 'install_repository_dependencies', False )
install_tool_dependencies = payload.get( 'install_tool_dependencies', False )
+ if install_tool_dependencies:
+ if trans.app.config.tool_dependency_dir is None:
+ no_tool_dependency_dir_message = "Tool dependencies can be automatically installed only if you set the value of your 'tool_dependency_dir' "
+ no_tool_dependency_dir_message += "setting in your Galaxy configuration file (universe_wsgi.ini) and restart your Galaxy server."
+ raise HTTPBadRequest( detail=no_tool_dependency_dir_message )
new_tool_panel_section = payload.get( 'new_tool_panel_section_label', '' )
shed_tool_conf = payload.get( 'shed_tool_conf', None )
if shed_tool_conf:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add the threadpool_kill_thread_limit setting to the tool shed's sample configuration file.
by commits-noreply@bitbucket.org 24 Jun '13
by commits-noreply@bitbucket.org 24 Jun '13
24 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/acc4a2270e6a/
Changeset: acc4a2270e6a
User: greg
Date: 2013-06-24 15:44:58
Summary: Add the threadpool_kill_thread_limit setting to the tool shed's sample configuration file.
Affected #: 1 file
diff -r 4f7b7e4ca213498824d5fba7526676ddf976b823 -r acc4a2270e6a45ec03976fd53fb7b55da7b3fabc tool_shed_wsgi.ini.sample
--- a/tool_shed_wsgi.ini.sample
+++ b/tool_shed_wsgi.ini.sample
@@ -12,6 +12,8 @@
use_threadpool = true
threadpool_workers = 10
+# Set the number of seconds a thread can work before you should kill it (assuming it will never finish) to 3 hours.
+threadpool_kill_thread_limit = 10800
# ---- Galaxy Webapps Community Interface -------------------------------------------------
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Add more package requirements for datatype converters
by commits-noreply@bitbucket.org 21 Jun '13
by commits-noreply@bitbucket.org 21 Jun '13
21 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4f7b7e4ca213/
Changeset: 4f7b7e4ca213
User: dannon
Date: 2013-06-21 20:55:12
Summary: Add more package requirements for datatype converters
Affected #: 3 files
diff -r b31177004e80656b8efdb553291244b2a3e53d6f -r 4f7b7e4ca213498824d5fba7526676ddf976b823 lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/bed_gff_or_vcf_to_bigwig_converter.xml
@@ -1,5 +1,9 @@
<tool id="CONVERTER_bed_gff_or_vcf_to_bigwig_0" name="Convert BED, GFF, or VCF to BigWig" version="1.0.0" hidden="true"><!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
## Remove comments and sort by chromosome.
grep -v '^#' $input | sort -k1,1 |
diff -r b31177004e80656b8efdb553291244b2a3e53d6f -r 4f7b7e4ca213498824d5fba7526676ddf976b823 lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/interval_to_bigwig_converter.xml
@@ -1,6 +1,10 @@
<tool id="CONVERTER_interval_to_bigwig_0" name="Convert Genomic Intervals To Coverage"><!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> --><!-- Used on the metadata edit page. -->
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
## Remove comments and sort by chromosome.
diff -r b31177004e80656b8efdb553291244b2a3e53d6f -r 4f7b7e4ca213498824d5fba7526676ddf976b823 lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
--- a/lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
+++ b/lib/galaxy/datatypes/converters/sam_to_bigwig_converter.xml
@@ -1,4 +1,9 @@
<tool id="CONVERTER_sam_to_bigwig_0" name="Convert SAM to BigWig" version="1.0.0" hidden="true">
+ <requirements>
+ <requirement type="package">ucsc_tools</requirement>
+ <requirement type="package">samtools</requirement>
+ <requirement type="package">bedtools</requirement>
+ </requirements><command>
samtools view -bh $input | bedtools genomecov -bg -split -ibam stdin -g $chromInfo
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Enhance tool shed repository installation process to automatically reset the attributes of a previously installed repository (that is no longer in the installed state) so that it can be installed. This streamlines the installation process when installing multiple repositories so that one or more of them do not need to be uninstalled.
by commits-noreply@bitbucket.org 21 Jun '13
by commits-noreply@bitbucket.org 21 Jun '13
21 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b31177004e80/
Changeset: b31177004e80
User: greg
Date: 2013-06-21 20:03:03
Summary: Enhance tool shed repository installation process to automatically reset the attributes of a previously installed repository (that is no longer in the installed state) so that it can be installed. This streamlines the installation process when installing multiple repositories so that one or more of them do not need to be uninstalled.
Affected #: 3 files
diff -r ecda22758c813923fee40c2a0b07c84427d24bd9 -r b31177004e80656b8efdb553291244b2a3e53d6f lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -147,41 +147,48 @@
dist_to_shed = installed_tool_shed_repository.dist_to_shed
elif installed_tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.DEACTIVATED ]:
# The current tool shed repository is deactivated, so updating it's database record is not necessary - just activate it.
+ log.debug( "Reactivating deactivated tool_shed_repository '%s'." % str( installed_tool_shed_repository.name ) )
common_install_util.activate_repository( trans, installed_tool_shed_repository )
can_update = False
else:
# The tool shed repository currently being processed is already installed or is in the process of being installed, so it's record
# in the database cannot be updated.
+ if installed_tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.INSTALLED ]:
+ log.debug( "Skipping installation of tool_shed_repository '%s' because it is already installed." % \
+ str( installed_tool_shed_repository.name ) )
+ else:
+ log.debug( "Skipping installation of tool_shed_repository '%s' because it's installation status is '%s'." % \
+ ( str( installed_tool_shed_repository.name ), str( installed_tool_shed_repository.status ) ) )
can_update = False
else:
# This block will be reached only if reinstalling is True, install_repository_dependencies is False and is_in_repo_info_dicts is False.
# The tool shed repository currently being processed must be a repository dependency that the user elected to not install, so it's
# record in the database cannot be updated.
+ debug_msg = "Skipping installation of tool_shed_repository '%s' because it is likely a " % str( installed_tool_shed_repository.name )
+ debug_msg += "repository dependency that was elected to not be installed."
+ log.debug( debug_msg )
can_update = False
else:
# This block will be reached only if reinstalling is False and install_repository_dependencies is False. This implies that the tool shed
# repository currently being processed has already been installed.
- if len( all_repo_info_dicts ) == 1:
- # If only a single repository is being installed, return an informative message to the user.
- message += "Revision <b>%s</b> of tool shed repository <b>%s</b> owned by <b>%s</b> " % ( changeset_revision, name, repository_owner )
- if installed_changeset_revision != changeset_revision:
- message += "was previously installed using changeset revision <b>%s</b>. " % installed_changeset_revision
- else:
- message += "was previously installed. "
- if installed_tool_shed_repository.uninstalled:
- message += "The repository has been uninstalled, however, so reinstall the original repository instead of installing it again. "
- elif installed_tool_shed_repository.deleted:
- message += "The repository has been deactivated, however, so activate the original repository instead of installing it again. "
- if installed_changeset_revision != changeset_revision:
- message += "You can get the latest updates for the repository using the <b>Get updates</b> option from the repository's "
- message += "<b>Repository Actions</b> pop-up menu. "
- created_or_updated_tool_shed_repositories.append( installed_tool_shed_repository )
- tool_panel_section_keys.append( tool_panel_section_key )
- return created_or_updated_tool_shed_repositories, tool_panel_section_keys, all_repo_info_dicts, filtered_repo_info_dicts, message
+ if installed_tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.INSTALLED ]:
+ # Since the repository currently being processed is already in the INSTALLED state, skip it and process the next repository in the
+ # list if there is one.
+ log.debug( "Skipping installation of tool_shed_repository '%s' because it's installation status is '%s'." % \
+ ( str( installed_tool_shed_repository.name ), str( installed_tool_shed_repository.status ) ) )
+ can_update = False
else:
- # We're in the process of installing multiple tool shed repositories into Galaxy. Since the repository currently being processed
- # has already been installed, skip it and process the next repository in the list.
- can_update = False
+ # The repository currently being processed is in some state other than INSTALLED, so reset it for installation.
+ debug_msg = "Resetting tool_shed_repository '%s' for installation.\n" % str( installed_tool_shed_repository.name )
+ debug_msg += "The current state of the tool_shed_repository is:\n"
+ debug_msg += "deleted: %s\n" % str( installed_tool_shed_repository.deleted )
+ debug_msg += "update_available: %s\n" % str( installed_tool_shed_repository.update_available )
+ debug_msg += "uninstalled: %s\n" % str( installed_tool_shed_repository.uninstalled )
+ debug_msg += "status: %s\n" % str( installed_tool_shed_repository.status )
+ debug_msg += "error_message: %s\n" % str( installed_tool_shed_repository.error_message )
+ log.debug( debug_msg )
+ suc.reset_previously_installed_repository( trans, installed_tool_shed_repository )
+ can_update = True
else:
# A tool shed repository is being installed into a Galaxy instance for the first time, or we're attempting to install it or reinstall it resulted
# in an error. In the latter case, the repository record in the database has no metadata and it's status has been set to 'New'. In either case,
diff -r ecda22758c813923fee40c2a0b07c84427d24bd9 -r b31177004e80656b8efdb553291244b2a3e53d6f lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1182,6 +1182,19 @@
return tool_shed_repository, previous_changeset_revision
return None, None
+def reset_previously_installed_repository( trans, repository ):
+ """
+ Reset the atrributes of a tool_shed_repository that was previsouly installed. The repository will be in some state other than with a
+ status of INSTALLED, so all atributes will be set to the default NEW state. This will enable the repository to be freshly installed.
+ """
+ repository.deleted = False
+ repository.update_available = False
+ repository.uninstalled = False
+ repository.status = trans.model.ToolShedRepository.installation_status.NEW
+ repository.error_message = None
+ trans.sa_session.add( repository )
+ trans.sa_session.flush()
+
def reversed_lower_upper_bounded_changelog( repo, excluded_lower_bounds_changeset_revision, included_upper_bounds_changeset_revision ):
"""
Return a reversed list of changesets in the repository changelog after the excluded_lower_bounds_changeset_revision, but up to and
diff -r ecda22758c813923fee40c2a0b07c84427d24bd9 -r b31177004e80656b8efdb553291244b2a3e53d6f test/tool_shed/functional/test_1000_install_basic_repository.py
--- a/test/tool_shed/functional/test_1000_install_basic_repository.py
+++ b/test/tool_shed/functional/test_1000_install_basic_repository.py
@@ -106,20 +106,21 @@
self.verify_tool_metadata_for_installed_repository( installed_repository )
def test_0030_install_filtering_repository_again( self ):
- '''Attempt to install the already installed filtering repository, and check for the resulting error message.'''
+ '''Attempt to install the already installed filtering repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
- post_submit_strings_displayed = [ installed_repository.name,
- installed_repository.owner,
- installed_repository.installed_changeset_revision,
- 'was previously installed',
- 'to manage the repository' ]
+ # The page displayed after installation is the ajaxian "Montior installing tool shed repositories" page. Since the filter
+ # repository was already installed, nothing will be in the process of being installed, so the grid will display 'No Items'.
+ post_submit_strings_displayed = [ 'No Items' ]
self.install_repository( 'filtering_0000',
common.test_user_1_name,
'Test 0000 Basic Repository Features 1',
post_submit_strings_displayed=post_submit_strings_displayed )
strings_displayed = [ 'filtering_0000',
- 'user1',
+ "Galaxy's filtering tool",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
+ self.display_installed_repository_manage_page( installed_repository, strings_displayed=strings_displayed )
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
def test_0035_verify_installed_repository_metadata( self ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Add semicolon to the list of delimiters in the 'Convert delimiters to whitespace tool'.
by commits-noreply@bitbucket.org 21 Jun '13
by commits-noreply@bitbucket.org 21 Jun '13
21 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ecda22758c81/
Changeset: ecda22758c81
User: jgoecks
Date: 2013-06-21 17:59:13
Summary: Add semicolon to the list of delimiters in the 'Convert delimiters to whitespace tool'.
Affected #: 2 files
diff -r 01dd0d00de0112b53c05eac5fe3ffbb6ce1526b1 -r ecda22758c813923fee40c2a0b07c84427d24bd9 tools/filters/convert_characters.py
--- a/tools/filters/convert_characters.py
+++ b/tools/filters/convert_characters.py
@@ -24,7 +24,17 @@
except:
stop_err("Output file cannot be opened for writing.")
- char_dict = {'T':'\t','s':'\s','Dt':'\.','C':',','D':'-','U':'_','P':'\|','Co':':'}
+ char_dict = {
+ 'T': '\t',
+ 's': '\s',
+ 'Dt': '\.',
+ 'C': ',',
+ 'D': '-',
+ 'U': '_',
+ 'P': '\|',
+ 'Co': ':',
+ 'Sc': ';'
+ }
from_ch = char_dict[from_char] + '+' #making an RE to match 1 or more occurences.
skipped = 0
diff -r 01dd0d00de0112b53c05eac5fe3ffbb6ce1526b1 -r ecda22758c813923fee40c2a0b07c84427d24bd9 tools/filters/convert_characters.xml
--- a/tools/filters/convert_characters.xml
+++ b/tools/filters/convert_characters.xml
@@ -12,6 +12,7 @@
<option value="U">Underscores</option><option value="P">Pipes</option><option value="Co">Colons</option>
+ <option value="Sc">Semicolons</option></param><param format="txt" name="input" type="data" label="in Dataset"/></inputs>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix for generating information about a repository being installed that has no defined repository dependencies.
by commits-noreply@bitbucket.org 21 Jun '13
by commits-noreply@bitbucket.org 21 Jun '13
21 Jun '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/01dd0d00de01/
Changeset: 01dd0d00de01
User: greg
Date: 2013-06-21 17:56:20
Summary: Fix for generating information about a repository being installed that has no defined repository dependencies.
Affected #: 1 file
diff -r b5887125a2164ef4552464031d78dd783f08f06b -r 01dd0d00de0112b53c05eac5fe3ffbb6ce1526b1 lib/tool_shed/util/common_install_util.py
--- a/lib/tool_shed/util/common_install_util.py
+++ b/lib/tool_shed/util/common_install_util.py
@@ -74,6 +74,7 @@
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td = \
suc.get_repo_info_tuple_contents( repo_info_tuple )
if repository_dependencies:
+ # We have a repository with one or more defined repository dependencies.
missing_td = {}
# Handle the scenario where a repository was installed, then uninstalled and an error occurred during the re-installation process.
# In this case, a record for the repository will exist in the database with the status of 'New'.
@@ -125,9 +126,13 @@
if td_key not in missing_td:
missing_td[ td_key ] = td_dict
else:
- has_repository_dependencies = False
- includes_tools = False
- includes_tools_for_display_in_tool_panel = False
+ # We have a single repository with no defined repository dependencies.
+ all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) )
+ has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False )
+ includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
+ includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False )
+ includes_tools = all_repo_info_dict.get( 'includes_tools', False )
+ required_repo_info_dicts = all_repo_info_dict.get( 'all_repo_info_dicts', [] )
installed_rd = None
missing_rd = None
missing_td = None
@@ -293,6 +298,10 @@
for components_list in val:
if components_list not in required_repository_tups:
required_repository_tups.append( components_list )
+ else:
+ # We have a single repository with no dependencies.
+ components_list = [ tool_shed_url, repository_name, repository_owner, changeset_revision, 'False' ]
+ required_repository_tups.append( components_list )
if required_repository_tups:
# The value of required_repository_tups is a list of tuples, so we need to encode it.
encoded_required_repository_tups = []
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0