Skip to content

Commit

Permalink
improve display of BaseCoverage scores
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Jan 22, 2013
1 parent 7dac8b9 commit 54136c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/JBrowse/View/Track/BaseCoverage.js
Expand Up @@ -37,6 +37,7 @@ return declare( Wiggle,
},

getFeatures: function( query, featureCallback, finishCallback, errorCallback ) {
var thisB = this;
var leftBase = query.start;
var rightBase = query.end;
var scale = query.scale; // px/bp
Expand Down Expand Up @@ -192,14 +193,14 @@ return declare( Wiggle,
drawRectangle('matchCoverage', toY(totalHeight), originY-toY( score['matchCoverage'] )+1, fRect);
totalHeight -= score['matchCoverage'];

for (counts in score) {
for (var counts in score) {
if (score.hasOwnProperty(counts) && counts != 'matchCoverage') {
drawRectangle( counts, toY(totalHeight), originY-toY( score[counts] )+1, fRect);
totalHeight -= score[counts];
}
}

}, this );
}, this );
},

/**
Expand Down Expand Up @@ -239,15 +240,22 @@ return declare( Wiggle,
* It displays more complete data.
*/
_showPixelValue: function( scoreDisplay, score ) {
if( typeof score['matchCoverage'] == 'number') {
var scoreSummary = "<u>COVERAGE SUMMARY</u><br>";
if (score['matchCoverage']){scoreSummary += "Matching Bases: "+score['matchCoverage']+'<br>';}
for (ID in score) {
if (score.hasOwnProperty(ID) && ID != 'matchCoverage') {
scoreSummary += ID + ': ' +score[ID] +'<br>';
if( score && typeof score['matchCoverage'] == 'number') {
var scoreSummary = '<table>';
if( score['matchCoverage'] ){
scoreSummary +=
"<tr><td>Ref"
+ (score['refBase'] ? ' ('+score['refBase']+')': '')
+ "</td><td>"
+ score['matchCoverage']
+ '</td></tr>';
}
for (var ID in score) {
if( score.hasOwnProperty(ID) && ID != 'matchCoverage' && ID != 'refBase' ) {
scoreSummary += '<tr><td>'+ID + '</td><td>' +score[ID] +'</td></tr>';
}
}
scoreDisplay.innerHTML = scoreSummary;
scoreDisplay.innerHTML = scoreSummary+'</table>';
return true;
} else {
return false;
Expand Down
3 changes: 3 additions & 0 deletions track_styles.css
Expand Up @@ -445,6 +445,9 @@ div.generic_parent-hist {
font-weight: bold;
cursor: default;
}
.wiggleValueDisplay td {
padding: 0 0.25em;
}
.wigglePositionIndicator {
background: #555;
border: none;
Expand Down

0 comments on commit 54136c6

Please sign in to comment.