forked from GMOD/bam-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfakerecord.ts
47 lines (39 loc) · 794 Bytes
/
fakerecord.ts
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
// @ts-nocheck
import Record from '../src/record'
class FakeRecord extends Record {
constructor(read1, strand1, strand2, tlen) {
super({
bytes: {
start: 0,
byteArray: Buffer.from([
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
]),
},
})
this.read1 = read1
this.read2 = !read1
this.strand1 = strand1 === 'R'
this.strand2 = strand2 === 'R'
this.tlen = tlen
this._refID = 1
}
isRead1() {
return this.read1
}
isRead2() {
return this.read2
}
isMateReverseComplemented() {
return this.strand2
}
isReverseComplemented() {
return this.strand1
}
template_length() {
return this.tlen
}
_next_refid() {
return 1
}
}
module.exports = FakeRecord