1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/af5c9914169f/ Changeset: af5c9914169f User: jgoecks Date: 2013-06-08 00:01:36 Summary: Viz framework: (a) use features/pixel rather than features/base to determine what type of data to provide and (b) enable variant tracks to use coverage data. Affected #: 2 files diff -r 7add3a6019d30318ed8fa0f757f020a560e32c41 -r af5c9914169f7920b5c132f587ddfad1507d1aa3 lib/galaxy/webapps/galaxy/api/datasets.py --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -169,12 +169,16 @@ return { 'dataset_type': indexer.dataset_type, 'data': None } else: return stats + + # Stats provides features/base and resolution is bases/pixel, so + # multiplying them yields features/pixel. + features_per_pixel = stats[ 'data' ][ 'max' ] * float( kwargs[ 'resolution' ] ) - # Use heuristic based on max depth and region size to determine whether to - # return coverage data. When zoomed out and region is large, max depth + # Use heuristic based on features/pixel and region size to determine whether to + # return coverage data. When zoomed out and region is large, features/pixel # is determining factor. However, when sufficiently zoomed in and region is # small, coverage data is no longer provided. - if int( high ) - int( low ) > 50000 and stats[ 'data' ][ 'max' ] > 1000: + if int( high ) - int( low ) > 50000 and features_per_pixel > 1000: return indexer.get_data( chrom, low, high ) # diff -r 7add3a6019d30318ed8fa0f757f020a560e32c41 -r af5c9914169f7920b5c132f587ddfad1507d1aa3 static/scripts/viz/trackster/tracks.js --- a/static/scripts/viz/trackster/tracks.js +++ b/static/scripts/viz/trackster/tracks.js @@ -3379,11 +3379,24 @@ }, /** - * Returns true if data is compatible with a given mode. Defaults to true because, for many tracks, - * all data is compatible with all modes. + * Returns true if data is compatible with a given mode. */ data_and_mode_compatible: function(data, mode) { - return true; + // Only handle modes that user can set. + if (mode === "Auto") { + return true; + } + // Histogram mode requires bigwig data. + else if (mode === "Coverage") { + return data.dataset_type === "bigwig"; + } + // All other modes--Dense, Squish, Pack--require data + details. + else if (data.extra_info === "no_detail") { + return false; + } + else { + return true; + } }, /** @@ -4174,27 +4187,6 @@ } return new FeatureTrackTile(track, region, resolution, canvas, result.data, w_scale, mode, result.message, all_slotted, feature_mapper); - }, - - /** - * Returns true if data is compatible with a given mode. - */ - data_and_mode_compatible: function(data, mode) { - // Only handle modes that user can set. - if (mode === "Auto") { - return true; - } - // Histogram mode requires bigwig data. - else if (mode === "Coverage") { - return data.dataset_type === "bigwig"; - } - // All other modes--Dense, Squish, Pack--require data + details. - else if (data.extra_info === "no_detail") { - return false; - } - else { - return true; - } } }); @@ -4209,6 +4201,7 @@ track: this, params: [ { key: 'name', label: 'Name', type: 'text', default_value: this.name }, + { key: 'color', label: 'Histogram color', type: 'color', default_value: util.get_random_color() }, { key: 'show_sample_data', label: 'Show sample data', type: 'bool', default_value: true }, { key: 'show_labels', label: 'Show summary and sample labels', type: 'bool', default_value: true }, { key: 'summary_height', label: 'Locus summary height', type: 'float', default_value: 20 }, @@ -4296,8 +4289,12 @@ postdraw_actions: function(tiles, width, w_scale, clear_after) { TiledTrack.prototype.postdraw_actions.call(this, tiles, width, w_scale, clear_after); + var line_track_tiles = _.filter(tiles, function(t) { + return (t instanceof LineTrackTile); + }); + // Add summary/sample labels if needed and not already included. - if ( !(tiles[0] instanceof LineTrackTile) && this.prefs.show_labels) { + if ( line_track_tiles.length === 0 && this.prefs.show_labels) { var font_size; // Add and/or style labels. 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.