Skip to content

Commit

Permalink
Move away from visibleRegion dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 6, 2018
1 parent 01f1f12 commit 840c362
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/JBrowse/GenomeView.js
Expand Up @@ -1098,6 +1098,7 @@ slide: function(distance) {
},

setLocation: function(refseq, startbp, endbp) {
console.log('setLocation', refseq, startbp, endbp)
if (startbp === undefined) startbp = this.minVisible();
if (endbp === undefined) endbp = this.maxVisible();
if( typeof refseq == 'string' ) {
Expand Down
1 change: 1 addition & 0 deletions src/JBrowse/Store/SeqFeature/BAM.js
Expand Up @@ -257,6 +257,7 @@ return declare( [ SeqFeatureStore, DeferredStatsMixin, DeferredFeaturesMixin, In

// called by getFeatures from the DeferredFeaturesMixin
_getFeatures( query, featCallback, endCallback, errorCallback ) {
console.log(query)
let seqName = query.ref || this.refSeq.name
seqName = this.browser.regularizeReferenceName( seqName );
const pairCache = {};
Expand Down
10 changes: 5 additions & 5 deletions src/JBrowse/View/Track/Alignments2.js
Expand Up @@ -163,7 +163,6 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
},

fillBlock: function( args ) {

// workaround for the fact that initial load of JBrowse invokes fillBlock on nonsense regions
// and then the cache cleanup can be invoked in ways that destroys visible features
this.removeFeaturesFromCacheAfterDelay = this.removeFeaturesFromCacheAfterDelay || false
Expand All @@ -174,12 +173,13 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
}
if(this.config.viewAsPairs) {
let supermethod = this.getInherited(arguments)
var reg = this.browser.view.visibleRegion()
var len = Math.max(reg.end - reg.start, 4000)
var min = args.leftBase
var max = args.rightBase
var len = Math.max(min - max, 4000)
const region = {
ref: this.refSeq.name,
start: Math.max( 0, reg.start ),
end: reg.end,
start: Math.max( 0, min ),
end: max,
viewAsPairs: true
}

Expand Down

0 comments on commit 840c362

Please sign in to comment.