Skip to content

Commit

Permalink
Only use neighboring block fetch strategy in paired arc view
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 27, 2018
1 parent bc94031 commit ecae2d0
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/JBrowse/View/Track/Alignments2.js
Expand Up @@ -322,9 +322,19 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
end: args.rightBase,
viewAsPairs: true
}
const numNeighboringBlockFetches = 6
const min = Math.max(0, region.start - Math.min(Math.max(len*numNeighboringBlockFetches, this.config.maxInsertSize), 100000))
const max = region.end + Math.min(Math.max(len*numNeighboringBlockFetches, this.config.maxInsertSize), 100000)
let min
let max

// when we use paired arc the insert size can be large and therefore we request a number of neighboring blocks
if(this.config.glyph == 'JBrowse/View/FeatureGlyph/PairedArc') {
const numNeighboringBlockFetches = 6
min = Math.max(0, region.start - Math.min(Math.max(len*numNeighboringBlockFetches, this.config.maxInsertSize), 100000))
max = region.end + Math.min(Math.max(len*numNeighboringBlockFetches, this.config.maxInsertSize), 100000)
} else {
// otherwise we just request based on maxInsertSize
min = Math.max(0, region.start - this.config.maxInsertSize)
max = region.end + this.config.maxInsertSize
}


var cachePromise = new Promise((resolve, reject) => {
Expand All @@ -335,9 +345,10 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {
viewAsPairs: this.config.viewAsPairs,
viewAsSpans: this.config.viewAsSpans,
maxInsertSize: this.config.maxInsertSize
}, () => { /* do nothing */}, () => {
}, () => {
/* do nothing except initialize caches on store backend */
}, () => {
this.insertSizeStats = this.insertSizeStats || this.store.getInsertSizeStats()

resolve()
}, reject)
})
Expand Down

0 comments on commit ecae2d0

Please sign in to comment.