Skip to content

Commit

Permalink
Add new options for wiggle summary rendering (maxScore,minScore,score…
Browse files Browse the repository at this point in the history
…). See #518
  • Loading branch information
cmdcolin committed Feb 6, 2015
1 parent f8d2851 commit 91620ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/JBrowse/Store/SeqFeature/BigWig/RequestWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ var RequestWorker = declare( null,
var sumSqData = data.getFloat32();

if (chromId == this.chr) {
var summaryOpts = {score: sumData/validCnt};
var summaryOpts = {score: sumData/validCnt,maxScore: mavVal,minScore:minVal};
if (this.window.bwg.type == 'bigbed') {
summaryOpts.type = 'density';
}
Expand Down Expand Up @@ -407,4 +407,4 @@ var RequestWorker = declare( null,

return RequestWorker;

});
});
6 changes: 4 additions & 2 deletions src/JBrowse/View/Track/WiggleBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ return declare( [BlockBasedTrack,ExportMixin, DetailStatsMixin ], {
_defaultConfig: function() {
return {
maxExportSpan: 500000,
autoscale: 'global'
autoscale: 'global',
scoreType: 'avg'
};
},

Expand Down Expand Up @@ -396,11 +397,12 @@ return declare( [BlockBasedTrack,ExportMixin, DetailStatsMixin ], {
_calculatePixelScores: function( canvasWidth, features, featureRects ) {
// make an array of the max score at each pixel on the canvas
var pixelValues = new Array( canvasWidth );
var scoreType = this.config.scoreType;
dojo.forEach( features, function( f, i ) {
var store = f.source;
var fRect = featureRects[i];
var jEnd = fRect.r;
var score = f.get('score');
var score = f.get(scoreType);
for( var j = Math.round(fRect.l); j < jEnd; j++ ) {
if ( pixelValues[j] && pixelValues[j]['lastUsedStore'] == store ) {
/* Note: if the feature is from a different store, the condition should fail,
Expand Down

0 comments on commit 91620ee

Please sign in to comment.