mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Trackster: fix for subsetting variant tracks.
This commit is contained in:
@@ -3139,6 +3139,11 @@ extend(TiledTrack.prototype, Drawable.prototype, Track.prototype, {
|
||||
var tile_drawn = $.Deferred();
|
||||
track.tile_cache.set_elt(key, tile_drawn);
|
||||
$.when.apply($, get_tile_data()).then( function() {
|
||||
// If deferred objects ever show up in tile data, that is likely because a
|
||||
// Deferred-subsetting interaction failed. Specifically, a Deferred for a superset
|
||||
// was returned but then couldn't be used). It's not clear whether this will happen
|
||||
// in practice, and currently the code doesn't handle it. It could probably handle it
|
||||
// by recursively calling draw_helper.
|
||||
var tile_data = get_tile_data(),
|
||||
tracks_data = tile_data,
|
||||
seq_data;
|
||||
@@ -3313,10 +3318,15 @@ extend(TiledTrack.prototype, Drawable.prototype, Track.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if data can be subsetted. Defaults to false to ensure data is fetched when needed.
|
||||
* Returns true if data can be subsetted.
|
||||
*/
|
||||
can_subset: function(data) {
|
||||
return false;
|
||||
// Do not subset entries with a message or data with no detail.
|
||||
if (data.dataset_type === 'bigwig' || data.message || data.extra_info === "no_detail") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -4116,18 +4126,6 @@ extend(FeatureTrack.prototype, Drawable.prototype, TiledTrack.prototype, {
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns true if data can be subsetted.
|
||||
*/
|
||||
can_subset: function(data) {
|
||||
// Do not subset entries with a message or data with no detail.
|
||||
if (data.dataset_type === 'bigwig' || data.message || data.extra_info === "no_detail") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ var select_datasets = function(dataset_url, add_track_async_url, filters, succes
|
||||
* Helper to determine if object is jQuery deferred.
|
||||
*/
|
||||
var is_deferred = function ( d ) {
|
||||
return ( 'isResolved' in d );
|
||||
return ('promise' in d);
|
||||
};
|
||||
|
||||
// --------- Models ---------
|
||||
@@ -331,14 +331,6 @@ var GenomeDataManager = Cache.extend({
|
||||
* Get data from dataset.
|
||||
*/
|
||||
get_data: function(region, mode, resolution, extra_params) {
|
||||
// Debugging:
|
||||
//console.log("get_data", low, high, mode);
|
||||
/*
|
||||
console.log("cache contents:")
|
||||
for (var i = 0; i < this.key_ary.length; i++) {
|
||||
console.log("\t", this.key_ary[i], this.obj_cache[this.key_ary[i]]);
|
||||
}
|
||||
*/
|
||||
|
||||
// Look for entry and return if it's a deferred or if data available is compatible with mode.
|
||||
var entry = this.get_elt(region);
|
||||
@@ -348,8 +340,7 @@ var GenomeDataManager = Cache.extend({
|
||||
}
|
||||
|
||||
//
|
||||
// Look in cache for data that can be used. Data can be reused if it
|
||||
// has the requested data and is not summary tree and has details.
|
||||
// Look in cache for data that can be used.
|
||||
// TODO: this logic could be improved if the visualization knew whether
|
||||
// the data was "index" or "data."
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user