galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
April 2014
- 1 participants
- 261 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/888478c66456/
Changeset: 888478c66456
Branch: next-stable
User: greg
Date: 2014-04-04 17:55:24
Summary: Enhance error message displayed when installing a repository into Galaxy that has an invalid repository dependency definiton.
Affected #: 1 file
diff -r 64d677b1e16ab79a60f91b315ecc8bee7505281c -r 888478c664569310b972ab8be495c275beed22a0 lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2558,7 +2558,11 @@
invalid = True
break
if invalid:
- message += 'The repository dependency definitions for this repository are invalid and will be ignored.'
+ message += 'The repository dependency definitions for this repository are invalid and will be ignored. '
+ message += 'The complete dependency hierarchy could not be determined. The cause of repository dependency '
+ message += 'definition errors like this can usually be seen when viewing the repository directly from the'
+ message += 'Tool Shed. The exact cause cannot be determined when visiting the Tool Shed from Galaxy to'
+ message += 'install the repository.'
status = 'error'
else:
repository_metadata_id = None
https://bitbucket.org/galaxy/galaxy-central/commits/4cb9c5ed03c9/
Changeset: 4cb9c5ed03c9
User: greg
Date: 2014-04-04 17:55:45
Summary: Merged next-stable
Affected #: 1 file
diff -r fd96caa42a4397db660ddd5c24e8c94c7b1c9d3e -r 4cb9c5ed03c9fef9972fa0a4bab275db1e0b1b8a lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2558,7 +2558,11 @@
invalid = True
break
if invalid:
- message += 'The repository dependency definitions for this repository are invalid and will be ignored.'
+ message += 'The repository dependency definitions for this repository are invalid and will be ignored. '
+ message += 'The complete dependency hierarchy could not be determined. The cause of repository dependency '
+ message += 'definition errors like this can usually be seen when viewing the repository directly from the'
+ message += 'Tool Shed. The exact cause cannot be determined when visiting the Tool Shed from Galaxy to'
+ message += 'install the repository.'
status = 'error'
else:
repository_metadata_id = None
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/64d677b1e16a/
Changeset: 64d677b1e16a
Branch: next-stable
User: dan
Date: 2014-04-04 17:46:03
Summary: Provide a full URL including protocol in activation emails.
Affected #: 1 file
diff -r 583cf942ebc798e1038e00883a4af9b160ced30f -r 64d677b1e16ab79a60f91b315ecc8bee7505281c lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -804,7 +804,7 @@
Prepares the account activation link for the user.
"""
activation_token = self.get_activation_token( trans, email )
- activation_link = str( trans.request.host ) + url_for( controller='user', action='activate' ) + "?activation_token=" + str( activation_token ) + "&email=" + urllib.quote( email )
+ activation_link = url_for( controller='user', action='activate', activation_token=activation_token, email=email, qualified=True )
return activation_link
def get_activation_token ( self, trans, email ):
https://bitbucket.org/galaxy/galaxy-central/commits/fd96caa42a43/
Changeset: fd96caa42a43
User: dan
Date: 2014-04-04 17:46:24
Summary: merge next stable
Affected #: 1 file
diff -r 14dedba28a71a4826e8dc6bffe345756b449e143 -r fd96caa42a4397db660ddd5c24e8c94c7b1c9d3e lib/galaxy/webapps/galaxy/controllers/user.py
--- a/lib/galaxy/webapps/galaxy/controllers/user.py
+++ b/lib/galaxy/webapps/galaxy/controllers/user.py
@@ -804,7 +804,7 @@
Prepares the account activation link for the user.
"""
activation_token = self.get_activation_token( trans, email )
- activation_link = str( trans.request.host ) + url_for( controller='user', action='activate' ) + "?activation_token=" + str( activation_token ) + "&email=" + urllib.quote( email )
+ activation_link = url_for( controller='user', action='activate', activation_token=activation_token, email=email, qualified=True )
return activation_link
def get_activation_token ( self, trans, email ):
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/583cf942ebc7/
Changeset: 583cf942ebc7
Branch: next-stable
User: greg
Date: 2014-04-04 17:39:48
Summary: Render tool shed features based on a combination of the webapp and a rendor_for value. Things get tricky when visiting the tool shed from galaxy to install repositories.
Affected #: 1 file
diff -r 3e211eba99bde29b3d4bcf161a041864d2de6905 -r 583cf942ebc798e1038e00883a4af9b160ced30f templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -319,21 +319,21 @@
${render_folder( sub_folder, pad, parent=my_row, row_counter=row_counter, is_root_folder=False, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for readme in folder.readme_files:
- ${render_readme( readme, pad, my_row, row_counter )}
+ ${render_readme( readme, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for invalid_repository_dependency in folder.invalid_repository_dependencies:
- ${render_invalid_repository_dependency( invalid_repository_dependency, pad, my_row, row_counter )}
+ ${render_invalid_repository_dependency( invalid_repository_dependency, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for index, repository_dependency in enumerate( folder.repository_dependencies ):
<% row_is_header = index == 0 %>
- ${render_repository_dependency( repository_dependency, pad, my_row, row_counter, row_is_header )}
+ ${render_repository_dependency( repository_dependency, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for invalid_tool_dependency in folder.invalid_tool_dependencies:
- ${render_invalid_tool_dependency( invalid_tool_dependency, pad, my_row, row_counter )}
+ ${render_invalid_tool_dependency( invalid_tool_dependency, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for index, tool_dependency in enumerate( folder.tool_dependencies ):
<% row_is_header = index == 0 %>
- ${render_tool_dependency( tool_dependency, pad, my_row, row_counter, row_is_header )}
+ ${render_tool_dependency( tool_dependency, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%if folder.valid_tools:
%for index, tool in enumerate( folder.valid_tools ):
@@ -353,74 +353,74 @@
%if folder.datatypes:
%for index, datatype in enumerate( folder.datatypes ):
<% row_is_header = index == 0 %>
- ${render_datatype( datatype, pad, my_row, row_counter, row_is_header )}
+ ${render_datatype( datatype, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.valid_data_managers:
%for index, data_manager in enumerate( folder.valid_data_managers ):
<% row_is_header = index == 0 %>
- ${render_valid_data_manager( data_manager, pad, my_row, row_counter, row_is_header )}
+ ${render_valid_data_manager( data_manager, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.invalid_data_managers:
%for index, data_manager in enumerate( folder.invalid_data_managers ):
<% row_is_header = index == 0 %>
- ${render_invalid_data_manager( data_manager, pad, my_row, row_counter, row_is_header )}
+ ${render_invalid_data_manager( data_manager, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.test_environments:
%for test_environment in folder.test_environments:
- ${render_test_environment( test_environment, pad, my_row, row_counter )}
+ ${render_test_environment( test_environment, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.failed_tests:
%for failed_test in folder.failed_tests:
- ${render_failed_test( failed_test, pad, my_row, row_counter )}
+ ${render_failed_test( failed_test, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.not_tested:
%for not_tested in folder.not_tested:
- ${render_not_tested( not_tested, pad, my_row, row_counter )}
+ ${render_not_tested( not_tested, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.passed_tests:
%for passed_test in folder.passed_tests:
- ${render_passed_test( passed_test, pad, my_row, row_counter )}
+ ${render_passed_test( passed_test, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.missing_test_components:
%for missing_test_component in folder.missing_test_components:
- ${render_missing_test_component( missing_test_component, pad, my_row, row_counter )}
+ ${render_missing_test_component( missing_test_component, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.tool_dependency_installation_errors:
%for tool_dependency_installation_error in folder.tool_dependency_installation_errors:
- ${render_tool_dependency_installation_error( tool_dependency_installation_error, pad, my_row, row_counter )}
+ ${render_tool_dependency_installation_error( tool_dependency_installation_error, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.tool_dependency_successful_installations:
%for tool_dependency_successful_installation in folder.tool_dependency_successful_installations:
- ${render_tool_dependency_successful_installation( tool_dependency_successful_installation, pad, my_row, row_counter )}
+ ${render_tool_dependency_successful_installation( tool_dependency_successful_installation, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.repository_installation_errors:
%for repository_installation_error in folder.repository_installation_errors:
- ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=False )}
+ ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=False, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.current_repository_installation_errors:
%for repository_installation_error in folder.current_repository_installation_errors:
- ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=True )}
+ ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=True, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.repository_successful_installations:
%for repository_successful_installation in folder.repository_successful_installations:
- ${render_repository_successful_installation( repository_successful_installation, pad, my_row, row_counter )}
+ ${render_repository_successful_installation( repository_successful_installation, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
</%def>
-<%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( datatype.id )
if row_is_header:
@@ -444,7 +444,7 @@
%></%def>
-<%def name="render_failed_test( failed_test, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_failed_test( failed_test, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from tool_shed.util.shed_util_common import to_html_string
encoded_id = trans.security.encode_id( failed_test.id )
@@ -470,7 +470,7 @@
%></%def>
-<%def name="render_invalid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_invalid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( data_manager.id )
if row_is_header:
@@ -492,7 +492,7 @@
%></%def>
-<%def name="render_invalid_repository_dependency( invalid_repository_dependency, pad, parent, row_counter )">
+<%def name="render_invalid_repository_dependency( invalid_repository_dependency, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( invalid_repository_dependency.id )
%>
@@ -534,7 +534,7 @@
%></%def>
-<%def name="render_invalid_tool_dependency( invalid_tool_dependency, pad, parent, row_counter )">
+<%def name="render_invalid_tool_dependency( invalid_tool_dependency, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( invalid_tool_dependency.id )
%>
@@ -565,7 +565,7 @@
%></%def>
-<%def name="render_missing_test_component( missing_test_component, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_missing_test_component( missing_test_component, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( missing_test_component.id )
%>
@@ -589,7 +589,7 @@
%></%def>
-<%def name="render_readme( readme, pad, parent, row_counter )">
+<%def name="render_readme( readme, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><% encoded_id = trans.security.encode_id( readme.id ) %><tr class="datasetRow"
%if parent is not None:
@@ -608,7 +608,7 @@
%></%def>
-<%def name="render_repository_dependency( repository_dependency, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_repository_dependency( repository_dependency, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import asbool
from tool_shed.util.shed_util_common import get_repository_by_name_and_owner
@@ -634,6 +634,7 @@
cell_type = 'th'
else:
cell_type = 'td'
+ rd = None
else:
# We're in the tool shed.
cell_type = 'td'
@@ -665,7 +666,7 @@
</${cell_type}>
%else:
<td style="padding-left: ${pad+20}px;">
- %if rd:
+ %if render_repository_actions_for == 'tool_shed' and rd:
<a class="view-info" href="${h.url_for( controller='repository', action='view_or_manage_repository', id=trans.security.encode_id( rd.id ), changeset_revision=changeset_revision )}">Repository <b>${repository_name | h}</b> revision <b>${changeset_revision | h}</b> owned by <b>${repository_owner | h}</b></a>${prior_installation_required_str}
%else:
Repository <b>${repository_name | h}</b> revision <b>${changeset_revision | h}</b> owned by <b>${repository_owner | h}</b>${prior_installation_required_str}
@@ -694,7 +695,7 @@
</style></%def>
-<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import unicodify
encoded_id = trans.security.encode_id( installation_error.id )
@@ -725,7 +726,7 @@
%></%def>
-<%def name="render_tool_dependency_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_tool_dependency_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( successful_installation.id )
%>
@@ -755,7 +756,7 @@
%></%def>
-<%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False )">
+<%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import unicodify
encoded_id = trans.security.encode_id( installation_error.id )
@@ -789,7 +790,7 @@
%></%def>
-<%def name="render_repository_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, is_current_repository=False )">
+<%def name="render_repository_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, is_current_repository=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( successful_installation.id )
%>
@@ -820,7 +821,7 @@
%></%def>
-<%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( not_tested.id )
%>
@@ -841,7 +842,7 @@
%></%def>
-<%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( passed_test.id )
%>
@@ -882,19 +883,20 @@
%else:
<td style="padding-left: ${pad+20}px;">
%if tool.repository_id:
- %if trans.webapp.name == 'tool_shed':
- <div style="float:left;" class="menubutton split popup" id="tool-${encoded_id}-popup">
- <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( tool.repository_id ), tool_config=tool.tool_config, changeset_revision=tool.changeset_revision, render_repository_actions_for=render_repository_actions_for )}">${tool.name | h}</a>
- </div>
- <div popupmenu="tool-${encoded_id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id, render_repository_actions_for=render_repository_actions_for )}">View tool metadata</a>
- </div>
- %else:
+ <div style="float:left;" class="menubutton split popup" id="tool-${encoded_id}-popup">
+ <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( tool.repository_id ), tool_config=tool.tool_config, changeset_revision=tool.changeset_revision, render_repository_actions_for=render_repository_actions_for )}">${tool.name | h}</a>
+ </div>
+ <div popupmenu="tool-${encoded_id}-popup">
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id, render_repository_actions_for=render_repository_actions_for )}">View tool metadata</a>
+ </div>
+ %if trans.webapp.name == 'galaxy':
%if tool.repository_installation_status == trans.install_model.ToolShedRepository.installation_status.INSTALLED:
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id )}">${tool.name | h}</a>
%else:
${tool.name | h}
%endif
+ %else:
+ ${tool.name | h}
%endif
%else:
${tool.name | h}
@@ -911,7 +913,7 @@
%></%def>
-<%def name="render_tool_dependency( tool_dependency, pad, parent, row_counter, row_is_header )">
+<%def name="render_tool_dependency( tool_dependency, pad, parent, row_counter, row_is_header, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import string_as_bool
encoded_id = trans.security.encode_id( tool_dependency.id )
@@ -967,7 +969,7 @@
%></%def>
-<%def name="render_test_environment( test_environment, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_test_environment( test_environment, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><% encoded_id = trans.security.encode_id( test_environment.id ) %><tr class="datasetRow"
%if parent is not None:
@@ -994,7 +996,7 @@
%></%def>
-<%def name="render_valid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_valid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( data_manager.id )
if row_is_header:
@@ -1109,7 +1111,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="readme_files">
- ${render_folder( readme_files_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( readme_files_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table></div></div>
@@ -1122,42 +1124,42 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_repository_dependencies">
- ${render_folder( invalid_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if missing_repository_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="missing_repository_dependencies">
- ${render_folder( missing_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( missing_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if repository_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="repository_dependencies">
- ${render_folder( repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if invalid_tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_tool_dependencies">
- ${render_folder( invalid_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="tool_dependencies">
- ${render_folder( tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if missing_tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="missing_tool_dependencies">
- ${render_folder( missing_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( missing_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
</div>
@@ -1186,14 +1188,14 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="valid_data_managers">
- ${render_folder( valid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( valid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if invalid_data_managers_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_data_managers">
- ${render_folder( invalid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if workflows_root_folder:
@@ -1207,7 +1209,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="datatypes">
- ${render_folder( datatypes_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( datatypes_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
</div>
@@ -1222,7 +1224,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="test_environment">
- ${render_folder( tool_test_results_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( tool_test_results_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table></div></div>
https://bitbucket.org/galaxy/galaxy-central/commits/14dedba28a71/
Changeset: 14dedba28a71
User: greg
Date: 2014-04-04 17:40:16
Summary: merged next-stable
Affected #: 1 file
diff -r d3696e1e6df253ac426d7a0576ddf82b596b8b00 -r 14dedba28a71a4826e8dc6bffe345756b449e143 templates/webapps/tool_shed/repository/common.mako
--- a/templates/webapps/tool_shed/repository/common.mako
+++ b/templates/webapps/tool_shed/repository/common.mako
@@ -319,21 +319,21 @@
${render_folder( sub_folder, pad, parent=my_row, row_counter=row_counter, is_root_folder=False, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for readme in folder.readme_files:
- ${render_readme( readme, pad, my_row, row_counter )}
+ ${render_readme( readme, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for invalid_repository_dependency in folder.invalid_repository_dependencies:
- ${render_invalid_repository_dependency( invalid_repository_dependency, pad, my_row, row_counter )}
+ ${render_invalid_repository_dependency( invalid_repository_dependency, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for index, repository_dependency in enumerate( folder.repository_dependencies ):
<% row_is_header = index == 0 %>
- ${render_repository_dependency( repository_dependency, pad, my_row, row_counter, row_is_header )}
+ ${render_repository_dependency( repository_dependency, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for invalid_tool_dependency in folder.invalid_tool_dependencies:
- ${render_invalid_tool_dependency( invalid_tool_dependency, pad, my_row, row_counter )}
+ ${render_invalid_tool_dependency( invalid_tool_dependency, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%for index, tool_dependency in enumerate( folder.tool_dependencies ):
<% row_is_header = index == 0 %>
- ${render_tool_dependency( tool_dependency, pad, my_row, row_counter, row_is_header )}
+ ${render_tool_dependency( tool_dependency, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%if folder.valid_tools:
%for index, tool in enumerate( folder.valid_tools ):
@@ -353,74 +353,74 @@
%if folder.datatypes:
%for index, datatype in enumerate( folder.datatypes ):
<% row_is_header = index == 0 %>
- ${render_datatype( datatype, pad, my_row, row_counter, row_is_header )}
+ ${render_datatype( datatype, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.valid_data_managers:
%for index, data_manager in enumerate( folder.valid_data_managers ):
<% row_is_header = index == 0 %>
- ${render_valid_data_manager( data_manager, pad, my_row, row_counter, row_is_header )}
+ ${render_valid_data_manager( data_manager, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.invalid_data_managers:
%for index, data_manager in enumerate( folder.invalid_data_managers ):
<% row_is_header = index == 0 %>
- ${render_invalid_data_manager( data_manager, pad, my_row, row_counter, row_is_header )}
+ ${render_invalid_data_manager( data_manager, pad, my_row, row_counter, row_is_header, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.test_environments:
%for test_environment in folder.test_environments:
- ${render_test_environment( test_environment, pad, my_row, row_counter )}
+ ${render_test_environment( test_environment, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.failed_tests:
%for failed_test in folder.failed_tests:
- ${render_failed_test( failed_test, pad, my_row, row_counter )}
+ ${render_failed_test( failed_test, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.not_tested:
%for not_tested in folder.not_tested:
- ${render_not_tested( not_tested, pad, my_row, row_counter )}
+ ${render_not_tested( not_tested, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.passed_tests:
%for passed_test in folder.passed_tests:
- ${render_passed_test( passed_test, pad, my_row, row_counter )}
+ ${render_passed_test( passed_test, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.missing_test_components:
%for missing_test_component in folder.missing_test_components:
- ${render_missing_test_component( missing_test_component, pad, my_row, row_counter )}
+ ${render_missing_test_component( missing_test_component, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.tool_dependency_installation_errors:
%for tool_dependency_installation_error in folder.tool_dependency_installation_errors:
- ${render_tool_dependency_installation_error( tool_dependency_installation_error, pad, my_row, row_counter )}
+ ${render_tool_dependency_installation_error( tool_dependency_installation_error, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.tool_dependency_successful_installations:
%for tool_dependency_successful_installation in folder.tool_dependency_successful_installations:
- ${render_tool_dependency_successful_installation( tool_dependency_successful_installation, pad, my_row, row_counter )}
+ ${render_tool_dependency_successful_installation( tool_dependency_successful_installation, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.repository_installation_errors:
%for repository_installation_error in folder.repository_installation_errors:
- ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=False )}
+ ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=False, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.current_repository_installation_errors:
%for repository_installation_error in folder.current_repository_installation_errors:
- ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=True )}
+ ${render_repository_installation_error( repository_installation_error, pad, my_row, row_counter, is_current_repository=True, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
%if folder.repository_successful_installations:
%for repository_successful_installation in folder.repository_successful_installations:
- ${render_repository_successful_installation( repository_successful_installation, pad, my_row, row_counter )}
+ ${render_repository_successful_installation( repository_successful_installation, pad, my_row, row_counter, render_repository_actions_for=render_repository_actions_for )}
%endfor
%endif
</%def>
-<%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_datatype( datatype, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( datatype.id )
if row_is_header:
@@ -444,7 +444,7 @@
%></%def>
-<%def name="render_failed_test( failed_test, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_failed_test( failed_test, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from tool_shed.util.shed_util_common import to_html_string
encoded_id = trans.security.encode_id( failed_test.id )
@@ -470,7 +470,7 @@
%></%def>
-<%def name="render_invalid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_invalid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( data_manager.id )
if row_is_header:
@@ -492,7 +492,7 @@
%></%def>
-<%def name="render_invalid_repository_dependency( invalid_repository_dependency, pad, parent, row_counter )">
+<%def name="render_invalid_repository_dependency( invalid_repository_dependency, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( invalid_repository_dependency.id )
%>
@@ -534,7 +534,7 @@
%></%def>
-<%def name="render_invalid_tool_dependency( invalid_tool_dependency, pad, parent, row_counter )">
+<%def name="render_invalid_tool_dependency( invalid_tool_dependency, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( invalid_tool_dependency.id )
%>
@@ -565,7 +565,7 @@
%></%def>
-<%def name="render_missing_test_component( missing_test_component, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_missing_test_component( missing_test_component, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( missing_test_component.id )
%>
@@ -589,7 +589,7 @@
%></%def>
-<%def name="render_readme( readme, pad, parent, row_counter )">
+<%def name="render_readme( readme, pad, parent, row_counter, render_repository_actions_for='tool_shed' )"><% encoded_id = trans.security.encode_id( readme.id ) %><tr class="datasetRow"
%if parent is not None:
@@ -608,7 +608,7 @@
%></%def>
-<%def name="render_repository_dependency( repository_dependency, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_repository_dependency( repository_dependency, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import asbool
from tool_shed.util.shed_util_common import get_repository_by_name_and_owner
@@ -634,6 +634,7 @@
cell_type = 'th'
else:
cell_type = 'td'
+ rd = None
else:
# We're in the tool shed.
cell_type = 'td'
@@ -665,7 +666,7 @@
</${cell_type}>
%else:
<td style="padding-left: ${pad+20}px;">
- %if rd:
+ %if render_repository_actions_for == 'tool_shed' and rd:
<a class="view-info" href="${h.url_for( controller='repository', action='view_or_manage_repository', id=trans.security.encode_id( rd.id ), changeset_revision=changeset_revision )}">Repository <b>${repository_name | h}</b> revision <b>${changeset_revision | h}</b> owned by <b>${repository_owner | h}</b></a>${prior_installation_required_str}
%else:
Repository <b>${repository_name | h}</b> revision <b>${changeset_revision | h}</b> owned by <b>${repository_owner | h}</b>${prior_installation_required_str}
@@ -694,7 +695,7 @@
</style></%def>
-<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_tool_dependency_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import unicodify
encoded_id = trans.security.encode_id( installation_error.id )
@@ -725,7 +726,7 @@
%></%def>
-<%def name="render_tool_dependency_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_tool_dependency_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( successful_installation.id )
%>
@@ -755,7 +756,7 @@
%></%def>
-<%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False )">
+<%def name="render_repository_installation_error( installation_error, pad, parent, row_counter, row_is_header=False, is_current_repository=False, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import unicodify
encoded_id = trans.security.encode_id( installation_error.id )
@@ -789,7 +790,7 @@
%></%def>
-<%def name="render_repository_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, is_current_repository=False )">
+<%def name="render_repository_successful_installation( successful_installation, pad, parent, row_counter, row_is_header=False, is_current_repository=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( successful_installation.id )
%>
@@ -820,7 +821,7 @@
%></%def>
-<%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_not_tested( not_tested, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( not_tested.id )
%>
@@ -841,7 +842,7 @@
%></%def>
-<%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_passed_test( passed_test, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( passed_test.id )
%>
@@ -882,19 +883,20 @@
%else:
<td style="padding-left: ${pad+20}px;">
%if tool.repository_id:
- %if trans.webapp.name == 'tool_shed':
- <div style="float:left;" class="menubutton split popup" id="tool-${encoded_id}-popup">
- <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( tool.repository_id ), tool_config=tool.tool_config, changeset_revision=tool.changeset_revision, render_repository_actions_for=render_repository_actions_for )}">${tool.name | h}</a>
- </div>
- <div popupmenu="tool-${encoded_id}-popup">
- <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id, render_repository_actions_for=render_repository_actions_for )}">View tool metadata</a>
- </div>
- %else:
+ <div style="float:left;" class="menubutton split popup" id="tool-${encoded_id}-popup">
+ <a class="view-info" href="${h.url_for( controller='repository', action='display_tool', repository_id=trans.security.encode_id( tool.repository_id ), tool_config=tool.tool_config, changeset_revision=tool.changeset_revision, render_repository_actions_for=render_repository_actions_for )}">${tool.name | h}</a>
+ </div>
+ <div popupmenu="tool-${encoded_id}-popup">
+ <a class="action-button" href="${h.url_for( controller='repository', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id, render_repository_actions_for=render_repository_actions_for )}">View tool metadata</a>
+ </div>
+ %if trans.webapp.name == 'galaxy':
%if tool.repository_installation_status == trans.install_model.ToolShedRepository.installation_status.INSTALLED:
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='view_tool_metadata', repository_id=trans.security.encode_id( tool.repository_id ), changeset_revision=tool.changeset_revision, tool_id=tool.tool_id )}">${tool.name | h}</a>
%else:
${tool.name | h}
%endif
+ %else:
+ ${tool.name | h}
%endif
%else:
${tool.name | h}
@@ -911,7 +913,7 @@
%></%def>
-<%def name="render_tool_dependency( tool_dependency, pad, parent, row_counter, row_is_header )">
+<%def name="render_tool_dependency( tool_dependency, pad, parent, row_counter, row_is_header, render_repository_actions_for='tool_shed' )"><%
from galaxy.util import string_as_bool
encoded_id = trans.security.encode_id( tool_dependency.id )
@@ -967,7 +969,7 @@
%></%def>
-<%def name="render_test_environment( test_environment, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_test_environment( test_environment, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><% encoded_id = trans.security.encode_id( test_environment.id ) %><tr class="datasetRow"
%if parent is not None:
@@ -994,7 +996,7 @@
%></%def>
-<%def name="render_valid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False )">
+<%def name="render_valid_data_manager( data_manager, pad, parent, row_counter, row_is_header=False, render_repository_actions_for='tool_shed' )"><%
encoded_id = trans.security.encode_id( data_manager.id )
if row_is_header:
@@ -1109,7 +1111,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="readme_files">
- ${render_folder( readme_files_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( readme_files_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table></div></div>
@@ -1122,42 +1124,42 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_repository_dependencies">
- ${render_folder( invalid_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if missing_repository_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="missing_repository_dependencies">
- ${render_folder( missing_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( missing_repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if repository_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="repository_dependencies">
- ${render_folder( repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( repository_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if invalid_tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_tool_dependencies">
- ${render_folder( invalid_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="tool_dependencies">
- ${render_folder( tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if missing_tool_dependencies_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="missing_tool_dependencies">
- ${render_folder( missing_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( missing_tool_dependencies_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
</div>
@@ -1186,14 +1188,14 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="valid_data_managers">
- ${render_folder( valid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( valid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if invalid_data_managers_root_folder:
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="invalid_data_managers">
- ${render_folder( invalid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( invalid_data_managers_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
%if workflows_root_folder:
@@ -1207,7 +1209,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="datatypes">
- ${render_folder( datatypes_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( datatypes_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table>
%endif
</div>
@@ -1222,7 +1224,7 @@
<p/><% row_counter = RowCounter() %><table cellspacing="2" cellpadding="2" border="0" width="100%" class="tables container-table" id="test_environment">
- ${render_folder( tool_test_results_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True )}
+ ${render_folder( tool_test_results_root_folder, 0, parent=None, row_counter=row_counter, is_root_folder=True, render_repository_actions_for=render_repository_actions_for )}
</table></div></div>
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/3e211eba99bd/
Changeset: 3e211eba99bd
Branch: next-stable
User: davebgx
Date: 2014-04-04 16:37:52
Summary: Fixed JAVA_JAR_PATH for realigner_target_creator.
Affected #: 1 file
diff -r aa6203b24be369697fd451e2a8dd45518d39073c -r 3e211eba99bde29b3d4bcf161a041864d2de6905 scripts/migrate_tools/0010_tools.xml
--- a/scripts/migrate_tools/0010_tools.xml
+++ b/scripts/migrate_tools/0010_tools.xml
@@ -84,7 +84,7 @@
<repository owner="devteam" name="rcve" changeset_revision="7740956d197b" description="Compute RCVE"><tool id="rcve1" version="1.0.0" file="regVariation/rcve.xml" /></repository>
- <repository owner="devteam" name="realigner_target_creator" changeset_revision="b83a853a3156" description="Realigner Target Creator for use in local realignment">
+ <repository owner="devteam" name="realigner_target_creator" changeset_revision="5b8eaae854da" description="Realigner Target Creator for use in local realignment"><tool id="gatk_realigner_target_creator" version="0.0.4" file="gatk/realigner_target_creator.xml" /></repository><repository owner="devteam" name="substitution_rates" changeset_revision="d1b35bcdaacc" description="Estimate substitution rates for non-coding regions">
https://bitbucket.org/galaxy/galaxy-central/commits/d3696e1e6df2/
Changeset: d3696e1e6df2
User: davebgx
Date: 2014-04-04 16:38:40
Summary: Merge in fix from next-stable.
Affected #: 1 file
diff -r 7880ca69b85075ee767406d898ab57511529aba8 -r d3696e1e6df253ac426d7a0576ddf82b596b8b00 scripts/migrate_tools/0010_tools.xml
--- a/scripts/migrate_tools/0010_tools.xml
+++ b/scripts/migrate_tools/0010_tools.xml
@@ -84,7 +84,7 @@
<repository owner="devteam" name="rcve" changeset_revision="7740956d197b" description="Compute RCVE"><tool id="rcve1" version="1.0.0" file="regVariation/rcve.xml" /></repository>
- <repository owner="devteam" name="realigner_target_creator" changeset_revision="b83a853a3156" description="Realigner Target Creator for use in local realignment">
+ <repository owner="devteam" name="realigner_target_creator" changeset_revision="5b8eaae854da" description="Realigner Target Creator for use in local realignment"><tool id="gatk_realigner_target_creator" version="0.0.4" file="gatk/realigner_target_creator.xml" /></repository><repository owner="devteam" name="substitution_rates" changeset_revision="d1b35bcdaacc" description="Estimate substitution rates for non-coding regions">
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f16b268beed3/
Changeset: f16b268beed3
User: dcnorris
Date: 2014-03-27 19:49:12
Summary: modified igb display xml files
Affected #: 5 files
diff -r f4d81f13120a8995b3486bd05c00d0430f2d44c7 -r f16b268beed38f97c7f773be2db5bc4ff2216e0f display_applications/igb/bam.xml
--- a/display_applications/igb/bam.xml
+++ b/display_applications/igb/bam.xml
@@ -1,58 +1,14 @@
<display id="igb_bam" version="0.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bam_file.dbkey}&feature_…</url>
- <param type="data" name="bam_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bam_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bai_file" url="${thenicename}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
- <param type="data" name="bam_file" url="${thenicename}_${DATASET_HASH}.bam" strip_https="True" />
- </link>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${bam_file.dbkey}&feature_url…</url>
+ <param type="data" name="bam_file_for_name" viewable="False"/>
+ <param type="template" name="niceName" viewable="False" strip="True">
+ #import re
+ #set nm=$bam_file_for_name.name
+ ${re.sub('\W',"_",nm)}
+ </param>
+ <param type="data" name="bai_file" url="${niceName}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
+ <param type="data" name="bam_file" url="${niceName}_${DATASET_HASH}.bam" strip_https="True" />
+ </link>
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bam_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bam_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bai_file" url="${thenicename}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
- <param type="data" name="bam_file" url="${thenicename}_${DATASET_HASH}.bam" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bam_file.dbkey}&feature_url_0=${bam_file.url}&sym_name_0=${thenicename}&sym_method_0=${bam_file.url}&query_url=${bam_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
diff -r f4d81f13120a8995b3486bd05c00d0430f2d44c7 -r f16b268beed38f97c7f773be2db5bc4ff2216e0f display_applications/igb/bb.xml
--- a/display_applications/igb/bb.xml
+++ b/display_applications/igb/bb.xml
@@ -1,58 +1,14 @@
<display id="igb_bb" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bigbed_file.dbkey}&loadr…</url>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${bigbed_file.dbkey}&loadresi…</url><param type="data" name="bigbed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$bigbed_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="bigbed_file" url="${thenicename}_${DATASET_HASH}.bigbed" strip_https="True" />
- </link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bigbed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bigbed_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bigbed_file" url="${thenicename}_${DATASET_HASH}.bigbed" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bigbed_file.dbkey}&loadresidues=false&feature_url_0=${bigbed_file.url}&sym_name_0=${thenicename}&sym_method_0=${bigbed_file.url}&query_url=${bigbed_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
+ <param type="data" name="bigbed_file" url="${niceName}_${DATASET_HASH}.bigbed" strip_https="True" /></link></display>
diff -r f4d81f13120a8995b3486bd05c00d0430f2d44c7 -r f16b268beed38f97c7f773be2db5bc4ff2216e0f display_applications/igb/bed.xml
--- a/display_applications/igb/bed.xml
+++ b/display_applications/igb/bed.xml
@@ -1,73 +1,17 @@
<display id="igb_bed" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bed_file.dbkey}&${positi…</url>
- <param type="data" name="bed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bed_file_for_name.name
- ${re.sub('\W',"_",nm)}
+ <link id="View" name="View">
+ <url>$bioviz</url>
+ <param type="data" name="bed_file_for_name" viewable="False"/>
+ <param type="template" name="niceName" viewable="False" strip="True">
+ #import re
+ #set nm=$bed_file_for_name.name
+ ${re.sub('\W',"_",nm)}
+ </param>
+ <param type="data" name="bed_file" url="${niceName}_${DATASET_HASH}.bed" strip_https="True" />
+
+ <param type="template" name="bioviz" strip="True" >
+ http://bioviz.org/igb/galaxy.html?version=${bed_file.dbkey}&loadresidue…
</param>
- <param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $bed_file.datatype.get_estimated_display_viewport( $bed_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- </link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bed_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $bed_file.datatype.get_estimated_display_viewport( $bed_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bed_file.dbkey}&${position}&loadresidues=false&feature_url_0=${bed_file.url}&sym_name_0=${thenicename}&sym_method_0=${bed_file.url}&query_url=${bed_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link>
+ </link></display>
diff -r f4d81f13120a8995b3486bd05c00d0430f2d44c7 -r f16b268beed38f97c7f773be2db5bc4ff2216e0f display_applications/igb/bigwig.xml
--- a/display_applications/igb/bigwig.xml
+++ b/display_applications/igb/bigwig.xml
@@ -1,14 +1,14 @@
<display id="igb_bigwig" version="1.0.0" name="display in IGB"><link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bigwig_file.dbkey}&loadr…</url>
+ <url>http://bioviz.org/igb/galaxy.html?version=${bigwig_file.dbkey}&loadresi…</url><param type="data" name="bigwig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$bigwig_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="bigwig_file" url="${thenicename}_${DATASET_HASH}.bigwig" strip_https="True" />
+ <param type="data" name="bigwig_file" url="${niceName}_${DATASET_HASH}.bigwig" strip_https="True" /><!--<param type="template" name="position" strip="True" >
#set chrom, start, end = $bigwig_file.datatype.get_estimated_display_viewport( $bigwig_file )
#if $chrom is not None:
@@ -19,47 +19,4 @@
</param>--></link>
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bigwig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bigwig_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bigwig_file" url="${thenicename}_${DATASET_HASH}.bigwig" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bigwig_file.dbkey}&loadresidues=false&feature_url_0=${bigwig_file.url}&sym_name_0=${thenicename}&sym_method_0=${bigwig_file.url}&query_url=${bigwig_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
diff -r f4d81f13120a8995b3486bd05c00d0430f2d44c7 -r f16b268beed38f97c7f773be2db5bc4ff2216e0f display_applications/igb/wig.xml
--- a/display_applications/igb/wig.xml
+++ b/display_applications/igb/wig.xml
@@ -1,14 +1,14 @@
<display id="igb_wig" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${wig_file.dbkey}&${positi…</url>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${wig_file.dbkey}&${position}…</url><param type="data" name="wig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$wig_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="wig_file" url="${thenicename}_${DATASET_HASH}.wig" strip_https="True" />
+ <param type="data" name="wig_file" url="${niceName}_${DATASET_HASH}.wig" strip_https="True" /><param type="template" name="position" strip="True" >
#set chrom, start, end = $wig_file.datatype.get_estimated_display_viewport( $wig_file )
#if $chrom is not None:
@@ -18,57 +18,5 @@
#end if
</param></link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="wig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$wig_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="wig_file" url="${thenicename}_${DATASET_HASH}.wig" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $wig_file.datatype.get_estimated_display_viewport( $wig_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${wig_file.dbkey}&${position}&loadresidues=false&feature_url_0=${wig_file.url}&sym_name_0=${thenicename}&sym_method_0=${wig_file.url}&query_url=${wig_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
https://bitbucket.org/galaxy/galaxy-central/commits/4493688dee95/
Changeset: 4493688dee95
User: hillrunner2008
Date: 2014-04-03 17:05:36
Summary: Changed the link text to match other file formats
Affected #: 1 file
diff -r f16b268beed38f97c7f773be2db5bc4ff2216e0f -r 4493688dee959bb68f6e85ca494e9dc3ad601bea display_applications/igb/bigwig.xml
--- a/display_applications/igb/bigwig.xml
+++ b/display_applications/igb/bigwig.xml
@@ -1,6 +1,6 @@
-<display id="igb_bigwig" version="1.0.0" name="display in IGB">
+<display id="igb_bigwig" version="1.0.0" name="Display in IGB">
- <link id="Local" name="Local">
+ <link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bigwig_file.dbkey}&loadresi…</url><param type="data" name="bigwig_file_for_name" viewable="False"/><param type="template" name="niceName" viewable="False" strip="True">
https://bitbucket.org/galaxy/galaxy-central/commits/7880ca69b850/
Changeset: 7880ca69b850
User: dan
Date: 2014-04-04 16:00:59
Summary: Merged in hillrunner2008/galaxy-central (pull request #354)
modified igb display xml files
Affected #: 5 files
diff -r b37fa2ccd056f939f3605952a6910d64490fc04c -r 7880ca69b85075ee767406d898ab57511529aba8 display_applications/igb/bam.xml
--- a/display_applications/igb/bam.xml
+++ b/display_applications/igb/bam.xml
@@ -1,58 +1,14 @@
<display id="igb_bam" version="0.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bam_file.dbkey}&feature_…</url>
- <param type="data" name="bam_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bam_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bai_file" url="${thenicename}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
- <param type="data" name="bam_file" url="${thenicename}_${DATASET_HASH}.bam" strip_https="True" />
- </link>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${bam_file.dbkey}&feature_url…</url>
+ <param type="data" name="bam_file_for_name" viewable="False"/>
+ <param type="template" name="niceName" viewable="False" strip="True">
+ #import re
+ #set nm=$bam_file_for_name.name
+ ${re.sub('\W',"_",nm)}
+ </param>
+ <param type="data" name="bai_file" url="${niceName}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
+ <param type="data" name="bam_file" url="${niceName}_${DATASET_HASH}.bam" strip_https="True" />
+ </link>
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bam_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bam_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bai_file" url="${thenicename}_${DATASET_HASH}.bam.bai" metadata="bam_index" strip_https="True" />
- <param type="data" name="bam_file" url="${thenicename}_${DATASET_HASH}.bam" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bam_file.dbkey}&feature_url_0=${bam_file.url}&sym_name_0=${thenicename}&sym_method_0=${bam_file.url}&query_url=${bam_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
diff -r b37fa2ccd056f939f3605952a6910d64490fc04c -r 7880ca69b85075ee767406d898ab57511529aba8 display_applications/igb/bb.xml
--- a/display_applications/igb/bb.xml
+++ b/display_applications/igb/bb.xml
@@ -1,58 +1,14 @@
<display id="igb_bb" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bigbed_file.dbkey}&loadr…</url>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${bigbed_file.dbkey}&loadresi…</url><param type="data" name="bigbed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$bigbed_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="bigbed_file" url="${thenicename}_${DATASET_HASH}.bigbed" strip_https="True" />
- </link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bigbed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bigbed_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bigbed_file" url="${thenicename}_${DATASET_HASH}.bigbed" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bigbed_file.dbkey}&loadresidues=false&feature_url_0=${bigbed_file.url}&sym_name_0=${thenicename}&sym_method_0=${bigbed_file.url}&query_url=${bigbed_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
+ <param type="data" name="bigbed_file" url="${niceName}_${DATASET_HASH}.bigbed" strip_https="True" /></link></display>
diff -r b37fa2ccd056f939f3605952a6910d64490fc04c -r 7880ca69b85075ee767406d898ab57511529aba8 display_applications/igb/bed.xml
--- a/display_applications/igb/bed.xml
+++ b/display_applications/igb/bed.xml
@@ -1,73 +1,17 @@
<display id="igb_bed" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bed_file.dbkey}&${positi…</url>
- <param type="data" name="bed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bed_file_for_name.name
- ${re.sub('\W',"_",nm)}
+ <link id="View" name="View">
+ <url>$bioviz</url>
+ <param type="data" name="bed_file_for_name" viewable="False"/>
+ <param type="template" name="niceName" viewable="False" strip="True">
+ #import re
+ #set nm=$bed_file_for_name.name
+ ${re.sub('\W',"_",nm)}
+ </param>
+ <param type="data" name="bed_file" url="${niceName}_${DATASET_HASH}.bed" strip_https="True" />
+
+ <param type="template" name="bioviz" strip="True" >
+ http://bioviz.org/igb/galaxy.html?version=${bed_file.dbkey}&loadresidue…
</param>
- <param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $bed_file.datatype.get_estimated_display_viewport( $bed_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- </link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bed_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bed_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bed_file" url="${thenicename}_${DATASET_HASH}.bed" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $bed_file.datatype.get_estimated_display_viewport( $bed_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bed_file.dbkey}&${position}&loadresidues=false&feature_url_0=${bed_file.url}&sym_name_0=${thenicename}&sym_method_0=${bed_file.url}&query_url=${bed_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link>
+ </link></display>
diff -r b37fa2ccd056f939f3605952a6910d64490fc04c -r 7880ca69b85075ee767406d898ab57511529aba8 display_applications/igb/bigwig.xml
--- a/display_applications/igb/bigwig.xml
+++ b/display_applications/igb/bigwig.xml
@@ -1,14 +1,14 @@
-<display id="igb_bigwig" version="1.0.0" name="display in IGB">
+<display id="igb_bigwig" version="1.0.0" name="Display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${bigwig_file.dbkey}&loadr…</url>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${bigwig_file.dbkey}&loadresi…</url><param type="data" name="bigwig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$bigwig_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="bigwig_file" url="${thenicename}_${DATASET_HASH}.bigwig" strip_https="True" />
+ <param type="data" name="bigwig_file" url="${niceName}_${DATASET_HASH}.bigwig" strip_https="True" /><!--<param type="template" name="position" strip="True" >
#set chrom, start, end = $bigwig_file.datatype.get_estimated_display_viewport( $bigwig_file )
#if $chrom is not None:
@@ -19,47 +19,4 @@
</param>--></link>
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="bigwig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$bigwig_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="bigwig_file" url="${thenicename}_${DATASET_HASH}.bigwig" strip_https="True" />
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${bigwig_file.dbkey}&loadresidues=false&feature_url_0=${bigwig_file.url}&sym_name_0=${thenicename}&sym_method_0=${bigwig_file.url}&query_url=${bigwig_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
diff -r b37fa2ccd056f939f3605952a6910d64490fc04c -r 7880ca69b85075ee767406d898ab57511529aba8 display_applications/igb/wig.xml
--- a/display_applications/igb/wig.xml
+++ b/display_applications/igb/wig.xml
@@ -1,14 +1,14 @@
<display id="igb_wig" version="1.0.0" name="display in IGB">
- <link id="Local" name="Local">
- <url>http://localhost:7085/UnibrowControl?version=${wig_file.dbkey}&${positi…</url>
+ <link id="View" name="View">
+ <url>http://bioviz.org/igb/galaxy.html?version=${wig_file.dbkey}&${position}…</url><param type="data" name="wig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
+ <param type="template" name="niceName" viewable="False" strip="True">
#import re
#set nm=$wig_file_for_name.name
${re.sub('\W',"_",nm)}
</param>
- <param type="data" name="wig_file" url="${thenicename}_${DATASET_HASH}.wig" strip_https="True" />
+ <param type="data" name="wig_file" url="${niceName}_${DATASET_HASH}.wig" strip_https="True" /><param type="template" name="position" strip="True" >
#set chrom, start, end = $wig_file.datatype.get_estimated_display_viewport( $wig_file )
#if $chrom is not None:
@@ -18,57 +18,5 @@
#end if
</param></link>
-
- <link id="Web" name="Web">
- <url>$jnlp.url</url>
- <param type="data" name="wig_file_for_name" viewable="False"/>
- <param type="template" name="thenicename" viewable="False" strip="True">
- #import re
- #set nm=$wig_file_for_name.name
- ${re.sub('\W',"_",nm)}
- </param>
- <param type="data" name="wig_file" url="${thenicename}_${DATASET_HASH}.wig" strip_https="True" />
- <param type="template" name="position" strip="True" >
- #set chrom, start, end = $wig_file.datatype.get_estimated_display_viewport( $wig_file )
- #if $chrom is not None:
- seqid=${chrom}&start=${start}&end=${int(end) + 1}
- #else:
- seqid=&start=&end=
- #end if
- </param>
- <param type="template" name="jnlp" url="${thenicename}_${DATASET_HASH}.jnlp" viewable="True" strip_https="True" mimetype="application/x-java-jnlp-file">
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="6.0+" version="" codebase="http://www.bioviz.org/igb/releases/current/" >
- <information>
- <title>IGB</title>
- <vendor>Genoviz Project</vendor>
- <homepage href="http://genoviz.sourceforge.net/" />
- <description>Integrated Genome Browser</description>
- <icon href="igb.gif"/>
- <offline-allowed/>
- <shortcut online="true">
- <desktop/>
- <menu submenu="IGB" />
- </shortcut>
- </information>
- <security>
- <all-permissions/>
- </security>
- <resources>
- <java version="1.6+" initial-heap-size="32m" max-heap-size="1024m"/>
- <jar href="igb_exe.jar" main="true" />
- <jar href="igb-i18n.jar" />
- <property name="apple.laf.useScreenMenuBar" value="true" />
- <property name="http.agent" value="IGB (Webstart)" />
- </resources>
- <application-desc main-class="com.affymetrix.main.Main">
- <argument>-prefs</argument>
- <argument>http://www.bioviz.org/igb/releases/current/igb_prefs.xml</argument>
- <argument>-href</argument>
- <argument>http://localhost:7085/UnibrowControl?version=${wig_file.dbkey}&${position}&loadresidues=false&feature_url_0=${wig_file.url}&sym_name_0=${thenicename}&sym_method_0=${wig_file.url}&query_url=${wig_file.url}&server_url=galaxy </argument>
- </application-desc>
-</jnlp>
- </param>
- </link></display>
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/aa6203b24be3/
Changeset: aa6203b24be3
Branch: next-stable
User: greg
Date: 2014-04-03 23:40:44
Summary: Better fix than ea1fbe9 and handle first discovered unhandled secure / insecure protocol issue when messing with the tool shed url for installed repositories.
Affected #: 6 files
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -137,8 +137,8 @@
action='reselect_tool_panel_section',
**kwd ) )
else:
- message = "Unable to get latest revision for repository <b>%s</b> from the tool shed, so repository " % str( repository.name )
- message += "reinstallation is not possible at this time."
+ message = "Unable to get latest revision for repository <b>%s</b> from " % str( repository.name )
+ message += "the Tool Shed, so repository reinstallation is not possible at this time."
status = "error"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -986,12 +986,15 @@
# The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
# 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
# Tool Shed admin update the Tool Shed to a later release.
- err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
- err_msg += 'allow updating an installed repository where the updates include newly defined repository '
- err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
- err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
- err_msg += 'ask if they can update the Tool Shed code to the latest release.'
- return trans.show_error_message( err_msg )
+ message = 'The updates available for the repository <b>%s</b> ' % str( repository.name )
+ message += 'include newly defined repository or tool dependency definitions, and attempting '
+ message += 'to update the repository resulted in the following error. Contact the Tool Shed '
+ message += 'administrator if necessary.<br/>%s' % str( e )
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
@@ -1811,7 +1814,7 @@
"""Update a cloned repository to the latest revision possible."""
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_shed_url = kwd[ 'tool_shed_url' ]
+ tool_shed_url = kwd.get( 'tool_shed_url', None )
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2535,18 +2535,19 @@
repository_metadata_id = trans.security.encode_id( repository_metadata.id ),
metadata = repository_metadata.metadata
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
if metadata:
if 'repository_dependencies' in metadata and not repository_dependencies:
- # See if we have an invalid repository dependency definition or if the repository dependency is required only for compiling the
- # repository's tool dependency.
+ # See if we have an invalid repository dependency definition or if the repository dependency is required
+ # only for compiling the repository's tool dependency.
invalid = False
repository_dependencies_dict = metadata[ 'repository_dependencies' ]
rd_tups = repository_dependencies_dict.get( 'repository_dependencies', [] )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -138,8 +138,8 @@
def handle_complex_repository_dependency_elem( trans, elem, sub_elem_index, sub_elem, sub_elem_altered, altered, unpopulate=False ):
"""
- Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines a complex repository
- dependency.
+ Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines
+ a complex repository dependency.
"""
# The received sub_elem looks something like the following:
# <repository name="package_eigen_2_0" owner="test" prior_installation_required="True" />
@@ -153,15 +153,16 @@
altered = True
return altered, sub_elem_altered, elem, error_message
-def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert, commit_message,
- undesirable_dirs_removed, undesirable_files_removed ):
+def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert,
+ commit_message, undesirable_dirs_removed, undesirable_files_removed ):
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
content_alert_str = ''
files_to_remove = []
filenames_in_archive = [ os.path.join( full_path, name ) for name in filenames_in_archive ]
if remove_repo_files_not_in_tar and not repository.is_new( trans.app ):
- # We have a repository that is not new (it contains files), so discover those files that are in the repository, but not in the uploaded archive.
+ # We have a repository that is not new (it contains files), so discover those files that are in the
+ # repository, but not in the uploaded archive.
for root, dirs, files in os.walk( full_path ):
if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
for undesirable_dir in UNDESIRABLE_DIRS:
@@ -413,9 +414,10 @@
# <install version="1.0">
for actions_index, actions_elem in enumerate( package_elem ):
if actions_elem.tag == 'actions_group':
- # Inspect all entries in the <actions_group> tag set, skipping <actions> tag sets that define os and architecture
- # attributes. We want to inspect only the last <actions> tag set contained within the <actions_group> tag set to
- # see if a complex repository dependency is defined.
+ # Inspect all entries in the <actions_group> tag set, skipping <actions>
+ # tag sets that define os and architecture attributes. We want to inspect
+ # only the last <actions> tag set contained within the <actions_group> tag
+ # set to see if a complex repository dependency is defined.
for actions_group_index, actions_group_elem in enumerate( actions_elem ):
if actions_group_elem.tag == 'actions':
# Skip all actions tags that include os or architecture attributes.
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c lib/tool_shed/util/export_util.py
--- a/lib/tool_shed/util/export_util.py
+++ b/lib/tool_shed/util/export_util.py
@@ -228,11 +228,12 @@
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -106,6 +106,8 @@
only those items contained in the received repo_info_dicts list will be processed.
"""
log.debug( "Creating repository dependency objects..." )
+ # Handle secure and insecure protocol since it may change over time.
+ tool_shed_url = suc.handle_tool_shed_url_protocol( trans.app, tool_shed_url )
# 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 = []
@@ -293,8 +295,8 @@
def get_repository_dependencies_for_installed_tool_shed_repository( trans, repository ):
"""
- Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository which is
- installed into Galaxy. This method is called only from Galaxy.
+ Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined
+ for the received repository which is installed into Galaxy. This method is called only from Galaxy.
"""
tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
@@ -565,12 +567,13 @@
key_rd_dicts_to_be_processed = remove_from_key_rd_dicts( key_rd_dict, key_rd_dicts_to_be_processed )
else:
# The repository is in a different tool shed, so build an url and send a request.
- error_message = "Repository dependencies are currently supported only within the same tool shed. Ignoring repository dependency definition "
+ error_message = "Repository dependencies are currently supported only within the same Tool Shed. Ignoring repository dependency definition "
error_message += "for tool shed %s, name %s, owner %s, changeset revision %s" % ( toolshed, name, owner, changeset_revision )
log.debug( error_message )
return toolshed, required_repository, required_repository_metadata, repository_key_rd_dicts, key_rd_dicts_to_be_processed, handled_key_rd_dicts
-def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies ):
+def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts,
+ circular_repository_dependencies ):
next_repository_key_rd_dict = key_rd_dicts_to_be_processed.pop( 0 )
next_repository_key_rd_dicts = [ next_repository_key_rd_dict ]
next_repository_key = next_repository_key_rd_dict.keys()[ 0 ]
diff -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 -r aa6203b24be369697fd451e2a8dd45518d39073c 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
@@ -1341,9 +1341,7 @@
"""
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
- if tool_shed.find( '//' ) > 0:
- tool_shed = tool_shed.split( '//' )[1]
- tool_shed = tool_shed.rstrip( '/' )
+ tool_shed = remove_protocol_from_tool_shed_url( tool_shed )
return repository_query \
.filter( and_( app.install_model.ToolShedRepository.table.c.tool_shed == tool_shed,
app.install_model.ToolShedRepository.table.c.name == name,
@@ -1597,6 +1595,12 @@
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
return galaxy_url
+def handle_tool_shed_url_protocol( app, tool_shed_url ):
+ """Handle secure and insecure HTTP protocol since they may change over time."""
+ tool_shed_url = remove_protocol_from_tool_shed_url( tool_shed_url )
+ tool_shed_url = get_url_from_tool_shed( app, tool_shed_url )
+ return tool_shed_url
+
def have_shed_tool_conf_for_install( trans ):
if not trans.app.toolbox.shed_tool_confs:
return False
@@ -1653,6 +1657,12 @@
except:
pass
+def remove_protocol_from_tool_shed_url( tool_shed_url ):
+ if tool_shed_url.find( '//' ) > 0:
+ tool_shed_url = tool_shed_url.split( '//' )[1]
+ tool_shed_url = tool_shed_url.rstrip( '/' )
+ return tool_shed_url
+
def __repository_query( app ):
if app.name == "galaxy":
query = app.install_model.context.query( app.install_model.ToolShedRepository )
https://bitbucket.org/galaxy/galaxy-central/commits/b37fa2ccd056/
Changeset: b37fa2ccd056
User: greg
Date: 2014-04-03 23:41:18
Summary: Merged next-stable
Affected #: 6 files
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -137,8 +137,8 @@
action='reselect_tool_panel_section',
**kwd ) )
else:
- message = "Unable to get latest revision for repository <b>%s</b> from the tool shed, so repository " % str( repository.name )
- message += "reinstallation is not possible at this time."
+ message = "Unable to get latest revision for repository <b>%s</b> from " % str( repository.name )
+ message += "the Tool Shed, so repository reinstallation is not possible at this time."
status = "error"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -986,12 +986,15 @@
# The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
# 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
# Tool Shed admin update the Tool Shed to a later release.
- err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
- err_msg += 'allow updating an installed repository where the updates include newly defined repository '
- err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
- err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
- err_msg += 'ask if they can update the Tool Shed code to the latest release.'
- return trans.show_error_message( err_msg )
+ message = 'The updates available for the repository <b>%s</b> ' % str( repository.name )
+ message += 'include newly defined repository or tool dependency definitions, and attempting '
+ message += 'to update the repository resulted in the following error. Contact the Tool Shed '
+ message += 'administrator if necessary.<br/>%s' % str( e )
+ status = 'error'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ message=message,
+ status=status ) )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
@@ -1811,7 +1814,7 @@
"""Update a cloned repository to the latest revision possible."""
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- tool_shed_url = kwd[ 'tool_shed_url' ]
+ tool_shed_url = kwd.get( 'tool_shed_url', None )
name = kwd.get( 'name', None )
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -2535,18 +2535,19 @@
repository_metadata_id = trans.security.encode_id( repository_metadata.id ),
metadata = repository_metadata.metadata
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
if metadata:
if 'repository_dependencies' in metadata and not repository_dependencies:
- # See if we have an invalid repository dependency definition or if the repository dependency is required only for compiling the
- # repository's tool dependency.
+ # See if we have an invalid repository dependency definition or if the repository dependency is required
+ # only for compiling the repository's tool dependency.
invalid = False
repository_dependencies_dict = metadata[ 'repository_dependencies' ]
rd_tups = repository_dependencies_dict.get( 'repository_dependencies', [] )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/tool_shed/util/commit_util.py
--- a/lib/tool_shed/util/commit_util.py
+++ b/lib/tool_shed/util/commit_util.py
@@ -138,8 +138,8 @@
def handle_complex_repository_dependency_elem( trans, elem, sub_elem_index, sub_elem, sub_elem_altered, altered, unpopulate=False ):
"""
- Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines a complex repository
- dependency.
+ Populate or unpopulate the toolshed and changeset_revision attributes of a <repository> tag that defines
+ a complex repository dependency.
"""
# The received sub_elem looks something like the following:
# <repository name="package_eigen_2_0" owner="test" prior_installation_required="True" />
@@ -153,15 +153,16 @@
altered = True
return altered, sub_elem_altered, elem, error_message
-def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert, commit_message,
- undesirable_dirs_removed, undesirable_files_removed ):
+def handle_directory_changes( trans, repository, full_path, filenames_in_archive, remove_repo_files_not_in_tar, new_repo_alert,
+ commit_message, undesirable_dirs_removed, undesirable_files_removed ):
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
content_alert_str = ''
files_to_remove = []
filenames_in_archive = [ os.path.join( full_path, name ) for name in filenames_in_archive ]
if remove_repo_files_not_in_tar and not repository.is_new( trans.app ):
- # We have a repository that is not new (it contains files), so discover those files that are in the repository, but not in the uploaded archive.
+ # We have a repository that is not new (it contains files), so discover those files that are in the
+ # repository, but not in the uploaded archive.
for root, dirs, files in os.walk( full_path ):
if root.find( '.hg' ) < 0 and root.find( 'hgrc' ) < 0:
for undesirable_dir in UNDESIRABLE_DIRS:
@@ -413,9 +414,10 @@
# <install version="1.0">
for actions_index, actions_elem in enumerate( package_elem ):
if actions_elem.tag == 'actions_group':
- # Inspect all entries in the <actions_group> tag set, skipping <actions> tag sets that define os and architecture
- # attributes. We want to inspect only the last <actions> tag set contained within the <actions_group> tag set to
- # see if a complex repository dependency is defined.
+ # Inspect all entries in the <actions_group> tag set, skipping <actions>
+ # tag sets that define os and architecture attributes. We want to inspect
+ # only the last <actions> tag set contained within the <actions_group> tag
+ # set to see if a complex repository dependency is defined.
for actions_group_index, actions_group_elem in enumerate( actions_elem ):
if actions_group_elem.tag == 'actions':
# Skip all actions tags that include os or architecture attributes.
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c lib/tool_shed/util/export_util.py
--- a/lib/tool_shed/util/export_util.py
+++ b/lib/tool_shed/util/export_util.py
@@ -228,11 +228,12 @@
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
+ toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
repository_dependencies = \
repository_dependency_util.get_repository_dependencies_for_changeset_revision( trans=trans,
repository=repository,
repository_metadata=repository_metadata,
- toolshed_base_url=str( web.url_for( '/', qualified=True ) ).rstrip( '/' ),
+ toolshed_base_url=toolshed_base_url,
key_rd_dicts_to_be_processed=None,
all_repository_dependencies=None,
handled_key_rd_dicts=None )
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -106,6 +106,8 @@
only those items contained in the received repo_info_dicts list will be processed.
"""
log.debug( "Creating repository dependency objects..." )
+ # Handle secure and insecure protocol since it may change over time.
+ tool_shed_url = suc.handle_tool_shed_url_protocol( trans.app, tool_shed_url )
# 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 = []
@@ -293,8 +295,8 @@
def get_repository_dependencies_for_installed_tool_shed_repository( trans, repository ):
"""
- Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined for the received repository which is
- installed into Galaxy. This method is called only from Galaxy.
+ Send a request to the appropriate tool shed to retrieve the dictionary of repository dependencies defined
+ for the received repository which is installed into Galaxy. This method is called only from Galaxy.
"""
tool_shed_url = suc.get_url_from_tool_shed( trans.app, repository.tool_shed )
url = suc.url_join( tool_shed_url,
@@ -565,12 +567,13 @@
key_rd_dicts_to_be_processed = remove_from_key_rd_dicts( key_rd_dict, key_rd_dicts_to_be_processed )
else:
# The repository is in a different tool shed, so build an url and send a request.
- error_message = "Repository dependencies are currently supported only within the same tool shed. Ignoring repository dependency definition "
+ error_message = "Repository dependencies are currently supported only within the same Tool Shed. Ignoring repository dependency definition "
error_message += "for tool shed %s, name %s, owner %s, changeset revision %s" % ( toolshed, name, owner, changeset_revision )
log.debug( error_message )
return toolshed, required_repository, required_repository_metadata, repository_key_rd_dicts, key_rd_dicts_to_be_processed, handled_key_rd_dicts
-def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies ):
+def handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts,
+ circular_repository_dependencies ):
next_repository_key_rd_dict = key_rd_dicts_to_be_processed.pop( 0 )
next_repository_key_rd_dicts = [ next_repository_key_rd_dict ]
next_repository_key = next_repository_key_rd_dict.keys()[ 0 ]
diff -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 -r b37fa2ccd056f939f3605952a6910d64490fc04c 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
@@ -1341,9 +1341,7 @@
"""
# This method is used only in Galaxy, not the tool shed.
repository_query = __repository_query( app )
- if tool_shed.find( '//' ) > 0:
- tool_shed = tool_shed.split( '//' )[1]
- tool_shed = tool_shed.rstrip( '/' )
+ tool_shed = remove_protocol_from_tool_shed_url( tool_shed )
return repository_query \
.filter( and_( app.install_model.ToolShedRepository.table.c.tool_shed == tool_shed,
app.install_model.ToolShedRepository.table.c.name == name,
@@ -1597,6 +1595,12 @@
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
return galaxy_url
+def handle_tool_shed_url_protocol( app, tool_shed_url ):
+ """Handle secure and insecure HTTP protocol since they may change over time."""
+ tool_shed_url = remove_protocol_from_tool_shed_url( tool_shed_url )
+ tool_shed_url = get_url_from_tool_shed( app, tool_shed_url )
+ return tool_shed_url
+
def have_shed_tool_conf_for_install( trans ):
if not trans.app.toolbox.shed_tool_confs:
return False
@@ -1653,6 +1657,12 @@
except:
pass
+def remove_protocol_from_tool_shed_url( tool_shed_url ):
+ if tool_shed_url.find( '//' ) > 0:
+ tool_shed_url = tool_shed_url.split( '//' )[1]
+ tool_shed_url = tool_shed_url.rstrip( '/' )
+ return tool_shed_url
+
def __repository_query( app ):
if app.name == "galaxy":
query = app.install_model.context.query( app.install_model.ToolShedRepository )
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/32cf6611bf3c/
Changeset: 32cf6611bf3c
Branch: next-stable
User: Jeremy Goecks
Date: 2014-04-03 20:33:48
Summary: Trackster: fixes for creating and resizing composite line tracks.
Affected #: 2 files
diff -r 089d1264d719891de3306684ee26fa0543577d55 -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 static/scripts/packed/viz/trackster/tracks.js
--- a/static/scripts/packed/viz/trackster/tracks.js
+++ b/static/scripts/packed/viz/trackster/tracks.js
@@ -1,1 +1,1 @@
-define(["libs/underscore","viz/visualization","viz/trackster/util","viz/trackster/slotting","viz/trackster/painters","viz/trackster/filters","mvc/data","mvc/tools","utils/config"],function(aa,w,j,s,J,h,W,P,R){var o=aa.extend;var l={};var i=function(ab,ac){l[ab.attr("id")]=ac};var k=function(ab,ac,ae,ad){ae=".group";l[ab.attr("id")]=ad;ab.bind("drag",{handle:"."+ac,relative:true},function(am,an){var al=$(this),aq=$(this).parent(),ai=aq.children(".track,.group"),ak=l[$(this).attr("id")],ah,ag,ao,af,aj;ag=$(this).parents(ae);if(ag.length!==0){ao=ag.position().top;af=ao+ag.outerHeight();var ap=l[ag.attr("id")];if(an.offsetY<ao){$(this).insertBefore(ag);ap.remove_drawable(ak);ap.container.add_drawable_before(ak,ap);return}else{if(an.offsetY>af){$(this).insertAfter(ag);ap.remove_drawable(ak);ap.container.add_drawable(ak);return}}}ag=null;for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));ao=ah.position().top;af=ao+ah.outerHeight();if(ah.is(ae)&&this!==ah.get(0)&&an.offsetY>=ao&&an.offsetY<=af){if(an.offsetY-ao<af-an.offsetY){ah.find(".content-div").prepend(this)}else{ah.find(".content-div").append(this)}if(ak.container){ak.container.remove_drawable(ak)}l[ah.attr("id")].add_drawable(ak);return}}for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));if(an.offsetY<ah.position().top&&!(ah.hasClass("reference-track")||ah.hasClass("intro"))){break}}if(aj===ai.length){if(this!==ai.get(aj-1)){aq.append(this);l[aq.attr("id")].move_drawable(ak,aj)}}else{if(this!==ai.get(aj)){$(this).insertBefore(ai.get(aj));l[aq.attr("id")].move_drawable(ak,(an.deltaY>0?aj-1:aj))}}}).bind("dragstart",function(){$(this).addClass("dragging")}).bind("dragend",function(){$(this).removeClass("dragging")})};var D=20,z=100,G=12000,Q=400,I=5000,v=100,m="Cannot display dataset due to an error. ",H="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",E="No data for this chrom/contig.",u="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",x="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",O=10,F=20,A=["Histogram","Line","Filled","Intensity"];function U(ac,ab){if(!ab){ab=0}var ad=Math.pow(10,ab);return Math.round(ac*ad)/ad}var p=function(ac,ab,ae){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.view=ac;this.container=ab;this.drag_handle_class=ae.drag_handle_class;this.is_overview=false;this.action_icons={};this.config=R.ConfigSettingCollection.from_models_and_saved_values(this.config_params,ae.prefs);if(!this.config.get_value("name")){this.config.set_value("name",ae.name)}if(this.config_onchange){this.config.on("change",this.config_onchange,this)}this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").addClass("track-icons").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(af){af.stopPropagation()});var ad=this;this.container_div.hover(function(){ad.icons_div.show()},function(){ad.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(ab){if(ab.config.get_value("content_visible")){ab.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");ab.hide_contents();ab.config.set_value("content_visible",false)}else{ab.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");ab.config.set_value("content_visible",true);ab.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"gear",on_click_fn:function(ac){var ab=new R.ConfigSettingCollectionView({collection:ac.config});ab.render_in_modal("Configure Track")}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(ab){$(".tooltip").remove();ab.remove()}}];o(p.prototype,{config_params:[{key:"name",label:"Name",type:"text",default_value:""},{key:"content_visible",type:"bool",default_value:true,hidden:true}],config_onchange:function(){},init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.config.get_value("content_visible")){return true}return false},request_draw:function(){},_draw:function(ab){},to_dict:function(){},set_name:function(ab){this.old_name=this.config.get_value("name");this.config.set_value("name",ab);this.name_div.text(ab)},revert_name:function(){if(this.old_name){this.config.set_value("name",this.old_name);this.name_div.text(this.old_name)}},remove:function(){this.changed();this.container.remove_drawable(this);var ab=this.view;this.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(ac,ah,ag,af,ab,ae){var ad=this;this.action_icons[ac]=$("<a/>").attr("title",ah).addClass("icon-button").addClass(ag).tooltip().click(function(){af(ad)}).appendTo(this.icons_div);if(ae){this.action_icons[ac].hide()}},build_action_icons:function(ab){var ad;for(var ac=0;ac<ab.length;ac++){ad=ab[ac];this.add_action_icon(ad.name,ad.title,ad.css_class,ad.on_click_fn,ad.prepend,ad.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){},get_drawables:function(){}});var y=function(ac,ab,ad){p.call(this,ac,ab,ad);this.obj_type=ad.obj_type;this.drawables=[]};o(y.prototype,p.prototype,{unpack_drawables:function(ad){this.drawables=[];var ac;for(var ab=0;ab<ad.length;ab++){ac=n(ad[ab],this.view,this);this.add_drawable(ac)}},init:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].init()}},_draw:function(ab){for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac]._draw(ab)}},to_dict:function(){var ac=[];for(var ab=0;ab<this.drawables.length;ab++){ac.push(this.drawables[ab].to_dict())}return{prefs:this.config.to_key_value_dict(),obj_type:this.obj_type,drawables:ac}},add_drawable:function(ab){this.drawables.push(ab);ab.container=this;this.changed()},add_drawable_before:function(ad,ab){this.changed();var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables.splice(ac,0,ad);return true}return false},replace_drawable:function(ad,ab,ac){var ae=this.drawables.indexOf(ad);if(ae!==-1){this.drawables[ae]=ab;if(ac){ad.container_div.replaceWith(ab.container_div)}this.changed()}return ae},remove_drawable:function(ac){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);ac.container=null;this.changed();return true}return false},move_drawable:function(ac,ad){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);this.drawables.splice(ad,0,ac);this.changed();return true}return false},get_drawables:function(){return this.drawables},get_tracks:function(ae){var ab=this.drawables.slice(0),ac=[],ad;while(ab.length!==0){ad=ab.shift();if(ad instanceof ae){ac.push(ad)}else{if(ad.drawables){ab=ab.concat(ad.drawables)}}}return ac}});var N=function(ac,ab,ae){o(ae,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});y.call(this,ac,ab,ae);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);i(this.container_div,this);i(this.content_div,this);k(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new h.FiltersManager(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ae){this.unpack_drawables(ae.drawables)}if("filters" in ae){var ad=this.filters_manager;this.filters_manager=new h.FiltersManager(this,ae.filters);ad.parent_div.replaceWith(this.filters_manager.parent_div);if(ae.filters.visible){this.setup_multitrack_filtering()}}};o(N.prototype,p.prototype,y.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters();ab._restore_filter_managers()}else{ab.setup_multitrack_filtering();ab.request_draw({clear_tile_cache:true})}ab.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var ab=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(ab)}return ab},build_header_div:function(){var ab=$("<div/>").addClass("track-header");ab.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.config.get_value("name")).appendTo(ab);return ab},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ad=this.drawables.length;if(ad===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ad===1){if(this.drawables[0] instanceof e){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ak,aj,ah,an=true,af=this.drawables[0].get_type(),ab=0;for(ak=0;ak<ad;ak++){ah=this.drawables[ak];if(ah.get_type()!==af){can_composite=false;break}if(ah instanceof c){ab++}}if(an||ab===1){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".tooltip").remove()}if(ab>1&&ab===this.drawables.length){var ao={},ac;ah=this.drawables[0];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];ao[ac.name]=[ac]}for(ak=1;ak<this.drawables.length;ak++){ah=this.drawables[ak];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];if(ac.name in ao){ao[ac.name].push(ac)}}}this.filters_manager.remove_all();var ae,ag,ai,al;for(var am in ao){ae=ao[am];if(ae.length===ab){ag=new h.NumberFilter({name:ae[0].name,index:ae[0].index});this.filters_manager.add_filter(ag)}}if(this.filters_manager.filters.length>0){this.action_icons.filters_icon.show()}else{this.action_icons.filters_icon.hide()}}else{this.action_icons.filters_icon.hide()}}}},_restore_filter_managers:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].filters_manager=this.saved_filters_managers[ab]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var ab=0;ab<this.drawables.length;ab++){drawable=this.drawables[ab];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ac=new e(this.view,this.view,{name:this.config.get_value("name"),drawables:this.drawables});var ab=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);this.update_icons()},remove_drawable:function(ab){y.prototype.remove_drawable.call(this,ab);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var ab=o(y.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return ab},request_draw:function(ab){aa.each(this.drawables,function(ac){ac.request_draw(ab)})}});var X=Backbone.View.extend({initialize:function(ab){o(ab,{obj_type:"View"});y.call(this,"View",ab.container,ab);this.chrom=null;this.vis_id=ab.vis_id;this.dbkey=ab.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.render();this.canvas_manager=new w.CanvasManager(this.container.get(0).ownerDocument);this.reset();this.config=R.ConfigSettingCollection.from_models_and_saved_values([{key:"name",label:"Name",type:"text",default_value:""},{key:"a_color",label:"A Color",type:"color",default_value:"#FF0000"},{key:"c_color",label:"C Color",type:"color",default_value:"#00FF00"},{key:"g_color",label:"G Color",type:"color",default_value:"#0000FF"},{key:"t_color",label:"T Color",type:"color",default_value:"#FF00FF"},{key:"n_color",label:"N Color",type:"color",default_value:"#AAAAAA"}],{name:ab.name})},render:function(){this.requested_redraw=false;var ad=this.container,ab=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ad);this.browser_content_div=$("<div/>").addClass("content").appendTo(ad);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ad);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;i(this.viewport_container,ab);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ae=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){w.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":ab.dbkey},function(af){aa.each(af,function(ag){ab.add_drawable(n(ag,ab,ab))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).addClass("chrom-nav").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ac=function(af){if(af.type==="focusout"||(af.keyCode||af.which)===13||(af.keyCode||af.which)===27){if((af.keyCode||af.which)!==27){ab.go_to($(this).val())}$(this).hide();$(this).val("");ab.location_span.show();ab.chrom_select.show()}af.stopPropagation()};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ac).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){ab.location_span.hide();ab.chrom_select.hide();ab.nav_input.val(ab.chrom+":"+ab.low+"-"+ab.high);ab.nav_input.css("display","inline-block");ab.nav_input.select();ab.nav_input.focus();ab.nav_input.autocomplete({source:function(ah,af){var ai=[],ag=$.map(ab.get_tracks(c),function(aj){return aj.data_manager.search_features(ah.term).success(function(ak){ai=ai.concat(ak)})});$.when.apply($,ag).done(function(){af($.map(ai,function(aj){return{label:aj[0],value:aj[1]}}))})}})});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){ab.zoom_out()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){ab.zoom_in()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){ab.change_chrom(ab.chrom_select.val())});this.browser_content_div.click(function(af){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(af){ab.zoom_in(af.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(af,ag){this.current_x=ag.offsetX}).bind("drag",function(af,ah){var ai=ah.offsetX-this.current_x;this.current_x=ah.offsetX;var ag=Math.round(ai/ab.viewport_container.width()*(ab.max_high-ab.max_low));ab.move_delta(-ag)});this.overview_close.click(function(){ab.reset_overview()});this.viewport_container.bind("draginit",function(af,ag){if(af.clientX>ab.viewport_container.width()-16){return false}}).bind("dragstart",function(af,ag){ag.original_low=ab.low;ag.current_height=af.clientY;ag.current_x=ag.offsetX}).bind("drag",function(ah,aj){var af=$(this);var ak=aj.offsetX-aj.current_x;var ag=af.scrollTop()-(ah.clientY-aj.current_height);af.scrollTop(ag);aj.current_height=ah.clientY;aj.current_x=aj.offsetX;var ai=Math.round(ak/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}).bind("mousewheel",function(ah,aj,ag,af){if(ag){ag*=50;var ai=Math.round(-ag/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}});this.top_labeltrack.bind("dragstart",function(af,ag){return $("<div/>").addClass("zoom-area").css("height",ab.browser_content_div.height()+ab.top_labeltrack.height()+ab.nav_labeltrack.height()+1).appendTo($(this))}).bind("drag",function(aj,ak){$(ak.proxy).css({left:Math.min(aj.pageX,ak.startX)-ab.container.offset().left,width:Math.abs(aj.pageX-ak.startX)});var ag=Math.min(aj.pageX,ak.startX)-ab.container.offset().left,af=Math.max(aj.pageX,ak.startX)-ab.container.offset().left,ai=(ab.high-ab.low),ah=ab.viewport_container.width();ab.update_location(Math.round(ag/ah*ai)+ab.low,Math.round(af/ah*ai)+ab.low)}).bind("dragend",function(ak,al){var ag=Math.min(ak.pageX,al.startX),af=Math.max(ak.pageX,al.startX),ai=(ab.high-ab.low),ah=ab.viewport_container.width(),aj=ab.low;ab.low=Math.round(ag/ah*ai)+aj;ab.high=Math.round(af/ah*ai)+aj;$(al.proxy).remove();ab.request_redraw()});this.add_label_track(new V(this,{content_div:this.top_labeltrack}));this.add_label_track(new V(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){ab.resize_window()},500)});$(document).bind("redraw",function(){ab.redraw()});this.reset();$(window).trigger("resize")},get_base_color:function(ab){return this.config.get_value(ab.toLowerCase()+"_color")||this.config.get_value("n_color")}});o(X.prototype,y.prototype,{changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(ac,ae,ab,af){if(this.timer){clearTimeout(this.timer)}if(af){var ad=this;this.timer=setTimeout(function(){ad.trigger("navigate",ac+":"+ae+"-"+ab)},500)}else{view.trigger("navigate",ac+":"+ae+"-"+ab)}},update_location:function(ab,ad){this.location_span.text(commatize(ab)+" - "+commatize(ad));this.nav_input.val(this.chrom+":"+commatize(ab)+"-"+commatize(ad));var ac=view.chrom_select.val();if(ac!==""){this.trigger_navigate(ac,view.low,view.high,true)}},load_chroms:function(ad){ad.num=v;var ab=this,ac=$.Deferred();$.ajax({url:galaxy_config.root+"api/genomes/"+this.dbkey,data:ad,dataType:"json",success:function(af){if(af.chrom_info.length===0){return}if(af.reference){var ag=new B(ab);ab.add_label_track(ag);ab.reference_track=ag}ab.chrom_data=af.chrom_info;var aj='<option value="">Select Chrom/Contig</option>';for(var ai=0,ae=ab.chrom_data.length;ai<ae;ai++){var ah=ab.chrom_data[ai].chrom;aj+='<option value="'+ah+'">'+ah+"</option>"}if(af.prev_chroms){aj+='<option value="previous">Previous '+v+"</option>"}if(af.next_chroms){aj+='<option value="next">Next '+v+"</option>"}ab.chrom_select.html(aj);ab.chrom_start_index=af.start_index;ac.resolve(af.chrom_info)},error:function(){alert("Could not load chroms for this dbkey: "+ab.dbkey)}});return ac},change_chrom:function(ag,ac,ai){var ad=this;if(!ad.chrom_data){ad.load_chroms_deferred.then(function(){ad.change_chrom(ag,ac,ai)});return}if(!ag||ag==="None"){return}if(ag==="previous"){ad.load_chroms({low:this.chrom_start_index-v});return}if(ag==="next"){ad.load_chroms({low:this.chrom_start_index+v});return}var ah=$.grep(ad.chrom_data,function(aj,ak){return aj.chrom===ag})[0];if(ah===undefined){ad.load_chroms({chrom:ag},function(){ad.change_chrom(ag,ac,ai)});return}else{if(ag!==ad.chrom){ad.chrom=ag;ad.chrom_select.val(ad.chrom);ad.max_high=ah.len-1;ad.reset();for(var af=0,ab=ad.drawables.length;af<ab;af++){var ae=ad.drawables[af];if(ae.init){ae.init()}}if(ad.reference_track){ad.reference_track.init()}}if(ac===undefined&&ai===undefined){ad.low=0;ad.high=ad.max_high}else{ad.low=(ac!==undefined?Math.max(ac,0):0);if(ai===undefined){ad.low=Math.max(ad.low-15,0);ad.high=ad.low+30}else{ad.high=Math.min(ai,ad.max_high)}}ad.reset_overview();ad.request_redraw()}},go_to:function(af){af=af.replace(/,/g,"");af=af.replace(/:|\-/g," ");var ac=af.split(/\s+/),ae=ac[0],ad=(ac[1]?parseInt(ac[1],10):undefined),ab=(ac[2]?parseInt(ac[2],10):undefined);this.change_chrom(ae,ad,ab)},move_fraction:function(ad){var ab=this;var ac=ab.high-ab.low;this.move_delta(ad*ac)},move_delta:function(ae){var ab=this;var ad=ab.high-ab.low;if(ab.low-ae<ab.max_low){ab.low=ab.max_low;ab.high=ab.max_low+ad}else{if(ab.high-ae>ab.max_high){ab.high=ab.max_high;ab.low=ab.max_high-ad}else{ab.high-=ae;ab.low-=ae}}ab.request_redraw({data_fetch:false});if(this.redraw_on_move_fn){clearTimeout(this.redraw_on_move_fn)}this.redraw_on_move_fn=setTimeout(function(){ab.request_redraw()},200);var ac=ab.chrom_select.val();this.trigger_navigate(ac,ab.low,ab.high,true)},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);ab.init();this.changed();this.update_intro_div()},add_label_track:function(ab){ab.view=this;ab.init();this.label_tracks.push(ab)},remove_drawable:function(ad,ac){y.prototype.remove_drawable.call(this,ad);if(ac){var ab=this;ad.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ac,ad){var ab=this,ae=(ad?[ad]:ab.drawables);aa.each(ae,function(af){var ag=aa.find(ab.tracks_to_be_redrawn,function(ah){return ah[0]===af});if(ag){ag[1]=ac}else{ab.tracks_to_be_redrawn.push([af,ac])}});if(!this.requested_redraw){requestAnimationFrame(function(){ab._redraw()});this.requested_redraw=true}},_redraw:function(){this.requested_redraw=false;var ab=this.low,af=this.high;if(ab<this.max_low){ab=this.max_low}if(af>this.max_high){af=this.max_high}var ac=this.high-this.low;if(this.high!==0&&ac<this.min_separation){af=ab+this.min_separation}this.low=Math.floor(ab);this.high=Math.ceil(af);this.update_location(this.low,this.high);this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var ae=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ag=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ad=13;this.overview_box.css({left:ae,width:Math.max(ad,ag)}).show();if(ag<ad){this.overview_box.css("left",ae-(ad-ag)/2)}if(this.overview_highlight){this.overview_highlight.css({left:ae,width:ag})}aa.each(this.tracks_to_be_redrawn,function(aj){var ah=aj[0],ai=aj[1];if(ah){ah._draw(ai)}});this.tracks_to_be_redrawn=[];aa.each(this.label_tracks,function(ah){ah._draw()})},zoom_in:function(ac,ad){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ae=this.high-this.low,af=ae/2+this.low,ab=(ae/this.zoom_factor)/2;if(ac){af=ac/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(af-ab);this.high=Math.round(af+ab);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var ac=this.high-this.low,ad=ac/2+this.low,ab=(ac*this.zoom_factor)/2;this.low=Math.round(ad-ab);this.high=Math.round(ad+ab);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ad){if(this.overview_drawable){if(this.overview_drawable.dataset.id===ad.dataset.id){return}this.overview_viewport.find(".track").remove()}var ac=ad.copy({content_div:this.overview_viewport}),ab=this;ac.header_div.hide();ac.is_overview=true;ab.overview_drawable=ac;this.overview_drawable.postdraw_actions=function(){ab.overview_highlight.show().height(ab.overview_drawable.content_div.height());ab.overview_viewport.height(ab.overview_drawable.content_div.height()+ab.overview_box.outerHeight());ab.overview_close.show();ab.resize_window()};ab.overview_drawable.request_draw();this.changed()},reset_overview:function(){$(".tooltip").remove();this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();view.overview_drawable=null}});var q=P.Tool.extend({defaults:{track:null},initialize:function(ab){P.Tool.prototype.initialize.call(this,ab);var ac=true;if(ab.tool_state!==undefined&&ab.tool_state.hidden!==undefined){ac=ab.tool_state.hidden}this.set("hidden",ac);this.remove_inputs(["data","hidden_data","conditional"])},state_dict:function(ab){return aa.extend(this.get_inputs_dict(),{hidden:!this.is_visible()})}});var t=Backbone.View.extend({events:{"change input":"update_value"},render:function(){var ad=this.$el.addClass("param-row"),ae=this.model;var ab=$("<div>").addClass("param-label").text(ae.get("label")).appendTo(ad);var ac=$("<div/>").addClass("param-input").html(ae.get("html")).appendTo(ad);ac.find(":input").val(ae.get("value"));$("<div style='clear: both;'/>").appendTo(ad)},update_value:function(ab){this.model.set_value($(ab.target).val())}});var Z=Backbone.View.extend({initialize:function(ab){this.model.on("change:hidden",this.set_visible,this)},render:function(){var ac=this;tool=this.model,parent_div=this.$el.addClass("dynamic-tool").hide();parent_div.bind("drag",function(ag){ag.stopPropagation()}).click(function(ag){ag.stopPropagation()}).bind("dblclick",function(ag){ag.stopPropagation()}).keydown(function(ag){ag.stopPropagation()});var ad=$("<div class='tool-name'>").appendTo(parent_div).text(tool.get("name"));tool.get("inputs").each(function(ah){var ag=new t({model:ah});ag.render();parent_div.append(ag.$el)});parent_div.find("input").click(function(){$(this).select()});var ae=$("<div>").addClass("param-row").appendTo(parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ae);var ab=$("<input type='submit'>").attr("value","Run on visible region").appendTo(ae);ab.click(function(){ac.run_on_region()});af.click(function(){ac.run_on_dataset()});if(tool.is_visible()){this.$el.show()}},set_visible:function(){if(this.model.is_visible()){this.$el.show()}else{this.$el.hide()}},update_params:function(){for(var ab=0;ab<this.params.length;ab++){this.params[ab].update_value()}},run_on_dataset:function(){var ab=this.model;this.run({target_dataset_id:this.model.get("track").dataset.id,action:"rerun",tool_id:ab.id},null,function(ac){Galaxy.modal.show({title:ab.get("name")+" is Running",body:ab.get("name")+" is running on the complete dataset. Tool outputs are in dataset's history.",buttons:{Close:function(){Galaxy.modal.hide()}}})})},run_on_region:function(){var ac=this.model.get("track"),af=this.model,ah=new w.GenomeRegion({chrom:ac.view.chrom,start:ac.view.low,end:ac.view.high}),ai={target_dataset_id:ac.dataset.id,action:"rerun",tool_id:af.id,regions:[ah.toJSON()]},ag=ac,ak=af.get("name")+ag.tool_region_and_parameters_str(ah),ab;if(ag.container===view){var aj=new N(view,view,{name:ac.config.get_value("name")});var ae=ag.container.replace_drawable(ag,aj,false);aj.container_div.insertBefore(ag.view.content_div.children()[ae]);aj.add_drawable(ag);ag.container_div.appendTo(aj.content_div);ab=aj}else{ab=ag.container}var ad=new ag.constructor(view,ab,{name:ak,hda_ldda:"hda"});ad.init_for_tool_data();ad.change_mode(ag.mode);ad.set_filters_manager(ag.filters_manager.copy(ad));ad.update_icons();ab.add_drawable(ad);ad.tiles_div.text("Starting job.");this.run(ai,ad,function(al){ad.set_dataset(new W.Dataset(al));ad.tiles_div.text("Running job.");ad.init()})},run:function(ab,ad,ae){ab.inputs=this.model.get_inputs_dict();var ac=new j.ServerStateDeferred({ajax_settings:{url:galaxy_config.root+"api/tools",data:JSON.stringify(ab),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(af){return af!=="pending"}});$.when(ac.go()).then(function(af){if(af==="no converter"){ad.container_div.addClass("error");ad.content_div.text(H)}else{if(af.error){ad.container_div.addClass("error");ad.content_div.text(x+af.message)}else{ae(af)}}})}});var C=function(ab,ac){J.Scaler.call(this,ac);this.filter=ab};C.prototype.gen_val=function(ab){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(ab[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var b=function(ab,ae,af,ac,ad){this.track=ab;this.region=ae;this.low=ae.get("start");this.high=ae.get("end");this.w_scale=af;this.canvas=ac;this.html_elt=$("<div class='track-tile'/>").append(ac);this.data=ad;this.stale=false};b.prototype.predisplay_actions=function(){};var K=function(ab,ae,af,ac,ad){b.call(this,ab,ae,af,ac,ad)};K.prototype.predisplay_actions=function(){};var M=function(ad,ai,ak,ac,af,ag,al,ab,ah,ae,aj){b.call(this,ad,ai,ak,ac,af);this.mode=ag;this.all_slotted=ab;this.feature_mapper=ah;this.has_icons=false;this.incomplete_features=ae;this.seq_data=aj};o(M.prototype,b.prototype);M.prototype.predisplay_actions=function(){var ac=this,ab={};if(ac.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(an){if(!this.hovered){return}var ai=$(this).offset(),am=an.pageX-ai.left,al=an.pageY-ai.top,ar=ac.feature_mapper.get_feature_data(am,al),aj=(ar?ar[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!aj||$(this).attr("id")!==aj.toString()){$(this).remove()}});if(ar){var ae=ab[aj];if(!ae){var ao={name:ar[3],start:ar[1],end:ar[2],strand:ar[4]},ah=ac.track.filters_manager.filters,ag;for(var ak=0;ak<ah.length;ak++){ag=ah[ak];ao[ag.name]=ar[ag.index]}ae=$("<div/>").attr("id",aj).addClass("feature-popup");var at=$("<table/>"),aq,ap,au;for(aq in ao){ap=ao[aq];au=$("<tr/>").appendTo(at);$("<th/>").appendTo(au).text(aq);$("<td/>").attr("align","left").appendTo(au).text(typeof(ap)==="number"?U(ap,2):ap)}ae.append($("<div class='feature-popup-inner'>").append(at));ab[aj]=ae}ae.appendTo($(this).parents(".track-content").children(".overlay"));var af=am+parseInt(ac.html_elt.css("left"),10)-ae.width()/2,ad=al+parseInt(ac.html_elt.css("top"),10)+7;ae.css("left",af+"px").css("top",ad+"px")}else{if(!an.isPropagationStopped()){an.stopPropagation();$(this).siblings().each(function(){$(this).trigger(an)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var f=function(ac,ab,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ac,ab,ad);this.dataset=null;if(ad.dataset){this.dataset=(ad.dataset instanceof Backbone.Model?ad.dataset:new W.Dataset(ad.dataset))}this.dataset_check_type="converted_datasets_state";this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:I);this.data_manager=("data_manager" in ad?ad.data_manager:new w.GenomeDataManager({dataset:this.dataset,genome:new w.Genome({key:ac.dbkey,chroms_info:{chrom_info:ac.chrom_data}}),data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=this.config.get_value("height");this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(f.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"application-dock-270",on_click_fn:function(ab){ab.view.set_overview(ab)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"ui-slider-050",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters()}else{ab.filters_manager.init_filters()}ab.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(ab){ab.tool.toggle();if(ab.tool.is_visible()){ab.set_name(ab.config.get_value("name")+ab.tool_region_and_parameters_str())}else{ab.revert_name()}$(".tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(ab){var ae='<strong>Tool</strong>: <%= track.tool.get("name") %><br/><strong>Dataset</strong>: <%= track.config.get("name") %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ad=aa.template(ae,{track:ab});var ag=function(){Galaxy.modal.hide();$(window).unbind("keypress.check_enter_esc")},ac=function(){var ai=$('select[name="regions"] option:selected').val(),ak,ah=new w.GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),aj=aa.map($(".bookmark"),function(al){return new w.GenomeRegion({from_str:$(al).children(".position").text()})});if(ai==="cur"){ak=[ah]}else{if(ai==="bookmarks"){ak=aj}else{ak=[ah].concat(aj)}}Galaxy.modal.hide();window.location.href=galaxy_config.root+"visualization/sweepster?"+$.param({dataset_id:ab.dataset.id,hda_ldda:ab.dataset.get("hda_ldda"),regions:JSON.stringify(new Backbone.Collection(ak).toJSON())})},af=function(ah){if((ah.keyCode||ah.which)===27){ag()}else{if((ah.keyCode||ah.which)===13){ac()}}};Galaxy.modal.show({title:"Visualize tool parameter space and output from different parameter settings?",body:ad,buttons:{No:ag,Yes:ac}})}},p.prototype.action_icons_def[2]],can_draw:function(){return this.dataset&&p.prototype.can_draw.call(this)},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id)},build_header_div:function(){var ab=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(ab)}this.name_div=$("<div/>").addClass("track-name").appendTo(ab).text(this.config.get_value("name")).attr("id",this.config.get_value("name").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return ab},set_dataset:function(ab){this.dataset=ab;this.data_manager.set("dataset",ab)},on_resize:function(){this.request_draw({clear_tile_cache:true})},add_resize_handle:function(){var ab=this;var ae=false;var ad=false;var ac=$("<div class='track-resize'>");$(ab.container_div).hover(function(){if(ab.config.get_value("content_visible")){ae=true;ac.show()}},function(){ae=false;if(!ad){ac.hide()}});ac.hide().bind("dragstart",function(af,ag){ad=true;ag.original_height=$(ab.content_div).height()}).bind("drag",function(ag,ah){var af=Math.min(Math.max(ah.original_height+ah.deltaY,ab.min_height_px),ab.max_height_px);$(ab.tiles_div).css("height",af);ab.visible_height_px=(ab.max_height_px===af?0:af);ab.on_resize()}).bind("dragend",function(af,ag){ab.tile_cache.clear();ad=false;if(!ae){ac.hide()}ab.config.set("height",ab.visible_height_px);ab.changed()}).appendTo(ab.container_div)},set_display_modes:function(ae,ah){this.display_modes=ae;this.mode=(ah?ah:(this.config&&this.config.get_value("mode")?this.config.get_value("mode"):this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var ac=this,af={};for(var ad=0,ab=ac.display_modes.length;ad<ab;ad++){var ag=ac.display_modes[ad];af[ag]=function(ai){return function(){ac.change_mode(ai);ac.icons_div.show();ac.container_div.mouseleave(function(){ac.icons_div.hide()})}}(ag)}make_popupmenu(this.action_icons.mode_icon,af)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof V){return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrack"}else{if(this instanceof g){return"LineTrack"}else{if(this instanceof S){return"ReadTrack"}else{if(this instanceof Y){return"VariantTrack"}else{if(this instanceof e){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},show_message:function(ab){this.tiles_div.remove();return $("<span/>").addClass("message").html(ab).appendTo(this.content_div)},init:function(ad){var ac=this;ac.enabled=false;ac.tile_cache.clear();ac.data_manager.clear();ac.content_div.children().remove();ac.container_div.removeClass("nodata error pending");ac.tiles_div=$("<div/>").addClass("tiles").appendTo(ac.content_div);if(!ac.dataset.id){return}var ab=$.Deferred(),ae={hda_ldda:ac.dataset.get("hda_ldda"),data_type:this.dataset_check_type,chrom:ac.view.chrom,retry:ad};$.getJSON(this.dataset.url(),ae,function(af){if(!af||af==="error"||af.kind==="error"){ac.container_div.addClass("error");var ag=ac.show_message(m);if(af.message){ag.append($("<a href='javascript:void(0);'></a>").text("View error").click(function(){Galaxy.modal.show({title:"Trackster Error",body:"<pre>"+af.message+"</pre>",buttons:{Close:function(){Galaxy.modal.hide()}}})}));ag.append($("<span/>").text(" "));ag.append($("<a href='javascript:void(0);'></a>").text("Try again").click(function(){ac.init(true)}))}}else{if(af==="no converter"){ac.container_div.addClass("error");ac.show_message(H)}else{if(af==="no data"||(af.data!==undefined&&(af.data===null||af.data.length===0))){ac.container_div.addClass("nodata");ac.show_message(E)}else{if(af==="pending"){ac.container_div.addClass("pending");ac.show_message(u);setTimeout(function(){ac.init()},ac.data_query_wait)}else{if(af==="data"||af.status==="data"){if(af.valid_chroms){ac.valid_chroms=af.valid_chroms;ac.update_icons()}ac.tiles_div.text(T);if(ac.view.chrom){ac.tiles_div.text("");ac.tiles_div.css("height",ac.visible_height_px+"px");ac.enabled=true;$.when.apply($,ac.predraw_init()).done(function(){ab.resolve();ac.container_div.removeClass("nodata error pending");ac.request_draw()})}else{ab.resolve()}}}}}}});this.update_icons();return ab},predraw_init:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(ae&&ae.min&&ae.max){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_default_value("min_value",ad);ab.config.set_default_value("max_value",af);ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},get_drawables:function(){return this}});var L=function(ad,ac,af){f.call(this,ad,ac,af);var ab=this;k(ab.container_div,ab.drag_handle_class,".group",ab);this.filters_manager=new h.FiltersManager(this,("filters" in af?af.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=(af.tool?new q(aa.extend(af.tool,{track:this,tool_state:af.tool_state})):null);this.tile_cache=new w.Cache(O);this.left_offset=0;if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){var ae=new Z({model:this.tool});ae.render();this.dynamic_tool_div=ae.$el;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);if(!this.config.get_value("content_visible")){this.tiles_div.hide()}this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)}};o(L.prototype,p.prototype,f.prototype,{action_icons_def:f.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(ab){$(".tooltip").remove();ab.slotters[ab.view.resolution_px_b].max_rows*=2;ab.request_draw({clear_tile_cache:true})},hide:true}]),copy:function(ab){var ac=this.to_dict();o(ac,{data_manager:this.data_manager});var ad=new this.constructor(this.view,ab,ac);ad.change_mode(this.mode);ad.enabled=this.enabled;return ad},set_filters_manager:function(ab){this.filters_manager=ab;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool?this.tool.state_dict():{})}},set_min_max:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(isNaN(parseFloat(ab.config.get_value("min_value")))||isNaN(parseFloat(ab.config.get_value("max_value")))){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},change_mode:function(ac){var ab=this;ab.mode=ac;ab.config.set_value("mode",ac);if(ac==="Auto"){this.data_manager.clear()}ab.request_draw({clear_tile_cache:true});this.action_icons.mode_icon.attr("title","Set display mode (now: "+ab.mode+")");return ab},update_icons:function(){var ab=this;if(ab.filters_available){ab.action_icons.filters_icon.show()}else{ab.action_icons.filters_icon.hide()}if(ab.tool){ab.action_icons.tools_icon.show();ab.action_icons.param_space_viz_icon.show()}else{ab.action_icons.tools_icon.hide();ab.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(ac,ab){return ac+"_"+ab},request_draw:function(ab){if(ab&&ab.clear_tile_cache){this.tile_cache.clear()}this.view.request_redraw(ab,this)},before_draw:function(){this.max_height_px=0},_draw:function(ap){if(!this.can_draw()){return}var am=ap&&ap.clear_after,ak=this.view.low,af=this.view.high,ai=af-ak,ac=this.view.container.width(),ao=this.view.resolution_px_b,ae=1/ao;if(this.is_overview){ak=this.view.max_low;af=this.view.max_high;ao=ac/(view.max_high-view.max_low);ae=1/ao}this.before_draw();this.tiles_div.children().addClass("remove");var ab=Math.floor(ak/(ae*Q)),aj,al,ag,ah=[],an=[];while((ab*Q*ae)<af){aj=Math.floor(ab*Q*ae);al=new w.GenomeRegion({chrom:this.view.chrom,start:aj,end:Math.min(aj+Math.ceil(Q*ae),this.view.max_high)});ag=this.draw_helper(al,ao,ap);ah.push(ag);$.when(ag).then(function(aq){an.push(aq)});ab+=1}if(!am){this.tiles_div.children(".remove").removeClass("remove").remove()}var ad=this;$.when.apply($,ah).then(function(){ad.tiles_div.children(".remove").remove();an=aa.filter(an,function(aq){return aq!==null});if(an.length!==0){ad.postdraw_actions(an,ac,ao,am)}})},_add_yaxis_label:function(ae,ag){var ac=this,af=(ae==="max"?"top":"bottom"),ah=(ae==="max"?"max":"min"),ab=(ae==="max"?"max_value":"min_value"),ad=this.container_div.find(".yaxislabel."+af);ag=ag||function(){ac.request_draw({clear_tile_cache:true})};if(ad.length!==0){ad.text(ac.config.get_value(ab))}else{ad=$("<div/>").text(ac.config.get_value(ab)).make_text_editable({num_cols:12,on_finish:function(ai){$(".tooltip").remove();ac.config.set_value(ab,ai);ag()},help_text:"Set "+ah+" value"}).addClass("yaxislabel "+af).css("color",this.config.get_value("label_color"));this.container_div.prepend(ad)}},postdraw_actions:function(ae,af,ah,ab){var ad=aa.filter(ae,function(ai){return(ai instanceof K)});if(ad.length>0){this.max_height_px=0;var ac=this;aa.each(ae,function(ai){if(!(ai instanceof K)){ai.html_elt.remove();ac.draw_helper(ai.region,ah,{force:true,mode:"Coverage"})}});ac._add_yaxis_label("max")}else{this.container_div.find(".yaxislabel").remove();var ag=aa.find(ae,function(ai){return ai.has_icons});if(ag){aa.each(ae,function(ai){if(!ai.has_icons){ai.html_elt.css("padding-top",D)}})}}},get_mode:function(ab){return this.mode},update_auto_mode:function(ab){},_get_drawables:function(){return[this]},draw_helper:function(ak,am,an){if(!an){an={}}var ac=an.force,ah=an.mode||this.mode,ae=1/am,ad=this,af=this._get_drawables(),al=this._gen_tile_cache_key(am,ak),ag=function(ao){return(ao&&"track" in ao)};var ai=(ac?undefined:ad.tile_cache.get_elt(al));if(ai){if(ag(ai)){ad.show_tile(ai,am)}return ai}if(an.data_fetch===false){return null}var aj=function(){var ao=(aa.find(A,function(aq){return aq===ah})?"Coverage":ah);var ap=aa.map(af,function(aq){return aq.data_manager.get_data(ak,ao,ae,ad.data_url_extra_params)});if(view.reference_track){ap.push(view.reference_track.data_manager.get_data(ak,ah,ae,view.reference_track.data_url_extra_params))}return ap};var ab=$.Deferred();ad.tile_cache.set_elt(al,ab);$.when.apply($,aj()).then(function(){var ao=aj(),au=ao,aA;if(aa.find(ao,function(aC){return j.is_deferred(aC)})){ad.tile_cache.set_elt(al,undefined);$.when(ad.draw_helper(ak,am,an)).then(function(aC){ab.resolve(aC)});return}if(view.reference_track){aA=view.reference_track.data_manager.subset_entry(ao.pop(),ak)}var av=[],ar=[];aa.each(af,function(aF,aC){var aE=aF.mode,aD=au[aC];if(aE==="Auto"){aE=aF.get_mode(aD);aF.update_auto_mode(aE)}av.push(aE);ar.push(aF.get_canvas_height(aD,aE,am,ap))});var at=ad.view.canvas_manager.new_canvas(),aw=ak.get("start"),aB=ak.get("end"),aq=0,ap=Math.ceil((aB-aw)*am)+ad.left_offset,ay=aa.max(ar),ax;at.width=ap;at.height=(an.height||ay);var az=at.getContext("2d");az.translate(ad.left_offset,0);if(af.length>1){az.globalAlpha=0.5;az.globalCompositeOperation="source-over"}aa.each(af,function(aD,aC){ax=aD.draw_tile(au[aC],az,av[aC],ak,am,aA)});if(ax!==undefined){ad.tile_cache.set_elt(al,ax);ad.show_tile(ax,am)}ab.resolve(ax)});return ab},get_canvas_height:function(ab,ad,ae,ac){return this.visible_height_px},_draw_line_track_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.LinePainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new K(this,af,ah,ae,ab.data)},draw_tile:function(ab,ac,af,ae,ag,ad){},show_tile:function(ad,ag){var ac=this,ab=ad.html_elt;ad.predisplay_actions();var af=(ad.low-(this.is_overview?this.view.max_low:this.view.low))*ag;if(this.left_offset){af-=this.left_offset}ab.css("left",af);if(ab.hasClass("remove")){ab.removeClass("remove")}else{this.tiles_div.append(ab)}ab.css("height","auto");this.max_height_px=Math.max(this.max_height_px,ab.height()-2);ab.parent().children().css("height",this.max_height_px+"px");var ae=this.max_height_px;if(this.visible_height_px!==0){ae=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",ae+"px")},tool_region_and_parameters_str:function(ae){var ab=this,ad=(ae!==undefined?ae.toString():"all"),ac=aa.values(ab.tool.get_inputs_dict()).join(", ");return" - region=["+ad+"], parameters=["+ac+"]"},data_and_mode_compatible:function(ab,ac){if(ac==="Auto"){return true}else{if(ac==="Coverage"){return ab.dataset_type==="bigwig"}else{if(ab.dataset_type==="bigwig"||ab.extra_info==="no_detail"){return false}else{return true}}}},can_subset:function(ab){if(ab.message||ab.extra_info==="no_detail"){return false}else{if(ab.dataset_type==="bigwig"){return(ab.data[1][0]-ab.data[0][0]===1)}}return true},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data");this.data_query_wait=1000;this.dataset_check_type="state"}});var V=function(ac,ab){var ad={resize:false};f.call(this,ac,ab,ad);this.container_div.addClass("label-track")};o(V.prototype,f.prototype,{build_header_div:function(){},init:function(){this.enabled=true},predraw_init:function(){},_draw:function(af){var ad=this.view,ae=ad.high-ad.low,ai=Math.floor(Math.pow(10,Math.floor(Math.log(ae)/Math.log(10)))),ab=Math.floor(ad.low/ai)*ai,ag=this.view.container.width(),ac=$("<div/>").addClass("label-container");while(ab<ad.high){var ah=(ab-ad.low)/ae*ag;ac.append($("<div/>").addClass("label").text(commatize(ab)).css({left:ah}));ab+=ai}this.content_div.children(":first").remove();this.content_div.append(ac)}});var e=function(ac,ab,af){L.call(this,ac,ab,af);this.drawables=[];if("drawables" in af){var ae;for(var ad=0;ad<af.drawables.length;ad++){ae=af.drawables[ad];this.drawables[ad]=n(ae,ac,null);if(ae.left_offset>this.left_offset){this.left_offset=ae.left_offset}}this.enabled=true}aa.each(this.drawables,function(ag){if(ag instanceof c||ag instanceof S){ag.change_mode("Coverage")}});this.update_icons();this.obj_type="CompositeTrack"};o(e.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_group()}}].concat(L.prototype.action_icons_def),to_dict:y.prototype.to_dict,add_drawable:y.prototype.add_drawable,unpack_drawables:y.prototype.unpack_drawables,config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},change_mode:function(ab){L.prototype.change_mode.call(this,ab);for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac].change_mode(ab)}},init:function(){var ad=[];for(var ac=0;ac<this.drawables.length;ac++){ad.push(this.drawables[ac].init())}var ab=this;$.when.apply($,ad).then(function(){ab.enabled=true;ab.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,_get_drawables:function(){return this.drawables},show_group:function(){var ae=new N(this.view,this.container,{name:this.config.get_value("name")}),ab;for(var ad=0;ad<this.drawables.length;ad++){ab=this.drawables[ad];ab.update_icons();ae.add_drawable(ab);ab.container=ae;ae.content_div.append(ab.container_div)}var ac=this.container.replace_drawable(this,ae,true);ae.request_draw({clear_tile_cache:true})},before_draw:function(){L.prototype.before_draw.call(this);var ac=aa.min(aa.map(this.drawables,function(ad){return ad.config.get_value("min_value")})),ab=aa.max(aa.map(this.drawables,function(ad){return ad.config.get_value("max_value")}));this.config.set_value("min_value",ac);this.config.set_value("max_value",ab);aa.each(this.drawables,function(ad){ad.config.set_value("min_value",ac);ad.config.set_value("max_value",ab)})},update_all_min_max:function(){var ac=this,ab=this.config.get_value("min_value"),ad=this.config.get_value("max_value");aa.each(this.drawables,function(ae){ae.config.set_value("min_value",ab);ae.config.set_value("max_value",ad)});this.request_draw({clear_tile_cache:true})},postdraw_actions:function(ah,ab,ak,ag){var af=-1,ad;for(ad=0;ad<ah.length;ad++){var ai=ah[ad].html_elt.find("canvas").height();if(ai>af){af=ai}}for(ad=0;ad<ah.length;ad++){var ae=ah[ad];if(ae.html_elt.find("canvas").height()!==af){this.draw_helper(ae.region,ak,{force:true,height:af});ae.html_elt.remove()}}var ac=this,aj=function(){ac.update_all_min_max()};this._add_yaxis_label("min",aj);this._add_yaxis_label("max",aj)}});var B=function(ab){L.call(this,ab,{content_div:ab.top_labeltrack},{resize:false});this.left_offset=ab.canvas_manager.char_width_px;this.container_div.addClass("reference-track");this.data_url=galaxy_config.root+"api/genomes/"+this.view.dbkey;this.data_url_extra_params={reference:true};this.data_manager=new w.GenomeReferenceDataManager({data_url:this.data_url,can_subset:this.can_subset});this.hide_contents()};o(B.prototype,p.prototype,L.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"height",type:"int",default_value:13,hidden:true}]),build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},predraw_init:function(){},can_draw:p.prototype.can_draw,draw_helper:function(ac,ad,ab){if(ad>this.view.canvas_manager.char_width_px){this.tiles_div.show();return L.prototype.draw_helper.call(this,ac,ad,ab)}else{this.tiles_div.hide();return null}},can_subset:function(ab){return true},draw_tile:function(ad,aj,ae,ag,ak){var ac=this.data_manager.subset_entry(ad,ag),ai=ac.data;var ab=aj.canvas;aj.font=aj.canvas.manager.default_font;aj.textAlign="center";for(var af=0,ah=ai.length;af<ah;af++){aj.fillStyle=this.view.get_base_color(ai[af]);aj.fillText(ai[af],Math.floor(af*ak),10)}return new b(this,ag,ak,ab,ac)}});var g=function(ac,ab,ad){this.mode="Histogram";L.call(this,ac,ab,ad)};o(g.prototype,p.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Color",type:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},before_draw:function(){},draw_tile:function(ab,ac,ae,ad,af){return this._draw_line_track_tile(ab,ac,ae,ad,af)},can_subset:function(ab){return(ab.data[1][0]-ab.data[0][0]===1)},postdraw_actions:function(ac,ad,ae,ab){this._add_yaxis_label("max");this._add_yaxis_label("min")}});var r=function(ac,ab,ad){this.mode="Heatmap";L.call(this,ac,ab,ad)};o(r.prototype,p.prototype,L.prototype,{display_modes:["Heatmap"],config_params:aa.union(p.prototype.config_params,[{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",default_value:-1},{key:"max_value",label:"Max Value",type:"float",default_value:1},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:500,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.DiagonalHeatmapPainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new b(this,af,ah,ae,ab.data)}});var c=function(ac,ab,ad){L.call(this,ac,ab,ad);this.container_div.addClass("feature-track");this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block color",type:"color"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.set_painter_from_config();this.request_draw({clear_tile_cache:true})},set_painter_from_config:function(){if(this.config.get_value("connector_style")==="arcs"){this.painter=J.ArcLinkedFeaturePainter}else{this.painter=J.LinkedFeaturePainter}},postdraw_actions:function(am,ae,ao,al){L.prototype.postdraw_actions.call(this,am,ae,ao,al);var ag=this,ah;var ab={};aa.each(aa.pluck(am,"incomplete_features"),function(ap){aa.each(ap,function(aq){ab[aq[0]]=aq})});var an=this;aa.each(am,function(ap){an.draw_tile({data:aa.values(ab)},ap.canvas.getContext("2d"),ap.mode,ap.region,ao,ap.seq_data,true)});if(ag.filters_manager){var af=ag.filters_manager.filters,aj;for(aj=0;aj<af.length;aj++){af[aj].update_ui_elt()}var ai=false,ak,ad;for(ah=0;ah<am.length;ah++){if(am[ah].data.length){ak=am[ah].data[0];for(aj=0;aj<af.length;aj++){ad=af[aj];if(ad.applies_to(ak)&&ad.min!==ad.max){ai=true;break}}}}if(ag.filters_available!==ai){ag.filters_available=ai;if(!ag.filters_available){ag.filters_manager.hide()}ag.update_icons()}}if(am[0] instanceof M){var ac=true;for(ah=0;ah<am.length;ah++){if(!am[ah].all_slotted){ac=false;break}}if(!ac){this.action_icons.show_more_rows_icon.show()}else{this.action_icons.show_more_rows_icon.hide()}}else{this.action_icons.show_more_rows_icon.hide()}},update_auto_mode:function(ab){if(this.mode==="Auto"){if(ab==="no_detail"){ab="feature spans"}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+ab+")")}},incremental_slots:function(af,ab,ae){var ac=this.view.canvas_manager.dummy_context,ad=this.slotters[af];if(!ad||(ad.mode!==ae)){ad=new (s.FeatureSlotter)(af,ae,z,function(ag){return ac.measureText(ag)});this.slotters[af]=ad}return ad.slot_features(ab)},get_mode:function(ab){if(ab.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>G){mode="Squish"}else{mode="Pack"}}return mode},get_canvas_height:function(ab,af,ag,ac){if(af==="Coverage"||ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ae=this.incremental_slots(ag,ab.data,af);var ad=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return Math.max(this.min_height_px,ad.get_required_height(ae,ac))}},draw_tile:function(am,ar,ap,af,aj,ae,an){var aq=this,ad=ar.canvas,ay=af.get("start"),ac=af.get("end"),ag=this.left_offset;if(am.dataset_type==="bigwig"){return this._draw_line_track_tile(am,ar,ap,af,aj)}var ai=[],ao=this.slotters[aj].slots;all_slotted=true;if(am.data){var ak=this.filters_manager.filters;for(var at=0,av=am.data.length;at<av;at++){var ah=am.data[at];var au=false;var al;for(var ax=0,aC=ak.length;ax<aC;ax++){al=ak[ax];al.update_attrs(ah);if(!al.keep(ah)){au=true;break}}if(!au){ai.push(ah);if(!(ah[0] in ao)){all_slotted=false}}}}var aB=(this.filters_manager.alpha_filter?new C(this.filters_manager.alpha_filter):null),az=(this.filters_manager.height_filter?new C(this.filters_manager.height_filter):null),aA=new (this.painter)(ai,ay,ac,this.config.to_key_value_dict(),ap,aB,az,ae,function(aD){return aq.view.get_base_color(aD)});var aw=null;ar.fillStyle=this.config.get_value("block_color");ar.font=ar.canvas.manager.default_font;ar.textAlign="right";if(am.data){var ab=aA.draw(ar,ad.width,ad.height,aj,ao);aw=ab.feature_mapper;incomplete_features=ab.incomplete_features;aw.translation=-ag}if(!an){return new M(aq,af,aj,ad,am.data,ap,am.message,all_slotted,aw,incomplete_features,ae)}}});var Y=function(ac,ab,ad){L.call(this,ac,ab,ad);this.painter=J.VariantPainter;this.summary_draw_height=30;this.left_offset=30};o(Y.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Histogram color",type:"color"},{key:"show_sample_data",label:"Show sample data",type:"bool",default_value:true},{key:"show_labels",label:"Show summary and sample labels",type:"bool",default_value:true},{key:"summary_height",label:"Locus summary height",type:"float",default_value:20},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ae,ag,af,ah){if(ab.dataset_type==="bigwig"){return this._draw_line_track_tile(ab,ae,"Histogram",af,ah)}else{var ad=this.view,ac=new (this.painter)(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag,function(ai){return ad.get_base_color(ai)});ac.draw(ae,ae.canvas.width,ae.canvas.height,ah);return new b(this,af,ah,ae.canvas,ab.data)}},get_canvas_height:function(ab,af,ag,ad){if(ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ac=(this.dataset.get_metadata("sample_names")?this.dataset.get_metadata("sample_names").length:0);if(ac===0&&ab.data.length!==0){ac=ab.data[0][7].match(/,/g);if(ac===null){ac=1}else{ac=ac.length+1}}var ae=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return ae.get_required_height(ac)}},predraw_init:function(){var ab=[f.prototype.predraw_init.call(this)];if(!this.dataset.get_metadata("sample_names")){ab.push(this.dataset.fetch())}return ab},postdraw_actions:function(af,ag,ai,ac){L.prototype.postdraw_actions.call(this,af,ag,ai,ac);var ae=aa.filter(af,function(aj){return(aj instanceof K)});var ad=this.dataset.get_metadata("sample_names");if(ae.length===0&&this.config.get_value("show_labels")&&ad&&ad.length>1){var ab;if(this.container_div.find(".yaxislabel.variant").length===0){ab=this.config.get_value("summary_height")/2;this.tiles_div.prepend($("<div/>").text("Summary").addClass("yaxislabel variant top").css({"font-size":ab+"px",top:(this.config.get_value("summary_height")-ab)/2+"px"}));if(this.config.get_value("show_sample_data")){var ah=ad.join("<br/>");this.tiles_div.prepend($("<div/>").html(ah).addClass("yaxislabel variant top sample").css({top:this.config.get_value("summary_height")}))}}ab=(this.mode==="Squish"?5:10)+"px";$(this.tiles_div).find(".sample").css({"font-size":ab,"line-height":ab});$(this.tiles_div).find(".yaxislabel").css("color",this.config.get_value("label_color"))}else{this.container_div.find(".yaxislabel.variant").remove()}}});var S=function(ac,ab,ad){c.call(this,ac,ab,ad);this.painter=J.ReadPainter;this.update_icons()};o(S.prototype,p.prototype,L.prototype,c.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block and sense strand color",type:"color",default_value:"#DDDDDD"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:"#AAAAAA"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})}});var d={CompositeTrack:e,DrawableGroup:N,DiagonalHeatmapTrack:r,FeatureTrack:c,LineTrack:g,ReadTrack:S,VariantTrack:Y,VcfTrack:Y};var n=function(ad,ac,ab){if("copy" in ad){return ad.copy(ab)}else{var ae=ad.obj_type;if(!ae){ae=ad.track_type}return new d[ae](ac,ab,ad)}};return{TracksterView:X,DrawableGroup:N,LineTrack:g,FeatureTrack:c,DiagonalHeatmapTrack:r,ReadTrack:S,VariantTrack:Y,CompositeTrack:e,object_from_template:n}});
\ No newline at end of file
+define(["libs/underscore","viz/visualization","viz/trackster/util","viz/trackster/slotting","viz/trackster/painters","viz/trackster/filters","mvc/data","mvc/tools","utils/config"],function(aa,w,j,s,J,h,W,P,R){var o=aa.extend;var l={};var i=function(ab,ac){l[ab.attr("id")]=ac};var k=function(ab,ac,ae,ad){ae=".group";l[ab.attr("id")]=ad;ab.bind("drag",{handle:"."+ac,relative:true},function(am,an){var al=$(this),aq=$(this).parent(),ai=aq.children(".track,.group"),ak=l[$(this).attr("id")],ah,ag,ao,af,aj;ag=$(this).parents(ae);if(ag.length!==0){ao=ag.position().top;af=ao+ag.outerHeight();var ap=l[ag.attr("id")];if(an.offsetY<ao){$(this).insertBefore(ag);ap.remove_drawable(ak);ap.container.add_drawable_before(ak,ap);return}else{if(an.offsetY>af){$(this).insertAfter(ag);ap.remove_drawable(ak);ap.container.add_drawable(ak);return}}}ag=null;for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));ao=ah.position().top;af=ao+ah.outerHeight();if(ah.is(ae)&&this!==ah.get(0)&&an.offsetY>=ao&&an.offsetY<=af){if(an.offsetY-ao<af-an.offsetY){ah.find(".content-div").prepend(this)}else{ah.find(".content-div").append(this)}if(ak.container){ak.container.remove_drawable(ak)}l[ah.attr("id")].add_drawable(ak);return}}for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));if(an.offsetY<ah.position().top&&!(ah.hasClass("reference-track")||ah.hasClass("intro"))){break}}if(aj===ai.length){if(this!==ai.get(aj-1)){aq.append(this);l[aq.attr("id")].move_drawable(ak,aj)}}else{if(this!==ai.get(aj)){$(this).insertBefore(ai.get(aj));l[aq.attr("id")].move_drawable(ak,(an.deltaY>0?aj-1:aj))}}}).bind("dragstart",function(){$(this).addClass("dragging")}).bind("dragend",function(){$(this).removeClass("dragging")})};var D=20,z=100,G=12000,Q=400,I=5000,v=100,m="Cannot display dataset due to an error. ",H="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",E="No data for this chrom/contig.",u="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",x="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",O=10,F=20,A=["Histogram","Line","Filled","Intensity"];function U(ac,ab){if(!ab){ab=0}var ad=Math.pow(10,ab);return Math.round(ac*ad)/ad}var p=function(ac,ab,ae){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.view=ac;this.container=ab;this.drag_handle_class=ae.drag_handle_class;this.is_overview=false;this.action_icons={};this.config=R.ConfigSettingCollection.from_models_and_saved_values(this.config_params,ae.prefs);if(!this.config.get_value("name")){this.config.set_value("name",ae.name)}if(this.config_onchange){this.config.on("change",this.config_onchange,this)}this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").addClass("track-icons").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(af){af.stopPropagation()});var ad=this;this.container_div.hover(function(){ad.icons_div.show()},function(){ad.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(ab){if(ab.config.get_value("content_visible")){ab.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");ab.hide_contents();ab.config.set_value("content_visible",false)}else{ab.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");ab.config.set_value("content_visible",true);ab.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"gear",on_click_fn:function(ac){var ab=new R.ConfigSettingCollectionView({collection:ac.config});ab.render_in_modal("Configure Track")}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(ab){$(".tooltip").remove();ab.remove()}}];o(p.prototype,{config_params:[{key:"name",label:"Name",type:"text",default_value:""},{key:"content_visible",type:"bool",default_value:true,hidden:true}],config_onchange:function(){},init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.config.get_value("content_visible")){return true}return false},request_draw:function(){},_draw:function(ab){},to_dict:function(){},set_name:function(ab){this.old_name=this.config.get_value("name");this.config.set_value("name",ab);this.name_div.text(ab)},revert_name:function(){if(this.old_name){this.config.set_value("name",this.old_name);this.name_div.text(this.old_name)}},remove:function(){this.changed();this.container.remove_drawable(this);var ab=this.view;this.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(ac,ah,ag,af,ab,ae){var ad=this;this.action_icons[ac]=$("<a/>").attr("title",ah).addClass("icon-button").addClass(ag).tooltip().click(function(){af(ad)}).appendTo(this.icons_div);if(ae){this.action_icons[ac].hide()}},build_action_icons:function(ab){var ad;for(var ac=0;ac<ab.length;ac++){ad=ab[ac];this.add_action_icon(ad.name,ad.title,ad.css_class,ad.on_click_fn,ad.prepend,ad.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){},get_drawables:function(){}});var y=function(ac,ab,ad){p.call(this,ac,ab,ad);this.obj_type=ad.obj_type;this.drawables=[]};o(y.prototype,p.prototype,{unpack_drawables:function(ad){this.drawables=[];var ac;for(var ab=0;ab<ad.length;ab++){ac=n(ad[ab],this.view,this);this.add_drawable(ac)}},init:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].init()}},_draw:function(ab){for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac]._draw(ab)}},to_dict:function(){var ac=[];for(var ab=0;ab<this.drawables.length;ab++){ac.push(this.drawables[ab].to_dict())}return{prefs:this.config.to_key_value_dict(),obj_type:this.obj_type,drawables:ac}},add_drawable:function(ab){this.drawables.push(ab);ab.container=this;this.changed()},add_drawable_before:function(ad,ab){this.changed();var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables.splice(ac,0,ad);return true}return false},replace_drawable:function(ad,ab,ac){var ae=this.drawables.indexOf(ad);if(ae!==-1){this.drawables[ae]=ab;if(ac){ad.container_div.replaceWith(ab.container_div)}this.changed()}return ae},remove_drawable:function(ac){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);ac.container=null;this.changed();return true}return false},move_drawable:function(ac,ad){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);this.drawables.splice(ad,0,ac);this.changed();return true}return false},get_drawables:function(){return this.drawables},get_tracks:function(ae){var ab=this.drawables.slice(0),ac=[],ad;while(ab.length!==0){ad=ab.shift();if(ad instanceof ae){ac.push(ad)}else{if(ad.drawables){ab=ab.concat(ad.drawables)}}}return ac}});var N=function(ac,ab,ae){o(ae,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});y.call(this,ac,ab,ae);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);i(this.container_div,this);i(this.content_div,this);k(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new h.FiltersManager(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ae){this.unpack_drawables(ae.drawables)}if("filters" in ae){var ad=this.filters_manager;this.filters_manager=new h.FiltersManager(this,ae.filters);ad.parent_div.replaceWith(this.filters_manager.parent_div);if(ae.filters.visible){this.setup_multitrack_filtering()}}};o(N.prototype,p.prototype,y.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters();ab._restore_filter_managers()}else{ab.setup_multitrack_filtering();ab.request_draw({clear_tile_cache:true})}ab.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var ab=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(ab)}return ab},build_header_div:function(){var ab=$("<div/>").addClass("track-header");ab.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.config.get_value("name")).appendTo(ab);return ab},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ad=this.drawables.length;if(ad===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ad===1){if(this.drawables[0] instanceof e){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ak,aj,ah,an=true,af=this.drawables[0].get_type(),ab=0;for(ak=0;ak<ad;ak++){ah=this.drawables[ak];if(ah.get_type()!==af){can_composite=false;break}if(ah instanceof c){ab++}}if(an&&this.drawables[0] instanceof g){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".tooltip").remove()}if(ab>1&&ab===this.drawables.length){var ao={},ac;ah=this.drawables[0];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];ao[ac.name]=[ac]}for(ak=1;ak<this.drawables.length;ak++){ah=this.drawables[ak];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];if(ac.name in ao){ao[ac.name].push(ac)}}}this.filters_manager.remove_all();var ae,ag,ai,al;for(var am in ao){ae=ao[am];if(ae.length===ab){ag=new h.NumberFilter({name:ae[0].name,index:ae[0].index});this.filters_manager.add_filter(ag)}}if(this.filters_manager.filters.length>0){this.action_icons.filters_icon.show()}else{this.action_icons.filters_icon.hide()}}else{this.action_icons.filters_icon.hide()}}}},_restore_filter_managers:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].filters_manager=this.saved_filters_managers[ab]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var ab=0;ab<this.drawables.length;ab++){drawable=this.drawables[ab];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ac=new e(this.view,this.view,{name:this.config.get_value("name"),drawables:this.drawables});var ab=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);this.update_icons()},remove_drawable:function(ab){y.prototype.remove_drawable.call(this,ab);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var ab=o(y.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return ab},request_draw:function(ab){aa.each(this.drawables,function(ac){ac.request_draw(ab)})}});var X=Backbone.View.extend({initialize:function(ab){o(ab,{obj_type:"View"});y.call(this,"View",ab.container,ab);this.chrom=null;this.vis_id=ab.vis_id;this.dbkey=ab.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.render();this.canvas_manager=new w.CanvasManager(this.container.get(0).ownerDocument);this.reset();this.config=R.ConfigSettingCollection.from_models_and_saved_values([{key:"name",label:"Name",type:"text",default_value:""},{key:"a_color",label:"A Color",type:"color",default_value:"#FF0000"},{key:"c_color",label:"C Color",type:"color",default_value:"#00FF00"},{key:"g_color",label:"G Color",type:"color",default_value:"#0000FF"},{key:"t_color",label:"T Color",type:"color",default_value:"#FF00FF"},{key:"n_color",label:"N Color",type:"color",default_value:"#AAAAAA"}],{name:ab.name})},render:function(){this.requested_redraw=false;var ad=this.container,ab=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ad);this.browser_content_div=$("<div/>").addClass("content").appendTo(ad);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ad);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;i(this.viewport_container,ab);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ae=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){w.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":ab.dbkey},function(af){aa.each(af,function(ag){ab.add_drawable(n(ag,ab,ab))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).addClass("chrom-nav").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ac=function(af){if(af.type==="focusout"||(af.keyCode||af.which)===13||(af.keyCode||af.which)===27){if((af.keyCode||af.which)!==27){ab.go_to($(this).val())}$(this).hide();$(this).val("");ab.location_span.show();ab.chrom_select.show()}af.stopPropagation()};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ac).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){ab.location_span.hide();ab.chrom_select.hide();ab.nav_input.val(ab.chrom+":"+ab.low+"-"+ab.high);ab.nav_input.css("display","inline-block");ab.nav_input.select();ab.nav_input.focus();ab.nav_input.autocomplete({source:function(ah,af){var ai=[],ag=$.map(ab.get_tracks(c),function(aj){return aj.data_manager.search_features(ah.term).success(function(ak){ai=ai.concat(ak)})});$.when.apply($,ag).done(function(){af($.map(ai,function(aj){return{label:aj[0],value:aj[1]}}))})}})});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){ab.zoom_out()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){ab.zoom_in()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){ab.change_chrom(ab.chrom_select.val())});this.browser_content_div.click(function(af){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(af){ab.zoom_in(af.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(af,ag){this.current_x=ag.offsetX}).bind("drag",function(af,ah){var ai=ah.offsetX-this.current_x;this.current_x=ah.offsetX;var ag=Math.round(ai/ab.viewport_container.width()*(ab.max_high-ab.max_low));ab.move_delta(-ag)});this.overview_close.click(function(){ab.reset_overview()});this.viewport_container.bind("draginit",function(af,ag){if(af.clientX>ab.viewport_container.width()-16){return false}}).bind("dragstart",function(af,ag){ag.original_low=ab.low;ag.current_height=af.clientY;ag.current_x=ag.offsetX}).bind("drag",function(ah,aj){var af=$(this);var ak=aj.offsetX-aj.current_x;var ag=af.scrollTop()-(ah.clientY-aj.current_height);af.scrollTop(ag);aj.current_height=ah.clientY;aj.current_x=aj.offsetX;var ai=Math.round(ak/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}).bind("mousewheel",function(ah,aj,ag,af){if(ag){ag*=50;var ai=Math.round(-ag/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}});this.top_labeltrack.bind("dragstart",function(af,ag){return $("<div/>").addClass("zoom-area").css("height",ab.browser_content_div.height()+ab.top_labeltrack.height()+ab.nav_labeltrack.height()+1).appendTo($(this))}).bind("drag",function(aj,ak){$(ak.proxy).css({left:Math.min(aj.pageX,ak.startX)-ab.container.offset().left,width:Math.abs(aj.pageX-ak.startX)});var ag=Math.min(aj.pageX,ak.startX)-ab.container.offset().left,af=Math.max(aj.pageX,ak.startX)-ab.container.offset().left,ai=(ab.high-ab.low),ah=ab.viewport_container.width();ab.update_location(Math.round(ag/ah*ai)+ab.low,Math.round(af/ah*ai)+ab.low)}).bind("dragend",function(ak,al){var ag=Math.min(ak.pageX,al.startX),af=Math.max(ak.pageX,al.startX),ai=(ab.high-ab.low),ah=ab.viewport_container.width(),aj=ab.low;ab.low=Math.round(ag/ah*ai)+aj;ab.high=Math.round(af/ah*ai)+aj;$(al.proxy).remove();ab.request_redraw()});this.add_label_track(new V(this,{content_div:this.top_labeltrack}));this.add_label_track(new V(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){ab.resize_window()},500)});$(document).bind("redraw",function(){ab.redraw()});this.reset();$(window).trigger("resize")},get_base_color:function(ab){return this.config.get_value(ab.toLowerCase()+"_color")||this.config.get_value("n_color")}});o(X.prototype,y.prototype,{changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(ac,ae,ab,af){if(this.timer){clearTimeout(this.timer)}if(af){var ad=this;this.timer=setTimeout(function(){ad.trigger("navigate",ac+":"+ae+"-"+ab)},500)}else{view.trigger("navigate",ac+":"+ae+"-"+ab)}},update_location:function(ab,ad){this.location_span.text(commatize(ab)+" - "+commatize(ad));this.nav_input.val(this.chrom+":"+commatize(ab)+"-"+commatize(ad));var ac=view.chrom_select.val();if(ac!==""){this.trigger_navigate(ac,view.low,view.high,true)}},load_chroms:function(ad){ad.num=v;var ab=this,ac=$.Deferred();$.ajax({url:galaxy_config.root+"api/genomes/"+this.dbkey,data:ad,dataType:"json",success:function(af){if(af.chrom_info.length===0){return}if(af.reference){var ag=new B(ab);ab.add_label_track(ag);ab.reference_track=ag}ab.chrom_data=af.chrom_info;var aj='<option value="">Select Chrom/Contig</option>';for(var ai=0,ae=ab.chrom_data.length;ai<ae;ai++){var ah=ab.chrom_data[ai].chrom;aj+='<option value="'+ah+'">'+ah+"</option>"}if(af.prev_chroms){aj+='<option value="previous">Previous '+v+"</option>"}if(af.next_chroms){aj+='<option value="next">Next '+v+"</option>"}ab.chrom_select.html(aj);ab.chrom_start_index=af.start_index;ac.resolve(af.chrom_info)},error:function(){alert("Could not load chroms for this dbkey: "+ab.dbkey)}});return ac},change_chrom:function(ag,ac,ai){var ad=this;if(!ad.chrom_data){ad.load_chroms_deferred.then(function(){ad.change_chrom(ag,ac,ai)});return}if(!ag||ag==="None"){return}if(ag==="previous"){ad.load_chroms({low:this.chrom_start_index-v});return}if(ag==="next"){ad.load_chroms({low:this.chrom_start_index+v});return}var ah=$.grep(ad.chrom_data,function(aj,ak){return aj.chrom===ag})[0];if(ah===undefined){ad.load_chroms({chrom:ag},function(){ad.change_chrom(ag,ac,ai)});return}else{if(ag!==ad.chrom){ad.chrom=ag;ad.chrom_select.val(ad.chrom);ad.max_high=ah.len-1;ad.reset();for(var af=0,ab=ad.drawables.length;af<ab;af++){var ae=ad.drawables[af];if(ae.init){ae.init()}}if(ad.reference_track){ad.reference_track.init()}}if(ac===undefined&&ai===undefined){ad.low=0;ad.high=ad.max_high}else{ad.low=(ac!==undefined?Math.max(ac,0):0);if(ai===undefined){ad.low=Math.max(ad.low-15,0);ad.high=ad.low+30}else{ad.high=Math.min(ai,ad.max_high)}}ad.reset_overview();ad.request_redraw()}},go_to:function(af){af=af.replace(/,/g,"");af=af.replace(/:|\-/g," ");var ac=af.split(/\s+/),ae=ac[0],ad=(ac[1]?parseInt(ac[1],10):undefined),ab=(ac[2]?parseInt(ac[2],10):undefined);this.change_chrom(ae,ad,ab)},move_fraction:function(ad){var ab=this;var ac=ab.high-ab.low;this.move_delta(ad*ac)},move_delta:function(ae){var ab=this;var ad=ab.high-ab.low;if(ab.low-ae<ab.max_low){ab.low=ab.max_low;ab.high=ab.max_low+ad}else{if(ab.high-ae>ab.max_high){ab.high=ab.max_high;ab.low=ab.max_high-ad}else{ab.high-=ae;ab.low-=ae}}ab.request_redraw({data_fetch:false});if(this.redraw_on_move_fn){clearTimeout(this.redraw_on_move_fn)}this.redraw_on_move_fn=setTimeout(function(){ab.request_redraw()},200);var ac=ab.chrom_select.val();this.trigger_navigate(ac,ab.low,ab.high,true)},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);ab.init();this.changed();this.update_intro_div()},add_label_track:function(ab){ab.view=this;ab.init();this.label_tracks.push(ab)},remove_drawable:function(ad,ac){y.prototype.remove_drawable.call(this,ad);if(ac){var ab=this;ad.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ac,ad){var ab=this,ae=(ad?[ad]:ab.drawables);aa.each(ae,function(af){var ag=aa.find(ab.tracks_to_be_redrawn,function(ah){return ah[0]===af});if(ag){ag[1]=ac}else{ab.tracks_to_be_redrawn.push([af,ac])}});if(!this.requested_redraw){requestAnimationFrame(function(){ab._redraw()});this.requested_redraw=true}},_redraw:function(){this.requested_redraw=false;var ab=this.low,af=this.high;if(ab<this.max_low){ab=this.max_low}if(af>this.max_high){af=this.max_high}var ac=this.high-this.low;if(this.high!==0&&ac<this.min_separation){af=ab+this.min_separation}this.low=Math.floor(ab);this.high=Math.ceil(af);this.update_location(this.low,this.high);this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var ae=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ag=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ad=13;this.overview_box.css({left:ae,width:Math.max(ad,ag)}).show();if(ag<ad){this.overview_box.css("left",ae-(ad-ag)/2)}if(this.overview_highlight){this.overview_highlight.css({left:ae,width:ag})}aa.each(this.tracks_to_be_redrawn,function(aj){var ah=aj[0],ai=aj[1];if(ah){ah._draw(ai)}});this.tracks_to_be_redrawn=[];aa.each(this.label_tracks,function(ah){ah._draw()})},zoom_in:function(ac,ad){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ae=this.high-this.low,af=ae/2+this.low,ab=(ae/this.zoom_factor)/2;if(ac){af=ac/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(af-ab);this.high=Math.round(af+ab);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var ac=this.high-this.low,ad=ac/2+this.low,ab=(ac*this.zoom_factor)/2;this.low=Math.round(ad-ab);this.high=Math.round(ad+ab);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ad){if(this.overview_drawable){if(this.overview_drawable.dataset.id===ad.dataset.id){return}this.overview_viewport.find(".track").remove()}var ac=ad.copy({content_div:this.overview_viewport}),ab=this;ac.header_div.hide();ac.is_overview=true;ab.overview_drawable=ac;this.overview_drawable.postdraw_actions=function(){ab.overview_highlight.show().height(ab.overview_drawable.content_div.height());ab.overview_viewport.height(ab.overview_drawable.content_div.height()+ab.overview_box.outerHeight());ab.overview_close.show();ab.resize_window()};ab.overview_drawable.request_draw();this.changed()},reset_overview:function(){$(".tooltip").remove();this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();view.overview_drawable=null}});var q=P.Tool.extend({defaults:{track:null},initialize:function(ab){P.Tool.prototype.initialize.call(this,ab);var ac=true;if(ab.tool_state!==undefined&&ab.tool_state.hidden!==undefined){ac=ab.tool_state.hidden}this.set("hidden",ac);this.remove_inputs(["data","hidden_data","conditional"])},state_dict:function(ab){return aa.extend(this.get_inputs_dict(),{hidden:!this.is_visible()})}});var t=Backbone.View.extend({events:{"change input":"update_value"},render:function(){var ad=this.$el.addClass("param-row"),ae=this.model;var ab=$("<div>").addClass("param-label").text(ae.get("label")).appendTo(ad);var ac=$("<div/>").addClass("param-input").html(ae.get("html")).appendTo(ad);ac.find(":input").val(ae.get("value"));$("<div style='clear: both;'/>").appendTo(ad)},update_value:function(ab){this.model.set_value($(ab.target).val())}});var Z=Backbone.View.extend({initialize:function(ab){this.model.on("change:hidden",this.set_visible,this)},render:function(){var ac=this;tool=this.model,parent_div=this.$el.addClass("dynamic-tool").hide();parent_div.bind("drag",function(ag){ag.stopPropagation()}).click(function(ag){ag.stopPropagation()}).bind("dblclick",function(ag){ag.stopPropagation()}).keydown(function(ag){ag.stopPropagation()});var ad=$("<div class='tool-name'>").appendTo(parent_div).text(tool.get("name"));tool.get("inputs").each(function(ah){var ag=new t({model:ah});ag.render();parent_div.append(ag.$el)});parent_div.find("input").click(function(){$(this).select()});var ae=$("<div>").addClass("param-row").appendTo(parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ae);var ab=$("<input type='submit'>").attr("value","Run on visible region").appendTo(ae);ab.click(function(){ac.run_on_region()});af.click(function(){ac.run_on_dataset()});if(tool.is_visible()){this.$el.show()}},set_visible:function(){if(this.model.is_visible()){this.$el.show()}else{this.$el.hide()}},update_params:function(){for(var ab=0;ab<this.params.length;ab++){this.params[ab].update_value()}},run_on_dataset:function(){var ab=this.model;this.run({target_dataset_id:this.model.get("track").dataset.id,action:"rerun",tool_id:ab.id},null,function(ac){Galaxy.modal.show({title:ab.get("name")+" is Running",body:ab.get("name")+" is running on the complete dataset. Tool outputs are in dataset's history.",buttons:{Close:function(){Galaxy.modal.hide()}}})})},run_on_region:function(){var ac=this.model.get("track"),af=this.model,ah=new w.GenomeRegion({chrom:ac.view.chrom,start:ac.view.low,end:ac.view.high}),ai={target_dataset_id:ac.dataset.id,action:"rerun",tool_id:af.id,regions:[ah.toJSON()]},ag=ac,ak=af.get("name")+ag.tool_region_and_parameters_str(ah),ab;if(ag.container===view){var aj=new N(view,view,{name:ac.config.get_value("name")});var ae=ag.container.replace_drawable(ag,aj,false);aj.container_div.insertBefore(ag.view.content_div.children()[ae]);aj.add_drawable(ag);ag.container_div.appendTo(aj.content_div);ab=aj}else{ab=ag.container}var ad=new ag.constructor(view,ab,{name:ak,hda_ldda:"hda"});ad.init_for_tool_data();ad.change_mode(ag.mode);ad.set_filters_manager(ag.filters_manager.copy(ad));ad.update_icons();ab.add_drawable(ad);ad.tiles_div.text("Starting job.");this.run(ai,ad,function(al){ad.set_dataset(new W.Dataset(al));ad.tiles_div.text("Running job.");ad.init()})},run:function(ab,ad,ae){ab.inputs=this.model.get_inputs_dict();var ac=new j.ServerStateDeferred({ajax_settings:{url:galaxy_config.root+"api/tools",data:JSON.stringify(ab),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(af){return af!=="pending"}});$.when(ac.go()).then(function(af){if(af==="no converter"){ad.container_div.addClass("error");ad.content_div.text(H)}else{if(af.error){ad.container_div.addClass("error");ad.content_div.text(x+af.message)}else{ae(af)}}})}});var C=function(ab,ac){J.Scaler.call(this,ac);this.filter=ab};C.prototype.gen_val=function(ab){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(ab[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var b=function(ab,ae,af,ac,ad){this.track=ab;this.region=ae;this.low=ae.get("start");this.high=ae.get("end");this.w_scale=af;this.canvas=ac;this.html_elt=$("<div class='track-tile'/>").append(ac);this.data=ad;this.stale=false};b.prototype.predisplay_actions=function(){};var K=function(ab,ae,af,ac,ad){b.call(this,ab,ae,af,ac,ad)};K.prototype.predisplay_actions=function(){};var M=function(ad,ai,ak,ac,af,ag,al,ab,ah,ae,aj){b.call(this,ad,ai,ak,ac,af);this.mode=ag;this.all_slotted=ab;this.feature_mapper=ah;this.has_icons=false;this.incomplete_features=ae;this.seq_data=aj};o(M.prototype,b.prototype);M.prototype.predisplay_actions=function(){var ac=this,ab={};if(ac.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(an){if(!this.hovered){return}var ai=$(this).offset(),am=an.pageX-ai.left,al=an.pageY-ai.top,ar=ac.feature_mapper.get_feature_data(am,al),aj=(ar?ar[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!aj||$(this).attr("id")!==aj.toString()){$(this).remove()}});if(ar){var ae=ab[aj];if(!ae){var ao={name:ar[3],start:ar[1],end:ar[2],strand:ar[4]},ah=ac.track.filters_manager.filters,ag;for(var ak=0;ak<ah.length;ak++){ag=ah[ak];ao[ag.name]=ar[ag.index]}ae=$("<div/>").attr("id",aj).addClass("feature-popup");var at=$("<table/>"),aq,ap,au;for(aq in ao){ap=ao[aq];au=$("<tr/>").appendTo(at);$("<th/>").appendTo(au).text(aq);$("<td/>").attr("align","left").appendTo(au).text(typeof(ap)==="number"?U(ap,2):ap)}ae.append($("<div class='feature-popup-inner'>").append(at));ab[aj]=ae}ae.appendTo($(this).parents(".track-content").children(".overlay"));var af=am+parseInt(ac.html_elt.css("left"),10)-ae.width()/2,ad=al+parseInt(ac.html_elt.css("top"),10)+7;ae.css("left",af+"px").css("top",ad+"px")}else{if(!an.isPropagationStopped()){an.stopPropagation();$(this).siblings().each(function(){$(this).trigger(an)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var f=function(ac,ab,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ac,ab,ad);this.dataset=null;if(ad.dataset){this.dataset=(ad.dataset instanceof Backbone.Model?ad.dataset:new W.Dataset(ad.dataset))}this.dataset_check_type="converted_datasets_state";this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:I);this.data_manager=("data_manager" in ad?ad.data_manager:new w.GenomeDataManager({dataset:this.dataset,genome:new w.Genome({key:ac.dbkey,chroms_info:{chrom_info:ac.chrom_data}}),data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=this.config.get_value("height");this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(f.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"application-dock-270",on_click_fn:function(ab){ab.view.set_overview(ab)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"ui-slider-050",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters()}else{ab.filters_manager.init_filters()}ab.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(ab){ab.tool.toggle();if(ab.tool.is_visible()){ab.set_name(ab.config.get_value("name")+ab.tool_region_and_parameters_str())}else{ab.revert_name()}$(".tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(ab){var ae='<strong>Tool</strong>: <%= track.tool.get("name") %><br/><strong>Dataset</strong>: <%= track.config.get("name") %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ad=aa.template(ae,{track:ab});var ag=function(){Galaxy.modal.hide();$(window).unbind("keypress.check_enter_esc")},ac=function(){var ai=$('select[name="regions"] option:selected').val(),ak,ah=new w.GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),aj=aa.map($(".bookmark"),function(al){return new w.GenomeRegion({from_str:$(al).children(".position").text()})});if(ai==="cur"){ak=[ah]}else{if(ai==="bookmarks"){ak=aj}else{ak=[ah].concat(aj)}}Galaxy.modal.hide();window.location.href=galaxy_config.root+"visualization/sweepster?"+$.param({dataset_id:ab.dataset.id,hda_ldda:ab.dataset.get("hda_ldda"),regions:JSON.stringify(new Backbone.Collection(ak).toJSON())})},af=function(ah){if((ah.keyCode||ah.which)===27){ag()}else{if((ah.keyCode||ah.which)===13){ac()}}};Galaxy.modal.show({title:"Visualize tool parameter space and output from different parameter settings?",body:ad,buttons:{No:ag,Yes:ac}})}},p.prototype.action_icons_def[2]],can_draw:function(){return this.dataset&&p.prototype.can_draw.call(this)},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id)},build_header_div:function(){var ab=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(ab)}this.name_div=$("<div/>").addClass("track-name").appendTo(ab).text(this.config.get_value("name")).attr("id",this.config.get_value("name").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return ab},set_dataset:function(ab){this.dataset=ab;this.data_manager.set("dataset",ab)},on_resize:function(){this.request_draw({clear_tile_cache:true})},add_resize_handle:function(){var ab=this;var ae=false;var ad=false;var ac=$("<div class='track-resize'>");$(ab.container_div).hover(function(){if(ab.config.get_value("content_visible")){ae=true;ac.show()}},function(){ae=false;if(!ad){ac.hide()}});ac.hide().bind("dragstart",function(af,ag){ad=true;ag.original_height=$(ab.content_div).height()}).bind("drag",function(ag,ah){var af=Math.min(Math.max(ah.original_height+ah.deltaY,ab.min_height_px),ab.max_height_px);$(ab.tiles_div).css("height",af);ab.visible_height_px=(ab.max_height_px===af?0:af);ab.on_resize()}).bind("dragend",function(af,ag){ab.tile_cache.clear();ad=false;if(!ae){ac.hide()}ab.config.set_value("height",ab.visible_height_px);ab.changed()}).appendTo(ab.container_div)},set_display_modes:function(ae,ah){this.display_modes=ae;this.mode=(ah?ah:(this.config&&this.config.get_value("mode")?this.config.get_value("mode"):this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var ac=this,af={};for(var ad=0,ab=ac.display_modes.length;ad<ab;ad++){var ag=ac.display_modes[ad];af[ag]=function(ai){return function(){ac.change_mode(ai);ac.icons_div.show();ac.container_div.mouseleave(function(){ac.icons_div.hide()})}}(ag)}make_popupmenu(this.action_icons.mode_icon,af)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof V){return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrack"}else{if(this instanceof g){return"LineTrack"}else{if(this instanceof S){return"ReadTrack"}else{if(this instanceof Y){return"VariantTrack"}else{if(this instanceof e){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},show_message:function(ab){this.tiles_div.remove();return $("<span/>").addClass("message").html(ab).appendTo(this.content_div)},init:function(ad){var ac=this;ac.enabled=false;ac.tile_cache.clear();ac.data_manager.clear();ac.content_div.children().remove();ac.container_div.removeClass("nodata error pending");ac.tiles_div=$("<div/>").addClass("tiles").appendTo(ac.content_div);if(!ac.dataset.id){return}var ab=$.Deferred(),ae={hda_ldda:ac.dataset.get("hda_ldda"),data_type:this.dataset_check_type,chrom:ac.view.chrom,retry:ad};$.getJSON(this.dataset.url(),ae,function(af){if(!af||af==="error"||af.kind==="error"){ac.container_div.addClass("error");var ag=ac.show_message(m);if(af.message){ag.append($("<a href='javascript:void(0);'></a>").text("View error").click(function(){Galaxy.modal.show({title:"Trackster Error",body:"<pre>"+af.message+"</pre>",buttons:{Close:function(){Galaxy.modal.hide()}}})}));ag.append($("<span/>").text(" "));ag.append($("<a href='javascript:void(0);'></a>").text("Try again").click(function(){ac.init(true)}))}}else{if(af==="no converter"){ac.container_div.addClass("error");ac.show_message(H)}else{if(af==="no data"||(af.data!==undefined&&(af.data===null||af.data.length===0))){ac.container_div.addClass("nodata");ac.show_message(E)}else{if(af==="pending"){ac.container_div.addClass("pending");ac.show_message(u);setTimeout(function(){ac.init()},ac.data_query_wait)}else{if(af==="data"||af.status==="data"){if(af.valid_chroms){ac.valid_chroms=af.valid_chroms;ac.update_icons()}ac.tiles_div.text(T);if(ac.view.chrom){ac.tiles_div.text("");ac.tiles_div.css("height",ac.visible_height_px+"px");ac.enabled=true;$.when.apply($,ac.predraw_init()).done(function(){ab.resolve();ac.container_div.removeClass("nodata error pending");ac.request_draw()})}else{ab.resolve()}}}}}}});this.update_icons();return ab},predraw_init:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(ae&&ae.min&&ae.max){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_default_value("min_value",ad);ab.config.set_default_value("max_value",af);ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},get_drawables:function(){return this}});var L=function(ad,ac,af){f.call(this,ad,ac,af);var ab=this;k(ab.container_div,ab.drag_handle_class,".group",ab);this.filters_manager=new h.FiltersManager(this,("filters" in af?af.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=(af.tool?new q(aa.extend(af.tool,{track:this,tool_state:af.tool_state})):null);this.tile_cache=new w.Cache(O);this.left_offset=0;if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){var ae=new Z({model:this.tool});ae.render();this.dynamic_tool_div=ae.$el;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);if(!this.config.get_value("content_visible")){this.tiles_div.hide()}this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)}};o(L.prototype,p.prototype,f.prototype,{action_icons_def:f.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(ab){$(".tooltip").remove();ab.slotters[ab.view.resolution_px_b].max_rows*=2;ab.request_draw({clear_tile_cache:true})},hide:true}]),copy:function(ab){var ac=this.to_dict();o(ac,{data_manager:this.data_manager});var ad=new this.constructor(this.view,ab,ac);ad.change_mode(this.mode);ad.enabled=this.enabled;return ad},set_filters_manager:function(ab){this.filters_manager=ab;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool?this.tool.state_dict():{})}},set_min_max:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(isNaN(parseFloat(ab.config.get_value("min_value")))||isNaN(parseFloat(ab.config.get_value("max_value")))){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},change_mode:function(ac){var ab=this;ab.mode=ac;ab.config.set_value("mode",ac);if(ac==="Auto"){this.data_manager.clear()}ab.request_draw({clear_tile_cache:true});this.action_icons.mode_icon.attr("title","Set display mode (now: "+ab.mode+")");return ab},update_icons:function(){var ab=this;if(ab.filters_available){ab.action_icons.filters_icon.show()}else{ab.action_icons.filters_icon.hide()}if(ab.tool){ab.action_icons.tools_icon.show();ab.action_icons.param_space_viz_icon.show()}else{ab.action_icons.tools_icon.hide();ab.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(ac,ab){return ac+"_"+ab},request_draw:function(ab){if(ab&&ab.clear_tile_cache){this.tile_cache.clear()}this.view.request_redraw(ab,this)},before_draw:function(){this.max_height_px=0},_draw:function(ap){if(!this.can_draw()){return}var am=ap&&ap.clear_after,ak=this.view.low,af=this.view.high,ai=af-ak,ac=this.view.container.width(),ao=this.view.resolution_px_b,ae=1/ao;if(this.is_overview){ak=this.view.max_low;af=this.view.max_high;ao=ac/(view.max_high-view.max_low);ae=1/ao}this.before_draw();this.tiles_div.children().addClass("remove");var ab=Math.floor(ak/(ae*Q)),aj,al,ag,ah=[],an=[];while((ab*Q*ae)<af){aj=Math.floor(ab*Q*ae);al=new w.GenomeRegion({chrom:this.view.chrom,start:aj,end:Math.min(aj+Math.ceil(Q*ae),this.view.max_high)});ag=this.draw_helper(al,ao,ap);ah.push(ag);$.when(ag).then(function(aq){an.push(aq)});ab+=1}if(!am){this.tiles_div.children(".remove").removeClass("remove").remove()}var ad=this;$.when.apply($,ah).then(function(){ad.tiles_div.children(".remove").remove();an=aa.filter(an,function(aq){return aq!==null});if(an.length!==0){ad.postdraw_actions(an,ac,ao,am)}})},_add_yaxis_label:function(ae,ag){var ac=this,af=(ae==="max"?"top":"bottom"),ah=(ae==="max"?"max":"min"),ab=(ae==="max"?"max_value":"min_value"),ad=this.container_div.find(".yaxislabel."+af);ag=ag||function(){ac.request_draw({clear_tile_cache:true})};if(ad.length!==0){ad.text(ac.config.get_value(ab))}else{ad=$("<div/>").text(ac.config.get_value(ab)).make_text_editable({num_cols:12,on_finish:function(ai){$(".tooltip").remove();ac.config.set_value(ab,ai);ag()},help_text:"Set "+ah+" value"}).addClass("yaxislabel "+af).css("color",this.config.get_value("label_color"));this.container_div.prepend(ad)}},postdraw_actions:function(ae,af,ah,ab){var ad=aa.filter(ae,function(ai){return(ai instanceof K)});if(ad.length>0){this.max_height_px=0;var ac=this;aa.each(ae,function(ai){if(!(ai instanceof K)){ai.html_elt.remove();ac.draw_helper(ai.region,ah,{force:true,mode:"Coverage"})}});ac._add_yaxis_label("max")}else{this.container_div.find(".yaxislabel").remove();var ag=aa.find(ae,function(ai){return ai.has_icons});if(ag){aa.each(ae,function(ai){if(!ai.has_icons){ai.html_elt.css("padding-top",D)}})}}},get_mode:function(ab){return this.mode},update_auto_mode:function(ab){},_get_drawables:function(){return[this]},draw_helper:function(ak,am,an){if(!an){an={}}var ac=an.force,ah=an.mode||this.mode,ae=1/am,ad=this,af=this._get_drawables(),al=this._gen_tile_cache_key(am,ak),ag=function(ao){return(ao&&"track" in ao)};var ai=(ac?undefined:ad.tile_cache.get_elt(al));if(ai){if(ag(ai)){ad.show_tile(ai,am)}return ai}if(an.data_fetch===false){return null}var aj=function(){var ao=(aa.find(A,function(aq){return aq===ah})?"Coverage":ah);var ap=aa.map(af,function(aq){return aq.data_manager.get_data(ak,ao,ae,ad.data_url_extra_params)});if(view.reference_track){ap.push(view.reference_track.data_manager.get_data(ak,ah,ae,view.reference_track.data_url_extra_params))}return ap};var ab=$.Deferred();ad.tile_cache.set_elt(al,ab);$.when.apply($,aj()).then(function(){var ao=aj(),au=ao,aA;if(aa.find(ao,function(aC){return j.is_deferred(aC)})){ad.tile_cache.set_elt(al,undefined);$.when(ad.draw_helper(ak,am,an)).then(function(aC){ab.resolve(aC)});return}if(view.reference_track){aA=view.reference_track.data_manager.subset_entry(ao.pop(),ak)}var av=[],ar=[];aa.each(af,function(aF,aC){var aE=aF.mode,aD=au[aC];if(aE==="Auto"){aE=aF.get_mode(aD);aF.update_auto_mode(aE)}av.push(aE);ar.push(aF.get_canvas_height(aD,aE,am,ap))});var at=ad.view.canvas_manager.new_canvas(),aw=ak.get("start"),aB=ak.get("end"),aq=0,ap=Math.ceil((aB-aw)*am)+ad.left_offset,ay=aa.max(ar),ax;at.width=ap;at.height=(an.height||ay);var az=at.getContext("2d");az.translate(ad.left_offset,0);if(af.length>1){az.globalAlpha=0.5;az.globalCompositeOperation="source-over"}aa.each(af,function(aD,aC){ax=aD.draw_tile(au[aC],az,av[aC],ak,am,aA)});if(ax!==undefined){ad.tile_cache.set_elt(al,ax);ad.show_tile(ax,am)}ab.resolve(ax)});return ab},get_canvas_height:function(ab,ad,ae,ac){return this.visible_height_px},_draw_line_track_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.LinePainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new K(this,af,ah,ae,ab.data)},draw_tile:function(ab,ac,af,ae,ag,ad){},show_tile:function(ad,ag){var ac=this,ab=ad.html_elt;ad.predisplay_actions();var af=(ad.low-(this.is_overview?this.view.max_low:this.view.low))*ag;if(this.left_offset){af-=this.left_offset}ab.css("left",af);if(ab.hasClass("remove")){ab.removeClass("remove")}else{this.tiles_div.append(ab)}ab.css("height","auto");this.max_height_px=Math.max(this.max_height_px,ab.height()-2);ab.parent().children().css("height",this.max_height_px+"px");var ae=this.max_height_px;if(this.visible_height_px!==0){ae=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",ae+"px")},tool_region_and_parameters_str:function(ae){var ab=this,ad=(ae!==undefined?ae.toString():"all"),ac=aa.values(ab.tool.get_inputs_dict()).join(", ");return" - region=["+ad+"], parameters=["+ac+"]"},data_and_mode_compatible:function(ab,ac){if(ac==="Auto"){return true}else{if(ac==="Coverage"){return ab.dataset_type==="bigwig"}else{if(ab.dataset_type==="bigwig"||ab.extra_info==="no_detail"){return false}else{return true}}}},can_subset:function(ab){if(ab.message||ab.extra_info==="no_detail"){return false}else{if(ab.dataset_type==="bigwig"){return(ab.data[1][0]-ab.data[0][0]===1)}}return true},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data");this.data_query_wait=1000;this.dataset_check_type="state"}});var V=function(ac,ab){var ad={resize:false};f.call(this,ac,ab,ad);this.container_div.addClass("label-track")};o(V.prototype,f.prototype,{build_header_div:function(){},init:function(){this.enabled=true},predraw_init:function(){},_draw:function(af){var ad=this.view,ae=ad.high-ad.low,ai=Math.floor(Math.pow(10,Math.floor(Math.log(ae)/Math.log(10)))),ab=Math.floor(ad.low/ai)*ai,ag=this.view.container.width(),ac=$("<div/>").addClass("label-container");while(ab<ad.high){var ah=(ab-ad.low)/ae*ag;ac.append($("<div/>").addClass("label").text(commatize(ab)).css({left:ah}));ab+=ai}this.content_div.children(":first").remove();this.content_div.append(ac)}});var e=function(ac,ab,af){L.call(this,ac,ab,af);this.drawables=[];if("drawables" in af){var ae;for(var ad=0;ad<af.drawables.length;ad++){ae=af.drawables[ad];this.drawables[ad]=n(ae,ac,null);if(ae.left_offset>this.left_offset){this.left_offset=ae.left_offset}}this.enabled=true}aa.each(this.drawables,function(ag){if(ag instanceof c||ag instanceof S){ag.change_mode("Coverage")}});this.update_icons();this.obj_type="CompositeTrack"};o(e.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_group()}}].concat(L.prototype.action_icons_def),to_dict:y.prototype.to_dict,add_drawable:y.prototype.add_drawable,unpack_drawables:y.prototype.unpack_drawables,config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},on_resize:function(){var ab=this.visible_height_px;aa.each(this.drawables,function(ac){ac.visible_height_px=ab});f.prototype.on_resize.call(this)},change_mode:function(ab){L.prototype.change_mode.call(this,ab);for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac].change_mode(ab)}},init:function(){var ad=[];for(var ac=0;ac<this.drawables.length;ac++){ad.push(this.drawables[ac].init())}var ab=this;$.when.apply($,ad).then(function(){ab.enabled=true;ab.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,_get_drawables:function(){return this.drawables},show_group:function(){var ae=new N(this.view,this.container,{name:this.config.get_value("name")}),ab;for(var ad=0;ad<this.drawables.length;ad++){ab=this.drawables[ad];ab.update_icons();ae.add_drawable(ab);ab.container=ae;ae.content_div.append(ab.container_div)}var ac=this.container.replace_drawable(this,ae,true);ae.request_draw({clear_tile_cache:true})},before_draw:function(){var ac=aa.min(aa.map(this.drawables,function(ad){return ad.config.get_value("min_value")})),ab=aa.max(aa.map(this.drawables,function(ad){return ad.config.get_value("max_value")}));this.config.set_value("min_value",ac);this.config.set_value("max_value",ab);aa.each(this.drawables,function(ad){ad.config.set_value("min_value",ac);ad.config.set_value("max_value",ab)})},update_all_min_max:function(){var ac=this,ab=this.config.get_value("min_value"),ad=this.config.get_value("max_value");aa.each(this.drawables,function(ae){ae.config.set_value("min_value",ab);ae.config.set_value("max_value",ad)});this.request_draw({clear_tile_cache:true})},postdraw_actions:function(ah,ab,ak,ag){var af=-1,ad;for(ad=0;ad<ah.length;ad++){var ai=ah[ad].html_elt.find("canvas").height();if(ai>af){af=ai}}for(ad=0;ad<ah.length;ad++){var ae=ah[ad];if(ae.html_elt.find("canvas").height()!==af){this.draw_helper(ae.region,ak,{force:true,height:af});ae.html_elt.remove()}}var ac=this,aj=function(){ac.update_all_min_max()};this._add_yaxis_label("min",aj);this._add_yaxis_label("max",aj)}});var B=function(ab){L.call(this,ab,{content_div:ab.top_labeltrack},{resize:false});this.left_offset=ab.canvas_manager.char_width_px;this.container_div.addClass("reference-track");this.data_url=galaxy_config.root+"api/genomes/"+this.view.dbkey;this.data_url_extra_params={reference:true};this.data_manager=new w.GenomeReferenceDataManager({data_url:this.data_url,can_subset:this.can_subset});this.hide_contents()};o(B.prototype,p.prototype,L.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"height",type:"int",default_value:13,hidden:true}]),build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},predraw_init:function(){},can_draw:p.prototype.can_draw,draw_helper:function(ac,ad,ab){if(ad>this.view.canvas_manager.char_width_px){this.tiles_div.show();return L.prototype.draw_helper.call(this,ac,ad,ab)}else{this.tiles_div.hide();return null}},can_subset:function(ab){return true},draw_tile:function(ad,aj,ae,ag,ak){var ac=this.data_manager.subset_entry(ad,ag),ai=ac.data;var ab=aj.canvas;aj.font=aj.canvas.manager.default_font;aj.textAlign="center";for(var af=0,ah=ai.length;af<ah;af++){aj.fillStyle=this.view.get_base_color(ai[af]);aj.fillText(ai[af],Math.floor(af*ak),10)}return new b(this,ag,ak,ab,ac)}});var g=function(ac,ab,ad){this.mode="Histogram";L.call(this,ac,ab,ad)};o(g.prototype,p.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Color",type:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},before_draw:function(){},draw_tile:function(ab,ac,ae,ad,af){return this._draw_line_track_tile(ab,ac,ae,ad,af)},can_subset:function(ab){return(ab.data[1][0]-ab.data[0][0]===1)},postdraw_actions:function(ac,ad,ae,ab){this._add_yaxis_label("max");this._add_yaxis_label("min")}});var r=function(ac,ab,ad){this.mode="Heatmap";L.call(this,ac,ab,ad)};o(r.prototype,p.prototype,L.prototype,{display_modes:["Heatmap"],config_params:aa.union(p.prototype.config_params,[{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",default_value:-1},{key:"max_value",label:"Max Value",type:"float",default_value:1},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:500,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.DiagonalHeatmapPainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new b(this,af,ah,ae,ab.data)}});var c=function(ac,ab,ad){L.call(this,ac,ab,ad);this.container_div.addClass("feature-track");this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block color",type:"color"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.set_painter_from_config();this.request_draw({clear_tile_cache:true})},set_painter_from_config:function(){if(this.config.get_value("connector_style")==="arcs"){this.painter=J.ArcLinkedFeaturePainter}else{this.painter=J.LinkedFeaturePainter}},postdraw_actions:function(am,ae,ao,al){L.prototype.postdraw_actions.call(this,am,ae,ao,al);var ag=this,ah;var ab={};aa.each(aa.pluck(am,"incomplete_features"),function(ap){aa.each(ap,function(aq){ab[aq[0]]=aq})});var an=this;aa.each(am,function(ap){an.draw_tile({data:aa.values(ab)},ap.canvas.getContext("2d"),ap.mode,ap.region,ao,ap.seq_data,true)});if(ag.filters_manager){var af=ag.filters_manager.filters,aj;for(aj=0;aj<af.length;aj++){af[aj].update_ui_elt()}var ai=false,ak,ad;for(ah=0;ah<am.length;ah++){if(am[ah].data.length){ak=am[ah].data[0];for(aj=0;aj<af.length;aj++){ad=af[aj];if(ad.applies_to(ak)&&ad.min!==ad.max){ai=true;break}}}}if(ag.filters_available!==ai){ag.filters_available=ai;if(!ag.filters_available){ag.filters_manager.hide()}ag.update_icons()}}if(am[0] instanceof M){var ac=true;for(ah=0;ah<am.length;ah++){if(!am[ah].all_slotted){ac=false;break}}if(!ac){this.action_icons.show_more_rows_icon.show()}else{this.action_icons.show_more_rows_icon.hide()}}else{this.action_icons.show_more_rows_icon.hide()}},update_auto_mode:function(ab){if(this.mode==="Auto"){if(ab==="no_detail"){ab="feature spans"}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+ab+")")}},incremental_slots:function(af,ab,ae){var ac=this.view.canvas_manager.dummy_context,ad=this.slotters[af];if(!ad||(ad.mode!==ae)){ad=new (s.FeatureSlotter)(af,ae,z,function(ag){return ac.measureText(ag)});this.slotters[af]=ad}return ad.slot_features(ab)},get_mode:function(ab){if(ab.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>G){mode="Squish"}else{mode="Pack"}}return mode},get_canvas_height:function(ab,af,ag,ac){if(af==="Coverage"||ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ae=this.incremental_slots(ag,ab.data,af);var ad=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return Math.max(this.min_height_px,ad.get_required_height(ae,ac))}},draw_tile:function(am,ar,ap,af,aj,ae,an){var aq=this,ad=ar.canvas,ay=af.get("start"),ac=af.get("end"),ag=this.left_offset;if(am.dataset_type==="bigwig"){return this._draw_line_track_tile(am,ar,ap,af,aj)}var ai=[],ao=this.slotters[aj].slots;all_slotted=true;if(am.data){var ak=this.filters_manager.filters;for(var at=0,av=am.data.length;at<av;at++){var ah=am.data[at];var au=false;var al;for(var ax=0,aC=ak.length;ax<aC;ax++){al=ak[ax];al.update_attrs(ah);if(!al.keep(ah)){au=true;break}}if(!au){ai.push(ah);if(!(ah[0] in ao)){all_slotted=false}}}}var aB=(this.filters_manager.alpha_filter?new C(this.filters_manager.alpha_filter):null),az=(this.filters_manager.height_filter?new C(this.filters_manager.height_filter):null),aA=new (this.painter)(ai,ay,ac,this.config.to_key_value_dict(),ap,aB,az,ae,function(aD){return aq.view.get_base_color(aD)});var aw=null;ar.fillStyle=this.config.get_value("block_color");ar.font=ar.canvas.manager.default_font;ar.textAlign="right";if(am.data){var ab=aA.draw(ar,ad.width,ad.height,aj,ao);aw=ab.feature_mapper;incomplete_features=ab.incomplete_features;aw.translation=-ag}if(!an){return new M(aq,af,aj,ad,am.data,ap,am.message,all_slotted,aw,incomplete_features,ae)}}});var Y=function(ac,ab,ad){L.call(this,ac,ab,ad);this.painter=J.VariantPainter;this.summary_draw_height=30;this.left_offset=30};o(Y.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Histogram color",type:"color"},{key:"show_sample_data",label:"Show sample data",type:"bool",default_value:true},{key:"show_labels",label:"Show summary and sample labels",type:"bool",default_value:true},{key:"summary_height",label:"Locus summary height",type:"float",default_value:20},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ae,ag,af,ah){if(ab.dataset_type==="bigwig"){return this._draw_line_track_tile(ab,ae,"Histogram",af,ah)}else{var ad=this.view,ac=new (this.painter)(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag,function(ai){return ad.get_base_color(ai)});ac.draw(ae,ae.canvas.width,ae.canvas.height,ah);return new b(this,af,ah,ae.canvas,ab.data)}},get_canvas_height:function(ab,af,ag,ad){if(ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ac=(this.dataset.get_metadata("sample_names")?this.dataset.get_metadata("sample_names").length:0);if(ac===0&&ab.data.length!==0){ac=ab.data[0][7].match(/,/g);if(ac===null){ac=1}else{ac=ac.length+1}}var ae=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return ae.get_required_height(ac)}},predraw_init:function(){var ab=[f.prototype.predraw_init.call(this)];if(!this.dataset.get_metadata("sample_names")){ab.push(this.dataset.fetch())}return ab},postdraw_actions:function(af,ag,ai,ac){L.prototype.postdraw_actions.call(this,af,ag,ai,ac);var ae=aa.filter(af,function(aj){return(aj instanceof K)});var ad=this.dataset.get_metadata("sample_names");if(ae.length===0&&this.config.get_value("show_labels")&&ad&&ad.length>1){var ab;if(this.container_div.find(".yaxislabel.variant").length===0){ab=this.config.get_value("summary_height")/2;this.tiles_div.prepend($("<div/>").text("Summary").addClass("yaxislabel variant top").css({"font-size":ab+"px",top:(this.config.get_value("summary_height")-ab)/2+"px"}));if(this.config.get_value("show_sample_data")){var ah=ad.join("<br/>");this.tiles_div.prepend($("<div/>").html(ah).addClass("yaxislabel variant top sample").css({top:this.config.get_value("summary_height")}))}}ab=(this.mode==="Squish"?5:10)+"px";$(this.tiles_div).find(".sample").css({"font-size":ab,"line-height":ab});$(this.tiles_div).find(".yaxislabel").css("color",this.config.get_value("label_color"))}else{this.container_div.find(".yaxislabel.variant").remove()}}});var S=function(ac,ab,ad){c.call(this,ac,ab,ad);this.painter=J.ReadPainter;this.update_icons()};o(S.prototype,p.prototype,L.prototype,c.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block and sense strand color",type:"color",default_value:"#DDDDDD"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:"#AAAAAA"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})}});var d={CompositeTrack:e,DrawableGroup:N,DiagonalHeatmapTrack:r,FeatureTrack:c,LineTrack:g,ReadTrack:S,VariantTrack:Y,VcfTrack:Y};var n=function(ad,ac,ab){if("copy" in ad){return ad.copy(ab)}else{var ae=ad.obj_type;if(!ae){ae=ad.track_type}return new d[ae](ac,ab,ad)}};return{TracksterView:X,DrawableGroup:N,LineTrack:g,FeatureTrack:c,DiagonalHeatmapTrack:r,ReadTrack:S,VariantTrack:Y,CompositeTrack:e,object_from_template:n}});
\ No newline at end of file
diff -r 089d1264d719891de3306684ee26fa0543577d55 -r 32cf6611bf3cf1249620ba265ed94ea430d9f4b1 static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -692,14 +692,16 @@
this.action_icons.filters_icon.hide();
}
else { // There are 2 or more tracks.
+
//
// Determine if a composite track can be created. Current criteria:
- // (a) all tracks are the same;
+ // (a) all tracks are line tracks;
// OR
+ // FIXME: this is not enabled right now because it has not been well tested:
// (b) there is a single FeatureTrack.
//
- /// All tracks the same?
+ // All tracks the same?
var i, j, drawable,
same_type = true,
a_type = this.drawables[0].get_type(),
@@ -715,14 +717,14 @@
}
}
- if (same_type || num_feature_tracks === 1) {
+ if (same_type && this.drawables[0] instanceof LineTrack) {
this.action_icons.composite_icon.show();
}
else {
this.action_icons.composite_icon.hide();
$(".tooltip").remove();
}
-
+
//
// Set up group-level filtering and update filter icon.
//
@@ -2365,7 +2367,7 @@
track.tile_cache.clear();
in_drag = false;
if (!in_handle) { drag_control.hide(); }
- track.config.set('height', track.visible_height_px);
+ track.config.set_value('height', track.visible_height_px);
track.changed();
}).appendTo(track.container_div);
},
@@ -3433,6 +3435,18 @@
},
/**
+ * Action to take during resize.
+ */
+ on_resize: function() {
+ // Propogate visible height to other tracks.
+ var visible_height = this.visible_height_px;
+ _.each(this.drawables, function(d) {
+ d.visible_height_px = visible_height;
+ });
+ Track.prototype.on_resize.call(this);
+ },
+
+ /**
* Change mode for all tracks.
*/
change_mode: function(new_mode) {
@@ -3499,7 +3513,8 @@
* Actions taken before drawing.
*/
before_draw: function() {
- TiledTrack.prototype.before_draw.call(this);
+ // FIXME: this is needed only if there are feature tracks in the composite track.
+ // TiledTrack.prototype.before_draw.call(this);
//
// Set min, max for tracks to be largest min, max.
@@ -3507,7 +3522,7 @@
// Get smallest min, biggest max.
var min = _.min(_.map(this.drawables, function(d) { return d.config.get_value('min_value'); })),
- max = _.max(_.map(this.drawables, function(d) { return d.config.get_value('max_value') }));
+ max = _.max(_.map(this.drawables, function(d) { return d.config.get_value('max_value'); }));
this.config.set_value('min_value', min);
this.config.set_value('max_value', max);
https://bitbucket.org/galaxy/galaxy-central/commits/9fcd372f9fdb/
Changeset: 9fcd372f9fdb
User: Jeremy Goecks
Date: 2014-04-03 20:34:17
Summary: Automated merge of next-stable to default
Affected #: 2 files
diff -r ea1fbe9d5bdb9435830c3f2d2dbc623a22d4b1a4 -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 static/scripts/packed/viz/trackster/tracks.js
--- a/static/scripts/packed/viz/trackster/tracks.js
+++ b/static/scripts/packed/viz/trackster/tracks.js
@@ -1,1 +1,1 @@
-define(["libs/underscore","viz/visualization","viz/trackster/util","viz/trackster/slotting","viz/trackster/painters","viz/trackster/filters","mvc/data","mvc/tools","utils/config"],function(aa,w,j,s,J,h,W,P,R){var o=aa.extend;var l={};var i=function(ab,ac){l[ab.attr("id")]=ac};var k=function(ab,ac,ae,ad){ae=".group";l[ab.attr("id")]=ad;ab.bind("drag",{handle:"."+ac,relative:true},function(am,an){var al=$(this),aq=$(this).parent(),ai=aq.children(".track,.group"),ak=l[$(this).attr("id")],ah,ag,ao,af,aj;ag=$(this).parents(ae);if(ag.length!==0){ao=ag.position().top;af=ao+ag.outerHeight();var ap=l[ag.attr("id")];if(an.offsetY<ao){$(this).insertBefore(ag);ap.remove_drawable(ak);ap.container.add_drawable_before(ak,ap);return}else{if(an.offsetY>af){$(this).insertAfter(ag);ap.remove_drawable(ak);ap.container.add_drawable(ak);return}}}ag=null;for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));ao=ah.position().top;af=ao+ah.outerHeight();if(ah.is(ae)&&this!==ah.get(0)&&an.offsetY>=ao&&an.offsetY<=af){if(an.offsetY-ao<af-an.offsetY){ah.find(".content-div").prepend(this)}else{ah.find(".content-div").append(this)}if(ak.container){ak.container.remove_drawable(ak)}l[ah.attr("id")].add_drawable(ak);return}}for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));if(an.offsetY<ah.position().top&&!(ah.hasClass("reference-track")||ah.hasClass("intro"))){break}}if(aj===ai.length){if(this!==ai.get(aj-1)){aq.append(this);l[aq.attr("id")].move_drawable(ak,aj)}}else{if(this!==ai.get(aj)){$(this).insertBefore(ai.get(aj));l[aq.attr("id")].move_drawable(ak,(an.deltaY>0?aj-1:aj))}}}).bind("dragstart",function(){$(this).addClass("dragging")}).bind("dragend",function(){$(this).removeClass("dragging")})};var D=20,z=100,G=12000,Q=400,I=5000,v=100,m="Cannot display dataset due to an error. ",H="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",E="No data for this chrom/contig.",u="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",x="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",O=10,F=20,A=["Histogram","Line","Filled","Intensity"];function U(ac,ab){if(!ab){ab=0}var ad=Math.pow(10,ab);return Math.round(ac*ad)/ad}var p=function(ac,ab,ae){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.view=ac;this.container=ab;this.drag_handle_class=ae.drag_handle_class;this.is_overview=false;this.action_icons={};this.config=R.ConfigSettingCollection.from_models_and_saved_values(this.config_params,ae.prefs);if(!this.config.get_value("name")){this.config.set_value("name",ae.name)}if(this.config_onchange){this.config.on("change",this.config_onchange,this)}this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").addClass("track-icons").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(af){af.stopPropagation()});var ad=this;this.container_div.hover(function(){ad.icons_div.show()},function(){ad.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(ab){if(ab.config.get_value("content_visible")){ab.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");ab.hide_contents();ab.config.set_value("content_visible",false)}else{ab.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");ab.config.set_value("content_visible",true);ab.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"gear",on_click_fn:function(ac){var ab=new R.ConfigSettingCollectionView({collection:ac.config});ab.render_in_modal("Configure Track")}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(ab){$(".tooltip").remove();ab.remove()}}];o(p.prototype,{config_params:[{key:"name",label:"Name",type:"text",default_value:""},{key:"content_visible",type:"bool",default_value:true,hidden:true}],config_onchange:function(){},init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.config.get_value("content_visible")){return true}return false},request_draw:function(){},_draw:function(ab){},to_dict:function(){},set_name:function(ab){this.old_name=this.config.get_value("name");this.config.set_value("name",ab);this.name_div.text(ab)},revert_name:function(){if(this.old_name){this.config.set_value("name",this.old_name);this.name_div.text(this.old_name)}},remove:function(){this.changed();this.container.remove_drawable(this);var ab=this.view;this.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(ac,ah,ag,af,ab,ae){var ad=this;this.action_icons[ac]=$("<a/>").attr("title",ah).addClass("icon-button").addClass(ag).tooltip().click(function(){af(ad)}).appendTo(this.icons_div);if(ae){this.action_icons[ac].hide()}},build_action_icons:function(ab){var ad;for(var ac=0;ac<ab.length;ac++){ad=ab[ac];this.add_action_icon(ad.name,ad.title,ad.css_class,ad.on_click_fn,ad.prepend,ad.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){},get_drawables:function(){}});var y=function(ac,ab,ad){p.call(this,ac,ab,ad);this.obj_type=ad.obj_type;this.drawables=[]};o(y.prototype,p.prototype,{unpack_drawables:function(ad){this.drawables=[];var ac;for(var ab=0;ab<ad.length;ab++){ac=n(ad[ab],this.view,this);this.add_drawable(ac)}},init:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].init()}},_draw:function(ab){for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac]._draw(ab)}},to_dict:function(){var ac=[];for(var ab=0;ab<this.drawables.length;ab++){ac.push(this.drawables[ab].to_dict())}return{prefs:this.config.to_key_value_dict(),obj_type:this.obj_type,drawables:ac}},add_drawable:function(ab){this.drawables.push(ab);ab.container=this;this.changed()},add_drawable_before:function(ad,ab){this.changed();var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables.splice(ac,0,ad);return true}return false},replace_drawable:function(ad,ab,ac){var ae=this.drawables.indexOf(ad);if(ae!==-1){this.drawables[ae]=ab;if(ac){ad.container_div.replaceWith(ab.container_div)}this.changed()}return ae},remove_drawable:function(ac){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);ac.container=null;this.changed();return true}return false},move_drawable:function(ac,ad){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);this.drawables.splice(ad,0,ac);this.changed();return true}return false},get_drawables:function(){return this.drawables},get_tracks:function(ae){var ab=this.drawables.slice(0),ac=[],ad;while(ab.length!==0){ad=ab.shift();if(ad instanceof ae){ac.push(ad)}else{if(ad.drawables){ab=ab.concat(ad.drawables)}}}return ac}});var N=function(ac,ab,ae){o(ae,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});y.call(this,ac,ab,ae);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);i(this.container_div,this);i(this.content_div,this);k(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new h.FiltersManager(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ae){this.unpack_drawables(ae.drawables)}if("filters" in ae){var ad=this.filters_manager;this.filters_manager=new h.FiltersManager(this,ae.filters);ad.parent_div.replaceWith(this.filters_manager.parent_div);if(ae.filters.visible){this.setup_multitrack_filtering()}}};o(N.prototype,p.prototype,y.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters();ab._restore_filter_managers()}else{ab.setup_multitrack_filtering();ab.request_draw({clear_tile_cache:true})}ab.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var ab=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(ab)}return ab},build_header_div:function(){var ab=$("<div/>").addClass("track-header");ab.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.config.get_value("name")).appendTo(ab);return ab},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ad=this.drawables.length;if(ad===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ad===1){if(this.drawables[0] instanceof e){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ak,aj,ah,an=true,af=this.drawables[0].get_type(),ab=0;for(ak=0;ak<ad;ak++){ah=this.drawables[ak];if(ah.get_type()!==af){can_composite=false;break}if(ah instanceof c){ab++}}if(an||ab===1){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".tooltip").remove()}if(ab>1&&ab===this.drawables.length){var ao={},ac;ah=this.drawables[0];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];ao[ac.name]=[ac]}for(ak=1;ak<this.drawables.length;ak++){ah=this.drawables[ak];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];if(ac.name in ao){ao[ac.name].push(ac)}}}this.filters_manager.remove_all();var ae,ag,ai,al;for(var am in ao){ae=ao[am];if(ae.length===ab){ag=new h.NumberFilter({name:ae[0].name,index:ae[0].index});this.filters_manager.add_filter(ag)}}if(this.filters_manager.filters.length>0){this.action_icons.filters_icon.show()}else{this.action_icons.filters_icon.hide()}}else{this.action_icons.filters_icon.hide()}}}},_restore_filter_managers:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].filters_manager=this.saved_filters_managers[ab]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var ab=0;ab<this.drawables.length;ab++){drawable=this.drawables[ab];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ac=new e(this.view,this.view,{name:this.config.get_value("name"),drawables:this.drawables});var ab=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);this.update_icons()},remove_drawable:function(ab){y.prototype.remove_drawable.call(this,ab);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var ab=o(y.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return ab},request_draw:function(ab){aa.each(this.drawables,function(ac){ac.request_draw(ab)})}});var X=Backbone.View.extend({initialize:function(ab){o(ab,{obj_type:"View"});y.call(this,"View",ab.container,ab);this.chrom=null;this.vis_id=ab.vis_id;this.dbkey=ab.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.render();this.canvas_manager=new w.CanvasManager(this.container.get(0).ownerDocument);this.reset();this.config=R.ConfigSettingCollection.from_models_and_saved_values([{key:"name",label:"Name",type:"text",default_value:""},{key:"a_color",label:"A Color",type:"color",default_value:"#FF0000"},{key:"c_color",label:"C Color",type:"color",default_value:"#00FF00"},{key:"g_color",label:"G Color",type:"color",default_value:"#0000FF"},{key:"t_color",label:"T Color",type:"color",default_value:"#FF00FF"},{key:"n_color",label:"N Color",type:"color",default_value:"#AAAAAA"}],{name:ab.name})},render:function(){this.requested_redraw=false;var ad=this.container,ab=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ad);this.browser_content_div=$("<div/>").addClass("content").appendTo(ad);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ad);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;i(this.viewport_container,ab);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ae=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){w.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":ab.dbkey},function(af){aa.each(af,function(ag){ab.add_drawable(n(ag,ab,ab))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).addClass("chrom-nav").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ac=function(af){if(af.type==="focusout"||(af.keyCode||af.which)===13||(af.keyCode||af.which)===27){if((af.keyCode||af.which)!==27){ab.go_to($(this).val())}$(this).hide();$(this).val("");ab.location_span.show();ab.chrom_select.show()}af.stopPropagation()};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ac).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){ab.location_span.hide();ab.chrom_select.hide();ab.nav_input.val(ab.chrom+":"+ab.low+"-"+ab.high);ab.nav_input.css("display","inline-block");ab.nav_input.select();ab.nav_input.focus();ab.nav_input.autocomplete({source:function(ah,af){var ai=[],ag=$.map(ab.get_tracks(c),function(aj){return aj.data_manager.search_features(ah.term).success(function(ak){ai=ai.concat(ak)})});$.when.apply($,ag).done(function(){af($.map(ai,function(aj){return{label:aj[0],value:aj[1]}}))})}})});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){ab.zoom_out()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){ab.zoom_in()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){ab.change_chrom(ab.chrom_select.val())});this.browser_content_div.click(function(af){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(af){ab.zoom_in(af.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(af,ag){this.current_x=ag.offsetX}).bind("drag",function(af,ah){var ai=ah.offsetX-this.current_x;this.current_x=ah.offsetX;var ag=Math.round(ai/ab.viewport_container.width()*(ab.max_high-ab.max_low));ab.move_delta(-ag)});this.overview_close.click(function(){ab.reset_overview()});this.viewport_container.bind("draginit",function(af,ag){if(af.clientX>ab.viewport_container.width()-16){return false}}).bind("dragstart",function(af,ag){ag.original_low=ab.low;ag.current_height=af.clientY;ag.current_x=ag.offsetX}).bind("drag",function(ah,aj){var af=$(this);var ak=aj.offsetX-aj.current_x;var ag=af.scrollTop()-(ah.clientY-aj.current_height);af.scrollTop(ag);aj.current_height=ah.clientY;aj.current_x=aj.offsetX;var ai=Math.round(ak/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}).bind("mousewheel",function(ah,aj,ag,af){if(ag){ag*=50;var ai=Math.round(-ag/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}});this.top_labeltrack.bind("dragstart",function(af,ag){return $("<div/>").addClass("zoom-area").css("height",ab.browser_content_div.height()+ab.top_labeltrack.height()+ab.nav_labeltrack.height()+1).appendTo($(this))}).bind("drag",function(aj,ak){$(ak.proxy).css({left:Math.min(aj.pageX,ak.startX)-ab.container.offset().left,width:Math.abs(aj.pageX-ak.startX)});var ag=Math.min(aj.pageX,ak.startX)-ab.container.offset().left,af=Math.max(aj.pageX,ak.startX)-ab.container.offset().left,ai=(ab.high-ab.low),ah=ab.viewport_container.width();ab.update_location(Math.round(ag/ah*ai)+ab.low,Math.round(af/ah*ai)+ab.low)}).bind("dragend",function(ak,al){var ag=Math.min(ak.pageX,al.startX),af=Math.max(ak.pageX,al.startX),ai=(ab.high-ab.low),ah=ab.viewport_container.width(),aj=ab.low;ab.low=Math.round(ag/ah*ai)+aj;ab.high=Math.round(af/ah*ai)+aj;$(al.proxy).remove();ab.request_redraw()});this.add_label_track(new V(this,{content_div:this.top_labeltrack}));this.add_label_track(new V(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){ab.resize_window()},500)});$(document).bind("redraw",function(){ab.redraw()});this.reset();$(window).trigger("resize")},get_base_color:function(ab){return this.config.get_value(ab.toLowerCase()+"_color")||this.config.get_value("n_color")}});o(X.prototype,y.prototype,{changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(ac,ae,ab,af){if(this.timer){clearTimeout(this.timer)}if(af){var ad=this;this.timer=setTimeout(function(){ad.trigger("navigate",ac+":"+ae+"-"+ab)},500)}else{view.trigger("navigate",ac+":"+ae+"-"+ab)}},update_location:function(ab,ad){this.location_span.text(commatize(ab)+" - "+commatize(ad));this.nav_input.val(this.chrom+":"+commatize(ab)+"-"+commatize(ad));var ac=view.chrom_select.val();if(ac!==""){this.trigger_navigate(ac,view.low,view.high,true)}},load_chroms:function(ad){ad.num=v;var ab=this,ac=$.Deferred();$.ajax({url:galaxy_config.root+"api/genomes/"+this.dbkey,data:ad,dataType:"json",success:function(af){if(af.chrom_info.length===0){return}if(af.reference){var ag=new B(ab);ab.add_label_track(ag);ab.reference_track=ag}ab.chrom_data=af.chrom_info;var aj='<option value="">Select Chrom/Contig</option>';for(var ai=0,ae=ab.chrom_data.length;ai<ae;ai++){var ah=ab.chrom_data[ai].chrom;aj+='<option value="'+ah+'">'+ah+"</option>"}if(af.prev_chroms){aj+='<option value="previous">Previous '+v+"</option>"}if(af.next_chroms){aj+='<option value="next">Next '+v+"</option>"}ab.chrom_select.html(aj);ab.chrom_start_index=af.start_index;ac.resolve(af.chrom_info)},error:function(){alert("Could not load chroms for this dbkey: "+ab.dbkey)}});return ac},change_chrom:function(ag,ac,ai){var ad=this;if(!ad.chrom_data){ad.load_chroms_deferred.then(function(){ad.change_chrom(ag,ac,ai)});return}if(!ag||ag==="None"){return}if(ag==="previous"){ad.load_chroms({low:this.chrom_start_index-v});return}if(ag==="next"){ad.load_chroms({low:this.chrom_start_index+v});return}var ah=$.grep(ad.chrom_data,function(aj,ak){return aj.chrom===ag})[0];if(ah===undefined){ad.load_chroms({chrom:ag},function(){ad.change_chrom(ag,ac,ai)});return}else{if(ag!==ad.chrom){ad.chrom=ag;ad.chrom_select.val(ad.chrom);ad.max_high=ah.len-1;ad.reset();for(var af=0,ab=ad.drawables.length;af<ab;af++){var ae=ad.drawables[af];if(ae.init){ae.init()}}if(ad.reference_track){ad.reference_track.init()}}if(ac===undefined&&ai===undefined){ad.low=0;ad.high=ad.max_high}else{ad.low=(ac!==undefined?Math.max(ac,0):0);if(ai===undefined){ad.low=Math.max(ad.low-15,0);ad.high=ad.low+30}else{ad.high=Math.min(ai,ad.max_high)}}ad.reset_overview();ad.request_redraw()}},go_to:function(af){af=af.replace(/,/g,"");af=af.replace(/:|\-/g," ");var ac=af.split(/\s+/),ae=ac[0],ad=(ac[1]?parseInt(ac[1],10):undefined),ab=(ac[2]?parseInt(ac[2],10):undefined);this.change_chrom(ae,ad,ab)},move_fraction:function(ad){var ab=this;var ac=ab.high-ab.low;this.move_delta(ad*ac)},move_delta:function(ae){var ab=this;var ad=ab.high-ab.low;if(ab.low-ae<ab.max_low){ab.low=ab.max_low;ab.high=ab.max_low+ad}else{if(ab.high-ae>ab.max_high){ab.high=ab.max_high;ab.low=ab.max_high-ad}else{ab.high-=ae;ab.low-=ae}}ab.request_redraw({data_fetch:false});if(this.redraw_on_move_fn){clearTimeout(this.redraw_on_move_fn)}this.redraw_on_move_fn=setTimeout(function(){ab.request_redraw()},200);var ac=ab.chrom_select.val();this.trigger_navigate(ac,ab.low,ab.high,true)},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);ab.init();this.changed();this.update_intro_div()},add_label_track:function(ab){ab.view=this;ab.init();this.label_tracks.push(ab)},remove_drawable:function(ad,ac){y.prototype.remove_drawable.call(this,ad);if(ac){var ab=this;ad.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ac,ad){var ab=this,ae=(ad?[ad]:ab.drawables);aa.each(ae,function(af){var ag=aa.find(ab.tracks_to_be_redrawn,function(ah){return ah[0]===af});if(ag){ag[1]=ac}else{ab.tracks_to_be_redrawn.push([af,ac])}});if(!this.requested_redraw){requestAnimationFrame(function(){ab._redraw()});this.requested_redraw=true}},_redraw:function(){this.requested_redraw=false;var ab=this.low,af=this.high;if(ab<this.max_low){ab=this.max_low}if(af>this.max_high){af=this.max_high}var ac=this.high-this.low;if(this.high!==0&&ac<this.min_separation){af=ab+this.min_separation}this.low=Math.floor(ab);this.high=Math.ceil(af);this.update_location(this.low,this.high);this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var ae=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ag=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ad=13;this.overview_box.css({left:ae,width:Math.max(ad,ag)}).show();if(ag<ad){this.overview_box.css("left",ae-(ad-ag)/2)}if(this.overview_highlight){this.overview_highlight.css({left:ae,width:ag})}aa.each(this.tracks_to_be_redrawn,function(aj){var ah=aj[0],ai=aj[1];if(ah){ah._draw(ai)}});this.tracks_to_be_redrawn=[];aa.each(this.label_tracks,function(ah){ah._draw()})},zoom_in:function(ac,ad){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ae=this.high-this.low,af=ae/2+this.low,ab=(ae/this.zoom_factor)/2;if(ac){af=ac/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(af-ab);this.high=Math.round(af+ab);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var ac=this.high-this.low,ad=ac/2+this.low,ab=(ac*this.zoom_factor)/2;this.low=Math.round(ad-ab);this.high=Math.round(ad+ab);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ad){if(this.overview_drawable){if(this.overview_drawable.dataset.id===ad.dataset.id){return}this.overview_viewport.find(".track").remove()}var ac=ad.copy({content_div:this.overview_viewport}),ab=this;ac.header_div.hide();ac.is_overview=true;ab.overview_drawable=ac;this.overview_drawable.postdraw_actions=function(){ab.overview_highlight.show().height(ab.overview_drawable.content_div.height());ab.overview_viewport.height(ab.overview_drawable.content_div.height()+ab.overview_box.outerHeight());ab.overview_close.show();ab.resize_window()};ab.overview_drawable.request_draw();this.changed()},reset_overview:function(){$(".tooltip").remove();this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();view.overview_drawable=null}});var q=P.Tool.extend({defaults:{track:null},initialize:function(ab){P.Tool.prototype.initialize.call(this,ab);var ac=true;if(ab.tool_state!==undefined&&ab.tool_state.hidden!==undefined){ac=ab.tool_state.hidden}this.set("hidden",ac);this.remove_inputs(["data","hidden_data","conditional"])},state_dict:function(ab){return aa.extend(this.get_inputs_dict(),{hidden:!this.is_visible()})}});var t=Backbone.View.extend({events:{"change input":"update_value"},render:function(){var ad=this.$el.addClass("param-row"),ae=this.model;var ab=$("<div>").addClass("param-label").text(ae.get("label")).appendTo(ad);var ac=$("<div/>").addClass("param-input").html(ae.get("html")).appendTo(ad);ac.find(":input").val(ae.get("value"));$("<div style='clear: both;'/>").appendTo(ad)},update_value:function(ab){this.model.set_value($(ab.target).val())}});var Z=Backbone.View.extend({initialize:function(ab){this.model.on("change:hidden",this.set_visible,this)},render:function(){var ac=this;tool=this.model,parent_div=this.$el.addClass("dynamic-tool").hide();parent_div.bind("drag",function(ag){ag.stopPropagation()}).click(function(ag){ag.stopPropagation()}).bind("dblclick",function(ag){ag.stopPropagation()}).keydown(function(ag){ag.stopPropagation()});var ad=$("<div class='tool-name'>").appendTo(parent_div).text(tool.get("name"));tool.get("inputs").each(function(ah){var ag=new t({model:ah});ag.render();parent_div.append(ag.$el)});parent_div.find("input").click(function(){$(this).select()});var ae=$("<div>").addClass("param-row").appendTo(parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ae);var ab=$("<input type='submit'>").attr("value","Run on visible region").appendTo(ae);ab.click(function(){ac.run_on_region()});af.click(function(){ac.run_on_dataset()});if(tool.is_visible()){this.$el.show()}},set_visible:function(){if(this.model.is_visible()){this.$el.show()}else{this.$el.hide()}},update_params:function(){for(var ab=0;ab<this.params.length;ab++){this.params[ab].update_value()}},run_on_dataset:function(){var ab=this.model;this.run({target_dataset_id:this.model.get("track").dataset.id,action:"rerun",tool_id:ab.id},null,function(ac){Galaxy.modal.show({title:ab.get("name")+" is Running",body:ab.get("name")+" is running on the complete dataset. Tool outputs are in dataset's history.",buttons:{Close:function(){Galaxy.modal.hide()}}})})},run_on_region:function(){var ac=this.model.get("track"),af=this.model,ah=new w.GenomeRegion({chrom:ac.view.chrom,start:ac.view.low,end:ac.view.high}),ai={target_dataset_id:ac.dataset.id,action:"rerun",tool_id:af.id,regions:[ah.toJSON()]},ag=ac,ak=af.get("name")+ag.tool_region_and_parameters_str(ah),ab;if(ag.container===view){var aj=new N(view,view,{name:ac.config.get_value("name")});var ae=ag.container.replace_drawable(ag,aj,false);aj.container_div.insertBefore(ag.view.content_div.children()[ae]);aj.add_drawable(ag);ag.container_div.appendTo(aj.content_div);ab=aj}else{ab=ag.container}var ad=new ag.constructor(view,ab,{name:ak,hda_ldda:"hda"});ad.init_for_tool_data();ad.change_mode(ag.mode);ad.set_filters_manager(ag.filters_manager.copy(ad));ad.update_icons();ab.add_drawable(ad);ad.tiles_div.text("Starting job.");this.run(ai,ad,function(al){ad.set_dataset(new W.Dataset(al));ad.tiles_div.text("Running job.");ad.init()})},run:function(ab,ad,ae){ab.inputs=this.model.get_inputs_dict();var ac=new j.ServerStateDeferred({ajax_settings:{url:galaxy_config.root+"api/tools",data:JSON.stringify(ab),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(af){return af!=="pending"}});$.when(ac.go()).then(function(af){if(af==="no converter"){ad.container_div.addClass("error");ad.content_div.text(H)}else{if(af.error){ad.container_div.addClass("error");ad.content_div.text(x+af.message)}else{ae(af)}}})}});var C=function(ab,ac){J.Scaler.call(this,ac);this.filter=ab};C.prototype.gen_val=function(ab){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(ab[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var b=function(ab,ae,af,ac,ad){this.track=ab;this.region=ae;this.low=ae.get("start");this.high=ae.get("end");this.w_scale=af;this.canvas=ac;this.html_elt=$("<div class='track-tile'/>").append(ac);this.data=ad;this.stale=false};b.prototype.predisplay_actions=function(){};var K=function(ab,ae,af,ac,ad){b.call(this,ab,ae,af,ac,ad)};K.prototype.predisplay_actions=function(){};var M=function(ad,ai,ak,ac,af,ag,al,ab,ah,ae,aj){b.call(this,ad,ai,ak,ac,af);this.mode=ag;this.all_slotted=ab;this.feature_mapper=ah;this.has_icons=false;this.incomplete_features=ae;this.seq_data=aj};o(M.prototype,b.prototype);M.prototype.predisplay_actions=function(){var ac=this,ab={};if(ac.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(an){if(!this.hovered){return}var ai=$(this).offset(),am=an.pageX-ai.left,al=an.pageY-ai.top,ar=ac.feature_mapper.get_feature_data(am,al),aj=(ar?ar[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!aj||$(this).attr("id")!==aj.toString()){$(this).remove()}});if(ar){var ae=ab[aj];if(!ae){var ao={name:ar[3],start:ar[1],end:ar[2],strand:ar[4]},ah=ac.track.filters_manager.filters,ag;for(var ak=0;ak<ah.length;ak++){ag=ah[ak];ao[ag.name]=ar[ag.index]}ae=$("<div/>").attr("id",aj).addClass("feature-popup");var at=$("<table/>"),aq,ap,au;for(aq in ao){ap=ao[aq];au=$("<tr/>").appendTo(at);$("<th/>").appendTo(au).text(aq);$("<td/>").attr("align","left").appendTo(au).text(typeof(ap)==="number"?U(ap,2):ap)}ae.append($("<div class='feature-popup-inner'>").append(at));ab[aj]=ae}ae.appendTo($(this).parents(".track-content").children(".overlay"));var af=am+parseInt(ac.html_elt.css("left"),10)-ae.width()/2,ad=al+parseInt(ac.html_elt.css("top"),10)+7;ae.css("left",af+"px").css("top",ad+"px")}else{if(!an.isPropagationStopped()){an.stopPropagation();$(this).siblings().each(function(){$(this).trigger(an)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var f=function(ac,ab,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ac,ab,ad);this.dataset=null;if(ad.dataset){this.dataset=(ad.dataset instanceof Backbone.Model?ad.dataset:new W.Dataset(ad.dataset))}this.dataset_check_type="converted_datasets_state";this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:I);this.data_manager=("data_manager" in ad?ad.data_manager:new w.GenomeDataManager({dataset:this.dataset,genome:new w.Genome({key:ac.dbkey,chroms_info:{chrom_info:ac.chrom_data}}),data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=this.config.get_value("height");this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(f.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"application-dock-270",on_click_fn:function(ab){ab.view.set_overview(ab)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"ui-slider-050",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters()}else{ab.filters_manager.init_filters()}ab.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(ab){ab.tool.toggle();if(ab.tool.is_visible()){ab.set_name(ab.config.get_value("name")+ab.tool_region_and_parameters_str())}else{ab.revert_name()}$(".tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(ab){var ae='<strong>Tool</strong>: <%= track.tool.get("name") %><br/><strong>Dataset</strong>: <%= track.config.get("name") %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ad=aa.template(ae,{track:ab});var ag=function(){Galaxy.modal.hide();$(window).unbind("keypress.check_enter_esc")},ac=function(){var ai=$('select[name="regions"] option:selected').val(),ak,ah=new w.GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),aj=aa.map($(".bookmark"),function(al){return new w.GenomeRegion({from_str:$(al).children(".position").text()})});if(ai==="cur"){ak=[ah]}else{if(ai==="bookmarks"){ak=aj}else{ak=[ah].concat(aj)}}Galaxy.modal.hide();window.location.href=galaxy_config.root+"visualization/sweepster?"+$.param({dataset_id:ab.dataset.id,hda_ldda:ab.dataset.get("hda_ldda"),regions:JSON.stringify(new Backbone.Collection(ak).toJSON())})},af=function(ah){if((ah.keyCode||ah.which)===27){ag()}else{if((ah.keyCode||ah.which)===13){ac()}}};Galaxy.modal.show({title:"Visualize tool parameter space and output from different parameter settings?",body:ad,buttons:{No:ag,Yes:ac}})}},p.prototype.action_icons_def[2]],can_draw:function(){return this.dataset&&p.prototype.can_draw.call(this)},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id)},build_header_div:function(){var ab=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(ab)}this.name_div=$("<div/>").addClass("track-name").appendTo(ab).text(this.config.get_value("name")).attr("id",this.config.get_value("name").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return ab},set_dataset:function(ab){this.dataset=ab;this.data_manager.set("dataset",ab)},on_resize:function(){this.request_draw({clear_tile_cache:true})},add_resize_handle:function(){var ab=this;var ae=false;var ad=false;var ac=$("<div class='track-resize'>");$(ab.container_div).hover(function(){if(ab.config.get_value("content_visible")){ae=true;ac.show()}},function(){ae=false;if(!ad){ac.hide()}});ac.hide().bind("dragstart",function(af,ag){ad=true;ag.original_height=$(ab.content_div).height()}).bind("drag",function(ag,ah){var af=Math.min(Math.max(ah.original_height+ah.deltaY,ab.min_height_px),ab.max_height_px);$(ab.tiles_div).css("height",af);ab.visible_height_px=(ab.max_height_px===af?0:af);ab.on_resize()}).bind("dragend",function(af,ag){ab.tile_cache.clear();ad=false;if(!ae){ac.hide()}ab.config.set("height",ab.visible_height_px);ab.changed()}).appendTo(ab.container_div)},set_display_modes:function(ae,ah){this.display_modes=ae;this.mode=(ah?ah:(this.config&&this.config.get_value("mode")?this.config.get_value("mode"):this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var ac=this,af={};for(var ad=0,ab=ac.display_modes.length;ad<ab;ad++){var ag=ac.display_modes[ad];af[ag]=function(ai){return function(){ac.change_mode(ai);ac.icons_div.show();ac.container_div.mouseleave(function(){ac.icons_div.hide()})}}(ag)}make_popupmenu(this.action_icons.mode_icon,af)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof V){return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrack"}else{if(this instanceof g){return"LineTrack"}else{if(this instanceof S){return"ReadTrack"}else{if(this instanceof Y){return"VariantTrack"}else{if(this instanceof e){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},show_message:function(ab){this.tiles_div.remove();return $("<span/>").addClass("message").html(ab).appendTo(this.content_div)},init:function(ad){var ac=this;ac.enabled=false;ac.tile_cache.clear();ac.data_manager.clear();ac.content_div.children().remove();ac.container_div.removeClass("nodata error pending");ac.tiles_div=$("<div/>").addClass("tiles").appendTo(ac.content_div);if(!ac.dataset.id){return}var ab=$.Deferred(),ae={hda_ldda:ac.dataset.get("hda_ldda"),data_type:this.dataset_check_type,chrom:ac.view.chrom,retry:ad};$.getJSON(this.dataset.url(),ae,function(af){if(!af||af==="error"||af.kind==="error"){ac.container_div.addClass("error");var ag=ac.show_message(m);if(af.message){ag.append($("<a href='javascript:void(0);'></a>").text("View error").click(function(){Galaxy.modal.show({title:"Trackster Error",body:"<pre>"+af.message+"</pre>",buttons:{Close:function(){Galaxy.modal.hide()}}})}));ag.append($("<span/>").text(" "));ag.append($("<a href='javascript:void(0);'></a>").text("Try again").click(function(){ac.init(true)}))}}else{if(af==="no converter"){ac.container_div.addClass("error");ac.show_message(H)}else{if(af==="no data"||(af.data!==undefined&&(af.data===null||af.data.length===0))){ac.container_div.addClass("nodata");ac.show_message(E)}else{if(af==="pending"){ac.container_div.addClass("pending");ac.show_message(u);setTimeout(function(){ac.init()},ac.data_query_wait)}else{if(af==="data"||af.status==="data"){if(af.valid_chroms){ac.valid_chroms=af.valid_chroms;ac.update_icons()}ac.tiles_div.text(T);if(ac.view.chrom){ac.tiles_div.text("");ac.tiles_div.css("height",ac.visible_height_px+"px");ac.enabled=true;$.when.apply($,ac.predraw_init()).done(function(){ab.resolve();ac.container_div.removeClass("nodata error pending");ac.request_draw()})}else{ab.resolve()}}}}}}});this.update_icons();return ab},predraw_init:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(ae&&ae.min&&ae.max){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_default_value("min_value",ad);ab.config.set_default_value("max_value",af);ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},get_drawables:function(){return this}});var L=function(ad,ac,af){f.call(this,ad,ac,af);var ab=this;k(ab.container_div,ab.drag_handle_class,".group",ab);this.filters_manager=new h.FiltersManager(this,("filters" in af?af.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=(af.tool?new q(aa.extend(af.tool,{track:this,tool_state:af.tool_state})):null);this.tile_cache=new w.Cache(O);this.left_offset=0;if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){var ae=new Z({model:this.tool});ae.render();this.dynamic_tool_div=ae.$el;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);if(!this.config.get_value("content_visible")){this.tiles_div.hide()}this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)}};o(L.prototype,p.prototype,f.prototype,{action_icons_def:f.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(ab){$(".tooltip").remove();ab.slotters[ab.view.resolution_px_b].max_rows*=2;ab.request_draw({clear_tile_cache:true})},hide:true}]),copy:function(ab){var ac=this.to_dict();o(ac,{data_manager:this.data_manager});var ad=new this.constructor(this.view,ab,ac);ad.change_mode(this.mode);ad.enabled=this.enabled;return ad},set_filters_manager:function(ab){this.filters_manager=ab;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool?this.tool.state_dict():{})}},set_min_max:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(isNaN(parseFloat(ab.config.get_value("min_value")))||isNaN(parseFloat(ab.config.get_value("max_value")))){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},change_mode:function(ac){var ab=this;ab.mode=ac;ab.config.set_value("mode",ac);if(ac==="Auto"){this.data_manager.clear()}ab.request_draw({clear_tile_cache:true});this.action_icons.mode_icon.attr("title","Set display mode (now: "+ab.mode+")");return ab},update_icons:function(){var ab=this;if(ab.filters_available){ab.action_icons.filters_icon.show()}else{ab.action_icons.filters_icon.hide()}if(ab.tool){ab.action_icons.tools_icon.show();ab.action_icons.param_space_viz_icon.show()}else{ab.action_icons.tools_icon.hide();ab.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(ac,ab){return ac+"_"+ab},request_draw:function(ab){if(ab&&ab.clear_tile_cache){this.tile_cache.clear()}this.view.request_redraw(ab,this)},before_draw:function(){this.max_height_px=0},_draw:function(ap){if(!this.can_draw()){return}var am=ap&&ap.clear_after,ak=this.view.low,af=this.view.high,ai=af-ak,ac=this.view.container.width(),ao=this.view.resolution_px_b,ae=1/ao;if(this.is_overview){ak=this.view.max_low;af=this.view.max_high;ao=ac/(view.max_high-view.max_low);ae=1/ao}this.before_draw();this.tiles_div.children().addClass("remove");var ab=Math.floor(ak/(ae*Q)),aj,al,ag,ah=[],an=[];while((ab*Q*ae)<af){aj=Math.floor(ab*Q*ae);al=new w.GenomeRegion({chrom:this.view.chrom,start:aj,end:Math.min(aj+Math.ceil(Q*ae),this.view.max_high)});ag=this.draw_helper(al,ao,ap);ah.push(ag);$.when(ag).then(function(aq){an.push(aq)});ab+=1}if(!am){this.tiles_div.children(".remove").removeClass("remove").remove()}var ad=this;$.when.apply($,ah).then(function(){ad.tiles_div.children(".remove").remove();an=aa.filter(an,function(aq){return aq!==null});if(an.length!==0){ad.postdraw_actions(an,ac,ao,am)}})},_add_yaxis_label:function(ae,ag){var ac=this,af=(ae==="max"?"top":"bottom"),ah=(ae==="max"?"max":"min"),ab=(ae==="max"?"max_value":"min_value"),ad=this.container_div.find(".yaxislabel."+af);ag=ag||function(){ac.request_draw({clear_tile_cache:true})};if(ad.length!==0){ad.text(ac.config.get_value(ab))}else{ad=$("<div/>").text(ac.config.get_value(ab)).make_text_editable({num_cols:12,on_finish:function(ai){$(".tooltip").remove();ac.config.set_value(ab,ai);ag()},help_text:"Set "+ah+" value"}).addClass("yaxislabel "+af).css("color",this.config.get_value("label_color"));this.container_div.prepend(ad)}},postdraw_actions:function(ae,af,ah,ab){var ad=aa.filter(ae,function(ai){return(ai instanceof K)});if(ad.length>0){this.max_height_px=0;var ac=this;aa.each(ae,function(ai){if(!(ai instanceof K)){ai.html_elt.remove();ac.draw_helper(ai.region,ah,{force:true,mode:"Coverage"})}});ac._add_yaxis_label("max")}else{this.container_div.find(".yaxislabel").remove();var ag=aa.find(ae,function(ai){return ai.has_icons});if(ag){aa.each(ae,function(ai){if(!ai.has_icons){ai.html_elt.css("padding-top",D)}})}}},get_mode:function(ab){return this.mode},update_auto_mode:function(ab){},_get_drawables:function(){return[this]},draw_helper:function(ak,am,an){if(!an){an={}}var ac=an.force,ah=an.mode||this.mode,ae=1/am,ad=this,af=this._get_drawables(),al=this._gen_tile_cache_key(am,ak),ag=function(ao){return(ao&&"track" in ao)};var ai=(ac?undefined:ad.tile_cache.get_elt(al));if(ai){if(ag(ai)){ad.show_tile(ai,am)}return ai}if(an.data_fetch===false){return null}var aj=function(){var ao=(aa.find(A,function(aq){return aq===ah})?"Coverage":ah);var ap=aa.map(af,function(aq){return aq.data_manager.get_data(ak,ao,ae,ad.data_url_extra_params)});if(view.reference_track){ap.push(view.reference_track.data_manager.get_data(ak,ah,ae,view.reference_track.data_url_extra_params))}return ap};var ab=$.Deferred();ad.tile_cache.set_elt(al,ab);$.when.apply($,aj()).then(function(){var ao=aj(),au=ao,aA;if(aa.find(ao,function(aC){return j.is_deferred(aC)})){ad.tile_cache.set_elt(al,undefined);$.when(ad.draw_helper(ak,am,an)).then(function(aC){ab.resolve(aC)});return}if(view.reference_track){aA=view.reference_track.data_manager.subset_entry(ao.pop(),ak)}var av=[],ar=[];aa.each(af,function(aF,aC){var aE=aF.mode,aD=au[aC];if(aE==="Auto"){aE=aF.get_mode(aD);aF.update_auto_mode(aE)}av.push(aE);ar.push(aF.get_canvas_height(aD,aE,am,ap))});var at=ad.view.canvas_manager.new_canvas(),aw=ak.get("start"),aB=ak.get("end"),aq=0,ap=Math.ceil((aB-aw)*am)+ad.left_offset,ay=aa.max(ar),ax;at.width=ap;at.height=(an.height||ay);var az=at.getContext("2d");az.translate(ad.left_offset,0);if(af.length>1){az.globalAlpha=0.5;az.globalCompositeOperation="source-over"}aa.each(af,function(aD,aC){ax=aD.draw_tile(au[aC],az,av[aC],ak,am,aA)});if(ax!==undefined){ad.tile_cache.set_elt(al,ax);ad.show_tile(ax,am)}ab.resolve(ax)});return ab},get_canvas_height:function(ab,ad,ae,ac){return this.visible_height_px},_draw_line_track_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.LinePainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new K(this,af,ah,ae,ab.data)},draw_tile:function(ab,ac,af,ae,ag,ad){},show_tile:function(ad,ag){var ac=this,ab=ad.html_elt;ad.predisplay_actions();var af=(ad.low-(this.is_overview?this.view.max_low:this.view.low))*ag;if(this.left_offset){af-=this.left_offset}ab.css("left",af);if(ab.hasClass("remove")){ab.removeClass("remove")}else{this.tiles_div.append(ab)}ab.css("height","auto");this.max_height_px=Math.max(this.max_height_px,ab.height()-2);ab.parent().children().css("height",this.max_height_px+"px");var ae=this.max_height_px;if(this.visible_height_px!==0){ae=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",ae+"px")},tool_region_and_parameters_str:function(ae){var ab=this,ad=(ae!==undefined?ae.toString():"all"),ac=aa.values(ab.tool.get_inputs_dict()).join(", ");return" - region=["+ad+"], parameters=["+ac+"]"},data_and_mode_compatible:function(ab,ac){if(ac==="Auto"){return true}else{if(ac==="Coverage"){return ab.dataset_type==="bigwig"}else{if(ab.dataset_type==="bigwig"||ab.extra_info==="no_detail"){return false}else{return true}}}},can_subset:function(ab){if(ab.message||ab.extra_info==="no_detail"){return false}else{if(ab.dataset_type==="bigwig"){return(ab.data[1][0]-ab.data[0][0]===1)}}return true},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data");this.data_query_wait=1000;this.dataset_check_type="state"}});var V=function(ac,ab){var ad={resize:false};f.call(this,ac,ab,ad);this.container_div.addClass("label-track")};o(V.prototype,f.prototype,{build_header_div:function(){},init:function(){this.enabled=true},predraw_init:function(){},_draw:function(af){var ad=this.view,ae=ad.high-ad.low,ai=Math.floor(Math.pow(10,Math.floor(Math.log(ae)/Math.log(10)))),ab=Math.floor(ad.low/ai)*ai,ag=this.view.container.width(),ac=$("<div/>").addClass("label-container");while(ab<ad.high){var ah=(ab-ad.low)/ae*ag;ac.append($("<div/>").addClass("label").text(commatize(ab)).css({left:ah}));ab+=ai}this.content_div.children(":first").remove();this.content_div.append(ac)}});var e=function(ac,ab,af){L.call(this,ac,ab,af);this.drawables=[];if("drawables" in af){var ae;for(var ad=0;ad<af.drawables.length;ad++){ae=af.drawables[ad];this.drawables[ad]=n(ae,ac,null);if(ae.left_offset>this.left_offset){this.left_offset=ae.left_offset}}this.enabled=true}aa.each(this.drawables,function(ag){if(ag instanceof c||ag instanceof S){ag.change_mode("Coverage")}});this.update_icons();this.obj_type="CompositeTrack"};o(e.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_group()}}].concat(L.prototype.action_icons_def),to_dict:y.prototype.to_dict,add_drawable:y.prototype.add_drawable,unpack_drawables:y.prototype.unpack_drawables,config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},change_mode:function(ab){L.prototype.change_mode.call(this,ab);for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac].change_mode(ab)}},init:function(){var ad=[];for(var ac=0;ac<this.drawables.length;ac++){ad.push(this.drawables[ac].init())}var ab=this;$.when.apply($,ad).then(function(){ab.enabled=true;ab.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,_get_drawables:function(){return this.drawables},show_group:function(){var ae=new N(this.view,this.container,{name:this.config.get_value("name")}),ab;for(var ad=0;ad<this.drawables.length;ad++){ab=this.drawables[ad];ab.update_icons();ae.add_drawable(ab);ab.container=ae;ae.content_div.append(ab.container_div)}var ac=this.container.replace_drawable(this,ae,true);ae.request_draw({clear_tile_cache:true})},before_draw:function(){L.prototype.before_draw.call(this);var ac=aa.min(aa.map(this.drawables,function(ad){return ad.config.get_value("min_value")})),ab=aa.max(aa.map(this.drawables,function(ad){return ad.config.get_value("max_value")}));this.config.set_value("min_value",ac);this.config.set_value("max_value",ab);aa.each(this.drawables,function(ad){ad.config.set_value("min_value",ac);ad.config.set_value("max_value",ab)})},update_all_min_max:function(){var ac=this,ab=this.config.get_value("min_value"),ad=this.config.get_value("max_value");aa.each(this.drawables,function(ae){ae.config.set_value("min_value",ab);ae.config.set_value("max_value",ad)});this.request_draw({clear_tile_cache:true})},postdraw_actions:function(ah,ab,ak,ag){var af=-1,ad;for(ad=0;ad<ah.length;ad++){var ai=ah[ad].html_elt.find("canvas").height();if(ai>af){af=ai}}for(ad=0;ad<ah.length;ad++){var ae=ah[ad];if(ae.html_elt.find("canvas").height()!==af){this.draw_helper(ae.region,ak,{force:true,height:af});ae.html_elt.remove()}}var ac=this,aj=function(){ac.update_all_min_max()};this._add_yaxis_label("min",aj);this._add_yaxis_label("max",aj)}});var B=function(ab){L.call(this,ab,{content_div:ab.top_labeltrack},{resize:false});this.left_offset=ab.canvas_manager.char_width_px;this.container_div.addClass("reference-track");this.data_url=galaxy_config.root+"api/genomes/"+this.view.dbkey;this.data_url_extra_params={reference:true};this.data_manager=new w.GenomeReferenceDataManager({data_url:this.data_url,can_subset:this.can_subset});this.hide_contents()};o(B.prototype,p.prototype,L.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"height",type:"int",default_value:13,hidden:true}]),build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},predraw_init:function(){},can_draw:p.prototype.can_draw,draw_helper:function(ac,ad,ab){if(ad>this.view.canvas_manager.char_width_px){this.tiles_div.show();return L.prototype.draw_helper.call(this,ac,ad,ab)}else{this.tiles_div.hide();return null}},can_subset:function(ab){return true},draw_tile:function(ad,aj,ae,ag,ak){var ac=this.data_manager.subset_entry(ad,ag),ai=ac.data;var ab=aj.canvas;aj.font=aj.canvas.manager.default_font;aj.textAlign="center";for(var af=0,ah=ai.length;af<ah;af++){aj.fillStyle=this.view.get_base_color(ai[af]);aj.fillText(ai[af],Math.floor(af*ak),10)}return new b(this,ag,ak,ab,ac)}});var g=function(ac,ab,ad){this.mode="Histogram";L.call(this,ac,ab,ad)};o(g.prototype,p.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Color",type:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},before_draw:function(){},draw_tile:function(ab,ac,ae,ad,af){return this._draw_line_track_tile(ab,ac,ae,ad,af)},can_subset:function(ab){return(ab.data[1][0]-ab.data[0][0]===1)},postdraw_actions:function(ac,ad,ae,ab){this._add_yaxis_label("max");this._add_yaxis_label("min")}});var r=function(ac,ab,ad){this.mode="Heatmap";L.call(this,ac,ab,ad)};o(r.prototype,p.prototype,L.prototype,{display_modes:["Heatmap"],config_params:aa.union(p.prototype.config_params,[{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",default_value:-1},{key:"max_value",label:"Max Value",type:"float",default_value:1},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:500,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.DiagonalHeatmapPainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new b(this,af,ah,ae,ab.data)}});var c=function(ac,ab,ad){L.call(this,ac,ab,ad);this.container_div.addClass("feature-track");this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block color",type:"color"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.set_painter_from_config();this.request_draw({clear_tile_cache:true})},set_painter_from_config:function(){if(this.config.get_value("connector_style")==="arcs"){this.painter=J.ArcLinkedFeaturePainter}else{this.painter=J.LinkedFeaturePainter}},postdraw_actions:function(am,ae,ao,al){L.prototype.postdraw_actions.call(this,am,ae,ao,al);var ag=this,ah;var ab={};aa.each(aa.pluck(am,"incomplete_features"),function(ap){aa.each(ap,function(aq){ab[aq[0]]=aq})});var an=this;aa.each(am,function(ap){an.draw_tile({data:aa.values(ab)},ap.canvas.getContext("2d"),ap.mode,ap.region,ao,ap.seq_data,true)});if(ag.filters_manager){var af=ag.filters_manager.filters,aj;for(aj=0;aj<af.length;aj++){af[aj].update_ui_elt()}var ai=false,ak,ad;for(ah=0;ah<am.length;ah++){if(am[ah].data.length){ak=am[ah].data[0];for(aj=0;aj<af.length;aj++){ad=af[aj];if(ad.applies_to(ak)&&ad.min!==ad.max){ai=true;break}}}}if(ag.filters_available!==ai){ag.filters_available=ai;if(!ag.filters_available){ag.filters_manager.hide()}ag.update_icons()}}if(am[0] instanceof M){var ac=true;for(ah=0;ah<am.length;ah++){if(!am[ah].all_slotted){ac=false;break}}if(!ac){this.action_icons.show_more_rows_icon.show()}else{this.action_icons.show_more_rows_icon.hide()}}else{this.action_icons.show_more_rows_icon.hide()}},update_auto_mode:function(ab){if(this.mode==="Auto"){if(ab==="no_detail"){ab="feature spans"}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+ab+")")}},incremental_slots:function(af,ab,ae){var ac=this.view.canvas_manager.dummy_context,ad=this.slotters[af];if(!ad||(ad.mode!==ae)){ad=new (s.FeatureSlotter)(af,ae,z,function(ag){return ac.measureText(ag)});this.slotters[af]=ad}return ad.slot_features(ab)},get_mode:function(ab){if(ab.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>G){mode="Squish"}else{mode="Pack"}}return mode},get_canvas_height:function(ab,af,ag,ac){if(af==="Coverage"||ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ae=this.incremental_slots(ag,ab.data,af);var ad=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return Math.max(this.min_height_px,ad.get_required_height(ae,ac))}},draw_tile:function(am,ar,ap,af,aj,ae,an){var aq=this,ad=ar.canvas,ay=af.get("start"),ac=af.get("end"),ag=this.left_offset;if(am.dataset_type==="bigwig"){return this._draw_line_track_tile(am,ar,ap,af,aj)}var ai=[],ao=this.slotters[aj].slots;all_slotted=true;if(am.data){var ak=this.filters_manager.filters;for(var at=0,av=am.data.length;at<av;at++){var ah=am.data[at];var au=false;var al;for(var ax=0,aC=ak.length;ax<aC;ax++){al=ak[ax];al.update_attrs(ah);if(!al.keep(ah)){au=true;break}}if(!au){ai.push(ah);if(!(ah[0] in ao)){all_slotted=false}}}}var aB=(this.filters_manager.alpha_filter?new C(this.filters_manager.alpha_filter):null),az=(this.filters_manager.height_filter?new C(this.filters_manager.height_filter):null),aA=new (this.painter)(ai,ay,ac,this.config.to_key_value_dict(),ap,aB,az,ae,function(aD){return aq.view.get_base_color(aD)});var aw=null;ar.fillStyle=this.config.get_value("block_color");ar.font=ar.canvas.manager.default_font;ar.textAlign="right";if(am.data){var ab=aA.draw(ar,ad.width,ad.height,aj,ao);aw=ab.feature_mapper;incomplete_features=ab.incomplete_features;aw.translation=-ag}if(!an){return new M(aq,af,aj,ad,am.data,ap,am.message,all_slotted,aw,incomplete_features,ae)}}});var Y=function(ac,ab,ad){L.call(this,ac,ab,ad);this.painter=J.VariantPainter;this.summary_draw_height=30;this.left_offset=30};o(Y.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Histogram color",type:"color"},{key:"show_sample_data",label:"Show sample data",type:"bool",default_value:true},{key:"show_labels",label:"Show summary and sample labels",type:"bool",default_value:true},{key:"summary_height",label:"Locus summary height",type:"float",default_value:20},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ae,ag,af,ah){if(ab.dataset_type==="bigwig"){return this._draw_line_track_tile(ab,ae,"Histogram",af,ah)}else{var ad=this.view,ac=new (this.painter)(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag,function(ai){return ad.get_base_color(ai)});ac.draw(ae,ae.canvas.width,ae.canvas.height,ah);return new b(this,af,ah,ae.canvas,ab.data)}},get_canvas_height:function(ab,af,ag,ad){if(ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ac=(this.dataset.get_metadata("sample_names")?this.dataset.get_metadata("sample_names").length:0);if(ac===0&&ab.data.length!==0){ac=ab.data[0][7].match(/,/g);if(ac===null){ac=1}else{ac=ac.length+1}}var ae=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return ae.get_required_height(ac)}},predraw_init:function(){var ab=[f.prototype.predraw_init.call(this)];if(!this.dataset.get_metadata("sample_names")){ab.push(this.dataset.fetch())}return ab},postdraw_actions:function(af,ag,ai,ac){L.prototype.postdraw_actions.call(this,af,ag,ai,ac);var ae=aa.filter(af,function(aj){return(aj instanceof K)});var ad=this.dataset.get_metadata("sample_names");if(ae.length===0&&this.config.get_value("show_labels")&&ad&&ad.length>1){var ab;if(this.container_div.find(".yaxislabel.variant").length===0){ab=this.config.get_value("summary_height")/2;this.tiles_div.prepend($("<div/>").text("Summary").addClass("yaxislabel variant top").css({"font-size":ab+"px",top:(this.config.get_value("summary_height")-ab)/2+"px"}));if(this.config.get_value("show_sample_data")){var ah=ad.join("<br/>");this.tiles_div.prepend($("<div/>").html(ah).addClass("yaxislabel variant top sample").css({top:this.config.get_value("summary_height")}))}}ab=(this.mode==="Squish"?5:10)+"px";$(this.tiles_div).find(".sample").css({"font-size":ab,"line-height":ab});$(this.tiles_div).find(".yaxislabel").css("color",this.config.get_value("label_color"))}else{this.container_div.find(".yaxislabel.variant").remove()}}});var S=function(ac,ab,ad){c.call(this,ac,ab,ad);this.painter=J.ReadPainter;this.update_icons()};o(S.prototype,p.prototype,L.prototype,c.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block and sense strand color",type:"color",default_value:"#DDDDDD"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:"#AAAAAA"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})}});var d={CompositeTrack:e,DrawableGroup:N,DiagonalHeatmapTrack:r,FeatureTrack:c,LineTrack:g,ReadTrack:S,VariantTrack:Y,VcfTrack:Y};var n=function(ad,ac,ab){if("copy" in ad){return ad.copy(ab)}else{var ae=ad.obj_type;if(!ae){ae=ad.track_type}return new d[ae](ac,ab,ad)}};return{TracksterView:X,DrawableGroup:N,LineTrack:g,FeatureTrack:c,DiagonalHeatmapTrack:r,ReadTrack:S,VariantTrack:Y,CompositeTrack:e,object_from_template:n}});
\ No newline at end of file
+define(["libs/underscore","viz/visualization","viz/trackster/util","viz/trackster/slotting","viz/trackster/painters","viz/trackster/filters","mvc/data","mvc/tools","utils/config"],function(aa,w,j,s,J,h,W,P,R){var o=aa.extend;var l={};var i=function(ab,ac){l[ab.attr("id")]=ac};var k=function(ab,ac,ae,ad){ae=".group";l[ab.attr("id")]=ad;ab.bind("drag",{handle:"."+ac,relative:true},function(am,an){var al=$(this),aq=$(this).parent(),ai=aq.children(".track,.group"),ak=l[$(this).attr("id")],ah,ag,ao,af,aj;ag=$(this).parents(ae);if(ag.length!==0){ao=ag.position().top;af=ao+ag.outerHeight();var ap=l[ag.attr("id")];if(an.offsetY<ao){$(this).insertBefore(ag);ap.remove_drawable(ak);ap.container.add_drawable_before(ak,ap);return}else{if(an.offsetY>af){$(this).insertAfter(ag);ap.remove_drawable(ak);ap.container.add_drawable(ak);return}}}ag=null;for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));ao=ah.position().top;af=ao+ah.outerHeight();if(ah.is(ae)&&this!==ah.get(0)&&an.offsetY>=ao&&an.offsetY<=af){if(an.offsetY-ao<af-an.offsetY){ah.find(".content-div").prepend(this)}else{ah.find(".content-div").append(this)}if(ak.container){ak.container.remove_drawable(ak)}l[ah.attr("id")].add_drawable(ak);return}}for(aj=0;aj<ai.length;aj++){ah=$(ai.get(aj));if(an.offsetY<ah.position().top&&!(ah.hasClass("reference-track")||ah.hasClass("intro"))){break}}if(aj===ai.length){if(this!==ai.get(aj-1)){aq.append(this);l[aq.attr("id")].move_drawable(ak,aj)}}else{if(this!==ai.get(aj)){$(this).insertBefore(ai.get(aj));l[aq.attr("id")].move_drawable(ak,(an.deltaY>0?aj-1:aj))}}}).bind("dragstart",function(){$(this).addClass("dragging")}).bind("dragend",function(){$(this).removeClass("dragging")})};var D=20,z=100,G=12000,Q=400,I=5000,v=100,m="Cannot display dataset due to an error. ",H="A converter for this dataset is not installed. Please check your datatypes_conf.xml file.",E="No data for this chrom/contig.",u="Preparing data. This can take a while for a large dataset. If the visualization is saved and closed, preparation will continue in the background.",x="Tool cannot be rerun: ",a="Loading data...",T="Ready for display",O=10,F=20,A=["Histogram","Line","Filled","Intensity"];function U(ac,ab){if(!ab){ab=0}var ad=Math.pow(10,ab);return Math.round(ac*ad)/ad}var p=function(ac,ab,ae){if(!p.id_counter){p.id_counter=0}this.id=p.id_counter++;this.view=ac;this.container=ab;this.drag_handle_class=ae.drag_handle_class;this.is_overview=false;this.action_icons={};this.config=R.ConfigSettingCollection.from_models_and_saved_values(this.config_params,ae.prefs);if(!this.config.get_value("name")){this.config.set_value("name",ae.name)}if(this.config_onchange){this.config.on("change",this.config_onchange,this)}this.container_div=this.build_container_div();this.header_div=this.build_header_div();if(this.header_div){this.container_div.append(this.header_div);this.icons_div=$("<div/>").addClass("track-icons").hide().appendTo(this.header_div);this.build_action_icons(this.action_icons_def);this.header_div.append($("<div style='clear: both'/>"));this.header_div.dblclick(function(af){af.stopPropagation()});var ad=this;this.container_div.hover(function(){ad.icons_div.show()},function(){ad.icons_div.hide()});$("<div style='clear: both'/>").appendTo(this.container_div)}};p.prototype.action_icons_def=[{name:"toggle_icon",title:"Hide/show content",css_class:"toggle",on_click_fn:function(ab){if(ab.config.get_value("content_visible")){ab.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");ab.hide_contents();ab.config.set_value("content_visible",false)}else{ab.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");ab.config.set_value("content_visible",true);ab.show_contents()}}},{name:"settings_icon",title:"Edit settings",css_class:"gear",on_click_fn:function(ac){var ab=new R.ConfigSettingCollectionView({collection:ac.config});ab.render_in_modal("Configure Track")}},{name:"remove_icon",title:"Remove",css_class:"remove-icon",on_click_fn:function(ab){$(".tooltip").remove();ab.remove()}}];o(p.prototype,{config_params:[{key:"name",label:"Name",type:"text",default_value:""},{key:"content_visible",type:"bool",default_value:true,hidden:true}],config_onchange:function(){},init:function(){},changed:function(){this.view.changed()},can_draw:function(){if(this.enabled&&this.config.get_value("content_visible")){return true}return false},request_draw:function(){},_draw:function(ab){},to_dict:function(){},set_name:function(ab){this.old_name=this.config.get_value("name");this.config.set_value("name",ab);this.name_div.text(ab)},revert_name:function(){if(this.old_name){this.config.set_value("name",this.old_name);this.name_div.text(this.old_name)}},remove:function(){this.changed();this.container.remove_drawable(this);var ab=this.view;this.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})},build_container_div:function(){},build_header_div:function(){},add_action_icon:function(ac,ah,ag,af,ab,ae){var ad=this;this.action_icons[ac]=$("<a/>").attr("title",ah).addClass("icon-button").addClass(ag).tooltip().click(function(){af(ad)}).appendTo(this.icons_div);if(ae){this.action_icons[ac].hide()}},build_action_icons:function(ab){var ad;for(var ac=0;ac<ab.length;ac++){ad=ab[ac];this.add_action_icon(ad.name,ad.title,ad.css_class,ad.on_click_fn,ad.prepend,ad.hide)}},update_icons:function(){},hide_contents:function(){},show_contents:function(){},get_drawables:function(){}});var y=function(ac,ab,ad){p.call(this,ac,ab,ad);this.obj_type=ad.obj_type;this.drawables=[]};o(y.prototype,p.prototype,{unpack_drawables:function(ad){this.drawables=[];var ac;for(var ab=0;ab<ad.length;ab++){ac=n(ad[ab],this.view,this);this.add_drawable(ac)}},init:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].init()}},_draw:function(ab){for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac]._draw(ab)}},to_dict:function(){var ac=[];for(var ab=0;ab<this.drawables.length;ab++){ac.push(this.drawables[ab].to_dict())}return{prefs:this.config.to_key_value_dict(),obj_type:this.obj_type,drawables:ac}},add_drawable:function(ab){this.drawables.push(ab);ab.container=this;this.changed()},add_drawable_before:function(ad,ab){this.changed();var ac=this.drawables.indexOf(ab);if(ac!==-1){this.drawables.splice(ac,0,ad);return true}return false},replace_drawable:function(ad,ab,ac){var ae=this.drawables.indexOf(ad);if(ae!==-1){this.drawables[ae]=ab;if(ac){ad.container_div.replaceWith(ab.container_div)}this.changed()}return ae},remove_drawable:function(ac){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);ac.container=null;this.changed();return true}return false},move_drawable:function(ac,ad){var ab=this.drawables.indexOf(ac);if(ab!==-1){this.drawables.splice(ab,1);this.drawables.splice(ad,0,ac);this.changed();return true}return false},get_drawables:function(){return this.drawables},get_tracks:function(ae){var ab=this.drawables.slice(0),ac=[],ad;while(ab.length!==0){ad=ab.shift();if(ad instanceof ae){ac.push(ad)}else{if(ad.drawables){ab=ab.concat(ad.drawables)}}}return ac}});var N=function(ac,ab,ae){o(ae,{obj_type:"DrawableGroup",drag_handle_class:"group-handle"});y.call(this,ac,ab,ae);this.content_div=$("<div/>").addClass("content-div").attr("id","group_"+this.id+"_content_div").appendTo(this.container_div);i(this.container_div,this);i(this.content_div,this);k(this.container_div,this.drag_handle_class,".group",this);this.filters_manager=new h.FiltersManager(this);this.header_div.after(this.filters_manager.parent_div);this.saved_filters_managers=[];if("drawables" in ae){this.unpack_drawables(ae.drawables)}if("filters" in ae){var ad=this.filters_manager;this.filters_manager=new h.FiltersManager(this,ae.filters);ad.parent_div.replaceWith(this.filters_manager.parent_div);if(ae.filters.visible){this.setup_multitrack_filtering()}}};o(N.prototype,p.prototype,y.prototype,{action_icons_def:[p.prototype.action_icons_def[0],p.prototype.action_icons_def[1],{name:"composite_icon",title:"Show composite track",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_composite_track()}},{name:"filters_icon",title:"Filters",css_class:"filters-icon",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters();ab._restore_filter_managers()}else{ab.setup_multitrack_filtering();ab.request_draw({clear_tile_cache:true})}ab.filters_manager.toggle()}},p.prototype.action_icons_def[2]],build_container_div:function(){var ab=$("<div/>").addClass("group").attr("id","group_"+this.id);if(this.container){this.container.content_div.append(ab)}return ab},build_header_div:function(){var ab=$("<div/>").addClass("track-header");ab.append($("<div/>").addClass(this.drag_handle_class));this.name_div=$("<div/>").addClass("track-name").text(this.config.get_value("name")).appendTo(ab);return ab},hide_contents:function(){this.tiles_div.hide()},show_contents:function(){this.tiles_div.show();this.request_draw()},update_icons:function(){var ad=this.drawables.length;if(ad===0){this.action_icons.composite_icon.hide();this.action_icons.filters_icon.hide()}else{if(ad===1){if(this.drawables[0] instanceof e){this.action_icons.composite_icon.show()}this.action_icons.filters_icon.hide()}else{var ak,aj,ah,an=true,af=this.drawables[0].get_type(),ab=0;for(ak=0;ak<ad;ak++){ah=this.drawables[ak];if(ah.get_type()!==af){can_composite=false;break}if(ah instanceof c){ab++}}if(an&&this.drawables[0] instanceof g){this.action_icons.composite_icon.show()}else{this.action_icons.composite_icon.hide();$(".tooltip").remove()}if(ab>1&&ab===this.drawables.length){var ao={},ac;ah=this.drawables[0];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];ao[ac.name]=[ac]}for(ak=1;ak<this.drawables.length;ak++){ah=this.drawables[ak];for(aj=0;aj<ah.filters_manager.filters.length;aj++){ac=ah.filters_manager.filters[aj];if(ac.name in ao){ao[ac.name].push(ac)}}}this.filters_manager.remove_all();var ae,ag,ai,al;for(var am in ao){ae=ao[am];if(ae.length===ab){ag=new h.NumberFilter({name:ae[0].name,index:ae[0].index});this.filters_manager.add_filter(ag)}}if(this.filters_manager.filters.length>0){this.action_icons.filters_icon.show()}else{this.action_icons.filters_icon.hide()}}else{this.action_icons.filters_icon.hide()}}}},_restore_filter_managers:function(){for(var ab=0;ab<this.drawables.length;ab++){this.drawables[ab].filters_manager=this.saved_filters_managers[ab]}this.saved_filters_managers=[]},setup_multitrack_filtering:function(){if(this.filters_manager.filters.length>0){this.saved_filters_managers=[];for(var ab=0;ab<this.drawables.length;ab++){drawable=this.drawables[ab];this.saved_filters_managers.push(drawable.filters_manager);drawable.filters_manager=this.filters_manager}}this.filters_manager.init_filters()},show_composite_track:function(){var ac=new e(this.view,this.view,{name:this.config.get_value("name"),drawables:this.drawables});var ab=this.container.replace_drawable(this,ac,true);ac.request_draw()},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);this.update_icons()},remove_drawable:function(ab){y.prototype.remove_drawable.call(this,ab);this.update_icons()},to_dict:function(){if(this.filters_manager.visible()){this._restore_filter_managers()}var ab=o(y.prototype.to_dict.call(this),{filters:this.filters_manager.to_dict()});if(this.filters_manager.visible()){this.setup_multitrack_filtering()}return ab},request_draw:function(ab){aa.each(this.drawables,function(ac){ac.request_draw(ab)})}});var X=Backbone.View.extend({initialize:function(ab){o(ab,{obj_type:"View"});y.call(this,"View",ab.container,ab);this.chrom=null;this.vis_id=ab.vis_id;this.dbkey=ab.dbkey;this.label_tracks=[];this.tracks_to_be_redrawn=[];this.max_low=0;this.max_high=0;this.zoom_factor=3;this.min_separation=30;this.has_changes=false;this.load_chroms_deferred=null;this.render();this.canvas_manager=new w.CanvasManager(this.container.get(0).ownerDocument);this.reset();this.config=R.ConfigSettingCollection.from_models_and_saved_values([{key:"name",label:"Name",type:"text",default_value:""},{key:"a_color",label:"A Color",type:"color",default_value:"#FF0000"},{key:"c_color",label:"C Color",type:"color",default_value:"#00FF00"},{key:"g_color",label:"G Color",type:"color",default_value:"#0000FF"},{key:"t_color",label:"T Color",type:"color",default_value:"#FF00FF"},{key:"n_color",label:"N Color",type:"color",default_value:"#AAAAAA"}],{name:ab.name})},render:function(){this.requested_redraw=false;var ad=this.container,ab=this;this.top_container=$("<div/>").addClass("top-container").appendTo(ad);this.browser_content_div=$("<div/>").addClass("content").appendTo(ad);this.bottom_container=$("<div/>").addClass("bottom-container").appendTo(ad);this.top_labeltrack=$("<div/>").addClass("top-labeltrack").appendTo(this.top_container);this.viewport_container=$("<div/>").addClass("viewport-container").attr("id","viewport-container").appendTo(this.browser_content_div);this.content_div=this.viewport_container;i(this.viewport_container,ab);this.intro_div=$("<div/>").addClass("intro").appendTo(this.viewport_container).hide();var ae=$("<div/>").text("Add Datasets to Visualization").addClass("action-button").appendTo(this.intro_div).click(function(){w.select_datasets(galaxy_config.root+"visualization/list_current_history_datasets",galaxy_config.root+"api/datasets",{"f-dbkey":ab.dbkey},function(af){aa.each(af,function(ag){ab.add_drawable(n(ag,ab,ab))})})});this.nav_labeltrack=$("<div/>").addClass("nav-labeltrack").appendTo(this.bottom_container);this.nav_container=$("<div/>").addClass("trackster-nav-container").prependTo(this.top_container);this.nav=$("<div/>").addClass("trackster-nav").appendTo(this.nav_container);this.overview=$("<div/>").addClass("overview").appendTo(this.bottom_container);this.overview_viewport=$("<div/>").addClass("overview-viewport").appendTo(this.overview);this.overview_close=$("<a/>").attr("title","Close overview").addClass("icon-button overview-close tooltip").hide().appendTo(this.overview_viewport);this.overview_highlight=$("<div/>").addClass("overview-highlight").hide().appendTo(this.overview_viewport);this.overview_box_background=$("<div/>").addClass("overview-boxback").appendTo(this.overview_viewport);this.overview_box=$("<div/>").addClass("overview-box").appendTo(this.overview_viewport);this.default_overview_height=this.overview_box.height();this.nav_controls=$("<div/>").addClass("nav-controls").appendTo(this.nav);this.chrom_select=$("<select/>").attr({name:"chrom"}).addClass("chrom-nav").append("<option value=''>Loading</option>").appendTo(this.nav_controls);var ac=function(af){if(af.type==="focusout"||(af.keyCode||af.which)===13||(af.keyCode||af.which)===27){if((af.keyCode||af.which)!==27){ab.go_to($(this).val())}$(this).hide();$(this).val("");ab.location_span.show();ab.chrom_select.show()}af.stopPropagation()};this.nav_input=$("<input/>").addClass("nav-input").hide().bind("keyup focusout",ac).appendTo(this.nav_controls);this.location_span=$("<span/>").addClass("location").attr("title","Click to change location").tooltip({placement:"bottom"}).appendTo(this.nav_controls);this.location_span.click(function(){ab.location_span.hide();ab.chrom_select.hide();ab.nav_input.val(ab.chrom+":"+ab.low+"-"+ab.high);ab.nav_input.css("display","inline-block");ab.nav_input.select();ab.nav_input.focus();ab.nav_input.autocomplete({source:function(ah,af){var ai=[],ag=$.map(ab.get_tracks(c),function(aj){return aj.data_manager.search_features(ah.term).success(function(ak){ai=ai.concat(ak)})});$.when.apply($,ag).done(function(){af($.map(ai,function(aj){return{label:aj[0],value:aj[1]}}))})}})});if(this.vis_id!==undefined){this.hidden_input=$("<input/>").attr("type","hidden").val(this.vis_id).appendTo(this.nav_controls)}this.zo_link=$("<a/>").attr("id","zoom-out").attr("title","Zoom out").tooltip({placement:"bottom"}).click(function(){ab.zoom_out()}).appendTo(this.nav_controls);this.zi_link=$("<a/>").attr("id","zoom-in").attr("title","Zoom in").tooltip({placement:"bottom"}).click(function(){ab.zoom_in()}).appendTo(this.nav_controls);this.load_chroms_deferred=this.load_chroms({low:0});this.chrom_select.bind("change",function(){ab.change_chrom(ab.chrom_select.val())});this.browser_content_div.click(function(af){$(this).find("input").trigger("blur")});this.browser_content_div.bind("dblclick",function(af){ab.zoom_in(af.pageX,this.viewport_container)});this.overview_box.bind("dragstart",function(af,ag){this.current_x=ag.offsetX}).bind("drag",function(af,ah){var ai=ah.offsetX-this.current_x;this.current_x=ah.offsetX;var ag=Math.round(ai/ab.viewport_container.width()*(ab.max_high-ab.max_low));ab.move_delta(-ag)});this.overview_close.click(function(){ab.reset_overview()});this.viewport_container.bind("draginit",function(af,ag){if(af.clientX>ab.viewport_container.width()-16){return false}}).bind("dragstart",function(af,ag){ag.original_low=ab.low;ag.current_height=af.clientY;ag.current_x=ag.offsetX}).bind("drag",function(ah,aj){var af=$(this);var ak=aj.offsetX-aj.current_x;var ag=af.scrollTop()-(ah.clientY-aj.current_height);af.scrollTop(ag);aj.current_height=ah.clientY;aj.current_x=aj.offsetX;var ai=Math.round(ak/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}).bind("mousewheel",function(ah,aj,ag,af){if(ag){ag*=50;var ai=Math.round(-ag/ab.viewport_container.width()*(ab.high-ab.low));ab.move_delta(ai)}});this.top_labeltrack.bind("dragstart",function(af,ag){return $("<div/>").addClass("zoom-area").css("height",ab.browser_content_div.height()+ab.top_labeltrack.height()+ab.nav_labeltrack.height()+1).appendTo($(this))}).bind("drag",function(aj,ak){$(ak.proxy).css({left:Math.min(aj.pageX,ak.startX)-ab.container.offset().left,width:Math.abs(aj.pageX-ak.startX)});var ag=Math.min(aj.pageX,ak.startX)-ab.container.offset().left,af=Math.max(aj.pageX,ak.startX)-ab.container.offset().left,ai=(ab.high-ab.low),ah=ab.viewport_container.width();ab.update_location(Math.round(ag/ah*ai)+ab.low,Math.round(af/ah*ai)+ab.low)}).bind("dragend",function(ak,al){var ag=Math.min(ak.pageX,al.startX),af=Math.max(ak.pageX,al.startX),ai=(ab.high-ab.low),ah=ab.viewport_container.width(),aj=ab.low;ab.low=Math.round(ag/ah*ai)+aj;ab.high=Math.round(af/ah*ai)+aj;$(al.proxy).remove();ab.request_redraw()});this.add_label_track(new V(this,{content_div:this.top_labeltrack}));this.add_label_track(new V(this,{content_div:this.nav_labeltrack}));$(window).bind("resize",function(){if(this.resize_timer){clearTimeout(this.resize_timer)}this.resize_timer=setTimeout(function(){ab.resize_window()},500)});$(document).bind("redraw",function(){ab.redraw()});this.reset();$(window).trigger("resize")},get_base_color:function(ab){return this.config.get_value(ab.toLowerCase()+"_color")||this.config.get_value("n_color")}});o(X.prototype,y.prototype,{changed:function(){this.has_changes=true},update_intro_div:function(){if(this.drawables.length===0){this.intro_div.show()}else{this.intro_div.hide()}},trigger_navigate:function(ac,ae,ab,af){if(this.timer){clearTimeout(this.timer)}if(af){var ad=this;this.timer=setTimeout(function(){ad.trigger("navigate",ac+":"+ae+"-"+ab)},500)}else{view.trigger("navigate",ac+":"+ae+"-"+ab)}},update_location:function(ab,ad){this.location_span.text(commatize(ab)+" - "+commatize(ad));this.nav_input.val(this.chrom+":"+commatize(ab)+"-"+commatize(ad));var ac=view.chrom_select.val();if(ac!==""){this.trigger_navigate(ac,view.low,view.high,true)}},load_chroms:function(ad){ad.num=v;var ab=this,ac=$.Deferred();$.ajax({url:galaxy_config.root+"api/genomes/"+this.dbkey,data:ad,dataType:"json",success:function(af){if(af.chrom_info.length===0){return}if(af.reference){var ag=new B(ab);ab.add_label_track(ag);ab.reference_track=ag}ab.chrom_data=af.chrom_info;var aj='<option value="">Select Chrom/Contig</option>';for(var ai=0,ae=ab.chrom_data.length;ai<ae;ai++){var ah=ab.chrom_data[ai].chrom;aj+='<option value="'+ah+'">'+ah+"</option>"}if(af.prev_chroms){aj+='<option value="previous">Previous '+v+"</option>"}if(af.next_chroms){aj+='<option value="next">Next '+v+"</option>"}ab.chrom_select.html(aj);ab.chrom_start_index=af.start_index;ac.resolve(af.chrom_info)},error:function(){alert("Could not load chroms for this dbkey: "+ab.dbkey)}});return ac},change_chrom:function(ag,ac,ai){var ad=this;if(!ad.chrom_data){ad.load_chroms_deferred.then(function(){ad.change_chrom(ag,ac,ai)});return}if(!ag||ag==="None"){return}if(ag==="previous"){ad.load_chroms({low:this.chrom_start_index-v});return}if(ag==="next"){ad.load_chroms({low:this.chrom_start_index+v});return}var ah=$.grep(ad.chrom_data,function(aj,ak){return aj.chrom===ag})[0];if(ah===undefined){ad.load_chroms({chrom:ag},function(){ad.change_chrom(ag,ac,ai)});return}else{if(ag!==ad.chrom){ad.chrom=ag;ad.chrom_select.val(ad.chrom);ad.max_high=ah.len-1;ad.reset();for(var af=0,ab=ad.drawables.length;af<ab;af++){var ae=ad.drawables[af];if(ae.init){ae.init()}}if(ad.reference_track){ad.reference_track.init()}}if(ac===undefined&&ai===undefined){ad.low=0;ad.high=ad.max_high}else{ad.low=(ac!==undefined?Math.max(ac,0):0);if(ai===undefined){ad.low=Math.max(ad.low-15,0);ad.high=ad.low+30}else{ad.high=Math.min(ai,ad.max_high)}}ad.reset_overview();ad.request_redraw()}},go_to:function(af){af=af.replace(/,/g,"");af=af.replace(/:|\-/g," ");var ac=af.split(/\s+/),ae=ac[0],ad=(ac[1]?parseInt(ac[1],10):undefined),ab=(ac[2]?parseInt(ac[2],10):undefined);this.change_chrom(ae,ad,ab)},move_fraction:function(ad){var ab=this;var ac=ab.high-ab.low;this.move_delta(ad*ac)},move_delta:function(ae){var ab=this;var ad=ab.high-ab.low;if(ab.low-ae<ab.max_low){ab.low=ab.max_low;ab.high=ab.max_low+ad}else{if(ab.high-ae>ab.max_high){ab.high=ab.max_high;ab.low=ab.max_high-ad}else{ab.high-=ae;ab.low-=ae}}ab.request_redraw({data_fetch:false});if(this.redraw_on_move_fn){clearTimeout(this.redraw_on_move_fn)}this.redraw_on_move_fn=setTimeout(function(){ab.request_redraw()},200);var ac=ab.chrom_select.val();this.trigger_navigate(ac,ab.low,ab.high,true)},add_drawable:function(ab){y.prototype.add_drawable.call(this,ab);ab.init();this.changed();this.update_intro_div()},add_label_track:function(ab){ab.view=this;ab.init();this.label_tracks.push(ab)},remove_drawable:function(ad,ac){y.prototype.remove_drawable.call(this,ad);if(ac){var ab=this;ad.container_div.hide(0,function(){$(this).remove();ab.update_intro_div()})}},reset:function(){this.low=this.max_low;this.high=this.max_high;this.viewport_container.find(".yaxislabel").remove()},request_redraw:function(ac,ad){var ab=this,ae=(ad?[ad]:ab.drawables);aa.each(ae,function(af){var ag=aa.find(ab.tracks_to_be_redrawn,function(ah){return ah[0]===af});if(ag){ag[1]=ac}else{ab.tracks_to_be_redrawn.push([af,ac])}});if(!this.requested_redraw){requestAnimationFrame(function(){ab._redraw()});this.requested_redraw=true}},_redraw:function(){this.requested_redraw=false;var ab=this.low,af=this.high;if(ab<this.max_low){ab=this.max_low}if(af>this.max_high){af=this.max_high}var ac=this.high-this.low;if(this.high!==0&&ac<this.min_separation){af=ab+this.min_separation}this.low=Math.floor(ab);this.high=Math.ceil(af);this.update_location(this.low,this.high);this.resolution_px_b=this.viewport_container.width()/(this.high-this.low);var ae=(this.low/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ag=((this.high-this.low)/(this.max_high-this.max_low)*this.overview_viewport.width())||0;var ad=13;this.overview_box.css({left:ae,width:Math.max(ad,ag)}).show();if(ag<ad){this.overview_box.css("left",ae-(ad-ag)/2)}if(this.overview_highlight){this.overview_highlight.css({left:ae,width:ag})}aa.each(this.tracks_to_be_redrawn,function(aj){var ah=aj[0],ai=aj[1];if(ah){ah._draw(ai)}});this.tracks_to_be_redrawn=[];aa.each(this.label_tracks,function(ah){ah._draw()})},zoom_in:function(ac,ad){if(this.max_high===0||this.high-this.low<=this.min_separation){return}var ae=this.high-this.low,af=ae/2+this.low,ab=(ae/this.zoom_factor)/2;if(ac){af=ac/this.viewport_container.width()*(this.high-this.low)+this.low}this.low=Math.round(af-ab);this.high=Math.round(af+ab);this.changed();this.request_redraw()},zoom_out:function(){if(this.max_high===0){return}var ac=this.high-this.low,ad=ac/2+this.low,ab=(ac*this.zoom_factor)/2;this.low=Math.round(ad-ab);this.high=Math.round(ad+ab);this.changed();this.request_redraw()},resize_window:function(){this.viewport_container.height(this.container.height()-this.top_container.height()-this.bottom_container.height());this.request_redraw()},set_overview:function(ad){if(this.overview_drawable){if(this.overview_drawable.dataset.id===ad.dataset.id){return}this.overview_viewport.find(".track").remove()}var ac=ad.copy({content_div:this.overview_viewport}),ab=this;ac.header_div.hide();ac.is_overview=true;ab.overview_drawable=ac;this.overview_drawable.postdraw_actions=function(){ab.overview_highlight.show().height(ab.overview_drawable.content_div.height());ab.overview_viewport.height(ab.overview_drawable.content_div.height()+ab.overview_box.outerHeight());ab.overview_close.show();ab.resize_window()};ab.overview_drawable.request_draw();this.changed()},reset_overview:function(){$(".tooltip").remove();this.overview_viewport.find(".track-tile").remove();this.overview_viewport.height(this.default_overview_height);this.overview_box.height(this.default_overview_height);this.overview_close.hide();this.overview_highlight.hide();view.resize_window();view.overview_drawable=null}});var q=P.Tool.extend({defaults:{track:null},initialize:function(ab){P.Tool.prototype.initialize.call(this,ab);var ac=true;if(ab.tool_state!==undefined&&ab.tool_state.hidden!==undefined){ac=ab.tool_state.hidden}this.set("hidden",ac);this.remove_inputs(["data","hidden_data","conditional"])},state_dict:function(ab){return aa.extend(this.get_inputs_dict(),{hidden:!this.is_visible()})}});var t=Backbone.View.extend({events:{"change input":"update_value"},render:function(){var ad=this.$el.addClass("param-row"),ae=this.model;var ab=$("<div>").addClass("param-label").text(ae.get("label")).appendTo(ad);var ac=$("<div/>").addClass("param-input").html(ae.get("html")).appendTo(ad);ac.find(":input").val(ae.get("value"));$("<div style='clear: both;'/>").appendTo(ad)},update_value:function(ab){this.model.set_value($(ab.target).val())}});var Z=Backbone.View.extend({initialize:function(ab){this.model.on("change:hidden",this.set_visible,this)},render:function(){var ac=this;tool=this.model,parent_div=this.$el.addClass("dynamic-tool").hide();parent_div.bind("drag",function(ag){ag.stopPropagation()}).click(function(ag){ag.stopPropagation()}).bind("dblclick",function(ag){ag.stopPropagation()}).keydown(function(ag){ag.stopPropagation()});var ad=$("<div class='tool-name'>").appendTo(parent_div).text(tool.get("name"));tool.get("inputs").each(function(ah){var ag=new t({model:ah});ag.render();parent_div.append(ag.$el)});parent_div.find("input").click(function(){$(this).select()});var ae=$("<div>").addClass("param-row").appendTo(parent_div);var af=$("<input type='submit'>").attr("value","Run on complete dataset").appendTo(ae);var ab=$("<input type='submit'>").attr("value","Run on visible region").appendTo(ae);ab.click(function(){ac.run_on_region()});af.click(function(){ac.run_on_dataset()});if(tool.is_visible()){this.$el.show()}},set_visible:function(){if(this.model.is_visible()){this.$el.show()}else{this.$el.hide()}},update_params:function(){for(var ab=0;ab<this.params.length;ab++){this.params[ab].update_value()}},run_on_dataset:function(){var ab=this.model;this.run({target_dataset_id:this.model.get("track").dataset.id,action:"rerun",tool_id:ab.id},null,function(ac){Galaxy.modal.show({title:ab.get("name")+" is Running",body:ab.get("name")+" is running on the complete dataset. Tool outputs are in dataset's history.",buttons:{Close:function(){Galaxy.modal.hide()}}})})},run_on_region:function(){var ac=this.model.get("track"),af=this.model,ah=new w.GenomeRegion({chrom:ac.view.chrom,start:ac.view.low,end:ac.view.high}),ai={target_dataset_id:ac.dataset.id,action:"rerun",tool_id:af.id,regions:[ah.toJSON()]},ag=ac,ak=af.get("name")+ag.tool_region_and_parameters_str(ah),ab;if(ag.container===view){var aj=new N(view,view,{name:ac.config.get_value("name")});var ae=ag.container.replace_drawable(ag,aj,false);aj.container_div.insertBefore(ag.view.content_div.children()[ae]);aj.add_drawable(ag);ag.container_div.appendTo(aj.content_div);ab=aj}else{ab=ag.container}var ad=new ag.constructor(view,ab,{name:ak,hda_ldda:"hda"});ad.init_for_tool_data();ad.change_mode(ag.mode);ad.set_filters_manager(ag.filters_manager.copy(ad));ad.update_icons();ab.add_drawable(ad);ad.tiles_div.text("Starting job.");this.run(ai,ad,function(al){ad.set_dataset(new W.Dataset(al));ad.tiles_div.text("Running job.");ad.init()})},run:function(ab,ad,ae){ab.inputs=this.model.get_inputs_dict();var ac=new j.ServerStateDeferred({ajax_settings:{url:galaxy_config.root+"api/tools",data:JSON.stringify(ab),dataType:"json",contentType:"application/json",type:"POST"},interval:2000,success_fn:function(af){return af!=="pending"}});$.when(ac.go()).then(function(af){if(af==="no converter"){ad.container_div.addClass("error");ad.content_div.text(H)}else{if(af.error){ad.container_div.addClass("error");ad.content_div.text(x+af.message)}else{ae(af)}}})}});var C=function(ab,ac){J.Scaler.call(this,ac);this.filter=ab};C.prototype.gen_val=function(ab){if(this.filter.high===Number.MAX_VALUE||this.filter.low===-Number.MAX_VALUE||this.filter.low===this.filter.high){return this.default_val}return((parseFloat(ab[this.filter.index])-this.filter.low)/(this.filter.high-this.filter.low))};var b=function(ab,ae,af,ac,ad){this.track=ab;this.region=ae;this.low=ae.get("start");this.high=ae.get("end");this.w_scale=af;this.canvas=ac;this.html_elt=$("<div class='track-tile'/>").append(ac);this.data=ad;this.stale=false};b.prototype.predisplay_actions=function(){};var K=function(ab,ae,af,ac,ad){b.call(this,ab,ae,af,ac,ad)};K.prototype.predisplay_actions=function(){};var M=function(ad,ai,ak,ac,af,ag,al,ab,ah,ae,aj){b.call(this,ad,ai,ak,ac,af);this.mode=ag;this.all_slotted=ab;this.feature_mapper=ah;this.has_icons=false;this.incomplete_features=ae;this.seq_data=aj};o(M.prototype,b.prototype);M.prototype.predisplay_actions=function(){var ac=this,ab={};if(ac.mode!=="Pack"){return}$(this.html_elt).hover(function(){this.hovered=true;$(this).mousemove()},function(){this.hovered=false;$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()}).mousemove(function(an){if(!this.hovered){return}var ai=$(this).offset(),am=an.pageX-ai.left,al=an.pageY-ai.top,ar=ac.feature_mapper.get_feature_data(am,al),aj=(ar?ar[0]:null);$(this).parents(".track-content").children(".overlay").children(".feature-popup").each(function(){if(!aj||$(this).attr("id")!==aj.toString()){$(this).remove()}});if(ar){var ae=ab[aj];if(!ae){var ao={name:ar[3],start:ar[1],end:ar[2],strand:ar[4]},ah=ac.track.filters_manager.filters,ag;for(var ak=0;ak<ah.length;ak++){ag=ah[ak];ao[ag.name]=ar[ag.index]}ae=$("<div/>").attr("id",aj).addClass("feature-popup");var at=$("<table/>"),aq,ap,au;for(aq in ao){ap=ao[aq];au=$("<tr/>").appendTo(at);$("<th/>").appendTo(au).text(aq);$("<td/>").attr("align","left").appendTo(au).text(typeof(ap)==="number"?U(ap,2):ap)}ae.append($("<div class='feature-popup-inner'>").append(at));ab[aj]=ae}ae.appendTo($(this).parents(".track-content").children(".overlay"));var af=am+parseInt(ac.html_elt.css("left"),10)-ae.width()/2,ad=al+parseInt(ac.html_elt.css("top"),10)+7;ae.css("left",af+"px").css("top",ad+"px")}else{if(!an.isPropagationStopped()){an.stopPropagation();$(this).siblings().each(function(){$(this).trigger(an)})}}}).mouseleave(function(){$(this).parents(".track-content").children(".overlay").children(".feature-popup").remove()})};var f=function(ac,ab,ad){o(ad,{drag_handle_class:"draghandle"});p.call(this,ac,ab,ad);this.dataset=null;if(ad.dataset){this.dataset=(ad.dataset instanceof Backbone.Model?ad.dataset:new W.Dataset(ad.dataset))}this.dataset_check_type="converted_datasets_state";this.data_url_extra_params={};this.data_query_wait=("data_query_wait" in ad?ad.data_query_wait:I);this.data_manager=("data_manager" in ad?ad.data_manager:new w.GenomeDataManager({dataset:this.dataset,genome:new w.Genome({key:ac.dbkey,chroms_info:{chrom_info:ac.chrom_data}}),data_mode_compatible:this.data_and_mode_compatible,can_subset:this.can_subset}));this.min_height_px=16;this.max_height_px=800;this.visible_height_px=this.config.get_value("height");this.content_div=$("<div class='track-content'>").appendTo(this.container_div);if(this.container){this.container.content_div.append(this.container_div);if(!("resize" in ad)||ad.resize){this.add_resize_handle()}}};o(f.prototype,p.prototype,{action_icons_def:[{name:"mode_icon",title:"Set display mode",css_class:"chevron-expand",on_click_fn:function(){}},p.prototype.action_icons_def[0],{name:"overview_icon",title:"Set as overview",css_class:"application-dock-270",on_click_fn:function(ab){ab.view.set_overview(ab)}},p.prototype.action_icons_def[1],{name:"filters_icon",title:"Filters",css_class:"ui-slider-050",on_click_fn:function(ab){if(ab.filters_manager.visible()){ab.filters_manager.clear_filters()}else{ab.filters_manager.init_filters()}ab.filters_manager.toggle()}},{name:"tools_icon",title:"Tool",css_class:"hammer",on_click_fn:function(ab){ab.tool.toggle();if(ab.tool.is_visible()){ab.set_name(ab.config.get_value("name")+ab.tool_region_and_parameters_str())}else{ab.revert_name()}$(".tooltip").remove()}},{name:"param_space_viz_icon",title:"Tool parameter space visualization",css_class:"arrow-split",on_click_fn:function(ab){var ae='<strong>Tool</strong>: <%= track.tool.get("name") %><br/><strong>Dataset</strong>: <%= track.config.get("name") %><br/><strong>Region(s)</strong>: <select name="regions"><option value="cur">current viewing area</option><option value="bookmarks">bookmarks</option><option value="both">current viewing area and bookmarks</option></select>',ad=aa.template(ae,{track:ab});var ag=function(){Galaxy.modal.hide();$(window).unbind("keypress.check_enter_esc")},ac=function(){var ai=$('select[name="regions"] option:selected').val(),ak,ah=new w.GenomeRegion({chrom:view.chrom,start:view.low,end:view.high}),aj=aa.map($(".bookmark"),function(al){return new w.GenomeRegion({from_str:$(al).children(".position").text()})});if(ai==="cur"){ak=[ah]}else{if(ai==="bookmarks"){ak=aj}else{ak=[ah].concat(aj)}}Galaxy.modal.hide();window.location.href=galaxy_config.root+"visualization/sweepster?"+$.param({dataset_id:ab.dataset.id,hda_ldda:ab.dataset.get("hda_ldda"),regions:JSON.stringify(new Backbone.Collection(ak).toJSON())})},af=function(ah){if((ah.keyCode||ah.which)===27){ag()}else{if((ah.keyCode||ah.which)===13){ac()}}};Galaxy.modal.show({title:"Visualize tool parameter space and output from different parameter settings?",body:ad,buttons:{No:ag,Yes:ac}})}},p.prototype.action_icons_def[2]],can_draw:function(){return this.dataset&&p.prototype.can_draw.call(this)},build_container_div:function(){return $("<div/>").addClass("track").attr("id","track_"+this.id)},build_header_div:function(){var ab=$("<div class='track-header'/>");if(this.view.editor){this.drag_div=$("<div/>").addClass(this.drag_handle_class).appendTo(ab)}this.name_div=$("<div/>").addClass("track-name").appendTo(ab).text(this.config.get_value("name")).attr("id",this.config.get_value("name").replace(/\s+/g,"-").replace(/[^a-zA-Z0-9\-]/g,"").toLowerCase());return ab},set_dataset:function(ab){this.dataset=ab;this.data_manager.set("dataset",ab)},on_resize:function(){this.request_draw({clear_tile_cache:true})},add_resize_handle:function(){var ab=this;var ae=false;var ad=false;var ac=$("<div class='track-resize'>");$(ab.container_div).hover(function(){if(ab.config.get_value("content_visible")){ae=true;ac.show()}},function(){ae=false;if(!ad){ac.hide()}});ac.hide().bind("dragstart",function(af,ag){ad=true;ag.original_height=$(ab.content_div).height()}).bind("drag",function(ag,ah){var af=Math.min(Math.max(ah.original_height+ah.deltaY,ab.min_height_px),ab.max_height_px);$(ab.tiles_div).css("height",af);ab.visible_height_px=(ab.max_height_px===af?0:af);ab.on_resize()}).bind("dragend",function(af,ag){ab.tile_cache.clear();ad=false;if(!ae){ac.hide()}ab.config.set_value("height",ab.visible_height_px);ab.changed()}).appendTo(ab.container_div)},set_display_modes:function(ae,ah){this.display_modes=ae;this.mode=(ah?ah:(this.config&&this.config.get_value("mode")?this.config.get_value("mode"):this.display_modes[0]));this.action_icons.mode_icon.attr("title","Set display mode (now: "+this.mode+")");var ac=this,af={};for(var ad=0,ab=ac.display_modes.length;ad<ab;ad++){var ag=ac.display_modes[ad];af[ag]=function(ai){return function(){ac.change_mode(ai);ac.icons_div.show();ac.container_div.mouseleave(function(){ac.icons_div.hide()})}}(ag)}make_popupmenu(this.action_icons.mode_icon,af)},build_action_icons:function(){p.prototype.build_action_icons.call(this,this.action_icons_def);if(this.display_modes!==undefined){this.set_display_modes(this.display_modes)}},hide_contents:function(){this.tiles_div.hide();this.container_div.find(".yaxislabel, .track-resize").hide()},show_contents:function(){this.tiles_div.show();this.container_div.find(".yaxislabel, .track-resize").show();this.request_draw()},get_type:function(){if(this instanceof V){return"LabelTrack"}else{if(this instanceof B){return"ReferenceTrack"}else{if(this instanceof g){return"LineTrack"}else{if(this instanceof S){return"ReadTrack"}else{if(this instanceof Y){return"VariantTrack"}else{if(this instanceof e){return"CompositeTrack"}else{if(this instanceof c){return"FeatureTrack"}}}}}}}return""},show_message:function(ab){this.tiles_div.remove();return $("<span/>").addClass("message").html(ab).appendTo(this.content_div)},init:function(ad){var ac=this;ac.enabled=false;ac.tile_cache.clear();ac.data_manager.clear();ac.content_div.children().remove();ac.container_div.removeClass("nodata error pending");ac.tiles_div=$("<div/>").addClass("tiles").appendTo(ac.content_div);if(!ac.dataset.id){return}var ab=$.Deferred(),ae={hda_ldda:ac.dataset.get("hda_ldda"),data_type:this.dataset_check_type,chrom:ac.view.chrom,retry:ad};$.getJSON(this.dataset.url(),ae,function(af){if(!af||af==="error"||af.kind==="error"){ac.container_div.addClass("error");var ag=ac.show_message(m);if(af.message){ag.append($("<a href='javascript:void(0);'></a>").text("View error").click(function(){Galaxy.modal.show({title:"Trackster Error",body:"<pre>"+af.message+"</pre>",buttons:{Close:function(){Galaxy.modal.hide()}}})}));ag.append($("<span/>").text(" "));ag.append($("<a href='javascript:void(0);'></a>").text("Try again").click(function(){ac.init(true)}))}}else{if(af==="no converter"){ac.container_div.addClass("error");ac.show_message(H)}else{if(af==="no data"||(af.data!==undefined&&(af.data===null||af.data.length===0))){ac.container_div.addClass("nodata");ac.show_message(E)}else{if(af==="pending"){ac.container_div.addClass("pending");ac.show_message(u);setTimeout(function(){ac.init()},ac.data_query_wait)}else{if(af==="data"||af.status==="data"){if(af.valid_chroms){ac.valid_chroms=af.valid_chroms;ac.update_icons()}ac.tiles_div.text(T);if(ac.view.chrom){ac.tiles_div.text("");ac.tiles_div.css("height",ac.visible_height_px+"px");ac.enabled=true;$.when.apply($,ac.predraw_init()).done(function(){ab.resolve();ac.container_div.removeClass("nodata error pending");ac.request_draw()})}else{ab.resolve()}}}}}}});this.update_icons();return ab},predraw_init:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(ae&&ae.min&&ae.max){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_default_value("min_value",ad);ab.config.set_default_value("max_value",af);ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},get_drawables:function(){return this}});var L=function(ad,ac,af){f.call(this,ad,ac,af);var ab=this;k(ab.container_div,ab.drag_handle_class,".group",ab);this.filters_manager=new h.FiltersManager(this,("filters" in af?af.filters:null));this.data_manager.set("filters_manager",this.filters_manager);this.filters_available=false;this.tool=(af.tool?new q(aa.extend(af.tool,{track:this,tool_state:af.tool_state})):null);this.tile_cache=new w.Cache(O);this.left_offset=0;if(this.header_div){this.set_filters_manager(this.filters_manager);if(this.tool){var ae=new Z({model:this.tool});ae.render();this.dynamic_tool_div=ae.$el;this.header_div.after(this.dynamic_tool_div)}}this.tiles_div=$("<div/>").addClass("tiles").appendTo(this.content_div);if(!this.config.get_value("content_visible")){this.tiles_div.hide()}this.overlay_div=$("<div/>").addClass("overlay").appendTo(this.content_div);if(af.mode){this.change_mode(af.mode)}};o(L.prototype,p.prototype,f.prototype,{action_icons_def:f.prototype.action_icons_def.concat([{name:"show_more_rows_icon",title:"To minimize track height, not all feature rows are displayed. Click to display more rows.",css_class:"exclamation",on_click_fn:function(ab){$(".tooltip").remove();ab.slotters[ab.view.resolution_px_b].max_rows*=2;ab.request_draw({clear_tile_cache:true})},hide:true}]),copy:function(ab){var ac=this.to_dict();o(ac,{data_manager:this.data_manager});var ad=new this.constructor(this.view,ab,ac);ad.change_mode(this.mode);ad.enabled=this.enabled;return ad},set_filters_manager:function(ab){this.filters_manager=ab;this.header_div.after(this.filters_manager.parent_div)},to_dict:function(){return{track_type:this.get_type(),dataset:{id:this.dataset.id,hda_ldda:this.dataset.get("hda_ldda")},prefs:this.config.to_key_value_dict(),mode:this.mode,filters:this.filters_manager.to_dict(),tool_state:(this.tool?this.tool.state_dict():{})}},set_min_max:function(){var ab=this;return $.getJSON(ab.dataset.url(),{data_type:"data",stats:true,chrom:ab.view.chrom,low:0,high:ab.view.max_high,hda_ldda:ab.dataset.get("hda_ldda")},function(ac){var ae=ac.data;if(isNaN(parseFloat(ab.config.get_value("min_value")))||isNaN(parseFloat(ab.config.get_value("max_value")))){var ad=ae.min,af=ae.max;ad=Math.floor(Math.min(0,Math.max(ad,ae.mean-2*ae.sd)));af=Math.ceil(Math.max(0,Math.min(af,ae.mean+2*ae.sd)));ab.config.set_value("min_value",ad);ab.config.set_value("max_value",af)}})},change_mode:function(ac){var ab=this;ab.mode=ac;ab.config.set_value("mode",ac);if(ac==="Auto"){this.data_manager.clear()}ab.request_draw({clear_tile_cache:true});this.action_icons.mode_icon.attr("title","Set display mode (now: "+ab.mode+")");return ab},update_icons:function(){var ab=this;if(ab.filters_available){ab.action_icons.filters_icon.show()}else{ab.action_icons.filters_icon.hide()}if(ab.tool){ab.action_icons.tools_icon.show();ab.action_icons.param_space_viz_icon.show()}else{ab.action_icons.tools_icon.hide();ab.action_icons.param_space_viz_icon.hide()}},_gen_tile_cache_key:function(ac,ab){return ac+"_"+ab},request_draw:function(ab){if(ab&&ab.clear_tile_cache){this.tile_cache.clear()}this.view.request_redraw(ab,this)},before_draw:function(){this.max_height_px=0},_draw:function(ap){if(!this.can_draw()){return}var am=ap&&ap.clear_after,ak=this.view.low,af=this.view.high,ai=af-ak,ac=this.view.container.width(),ao=this.view.resolution_px_b,ae=1/ao;if(this.is_overview){ak=this.view.max_low;af=this.view.max_high;ao=ac/(view.max_high-view.max_low);ae=1/ao}this.before_draw();this.tiles_div.children().addClass("remove");var ab=Math.floor(ak/(ae*Q)),aj,al,ag,ah=[],an=[];while((ab*Q*ae)<af){aj=Math.floor(ab*Q*ae);al=new w.GenomeRegion({chrom:this.view.chrom,start:aj,end:Math.min(aj+Math.ceil(Q*ae),this.view.max_high)});ag=this.draw_helper(al,ao,ap);ah.push(ag);$.when(ag).then(function(aq){an.push(aq)});ab+=1}if(!am){this.tiles_div.children(".remove").removeClass("remove").remove()}var ad=this;$.when.apply($,ah).then(function(){ad.tiles_div.children(".remove").remove();an=aa.filter(an,function(aq){return aq!==null});if(an.length!==0){ad.postdraw_actions(an,ac,ao,am)}})},_add_yaxis_label:function(ae,ag){var ac=this,af=(ae==="max"?"top":"bottom"),ah=(ae==="max"?"max":"min"),ab=(ae==="max"?"max_value":"min_value"),ad=this.container_div.find(".yaxislabel."+af);ag=ag||function(){ac.request_draw({clear_tile_cache:true})};if(ad.length!==0){ad.text(ac.config.get_value(ab))}else{ad=$("<div/>").text(ac.config.get_value(ab)).make_text_editable({num_cols:12,on_finish:function(ai){$(".tooltip").remove();ac.config.set_value(ab,ai);ag()},help_text:"Set "+ah+" value"}).addClass("yaxislabel "+af).css("color",this.config.get_value("label_color"));this.container_div.prepend(ad)}},postdraw_actions:function(ae,af,ah,ab){var ad=aa.filter(ae,function(ai){return(ai instanceof K)});if(ad.length>0){this.max_height_px=0;var ac=this;aa.each(ae,function(ai){if(!(ai instanceof K)){ai.html_elt.remove();ac.draw_helper(ai.region,ah,{force:true,mode:"Coverage"})}});ac._add_yaxis_label("max")}else{this.container_div.find(".yaxislabel").remove();var ag=aa.find(ae,function(ai){return ai.has_icons});if(ag){aa.each(ae,function(ai){if(!ai.has_icons){ai.html_elt.css("padding-top",D)}})}}},get_mode:function(ab){return this.mode},update_auto_mode:function(ab){},_get_drawables:function(){return[this]},draw_helper:function(ak,am,an){if(!an){an={}}var ac=an.force,ah=an.mode||this.mode,ae=1/am,ad=this,af=this._get_drawables(),al=this._gen_tile_cache_key(am,ak),ag=function(ao){return(ao&&"track" in ao)};var ai=(ac?undefined:ad.tile_cache.get_elt(al));if(ai){if(ag(ai)){ad.show_tile(ai,am)}return ai}if(an.data_fetch===false){return null}var aj=function(){var ao=(aa.find(A,function(aq){return aq===ah})?"Coverage":ah);var ap=aa.map(af,function(aq){return aq.data_manager.get_data(ak,ao,ae,ad.data_url_extra_params)});if(view.reference_track){ap.push(view.reference_track.data_manager.get_data(ak,ah,ae,view.reference_track.data_url_extra_params))}return ap};var ab=$.Deferred();ad.tile_cache.set_elt(al,ab);$.when.apply($,aj()).then(function(){var ao=aj(),au=ao,aA;if(aa.find(ao,function(aC){return j.is_deferred(aC)})){ad.tile_cache.set_elt(al,undefined);$.when(ad.draw_helper(ak,am,an)).then(function(aC){ab.resolve(aC)});return}if(view.reference_track){aA=view.reference_track.data_manager.subset_entry(ao.pop(),ak)}var av=[],ar=[];aa.each(af,function(aF,aC){var aE=aF.mode,aD=au[aC];if(aE==="Auto"){aE=aF.get_mode(aD);aF.update_auto_mode(aE)}av.push(aE);ar.push(aF.get_canvas_height(aD,aE,am,ap))});var at=ad.view.canvas_manager.new_canvas(),aw=ak.get("start"),aB=ak.get("end"),aq=0,ap=Math.ceil((aB-aw)*am)+ad.left_offset,ay=aa.max(ar),ax;at.width=ap;at.height=(an.height||ay);var az=at.getContext("2d");az.translate(ad.left_offset,0);if(af.length>1){az.globalAlpha=0.5;az.globalCompositeOperation="source-over"}aa.each(af,function(aD,aC){ax=aD.draw_tile(au[aC],az,av[aC],ak,am,aA)});if(ax!==undefined){ad.tile_cache.set_elt(al,ax);ad.show_tile(ax,am)}ab.resolve(ax)});return ab},get_canvas_height:function(ab,ad,ae,ac){return this.visible_height_px},_draw_line_track_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.LinePainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new K(this,af,ah,ae,ab.data)},draw_tile:function(ab,ac,af,ae,ag,ad){},show_tile:function(ad,ag){var ac=this,ab=ad.html_elt;ad.predisplay_actions();var af=(ad.low-(this.is_overview?this.view.max_low:this.view.low))*ag;if(this.left_offset){af-=this.left_offset}ab.css("left",af);if(ab.hasClass("remove")){ab.removeClass("remove")}else{this.tiles_div.append(ab)}ab.css("height","auto");this.max_height_px=Math.max(this.max_height_px,ab.height()-2);ab.parent().children().css("height",this.max_height_px+"px");var ae=this.max_height_px;if(this.visible_height_px!==0){ae=Math.min(this.max_height_px,this.visible_height_px)}this.tiles_div.css("height",ae+"px")},tool_region_and_parameters_str:function(ae){var ab=this,ad=(ae!==undefined?ae.toString():"all"),ac=aa.values(ab.tool.get_inputs_dict()).join(", ");return" - region=["+ad+"], parameters=["+ac+"]"},data_and_mode_compatible:function(ab,ac){if(ac==="Auto"){return true}else{if(ac==="Coverage"){return ab.dataset_type==="bigwig"}else{if(ab.dataset_type==="bigwig"||ab.extra_info==="no_detail"){return false}else{return true}}}},can_subset:function(ab){if(ab.message||ab.extra_info==="no_detail"){return false}else{if(ab.dataset_type==="bigwig"){return(ab.data[1][0]-ab.data[0][0]===1)}}return true},init_for_tool_data:function(){this.data_manager.set("data_type","raw_data");this.data_query_wait=1000;this.dataset_check_type="state"}});var V=function(ac,ab){var ad={resize:false};f.call(this,ac,ab,ad);this.container_div.addClass("label-track")};o(V.prototype,f.prototype,{build_header_div:function(){},init:function(){this.enabled=true},predraw_init:function(){},_draw:function(af){var ad=this.view,ae=ad.high-ad.low,ai=Math.floor(Math.pow(10,Math.floor(Math.log(ae)/Math.log(10)))),ab=Math.floor(ad.low/ai)*ai,ag=this.view.container.width(),ac=$("<div/>").addClass("label-container");while(ab<ad.high){var ah=(ab-ad.low)/ae*ag;ac.append($("<div/>").addClass("label").text(commatize(ab)).css({left:ah}));ab+=ai}this.content_div.children(":first").remove();this.content_div.append(ac)}});var e=function(ac,ab,af){L.call(this,ac,ab,af);this.drawables=[];if("drawables" in af){var ae;for(var ad=0;ad<af.drawables.length;ad++){ae=af.drawables[ad];this.drawables[ad]=n(ae,ac,null);if(ae.left_offset>this.left_offset){this.left_offset=ae.left_offset}}this.enabled=true}aa.each(this.drawables,function(ag){if(ag instanceof c||ag instanceof S){ag.change_mode("Coverage")}});this.update_icons();this.obj_type="CompositeTrack"};o(e.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),action_icons_def:[{name:"composite_icon",title:"Show individual tracks",css_class:"layers-stack",on_click_fn:function(ab){$(".tooltip").remove();ab.show_group()}}].concat(L.prototype.action_icons_def),to_dict:y.prototype.to_dict,add_drawable:y.prototype.add_drawable,unpack_drawables:y.prototype.unpack_drawables,config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},on_resize:function(){var ab=this.visible_height_px;aa.each(this.drawables,function(ac){ac.visible_height_px=ab});f.prototype.on_resize.call(this)},change_mode:function(ab){L.prototype.change_mode.call(this,ab);for(var ac=0;ac<this.drawables.length;ac++){this.drawables[ac].change_mode(ab)}},init:function(){var ad=[];for(var ac=0;ac<this.drawables.length;ac++){ad.push(this.drawables[ac].init())}var ab=this;$.when.apply($,ad).then(function(){ab.enabled=true;ab.request_draw()})},update_icons:function(){this.action_icons.filters_icon.hide();this.action_icons.tools_icon.hide();this.action_icons.param_space_viz_icon.hide()},can_draw:p.prototype.can_draw,_get_drawables:function(){return this.drawables},show_group:function(){var ae=new N(this.view,this.container,{name:this.config.get_value("name")}),ab;for(var ad=0;ad<this.drawables.length;ad++){ab=this.drawables[ad];ab.update_icons();ae.add_drawable(ab);ab.container=ae;ae.content_div.append(ab.container_div)}var ac=this.container.replace_drawable(this,ae,true);ae.request_draw({clear_tile_cache:true})},before_draw:function(){var ac=aa.min(aa.map(this.drawables,function(ad){return ad.config.get_value("min_value")})),ab=aa.max(aa.map(this.drawables,function(ad){return ad.config.get_value("max_value")}));this.config.set_value("min_value",ac);this.config.set_value("max_value",ab);aa.each(this.drawables,function(ad){ad.config.set_value("min_value",ac);ad.config.set_value("max_value",ab)})},update_all_min_max:function(){var ac=this,ab=this.config.get_value("min_value"),ad=this.config.get_value("max_value");aa.each(this.drawables,function(ae){ae.config.set_value("min_value",ab);ae.config.set_value("max_value",ad)});this.request_draw({clear_tile_cache:true})},postdraw_actions:function(ah,ab,ak,ag){var af=-1,ad;for(ad=0;ad<ah.length;ad++){var ai=ah[ad].html_elt.find("canvas").height();if(ai>af){af=ai}}for(ad=0;ad<ah.length;ad++){var ae=ah[ad];if(ae.html_elt.find("canvas").height()!==af){this.draw_helper(ae.region,ak,{force:true,height:af});ae.html_elt.remove()}}var ac=this,aj=function(){ac.update_all_min_max()};this._add_yaxis_label("min",aj);this._add_yaxis_label("max",aj)}});var B=function(ab){L.call(this,ab,{content_div:ab.top_labeltrack},{resize:false});this.left_offset=ab.canvas_manager.char_width_px;this.container_div.addClass("reference-track");this.data_url=galaxy_config.root+"api/genomes/"+this.view.dbkey;this.data_url_extra_params={reference:true};this.data_manager=new w.GenomeReferenceDataManager({data_url:this.data_url,can_subset:this.can_subset});this.hide_contents()};o(B.prototype,p.prototype,L.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"height",type:"int",default_value:13,hidden:true}]),build_header_div:function(){},init:function(){this.data_manager.clear();this.enabled=true},predraw_init:function(){},can_draw:p.prototype.can_draw,draw_helper:function(ac,ad,ab){if(ad>this.view.canvas_manager.char_width_px){this.tiles_div.show();return L.prototype.draw_helper.call(this,ac,ad,ab)}else{this.tiles_div.hide();return null}},can_subset:function(ab){return true},draw_tile:function(ad,aj,ae,ag,ak){var ac=this.data_manager.subset_entry(ad,ag),ai=ac.data;var ab=aj.canvas;aj.font=aj.canvas.manager.default_font;aj.textAlign="center";for(var af=0,ah=ai.length;af<ah;af++){aj.fillStyle=this.view.get_base_color(ai[af]);aj.fillText(ai[af],Math.floor(af*ak),10)}return new b(this,ag,ak,ab,ac)}});var g=function(ac,ab,ad){this.mode="Histogram";L.call(this,ac,ab,ad)};o(g.prototype,p.prototype,L.prototype,{display_modes:A,config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Color",type:"color"},{key:"min_value",label:"Min Value",type:"float",default_value:undefined},{key:"max_value",label:"Max Value",type:"float",default_value:undefined},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:30,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},before_draw:function(){},draw_tile:function(ab,ac,ae,ad,af){return this._draw_line_track_tile(ab,ac,ae,ad,af)},can_subset:function(ab){return(ab.data[1][0]-ab.data[0][0]===1)},postdraw_actions:function(ac,ad,ae,ab){this._add_yaxis_label("max");this._add_yaxis_label("min")}});var r=function(ac,ab,ad){this.mode="Heatmap";L.call(this,ac,ab,ad)};o(r.prototype,p.prototype,L.prototype,{display_modes:["Heatmap"],config_params:aa.union(p.prototype.config_params,[{key:"pos_color",label:"Positive Color",type:"color",default_value:"#FF8C00"},{key:"neg_color",label:"Negative Color",type:"color",default_value:"#4169E1"},{key:"min_value",label:"Min Value",type:"float",default_value:-1},{key:"max_value",label:"Max Value",type:"float",default_value:1},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:500,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ad,ag,af,ah){var ae=ad.canvas,ac=new J.DiagonalHeatmapPainter(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag);ac.draw(ad,ae.width,ae.height,ah);return new b(this,af,ah,ae,ab.data)}});var c=function(ac,ab,ad){L.call(this,ac,ab,ad);this.container_div.addClass("feature-track");this.summary_draw_height=30;this.slotters={};this.start_end_dct={};this.left_offset=200;this.set_painter_from_config()};o(c.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block color",type:"color"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true,help:"Show the number of items in each bin when drawing summary histogram"},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"connector_style",label:"Connector style",type:"select",default_value:"fishbones",options:[{label:"Line with arrows",value:"fishbone"},{label:"Arcs",value:"arcs"}]},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.set_painter_from_config();this.request_draw({clear_tile_cache:true})},set_painter_from_config:function(){if(this.config.get_value("connector_style")==="arcs"){this.painter=J.ArcLinkedFeaturePainter}else{this.painter=J.LinkedFeaturePainter}},postdraw_actions:function(am,ae,ao,al){L.prototype.postdraw_actions.call(this,am,ae,ao,al);var ag=this,ah;var ab={};aa.each(aa.pluck(am,"incomplete_features"),function(ap){aa.each(ap,function(aq){ab[aq[0]]=aq})});var an=this;aa.each(am,function(ap){an.draw_tile({data:aa.values(ab)},ap.canvas.getContext("2d"),ap.mode,ap.region,ao,ap.seq_data,true)});if(ag.filters_manager){var af=ag.filters_manager.filters,aj;for(aj=0;aj<af.length;aj++){af[aj].update_ui_elt()}var ai=false,ak,ad;for(ah=0;ah<am.length;ah++){if(am[ah].data.length){ak=am[ah].data[0];for(aj=0;aj<af.length;aj++){ad=af[aj];if(ad.applies_to(ak)&&ad.min!==ad.max){ai=true;break}}}}if(ag.filters_available!==ai){ag.filters_available=ai;if(!ag.filters_available){ag.filters_manager.hide()}ag.update_icons()}}if(am[0] instanceof M){var ac=true;for(ah=0;ah<am.length;ah++){if(!am[ah].all_slotted){ac=false;break}}if(!ac){this.action_icons.show_more_rows_icon.show()}else{this.action_icons.show_more_rows_icon.hide()}}else{this.action_icons.show_more_rows_icon.hide()}},update_auto_mode:function(ab){if(this.mode==="Auto"){if(ab==="no_detail"){ab="feature spans"}this.action_icons.mode_icon.attr("title","Set display mode (now: Auto/"+ab+")")}},incremental_slots:function(af,ab,ae){var ac=this.view.canvas_manager.dummy_context,ad=this.slotters[af];if(!ad||(ad.mode!==ae)){ad=new (s.FeatureSlotter)(af,ae,z,function(ag){return ac.measureText(ag)});this.slotters[af]=ad}return ad.slot_features(ab)},get_mode:function(ab){if(ab.extra_info==="no_detail"||this.is_overview){mode="no_detail"}else{if(this.view.high-this.view.low>G){mode="Squish"}else{mode="Pack"}}return mode},get_canvas_height:function(ab,af,ag,ac){if(af==="Coverage"||ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ae=this.incremental_slots(ag,ab.data,af);var ad=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return Math.max(this.min_height_px,ad.get_required_height(ae,ac))}},draw_tile:function(am,ar,ap,af,aj,ae,an){var aq=this,ad=ar.canvas,ay=af.get("start"),ac=af.get("end"),ag=this.left_offset;if(am.dataset_type==="bigwig"){return this._draw_line_track_tile(am,ar,ap,af,aj)}var ai=[],ao=this.slotters[aj].slots;all_slotted=true;if(am.data){var ak=this.filters_manager.filters;for(var at=0,av=am.data.length;at<av;at++){var ah=am.data[at];var au=false;var al;for(var ax=0,aC=ak.length;ax<aC;ax++){al=ak[ax];al.update_attrs(ah);if(!al.keep(ah)){au=true;break}}if(!au){ai.push(ah);if(!(ah[0] in ao)){all_slotted=false}}}}var aB=(this.filters_manager.alpha_filter?new C(this.filters_manager.alpha_filter):null),az=(this.filters_manager.height_filter?new C(this.filters_manager.height_filter):null),aA=new (this.painter)(ai,ay,ac,this.config.to_key_value_dict(),ap,aB,az,ae,function(aD){return aq.view.get_base_color(aD)});var aw=null;ar.fillStyle=this.config.get_value("block_color");ar.font=ar.canvas.manager.default_font;ar.textAlign="right";if(am.data){var ab=aA.draw(ar,ad.width,ad.height,aj,ao);aw=ab.feature_mapper;incomplete_features=ab.incomplete_features;aw.translation=-ag}if(!an){return new M(aq,af,aj,ad,am.data,ap,am.message,all_slotted,aw,incomplete_features,ae)}}});var Y=function(ac,ab,ad){L.call(this,ac,ab,ad);this.painter=J.VariantPainter;this.summary_draw_height=30;this.left_offset=30};o(Y.prototype,p.prototype,L.prototype,{display_modes:["Auto","Coverage","Dense","Squish","Pack"],config_params:aa.union(p.prototype.config_params,[{key:"color",label:"Histogram color",type:"color"},{key:"show_sample_data",label:"Show sample data",type:"bool",default_value:true},{key:"show_labels",label:"Show summary and sample labels",type:"bool",default_value:true},{key:"summary_height",label:"Locus summary height",type:"float",default_value:20},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})},draw_tile:function(ab,ae,ag,af,ah){if(ab.dataset_type==="bigwig"){return this._draw_line_track_tile(ab,ae,"Histogram",af,ah)}else{var ad=this.view,ac=new (this.painter)(ab.data,af.get("start"),af.get("end"),this.config.to_key_value_dict(),ag,function(ai){return ad.get_base_color(ai)});ac.draw(ae,ae.canvas.width,ae.canvas.height,ah);return new b(this,af,ah,ae.canvas,ab.data)}},get_canvas_height:function(ab,af,ag,ad){if(ab.dataset_type==="bigwig"){return this.summary_draw_height}else{var ac=(this.dataset.get_metadata("sample_names")?this.dataset.get_metadata("sample_names").length:0);if(ac===0&&ab.data.length!==0){ac=ab.data[0][7].match(/,/g);if(ac===null){ac=1}else{ac=ac.length+1}}var ae=new (this.painter)(null,null,null,this.config.to_key_value_dict(),af);return ae.get_required_height(ac)}},predraw_init:function(){var ab=[f.prototype.predraw_init.call(this)];if(!this.dataset.get_metadata("sample_names")){ab.push(this.dataset.fetch())}return ab},postdraw_actions:function(af,ag,ai,ac){L.prototype.postdraw_actions.call(this,af,ag,ai,ac);var ae=aa.filter(af,function(aj){return(aj instanceof K)});var ad=this.dataset.get_metadata("sample_names");if(ae.length===0&&this.config.get_value("show_labels")&&ad&&ad.length>1){var ab;if(this.container_div.find(".yaxislabel.variant").length===0){ab=this.config.get_value("summary_height")/2;this.tiles_div.prepend($("<div/>").text("Summary").addClass("yaxislabel variant top").css({"font-size":ab+"px",top:(this.config.get_value("summary_height")-ab)/2+"px"}));if(this.config.get_value("show_sample_data")){var ah=ad.join("<br/>");this.tiles_div.prepend($("<div/>").html(ah).addClass("yaxislabel variant top sample").css({top:this.config.get_value("summary_height")}))}}ab=(this.mode==="Squish"?5:10)+"px";$(this.tiles_div).find(".sample").css({"font-size":ab,"line-height":ab});$(this.tiles_div).find(".yaxislabel").css("color",this.config.get_value("label_color"))}else{this.container_div.find(".yaxislabel.variant").remove()}}});var S=function(ac,ab,ad){c.call(this,ac,ab,ad);this.painter=J.ReadPainter;this.update_icons()};o(S.prototype,p.prototype,L.prototype,c.prototype,{config_params:aa.union(p.prototype.config_params,[{key:"block_color",label:"Block and sense strand color",type:"color",default_value:"#DDDDDD"},{key:"reverse_strand_color",label:"Antisense strand color",type:"color",default_value:"#AAAAAA"},{key:"label_color",label:"Label color",type:"color",default_value:"black"},{key:"show_insertions",label:"Show insertions",type:"bool",default_value:false},{key:"show_differences",label:"Show differences only",type:"bool",default_value:true},{key:"show_counts",label:"Show summary counts",type:"bool",default_value:true},{key:"mode",type:"string",default_value:this.mode,hidden:true},{key:"min_value",label:"Histogram minimum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"max_value",label:"Histogram maximum",type:"float",default_value:null,help:"clear value to set automatically"},{key:"height",type:"int",default_value:0,hidden:true}]),config_onchange:function(){this.set_name(this.config.get_value("name"));this.request_draw({clear_tile_cache:true})}});var d={CompositeTrack:e,DrawableGroup:N,DiagonalHeatmapTrack:r,FeatureTrack:c,LineTrack:g,ReadTrack:S,VariantTrack:Y,VcfTrack:Y};var n=function(ad,ac,ab){if("copy" in ad){return ad.copy(ab)}else{var ae=ad.obj_type;if(!ae){ae=ad.track_type}return new d[ae](ac,ab,ad)}};return{TracksterView:X,DrawableGroup:N,LineTrack:g,FeatureTrack:c,DiagonalHeatmapTrack:r,ReadTrack:S,VariantTrack:Y,CompositeTrack:e,object_from_template:n}});
\ No newline at end of file
diff -r ea1fbe9d5bdb9435830c3f2d2dbc623a22d4b1a4 -r 9fcd372f9fdbe8d6afa4aecd3d7f4f1ac2009ec8 static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -692,14 +692,16 @@
this.action_icons.filters_icon.hide();
}
else { // There are 2 or more tracks.
+
//
// Determine if a composite track can be created. Current criteria:
- // (a) all tracks are the same;
+ // (a) all tracks are line tracks;
// OR
+ // FIXME: this is not enabled right now because it has not been well tested:
// (b) there is a single FeatureTrack.
//
- /// All tracks the same?
+ // All tracks the same?
var i, j, drawable,
same_type = true,
a_type = this.drawables[0].get_type(),
@@ -715,14 +717,14 @@
}
}
- if (same_type || num_feature_tracks === 1) {
+ if (same_type && this.drawables[0] instanceof LineTrack) {
this.action_icons.composite_icon.show();
}
else {
this.action_icons.composite_icon.hide();
$(".tooltip").remove();
}
-
+
//
// Set up group-level filtering and update filter icon.
//
@@ -2365,7 +2367,7 @@
track.tile_cache.clear();
in_drag = false;
if (!in_handle) { drag_control.hide(); }
- track.config.set('height', track.visible_height_px);
+ track.config.set_value('height', track.visible_height_px);
track.changed();
}).appendTo(track.container_div);
},
@@ -3433,6 +3435,18 @@
},
/**
+ * Action to take during resize.
+ */
+ on_resize: function() {
+ // Propogate visible height to other tracks.
+ var visible_height = this.visible_height_px;
+ _.each(this.drawables, function(d) {
+ d.visible_height_px = visible_height;
+ });
+ Track.prototype.on_resize.call(this);
+ },
+
+ /**
* Change mode for all tracks.
*/
change_mode: function(new_mode) {
@@ -3499,7 +3513,8 @@
* Actions taken before drawing.
*/
before_draw: function() {
- TiledTrack.prototype.before_draw.call(this);
+ // FIXME: this is needed only if there are feature tracks in the composite track.
+ // TiledTrack.prototype.before_draw.call(this);
//
// Set min, max for tracks to be largest min, max.
@@ -3507,7 +3522,7 @@
// Get smallest min, biggest max.
var min = _.min(_.map(this.drawables, function(d) { return d.config.get_value('min_value'); })),
- max = _.max(_.map(this.drawables, function(d) { return d.config.get_value('max_value') }));
+ max = _.max(_.map(this.drawables, function(d) { return d.config.get_value('max_value'); }));
this.config.set_value('min_value', min);
this.config.set_value('max_value', max);
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: natefoo: Open next-stable branch.
by commits-noreply@bitbucket.org 03 Apr '14
by commits-noreply@bitbucket.org 03 Apr '14
03 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/089d1264d719/
Changeset: 089d1264d719
Branch: next-stable
User: natefoo
Date: 2014-04-03 18:02:24
Summary: Open next-stable branch.
Affected #: 772 files
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -77,6 +77,7 @@
tool-data/shared/ucsc/builds.txt
tool-data/shared/ensembl/builds.txt
tool-data/shared/ucsc/publicbuilds.txt
+tool-data/shared/ucsc/ucsc_build_sites.txt
tool-data/*.loc
tool-data/genome/*
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -5,3 +5,4 @@
524f246ca85395082719ae7a6ff72260d7ad5612 release_2013.06.03
1ae95b3aa98d1ccf15b243ac3ce6a895eb7efc53 release_2013.08.12
26f58e05aa1068761660681583821e21e6cbf7ab release_2013.11.04
+5e605ed6069fe4c5ca9875e95e91b2713499e8ca release_2014.02.10
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 README.txt
--- a/README.txt
+++ b/README.txt
@@ -26,6 +26,6 @@
on adding tools can be found on the Galaxy website (linked above).
Not all dependencies are included for the tools provided in the sample
-tool_conf.xml. A full list of external dependencies is available at:
+tool_conf.xml. A full list of external dependencies is available at:
-http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Dependencies
+https://wiki.galaxyproject.org/Admin/Tools/ToolDependencies
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/additional_template_paths.xml
--- /dev/null
+++ b/config/plugins/visualizations/additional_template_paths.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- these relative paths can contain common templates importable by all visualization plugins -->
+<paths>
+ <path>common/templates</path>
+</paths>
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/Gruntfile.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/Gruntfile.js
@@ -0,0 +1,24 @@
+// NOTE: use 'sudo npm install .', then 'grunt' to use this file
+module.exports = function(grunt) {
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ requirejs: {
+ compile: {
+ options: {
+ baseUrl : "../../../../static/scripts/",
+ paths : {
+ "plugin": "../../config/plugins/visualizations/charts/static"
+ },
+ shim : {
+ "libs/underscore": { exports: "_" },
+ "libs/backbone/backbone": { exports: "Backbone" }
+ },
+ name : "plugin/app",
+ out : "static/build-app.js",
+ }
+ }
+ }
+ });
+ grunt.loadNpmTasks('grunt-contrib-requirejs');
+ grunt.registerTask( 'default', [ 'requirejs' ]);
+};
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/config/charts.xml
--- a/config/plugins/visualizations/charts/config/charts.xml
+++ b/config/plugins/visualizations/charts/config/charts.xml
@@ -7,15 +7,9 @@
<test type="isinstance" test_attr="datatype" result_type="datatype">tabular.Tabular</test><to_param param_attr="id">dataset_id</to_param></data_source>
- <data_source>
- <model_class>Visualization</model_class>
- <test test_attr="type">charts</test>
- <to_param param_attr="id">visualization_id</to_param>
- </data_source></data_sources><params><param type="dataset" var_name_in_template="hda" required="true">dataset_id</param>
- <param type="visualization" var_name_in_template="visualization">visualization_id</param></params><template>charts.mako</template></visualization>
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/package.json
--- /dev/null
+++ b/config/plugins/visualizations/charts/package.json
@@ -0,0 +1,18 @@
+{
+ "name": "galaxy-charts",
+ "version": "0.0.0",
+ "description": "Charts visualization plugin for the Galaxy informatics framework",
+ "main": " ",
+ "keywords": [
+ "galaxy",
+ "visualization",
+ "d3"
+ ],
+ "author": "Aysam Guerler",
+ "license": "BSD",
+ "devDependencies": {
+ "grunt": "~0.4.1",
+ "grunt-cli": "~0.1.9",
+ "grunt-contrib-requirejs": "~0.4.3"
+ }
+}
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -1,10 +1,12 @@
// dependencies
-define(['library/portlet', 'library/ui', 'library/utils',
- 'views/charts', 'views/viewport', 'views/chart', 'views/group',
- 'models/config', 'models/datasets', 'models/chart', 'models/charts', 'models/group', 'models/types'],
- function( Portlet, Ui, Utils,
- ChartsView, ViewportView, ChartView, GroupView,
- Config, Datasets, Chart, Charts, Group, Types
+define(['mvc/ui/ui-modal', 'mvc/ui/ui-portlet', 'plugin/library/ui', 'utils/utils',
+ 'plugin/library/jobs', 'plugin/library/datasets', 'plugin/library/storage',
+ 'plugin/views/viewer', 'plugin/views/editor',
+ 'plugin/models/config', 'plugin/models/chart',
+ 'plugin/charts/types'],
+ function( Modal, Portlet, Ui, Utils, Jobs, Datasets, Storage,
+ ViewerView, EditorView,
+ Config, Chart, Types
) {
// widget
@@ -13,66 +15,75 @@
// initialize
initialize: function(options)
{
+ // deactivate all debugs outputs
+ //window.console.debug = function() {};
+
// link options
this.options = options;
- // link galaxy
- this.modal = parent.Galaxy.modal;
+ // link galaxy modal or create one
+ if (Galaxy && Galaxy.modal) {
+ this.modal = Galaxy.modal;
+ } else {
+ this.modal = new Modal.View();
+ }
- // create configuration model
+ //
+ // models
+ //
this.config = new Config();
-
- // create chart models
this.types = new Types();
this.chart = new Chart();
- this.charts = new Charts();
- this.group = new Group();
- // create dataset handler
+ //
+ // libraries
+ //
+ this.jobs = new Jobs(this);
this.datasets = new Datasets(this);
+ this.storage = new Storage(this);
- // create views
- this.charts_view = new ChartsView(this);
- this.group_view = new GroupView(this);
- this.chart_view = new ChartView(this);
- this.viewport_view = new ViewportView(this);
-
- // append view port to charts viewer
- this.charts_view.append(this.viewport_view.$el);
-
- // create portlet
- if (!this.options.config.widget) {
- this.portlet = new Portlet({icon : 'fa-bar-chart-o', label : 'Charts'});
- } else {
- this.portlet = $('<div></div>');
- }
+ //
+ // views
+ //
+ this.viewer_view = new ViewerView(this);
+ this.editor_view = new EditorView(this);
// append views
- this.portlet.append(this.charts_view.$el);
- this.portlet.append(this.group_view.$el);
- this.portlet.append(this.chart_view.$el);
-
- // set element
- if (!this.options.config.widget) {
- this.setElement(this.portlet.$el);
+ this.$el.append(this.viewer_view.$el);
+ this.$el.append(this.editor_view.$el);
+
+ // pick start screen
+ if (!this.storage.load()) {
+ // show editor
+ this.go('editor');
} else {
- this.setElement(this.portlet);
+ // show viewport
+ this.go('viewer');
+
+ // draw chart
+ var self = this;
+ this.chart.deferred.execute(function() {
+ self.chart.trigger('redraw');
+ });
}
-
- // hide views
- this.group_view.$el.hide();
- this.charts_view.$el.hide();
-
- // events
- var self = this;
- this.config.on('change:current_view', function() {
- self._showCurrent();
- });
},
- // current view
- _showCurrent: function() {
+ // loads a view and makes sure that all others are hidden
+ go: function(view_id) {
+ // hide all tooltips
+ $('.tooltip').hide();
+ // pick view
+ switch (view_id) {
+ case 'editor' :
+ this.editor_view.show();
+ this.viewer_view.hide();
+ break;
+ case 'viewer' :
+ this.editor_view.hide();
+ this.viewer_view.show();
+ break;
+ }
},
// execute command
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/build-app.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/build-app.js
@@ -0,0 +1,6 @@
+// Underscore.js 1.4.4
+// http://underscorejs.org
+// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
+// Underscore may be freely distributed under the MIT license.
+
+(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t==null?x.identity:t);return T(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};x.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)})},x.countBy=function(e,t,n){return L(e,t,n,function(e,t){x.has(e,t)||(e[t]=0),e[t]++})},x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return T(e,function(e){x.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(a.apply(r,arguments))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=x.pluck(e,""+r);return n},x.unzip=function(e){var t=[];return x.each(e,function(e,n){x.each(e,function(e,r){t.length<=r&&(t[r]=[]),t[r][n]=e})}),t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(e.bind===S&&S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o,u=0,a=function(){u=new Date,s=null,o=e.apply(r,i)};return function(){var f=new Date;!u&&n===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(s),s=null,u=f,o=e.apply(r,i)):s||(s=setTimeout(a,l)),o}},x.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this),define("libs/underscore",function(e){return function(){var t,n;return t||e._}}(this)),define("utils/utils",["libs/underscore"],function(e){function t(e,t,r){n("GET",e,{},t,r)}function n(e,t,n,r,i){if(e=="GET"||e=="DELETE")t.indexOf("?")==-1?t+="?":t+="&",t+=$.param(n);var s=new XMLHttpRequest;s.open(e,t,!0),s.setRequestHeader("Accept","application/json"),s.setRequestHeader("Cache-Control","no-cache"),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-Type","application/json"),s.onloadend=function(){var e=s.status;try{response=jQuery.parseJSON(s.responseText)}catch(t){response=s.responseText}e==200?r&&r(response):i&&i(response)},e=="GET"||e=="DELETE"?s.send():s.send(JSON.stringify(n))}function r(e,t){var n=$('<div class="'+e+'"></div>');n.appendTo(":eq(0)");var r=n.css(t);return n.remove(),r}function i(e){$('link[href^="'+e+'"]').length||$('<link href="'+galaxy_config.root+e+'" rel="stylesheet">').appendTo("head")}function s(t,n){return t?e.defaults(t,n):n}function o(e,t){var n="";if(e>=1e11)e/=1e11,n="TB";else if(e>=1e8)e/=1e8,n="GB";else if(e>=1e5)e/=1e5,n="MB";else if(e>=100)e/=100,n="KB";else{if(!(e>0))return"<strong>-</strong>";e*=10,n="b"}var r=Math.round(e)/10;return t?r+" "+n:"<strong>"+r+"</strong> "+n}function u(){return(new Date).getTime().toString(36)}function a(e){var t=$("<p></p>");return t.append(e),t}function f(){var e=new Date,t=(e.getHours()<10?"0":"")+e.getHours(),n=(e.getMinutes()<10?"0":"")+e.getMinutes(),r=e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+", "+t+":"+n;return r}return{cssLoadFile:i,cssGetAttribute:r,get:t,merge:s,bytesToString:o,uuid:u,time:f,wrap:a,request:n}}),define("mvc/ui/ui-modal",["utils/utils"],function(e){var t=Backbone.View.extend({elMain:"body",optionsDefault:{title:"ui-modal",body:"",backdrop:!0,height:null,width:null,closing_events:!1},buttonList:{},initialize:function(e){e&&this._create(e)},show:function(e){this.initialize(e),this.options.height?(this.$body.css("height",this.options.height),this.$body.css("overflow","hidden")):this.$body.css("max-height",$(window).height()/2),this.options.width&&this.$dialog.css("width",this.options.width),this.visible?this.$el.show():this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.visible=!1,this.$el.fadeOut("fast")},enableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!1)},disableButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).prop("disabled",!0)},showButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).show()},hideButton:function(e){var t=this.buttonList[e];this.$buttons.find("#"+t).hide()},getButton:function(e){var t=this.buttonList[e];return this.$buttons.find("#"+t)},scrollTop:function(){return this.$body.scrollTop()},_create:function(e){var t=this;this.options=_.defaults(e,this.optionsDefault),this.options.body=="progress"&&(this.options.body=$('<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%"></div></div>')),this.$el&&(this.$el.remove(),$(document).off("keyup.ui-modal")),this.setElement(this._template(this.options.title)),this.$dialog=this.$el.find(".modal-dialog"),this.$body=this.$el.find(".modal-body"),this.$footer=this.$el.find(".modal-footer"),this.$buttons=this.$el.find(".buttons"),this.$backdrop=this.$el.find(".modal-backdrop"),this.$body.html(this.options.body),this.options.backdrop||this.$backdrop.removeClass("in");if(this.options.buttons){this.buttonList={};var n=0;$.each(this.options.buttons,function(e,r){var i="button-"+n++;t.$buttons.append($('<button id="'+i+'"></button>').text(e).click(r)).append(" "),t.buttonList[e]=i})}else this.$footer.hide();$(this.elMain).append($(this.el)),this.options.closing_events&&($(document).on("keyup.ui-modal",function(e){e.keyCode==27&&t.hide()}),this.$el.find(".modal-backdrop").on("click",function(){t.hide()}))},_template:function(e){return'<div class="modal"><div class="modal-backdrop fade in" style="z-index: -1;"></div><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" style="display: none;">×</button><h4 class="title">'+e+"</h4>"+"</div>"+'<div class="modal-body" style="position: static;"></div>'+'<div class="modal-footer">'+'<div class="buttons" style="float: right;"></div>'+"</div>"+"</div"+"</div>"+"</div>"}});return{View:t}}),define("mvc/ui/ui-portlet",["utils/utils"],function(e){var t=Backbone.View.extend({visible:!1,optionsDefault:{title:"",icon:"",buttons:null,body:null,height:null,operations:null,placement:"bottom",overflow:"auto"},$title:null,$content:null,$buttons:null,$operations:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.$content=this.$el.find("#content"),this.$title=this.$el.find("#title-text"),this.options.height&&(this.$el.find("#body").css("height",this.options.height),this.$el.find("#content").css("overflow",this.options.overflow)),this.$buttons=$(this.el).find("#buttons");if(this.options.buttons){var n=this;$.each(this.options.buttons,function(e,t){t.$el.prop("id",e),n.$buttons.append(t.$el)})}else this.$buttons.remove();this.$operations=$(this.el).find("#operations");if(this.options.operations){var n=this;$.each(this.options.operations,function(e,t){t.$el.prop("id",e),n.$operations.append(t.$el)})}this.options.body&&this.append(this.options.body)},append:function(t){this.$content.append(e.wrap(t))},content:function(){return this.$content},show:function(){this.$el.fadeIn("fast"),this.visible=!0},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},enableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!1)},disableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!0)},hideOperation:function(e){this.$operations.find("#"+e).hide()},showOperation:function(e){this.$operations.find("#"+e).show()},setOperation:function(e,t){var n=this.$operations.find("#"+e);n.off("click"),n.on("click",t)},title:function(e){var t=this.$title;return e&&t.html(e),t.html()},_template:function(e){var t='<div class="toolForm portlet-view no-highlight">';if(e.title||e.icon)t+='<div id="title" class="toolFormTitle portlet-title"><div id="operations" class="portlet-operations"/><div style="overflow: hidden;">',e.icon&&(t+='<div class="portlet-title-icon fa '+e.icon+'"> </div>'),t+='<div id="title-text" class="portlet-title-text">'+e.title+"</div>",t+="</div></div>";return t+='<div id="body" class="toolFormBody portlet-body">',e.placement=="top"&&(t+='<div id="buttons" class="portlet-buttons"/>'),t+='<div id="content" class="portlet-content"/>',e.placement=="bottom"&&(t+='<div id="buttons" class="portlet-buttons"/>'),t+="</div></div>",t}});return{View:t}}),define("plugin/library/ui-select",["utils/utils"],function(e){var t=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:!0,wait:!1},selected:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.$select=this.$el.find("#select"),this.$icon=this.$el.find("#icon"),this.selected=this.options.value;var n=this;this.options.onchange&&this.$select.on("change",function(){n.value(n.$select.val())}),this._refresh(),this.options.visible||this.hide(),this.options.wait?this.wait():this.show()},value:function(e){var t=this.selected;e!==undefined&&(this.selected=e,this.$select.val(e));var n=this.selected;return n&&n!=t&&this.options.onchange&&this.options.onchange(n),n},text:function(){return this.$select.find("option:selected").text()},show:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-caret-down"),this.$select.show(),this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass(),this.$icon.addClass("fa fa-spinner fa-spin"),this.$select.hide()},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",!1)},disable:function(){this.$select.prop("disabled",!0)},add:function(e){this.$select.append(this._templateOption(e)),this._refresh()},del:function(e){this.$select.find("option[value="+e+"]").remove(),this.$select.trigger("change"),this._refresh()},update:function(e){this.$select.find("option").remove();for(var t in e)this.$select.append(this._templateOption(e[t]));!this.selected&&e.length>0&&this.value(e[0].value),this._refresh()},_refresh:function(){this.$select.find("option[value=null]").remove();var e=this.$select.find("option").length;e==0?(this.$select.append(this._templateOption({value:"null",label:this.options.empty})),this.disable()):(this.enable(),this.selected&&this.$select.val(this.selected))},_exists:function(e){return 0!=this.$select.find("option[value="+e+"]").length},_templateOption:function(e){return'<option value="'+e.value+'">'+e.label+"</option>"},_template:function(e){var t='<div id="'+e.id+'" class="styled-select">'+'<div class="button">'+'<i id="icon"/>'+"</div>"+'<select id="select" class="select '+e.cls+" "+e.id+'">';for(key in e.data){var n=e.data[key],r="";if(n.value==e.value||n.value=="")r="selected";t+='<option value="'+n.value+'" '+r+">"+n.label+"</option>"}return t+="</select></div>",t}});return{View:t}}),define("plugin/library/ui",["utils/utils","plugin/library/ui-select"],function(e,t){var n=Backbone.View.extend({optionsDefault:{title:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options))},title:function(e){this.$el.find("b").html(e)},_template:function(e){return"<label><b>"+e.title+"</b></label>"},value:function(){return options.title}}),r=Backbone.View.extend({optionsDefault:{id:null,title:"","float":"right",cls:"btn-default",icon:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t='<button id="'+e.id+'" type="submit" style="margin-right: 5px; float: '+e.float+';" type="button" class="btn '+e.cls+'">';return e.icon&&(t+='<i class="icon fa '+e.icon+'"></i> '),t+=e.title+"</button>",t}}),i=Backbone.View.extend({optionsDefault:{"float":"right",icon:"",tooltip:"",placement:"bottom",title:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){return'<div><span class="fa '+e.icon+'" style="font-size: 1.2em;"/> '+e.title+"</div>"}}),s=Backbone.View.extend({optionsDefault:{title:"",id:null,"float":"right",cls:"icon-btn",icon:"",tooltip:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick),$(this.el).tooltip({title:t.tooltip,placement:"bottom"})},_template:function(e){var t="";e.title&&(t="width: auto;");var n='<div id="'+e.id+'" style="margin-right: 5px; float: '+e.float+"; "+t+'" class="'+e.cls+'">';return e.title?n+='<div style="margin-right: 5px; margin-left: 5px;"><i class="icon fa '+e.icon+'"/> '+'<span style="position: relative; font-size: 0.8em; font-weight: normal; top: -1px;">'+e.title+"</span>"+"</div>":n+='<i class="icon fa '+e.icon+'"/>',n+="</div>",n}}),o=Backbone.View.extend({optionsDefault:{title:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),$(this.el).on("click",t.onclick)},_template:function(e){return'<div><a href="javascript:void(0)">'+e.title+"</a></div>"}}),u=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:!1},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement("<div></div>")},update:function(t){this.options=e.merge(t,this.optionsDefault);if(t.message!=""){this.$el.html(this._template(this.options)),this.$el.fadeIn();if(!t.persistent){var n=this;window.setTimeout(function(){n.$el.is(":visible")?n.$el.fadeOut():n.$el.hide()},3e3)}}else this.$el.fadeOut()},_template:function(e){return'<div class="alert alert-'+e.status+'" style="padding: 2px 2px 2px 10px;">'+e.message+"</div>"}}),a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options));var n=this;this.options.onclick&&this.$el.on("submit",function(e){var t=n.$el.find("#search");n.options.onclick(t.val())})},_template:function(e){return'<div class="search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+e.searchword+'">'+'<button type="submit" class="btn search-btn">'+'<i class="fa fa-search"></i>'+"</button>"+"</form>"+"</div>"}}),f=Backbone.View.extend({optionsDefault:{title:"Unlabeled",body:null},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.body&&this.$el.find(".body").append(this.options.body)},_template:function(e){return'<div id="title" class="title">'+e.title+":"+"</div>"}}),l=Backbone.View.extend({optionsDefault:{id:"",title:"",target:"",href:"",onunload:null,onclick:null,visible:!0,icon:null,tag:""},$menu:null,initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement($(this._template(this.options)));var n=$(this.el).find(".root"),r=this;n.on("click",function(e){e.preventDefault(),r.options.onclick&&r.options.onclick()}),this.options.visible||this.hide()},show:function(){$(this.el).show()},hide:function(){$(this.el).hide()},addMenu:function(t){var n={title:"",target:"",href:"",onclick:null,divider:!1,icon:null};n=e.merge(t,n),this.$menu||($(this.el).append(this._templateMenu()),this.$menu=$(this.el).find(".menu"));var r=$(this._templateMenuItem(n));r.on("click",function(e){e.preventDefault(),n.onclick&&n.onclick()}),this.$menu.append(r),n.divider&&this.$menu.append($(this._templateDivider()))},_templateMenuItem:function(e){var t='<li><a href="'+e.href+'" target="'+e.target+'">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),t+=" "+e.title+"</a>"+"</li>",t},_templateMenu:function(){return'<ul class="menu dropdown-menu pull-right" role="menu"></ul>'},_templateDivider:function(){return'<li class="divider"></li>'},_template:function(e){var t='<div id="'+e.id+'" class="button-menu btn-group">'+'<button type="button" class="root btn btn-default dropdown-toggle" data-toggle="dropdown">';return e.icon&&(t+='<i class="fa '+e.icon+'"></i>'),"</button></div>",t}}),c=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:!1,visible:!0},initialize:function(t){this.options=e.merge(t,this.optionsDefault),this.setElement(this._template(this.options)),this.options.disabled&&this.$el.prop("disabled",!0),this.options.visible||this.$el.hide();var n=this;this.options.onchange&&this.$el.on("input",function(){n.options.onchange()})},value:function(e){return e!==undefined&&this.$el.val(e),this.$el.val()},_template:function(e){return'<input id="'+e.id+'" type="'+e.type+'" value="'+e.value+'" placeholder="'+e.placeholder+'" class="form-control">'}});return{Label:n,Button:r,Icon:i,ButtonIcon:s,Input:c,Anchor:o,Message:u,Searchbox:a,Title:f,Select:t,ButtonMenu:l}}),define("plugin/library/jobs",["utils/utils"],function(e){return Backbone.Model.extend({initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},cleanup:function(t){var n=t.get("dataset_id_job");if(n!=""){var r=this;e.request("PUT",config.root+"api/histories/none/contents/"+n,{deleted:!0},function(){r._refreshHdas()}),t.set("dataset_id_job","")}},submit:function(t,n,r,i,s){var o=this,u=t.id,a=t.get("type"),f=this.app.types.get(a);data={tool_id:"chartskit",inputs:{input:{id:t.get("dataset_id"),src:"hda"},module:a,columns:r,settings:n}},t.state("wait","Sending job request..."),e.request("POST",config.root+"api/tools",data,function(e){if(!e.outputs||e.outputs.length==0)t.state("failed","Job submission failed. No response."),s&&s();else{o._refreshHdas();var n=e.outputs[0];t.state("wait","Job has been queued..."),t.set("dataset_id_job",n.id),this.app.storage.save(),o._loop(n.id,function(e){switch(e.state){case"ok":return t.state("wait","Job completed successfully..."),i(e),!0;case"error":return t.state("failed","Job has failed. Please check the history for details."),s&&s(),!0;case"running":return t.state("wait","Job is running..."),!1}})}},function(e){var n="";e&&e.message&&e.message.data&&e.message.data.input&&(n=e.message.data.input+"."),t.state("failed","This visualization requires the Charts-Kit. Please make sure it is installed. "+n),s&&s()})},_loop:function(t,n){var r=this;e.request("GET",config.root+"api/jobs/"+t,{},function(e){n(e)||setTimeout(function(){r._loop(t,n)},r.app.config.get("query_timeout"))})},_refreshHdas:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.refreshHdas()}})}),define("plugin/library/datasets",["utils/utils"],function(e){return Backbone.Collection.extend({list:{},initialize:function(t,n){this.app=t,this.options=e.merge(n,this.optionsDefault)},request:function(t,n,r){var i=this;if(t.groups)this._fetch(t,n);else{var s=this.list[t.id];if(s){n(s);return}e.request("GET",config.root+"api/datasets/"+t.id,{},function(e){switch(e.state){case"error":r&&r(e);break;default:i.list[t.id]=e,n(e)}})}},_fetch:function(t,n){var r=t.start?t.start:0,i=Math.abs(t.end-t.start),s=this.app.config.get("query_limit");if(!i||i>s)i=s;var o="",u={},a=0;for(var f in t.groups){var l=t.groups[f];for(var c in l.columns){var h=l.columns[c];o+=h+",",u[h]=a,a++}}if(a==0){n({});return}o=o.substring(0,o.length-1);var p=t.groups.slice(0);for(var f in p)p[f].values=[];var d=this;e.request("GET",config.root+"api/datasets/"+t.id,{data_type:"raw_data",provider:"dataset-column",limit:i,offset:r,indeces:o},function(e){for(var i in e.data){var s=e.data[i];for(var o in t.groups){var a=t.groups[o],f={x:parseInt(i)+r};for(var l in a.columns){var c=a.columns[l],h=u[c],d=s[h];if(isNaN(d)||!d)d=0;f[l]=d}p[o].values.push(f)}}n(p)})}})}),define("plugin/models/group",[],function(){return Backbone.Model.extend({defaults:{key:"Data label",date:""},reset:function(){this.clear({silent:!0}).set(this.defaults),this.trigger("reset",this)}})}),define("plugin/models/groups",["plugin/models/group"],function(e){return Backbone.Collection.extend({model:e})}),define("plugin/library/deferred",["utils/utils"],function(e){return Backbone.Model.extend({queue:[],process:{},counter:0,initialize:function(){this.on("refresh",function(){if(this.counter==0)for(var e in this.queue)this.queue[e](),this.queue.splice(e,1)})},execute:function(e){this.queue.push(e),this.trigger("refresh")},register:function(){var t=e.uuid();return this.process[t]=!0,this.counter++,console.debug("Deferred:register() - Registering "+t),t},done:function(e){delete this.process[e],this.counter--,console.debug("Deferred:done() - Unregistering "+e),this.trigger("refresh")},ready:function(){return this.counter==0?!0:!1}})});var Visualization=Backbone.Model.extend({defaults:{config:{}},urlRoot:function(){var e="/api/visualizations";return window.galaxy_config&&galaxy_config.root?galaxy_config.root+e:e},initialize:function(e){_.isObject(e.config)&&_.isObject(this.defaults.config)&&_.defaults(e.config,this.defaults.config),this._setUpListeners()},_setUpListeners:function(){},set:function(e,t){if(e==="config"){var n=this.get("config");_.isObject(n)&&(t=_.extend(_.clone(n),t))}return Backbone.Model.prototype.set.call(this,e,t),this},toString:function(){var e=this.get("id")||"";return this.get("title")&&(e+=":"+this.get("title")),"Visualization("+e+")"}}),VisualizationCollection=Backbone.Collection.extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(e,t){t=t||{}},set:function(e,t){var n=this;e=_.map(e,function(e){var t=n.get(e.id);if(!t)return e;var r=t.toJSON();return _.extend(r,e),r}),Backbone.Collection.prototype.set.call(this,e,t)},toString:function(){return["VisualizationCollection(",[this.historyId,this.length].join(),")"].join("")}});define("mvc/visualization/visualization-model",function(){}),define("plugin/models/chart",["plugin/models/groups","plugin/library/deferred","mvc/visualization/visualization-model"],function(e,t){return Backbone.Model.extend({defaults:{id:null,title:"",type:"",date:null,state:"",state_info:"",modified:!1,dataset_id:"",dataset_id_job:""},initialize:function(n){this.groups=new e,this.settings=new Backbone.Model,this.deferred=new t},reset:function(){this.clear({silent:!0}).set(this.defaults),this.groups.reset(),this.settings.clear(),this.trigger("reset",this)},copy:function(e){var t=this;t.clear({silent:!0}).set(this.defaults),t.set(e.attributes),t.settings=e.settings.clone(),t.groups.reset(),e.groups.each(function(e){t.groups.add(e.clone())}),t.trigger("change",t)},state:function(e,t){this.set("state",e),this.set("state_info",t),this.trigger("set:state"),console.debug("Chart:state() - "+t+" ("+e+")")}})}),define("plugin/library/storage",["utils/utils","plugin/models/chart","plugin/models/group"],function(e,t,n){return Backbone.Model.extend({vis:null,initialize:function(e){this.app=e,this.chart=this.app.chart,this.options=this.app.options,this.id=this.options.id,this.vis=new Visualization({type:"charts",config:{dataset_id:this.options.config.dataset_id,chart_dict:{}}}),this.id&&(this.vis.id=this.id);var t=this.options.config.chart_dict;t&&(this.vis.get("config").chart_dict=t)},save:function(){var e=this.app.chart;this.vis.get("config").chart_dict={};var t=e.get("title");t!=""&&this.vis.set("title",t);var n={attributes:e.attributes,settings:e.settings.attributes,groups:[]};e.groups.each(function(e){n.groups.push(e.attributes)}),this.vis.get("config").chart_dict=n;var r=this;this.vis.save().fail(function(e,t,n){console.error(e,t,n)}).then(function(e){e&&e.id&&(r.id=e.id)})},load:function(){var e=this.vis.get("config").chart_dict;if(!e.attributes)return!1;this.chart.set(e.attributes),this.chart.state("ok","Loading saved visualization..."),this.chart.settings.set(e.settings);for(var t in e.groups)this.chart.groups.add(new n(e.groups[t]));return this.chart.set("modified",!1),!0}})}),define("plugin/views/viewport",["mvc/ui/ui-portlet","plugin/library/ui","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(e,t){this.app=e,this.chart=this.app.chart,this.options=n.merge(t,this.optionsDefault),this.setElement($(this._template())),this._create_svg();var r=this;this.chart.on("redraw",function(){r._draw(r.chart)}),this.chart.on("set:state",function(){var e=r.$el.find("#info"),t=e.find("#icon");t.removeClass(),e.show(),e.find("#text").html(r.chart.get("state_info"));var n=r.chart.get("state");switch(n){case"ok":e.hide();break;case"failed":t.addClass("fa fa-warning");break;default:t.addClass("fa fa-spinner fa-spin")}})},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_create_svg:function(){this.svg&&this.svg.remove(),this.$el.append($(this._template_svg())),this.svg_el=this.$el.find("svg"),this.svg=d3.select(this.svg_el[0])},_draw:function(e){var t=this;this._create_svg(),e.state("wait","Please wait...");var n=e.deferred.register(),r=e.get("type"),i=this.app.types.get(r);if(!i.execute||i.execute&&e.get("modified"))this.app.jobs.cleanup(e),e.set("modified",!1);var t=this;require(["plugin/charts/"+r+"/"+r],function(r){var s=new r(t.app,{svg:t.svg});i.execute?e.get("dataset_id_job")==""?t.app.jobs.submit(e,t._defaultSettingsString(e),t._defaultRequestString(e),function(){s.draw(n,e,t._defaultRequestDictionary(e))},function(){e.deferred.done(n)}):s.draw(n,e,t._defaultRequestDictionary(e)):s.draw(n,e,t._defaultRequestDictionary(e))})},_defaultRequestString:function(e){var t=this.app.types.get(e.get("type")),n="",r=0;return e.groups.each(function(e){for(var i in t.columns)n+=i+"_"+ ++r+":"+(parseInt(e.get(i))+1)+", "}),n.substring(0,n.length-2)},_defaultSettingsString:function(e){var t="";for(key in e.settings.attributes)t+=key+":"+e.settings.get(key)+", ";return t.substring(0,t.length-2)},_defaultRequestDictionary:function(e){var t=this.app.types.get(e.get("type")),n={groups:[]};t.execute?n.id=e.get("dataset_id_job"):n.id=e.get("dataset_id");var r=0;return e.groups.each(function(e){var i={};for(var s in t.columns)i[s]=e.get(s);n.groups.push({key:++r+":"+e.get("key"),columns:i})}),n},_template:function(){return'<div style="height: 100%; min-height: 50px;"><div id="info" style="position: absolute; margin-left: 10px; margin-top: 10px; margin-bottom: 50px;"><span id="icon" style="font-size: 1.2em; display: inline-block;"/><span id="text" style="position: relative; margin-left: 5px; top: -1px; font-size: 1.0em;"/></div></div>'},_template_svg:function(){return'<svg style="height: calc(100% - 80px)"/>'}})}),define("plugin/views/viewer",["utils/utils","plugin/library/ui","mvc/ui/ui-portlet","plugin/models/group","plugin/views/viewport"],function(e,t,n,r,i){return Backbone.View.extend({initialize:function(e,r){this.app=e,this.chart=this.app.chart,this.viewport_view=new i(e);var s=this;this.portlet=new n.View({icon:"fa-bar-chart-o",title:"Viewport",operations:{edit_button:new t.ButtonIcon({icon:"fa-edit",tooltip:"Customize this chart",title:"Customize",onclick:function(){s._wait(s.chart,function(){s.app.go("editor")})}})}}),this.portlet.append(this.viewport_view.$el),this.setElement(this.portlet.$el);var s=this;this.chart.on("change:title",function(){s._refreshTitle()})},show:function(){this.$el.show(),$(window).trigger("resize")},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e)},_screenshot:function(){var e=new XMLSerializer,t=e.serializeToString(this.viewport_view.svg.node()),n="data:image/svg+xml;base64,"+btoa(t);window.location.href="data:application/x-download/;charset=utf-8,"+encodeURIComponent(t)},_wait:function(e,t){if(e.deferred.ready())t();else{var n=this;this.app.modal.show({title:"Please wait!",body:"Your chart is currently being processed. Please wait and try again.",buttons:{Close:function(){n.app.modal.hide()},Retry:function(){n.app.modal.hide(),setTimeout(function(){n._wait(e,t)},n.app.config.get("query_timeout"))}}})}}})}),define("mvc/ui/ui-tabs",["utils/utils"],function(e){var t=Backbone.View.extend({visible:!1,list:{},$nav:null,$content:null,first_tab:null,optionsDefault:{title_new:"",operations:null,onnew:null},initialize:function(t){this.options=e.merge(t,this.optionsDefault);var n=$(this._template(this.options));this.$nav=n.find(".tab-navigation"),this.$content=n.find(".tab-content"),this.setElement(n),this.list={};var r=this;this.options.operations&&$.each(this.options.operations,function(e,t){t.$el.prop("id",e),r.$nav.find(".operations").append(t.$el)});if(this.options.onnew){var i=$(this._template_tab_new(this.options));this.$nav.append(i),i.tooltip({title:"Add a new tab",placement:"bottom",container:r.$el}),i.on("click",function(e){i.tooltip("hide"),r.options.onnew()})}},add:function(e){var t=e.id,n={$title:$(this._template_tab(e)),$content:$(this._template_tab_content(e)),removable:e.ondel?!0:!1};this.list[t]=n,this.options.onnew?this.$nav.find("#new-tab").before(n.$title):this.$nav.append(n.$title),n.$content.append(e.$el),this.$content.append(n.$content),_.size(this.list)==1&&(n.$title.addClass("active"),n.$content.addClass("active"),this.first_tab=t);if(e.ondel){var r=this,i=n.$title.find("#delete");i.tooltip({title:"Delete this tab",placement:"bottom",container:r.$el}),i.on("click",function(){return i.tooltip("destroy"),r.$el.find(".tooltip").remove(),e.ondel(),!1})}e.onclick&&n.$title.on("click",function(){e.onclick()})},del:function(e){var t=this.list[e];t.$title.remove(),t.$content.remove(),delete t,this.first_tab==e&&(this.first_tab=null),this.first_tab!=null&&this.show(this.first_tab)},delRemovable:function(){for(var e in this.list){var t=this.list[e];t.removable&&this.del(e)}},show:function(e){this.$el.fadeIn("fast"),this.visible=!0,e&&this.list[e].$title.find("a").tab("show")},hide:function(){this.$el.fadeOut("fast"),this.visible=!1},hideOperation:function(e){this.$nav.find("#"+e).hide()},showOperation:function(e){this.$nav.find("#"+e).show()},setOperation:function(e,t){var n=this.$nav.find("#"+e);n.off("click"),n.on("click",t)},title:function(e,t){var n=this.list[e].$title.find("#text");return t&&n.html(t),n.html()},_template:function(e){return'<div class="tabbable tabs-left"><ul class="tab-navigation nav nav-tabs"><div class="operations" style="float: right; margin-bottom: 4px;"></div></ul><div class="tab-content"/></div>'},_template_tab_new:function(e){return'<li id="new-tab"><a href="javascript:void(0);"><i style="font-size: 0.8em; margin-right: 5px;" class="fa fa-plus-circle"/>'+e.title_new+"</a>"+"</li>"},_template_tab:function(e){var t='<li id="title-'+e.id+'">'+'<a title="" href="#tab-'+e.id+'" data-toggle="tab" data-original-title="">'+'<span id="text">'+e.title+"</span>";return e.ondel&&(t+='<i id="delete" style="font-size: 0.8em; margin-left: 5px; cursor: pointer;" class="fa fa-minus-circle"/>'),t+="</a></li>",t},_template_tab_content:function(e){return'<div id="tab-'+e.id+'" class="tab-pane"/>'}});return{View:t}}),define("plugin/library/ui-table",["utils/utils"],function(e){var t=Backbone.View.extend({row:null,row_count:0,optionsDefault:{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null},events:{click:"_onclick",dblclick:"_ondblclick"},first:!0,initialize:function(t){this.options=e.merge(t,this.optionsDefault);var n=$(this._template(t));this.$thead=n.find("thead"),this.$tbody=n.find("tbody"),this.$tmessage=n.find("tmessage"),this.setElement(n),this.row=$("<tr></tr>")},addHeader:function(e){var t=$("<th></th>");t.append(e),this.row.append(t)},appendHeader:function(){this.$thead.append(this.row),this.row=$("<tr></tr>")},add:function(e,t){var n=$("<td></td>");t&&n.css("width",t),n.append(e),this.row.append(n)},append:function(e){this._commit(e)},prepend:function(e){this._commit(e,!0)},remove:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},removeAll:function(){this.$tbody.html(""),this.row_count=0,this._refresh()},value:function(e){this.before=this.$tbody.find(".current").attr("id"),e!==undefined&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return t===undefined?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t){this.remove(e),this.row.attr("id",e),t?this.$tbody.prepend(this.row):this.$tbody.append(this.row),this.row=$("<tr></tr>"),this.row_count++,this._refresh()},_onclick:function(e){var t=this.value(),n=$(e.target).closest("tr").attr("id");n&&t!=n&&(this.options.onconfirm?this.options.onconfirm(n):this.value(n))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){this.row_count==0?this.$tmessage.show():this.$tmessage.hide()},_template:function(e){return'<div><table class="grid"><thead></thead><tbody style="cursor: pointer;"></tbody></table><tmessage>'+e.content+"</tmessage>"+"<div>"}});return{View:t}}),define("plugin/views/group",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){return Backbone.View.extend({columns:[],initialize:function(r,i){this.app=r;var s=this;this.chart=this.app.chart,this.group=i.group,this.group_key=new t.Input({placeholder:"Data label",onchange:function(){s.group.set("key",s.group_key.value())}}),this.table=new e.View({content:"No data column."});var o=$("<div/>");o.append(n.wrap((new t.Label({title:"Provide a label:"})).$el)),o.append(n.wrap(this.group_key.$el)),o.append(n.wrap((new t.Label({title:"Select columns:"})).$el)),o.append(n.wrap(this.table.$el)),this.setElement(o);var s=this;this.chart.on("change:dataset_id",function(){s._refreshTable()}),this.chart.on("change:type",function(){s._refreshTable()}),this.group.on("change:key",function(){s._refreshGroupKey()}),this.group.on("change",function(){s._refreshGroup()}),this._refreshTable(),this._refreshGroupKey(),this._refreshGroup()},_refreshTable:function(){var e=this.chart.get("dataset_id"),n=this.chart.get("type");if(!e||!n)return;var r=this,i=this.app.types.get(n);this.table.removeAll();var s={};for(var o in i.columns){var u=this.group.get(o);u||this.group.set(o,0);var a=i.columns[o],f=new t.Select.View({id:"select_"+o,gid:o,onchange:function(e){r.group.set(this.gid,e),r.chart.set("modified",!0)},value:u,wait:!0});this.table.add(a.title,"25%"),this.table.add(f.$el),this.table.append(o),s[o]=f}this.chart.state("wait","Loading metadata...");var l=this.chart.deferred.register();this.app.datasets.request({id:e},function(e){r.columns=[];var t=e.metadata_column_types;for(var n in t)(t[n]=="int"||t[n]=="float")&&r.columns.push({label:"Column: "+(parseInt(n)+1)+" ["+t[n]+"]",value:n});for(var n in s)s[n].update(r.columns),s[n].show();r.chart.state("wait","Metadata initialized..."),r.chart.deferred.done(l)})},_refreshGroup:function(){this.group.set("date",n.time())},_refreshGroupKey:function(){var e=this.group.get("key");e===undefined&&(e=""),this.group_key.value(e)}})}),define("plugin/library/ui-table-form",["plugin/library/ui-table","plugin/library/ui","utils/utils"],function(e,t,n){var r=Backbone.View.extend({list:[],initialize:function(r){this.table_title=new t.Label({title:r.title}),this.table=new e.View({content:r.content});var i=$("<div/>");i.append(n.wrap(this.table_title.$el)),i.append(n.wrap(this.table.$el)),this.setElement(i)},title:function(e){this.table_title.title(e)},update:function(e,t){this.table.removeAll(),this.list=[];for(var n in e)this._add(n,e[n],t);for(var n in this.list){var r=this.list[n].options.onchange;r&&r()}},_add:function(e,n,r){var i=this,s=null,o=n.type;switch(o){case"text":s=new t.Input({id:e,placeholder:n.placeholder,onchange:function(){r.set(e,s.value())}});break;case"select":s=new t.Select.View({id:e,data:n.data,onchange:function(){var t=s.value();r.set(e,t);var o=_.findWhere(n.data,{value:t});o&&(o.show&&i.$el.find("#"+o.show).fadeIn("fast"),o.hide&&i.$el.find("#"+o.hide).fadeOut("fast"))}});break;case"separator":s=$("<div/>");break;default:console.log("ui-table-form:_add","Unknown setting type ("+n.type+")");return}if(o!="separator"){r.get(e)||r.set(e,n.init),s.value(r.get(e)),this.list[e]=s;var u=$("<div/>");u.append(s.$el),u.append('<div class="toolParamHelp" style="font-size: 0.9em;">'+n.info+"</div>"),this.table.add('<span style="white-space: nowrap;">'+n.title+"</span>","25%"),this.table.add(u)}else this.table.add('<h6 style="white-space: nowrap;">'+n.title+":<h6/>"),this.table.add($("<div/>"));this.table.append(e)}});return{View:r}}),define("plugin/views/settings",["plugin/library/ui","plugin/library/ui-table-form","utils/utils"],function(e,t,n){return Backbone.View.extend({initialize:function(e,n){this.app=e;var r=this;this.chart=this.app.chart,this.form=new t.View({title:"Chart options:",content:"This chart type does not provide any options."}),this.setElement(this.form.$el);var r=this;this.chart.on("change",function(){r._refreshTable()})},_refreshTable:function(){var e=this.chart.get("type");if(!e)return;var t=this.app.types.get(e);this.form.title(t.title+":"),this.form.update(t.settings,this.chart.settings)}})}),define("plugin/views/editor",["mvc/ui/ui-tabs","plugin/library/ui-table","plugin/library/ui","mvc/ui/ui-portlet","utils/utils","plugin/models/chart","plugin/models/group","plugin/views/group","plugin/views/settings"],function(e,t,n,r,i,s,o,u,a){return Backbone.View.extend({optionsDefault:{header:!0,content:"No content available."},initialize:function(s,o){var u=this;this.app=s,this.chart=this.app.chart,this.options=i.merge(o,this.optionsDefault),this.portlet=new r.View({icon:"fa-bar-chart-o",title:"Editor",operations:{save:new n.ButtonIcon({icon:"fa-save",tooltip:"Draw Chart",title:"Draw",onclick:function(){u.app.go("viewer"),u._saveChart()}}),back:new n.ButtonIcon({icon:"fa-caret-left",tooltip:"Return to Viewer",title:"Return",onclick:function(){u.app.go("viewer"),u.app.storage.load()}})}}),this.table=new t.View({header:!1,onconfirm:function(e){u.chart.groups.length>0?u.app.modal.show({title:"Switching to another chart type?",body:"If you continue your settings and selections will be cleared.",buttons:{Cancel:function(){u.app.modal.hide()},Continue:function(){u.app.modal.hide(),u.table.value(e)}}}):u.table.value(e)},onchange:function(e){u.chart.groups.reset(),u.chart.settings.clear(),u.chart.set({type:e})},ondblclick:function(e){u.tabs.show("settings")},content:"No chart types available"});var f=0,l=s.types.attributes;for(var c in l){var h=l[c];this.table.add(++f+"."),h.execute?this.table.add(h.title+" (requires processing)"):this.table.add(h.title),this.table.append(c)}this.tabs=new e.View({title_new:"Add Data",onnew:function(){var e=u._addGroupModel();u.tabs.show(e.id)}}),this.title=new n.Input({placeholder:"Chart title",onchange:function(){u.chart.set("title",u.title.value())}});var p=$("<div/>");p.append(i.wrap((new n.Label({title:"Provide a chart title:"})).$el)),p.append(i.wrap(this.title.$el)),p.append(i.wrap((new n.Label({title:"Select a chart type:"})).$el)),p.append(i.wrap(this.table.$el)),this.tabs.add({id:"main",title:"Start",$el:p}),this.settings=new a(this.app),this.tabs.add({id:"settings",title:"Configuration",$el:this.settings.$el}),this.portlet.append(this.tabs.$el),this.setElement(this.portlet.$el),this.tabs.hideOperation("back");var u=this;this.chart.on("change:title",function(e){u._refreshTitle()}),this.chart.on("change:type",function(e){u.table.value(e.get("type"))}),this.chart.on("reset",function(e){u._resetChart()}),this.app.chart.on("redraw",function(e){u.portlet.showOperation("back")}),this.app.chart.groups.on("add",function(e){u._addGroup(e)}),this.app.chart.groups.on("remove",function(e){u._removeGroup(e)}),this.app.chart.groups.on("reset",function(e){u._removeAllGroups()}),this.app.chart.groups.on("change:key",function(e){u._refreshGroupKey()}),this._resetChart()},show:function(){this.$el.show()},hide:function(){this.$el.hide()},_refreshTitle:function(){var e=this.chart.get("title");this.portlet.title(e),this.title.value(e)},_refreshGroupKey:function(){var e=this,t=0;this.chart.groups.each(function(n){var r=n.get("key","");r==""&&(r="Chart data"),e.tabs.title(n.id,++t+": "+r)})},_addGroupModel:function(){var e=new o({id:i.uuid()});return this.chart.groups.add(e),e},_addGroup:function(e){var t=this,n=new u(this.app,{group:e}),r=t.chart.groups.length;this.tabs.add({id:e.id,$el:n.$el,ondel:function(){t.chart.groups.remove(e.id)}}),this._refreshGroupKey()},_removeGroup:function(e){this.tabs.del(e.id),this._refreshGroupKey(),this.chart.set("modified",!0)},_removeAllGroups:function(e){this.tabs.delRemovable()},_resetChart:function(){this.chart.set("id",i.uuid()),this.chart.set("type","bardiagram"),this.chart.set("dataset_id",this.app.options.config.dataset_id),this.chart.set("title","New Chart"),this.portlet.hideOperation("back")},_saveChart:function(){this.chart.set({type:this.table.value(),title:this.title.value(),date:i.time()}),this.chart.groups.length==0&&this._addGroupModel();var e=this;this.chart.deferred.execute(function(){e.app.storage.save(),e.chart.trigger("redraw")})}})}),define("plugin/models/config",[],function(){return Backbone.Model.extend({defaults:{query_limit:1e3,query_timeout:500}})}),define("plugin/charts/_nvd3/config",[],function(){return{title:"",columns:{y:{title:"Values for y-axis"}},settings:{separator_label:{title:"X axis",type:"separator"},x_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"X-axis",placeholder:"Axis label"},x_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:"x_axis_tick"},{label:"Auto",value:"auto",hide:"x_axis_tick"},{label:"Float",value:"f",show:"x_axis_tick"},{label:"Exponent",value:"e",show:"x_axis_tick"},{label:"Integer",value:"d",hide:"x_axis_tick"},{label:"Percentage",value:"p",show:"x_axis_tick"},{label:"Rounded",value:"r",show:"x_axis_tick"},{label:"SI-prefix",value:"s",show:"x_axis_tick"}]},x_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_tick:{title:"Y axis",type:"separator"},y_axis_label:{title:"Axis label",info:"Provide a label for the axis.",type:"text",init:"Y-axis",placeholder:"Axis label"},y_axis_type:{title:"Axis value type",info:"Select the value type of the axis.",type:"select",init:"auto",data:[{label:"-- Do not show values --",value:"hide",hide:"y_axis_tick"},{label:"Auto",value:"auto",hide:"y_axis_tick"},{label:"Float",value:"f",show:"y_axis_tick"},{label:"Exponent",value:"e",show:"y_axis_tick"},{label:"Integer",value:"d",hide:"y_axis_tick"},{label:"Percentage",value:"p",show:"y_axis_tick"},{label:"Rounded",value:"r",show:"y_axis_tick"},{label:"SI-prefix",value:"s",show:"y_axis_tick"}]},y_axis_tick:{title:"Axis tick format",info:"Select the tick format for the axis.",type:"select",init:".1",data:[{label:"0.00001",value:".5"},{label:"0.0001",value:".4"},{label:"0.001",value:".3"},{label:"0.01",value:".2"},{label:"0.1",value:".1"},{label:"1",value:"1"}]},separator_legend:{title:"Others",type:"separator"},show_legend:{title:"Show legend",info:"Would you like to add a legend?",type:"select",init:"true",data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]}}}}),define("plugin/charts/bardiagram/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Bar diagram"})}),define("plugin/charts/histogram/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Histogram",execute:!0,columns:{y:{title:"Observations"}},settings:{x_axis_label:{init:"Breaks"},y_axis_label:{init:"Density"}}})}),define("plugin/charts/horizontal/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Bar diagram (horizontal)",settings:{x_axis_type:{init:"hide"}}})}),define("plugin/charts/line/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Line chart"})}),define("plugin/charts/linewithfocus/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Line with focus"})}),define("plugin/charts/piechart/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Pie chart"})}),define("plugin/charts/scatterplot/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Scatter plot",columns:{x:{title:"Values for x-axis"}}})}),define("plugin/charts/stackedarea/config",["plugin/charts/_nvd3/config"],function(e){return $.extend(!0,{},e,{title:"Stacked area"})}),define("plugin/charts/types",["plugin/charts/bardiagram/config","plugin/charts/histogram/config","plugin/charts/horizontal/config","plugin/charts/line/config","plugin/charts/linewithfocus/config","plugin/charts/piechart/config","plugin/charts/scatterplot/config","plugin/charts/stackedarea/config"],function(e,t,n,r,i,s,o,u){return Backbone.Model.extend({defaults:{bardiagram:e,horizontal:n,histogram:t,line:r,linewithfocus:i,piechart:s,scatterplot:o,stackedarea:u}})}),define("plugin/app",["mvc/ui/ui-modal","mvc/ui/ui-portlet","plugin/library/ui","utils/utils","plugin/library/jobs","plugin/library/datasets","plugin/library/storage","plugin/views/viewer","plugin/views/editor","plugin/models/config","plugin/models/chart","plugin/charts/types"],function(e,t,n,r,i,s,o,u,a,f,l,c){return Backbone.View.extend({initialize:function(t){this.options=t,Galaxy&&Galaxy.modal?this.modal=Galaxy.modal:this.modal=new e.View,this.config=new f,this.types=new c,this.chart=new l,this.jobs=new i(this),this.datasets=new s(this),this.storage=new o(this),this.viewer_view=new u(this),this.editor_view=new a(this),this.$el.append(this.viewer_view.$el),this.$el.append(this.editor_view.$el);if(!this.storage.load())this.go("editor");else{this.go("viewer");var n=this;this.chart.deferred.execute(function(){n.chart.trigger("redraw")})}},go:function(e){$(".tooltip").hide();switch(e){case"editor":this.editor_view.show(),this.viewer_view.hide();break;case"viewer":this.editor_view.hide(),this.viewer_view.show()}},execute:function(e){},onunload:function(){},log:function(e,t){console.log(e+" "+t)}})});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/_nvd3/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/_nvd3/config.js
@@ -0,0 +1,218 @@
+define([], function() {
+
+return {
+ title : '',
+ columns : {
+ y : {
+ title : 'Values for y-axis'
+ }
+ },
+ settings : {
+ separator_label : {
+ title : 'X axis',
+ type : 'separator'
+ },
+ x_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'X-axis',
+ placeholder : 'Axis label'
+ },
+ x_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ hide : 'x_axis_tick'
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ hide : 'x_axis_tick'
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ show : 'x_axis_tick'
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ show : 'x_axis_tick'
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ hide : 'x_axis_tick'
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ show : 'x_axis_tick'
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ show : 'x_axis_tick'
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ show : 'x_axis_tick'
+ }
+ ]
+ },
+ x_axis_tick : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_tick : {
+ title : 'Y axis',
+ type : 'separator'
+ },
+ y_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'Y-axis',
+ placeholder : 'Axis label'
+ },
+ y_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ hide : 'y_axis_tick'
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ hide : 'y_axis_tick'
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ show : 'y_axis_tick'
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ show : 'y_axis_tick'
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ hide : 'y_axis_tick'
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ show : 'y_axis_tick'
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ show : 'y_axis_tick'
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ show : 'y_axis_tick'
+ }
+ ]
+ },
+ y_axis_tick : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_legend : {
+ title : 'Others',
+ type : 'separator'
+ },
+ show_legend : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'select',
+ init : 'true',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ },
+ }
+};
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/_nvd3/nvd3.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/_nvd3/nvd3.js
@@ -0,0 +1,80 @@
+// dependencies
+define([], function() {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, nvd3_model, chart, request_dictionary, callback)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+ nv.addGraph(function() {
+ // x axis
+ self._axis(nvd3_model.xAxis, chart.settings.get('x_axis_type'), chart.settings.get('x_axis_tick'));
+
+ // x axis label
+ nvd3_model.xAxis.axisLabel(chart.settings.get('x_axis_label'));
+
+ // y axis
+ self._axis(nvd3_model.yAxis, chart.settings.get('y_axis_type'), chart.settings.get('y_axis_tick'));
+
+ // y axis label
+ nvd3_model.yAxis.axisLabel(chart.settings.get('y_axis_label'))
+ .axisLabelDistance(30);
+
+ // controls
+ if (chart.groups.length == 1) {
+ nvd3_model.options({ showControls: false });
+ }
+
+ // legend
+ var legend_visible = true;
+ if (chart.settings.get('show_legend') == 'false') {
+ legend_visible = false;
+ }
+ nvd3_model.showLegend(legend_visible);
+
+ // custom callback
+ if (callback) {
+ callback(nvd3_model);
+ }
+
+ // parse data to svg
+ self.options.svg.datum(data)
+ .call(nvd3_model);
+
+ // refresh on window resize
+ nv.utils.windowResize(nvd3_model.update);
+
+ // set chart state
+ chart.state('ok', 'Chart has been drawn.');
+
+ // unregister process
+ chart.deferred.done(process_id);
+ });
+ });
+ },
+
+ // make axis
+ _axis: function(axis, type, tick) {
+ switch (type) {
+ case 'hide':
+ axis.tickFormat(function() { return '' });
+ break;
+ case 'auto':
+ break;
+ default:
+ axis.tickFormat(d3.format(tick + type));
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/bardiagram.js
--- a/config/plugins/visualizations/charts/static/charts/bardiagram.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// dependencies
-define([], function() {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarChart();
-
- self.d3_chart.xAxis.tickFormat(d3.format('.2f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.1f'))
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/bardiagram.js
@@ -0,0 +1,21 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.multiBarChart(), chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/bardiagram/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/bardiagram/config.js
@@ -0,0 +1,7 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Bar diagram',
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/histogram/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/histogram/config.js
@@ -0,0 +1,21 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Histogram',
+ execute : true,
+ columns : {
+ y : {
+ title : 'Observations'
+ }
+ },
+ settings : {
+ x_axis_label : {
+ init : 'Breaks'
+ },
+ y_axis_label : {
+ init : 'Density'
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/histogram/histogram.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/histogram/histogram.js
@@ -0,0 +1,31 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // configure request
+ var index = 0;
+ for (var i in request_dictionary.groups) {
+ var group = request_dictionary.groups[i];
+ group.columns = {
+ x: index++,
+ y: index++
+ }
+ }
+
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.multiBarChart(), chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/horizontal.js
--- a/config/plugins/visualizations/charts/static/charts/horizontal.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.d3_chart = nv.models.multiBarHorizontalChart();
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/horizontal/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/config.js
@@ -0,0 +1,12 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Bar diagram (horizontal)',
+ settings : {
+ x_axis_type : {
+ init : 'hide'
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/horizontal/horizontal.js
@@ -0,0 +1,21 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.multiBarHorizontalChart(), chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/line.js
--- a/config/plugins/visualizations/charts/static/charts/line.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- return self.chart_3d;
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/line/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/line/config.js
@@ -0,0 +1,7 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Line chart',
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/line/line.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/line/line.js
@@ -0,0 +1,21 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.lineChart(), chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/linewithfocus.js
--- a/config/plugins/visualizations/charts/static/charts/linewithfocus.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.chart_3d = nv.models.lineWithFocusChart();
-
- self.chart_3d.xAxis
- .tickFormat(d3.format(',f'));
-
- self.chart_3d.yAxis
- .tickFormat(d3.format(',.2f'));
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/config.js
@@ -0,0 +1,7 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Line with focus',
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/linewithfocus/linewithfocus.js
@@ -0,0 +1,21 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.lineWithFocusChart(), chart, request_dictionary);
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/piechart.js
--- a/config/plugins/visualizations/charts/static/charts/piechart.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // loop through data groups
- for (var key in data) {
- // get group
- var group = data[key];
-
- // format chart data
- var pie_data = [];
- for (var key in group.values) {
- var value = group.values[key];
- pie_data.push ({
- key : value.x,
- y : value.y
- });
- }
-
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.chart_3d = nv.models.pieChart()
- .donut(true)
- .showLegend(false);
-
- d3.select(self.options.svg_id)
- .datum(pie_data)
- .call(self.chart_3d);
-
- nv.utils.windowResize(self.chart_3d.update);
-
- return self.chart_3d;
- });
- }
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/piechart/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/piechart/config.js
@@ -0,0 +1,7 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Pie chart',
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/piechart/piechart.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/piechart/piechart.js
@@ -0,0 +1,57 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ // request data
+ var self = this;
+ this.app.datasets.request(request_dictionary, function(data) {
+
+ // loop through data groups
+ for (var key in request_dictionary.groups) {
+ // get group
+ var group = request_dictionary.groups[key];
+
+ // format chart data
+ var pie_data = [];
+ for (var key in group.values) {
+ var value = group.values[key];
+ pie_data.push ({
+ key : value.x,
+ y : value.y
+ });
+ }
+
+ // add graph to screen
+ nv.addGraph(function() {
+ self.chart_3d = nv.models.pieChart()
+ .donut(true)
+ .showLegend(false);
+
+ self.options.svg.datum(pie_data)
+ .call(self.chart_3d);
+
+ nv.utils.windowResize(self.chart_3d.update);
+
+ // set chart state
+ chart.state('ok', 'Pie chart drawn.');
+
+ // unregister process
+ chart.deferred.done(process_id);
+ });
+ }
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/scatterplot.js
--- a/config/plugins/visualizations/charts/static/charts/scatterplot.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- self.d3_chart = nv.models.scatterChart()
- .showDistX(true)
- .showDistY(true)
- .color(d3.scale.category10().range());
-
- self.d3_chart.xAxis.tickFormat(d3.format('.02f'))
- self.d3_chart.yAxis.tickFormat(d3.format('.02f'))
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/scatterplot/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/config.js
@@ -0,0 +1,12 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Scatter plot',
+ columns : {
+ x : {
+ title : 'Values for x-axis'
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/scatterplot/scatterplot.js
@@ -0,0 +1,25 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.scatterChart(), chart, request_dictionary, function(nvd3_model) {
+ nvd3_model.showDistX(true)
+ .showDistY(true)
+ .color(d3.scale.category10().range());
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/stackedarea.js
--- a/config/plugins/visualizations/charts/static/charts/stackedarea.js
+++ /dev/null
@@ -1,59 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// widget
-return Backbone.View.extend(
-{
- // initialize
- initialize: function(app, options) {
- this.app = app;
- this.options = options;
- this.chart = options.chart;
- },
-
- // render
- refresh : function(data)
- {
- // add graph to screen
- var self = this;
- nv.addGraph(function() {
- // check data
- var valid = true;
- var length = 0;
- for (var key in data) {
- // evalute length
- if (length == 0) {
- length = data[key].values.length;
- } else {
- if (length != data[key].values.length) {
- valid = false;
- break;
- }
- }
- }
- if (!valid) {
- return;
- }
-
- // make plot
- self.d3_chart = nv.models.stackedAreaChart()
- .x(function(d) {
- return d.x
- })
- .y(function(d) {
- return d.y
- })
- .clipEdge(true);
-
- self.d3_chart.xAxis.tickFormat(function() { return ''; });
-
- d3.select(self.options.svg_id)
- .datum(data)
- .call(self.d3_chart);
-
- nv.utils.windowResize(self.d3_chart.update);
- });
- }
-});
-
-});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/stackedarea/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/config.js
@@ -0,0 +1,7 @@
+define(['plugin/charts/_nvd3/config'], function(nvd3_config) {
+
+return $.extend(true, {}, nvd3_config, {
+ title : 'Stacked area'
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/stackedarea/stackedarea.js
@@ -0,0 +1,26 @@
+// dependencies
+define(['plugin/charts/_nvd3/nvd3'], function(NVD3) {
+
+// widget
+return Backbone.View.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary)
+ {
+ var nvd3 = new NVD3(this.app, this.options);
+ nvd3.draw(process_id, nv.models.stackedAreaChart(), chart, request_dictionary, function(nvd3_model) {
+ // make plot
+ nvd3_model.x(function(d) { return d.x })
+ .y(function(d) { return d.y })
+ .clipEdge(true);
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/charts/types.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -0,0 +1,39 @@
+// dependencies
+define(['plugin/charts/bardiagram/config',
+ //'plugin/charts/boxplot/config',
+ 'plugin/charts/histogram/config',
+ 'plugin/charts/horizontal/config',
+ 'plugin/charts/line/config',
+ 'plugin/charts/linewithfocus/config',
+ 'plugin/charts/piechart/config',
+ 'plugin/charts/scatterplot/config',
+ 'plugin/charts/stackedarea/config',
+ ], function(bardiagram,
+ //boxplot,
+ histogram,
+ horizontal,
+ line,
+ linewithfocus,
+ piechart,
+ scatterplot,
+ stackedarea
+ ) {
+
+// widget
+return Backbone.Model.extend(
+{
+ // types
+ defaults: {
+ 'bardiagram' : bardiagram,
+ //'boxplot' : boxplot,
+ 'horizontal' : horizontal,
+ 'histogram' : histogram,
+ 'line' : line,
+ 'linewithfocus' : linewithfocus,
+ 'piechart' : piechart,
+ 'scatterplot' : scatterplot,
+ 'stackedarea' : stackedarea
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/library/datasets.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/library/datasets.js
@@ -0,0 +1,149 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.Collection.extend(
+{
+ // list of datasets
+ list: {},
+
+ // initialize
+ initialize: function(app, options)
+ {
+ // link app
+ this.app = app;
+
+ // configure options
+ this.options = Utils.merge(options, this.optionsDefault);
+ },
+
+ // wait
+ request: function(options, success, error) {
+ // link this
+ var self = this;
+
+ // check if column data is requested
+ if (options.groups) {
+ this._fetch(options, success);
+ } else {
+ // check if dataset is available from cache
+ var dataset = this.list[options.id];
+ if (dataset) {
+ success(dataset);
+ return;
+ }
+
+ // request dataset
+ Utils.request('GET', config.root + 'api/datasets/' + options.id, {}, function(dataset) {
+ switch (dataset.state) {
+ case 'error':
+ if (error) {
+ error(dataset);
+ }
+ break;
+ default:
+ self.list[options.id] = dataset;
+ success(dataset);
+ }
+ });
+ }
+ },
+
+ // fetch data columns into dataset object
+ _fetch: function(options, callback) {
+ // set offset
+ var offset = options.start ? options.start : 0;
+
+ // set limit
+ var limit = Math.abs(options.end - options.start);
+ var query_limit = this.app.config.get('query_limit');
+ if (!limit || limit > query_limit) {
+ limit = query_limit;
+ }
+
+ // get column indices
+ var index_string = '';
+ var index_map = {};
+ var index_count = 0;
+ for (var i in options.groups) {
+ var group = options.groups[i];
+ for (var key in group.columns) {
+ var column = group.columns[key];
+
+ // add to index string
+ index_string += column + ',';
+
+ // add to dictionary
+ index_map[column] = index_count;
+
+ // increase counter
+ index_count++;
+ }
+ }
+ if (index_count == 0) {
+ callback({});
+ return;
+ }
+ index_string = index_string.substring(0, index_string.length - 1);
+
+ // initialize result dictionary
+ var result = options.groups.slice(0);
+ for (var i in result) {
+ result[i].values = [];
+ }
+
+ // make request
+ var self = this;
+ Utils.request('GET', config.root + 'api/datasets/' + options.id, {
+ data_type : 'raw_data',
+ provider : 'dataset-column',
+ limit : limit,
+ offset : offset,
+ indeces : index_string
+ }, function(response) {
+
+ // loop through rows
+ for (var i in response.data) {
+ // get row
+ var row = response.data[i];
+
+ // collect all data into the defined groups
+ for (var j in options.groups) {
+ // get group
+ var group = options.groups[j];
+
+ // initialize value
+ var value = {
+ x : parseInt(i) + offset
+ };
+
+ // fill value
+ for (var key in group.columns) {
+ // get column
+ var column = group.columns[key];
+
+ // identify column
+ var index = index_map[column];
+
+ // read value from row
+ var v = row[index];
+ if(isNaN(v) || !v) {
+ v = 0;
+ }
+
+ // add value to dictionary
+ value[key] = v;
+ }
+
+ // add to result
+ result[j].values.push(value);
+ }
+ }
+
+ // callback
+ callback(result);
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/library/deferred.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/library/deferred.js
@@ -0,0 +1,85 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// deferred process handler
+return Backbone.Model.extend(
+{
+ // queue
+ queue: [],
+
+ // list of currently registered processes
+ process: {},
+
+ // process counter
+ counter: 0,
+
+ // initialize
+ initialize: function()
+ {
+ // loop through queue and check states
+ this.on('refresh', function() {
+ if (this.counter == 0) {
+ for (var index in this.queue) {
+ // execute callback
+ this.queue[index]();
+
+ // remove callback
+ this.queue.splice(index, 1);
+ }
+ }
+ });
+ },
+
+ // executes callback once all processes are unregistered
+ execute: function(callback) {
+ // add wrapper to queue
+ this.queue.push(callback);
+
+ // trigger change
+ this.trigger('refresh');
+ },
+
+ // register process
+ register: function() {
+ // create unique id
+ var id = Utils.uuid();
+
+ // add process to queue
+ this.process[id] = true;
+
+ // increase process counter
+ this.counter++;
+
+ // log
+ console.debug('Deferred:register() - Registering ' + id);
+
+ // return unique id
+ return id;
+ },
+
+ // unregister process
+ done: function(id) {
+ // delete tag
+ delete this.process[id];
+
+ // decrease process counter
+ this.counter--;
+
+ // log
+ console.debug('Deferred:done() - Unregistering ' + id);
+
+ // trigger change
+ this.trigger('refresh');
+ },
+
+ // ready
+ ready: function() {
+ if (this.counter == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/library/jobs.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/library/jobs.js
@@ -0,0 +1,152 @@
+// dependencies
+define(['utils/utils'], function(Utils) {
+
+// widget
+return Backbone.Model.extend(
+{
+ // initialize
+ initialize: function(app, options) {
+ // link app
+ this.app = app;
+
+ // link options
+ this.options = Utils.merge(options, this.optionsDefault);
+ },
+
+ // clean
+ cleanup: function(chart) {
+ // cleanup previous dataset file
+ var previous = chart.get('dataset_id_job');
+ if (previous != '') {
+ var self = this;
+ Utils.request('PUT', config.root + 'api/histories/none/contents/' + previous, { deleted: true }, function() {
+ // update galaxy history
+ self._refreshHdas();
+ });
+
+ // reset id
+ chart.set('dataset_id_job', '');
+ }
+ },
+
+ // create job
+ submit: function(chart, settings_string, columns_string, success, error) {
+ // link this
+ var self = this;
+
+ // backup chart details
+ var chart_id = chart.id;
+ var chart_type = chart.get('type');
+
+ // get chart settings
+ var chart_settings = this.app.types.get(chart_type);
+
+ // configure tool
+ data = {
+ 'tool_id' : 'chartskit',
+ 'inputs' : {
+ 'input' : {
+ 'id' : chart.get('dataset_id'),
+ 'src' : 'hda'
+ },
+ 'module' : chart_type,
+ 'columns' : columns_string,
+ 'settings' : settings_string
+ }
+ }
+
+ // set chart state
+ chart.state('wait', 'Sending job request...');
+
+ // post job
+ Utils.request('POST', config.root + 'api/tools', data,
+ // success handler
+ function(response) {
+ if (!response.outputs || response.outputs.length == 0) {
+ chart.state('failed', 'Job submission failed. No response.');
+
+ // call error
+ error && error();
+ } else {
+ // update galaxy history
+ self._refreshHdas();
+
+ // get dataset
+ var job = response.outputs[0];
+
+ // check dataset
+ chart.state('wait', 'Job has been queued...');
+
+ // backup resulting dataset id
+ chart.set('dataset_id_job', job.id);
+
+ // save
+ this.app.storage.save();
+
+ // wait for job completion
+ self._loop(job.id, function(job) {
+ switch (job.state) {
+ case 'ok':
+ // update state
+ chart.state('wait', 'Job completed successfully...');
+
+ // execute success
+ success(job);
+
+ // stop loop
+ return true;
+ case 'error':
+ // update state
+ chart.state('failed', 'Job has failed. Please check the history for details.');
+
+ // call error
+ error && error();
+
+ // stop loop
+ return true;
+ case 'running':
+ // wait
+ chart.state('wait', 'Job is running...');
+
+ // continue loop
+ return false;
+ }
+ });
+ }
+ },
+ // error handler
+ function(response) {
+ var message = '';
+ if (response && response.message && response.message.data && response.message.data.input) {
+ message = response.message.data.input + '.';
+ }
+ // update state
+ chart.state('failed', 'This visualization requires the Charts-Kit. Please make sure it is installed. ' + message);
+
+ // call error
+ error && error();
+
+ }
+ );
+ },
+
+ // request job details
+ _loop: function(id, callback) {
+ var self = this;
+ Utils.request('GET', config.root + 'api/jobs/' + id, {}, function(job) {
+ if (!callback(job)) {
+ setTimeout(function() { self._loop(id, callback); }, self.app.config.get('query_timeout'));
+ }
+ });
+ },
+
+ // refresh history panel
+ _refreshHdas: function() {
+ // update galaxy history
+ if (Galaxy && Galaxy.currHistoryPanel) {
+ Galaxy.currHistoryPanel.refreshHdas();
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 3fccf761066931c39aa087bf7e132ed2ed65cb05 -r 089d1264d719891de3306684ee26fa0543577d55 config/plugins/visualizations/charts/static/library/portlet.js
--- a/config/plugins/visualizations/charts/static/library/portlet.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// dependencies
-define(['library/utils'], function(Utils) {
-
-// return
-return Backbone.View.extend(
-{
- // visibility
- visible: false,
-
- // defaults options
- optionsDefault: {
- label : '',
- icon : 'fa-tasks',
- buttons : null,
- body : null,
- height : null,
- operations : null,
- placement : 'bottom',
- overflow : 'auto'
- },
-
- // content
- $content : null,
-
- // initialize
- initialize : function(options) {
- // configure options
- this.options = Utils.merge(options, this.optionsDefault);
-
- // create new element
- this.setElement(this.template(this.options));
-
- // link content
- this.$content = this.$el.find('#content');
-
- // set content height
- if (this.options.height) {
- this.$el.find('#body').css('height', this.options.height);
- this.$el.find('#content').css('overflow', this.options.overflow);
- }
-
- // append buttons
- this.$buttons = $(this.el).find('#buttons');
- if (this.options.buttons) {
- // link functions
- var self = this;
- $.each(this.options.buttons, function(name, item) {
- item.$el.prop('id', name);
- self.$buttons.append(item.$el);
- });
- } else {
- this.$buttons.remove();
- }
-
- // append operations
- this.$operations = $(this.el).find('#operations');
- if (this.options.operations) {
- // link functions
- var self = this;
- $.each(this.options.operations, function(name, item) {
- item.$el.prop('id', name);
- self.$operations.append(item.$el);
- });
- }
-
- // add body
- if(this.options.body) {
- this.append(this.options.body);
- }
- },
-
- // append
- append: function($el) {
- this.$content.append(Utils.wrap($el));
- },
-
- // content
- content: function() {
- return this.$content;
- },
-
- // hide modal
- show: function(){
- // fade in
- this.$el.fadeIn('fast');
-
- // set flag
- this.visible = true;
- },
-
- // hide modal
- hide: function(){
- // fade out
- this.$el.fadeOut('fast');
-
- // set flag
- this.visible = false;
- },
-
- // enable buttons
- enableButton: function(id) {
- this.$buttons.find('#' + id).prop('disabled', false);
- },
-
- // disable buttons
- disableButton: function(id) {
- this.$buttons.find('#' + id).prop('disabled', true);
- },
-
- // enable operation
- hideOperation: function(id) {
- this.$operations.find('#' + id).hide();
- },
-
- // disable operation
- showOperation: function(id) {
- this.$operations.find('#' + id).show();
- },
-
- // set operation
- setOperation: function(id, callback) {
- var $el = this.$operations.find('#' + id);
- $el.off('click');
- $el.on('click', callback);
- },
-
- // label
- label: function(new_label) {
- var $el = this.$el.find('#label');
- if (new_label) {
- $el.html(new_label);
- }
- return $el.html();
- },
-
- // fill regular modal template
- template: function(options) {
- var tmpl = '<div class="toolForm">';
-
- if (options.label || options.icon) {
- tmpl += '<div id="title" class="toolFormTitle" style="overflow:hidden;">' +
- '<div id="operations" style="float: right;"></div>' +
- '<div style="overflow: hidden">';
-
- if (options.icon)
- tmpl += '<i style="padding-top: 3px; float: left; font-size: 1.2em" class="icon fa ' + options.icon + '"> </i>';
-
- tmpl += '<div id="label" style="padding-top: 2px; float: left;">' + options.label + '</div>';
-
- tmpl += '</div>' +
- '</div>';
- }
- tmpl += '<div id="body" class="toolFormBody">';
-
- if (options.placement == 'top') {
- tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
- }
-
- tmpl += '<div id="content" class="content" style="height: inherit; padding: 10px;"></div>';
-
- if (options.placement == 'bottom') {
- tmpl += '<div id="buttons" class="buttons" style="height: 50px; padding: 10px;"></div>';
- }
-
- tmpl += '</div>' +
- '</div>';
- return tmpl;
- }
-});
-
-});
This diff is so big that we needed to truncate the remainder.
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 exception handling when updating an installed repository to a revision that include newly defined dependency definitions.
by commits-noreply@bitbucket.org 03 Apr '14
by commits-noreply@bitbucket.org 03 Apr '14
03 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ea1fbe9d5bdb/
Changeset: ea1fbe9d5bdb
User: greg
Date: 2014-04-03 18:00:25
Summary: Add exception handling when updating an installed repository to a revision that include newly defined dependency definitions.
Affected #: 1 file
diff -r 4f3190509ba240ae8227b2321237876e3e66ecb2 -r ea1fbe9d5bdb9435830c3f2d2dbc623a22d4b1a4 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
@@ -976,10 +976,22 @@
# update_to_changeset_revision() method. We need to get the id of the same repository from the
# Tool Shed side.
repository = suc.get_tool_shed_repository_by_id( trans, updating_repository_id )
- url = suc.url_join( tool_shed_url,
- 'repository/get_repository_id?name=%s&owner=%s' % \
- ( str( repository.name ), str( repository.owner ) ) )
- repository_ids = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ # For backward compatibility to the 12/20/12 Galaxy release.
+ try:
+ url = suc.url_join( tool_shed_url,
+ 'repository/get_repository_id?name=%s&owner=%s' % \
+ ( str( repository.name ), str( repository.owner ) ) )
+ repository_ids = common_util.tool_shed_get( trans.app, tool_shed_url, url )
+ except Exception, e:
+ # The Tool Shed cannot handle the get_repository_id request, so the code must be older than the
+ # 04/2014 Galaxy release when it was introduced. It will be safest to error out and let the
+ # Tool Shed admin update the Tool Shed to a later release.
+ err_msg = 'The Tool Shed %s is running a code revision that does not ' % str( tool_shed_url)
+ err_msg += 'allow updating an installed repository where the updates include newly defined repository '
+ err_msg += 'or tool dependency definitions, so the repository %s cannot ' % str( repository.name )
+ err_msg += 'be updated at this time. Contact the Tool Shed administrator if possible and'
+ err_msg += 'ask if they can update the Tool Shed code to the latest release.'
+ return trans.show_error_message( err_msg )
changeset_revisions = updating_to_changeset_revision
else:
changeset_revisions = kwd.get( 'changeset_revisions', None )
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: dan: Change Biostar 'submit' parameter to be called 'action'. Resolves needing to use workaround of 'click()' on submit button instead of submit() on form.
by commits-noreply@bitbucket.org 03 Apr '14
by commits-noreply@bitbucket.org 03 Apr '14
03 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4f3190509ba2/
Changeset: 4f3190509ba2
User: dan
Date: 2014-04-03 17:17:47
Summary: Change Biostar 'submit' parameter to be called 'action'. Resolves needing to use workaround of 'click()' on submit button instead of submit() on form.
Affected #: 2 files
diff -r 59bd7349a128f06de64f6656f553887b09f18ea2 -r 4f3190509ba240ae8227b2321237876e3e66ecb2 lib/galaxy/util/biostar.py
--- a/lib/galaxy/util/biostar.py
+++ b/lib/galaxy/util/biostar.py
@@ -142,6 +142,6 @@
payload[ 'content' ] = "%s<br />%s" % ( payload['content'], payload2['content'] )
if 'tag_val' in payload2:
payload[ 'tag_val' ] = ','.join( [ payload2[ 'tag_val' ], payload[ 'tag_val' ] ] )
- if 'submit' not in payload:
- payload[ 'submit' ] = 1 #Automatically post bug reports to biostar
+ if 'action' not in payload:
+ payload[ 'action' ] = 1 #Automatically post bug reports to biostar
return payload
diff -r 59bd7349a128f06de64f6656f553887b09f18ea2 -r 4f3190509ba240ae8227b2321237876e3e66ecb2 templates/webapps/galaxy/biostar/post_redirect.mako
--- a/templates/webapps/galaxy/biostar/post_redirect.mako
+++ b/templates/webapps/galaxy/biostar/post_redirect.mako
@@ -4,9 +4,8 @@
${parent.javascripts()}
<script>
$( document ).ready( function(){
- $("#postRedirect").hide();
- ##need to use 'click()' on submit button instead of submit() on form, since Biostar uses a parameter named 'submit'
- $("#GalaxySubmitPostRedirectForm").click();
+ $("div#postRedirect").hide();
+ $("form#postRedirectForm").submit();
});
</script></%def>
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