Skip to content

Commit

Permalink
Set the initial pileup range correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
danvk committed Jun 12, 2015
1 parent 25e6364 commit 5866d0a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions cycledash/static/js/examine/components/PileupViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,28 +132,25 @@ var PileupViewer = React.createClass({
var pileupEl = this.refs.pileupElement.getDOMNode();

this.browser = pileup.create(pileupEl, {
range: {
contig: '20', // random position -- it will be changed.
start: 2684736 - 50,
stop: 2684736 + 50
},
range: this.rangeForRecord(this.props.selectedRecord),
tracks: sources
});
},
panToSelection: function() {
var rec = this.props.selectedRecord;
this.browser.setRange({
contig: rec.contig,
start: rec.position - 25,
stop: rec.position + 25
});
this.browser.setRange(this.rangeForRecord(this.props.selectedRecord));
},
update: function() {
if (this.props.isOpen && this.props.selectedRecord) {
this.lazilyCreateDalliance();
this.panToSelection();
}
},
rangeForRecord: function(record) {
return {
contig: record.contig,
start: record.position - 25,
stop: record.position + 25
};
},
fetchIndexChunks: function() {
var propBamPathPairs = [['normalBaiChunks', this.props.normalBamPath],
['tumorBaiChunks', this.props.tumorBamPath]];
Expand Down

0 comments on commit 5866d0a

Please sign in to comment.