Skip to content

Commit

Permalink
Enable insert size coloring on normal alignments track
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 9, 2018
1 parent 703d4f7 commit d19cf20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/JBrowse/Store/SeqFeature/BAM.js
Expand Up @@ -222,6 +222,7 @@ return declare( [ SeqFeatureStore, DeferredStatsMixin, DeferredFeaturesMixin, In
.then(records => {
if(query.viewAsPairs) {
const recs = records.map(f => this._bamRecordToFeature(f))
recs.forEach(r => this.insertSizeCache.insertFeat(r))
this.pairFeatures(query, recs, featCallback, endCallback, errorCallback)
} else {
for(let i = 0; i < records.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/JBrowse/Store/SeqFeature/_InsertSizeCache.js
Expand Up @@ -24,14 +24,14 @@ return declare(null, {
},

insertFeat(feat) {
this.featureCache[feat.get('name')] = feat
this.featureCache[feat.get('name')] = Math.abs(feat.get('template_length'))
},

getInsertSizeStats() {
if(Object.keys(this.featureCache).length > this.insertStatsCacheMin) {
var total = Object.keys(this.featureCache).length
var tlens = Object.entries(this.featureCache)
.map(([k, v]) => Math.abs(v.get('template_length')))
.map(([k, v]) => Math.abs(v))
.filter(tlen => tlen < this.insertMaxSize)
.sort((a, b) => a - b)
var sum = tlens.reduce((a, b) => a + b, 0)
Expand Down
4 changes: 2 additions & 2 deletions src/JBrowse/View/Track/Alignments2.js
Expand Up @@ -61,12 +61,12 @@ return declare( [ CanvasFeatureTrack, AlignmentsMixin ], {

var m = {
type: 'dijit/Menu',
label: 'Pair options',
label: 'Track visualization options',
children: []
}
var c = {
type: 'dijit/Menu',
label: 'Color options',
label: 'Coloring options',
children: []
}

Expand Down

0 comments on commit d19cf20

Please sign in to comment.