forked from igvteam/igv.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testHtsgetReader.js
54 lines (42 loc) · 1.48 KB
/
testHtsgetReader.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import HtsgetReader from "../js/bam/htsgetReader.js";
function runHtsgetTests() {
// mock object
const genome = {
getChromosomeName: function (chr) {
return "chr" + chr;
}
}
QUnit.test('Load Urls - EBI', function (assert) {
var done = assert.async();
var id = 'genomics-public-data/platinum-genomes/bam/NA12877_S1.bam',
chr = 'chr1',
s = 10000,
end = 10100;
const trackConfig = {
url: 'http://35.196.212.220',
endpoint: '/reads/',
id: id
}
const reader = new HtsgetReader(trackConfig);
reader.readAlignments(chr, s, end).then(function (alignmentContainer) {
assert.ok(alignmentContainer);
assert.ok(alignmentContainer.alignments.length > 0);
done();
});
});
QUnit.test('Load Urls - EBI - Legacy convention', function (assert) {
var done = assert.async();
var endpoint = 'http://35.196.212.220',
id = 'genomics-public-data/platinum-genomes/bam/NA12877_S1.bam',
chr = 'chr1',
s = 10000,
end = 10100;
var reader = new HtsgetReader({endpoint: endpoint, id: id});
reader.readAlignments(chr, s, end).then(function (alignmentContainer) {
assert.ok(alignmentContainer);
assert.ok(alignmentContainer.alignments.length > 0);
done();
});
});
}
export default runHtsgetTests;