-
-
Save danvk/1f772749c481f4da5fc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contig: range.contig, | |
start: range.start(), | |
stop: range.stop() | |
}); | |
}); | |
it('should fetch nearby features', function(done) { | |
this.timeout(5000); | |
var source = getTestSource(); | |
// Requests are for 'chr20', while the canonical name is just '20'. | |
var range = new ContigInterval('chr20', 31512050, 31512150), | |
rangeBefore = new ContigInterval('chr20', 31512000, 31512050), | |
rangeAfter = new ContigInterval('chr20', 31512150, 31512199); | |
var reads = source.getAlignmentsInRange(range); | |
expect(reads).to.deep.equal([]); | |
// Fetching [50, 150] should cache [0, 200] | |
source.on('newdata', () => { | |
var reads = source.getAlignmentsInRange(range); | |
expect(reads).to.have.length(19); | |
expect(reads[0].toString()).to.equal('20:31511951-31512051'); | |
expect(reads[18].toString()).to.equal('20:31512146-31512246'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment