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
February 2013
- 2 participants
- 189 discussions
commit/galaxy-central: dan: Do not install Data Managers from the Tool Shed into the Tool Panel.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2664d904641a/
changeset: 2664d904641a
user: dan
date: 2013-02-15 19:34:43
summary: Do not install Data Managers from the Tool Shed into the Tool Panel.
affected #: 2 files
diff -r 0c8763c8d52918ee15f83288d6d7cef153267239 -r 2664d904641abdc1ed6a2f972eb5aeefa8f93703 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -469,13 +469,14 @@
section_name = ''
section_version = ''
for tool_dict in tool_dicts:
- guid = tool_dict[ 'guid' ]
- tool_config = tool_dict[ 'tool_config' ]
- tool_section_dict = dict( tool_config=tool_config, id=section_id, name=section_name, version=section_version )
- if guid in tool_panel_dict:
- tool_panel_dict[ guid ].append( tool_section_dict )
- else:
- tool_panel_dict[ guid ] = [ tool_section_dict ]
+ if tool_dict.get( 'add_to_tool_panel', True ):
+ guid = tool_dict[ 'guid' ]
+ tool_config = tool_dict[ 'tool_config' ]
+ tool_section_dict = dict( tool_config=tool_config, id=section_id, name=section_name, version=section_version )
+ if guid in tool_panel_dict:
+ tool_panel_dict[ guid ].append( tool_section_dict )
+ else:
+ tool_panel_dict[ guid ] = [ tool_section_dict ]
return tool_panel_dict
def generate_tool_panel_dict_for_tool_config( guid, tool_config, tool_sections=None ):
"""
diff -r 0c8763c8d52918ee15f83288d6d7cef153267239 -r 2664d904641abdc1ed6a2f972eb5aeefa8f93703 lib/galaxy/util/shed_util_common.py
--- a/lib/galaxy/util/shed_util_common.py
+++ b/lib/galaxy/util/shed_util_common.py
@@ -1614,7 +1614,8 @@
tool_config=tool_config,
tool_type=tool.tool_type,
requirements=tool_requirements,
- tests=tool_tests )
+ tests=tool_tests,
+ add_to_tool_panel=tool.tool_type not in TOOL_TYPES_NOT_IN_TOOL_PANEL )
if 'tools' in metadata_dict:
metadata_dict[ 'tools' ].append( tool_dict )
else:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0c8763c8d529/
changeset: 0c8763c8d529
user: dan
date: 2013-02-15 19:19:30
summary: Minor formating fix for 22f7938bfa33.
affected #: 1 file
diff -r 22f7938bfa3331e1f4e03b67b85b1f9602fd1e85 -r 0c8763c8d52918ee15f83288d6d7cef153267239 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
@@ -705,7 +705,7 @@
new_install=True )
if 'data_manager' in metadata_dict:
new_data_managers = shed_util.install_data_managers( trans.app, trans.app.config.shed_data_manager_config_file, metadata_dict, shed_config_dict, relative_install_dir,
- tool_shed_repository, repository_tools_tups )
+ tool_shed_repository, repository_tools_tups )
if 'datatypes' in metadata_dict:
tool_shed_repository.status = trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
if not tool_shed_repository.includes_datatypes:
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: Handle Data Managers when reactivating a deactivated Tool Shed Repository.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/22f7938bfa33/
changeset: 22f7938bfa33
user: dan
date: 2013-02-15 19:18:00
summary: Handle Data Managers when reactivating a deactivated Tool Shed Repository.
affected #: 2 files
diff -r f53c0039c2c07979b54ce42d680aabbce3be1116 -r 22f7938bfa3331e1f4e03b67b85b1f9602fd1e85 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -42,6 +42,11 @@
shed_tool_conf,
tool_panel_dict,
new_install=False )
+ if repository.includes_data_managers:
+ tp, data_manager_relative_install_dir = repository.get_tool_relative_path( trans.app )
+ data_manager_relative_install_dir = os.path.join( data_manager_relative_install_dir, repository.name ) #hack to add repository.name here, which is actually the root of the installed repository
+ new_data_managers = install_data_managers( trans.app, trans.app.config.shed_data_manager_config_file, metadata, repository.get_shed_config_dict( trans.app ), data_manager_relative_install_dir,
+ repository, repository_tools_tups )
trans.sa_session.add( repository )
trans.sa_session.flush()
if repository.includes_datatypes:
diff -r f53c0039c2c07979b54ce42d680aabbce3be1116 -r 22f7938bfa3331e1f4e03b67b85b1f9602fd1e85 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
@@ -704,7 +704,7 @@
tool_panel_dict=tool_panel_dict,
new_install=True )
if 'data_manager' in metadata_dict:
- rval = shed_util.install_data_managers( trans.app, trans.app.config.shed_data_manager_config_file, metadata_dict, shed_config_dict, relative_install_dir,
+ new_data_managers = shed_util.install_data_managers( trans.app, trans.app.config.shed_data_manager_config_file, metadata_dict, shed_config_dict, relative_install_dir,
tool_shed_repository, repository_tools_tups )
if 'datatypes' in metadata_dict:
tool_shed_repository.status = trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f53c0039c2c0/
changeset: f53c0039c2c0
user: jgoecks
date: 2013-02-15 18:44:08
summary: Use strict equality operators.
affected #: 1 file
diff -r 8484a745317e5402e987401c85359e8c7a513445 -r f53c0039c2c07979b54ce42d680aabbce3be1116 static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -236,8 +236,8 @@
ready_deferred = $.Deferred(),
// If requesting raw data, query dataset state; if requesting (converted) data,
// need to query converted datasets state.
- query_type = (this.get('data_type') == 'raw_data' ? 'state' :
- this.get('data_type') == 'data' ? 'converted_datasets_state' : "error" ),
+ query_type = (this.get('data_type') === 'raw_data' ? 'state' :
+ this.get('data_type') === 'data' ? 'converted_datasets_state' : "error" ),
ss_deferred = new util_mod.ServerStateDeferred({
ajax_settings: {
url: this.get('dataset').url(),
@@ -575,7 +575,7 @@
*/
get_chrom_region: function(chr_name) {
var chrom_info = _.find(this.get_chroms_info(), function(chrom_info) {
- return chrom_info.chrom == chr_name;
+ return chrom_info.chrom === chr_name;
});
return new GenomeRegion({
chrom: chrom_info.chrom,
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: Give Data Managers from Tool Sheds their own guid.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8484a745317e/
changeset: 8484a745317e
user: dan
date: 2013-02-15 18:01:44
summary: Give Data Managers from Tool Sheds their own guid.
affected #: 3 files
diff -r ef0e9bf34c0b22dd355759478aa85fc2d46d49d4 -r 8484a745317e5402e987401c85359e8c7a513445 lib/galaxy/tools/data_manager/manager.py
--- a/lib/galaxy/tools/data_manager/manager.py
+++ b/lib/galaxy/tools/data_manager/manager.py
@@ -64,31 +64,38 @@
self.managed_data_tables[ data_table_name ].append( data_manager )
def get_manager( self, *args, **kwds ):
return self.data_managers.get( *args, **kwds )
- def remove_manager( self, manager_id ):
- data_manager = self.get_manager( manager_id, None )
- if data_manager is not None:
- del self.data_managers[ manager_id ]
- #remove tool from toolbox
- if data_manager.tool:
- self.app.toolbox.remove_tool_by_id( data_manager.tool.id )
- #determine if any data_tables are no longer tracked
- for data_table_name in data_manager.data_tables.keys():
- remove_data_table_tracking = True
- for other_data_manager in self.data_managers.itervalues():
- if data_table_name in other_data_manager.data_tables:
- remove_data_table_tracking = False
- break
- if remove_data_table_tracking and data_table_name in self.managed_data_tables:
- del self.managed_data_tables[ data_table_name ]
+ def remove_manager( self, manager_ids ):
+ if not isinstance( manager_ids, list ):
+ manager_ids = [ manager_ids ]
+ for manager_id in manager_ids:
+ data_manager = self.get_manager( manager_id, None )
+ if data_manager is not None:
+ del self.data_managers[ manager_id ]
+ #remove tool from toolbox
+ if data_manager.tool:
+ self.app.toolbox.remove_tool_by_id( data_manager.tool.id )
+ #determine if any data_tables are no longer tracked
+ for data_table_name in data_manager.data_tables.keys():
+ remove_data_table_tracking = True
+ for other_data_manager in self.data_managers.itervalues():
+ if data_table_name in other_data_manager.data_tables:
+ remove_data_table_tracking = False
+ break
+ if remove_data_table_tracking and data_table_name in self.managed_data_tables:
+ del self.managed_data_tables[ data_table_name ]
class DataManager( object ):
+ GUID_TYPE = 'data_manager'
+ DEFAULT_VERSION = "0.0.1"
+
def __init__( self, data_managers, elem=None, tool_path=None ):
self.data_managers = data_managers
self.declared_id = None
self.name = None
self.description = None
+ self.version = self.DEFAULT_VERSION
+ self.guid = None
self.tool = None
- self.tool_guid = None
self.data_tables = odict()
self.output_ref_by_data_table = {}
self.move_by_data_table_column = {}
@@ -98,12 +105,14 @@
def load_from_element( self, elem, tool_path ):
assert elem.tag == 'data_manager', 'A data manager configuration must have a "data_manager" tag as the root. "%s" is present' % ( root.tag )
self.declared_id = elem.get( 'id', None )
+ self.guid = elem.get( 'guid', None )
path = elem.get( 'tool_file', None )
+ tool_guid = None
if path is None:
tool_elem = elem.find( 'tool' )
assert tool_elem is not None, "Error loading tool for data manager. Make sure that a tool_file attribute or a tool tag set has been defined:\n%s" % ( util.xml_to_string( elem ) )
path = tool_elem.get( "file", None )
- self.tool_guid = tool_elem.get( "guid", None )
+ tool_guid = tool_elem.get( "guid", None )
#use shed_conf_file to determine tool_path
shed_conf_file = elem.get( "shed_conf_file", None )
if shed_conf_file:
@@ -111,7 +120,7 @@
if shed_conf:
tool_path = shed_conf.get( "tool_path", tool_path )
assert path is not None, "A tool file path could not be determined:\n%s" % ( util.xml_to_string( elem ) )
- self.load_tool( os.path.join( tool_path, path ), guid=self.tool_guid, data_manager_id=self.id )
+ self.load_tool( os.path.join( tool_path, path ), guid=tool_guid, data_manager_id=self.id )
self.name = elem.get( 'name', self.tool.name )
self.description = elem.get( 'description', self.tool.description )
@@ -164,7 +173,7 @@
self.move_by_data_table_column[ data_table_name ][ data_table_coumn_name ] = dict( type=move_type, source_base=source_base, source_value=source_value, target_base=target_base, target_value=target_value, relativize_symlinks=relativize_symlinks )
@property
def id( self ):
- return self.tool_guid or self.declared_id #if we have a tool with a guid, we will use that as the tool_manager id
+ return self.guid or self.declared_id #if we have a guid, we will use that as the data_manager id
def load_tool( self, tool_filename, guid=None, data_manager_id=None ):
tool = self.data_managers.app.toolbox.load_tool( tool_filename, guid=guid, data_manager_id=data_manager_id )
self.data_managers.app.toolbox.data_manager_tools[ tool.id ] = tool
diff -r ef0e9bf34c0b22dd355759478aa85fc2d46d49d4 -r 8484a745317e5402e987401c85359e8c7a513445 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1194,7 +1194,11 @@
if data_manager_dict is None:
log.error( "Data manager metadata is not defined properly for '%s'." % ( data_manager_id ) )
continue
-
+ guid = data_manager_dict.get( 'guid', None )
+ if guid is None:
+ log.error( "Data manager guid '%s' is not set in metadata for '%s'." % ( guid, data_manager_id ) )
+ continue
+ elem.set( 'guid', guid )
tool_guid = data_manager_dict.get( 'tool_guid', None )
if tool_guid is None:
log.error( "Data manager tool guid '%s' is not set in metadata for '%s'." % ( tool_guid, data_manager_id ) )
@@ -1510,27 +1514,18 @@
def remove_from_data_manager( app, repository ):
metadata_dict = repository.metadata
if metadata_dict and 'data_manager' in metadata_dict:
- data_manager_tool_guids = [ data_manager_dict.get( 'tool_guid' ) for data_manager_dict in metadata_dict.get( 'data_manager', {} ).get( 'data_managers', {} ).itervalues() if 'tool_guid' in data_manager_dict ]
shed_data_manager_conf_filename = app.config.shed_data_manager_config_file
tree = util.parse_xml( shed_data_manager_conf_filename )
root = tree.getroot()
assert root.tag == 'data_managers', 'The file provided (%s) for removing data managers from is not a valid data manager xml file.' % ( shed_data_manager_conf_filename )
+ guids = [ data_manager_dict.get( 'guid' ) for data_manager_dict in metadata_dict.get( 'data_manager', {} ).get( 'data_managers', {} ).itervalues() if 'guid' in data_manager_dict ]
config_elems = []
for elem in root:
- keep_elem = True
- if elem.tag == 'data_manager':
- tool_elem = elem.find( 'tool' )
- if tool_elem is not None:
- tool_guid = tool_elem.get( 'guid', None )
- if tool_guid in data_manager_tool_guids:
- keep_elem = False
- if keep_elem:
+ if elem.tag != 'data_manager' or elem.get( 'guid', None ) not in guids:
config_elems.append( elem )
- #remove data manager from in memory
- for data_manager_tool_guids in data_manager_tool_guids:
- #for shed-based data managers, the data_manager id is the same as the tool guid
- app.data_managers.remove_manager( data_manager_tool_guids )
- # Persist the altered shed_tool_config file.
+ #remove data managers from in memory
+ app.data_managers.remove_manager( guids )
+ # Persist the altered shed_data_manager_config file.
suc.data_manager_config_elems_to_xml_file( app, config_elems, shed_data_manager_conf_filename )
def remove_from_shed_tool_config( trans, shed_tool_conf_dict, guids_to_remove ):
# A tool shed repository is being uninstalled so change the shed_tool_conf file. Parse the config file to generate the entire list
diff -r ef0e9bf34c0b22dd355759478aa85fc2d46d49d4 -r 8484a745317e5402e987401c85359e8c7a513445 lib/galaxy/util/shed_util_common.py
--- a/lib/galaxy/util/shed_util_common.py
+++ b/lib/galaxy/util/shed_util_common.py
@@ -13,6 +13,7 @@
import sqlalchemy.orm.exc
from galaxy.tools.parameters import dynamic_options
from galaxy.tool_shed import encoding_util
+from galaxy.tools.data_manager.manager import DataManager
from galaxy import eggs
import pkg_resources
@@ -1012,7 +1013,7 @@
def generate_clone_url_for_repository_in_tool_shed( trans, repository ):
"""Generate the URL for cloning a repository that is in the tool shed."""
base_url = url_for( '/', qualified=True ).rstrip( '/' )
- if trans.user:
+ if trans and trans.user:
protocol, base = base_url.split( '://' )
username = '%s@' % trans.user.username
return '%s://%s%s/repos/%s/%s' % ( protocol, username, base, repository.user.username, repository.name )
@@ -1038,10 +1039,14 @@
tools[tool_conf_name] = tool
repo_path = repository.repo_path( app )
try:
+ #Galaxy Side
repo_files_directory = repository.repo_files_directory( app )
repo_dir = repo_files_directory
+ repository_clone_url = generate_clone_url_for_installed_repository( app, repository )
except AttributeError:
+ #Tool Shed side
repo_files_directory = repo_path
+ repository_clone_url = generate_clone_url_for_repository_in_tool_shed( None, repository )
relative_data_manager_dir = util.relpath( os.path.split( data_manager_config_filename )[0], repo_dir )
rel_data_manager_config_filename = os.path.join( relative_data_manager_dir, os.path.split( data_manager_config_filename )[1] )
data_managers = {}
@@ -1057,6 +1062,8 @@
if data_manager_id is None:
log.error( 'Data Manager entry is missing id attribute in "%s".' % ( data_manager_config_filename ) )
continue
+ version = data_manager_elem.get( 'version', DataManager.DEFAULT_VERSION )
+ guid = generate_guid_for_object( repository_clone_url, DataManager.GUID_TYPE, data_manager_id, version )
data_tables = []
if tool_file is None:
log.error( 'Data Manager entry is missing tool_file attribute in "%s".' % ( data_manager_config_filename ) )
@@ -1073,7 +1080,7 @@
if tool is None:
log.error( "Unable to determine tools metadata for '%s'." % ( data_manager_metadata_tool_file ) )
continue
- data_managers[ data_manager_id ] = { 'tool_config_file': data_manager_metadata_tool_file, 'data_tables': data_tables, 'tool_guid': tool['guid'] }
+ data_managers[ data_manager_id ] = { 'guid': guid, 'version': version, 'tool_config_file': data_manager_metadata_tool_file, 'data_tables': data_tables, 'tool_guid': tool['guid'] }
log.debug( 'Loaded Data Manager tool_files: %s' % ( tool_file ) )
return metadata_dict
def generate_datatypes_metadata( datatypes_config, metadata_dict ):
@@ -1555,6 +1562,9 @@
version_elem = SubElement( tool_elem, 'version' )
version_elem.text = tool.version
return tool_elem
+def generate_guid_for_object( repository_clone_url, guid_type, obj_id, version ):
+ tmp_url = clean_repository_clone_url( repository_clone_url )
+ return '%s/%s/%s/%s' % ( tmp_url, guid_type, obj_id, version )
def generate_tool_guid( repository_clone_url, tool ):
"""
Generate a guid for the installed tool. It is critical that this guid matches the guid for
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ef0e9bf34c0b/
changeset: ef0e9bf34c0b
user: dan
date: 2013-02-15 17:58:29
summary: Add missing Data Manager controller.
affected #: 1 file
diff -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 -r ef0e9bf34c0b22dd355759478aa85fc2d46d49d4 lib/galaxy/webapps/galaxy/controllers/data_manager.py
--- /dev/null
+++ b/lib/galaxy/webapps/galaxy/controllers/data_manager.py
@@ -0,0 +1,79 @@
+from galaxy import web
+from galaxy.web.base.controller import BaseUIController
+from galaxy.util.json import from_json_string
+
+import pkg_resources;
+pkg_resources.require( "Paste" )
+import paste.httpexceptions
+
+#set up logger
+import logging
+log = logging.getLogger( __name__ )
+
+class DataManager( BaseUIController ):
+
+ @web.expose
+ def index( self, trans, **kwd ):
+ not_is_admin = not trans.user_is_admin()
+ if not_is_admin and not trans.app.config.enable_data_manager_user_view:
+ raise paste.httpexceptions.HTTPUnauthorized( "This Galaxy instance is not configured to allow non-admins to view the data manager." )
+ message = kwd.get( 'message' )
+ status = kwd.get( 'status', 'info' )
+ return trans.fill_template( "data_manager/index.mako", data_managers=trans.app.data_managers, view_only=not_is_admin, message=message, status=status )
+
+ @web.expose
+ def manage_data_manager( self, trans, **kwd ):
+ not_is_admin = not trans.user_is_admin()
+ if not_is_admin and not trans.app.config.enable_data_manager_user_view:
+ raise paste.httpexceptions.HTTPUnauthorized( "This Galaxy instance is not configured to allow non-admins to view the data manager." )
+ message = kwd.get( 'message' )
+ status = kwd.get( 'status', 'info' )
+ data_manager_id = kwd.get( 'id', None )
+ data_manager = trans.app.data_managers.get_manager( data_manager_id )
+ if data_manager is None:
+ return trans.response.send_redirect( web.url_for( controller="data_manager", action="index", message="Invalid Data Manager (%s) was requested" % data_manager_id, status="error" ) )
+ jobs = reversed( [ assoc.job for assoc in trans.sa_session.query( trans.app.model.DataManagerJobAssociation ).filter_by( data_manager_id=data_manager_id ) ] )
+ return trans.fill_template( "data_manager/manage_data_manager.mako", data_manager=data_manager, jobs=jobs, view_only=not_is_admin, message=message, status=status )
+
+ @web.expose
+ def view_job( self, trans, **kwd ):
+ not_is_admin = not trans.user_is_admin()
+ if not_is_admin and not trans.app.config.enable_data_manager_user_view:
+ raise paste.httpexceptions.HTTPUnauthorized( "This Galaxy instance is not configured to allow non-admins to view the data manager." )
+ message = kwd.get( 'message' )
+ status = kwd.get( 'status', 'info' )
+ job_id = kwd.get( 'id', None )
+ try:
+ job_id = trans.security.decode_id( job_id )
+ job = trans.app.model.Job.get( job_id )
+ except Exception, e:
+ job = None
+ log.error( "Bad job id (%s) passed to view_job: %s" % ( job_id, e ) )
+ if not job:
+ return trans.response.send_redirect( web.url_for( controller="data_manager", action="index",message="Invalid job (%s) was requested" % job_id, status="error" ) )
+ data_manager_id = job.data_manager_association.data_manager_id
+ data_manager = trans.app.data_managers.get_manager( data_manager_id )
+ hdas = [ assoc.dataset for assoc in job.get_output_datasets() ]
+ data_manager_output = []
+ for hda in hdas:
+ data_manager_json = from_json_string( open( hda.get_file_name() ).read() )
+ values = []
+ for key, value in data_manager_json.get( 'data_tables', {} ).iteritems():
+ values.append( ( key, value ) )
+ data_manager_output.append( values )
+ return trans.fill_template( "data_manager/view_job.mako", data_manager=data_manager, job=job, view_only=not_is_admin, hdas=hdas, data_manager_output=data_manager_output, message=message, status=status )
+
+ @web.expose
+ def manage_data_table( self, trans, **kwd ):
+ not_is_admin = not trans.user_is_admin()
+ if not_is_admin and not trans.app.config.enable_data_manager_user_view:
+ raise paste.httpexceptions.HTTPUnauthorized( "This Galaxy instance is not configured to allow non-admins to view the data manager." )
+ message = kwd.get( 'message' )
+ status = kwd.get( 'status', 'info' )
+ data_table_name = kwd.get( 'table_name', None )
+ if not data_table_name:
+ return trans.response.send_redirect( web.url_for( controller="data_manager", action="index" ) )
+ data_table = trans.app.tool_data_tables.get( data_table_name, None )
+ if data_table is None:
+ return trans.response.send_redirect( web.url_for( controller="data_manager", action="index", message="Invalid Data table (%s) was requested" % data_table_name, status="error" ) )
+ return trans.fill_template( "data_manager/manage_data_table.mako", data_table=data_table, view_only=not_is_admin, message=message, status=status )
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: inithello: Enhance tool shed functional tests to be more informative when errors occur.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d04aa3ad6132/
changeset: d04aa3ad6132
user: inithello
date: 2013-02-15 17:42:19
summary: Enhance tool shed functional tests to be more informative when errors occur.
affected #: 23 files
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -941,7 +941,10 @@
for data_table in data_tables:
if 'name' in table_elem.attrib and table_elem.attrib[ 'name' ] == data_table:
file_elem = table_elem.find( 'file' )
- assert os.path.exists( file_elem.attrib[ 'path' ] ), 'Tool data table file %s not found.' % file_elem.path
+ file_path = file_elem.get( 'path', None )
+ full_path = os.path.join( self.tool_data_path, file_path )
+ assert file_path is not None, 'No file path configured for this data table.'
+ assert os.path.exists( full_path ), 'Tool data table file %s not found.' % full_path
found = True
break
assert found, 'No entry for %s in %s.' % ( data_table, self.shed_tool_data_table_conf )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_0000_basic_repository_features.py
--- a/test/tool_shed/functional/test_0000_basic_repository_features.py
+++ b/test/tool_shed/functional/test_0000_basic_repository_features.py
@@ -83,7 +83,9 @@
repository = test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
self.logout()
self.login( email=common.admin_email, username=common.admin_username )
- self.set_repository_malicious( repository, set_malicious=True, strings_displayed=[ 'The repository tip has been defined as malicious.' ] )
+ self.set_repository_malicious( repository,
+ set_malicious=True,
+ strings_displayed=[ 'The repository tip has been defined as malicious.' ] )
self.set_repository_malicious( repository,
set_malicious=False,
strings_displayed=[ 'The repository tip has been defined as <b>not</b> malicious.' ] )
@@ -92,8 +94,8 @@
self.set_repository_deprecated( repository,
strings_displayed=[ 'has been marked as deprecated', 'Mark as not deprecated' ] )
self.display_manage_repository_page( repository,
- strings_displayed=[ 'This repository has been marked as deprecated' ],
- strings_not_displayed=[ 'Upload files', 'Reset all repository metadata' ] )
+ strings_displayed=[ 'This repository has been marked as deprecated' ],
+ strings_not_displayed=[ 'Upload files', 'Reset all repository metadata' ] )
self.browse_repository( repository, strings_not_displayed=[ 'Upload files' ] )
self.set_repository_deprecated( repository,
strings_displayed=[ 'has been marked as not deprecated', 'Mark as deprecated' ],
@@ -197,16 +199,18 @@
def test_0090_verify_reserved_repository_name_handling( self ):
'''Check that reserved repository names are handled correctly.'''
category = test_db_util.get_category_by_name( 'Test 0000 Basic Repository Features 1' )
+ error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a repository name.'
self.get_or_create_repository( name='repos',
description=repository_description,
long_description=repository_long_description,
owner=common.test_user_1_name,
category_id=self.security.encode_id( category.id ),
- strings_displayed=[ 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a repository name.' ] )
+ strings_displayed=[ error_message ] )
def test_0100_verify_reserved_username_handling( self ):
'''Check that reserved usernames are handled correctly.'''
self.logout()
self.login( email='baduser(a)bx.psu.edu', username='repos' )
test_user_1 = test_db_util.get_user( 'baduser(a)bx.psu.edu' )
assert test_user_1 is None, 'Creating user with public name "repos" succeeded.'
- self.check_for_strings( strings_displayed=[ 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.' ] )
+ error_message = 'The term <b>repos</b> is a reserved word in the tool shed, so it cannot be used as a public user name.'
+ self.check_for_strings( strings_displayed=[ error_message ] )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_0020_basic_repository_dependencies.py
--- a/test/tool_shed/functional/test_0020_basic_repository_dependencies.py
+++ b/test/tool_shed/functional/test_0020_basic_repository_dependencies.py
@@ -6,8 +6,8 @@
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
emboss_repository_name = 'emboss_0020'
-emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
-emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
+emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
+emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
class TestBasicRepositoryDependencies( ShedTwillTestCase ):
'''Testing emboss 5 with repository dependencies.'''
@@ -93,8 +93,8 @@
'emboss',
'5.0.0',
'package',
- datatypes_repository_name,
- common.test_user_1_name,
+ 'emboss_datatypes_0020',
+ 'user1',
changeset_revision,
'Repository dependencies' ]
self.display_manage_repository_page( repository, strings_displayed=strings_displayed )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_0030_repository_dependency_revisions.py
--- a/test/tool_shed/functional/test_0030_repository_dependency_revisions.py
+++ b/test/tool_shed/functional/test_0030_repository_dependency_revisions.py
@@ -1,6 +1,7 @@
from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
import tool_shed.base.test_db_util as test_db_util
-
+import logging
+log = logging.getLogger(__name__)
datatypes_repository_name = 'emboss_datatypes_0030'
datatypes_repository_description = "Galaxy applicable data formats used by Emboss tools."
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
@@ -8,8 +9,8 @@
emboss_repository_name = 'emboss_0030'
emboss_5_repository_name = 'emboss_5_0030'
emboss_6_repository_name = 'emboss_6_0030'
-emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
-emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
+emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
+emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
class TestRepositoryDependencyRevisions( ShedTwillTestCase ):
'''Test dependencies on different revisions of a repository.'''
@@ -91,10 +92,10 @@
self.login( email=common.test_user_1_email, username=common.test_user_1_name )
category = test_db_util.get_category_by_name( 'Test 0030 Repository Dependency Revisions' )
repository = self.get_or_create_repository( name=emboss_repository_name,
- description=emboss_repository_description,
- long_description=emboss_repository_long_description,
- owner=common.test_user_1_name,
- category_id=self.security.encode_id( category.id ) )
+ description=emboss_repository_description,
+ long_description=emboss_repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ) )
self.upload_file( repository,
filename='emboss/emboss.tar',
filepath=None,
@@ -175,14 +176,8 @@
datatypes_tip = self.get_repository_tip( datatypes_repository )
# Iterate through all metadata revisions and check for repository dependencies.
for metadata, changeset_revision in repository_metadata:
- strings_displayed = [ str( metadata_elem ) for metadata_elem in metadata[ 'repository_dependencies' ][ 'repository_dependencies' ][ 0 ] ]
- # Remove the tool shed URL, because that's not displayed on the page (yet?)
- strings_displayed.pop( strings_displayed.index( self.url ) )
# Add the dependency description and datatypes repository details to the strings to check.
- strings_displayed.extend( [ metadata[ 'repository_dependencies' ][ 'description' ],
- datatypes_repository_name,
- datatypes_repository.user.username,
- datatypes_tip ] )
+ strings_displayed.extend( [ 'Emboss requires the Emboss', 'emboss_datatypes_0030', 'user1', datatypes_tip ] )
strings_displayed.extend( [ 'Tool dependencies', 'emboss', '5.0.0', 'package' ] )
self.display_manage_repository_page( repository,
changeset_revision=changeset_revision,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_0040_repository_circular_dependencies.py
--- a/test/tool_shed/functional/test_0040_repository_circular_dependencies.py
+++ b/test/tool_shed/functional/test_0040_repository_circular_dependencies.py
@@ -2,12 +2,12 @@
import tool_shed.base.test_db_util as test_db_util
freebayes_repository_name = 'freebayes_0040'
-freebayes_repository_description = "Galaxy's freebayes tool"
-freebayes_repository_long_description = "Long description of Galaxy's freebayes tool"
+freebayes_repository_description = "Galaxy's freebayes tool for test 0040"
+freebayes_repository_long_description = "Long description of Galaxy's freebayes tool for test 0040"
filtering_repository_name = 'filtering_0040'
-filtering_repository_description = "Galaxy's filtering tool"
-filtering_repository_long_description = "Long description of Galaxy's filtering tool"
+filtering_repository_description = "Galaxy's filtering tool for test 0040"
+filtering_repository_long_description = "Long description of Galaxy's filtering tool for test 0040"
class TestRepositoryCircularDependencies( ShedTwillTestCase ):
'''Verify that the code correctly displays repositories with circular repository dependencies.'''
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_0400_repository_component_reviews.py
--- a/test/tool_shed/functional/test_0400_repository_component_reviews.py
+++ b/test/tool_shed/functional/test_0400_repository_component_reviews.py
@@ -474,7 +474,7 @@
valid_tools_only=True,
uncompress_file=True,
remove_repo_files_not_in_tar=False,
- commit_message='Uploaded filtering 1.1.0 tarball.',
+ commit_message='Uploaded filtering test data.',
strings_displayed=[],
strings_not_displayed=[] )
def test_0110_review_new_changeset_functional_tests( self ):
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
--- a/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
+++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
@@ -111,10 +111,10 @@
install_tool_dependencies=False,
new_tool_panel_section='test_1010' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'freebayes_0010',
+ "Galaxy's freebayes tool",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
--- a/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
@@ -6,8 +6,8 @@
datatypes_repository_long_description = "Galaxy applicable data formats used by Emboss tools. This repository contains no tools."
emboss_repository_name = 'emboss_0020'
-emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
-emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
+emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
+emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020'
base_datatypes_count = 0
repository_datatypes_count = 0
@@ -103,10 +103,10 @@
install_tool_dependencies=False,
new_tool_panel_section='test_1020' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0020', common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0020',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
--- a/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
+++ b/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
@@ -8,8 +8,8 @@
emboss_repository_name = 'emboss_0030'
emboss_5_repository_name = 'emboss_5_0030'
emboss_6_repository_name = 'emboss_6_0030'
-emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
-emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools'
+emboss_repository_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
+emboss_repository_long_description = 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030'
base_datatypes_count = 0
repository_datatypes_count = 0
@@ -173,8 +173,8 @@
install_tool_dependencies=False,
new_tool_panel_section='test_1030' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0030', common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
+ strings_displayed = [ 'emboss_0030',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030',
installed_repository.owner,
installed_repository.tool_shed,
installed_repository.installed_changeset_revision ]
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
--- a/test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
+++ b/test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
@@ -2,12 +2,12 @@
import tool_shed.base.test_db_util as test_db_util
freebayes_repository_name = 'freebayes_0040'
-freebayes_repository_description = "Galaxy's freebayes tool"
-freebayes_repository_long_description = "Long description of Galaxy's freebayes tool"
+freebayes_repository_description = "Galaxy's freebayes tool for test 0040"
+freebayes_repository_long_description = "Long description of Galaxy's freebayes tool for test 0040"
filtering_repository_name = 'filtering_0040'
-filtering_repository_description = "Galaxy's filtering tool"
-filtering_repository_long_description = "Long description of Galaxy's filtering tool"
+filtering_repository_description = "Galaxy's filtering tool for test 0040"
+filtering_repository_long_description = "Long description of Galaxy's filtering tool for test 0040"
category_name = 'test_0040_repository_circular_dependencies'
@@ -164,6 +164,6 @@
self.check_galaxy_repository_tool_panel_section( installed_freebayes_repository, 'freebayes' )
strings_displayed = [ 'Missing repository', 'freebayes' ]
self.display_installed_repository_manage_page( installed_filtering_repository, strings_displayed=strings_displayed )
- self.check_galaxy_repository_db_status( freebayes_repository_name,
- common.test_user_1_name,
+ self.check_galaxy_repository_db_status( 'freebayes_0040',
+ 'user1',
'Uninstalled' )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
--- a/test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
+++ b/test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
@@ -343,9 +343,9 @@
assert original_datatypes < self.get_datatypes_count(), 'Installing a repository that depends on emboss_datatypes did not add datatypes.'
emboss_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
datatypes_repository = test_db_util.get_installed_repository_by_name_owner( emboss_datatypes_repository_name, common.test_user_1_name )
- strings_displayed = [ emboss_repository.name,
+ strings_displayed = [ 'emboss_0050',
+ 'emboss_datatypes_0050',
emboss_repository.installed_changeset_revision,
- datatypes_repository.name,
datatypes_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
# Installing freebayes should automatically reinstall emboss and reactivate emboss_datatypes.
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1060_install_repository_with_workflow.py
--- a/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
+++ b/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
@@ -84,6 +84,6 @@
workflow_name,
strings_displayed=[ '#EBD9B2' ],
strings_not_displayed=[ '#EBBCB2' ] )
- self.display_all_workflows( strings_not_displayed=[ workflow_name ] )
+ self.display_all_workflows( strings_not_displayed=[ 'Workflow for 0060_filter_workflow_repository' ] )
self.import_workflow( installed_repository, workflow_name )
- self.display_all_workflows( strings_displayed=[ workflow_name ] )
+ self.display_all_workflows( strings_displayed=[ 'Workflow for 0060_filter_workflow_repository' ] )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1070_invalid_tool.py
--- a/test/tool_shed/functional/test_1070_invalid_tool.py
+++ b/test/tool_shed/functional/test_1070_invalid_tool.py
@@ -73,10 +73,10 @@
install_tool_dependencies=False,
new_tool_panel_section='test_1070' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'bismark_0070',
+ "Galaxy's bismark wrapper",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
--- a/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
+++ b/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
@@ -131,15 +131,15 @@
common.test_user_1_name )
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
- browse_strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ browse_strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision ]
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Missing repository dependencies' ]
self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed )
@@ -157,18 +157,18 @@
common.test_user_1_name )
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
- browse_strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ browse_strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
- installed_column_repository.description,
+ 'column_maker_0080',
+ 'Add column',
installed_column_repository.installed_changeset_revision ]
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed )
@@ -181,11 +181,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_convert_repository, remove_from_disk=False )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Missing repository dependencies',
'Deactivated' ]
@@ -198,11 +198,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.reactivate_repository( installed_convert_repository )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Installed repository dependencies' ]
def test_0040_deactivate_column_repository( self ):
@@ -212,11 +212,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_column_repository, remove_from_disk=False )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Missing repository dependencies',
'Deactivated' ]
@@ -229,9 +229,9 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_convert_repository, remove_from_disk=False )
- strings_not_displayed = [ installed_column_repository.name,
+ strings_not_displayed = [ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed )
def test_0050_reactivate_column_repository( self ):
@@ -241,11 +241,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.reactivate_repository( installed_column_repository )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Missing repository dependencies',
'Deactivated' ]
@@ -258,20 +258,20 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.reactivate_repository( installed_convert_repository )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_column_repository,
strings_displayed=strings_displayed )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_convert_repository,
@@ -283,11 +283,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_column_repository, remove_from_disk=True )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Missing repository dependencies',
'Uninstalled' ]
@@ -301,20 +301,20 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.reinstall_repository( installed_column_repository, install_repository_dependencies=False )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_column_repository,
strings_displayed=strings_displayed )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_convert_repository,
@@ -326,11 +326,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_convert_repository, remove_from_disk=True )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Missing repository dependencies',
'Uninstalled' ]
@@ -344,11 +344,11 @@
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
self.uninstall_repository( installed_column_repository, remove_from_disk=True )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Missing repository dependencies',
'Activate or reinstall repository',
@@ -365,20 +365,20 @@
install_repository_dependencies=True,
no_changes=False,
new_tool_panel_section='convert_maker' )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_0080',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision,
- installed_convert_repository.name,
+ 'convert_chars_0080',
installed_convert_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_column_repository,
strings_displayed=strings_displayed )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_0080',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_0080',
installed_column_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_installed_repository_manage_page( installed_convert_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1085_repository_dependency_handling.py
--- a/test/tool_shed/functional/test_1085_repository_dependency_handling.py
+++ b/test/tool_shed/functional/test_1085_repository_dependency_handling.py
@@ -122,18 +122,18 @@
common.test_user_1_name )
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
common.test_user_1_name )
- browse_strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ browse_strings_displayed = [ 'convert_chars_1085',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
- installed_column_repository.description,
+ 'column_maker_1085',
+ 'Add column',
installed_column_repository.installed_changeset_revision ]
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_1085',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision,
- installed_column_repository.name,
+ 'column_maker_1085',
installed_column_repository.installed_changeset_revision,
'Installed repository dependencies' ]
self.display_galaxy_browse_repositories_page( strings_displayed=browse_strings_displayed )
@@ -161,9 +161,9 @@
install_repository_dependencies=False,
new_tool_panel_section='new_column_maker',
no_changes=False )
- strings_displayed = [ installed_column_repository.name,
- installed_column_repository.description,
- installed_column_repository.tool_shed,
+ strings_displayed = [ 'column_maker_1085',
+ 'Add column',
+ self.url.replace( 'http://', '' ),
installed_column_repository.installed_changeset_revision ]
self.display_installed_repository_manage_page( installed_column_repository,
strings_displayed=strings_displayed )
@@ -176,9 +176,9 @@
install_repository_dependencies=False,
new_tool_panel_section='new_convert_chars',
no_changes=False )
- strings_displayed = [ installed_convert_repository.name,
- installed_convert_repository.description,
- installed_convert_repository.tool_shed,
+ strings_displayed = [ 'convert_chars_1085',
+ 'Convert delimiters',
+ self.url.replace( 'http://', '' ),
installed_convert_repository.installed_changeset_revision ]
self.display_installed_repository_manage_page( installed_convert_repository,
strings_displayed=strings_displayed )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
--- a/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
@@ -103,7 +103,7 @@
'''Reinstall column_maker and verify that it now shows repository dependencies.'''
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, common.test_user_1_name )
convert_repository = test_db_util.get_repository_by_name_and_owner( convert_repository_name, common.test_user_1_name )
- strings_displayed=[ 'Handle repository dependencies', convert_repository.name, self.get_repository_tip( convert_repository ) ]
+ strings_displayed=[ 'Handle repository dependencies', 'convert_chars_1087', self.get_repository_tip( convert_repository ) ]
# Due to twill's limitations, only check for strings on the (redirected) reselect tool panel section page, don't actually reinstall.
url = '/admin_toolshed/browse_repositories?operation=activate+or+reinstall&id=%s' % self.security.encode_id( installed_column_repository.id )
self.visit_galaxy_url( url )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
--- a/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
+++ b/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
@@ -270,9 +270,9 @@
bwa_color_revision = self.get_repository_tip( bwa_color_repository )
self.search_for_valid_tools( search_fields={ 'tool_id': 'bwa' },
exact_matches=False, from_galaxy=True,
- strings_displayed=[ bwa_color_repository_name, bwa_base_repository_name, bwa_base_revision, bwa_color_revision ] )
- strings_displayed=[ freebayes_repository_name, emboss_repository_name, filtering_repository_name ]
- strings_displayed.extend( [ bwa_color_repository_name, bwa_base_repository_name, emboss_datatypes_repository_name ] )
+ strings_displayed=[ 'bwa_color_0090', 'bwa_base_0090', bwa_base_revision, bwa_color_revision ] )
+ strings_displayed=[ 'freebayes_0090', 'emboss_0090', 'filtering_0090' ]
+ strings_displayed.extend( [ 'bwa_color_0090', 'bwa_base_0090', 'emboss_datatypes_0090' ] )
strings_displayed.extend( [ 'bwa', 'Handle', 'tool dependencies' ] )
repositories_to_install = [ bwa_color_repository, bwa_base_repository ]
# BWA is a good candidate for testing the installation of tool dependencies, but it is a core requirement of functional
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
--- a/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
+++ b/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
@@ -243,11 +243,11 @@
strings_displayed.append( self.url.replace( 'http://', '' ) )
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed, strings_not_displayed=[] )
checks = [ ( tool_repository,
- [ tool_repository.name, tool_repository.owner, tool_repository.installed_changeset_revision ],
+ [ 'bwa_tool_repository_0100', 'user1', tool_repository.installed_changeset_revision ],
[ 'Missing tool dependencies' ] ),
( base_repository,
- [ base_repository.name, base_repository.owner, base_repository.installed_changeset_revision, tool_repository.name,
- tool_repository.owner, tool_repository.installed_changeset_revision ],
+ [ 'bwa_base_repository_0100', 'user1', base_repository.installed_changeset_revision, 'bwa_tool_repository_0100',
+ tool_repository.installed_changeset_revision ],
[ 'Missing tool dependencies' ] ) ]
for repository, strings_displayed, strings_not_displayed in checks:
self.display_installed_repository_manage_page( repository, strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed )
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
--- a/test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
+++ b/test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
@@ -174,7 +174,7 @@
self.galaxy_logout()
self.galaxy_login( email=common.admin_email, username=common.admin_username )
repository = test_db_util.get_repository_by_name_and_owner( emboss_repository_name, common.test_user_1_name )
- preview_strings_displayed = [ repository.name, self.get_repository_tip( repository ), 'will be ignored' ]
+ preview_strings_displayed = [ 'emboss_0110', self.get_repository_tip( repository ), 'will be ignored' ]
self.install_repository( emboss_repository_name,
common.test_user_1_name,
category_name,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
--- a/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
+++ b/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
@@ -77,28 +77,28 @@
'Test 0000 Basic Repository Features 1',
new_tool_panel_section='test_1000' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'filtering_0000',
+ "Galaxy's filtering tool for test 0000",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
def test_0015_uninstall_filtering_repository( self ):
'''Uninstall the filtering repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
self.uninstall_repository( installed_repository, remove_from_disk=True )
- strings_not_displayed = [ installed_repository.name,
- installed_repository.description,
+ strings_not_displayed = [ 'filtering_0000',
+ "Galaxy's filtering tool for test 0000",
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed )
def test_0020_reinstall_filtering_repository( self ):
'''Reinstall the filtering repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
self.reinstall_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'filtering_0000',
+ "Galaxy's filtering tool for test 0000",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
@@ -108,18 +108,18 @@
'''Deactivate the filtering repository without removing it from disk.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
self.uninstall_repository( installed_repository, remove_from_disk=False )
- strings_not_displayed = [ installed_repository.name,
- installed_repository.description,
+ strings_not_displayed = [ 'filtering_0000',
+ "Galaxy's filtering tool for test 0000",
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed )
def test_0030_reactivate_filtering_repository( self ):
'''Reactivate the filtering repository and verify that it now shows up in the list of installed repositories.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
self.reactivate_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'filtering_0000',
+ "Galaxy's filtering tool for test 0000",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
--- a/test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
+++ b/test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
@@ -96,10 +96,10 @@
strings_displayed=strings_displayed,
new_tool_panel_section='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'freebayes_0010',
+ "Galaxy's freebayes tool",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
def test_0015_uninstall_freebayes_repository( self ):
@@ -112,10 +112,10 @@
'''Reinstall the freebayes repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name )
self.reinstall_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'freebayes_0010',
+ "Galaxy's freebayes tool",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
@@ -131,10 +131,10 @@
'''Reactivate the freebayes repository and verify that it now shows up in the list of installed repositories.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name )
self.reactivate_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'freebayes_0010',
+ "Galaxy's freebayes tool",
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
--- a/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
@@ -98,10 +98,10 @@
strings_displayed=strings_displayed,
new_tool_panel_section='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0020',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
current_datatypes = int( self.get_datatypes_count() )
@@ -122,10 +122,10 @@
'''Reinstall the emboss repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.reinstall_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0020',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
@@ -135,17 +135,17 @@
'''Deactivate the emboss repository without removing it from disk.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.uninstall_repository( installed_repository, remove_from_disk=False )
- strings_not_displayed = [ installed_repository.name,
+ strings_not_displayed = [ 'emboss_0020',
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_not_displayed=strings_not_displayed )
def test_0030_reactivate_emboss_repository( self ):
'''Reactivate the emboss repository and verify that it now shows up in the list of installed repositories.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.reactivate_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0020',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
diff -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 -r d04aa3ad613211d3c88f1daa7e5a9df4d1233597 test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
--- a/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
+++ b/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
@@ -158,10 +158,10 @@
strings_displayed=strings_displayed,
new_tool_panel_section='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0030',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
current_datatypes = int( self.get_datatypes_count() )
@@ -182,10 +182,10 @@
'''Reinstall the emboss repository.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.reinstall_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0030',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
@@ -201,10 +201,10 @@
'''Reactivate the emboss repository and verify that it now shows up in the list of installed repositories.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.reactivate_repository( installed_repository )
- strings_displayed = [ installed_repository.name,
- installed_repository.description,
- installed_repository.owner,
- installed_repository.tool_shed,
+ strings_displayed = [ 'emboss_0030',
+ 'Galaxy wrappers for Emboss version 5.0.0 tools',
+ 'user1',
+ self.url.replace( 'http://', '' ),
installed_repository.installed_changeset_revision ]
self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
self.display_installed_repository_manage_page( installed_repository,
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: Fix exception handling in migration script 111.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/359f6fbcde82/
changeset: 359f6fbcde82
user: natefoo
date: 2013-02-15 17:21:11
summary: Fix exception handling in migration script 111.
affected #: 1 file
diff -r 865c74ff03755f21eaaf4a557b1c2aeb1518e593 -r 359f6fbcde82bbf8aa1d4b932a54882f86121d71 lib/galaxy/model/migrate/versions/0111_add_job_destinations.py
--- a/lib/galaxy/model/migrate/versions/0111_add_job_destinations.py
+++ b/lib/galaxy/model/migrate/versions/0111_add_job_destinations.py
@@ -26,14 +26,14 @@
try:
c.create( Job_table )
assert c is Job_table.c.destination_id
- except:
+ except Exception, e:
log.error( "Adding column 'destination_id' to job table failed: %s" % str( e ) )
c = Column( "destination_params", JSONType, nullable=True )
try:
c.create( Job_table )
assert c is Job_table.c.destination_params
- except:
+ except Exception, e:
log.error( "Adding column 'destination_params' to job table failed: %s" % str( e ) )
def downgrade():
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: Handle the Torque 'E' job state in the CLI runner.
by Bitbucket 15 Feb '13
by Bitbucket 15 Feb '13
15 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8cd0793b0fc6/
changeset: 8cd0793b0fc6
branch: stable
user: natefoo
date: 2013-02-15 16:53:20
summary: Handle the Torque 'E' job state in the CLI runner.
affected #: 1 file
diff -r 1f1072317efd5cf82cb791d75ba968c4bacffaf4 -r 8cd0793b0fc65b57f8fd93cfffc19ba105d190cf lib/galaxy/jobs/runners/cli_job/torque.py
--- a/lib/galaxy/jobs/runners/cli_job/torque.py
+++ b/lib/galaxy/jobs/runners/cli_job/torque.py
@@ -128,5 +128,6 @@
return job_states.OK
def __get_job_state(self, state):
- return { 'R' : job_states.RUNNING,
+ return { 'E' : job_states.RUNNING,
+ 'R' : job_states.RUNNING,
'Q' : job_states.QUEUED }.get(state, state)
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c3d93fe36b28/
changeset: c3d93fe36b28
user: jgoecks
date: 2013-02-15 00:14:18
summary: Add new config files to hgignore.
affected #: 1 file
diff -r c58f82badc26168885507312b71ac2351046bee8 -r c3d93fe36b28898f741c06e316d7184a993dfb9a .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -46,6 +46,8 @@
openid_conf.xml
shed_tool_data_table_conf.xml
job_conf.xml
+data_manager_conf.xml
+shed_data_manager_conf.xml
static/welcome.html.*
static/welcome.html
https://bitbucket.org/galaxy/galaxy-central/commits/4150920c8075/
changeset: 4150920c8075
user: jgoecks
date: 2013-02-15 00:15:34
summary: Standardize on BED format for genome data providers and fix off-by-one issues.
affected #: 2 files
diff -r c3d93fe36b28898f741c06e316d7184a993dfb9a -r 4150920c807513bc321619c0d59784a30020b07a lib/galaxy/visualization/data_providers/genome.py
--- a/lib/galaxy/visualization/data_providers/genome.py
+++ b/lib/galaxy/visualization/data_providers/genome.py
@@ -111,7 +111,10 @@
return result
class GenomeDataProvider( BaseDataProvider ):
- """ Base class for genome data providers. """
+ """
+ Base class for genome data providers. All genome providers should
+ produce data with BED interval format: 0-based, half-open coordinates.
+ """
dataset_type = None
@@ -819,8 +822,8 @@
class BamDataProvider( GenomeDataProvider, FilterableMixin ):
"""
- Provides access to intervals from a sorted indexed BAM file. Position data
- is reported in 1-based, closed format, i.e. SAM/BAM format.
+ Provides access to intervals from a sorted indexed BAM file. Coordinate
+ data is reported in BED format: 0-based, half-open.
"""
dataset_type = 'bai'
diff -r c3d93fe36b28898f741c06e316d7184a993dfb9a -r 4150920c807513bc321619c0d59784a30020b07a static/scripts/viz/trackster/painters.js
--- a/static/scripts/viz/trackster/painters.js
+++ b/static/scripts/viz/trackster/painters.js
@@ -493,8 +493,7 @@
var
feature_uid = feature[0],
feature_start = feature[1],
- // -1 because end is not included in feature; see FeaturePainter documentation for details.
- feature_end = feature[2] - 1,
+ feature_end = feature[2],
feature_name = feature[3],
feature_strand = feature[4],
f_start = Math.floor( Math.max(0, (feature_start - tile_low) * w_scale) ),
@@ -613,8 +612,7 @@
for (var k = 0, k_len = feature_blocks.length; k < k_len; k++) {
var block = feature_blocks[k],
block_start = Math.floor( Math.max(0, (block[0] - tile_low) * w_scale) ),
- // -1 because end is not included in feature; see FeaturePainter documentation for details.
- block_end = Math.ceil( Math.min(width, Math.max((block[1] - 1 - tile_low) * w_scale)) ),
+ block_end = Math.ceil( Math.min(width, Math.max((block[1] - tile_low) * w_scale)) ),
last_block_start, last_block_end;
// Skip drawing if block not on tile.
@@ -759,8 +757,7 @@
// Go left if it clips
base_offset -= cig_len;
}
- // -1 for feature start because data is using 1-based offset but display is 0-based.
- var seq_start = (feature_start - 1) + base_offset,
+ var seq_start = feature_start + base_offset,
s_start = Math.floor( Math.max(0, (seq_start - tile_low) * w_scale) ),
s_end = Math.floor( Math.max(0, (seq_start + cig_len - tile_low) * w_scale) );
https://bitbucket.org/galaxy/galaxy-central/commits/04aaf661f80a/
changeset: 04aaf661f80a
user: jgoecks
date: 2013-02-15 00:31:21
summary: More Trackster fixes to standardize on 0-based coordinate system.
affected #: 1 file
diff -r 4150920c807513bc321619c0d59784a30020b07a -r 04aaf661f80a92cfd8c804baccac348e3cc98355 static/scripts/viz/trackster/painters.js
--- a/static/scripts/viz/trackster/painters.js
+++ b/static/scripts/viz/trackster/painters.js
@@ -779,8 +779,7 @@
case "=": // Equals.
if (is_overlap([seq_start, seq_start + cig_len], tile_region)) {
// Draw.
- // -1 b/c sequence data is 1-based but painter is 0-based.
- var seq = ref_seq.slice(seq_offset - 1, seq_offset + cig_len);
+ var seq = ref_seq.slice(seq_offset, seq_offset + cig_len);
if (gap > 0) {
ctx.fillStyle = block_color;
ctx.fillRect(s_start - gap, y_center + 1, s_end - s_start, 9);
@@ -836,8 +835,7 @@
var insert_x_coord = s_start - gap;
if (is_overlap([seq_start, seq_start + cig_len], tile_region)) {
- // -1 b/c sequence data is 1-based but painter is 0-based.
- var seq = ref_seq.slice(seq_offset - 1, seq_offset + cig_len);
+ var seq = ref_seq.slice(seq_offset, seq_offset + cig_len);
// Insertion point is between the sequence start and the previous base: (-gap) moves
// back from sequence start to insertion point.
if (this.prefs.show_insertions) {
https://bitbucket.org/galaxy/galaxy-central/commits/865c74ff0375/
changeset: 865c74ff0375
user: jgoecks
date: 2013-02-15 00:56:27
summary: Use 0-based coordinates for BBI data and display.
affected #: 3 files
diff -r 04aaf661f80a92cfd8c804baccac348e3cc98355 -r 865c74ff03755f21eaaf4a557b1c2aeb1518e593 lib/galaxy/visualization/data_providers/genome.py
--- a/lib/galaxy/visualization/data_providers/genome.py
+++ b/lib/galaxy/visualization/data_providers/genome.py
@@ -112,8 +112,8 @@
class GenomeDataProvider( BaseDataProvider ):
"""
- Base class for genome data providers. All genome providers should
- produce data with BED interval format: 0-based, half-open coordinates.
+ Base class for genome data providers. All genome providers use BED coordinate
+ format (0-based, half-open coordinates) for both queries and returned data.
"""
dataset_type = None
@@ -1044,7 +1044,9 @@
return all_dat is not None
def get_data( self, chrom, start, end, start_val=0, max_vals=None, num_samples=1000, **kwargs ):
- start = int( start )
+ # Subtract 1 because start/end are in 0-based coordinate system but BBI
+ # provider uses 1-based coordinate system.
+ start = int( start ) - 1
end = int( end )
# Helper function for getting summary data regardless of chromosome
diff -r 04aaf661f80a92cfd8c804baccac348e3cc98355 -r 865c74ff03755f21eaaf4a557b1c2aeb1518e593 static/scripts/packed/viz/trackster/painters.js
--- a/static/scripts/packed/viz/trackster/painters.js
+++ b/static/scripts/packed/viz/trackster/painters.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(_){var extend=_.extend;var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(first_region,second_region){var first_start=first_region[0],first_end=first_region[1],second_start=second_region[0],second_end=second_region[1],overlap;if(first_start<second_start){if(first_end<second_start){overlap=BEFORE}else{if(first_end<=second_end){overlap=OVERLAP_START}else{overlap=CONTAINS}}}else{if(first_start>second_end){overlap=AFTER}else{if(first_end<=second_end){overlap=CONTAINED_BY}else{overlap=OVERLAP_END}}}return overlap};var is_overlap=function(first_region,second_region){var overlap=compute_overlap(first_region,second_region);return(overlap!==BEFORE&&overlap!==AFTER)};var dashedLine=function(ctx,x1,y1,x2,y2,dashLen){if(dashLen===undefined){dashLen=4}var dX=x2-x1;var dY=y2-y1;var dashes=Math.floor(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=dX/dashes;var dashY=dY/dashes;var q;for(q=0;q<dashes;q++,x1+=dashX,y1+=dashY){if(q%2!==0){continue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle=function(ctx,down_vertex_x,down_vertex_y,side_len){var x1=down_vertex_x-side_len/2,x2=down_vertex_x+side_len/2,y=down_vertex_y-Math.sqrt(side_len*3/2);ctx.beginPath();ctx.moveTo(x1,y);ctx.lineTo(x2,y);ctx.lineTo(down_vertex_x,down_vertex_y);ctx.lineTo(x1,y);ctx.strokeStyle=this.fillStyle;ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=function(default_val){this.default_val=(default_val?default_val:1)};Scaler.prototype.gen_val=function(input){return this.default_val};var Painter=function(data,view_start,view_end,prefs,mode){this.data=data;this.view_start=view_start;this.view_end=view_end;this.prefs=extend({},this.default_prefs,prefs);this.mode=mode};Painter.prototype.default_prefs={};Painter.prototype.draw=function(ctx,width,height,w_scale){};var SummaryTreePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode)};SummaryTreePainter.prototype.default_prefs={show_counts:false};SummaryTreePainter.prototype.draw=function(ctx,width,height,w_scale){var view_start=this.view_start,points=this.data.data,max=(this.prefs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=height;delta_x_px=Math.ceil(this.data.delta*w_scale);ctx.save();for(var i=0,len=points.length;i<len;i++){var x=Math.floor((points[i][0]-view_start)*w_scale);var y=points[i][1];if(!y){continue}var y_px=y/max*height;if(y!==0&&y_px<1){y_px=1}ctx.fillStyle=this.prefs.block_color;ctx.fillRect(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=4;if(this.prefs.show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.fillStyle=this.prefs.label_color;ctx.textAlign="center";ctx.fillText(y,x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][1])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][1])}this.prefs.max_value=max_value}};LinePainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};LinePainter.prototype.draw=function(ctx,width,height,w_scale){var in_path=false,min_value=this.prefs.min_value,max_value=this.prefs.max_value,vertical_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data;ctx.save();var y_zero=Math.round(height+min_value/vertical_range*height);if(mode!=="Intensity"){ctx.fillStyle="#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=Math.ceil((data[1][0]-data[0][0])*w_scale)}else{delta_x_px=10}var pref_color=parseInt(this.prefs.color.slice(1),16),pref_r=(pref_color&16711680)>>16,pref_g=(pref_color&65280)>>8,pref_b=pref_color&255;for(var i=0,len=data.length;i<len;i++){ctx.fillStyle=ctx.strokeStyle=this.prefs.color;x_scaled=Math.round((data[i][0]-view_start-1)*w_scale);y=data[i][1];var top_overflow=false,bot_overflow=false;if(y===null){if(in_path&&mode==="Filled"){ctx.lineTo(x_scaled,height_px)}in_path=false;continue}if(y<min_value){bot_overflow=true;y=min_value}else{if(y>max_value){top_overflow=true;y=max_value}}if(mode==="Histogram"){y=Math.round(y/vertical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(mode==="Intensity"){var saturation=(y-min_value)/vertical_range,new_r=Math.round(pref_r+(255-pref_r)*(1-saturation)),new_g=Math.round(pref_g+(255-pref_g)*(1-saturation)),new_b=Math.round(pref_b+(255-pref_b)*(1-saturation));ctx.fillStyle="rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRect(x_scaled,0,delta_x_px,height_px)}else{y=Math.round(height_px-(y-min_value)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_path=true;if(mode==="Filled"){ctx.moveTo(x_scaled,height_px);ctx.lineTo(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=this.prefs.overflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode==="Histogram"||mode==="Intensity"){overflow_x=delta_x_px}else{x_scaled-=2;overflow_x=4}if(top_overflow){ctx.fillRect(x_scaled,0,overflow_x,3)}if(bot_overflow){ctx.fillRect(x_scaled,height_px-3,overflow_x,3)}}ctx.fillStyle=this.prefs.color}if(mode==="Filled"){if(in_path){ctx.lineTo(x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.restore()};var FeaturePositionMapper=function(slot_height){this.feature_positions={};this.slot_height=slot_height;this.translation=0;this.y_translation=0};FeaturePositionMapper.prototype.map_feature_data=function(feature_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature_positions[slot]=[]}this.feature_positions[slot].push({data:feature_data,x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_data=function(x,y){var slot=Math.floor((y-this.y_translation)/this.slot_height),feature_dict;if(!this.feature_positions[slot]){return null}x+=this.translation;for(var i=0;i<this.feature_positions[slot].length;i++){feature_dict=this.feature_positions[slot][i];if(x>=feature_dict.x_start&&x<=feature_dict.x_end){return feature_dict.data}}};var FeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Painter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=(alpha_scaler?alpha_scaler:new Scaler());this.height_scaler=(height_scaler?height_scaler:new Scaler())};FeaturePainter.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_required_height:function(rows_required,width){var required_height=this.get_row_height(),y_scale=required_height,mode=this.mode;if(mode==="no_detail"||mode==="Squish"||mode==="Pack"){required_height=rows_required*y_scale}return required_height+this.get_top_padding(width)+this.get_bottom_padding(width)},get_top_padding:function(width){return 0},get_bottom_padding:function(width){return Math.max(Math.round(this.get_row_height()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=this.data,view_start=this.view_start,view_end=this.view_end;ctx.save();ctx.fillStyle=this.prefs.block_color;ctx.textAlign="right";var y_scale=this.get_row_height(),feature_mapper=new FeaturePositionMapper(y_scale),x_draw_coords;for(var i=0,len=data.length;i<len;i++){var feature=data[i],feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],slot=(slots&&slots[feature_uid]!==undefined?slots[feature_uid]:null);if((feature_start<view_end&&feature_end>view_start)&&(this.mode==="Dense"||slot!==null)){x_draw_coords=this.draw_element(ctx,this.mode,feature,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_feature_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();feature_mapper.y_translation=this.get_top_padding(width);return feature_mapper},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){console.log("WARNING: Unimplemented function.");return[0,0]}});var DENSE_TRACK_HEIGHT=10,NO_DETAIL_TRACK_HEIGHT=3,SQUISH_TRACK_HEIGHT=5,PACK_TRACK_HEIGHT=10,NO_DETAIL_FEATURE_HEIGHT=1,DENSE_FEATURE_HEIGHT=9,SQUISH_FEATURE_HEIGHT=3,PACK_FEATURE_HEIGHT=9,LABEL_SPACING=2,CONNECTOR_COLOR="#ccc";var LinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){FeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.draw_background_connector=true;this.draw_individual_connectors=false};extend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var mode=this.mode,height;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="no_detail"){height=NO_DETAIL_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2]-1,feature_name=feature[3],feature_strand=feature[4],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),draw_start=f_start,draw_end=f_end,y_center=(mode==="Dense"?0:(0+slot))*y_scale+this.get_top_padding(width),thickness,y_start,thick_start=null,thick_end=null,block_color=(!feature_strand||feature_strand==="+"||feature_strand==="."?this.prefs.block_color:this.prefs.reverse_strand_color);label_color=this.prefs.label_color;ctx.globalAlpha=this.alpha_scaler.gen_val(feature);if(mode==="Dense"){slot=1}if(mode==="no_detail"){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HEIGHT)}else{var feature_ts=feature[5],feature_te=feature[6],feature_blocks=feature[7],full_height=true;if(feature_ts&&feature_te){thick_start=Math.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=Math.ceil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_height,thick_height;if(mode==="Squish"){thin_height=1;thick_height=SQUISH_FEATURE_HEIGHT;full_height=false}else{if(mode==="Dense"){thin_height=5;thick_height=DENSE_FEATURE_HEIGHT}else{thin_height=5;thick_height=PACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_strand&&full_height){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_center,cur_height;if(mode==="Squish"||mode==="Dense"){cur_y_center=y_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}else{if(feature_strand){cur_y_center=y_center;cur_height=thick_height}else{cur_y_center+=(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}}if(this.draw_background_connector){if(mode==="Squish"||mode==="Dense"){ctx.fillStyle=CONNECTOR_COLOR}else{if(feature_strand){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand")}}}else{ctx.fillStyle=CONNECTOR_COLOR}}ctx.fillRect(f_start,cur_y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=0,k_len=feature_blocks.length;k<k_len;k++){var block=feature_blocks[k],block_start=Math.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=Math.ceil(Math.min(width,Math.max((block[1]-1-tile_low)*w_scale))),last_block_start,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=block_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,block_end-block_start,thin_height);if(thick_start!==undefined&&feature_te>feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thick_start=Math.max(block_start,thick_start),block_thick_end=Math.min(block_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height);if(feature_blocks.length===1&&mode==="Pack"){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}if(block_thick_start+14<block_thick_end){block_thick_start+=2;block_thick_end-=2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_end,y_center)}last_block_start=block_start;last_block_end=block_end}if(mode==="Pack"){ctx.globalAlpha=1;ctx.fillStyle="white";var hscale_factor=this.height_scaler.gen_val(feature),new_height=Math.ceil(thick_height*hscale_factor),ws_height=Math.round((thick_height-new_height)/2);if(hscale_factor!==1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,ws_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-f_start,ws_height)}}}ctx.globalAlpha=1;if(feature_name&&mode==="Pack"&&feature_start>tile_low){ctx.fillStyle=label_color;if(tile_low===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=ctx.measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=ctx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=1;return[draw_start,draw_end]}});var ReadPainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler,ref_seq){FeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.ref_seq=(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var height,mode=this.mode;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT;if(this.prefs.show_insertions){height*=2}}}return height},draw_read:function(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,ref_seq){ctx.textAlign="center";var tile_region=[tile_low,tile_high],base_offset=0,seq_offset=0,gap=0,char_width_px=ctx.canvas.manager.char_width_px,block_color=(strand==="+"?this.prefs.block_color:this.prefs.reverse_strand_color);var draw_last=[];if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){gap=Math.round(w_scale/2)}if(!cigar){cigar=[[0,ref_seq.length]]}for(var cig_id=0,len=cigar.length;cig_id<len;cig_id++){var cig=cigar[cig_id],cig_op="MIDNSHP=X"[cig[0]],cig_len=cig[1];if(cig_op==="H"||cig_op==="S"){base_offset-=cig_len}var seq_start=(feature_start-1)+base_offset,s_start=Math.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=Math.floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start===s_end){s_end+=1}switch(cig_op){case"H":break;case"S":case"M":case"=":if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=ref_seq.slice(seq_offset-1,seq_offset+cig_len);if(gap>0){ctx.fillStyle=block_color;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=CONNECTOR_COLOR;for(var c=0,str_len=seq.length;c<str_len;c++){if(this.prefs.show_differences){if(this.ref_seq){var ref_char=this.ref_seq[seq_start-tile_low+c];if(!ref_char||ref_char.toLowerCase()===seq[c].toLowerCase()){continue}}else{continue}}if(seq_start+c>=tile_low&&seq_start+c<=tile_high){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=block_color;ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_offset+=cig_len;base_offset+=cig_len;break;case"N":ctx.fillStyle=CONNECTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset+=cig_len;break;case"D":ctx.fillStyle="red";ctx.fillRect(s_start-gap,y_center+4,s_end-s_start,3);base_offset+=cig_len;break;case"P":break;case"I":var insert_x_coord=s_start-gap;if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=ref_seq.slice(seq_offset-1,seq_offset+cig_len);if(this.prefs.show_insertions){var x_center=s_start-(s_end-s_start)/2;if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){ctx.fillStyle="yellow";ctx.fillRect(x_center-gap,y_center-9,s_end-s_start,9);draw_last[draw_last.length]={type:"triangle",data:[insert_x_coord,y_center+4,5]};ctx.fillStyle=CONNECTOR_COLOR;switch(compute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_START):seq=seq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=seq.slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS):seq=seq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c=0,str_len=seq.length;c<str_len;c++){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_start)/2,y_center)}}else{ctx.fillStyle="yellow";ctx.fillRect(x_center,y_center+(this.mode!=="Dense"?2:5),s_end-s_start,(mode!=="Dense"?SQUISH_FEATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){draw_last.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}seq_offset+=cig_len;break;case"X":seq_offset+=cig_len;break}}ctx.fillStyle="yellow";var item,type,data;for(var i=0;i<draw_last.length;i++){item=draw_last[i];type=item.type;data=item.data;if(type==="text"){ctx.save();ctx.font="bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]);ctx.restore()}else{if(type==="triangle"){drawDownwardEquilateralTriangle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],feature_name=feature[3],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),y_center=(mode==="Dense"?0:(0+slot))*y_scale,label_color=this.prefs.label_color,gap=0;if((mode==="Pack"||this.mode==="Auto")&&w_scale>ctx.canvas.manager.char_width_px){var gap=Math.round(w_scale/2)}if(feature[5] instanceof Array){var b1_start=Math.floor(Math.max(0,(feature[4][0]-tile_low)*w_scale)),b1_end=Math.ceil(Math.min(width,Math.max(0,(feature[4][1]-tile_low)*w_scale))),b2_start=Math.floor(Math.max(0,(feature[5][0]-tile_low)*w_scale)),b2_end=Math.ceil(Math.min(width,Math.max(0,(feature[5][1]-tile_low)*w_scale))),connector=true;if(feature[4][1]>=tile_low&&feature[4][0]<=tile_high&&feature[4][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[4][0],feature[4][2],feature[4][3],feature[4][4])}else{connector=false}if(feature[5][1]>=tile_low&&feature[5][0]<=tile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5][4])}else{connector=false}if(connector&&b2_start>b1_end){ctx.fillStyle=CONNECTOR_COLOR;dashedLine(ctx,b1_end-gap,y_center+5,b2_start-gap,y_center+5)}}else{this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,feature[4],feature[5],feature[6])}if(mode==="Pack"&&feature_start>tile_low&&feature_name!=="."){ctx.fillStyle=this.prefs.label_color;var tile_index=1;if(tile_index===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING-gap,y_center+8)}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.longest_feature_length=this.calculate_longest_feature_length();this.draw_background_connector=false;this.draw_individual_connectors=true};extend(ArcLinkedFeaturePainter.prototype,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest_feature_length:function(){var longest_feature_length=0;for(var i=0,len=this.data.length;i<len;i++){var feature=this.data[i],feature_start=feature[1],feature_end=feature[2];longest_feature_length=Math.max(longest_feature_length,feature_end-feature_start)}return longest_feature_length},get_top_padding:function(width){var view_range=this.view_end-this.view_start,w_scale=width/view_range;return Math.min(128,Math.ceil((this.longest_feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block1_end,block2_start,block2_end,y_center){var x_center=(block1_end+block2_start)/2,radius=block2_start-x_center;var angle1=Math.PI,angle2=0;if(radius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Math.PI,0);ctx.stroke()}}});var Color=function(rgb,a){if(Array.isArray(rgb)){this.rgb=rgb}else{if(rgb.length==6){this.rgb=rgb.match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{if(rgb.length==7){this.rgb=rgb.substring(1,7).match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{this.rgb=rgb.split("").map(function(c){return parseInt(c+c,16)})}}}this.alpha=typeof(a)==="number"?a:1};Color.prototype={eval:function(){return this},toCSS:function(){if(this.alpha<1){return"rgba("+this.rgb.map(function(c){return Math.round(c)}).concat(this.alpha).join(", ")+")"}else{return"#"+this.rgb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")}},toHSL:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2,d=max-min;if(max===min){h=s=0}else{s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,l:l,a:a}},toARGB:function(){var argb=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")},mix:function(color2,weight){color1=this;var p=weight;var w=p*2-1;var a=color1.toHSL().a-color2.toHSL().a;var w1=(((w*a==-1)?w:(w+a)/(1+w*a))+1)/2;var w2=1-w1;var rgb=[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=color1.alpha*p+color2.alpha*(1-p);return new Color(rgb,alpha)}};var LinearRamp=function(start_color,end_color,start_value,end_value){this.start_color=new Color(start_color);this.end_color=new Color(end_color);this.start_value=start_value;this.end_value=end_value;this.value_range=end_value-start_value};LinearRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);value=(value-this.start_value)/this.value_range;return this.start_color.mix(this.end_color,1-value).toCSS()};var SplitRamp=function(start_color,middle_color,end_color,start_value,end_value){this.positive_ramp=new LinearRamp(middle_color,end_color,0,end_value);this.negative_ramp=new LinearRamp(middle_color,start_color,0,-start_value);this.start_value=start_value;this.end_value=end_value};SplitRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);if(value>=0){return this.positive_ramp.map_value(value)}else{return this.negative_ramp.map_value(-value)}};var DiagonalHeatmapPainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][5])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][5])}this.prefs.max_value=max_value}};DiagonalHeatmapPainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Heatmap",pos_color:"#FF8C00",neg_color:"#4169E1"};DiagonalHeatmapPainter.prototype.draw=function(ctx,width,height,w_scale){var min_value=this.prefs.min_value,max_value=this.prefs.max_value,value_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data,invsqrt2=1/Math.sqrt(2);var ramp=(new SplitRamp(this.prefs.neg_color,"#FFFFFF",this.prefs.pos_color,min_value,max_value));var d,s1,e1,s2,e2,value;var scale=function(p){return(p-view_start)*w_scale};ctx.save();ctx.rotate(-45*Math.PI/180);ctx.scale(invsqrt2,invsqrt2);for(var i=0,len=data.length;i<len;i++){d=data[i];s1=scale(d[1]);e1=scale(d[2]);s2=scale(d[4]);e2=scale(d[5]);value=d[6];ctx.fillStyle=(ramp.map_value(value));ctx.fillRect(s1,s2,(e1-s1),(e2-s2))}ctx.restore()};return{Scaler:Scaler,SummaryTreePainter:SummaryTreePainter,LinePainter:LinePainter,LinkedFeaturePainter:LinkedFeaturePainter,ReadPainter:ReadPainter,ArcLinkedFeaturePainter:ArcLinkedFeaturePainter,DiagonalHeatmapPainter:DiagonalHeatmapPainter}});
\ No newline at end of file
+define(["libs/underscore"],function(_){var extend=_.extend;var BEFORE=1001,CONTAINS=1002,OVERLAP_START=1003,OVERLAP_END=1004,CONTAINED_BY=1005,AFTER=1006;var compute_overlap=function(first_region,second_region){var first_start=first_region[0],first_end=first_region[1],second_start=second_region[0],second_end=second_region[1],overlap;if(first_start<second_start){if(first_end<second_start){overlap=BEFORE}else{if(first_end<=second_end){overlap=OVERLAP_START}else{overlap=CONTAINS}}}else{if(first_start>second_end){overlap=AFTER}else{if(first_end<=second_end){overlap=CONTAINED_BY}else{overlap=OVERLAP_END}}}return overlap};var is_overlap=function(first_region,second_region){var overlap=compute_overlap(first_region,second_region);return(overlap!==BEFORE&&overlap!==AFTER)};var dashedLine=function(ctx,x1,y1,x2,y2,dashLen){if(dashLen===undefined){dashLen=4}var dX=x2-x1;var dY=y2-y1;var dashes=Math.floor(Math.sqrt(dX*dX+dY*dY)/dashLen);var dashX=dX/dashes;var dashY=dY/dashes;var q;for(q=0;q<dashes;q++,x1+=dashX,y1+=dashY){if(q%2!==0){continue}ctx.fillRect(x1,y1,dashLen,1)}};var drawDownwardEquilateralTriangle=function(ctx,down_vertex_x,down_vertex_y,side_len){var x1=down_vertex_x-side_len/2,x2=down_vertex_x+side_len/2,y=down_vertex_y-Math.sqrt(side_len*3/2);ctx.beginPath();ctx.moveTo(x1,y);ctx.lineTo(x2,y);ctx.lineTo(down_vertex_x,down_vertex_y);ctx.lineTo(x1,y);ctx.strokeStyle=this.fillStyle;ctx.fill();ctx.stroke();ctx.closePath()};var Scaler=function(default_val){this.default_val=(default_val?default_val:1)};Scaler.prototype.gen_val=function(input){return this.default_val};var Painter=function(data,view_start,view_end,prefs,mode){this.data=data;this.view_start=view_start;this.view_end=view_end;this.prefs=extend({},this.default_prefs,prefs);this.mode=mode};Painter.prototype.default_prefs={};Painter.prototype.draw=function(ctx,width,height,w_scale){};var SummaryTreePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode)};SummaryTreePainter.prototype.default_prefs={show_counts:false};SummaryTreePainter.prototype.draw=function(ctx,width,height,w_scale){var view_start=this.view_start,points=this.data.data,max=(this.prefs.histogram_max?this.prefs.histogram_max:this.data.max),base_y=height;delta_x_px=Math.ceil(this.data.delta*w_scale);ctx.save();for(var i=0,len=points.length;i<len;i++){var x=Math.floor((points[i][0]-view_start)*w_scale);var y=points[i][1];if(!y){continue}var y_px=y/max*height;if(y!==0&&y_px<1){y_px=1}ctx.fillStyle=this.prefs.block_color;ctx.fillRect(x,base_y-y_px,delta_x_px,y_px);var text_padding_req_x=4;if(this.prefs.show_counts&&(ctx.measureText(y).width+text_padding_req_x)<delta_x_px){ctx.fillStyle=this.prefs.label_color;ctx.textAlign="center";ctx.fillText(y,x+(delta_x_px/2),10)}}ctx.restore()};var LinePainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][1])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][1])}this.prefs.max_value=max_value}};LinePainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Histogram",color:"#000",overflow_color:"#F66"};LinePainter.prototype.draw=function(ctx,width,height,w_scale){var in_path=false,min_value=this.prefs.min_value,max_value=this.prefs.max_value,vertical_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data;ctx.save();var y_zero=Math.round(height+min_value/vertical_range*height);if(mode!=="Intensity"){ctx.fillStyle="#aaa";ctx.fillRect(0,y_zero,width,1)}ctx.beginPath();var x_scaled,y,delta_x_px;if(data.length>1){delta_x_px=Math.ceil((data[1][0]-data[0][0])*w_scale)}else{delta_x_px=10}var pref_color=parseInt(this.prefs.color.slice(1),16),pref_r=(pref_color&16711680)>>16,pref_g=(pref_color&65280)>>8,pref_b=pref_color&255;for(var i=0,len=data.length;i<len;i++){ctx.fillStyle=ctx.strokeStyle=this.prefs.color;x_scaled=Math.round((data[i][0]-view_start)*w_scale);y=data[i][1];var top_overflow=false,bot_overflow=false;if(y===null){if(in_path&&mode==="Filled"){ctx.lineTo(x_scaled,height_px)}in_path=false;continue}if(y<min_value){bot_overflow=true;y=min_value}else{if(y>max_value){top_overflow=true;y=max_value}}if(mode==="Histogram"){y=Math.round(y/vertical_range*height_px);ctx.fillRect(x_scaled,y_zero,delta_x_px,-y)}else{if(mode==="Intensity"){var saturation=(y-min_value)/vertical_range,new_r=Math.round(pref_r+(255-pref_r)*(1-saturation)),new_g=Math.round(pref_g+(255-pref_g)*(1-saturation)),new_b=Math.round(pref_b+(255-pref_b)*(1-saturation));ctx.fillStyle="rgb("+new_r+","+new_g+","+new_b+")";ctx.fillRect(x_scaled,0,delta_x_px,height_px)}else{y=Math.round(height_px-(y-min_value)/vertical_range*height_px);if(in_path){ctx.lineTo(x_scaled,y)}else{in_path=true;if(mode==="Filled"){ctx.moveTo(x_scaled,height_px);ctx.lineTo(x_scaled,y)}else{ctx.moveTo(x_scaled,y)}}}}ctx.fillStyle=this.prefs.overflow_color;if(top_overflow||bot_overflow){var overflow_x;if(mode==="Histogram"||mode==="Intensity"){overflow_x=delta_x_px}else{x_scaled-=2;overflow_x=4}if(top_overflow){ctx.fillRect(x_scaled,0,overflow_x,3)}if(bot_overflow){ctx.fillRect(x_scaled,height_px-3,overflow_x,3)}}ctx.fillStyle=this.prefs.color}if(mode==="Filled"){if(in_path){ctx.lineTo(x_scaled,y_zero);ctx.lineTo(0,y_zero)}ctx.fill()}else{ctx.stroke()}ctx.restore()};var FeaturePositionMapper=function(slot_height){this.feature_positions={};this.slot_height=slot_height;this.translation=0;this.y_translation=0};FeaturePositionMapper.prototype.map_feature_data=function(feature_data,slot,x_start,x_end){if(!this.feature_positions[slot]){this.feature_positions[slot]=[]}this.feature_positions[slot].push({data:feature_data,x_start:x_start,x_end:x_end})};FeaturePositionMapper.prototype.get_feature_data=function(x,y){var slot=Math.floor((y-this.y_translation)/this.slot_height),feature_dict;if(!this.feature_positions[slot]){return null}x+=this.translation;for(var i=0;i<this.feature_positions[slot].length;i++){feature_dict=this.feature_positions[slot][i];if(x>=feature_dict.x_start&&x<=feature_dict.x_end){return feature_dict.data}}};var FeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){Painter.call(this,data,view_start,view_end,prefs,mode);this.alpha_scaler=(alpha_scaler?alpha_scaler:new Scaler());this.height_scaler=(height_scaler?height_scaler:new Scaler())};FeaturePainter.prototype.default_prefs={block_color:"#FFF",connector_color:"#FFF"};extend(FeaturePainter.prototype,{get_required_height:function(rows_required,width){var required_height=this.get_row_height(),y_scale=required_height,mode=this.mode;if(mode==="no_detail"||mode==="Squish"||mode==="Pack"){required_height=rows_required*y_scale}return required_height+this.get_top_padding(width)+this.get_bottom_padding(width)},get_top_padding:function(width){return 0},get_bottom_padding:function(width){return Math.max(Math.round(this.get_row_height()/2),5)},draw:function(ctx,width,height,w_scale,slots){var data=this.data,view_start=this.view_start,view_end=this.view_end;ctx.save();ctx.fillStyle=this.prefs.block_color;ctx.textAlign="right";var y_scale=this.get_row_height(),feature_mapper=new FeaturePositionMapper(y_scale),x_draw_coords;for(var i=0,len=data.length;i<len;i++){var feature=data[i],feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],slot=(slots&&slots[feature_uid]!==undefined?slots[feature_uid]:null);if((feature_start<view_end&&feature_end>view_start)&&(this.mode==="Dense"||slot!==null)){x_draw_coords=this.draw_element(ctx,this.mode,feature,slot,view_start,view_end,w_scale,y_scale,width);feature_mapper.map_feature_data(feature,slot,x_draw_coords[0],x_draw_coords[1])}}ctx.restore();feature_mapper.y_translation=this.get_top_padding(width);return feature_mapper},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){console.log("WARNING: Unimplemented function.");return[0,0]}});var DENSE_TRACK_HEIGHT=10,NO_DETAIL_TRACK_HEIGHT=3,SQUISH_TRACK_HEIGHT=5,PACK_TRACK_HEIGHT=10,NO_DETAIL_FEATURE_HEIGHT=1,DENSE_FEATURE_HEIGHT=9,SQUISH_FEATURE_HEIGHT=3,PACK_FEATURE_HEIGHT=9,LABEL_SPACING=2,CONNECTOR_COLOR="#ccc";var LinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){FeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.draw_background_connector=true;this.draw_individual_connectors=false};extend(LinkedFeaturePainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var mode=this.mode,height;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="no_detail"){height=NO_DETAIL_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT}}}return height},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],feature_name=feature[3],feature_strand=feature[4],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),draw_start=f_start,draw_end=f_end,y_center=(mode==="Dense"?0:(0+slot))*y_scale+this.get_top_padding(width),thickness,y_start,thick_start=null,thick_end=null,block_color=(!feature_strand||feature_strand==="+"||feature_strand==="."?this.prefs.block_color:this.prefs.reverse_strand_color);label_color=this.prefs.label_color;ctx.globalAlpha=this.alpha_scaler.gen_val(feature);if(mode==="Dense"){slot=1}if(mode==="no_detail"){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+5,f_end-f_start,NO_DETAIL_FEATURE_HEIGHT)}else{var feature_ts=feature[5],feature_te=feature[6],feature_blocks=feature[7],full_height=true;if(feature_ts&&feature_te){thick_start=Math.floor(Math.max(0,(feature_ts-tile_low)*w_scale));thick_end=Math.ceil(Math.min(width,Math.max(0,(feature_te-tile_low)*w_scale)))}var thin_height,thick_height;if(mode==="Squish"){thin_height=1;thick_height=SQUISH_FEATURE_HEIGHT;full_height=false}else{if(mode==="Dense"){thin_height=5;thick_height=DENSE_FEATURE_HEIGHT}else{thin_height=5;thick_height=PACK_FEATURE_HEIGHT}}if(!feature_blocks){ctx.fillStyle=block_color;ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height);if(feature_strand&&full_height){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}ctx.fillRect(f_start,y_center+1,f_end-f_start,thick_height)}}else{var cur_y_center,cur_height;if(mode==="Squish"||mode==="Dense"){cur_y_center=y_center+Math.floor(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}else{if(feature_strand){cur_y_center=y_center;cur_height=thick_height}else{cur_y_center+=(SQUISH_FEATURE_HEIGHT/2)+1;cur_height=1}}if(this.draw_background_connector){if(mode==="Squish"||mode==="Dense"){ctx.fillStyle=CONNECTOR_COLOR}else{if(feature_strand){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand")}}}else{ctx.fillStyle=CONNECTOR_COLOR}}ctx.fillRect(f_start,cur_y_center,f_end-f_start,cur_height)}var start_and_height;for(var k=0,k_len=feature_blocks.length;k<k_len;k++){var block=feature_blocks[k],block_start=Math.floor(Math.max(0,(block[0]-tile_low)*w_scale)),block_end=Math.ceil(Math.min(width,Math.max((block[1]-tile_low)*w_scale))),last_block_start,last_block_end;if(block_start>block_end){continue}ctx.fillStyle=block_color;ctx.fillRect(block_start,y_center+(thick_height-thin_height)/2+1,block_end-block_start,thin_height);if(thick_start!==undefined&&feature_te>feature_ts&&!(block_start>thick_end||block_end<thick_start)){var block_thick_start=Math.max(block_start,thick_start),block_thick_end=Math.min(block_end,thick_end);ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height);if(feature_blocks.length===1&&mode==="Pack"){if(feature_strand==="+"){ctx.fillStyle=ctx.canvas.manager.get_pattern("right_strand_inv")}else{if(feature_strand==="-"){ctx.fillStyle=ctx.canvas.manager.get_pattern("left_strand_inv")}}if(block_thick_start+14<block_thick_end){block_thick_start+=2;block_thick_end-=2}ctx.fillRect(block_thick_start,y_center+1,block_thick_end-block_thick_start,thick_height)}}if(this.draw_individual_connectors&&last_block_start){this.draw_connector(ctx,last_block_start,last_block_end,block_start,block_end,y_center)}last_block_start=block_start;last_block_end=block_end}if(mode==="Pack"){ctx.globalAlpha=1;ctx.fillStyle="white";var hscale_factor=this.height_scaler.gen_val(feature),new_height=Math.ceil(thick_height*hscale_factor),ws_height=Math.round((thick_height-new_height)/2);if(hscale_factor!==1){ctx.fillRect(f_start,cur_y_center+1,f_end-f_start,ws_height);ctx.fillRect(f_start,cur_y_center+thick_height-ws_height+1,f_end-f_start,ws_height)}}}ctx.globalAlpha=1;if(feature_name&&mode==="Pack"&&feature_start>tile_low){ctx.fillStyle=label_color;if(tile_low===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING,y_center+8);draw_end+=ctx.measureText(feature_name).width+LABEL_SPACING}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING,y_center+8);draw_start-=ctx.measureText(feature_name).width+LABEL_SPACING}}}ctx.globalAlpha=1;return[draw_start,draw_end]}});var ReadPainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler,ref_seq){FeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.ref_seq=(ref_seq?ref_seq.data:null)};extend(ReadPainter.prototype,FeaturePainter.prototype,{get_row_height:function(){var height,mode=this.mode;if(mode==="Dense"){height=DENSE_TRACK_HEIGHT}else{if(mode==="Squish"){height=SQUISH_TRACK_HEIGHT}else{height=PACK_TRACK_HEIGHT;if(this.prefs.show_insertions){height*=2}}}return height},draw_read:function(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,cigar,strand,ref_seq){ctx.textAlign="center";var tile_region=[tile_low,tile_high],base_offset=0,seq_offset=0,gap=0,char_width_px=ctx.canvas.manager.char_width_px,block_color=(strand==="+"?this.prefs.block_color:this.prefs.reverse_strand_color);var draw_last=[];if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){gap=Math.round(w_scale/2)}if(!cigar){cigar=[[0,ref_seq.length]]}for(var cig_id=0,len=cigar.length;cig_id<len;cig_id++){var cig=cigar[cig_id],cig_op="MIDNSHP=X"[cig[0]],cig_len=cig[1];if(cig_op==="H"||cig_op==="S"){base_offset-=cig_len}var seq_start=feature_start+base_offset,s_start=Math.floor(Math.max(0,(seq_start-tile_low)*w_scale)),s_end=Math.floor(Math.max(0,(seq_start+cig_len-tile_low)*w_scale));if(s_start===s_end){s_end+=1}switch(cig_op){case"H":break;case"S":case"M":case"=":if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=ref_seq.slice(seq_offset,seq_offset+cig_len);if(gap>0){ctx.fillStyle=block_color;ctx.fillRect(s_start-gap,y_center+1,s_end-s_start,9);ctx.fillStyle=CONNECTOR_COLOR;for(var c=0,str_len=seq.length;c<str_len;c++){if(this.prefs.show_differences){if(this.ref_seq){var ref_char=this.ref_seq[seq_start-tile_low+c];if(!ref_char||ref_char.toLowerCase()===seq[c].toLowerCase()){continue}}else{continue}}if(seq_start+c>=tile_low&&seq_start+c<=tile_high){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start,y_center+9)}}}else{ctx.fillStyle=block_color;ctx.fillRect(s_start,y_center+4,s_end-s_start,SQUISH_FEATURE_HEIGHT)}}seq_offset+=cig_len;base_offset+=cig_len;break;case"N":ctx.fillStyle=CONNECTOR_COLOR;ctx.fillRect(s_start-gap,y_center+5,s_end-s_start,1);base_offset+=cig_len;break;case"D":ctx.fillStyle="red";ctx.fillRect(s_start-gap,y_center+4,s_end-s_start,3);base_offset+=cig_len;break;case"P":break;case"I":var insert_x_coord=s_start-gap;if(is_overlap([seq_start,seq_start+cig_len],tile_region)){var seq=ref_seq.slice(seq_offset,seq_offset+cig_len);if(this.prefs.show_insertions){var x_center=s_start-(s_end-s_start)/2;if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){ctx.fillStyle="yellow";ctx.fillRect(x_center-gap,y_center-9,s_end-s_start,9);draw_last[draw_last.length]={type:"triangle",data:[insert_x_coord,y_center+4,5]};ctx.fillStyle=CONNECTOR_COLOR;switch(compute_overlap([seq_start,seq_start+cig_len],tile_region)){case (OVERLAP_START):seq=seq.slice(tile_low-seq_start);break;case (OVERLAP_END):seq=seq.slice(0,seq_start-tile_high);break;case (CONTAINED_BY):break;case (CONTAINS):seq=seq.slice(tile_low-seq_start,seq_start-tile_high);break}for(var c=0,str_len=seq.length;c<str_len;c++){var c_start=Math.floor(Math.max(0,(seq_start+c-tile_low)*w_scale));ctx.fillText(seq[c],c_start-(s_end-s_start)/2,y_center)}}else{ctx.fillStyle="yellow";ctx.fillRect(x_center,y_center+(this.mode!=="Dense"?2:5),s_end-s_start,(mode!=="Dense"?SQUISH_FEATURE_HEIGHT:DENSE_FEATURE_HEIGHT))}}else{if((mode==="Pack"||this.mode==="Auto")&&ref_seq!==undefined&&w_scale>char_width_px){draw_last.push({type:"text",data:[seq.length,insert_x_coord,y_center+9]})}else{}}}seq_offset+=cig_len;break;case"X":seq_offset+=cig_len;break}}ctx.fillStyle="yellow";var item,type,data;for(var i=0;i<draw_last.length;i++){item=draw_last[i];type=item.type;data=item.data;if(type==="text"){ctx.save();ctx.font="bold "+ctx.font;ctx.fillText(data[0],data[1],data[2]);ctx.restore()}else{if(type==="triangle"){drawDownwardEquilateralTriangle(ctx,data[0],data[1],data[2])}}}},draw_element:function(ctx,mode,feature,slot,tile_low,tile_high,w_scale,y_scale,width){var feature_uid=feature[0],feature_start=feature[1],feature_end=feature[2],feature_name=feature[3],f_start=Math.floor(Math.max(0,(feature_start-tile_low)*w_scale)),f_end=Math.ceil(Math.min(width,Math.max(0,(feature_end-tile_low)*w_scale))),y_center=(mode==="Dense"?0:(0+slot))*y_scale,label_color=this.prefs.label_color,gap=0;if((mode==="Pack"||this.mode==="Auto")&&w_scale>ctx.canvas.manager.char_width_px){var gap=Math.round(w_scale/2)}if(feature[5] instanceof Array){var b1_start=Math.floor(Math.max(0,(feature[4][0]-tile_low)*w_scale)),b1_end=Math.ceil(Math.min(width,Math.max(0,(feature[4][1]-tile_low)*w_scale))),b2_start=Math.floor(Math.max(0,(feature[5][0]-tile_low)*w_scale)),b2_end=Math.ceil(Math.min(width,Math.max(0,(feature[5][1]-tile_low)*w_scale))),connector=true;if(feature[4][1]>=tile_low&&feature[4][0]<=tile_high&&feature[4][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[4][0],feature[4][2],feature[4][3],feature[4][4])}else{connector=false}if(feature[5][1]>=tile_low&&feature[5][0]<=tile_high&&feature[5][2]){this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature[5][0],feature[5][2],feature[5][3],feature[5][4])}else{connector=false}if(connector&&b2_start>b1_end){ctx.fillStyle=CONNECTOR_COLOR;dashedLine(ctx,b1_end-gap,y_center+5,b2_start-gap,y_center+5)}}else{this.draw_read(ctx,mode,w_scale,y_center,tile_low,tile_high,feature_start,feature[4],feature[5],feature[6])}if(mode==="Pack"&&feature_start>tile_low&&feature_name!=="."){ctx.fillStyle=this.prefs.label_color;var tile_index=1;if(tile_index===0&&f_start-ctx.measureText(feature_name).width<0){ctx.textAlign="left";ctx.fillText(feature_name,f_end+LABEL_SPACING-gap,y_center+8)}else{ctx.textAlign="right";ctx.fillText(feature_name,f_start-LABEL_SPACING-gap,y_center+8)}}return[0,0]}});var ArcLinkedFeaturePainter=function(data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler){LinkedFeaturePainter.call(this,data,view_start,view_end,prefs,mode,alpha_scaler,height_scaler);this.longest_feature_length=this.calculate_longest_feature_length();this.draw_background_connector=false;this.draw_individual_connectors=true};extend(ArcLinkedFeaturePainter.prototype,FeaturePainter.prototype,LinkedFeaturePainter.prototype,{calculate_longest_feature_length:function(){var longest_feature_length=0;for(var i=0,len=this.data.length;i<len;i++){var feature=this.data[i],feature_start=feature[1],feature_end=feature[2];longest_feature_length=Math.max(longest_feature_length,feature_end-feature_start)}return longest_feature_length},get_top_padding:function(width){var view_range=this.view_end-this.view_start,w_scale=width/view_range;return Math.min(128,Math.ceil((this.longest_feature_length/2)*w_scale))},draw_connector:function(ctx,block1_start,block1_end,block2_start,block2_end,y_center){var x_center=(block1_end+block2_start)/2,radius=block2_start-x_center;var angle1=Math.PI,angle2=0;if(radius>0){ctx.beginPath();ctx.arc(x_center,y_center,block2_start-x_center,Math.PI,0);ctx.stroke()}}});var Color=function(rgb,a){if(Array.isArray(rgb)){this.rgb=rgb}else{if(rgb.length==6){this.rgb=rgb.match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{if(rgb.length==7){this.rgb=rgb.substring(1,7).match(/.{2}/g).map(function(c){return parseInt(c,16)})}else{this.rgb=rgb.split("").map(function(c){return parseInt(c+c,16)})}}}this.alpha=typeof(a)==="number"?a:1};Color.prototype={eval:function(){return this},toCSS:function(){if(this.alpha<1){return"rgba("+this.rgb.map(function(c){return Math.round(c)}).concat(this.alpha).join(", ")+")"}else{return"#"+this.rgb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")}},toHSL:function(){var r=this.rgb[0]/255,g=this.rgb[1]/255,b=this.rgb[2]/255,a=this.alpha;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2,d=max-min;if(max===min){h=s=0}else{s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h*360,s:s,l:l,a:a}},toARGB:function(){var argb=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+argb.map(function(i){i=Math.round(i);i=(i>255?255:(i<0?0:i)).toString(16);return i.length===1?"0"+i:i}).join("")},mix:function(color2,weight){color1=this;var p=weight;var w=p*2-1;var a=color1.toHSL().a-color2.toHSL().a;var w1=(((w*a==-1)?w:(w+a)/(1+w*a))+1)/2;var w2=1-w1;var rgb=[color1.rgb[0]*w1+color2.rgb[0]*w2,color1.rgb[1]*w1+color2.rgb[1]*w2,color1.rgb[2]*w1+color2.rgb[2]*w2];var alpha=color1.alpha*p+color2.alpha*(1-p);return new Color(rgb,alpha)}};var LinearRamp=function(start_color,end_color,start_value,end_value){this.start_color=new Color(start_color);this.end_color=new Color(end_color);this.start_value=start_value;this.end_value=end_value;this.value_range=end_value-start_value};LinearRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);value=(value-this.start_value)/this.value_range;return this.start_color.mix(this.end_color,1-value).toCSS()};var SplitRamp=function(start_color,middle_color,end_color,start_value,end_value){this.positive_ramp=new LinearRamp(middle_color,end_color,0,end_value);this.negative_ramp=new LinearRamp(middle_color,start_color,0,-start_value);this.start_value=start_value;this.end_value=end_value};SplitRamp.prototype.map_value=function(value){value=Math.max(value,this.start_value);value=Math.min(value,this.end_value);if(value>=0){return this.positive_ramp.map_value(value)}else{return this.negative_ramp.map_value(-value)}};var DiagonalHeatmapPainter=function(data,view_start,view_end,prefs,mode){Painter.call(this,data,view_start,view_end,prefs,mode);var i,len;if(this.prefs.min_value===undefined){var min_value=Infinity;for(i=0,len=this.data.length;i<len;i++){min_value=Math.min(min_value,this.data[i][5])}this.prefs.min_value=min_value}if(this.prefs.max_value===undefined){var max_value=-Infinity;for(i=0,len=this.data.length;i<len;i++){max_value=Math.max(max_value,this.data[i][5])}this.prefs.max_value=max_value}};DiagonalHeatmapPainter.prototype.default_prefs={min_value:undefined,max_value:undefined,mode:"Heatmap",pos_color:"#FF8C00",neg_color:"#4169E1"};DiagonalHeatmapPainter.prototype.draw=function(ctx,width,height,w_scale){var min_value=this.prefs.min_value,max_value=this.prefs.max_value,value_range=max_value-min_value,height_px=height,view_start=this.view_start,mode=this.mode,data=this.data,invsqrt2=1/Math.sqrt(2);var ramp=(new SplitRamp(this.prefs.neg_color,"#FFFFFF",this.prefs.pos_color,min_value,max_value));var d,s1,e1,s2,e2,value;var scale=function(p){return(p-view_start)*w_scale};ctx.save();ctx.rotate(-45*Math.PI/180);ctx.scale(invsqrt2,invsqrt2);for(var i=0,len=data.length;i<len;i++){d=data[i];s1=scale(d[1]);e1=scale(d[2]);s2=scale(d[4]);e2=scale(d[5]);value=d[6];ctx.fillStyle=(ramp.map_value(value));ctx.fillRect(s1,s2,(e1-s1),(e2-s2))}ctx.restore()};return{Scaler:Scaler,SummaryTreePainter:SummaryTreePainter,LinePainter:LinePainter,LinkedFeaturePainter:LinkedFeaturePainter,ReadPainter:ReadPainter,ArcLinkedFeaturePainter:ArcLinkedFeaturePainter,DiagonalHeatmapPainter:DiagonalHeatmapPainter}});
\ No newline at end of file
diff -r 04aaf661f80a92cfd8c804baccac348e3cc98355 -r 865c74ff03755f21eaaf4a557b1c2aeb1518e593 static/scripts/viz/trackster/painters.js
--- a/static/scripts/viz/trackster/painters.js
+++ b/static/scripts/viz/trackster/painters.js
@@ -236,9 +236,7 @@
// Paint track.
for (var i = 0, len = data.length; i < len; i++) {
ctx.fillStyle = ctx.strokeStyle = this.prefs.color;
- // -1 because LineTrack data uses 1-based coordinate system but painter
- // uses 0-based system.
- x_scaled = Math.round((data[i][0] - view_start - 1) * w_scale);
+ x_scaled = Math.round((data[i][0] - view_start) * w_scale);
y = data[i][1];
var top_overflow = false, bot_overflow = false;
if (y === null) {
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