commit/galaxy-central: jgoecks: Circster improvements: (a) fetch a smaller amount of data on load and (b) use large quantile rather than max for top data range to limit impact of exceptionally large values.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/efccb227d72c/ changeset: efccb227d72c user: jgoecks date: 2012-11-06 15:52:23 summary: Circster improvements: (a) fetch a smaller amount of data on load and (b) use large quantile rather than max for top data range to limit impact of exceptionally large values. affected #: 2 files diff -r dd4786c5b4e48db780f6ec5da42dfafec19538f4 -r efccb227d72ccb2764544fd461195789653b4509 lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -636,9 +636,12 @@ data_provider = trans.app.data_provider_registry.get_data_provider( trans, original_dataset=dataset, source=source ) - # HACK: pass in additional params which are used for only some types of data providers; - # level, cutoffs used for summary tree, and interchromosomal used for chromatin interactions. - rval = data_provider.get_genome_data( chroms_info, level=4, detail_cutoff=0, draw_cutoff=0, + # HACK: pass in additional params which are used for only some + # types of data providers; level, cutoffs used for summary tree, + # num_samples for BBI, and interchromosomal used for chromatin interactions. + rval = data_provider.get_genome_data( chroms_info, + level=4, detail_cutoff=0, draw_cutoff=0, + num_samples=150, interchromosomal=True ) return rval diff -r dd4786c5b4e48db780f6ec5da42dfafec19538f4 -r efccb227d72ccb2764544fd461195789653b4509 static/scripts/viz/circster.js --- a/static/scripts/viz/circster.js +++ b/static/scripts/viz/circster.js @@ -720,6 +720,14 @@ var CircsterQuantitativeTrackView = CircsterTrackView.extend({ /** + * Returns quantile for an array of numbers. + */ + _quantile: function(numbers, quantile) { + numbers.sort(d3.ascending); + return d3.quantile(numbers, quantile); + }, + + /** * Renders quantitative data with the form [x, value] and assumes data is equally spaced across * chromosome. Attachs a dict with track and chrom name information to DOM element. */ @@ -750,7 +758,8 @@ // Radius scaler. var radius = d3.scale.linear() .domain(this.data_bounds) - .range(this.radius_bounds); + .range(this.radius_bounds) + .clamp(true); // Scaler for placing data points across arc. var angle = d3.scale.linear() @@ -854,7 +863,7 @@ if (typeof d === 'string' || !d.max) { return 0; } return d.max; }); - return [ 0, (max_data && typeof max_data !== 'string' ? _.max(max_data) : 0) ]; + return [ 0, (max_data && typeof max_data !== 'string' ? this._quantile(values, 0.98) : 0) ]; } }); @@ -865,7 +874,7 @@ get_data_bounds: function(data) { // Set max across dataset by extracting all values, flattening them into a - // single array, and getting the min and max. + // single array, and getting third quartile. var values = _.flatten( _.map(data, function(d) { if (d) { // Each data point has the form [position, value], so return all values. @@ -878,7 +887,7 @@ } }) ); - return [ _.min(values), _.max(values) ]; + return [ _.min(values), this._quantile(values, 0.98) ]; } }); 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.
participants (1)
-
Bitbucket