Skip to content

Commit

Permalink
Update [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Aug 26, 2018
1 parent 4ee5bf2 commit 79962e3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/JBrowse/Store/SeqFeature/BAM.js
Expand Up @@ -123,7 +123,23 @@ var BAMStore = declare( [ SeqFeatureStore, DeferredStatsMixin, DeferredFeaturesM

// called by getFeatures from the DeferredFeaturesMixin
_getFeatures: function( query, featCallback, endCallback, errorCallback ) {
this.bam.fetch( query.ref ? query.ref : this.refSeq.name, query.start, query.end, featCallback, endCallback, errorCallback );
const features = [];
const fun = (feat) => {
features.push(feat);
}
const end = () => {
features.sort((a, b) => {
const x = a.get('cigar').indexOf("N")==-1;
const y = b.get('cigar').indexOf("N")==-1;
if(x && y) return 0;
if(x && !y) return 1;
if(!x && y) return -1;
else return 0;
})
features.forEach(featCallback);
endCallback();
}
this.bam.fetch( query.ref ? query.ref : this.refSeq.name, query.start, query.end, fun, end, errorCallback );
},

saveStore: function() {
Expand Down

0 comments on commit 79962e3

Please sign in to comment.