@gmod/cram 1.5.9 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/README.md +182 -172
- package/dist/craiIndex.d.ts +37 -0
- package/dist/craiIndex.js +196 -301
- package/dist/craiIndex.js.map +1 -0
- package/dist/cram-bundle.js +6 -15
- package/dist/cramFile/codecs/_base.d.ts +6 -0
- package/dist/cramFile/codecs/_base.js +44 -53
- package/dist/cramFile/codecs/_base.js.map +1 -0
- package/dist/cramFile/codecs/beta.d.ts +4 -0
- package/dist/cramFile/codecs/beta.js +38 -48
- package/dist/cramFile/codecs/beta.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/dist/cramFile/codecs/byteArrayLength.js +58 -78
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/dist/cramFile/codecs/byteArrayStop.js +62 -76
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/dist/cramFile/codecs/external.d.ts +7 -0
- package/dist/cramFile/codecs/external.js +63 -81
- package/dist/cramFile/codecs/external.js.map +1 -0
- package/dist/cramFile/codecs/gamma.d.ts +4 -0
- package/dist/cramFile/codecs/gamma.js +43 -56
- package/dist/cramFile/codecs/gamma.js.map +1 -0
- package/dist/cramFile/codecs/huffman.d.ts +17 -0
- package/dist/cramFile/codecs/huffman.js +126 -199
- package/dist/cramFile/codecs/huffman.js.map +1 -0
- package/dist/cramFile/codecs/index.d.ts +2 -0
- package/dist/cramFile/codecs/index.js +31 -38
- package/dist/cramFile/codecs/index.js.map +1 -0
- package/dist/cramFile/codecs/subexp.d.ts +4 -0
- package/dist/cramFile/codecs/subexp.js +51 -64
- package/dist/cramFile/codecs/subexp.js.map +1 -0
- package/dist/cramFile/constants.d.ts +36 -0
- package/dist/cramFile/constants.js +52 -50
- package/dist/cramFile/constants.js.map +1 -0
- package/dist/cramFile/container/compressionScheme.d.ts +23 -0
- package/dist/cramFile/container/compressionScheme.js +115 -153
- package/dist/cramFile/container/compressionScheme.js.map +1 -0
- package/dist/cramFile/container/index.d.ts +13 -0
- package/dist/cramFile/container/index.js +169 -283
- package/dist/cramFile/container/index.js.map +1 -0
- package/dist/cramFile/file.d.ts +63 -0
- package/dist/cramFile/file.js +440 -766
- package/dist/cramFile/file.js.map +1 -0
- package/dist/cramFile/index.d.ts +2 -0
- package/dist/cramFile/index.js +7 -4
- package/dist/cramFile/index.js.map +1 -0
- package/dist/cramFile/record.d.ts +79 -0
- package/dist/cramFile/record.js +253 -308
- package/dist/cramFile/record.js.map +1 -0
- package/dist/cramFile/sectionParsers.d.ts +18 -0
- package/dist/cramFile/sectionParsers.js +324 -362
- package/dist/cramFile/sectionParsers.js.map +1 -0
- package/dist/cramFile/slice/decodeRecord.d.ts +2 -0
- package/dist/cramFile/slice/decodeRecord.js +278 -298
- package/dist/cramFile/slice/decodeRecord.js.map +1 -0
- package/dist/cramFile/slice/index.d.ts +20 -0
- package/dist/cramFile/slice/index.js +488 -789
- package/dist/cramFile/slice/index.js.map +1 -0
- package/dist/cramFile/util.d.ts +5 -0
- package/dist/cramFile/util.js +158 -144
- package/dist/cramFile/util.js.map +1 -0
- package/dist/errors.d.ts +23 -0
- package/dist/errors.js +66 -103
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -0
- package/dist/indexedCramFile.d.ts +39 -0
- package/dist/indexedCramFile.js +213 -315
- package/dist/indexedCramFile.js.map +1 -0
- package/dist/io/bufferCache.d.ts +12 -0
- package/dist/io/bufferCache.js +108 -128
- package/dist/io/bufferCache.js.map +1 -0
- package/dist/io/index.d.ts +5 -0
- package/dist/io/index.js +29 -27
- package/dist/io/index.js.map +1 -0
- package/dist/io/localFile.d.ts +10 -0
- package/dist/io/localFile.js +105 -162
- package/dist/io/localFile.js.map +1 -0
- package/dist/io/remoteFile.d.ts +16 -0
- package/dist/io/remoteFile.js +137 -206
- package/dist/io/remoteFile.js.map +1 -0
- package/dist/rans/constants.d.ts +3 -0
- package/dist/rans/constants.js +6 -6
- package/dist/rans/constants.js.map +1 -0
- package/dist/rans/d04.d.ts +1 -0
- package/dist/rans/d04.js +70 -99
- package/dist/rans/d04.js.map +1 -0
- package/dist/rans/d14.d.ts +1 -0
- package/dist/rans/d14.js +55 -93
- package/dist/rans/d14.js.map +1 -0
- package/dist/rans/decoding.d.ts +30 -0
- package/dist/rans/decoding.js +112 -159
- package/dist/rans/decoding.js.map +1 -0
- package/dist/rans/frequencies.d.ts +2 -0
- package/dist/rans/frequencies.js +110 -119
- package/dist/rans/frequencies.js.map +1 -0
- package/dist/rans/index.d.ts +1 -0
- package/dist/rans/index.js +111 -174
- package/dist/rans/index.js.map +1 -0
- package/dist/sam.d.ts +1 -0
- package/dist/sam.js +16 -41
- package/dist/sam.js.map +1 -0
- package/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +9 -0
- package/dist/unzip-pako.js.map +1 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +6 -0
- package/dist/unzip.js.map +1 -0
- package/errors.js +66 -103
- package/esm/craiIndex.d.ts +37 -0
- package/esm/craiIndex.js +158 -0
- package/esm/craiIndex.js.map +1 -0
- package/esm/cramFile/codecs/_base.d.ts +6 -0
- package/esm/cramFile/codecs/_base.js +42 -0
- package/esm/cramFile/codecs/_base.js.map +1 -0
- package/esm/cramFile/codecs/beta.d.ts +4 -0
- package/esm/cramFile/codecs/beta.js +15 -0
- package/esm/cramFile/codecs/beta.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/esm/cramFile/codecs/byteArrayLength.js +35 -0
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/esm/cramFile/codecs/byteArrayStop.js +40 -0
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/esm/cramFile/codecs/external.d.ts +7 -0
- package/esm/cramFile/codecs/external.js +40 -0
- package/esm/cramFile/codecs/external.js.map +1 -0
- package/esm/cramFile/codecs/gamma.d.ts +4 -0
- package/esm/cramFile/codecs/gamma.js +20 -0
- package/esm/cramFile/codecs/gamma.js.map +1 -0
- package/esm/cramFile/codecs/huffman.d.ts +17 -0
- package/esm/cramFile/codecs/huffman.js +107 -0
- package/esm/cramFile/codecs/huffman.js.map +1 -0
- package/esm/cramFile/codecs/index.d.ts +2 -0
- package/esm/cramFile/codecs/index.js +30 -0
- package/esm/cramFile/codecs/index.js.map +1 -0
- package/esm/cramFile/codecs/subexp.d.ts +4 -0
- package/esm/cramFile/codecs/subexp.js +28 -0
- package/esm/cramFile/codecs/subexp.js.map +1 -0
- package/esm/cramFile/constants.d.ts +36 -0
- package/esm/cramFile/constants.js +51 -0
- package/esm/cramFile/constants.js.map +1 -0
- package/esm/cramFile/container/compressionScheme.d.ts +23 -0
- package/esm/cramFile/container/compressionScheme.js +123 -0
- package/esm/cramFile/container/compressionScheme.js.map +1 -0
- package/esm/cramFile/container/index.d.ts +13 -0
- package/esm/cramFile/container/index.js +84 -0
- package/esm/cramFile/container/index.js.map +1 -0
- package/esm/cramFile/file.d.ts +63 -0
- package/esm/cramFile/file.js +281 -0
- package/esm/cramFile/file.js.map +1 -0
- package/esm/cramFile/index.d.ts +2 -0
- package/esm/cramFile/index.js +3 -0
- package/esm/cramFile/index.js.map +1 -0
- package/esm/cramFile/record.d.ts +79 -0
- package/esm/cramFile/record.js +297 -0
- package/esm/cramFile/record.js.map +1 -0
- package/esm/cramFile/sectionParsers.d.ts +18 -0
- package/esm/cramFile/sectionParsers.js +347 -0
- package/esm/cramFile/sectionParsers.js.map +1 -0
- package/esm/cramFile/slice/decodeRecord.d.ts +2 -0
- package/esm/cramFile/slice/decodeRecord.js +299 -0
- package/esm/cramFile/slice/decodeRecord.js.map +1 -0
- package/esm/cramFile/slice/index.d.ts +20 -0
- package/esm/cramFile/slice/index.js +364 -0
- package/esm/cramFile/slice/index.js.map +1 -0
- package/esm/cramFile/util.d.ts +5 -0
- package/esm/cramFile/util.js +161 -0
- package/esm/cramFile/util.js.map +1 -0
- package/esm/errors.d.ts +23 -0
- package/esm/errors.js +24 -0
- package/esm/errors.js.map +1 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -0
- package/esm/indexedCramFile.d.ts +39 -0
- package/esm/indexedCramFile.js +155 -0
- package/esm/indexedCramFile.js.map +1 -0
- package/esm/io/bufferCache.d.ts +12 -0
- package/esm/io/bufferCache.js +54 -0
- package/esm/io/bufferCache.js.map +1 -0
- package/esm/io/index.d.ts +5 -0
- package/esm/io/index.js +24 -0
- package/esm/io/index.js.map +1 -0
- package/esm/io/localFile.d.ts +10 -0
- package/esm/io/localFile.js +31 -0
- package/esm/io/localFile.js.map +1 -0
- package/esm/io/remoteFile.d.ts +16 -0
- package/esm/io/remoteFile.js +64 -0
- package/esm/io/remoteFile.js.map +1 -0
- package/esm/rans/constants.d.ts +3 -0
- package/esm/rans/constants.js +5 -0
- package/esm/rans/constants.js.map +1 -0
- package/esm/rans/d04.d.ts +1 -0
- package/esm/rans/d04.js +67 -0
- package/esm/rans/d04.js.map +1 -0
- package/esm/rans/d14.d.ts +1 -0
- package/esm/rans/d14.js +52 -0
- package/esm/rans/d14.js.map +1 -0
- package/esm/rans/decoding.d.ts +30 -0
- package/esm/rans/decoding.js +118 -0
- package/esm/rans/decoding.js.map +1 -0
- package/esm/rans/frequencies.d.ts +2 -0
- package/esm/rans/frequencies.js +110 -0
- package/esm/rans/frequencies.js.map +1 -0
- package/esm/rans/index.d.ts +1 -0
- package/esm/rans/index.js +195 -0
- package/esm/rans/index.js.map +1 -0
- package/esm/sam.d.ts +1 -0
- package/esm/sam.js +16 -0
- package/esm/sam.js.map +1 -0
- package/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +5 -0
- package/esm/unzip-pako.js.map +1 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +3 -0
- package/esm/unzip.js.map +1 -0
- package/package.json +38 -35
- package/src/craiIndex.js +180 -0
- package/src/cramFile/codecs/_base.js +49 -0
- package/src/cramFile/codecs/beta.js +23 -0
- package/src/cramFile/codecs/byteArrayLength.js +55 -0
- package/src/cramFile/codecs/byteArrayStop.js +50 -0
- package/src/cramFile/codecs/external.js +54 -0
- package/src/cramFile/codecs/gamma.js +30 -0
- package/src/cramFile/codecs/huffman.js +137 -0
- package/src/cramFile/codecs/index.js +38 -0
- package/src/cramFile/codecs/subexp.js +32 -0
- package/src/cramFile/constants.js +55 -0
- package/src/cramFile/container/compressionScheme.js +144 -0
- package/src/cramFile/container/index.js +119 -0
- package/src/cramFile/file.js +347 -0
- package/src/cramFile/index.js +3 -0
- package/src/cramFile/record.js +337 -0
- package/src/cramFile/sectionParsers.js +379 -0
- package/src/cramFile/slice/decodeRecord.js +362 -0
- package/src/cramFile/slice/index.js +497 -0
- package/src/cramFile/util.js +169 -0
- package/src/errors.js +22 -0
- package/src/index.js +5 -0
- package/src/indexedCramFile.js +191 -0
- package/src/io/bufferCache.js +66 -0
- package/src/io/index.js +26 -0
- package/src/io/localFile.js +35 -0
- package/src/io/remoteFile.js +71 -0
- package/src/rans/README.md +1 -0
- package/src/rans/constants.js +5 -0
- package/src/rans/d04.js +83 -0
- package/src/rans/d14.js +59 -0
- package/src/rans/decoding.js +141 -0
- package/src/rans/frequencies.js +121 -0
- package/src/rans/index.js +249 -0
- package/src/sam.js +15 -0
- package/src/unzip-pako.ts +5 -0
- package/src/unzip.ts +2 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# v1.6.2
|
|
2
|
+
|
|
3
|
+
- Publish src directory for better source maps
|
|
4
|
+
|
|
5
|
+
# v1.6.1
|
|
6
|
+
|
|
7
|
+
- Explicitly use pako for browser bundle to help avoid buggy zlib polyfills
|
|
8
|
+
|
|
9
|
+
# v1.6.0
|
|
10
|
+
|
|
11
|
+
- Support CRAMv3.1 (thanks to @jkbonfield for contributing!)
|
|
12
|
+
- Support bzip codec
|
|
13
|
+
- Remove localFile from the browser bundle using "browser" package.json field
|
|
14
|
+
- Add esm module field in package.json
|
|
15
|
+
|
|
16
|
+
# v1.5.9
|
|
17
|
+
|
|
18
|
+
- Fix CRAM not downloading proper records for long reads (pt2, PR #84)
|
|
19
|
+
|
|
20
|
+
# v1.5.8
|
|
21
|
+
|
|
22
|
+
- Fix CRAM not downloading proper records for long reads (pt1, PR #85)
|
|
23
|
+
|
|
24
|
+
# v1.5.7
|
|
25
|
+
|
|
26
|
+
- Add getHeaderText to CRAM to get SAM header
|
|
27
|
+
|
|
28
|
+
# v1.5.6
|
|
29
|
+
|
|
30
|
+
- Remove unnecessary rethor win tinyMemoize error handler
|
|
31
|
+
- Avoid uncaught promise from constructor
|
|
32
|
+
|
|
33
|
+
# v1.5.5
|
|
34
|
+
|
|
35
|
+
- Fix ability to reload CRAM file after failure
|
|
36
|
+
- Check if BAI file incorrectly submitted as index for CRAM
|
|
37
|
+
|
|
38
|
+
# v1.5.4
|
|
39
|
+
|
|
40
|
+
- Fix handling of hard clipping
|
|
41
|
+
|
|
42
|
+
# v1.5.3
|
|
43
|
+
|
|
44
|
+
- Improved README
|
|
45
|
+
- Upgrade to babel 7
|
|
46
|
+
- Upgrade @gmod/binary-parser
|
|
47
|
+
- Add fix for 'b', 'q', and 'Q' readFeatures
|
|
48
|
+
|
|
49
|
+
# v1.5.2
|
|
50
|
+
|
|
51
|
+
- Fix off-by-one error in range query
|
|
52
|
+
- Add webpack cram-bundle.js
|
|
53
|
+
|
|
54
|
+
# v1.5.1
|
|
55
|
+
|
|
56
|
+
- Add fix for when mate is unmapped
|
|
57
|
+
|
|
58
|
+
# v1.5.0
|
|
59
|
+
|
|
60
|
+
- Add lossy-names support
|
|
61
|
+
- Fix for mate strand
|
|
62
|
+
|
|
63
|
+
# v1.4.3
|
|
64
|
+
|
|
65
|
+
- Make sure mate exists for unmated pair, can exist when coordinate slices of cram file are made via samtools view
|
|
66
|
+
|
|
67
|
+
# v1.4.2
|
|
68
|
+
|
|
69
|
+
- Switch to es6-promisify for ie11
|
|
70
|
+
- Switch to quick-lru instead of lru-cache for ie11
|
|
71
|
+
|
|
72
|
+
# v1.4.1
|
|
73
|
+
|
|
74
|
+
- Add maxInsertSize for viewAsPairs
|
|
75
|
+
|
|
76
|
+
# v1.4.0
|
|
77
|
+
|
|
78
|
+
- Add viewAsPairs implementation
|
|
79
|
+
|
|
80
|
+
# v1.3.0
|
|
81
|
+
|
|
82
|
+
- Fix tests in node 6
|
|
83
|
+
- Make cram record unique IDs start at 1 instead of 0 to always be truthy
|
|
84
|
+
- Implement gamma and subexp codecs
|
|
85
|
+
|
|
86
|
+
# v1.2.0
|
|
87
|
+
|
|
88
|
+
- Add `getReadBases` docs
|
|
89
|
+
- Rewrite seq calculation to be much faster
|
|
90
|
+
- Implement ref fetching for multi-ref slices
|
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @gmod/cram
|
|
2
2
|
|
|
3
|
-
[](https://github.com/diegohaz/nod)
|
|
4
3
|
[](https://npmjs.org/package/@gmod/cram)
|
|
5
|
-
[](https://codecov.io/gh/GMOD/cram-js/branch/master)
|
|
5
|
+
[](https://github.com/GMOD/cram-js/actions?query=branch%3Amaster+workflow%3APush+)
|
|
6
6
|
|
|
7
7
|
Read CRAM files (indexed or unindexed) with pure JS, works in node or in the browser.
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- Reads CRAM 3.x and 2.x (3.1 added in v1.6.0)
|
|
10
|
+
- Does not read CRAM 1.x
|
|
11
|
+
- Can use .crai indexes out of the box, for efficient sequence fetching, but also has an [index API](#craiindex) that would allow use with other index types
|
|
12
|
+
- Does implement bzip2 but not lzma codecs (yet); if this is important to your use case, please file an issue
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
@@ -24,101 +24,142 @@ $ yarn add @gmod/cram
|
|
|
24
24
|
```js
|
|
25
25
|
const { IndexedCramFile, CramFile, CraiIndex } = require('@gmod/cram')
|
|
26
26
|
|
|
27
|
-
//Use indexedfasta library for seqFetch, if using local file (see below)
|
|
27
|
+
// Use indexedfasta library for seqFetch, if using local file (see below)
|
|
28
28
|
const { IndexedFasta, BgzipIndexedFasta } = require('@gmod/indexedfasta')
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
// this uses local file paths for node.js for IndexedFasta, for usages using
|
|
31
|
+
// remote URLs see indexedfasta docs for filehandles and
|
|
32
|
+
// https://github.com/gmod/generic-filehandle
|
|
31
33
|
const t = new IndexedFasta({
|
|
32
34
|
path: '/filesystem/yourfile.fa',
|
|
33
35
|
faiPath: '/filesystem/yourfile.fa.fai',
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// open local files
|
|
38
|
-
const indexedFile = new IndexedCramFile({
|
|
39
|
-
cramPath: '/filesystem/yourfile.cram',
|
|
40
|
-
index: new CraiIndex({
|
|
41
|
-
path: '/filesystem/yourfile.cram.crai'),
|
|
42
|
-
}),
|
|
43
|
-
seqFetch: async (seqId, start, end) => {
|
|
44
|
-
// note:
|
|
45
|
-
// * seqFetch should return a promise for a string, in this instance retrieved from IndexedFasta
|
|
46
|
-
// * we use start-1 because cram-js uses 1-based but IndexedFasta uses 0-based coordinates
|
|
47
|
-
// * the seqId is a numeric identifier
|
|
48
|
-
return t.getSequence(seqId, start-1, end)
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
checkSequenceMD5: false,
|
|
52
36
|
})
|
|
53
37
|
|
|
54
38
|
// example of fetching records from an indexed CRAM file.
|
|
55
39
|
// NOTE: only numeric IDs for the reference sequence are accepted.
|
|
56
|
-
// For indexedfasta the numeric ID is the order in which the sequence names
|
|
40
|
+
// For indexedfasta the numeric ID is the order in which the sequence names
|
|
41
|
+
// appear in the header
|
|
57
42
|
|
|
58
43
|
// Wrap in an async and then run
|
|
59
|
-
run = async() => {
|
|
60
|
-
const
|
|
44
|
+
run = async () => {
|
|
45
|
+
const idToName = []
|
|
46
|
+
const nameToId = {}
|
|
47
|
+
|
|
48
|
+
// example opening local files on node.js
|
|
49
|
+
// can also pass `cramUrl` (for the IndexedCramFile class), and `url` (for
|
|
50
|
+
// the CraiIndex) params to open remote URLs
|
|
51
|
+
//
|
|
52
|
+
// alternatively `cramFilehandle` (for the IndexedCramFile class) and
|
|
53
|
+
// `filehandle` (for the CraiIndex) can be used, see for examples
|
|
54
|
+
// https://github.com/gmod/generic-filehandle
|
|
55
|
+
|
|
56
|
+
const indexedFile = new IndexedCramFile({
|
|
57
|
+
cramPath: '/filesystem/yourfile.cram',
|
|
58
|
+
//or
|
|
59
|
+
//cramUrl: 'url/to/file.cram'
|
|
60
|
+
//cramFilehandle: a generic-filehandle or similar filehandle
|
|
61
|
+
index: new CraiIndex({
|
|
62
|
+
path: '/filesystem/yourfile.cram.crai',
|
|
63
|
+
// or
|
|
64
|
+
// url: 'url/to/file.cram.crai'
|
|
65
|
+
// filehandle: a generic-filehandle or similar filehandle
|
|
66
|
+
}),
|
|
67
|
+
seqFetch: async (seqId, start, end) => {
|
|
68
|
+
// note:
|
|
69
|
+
// * seqFetch should return a promise for a string, in this instance retrieved from IndexedFasta
|
|
70
|
+
// * we use start-1 because cram-js uses 1-based but IndexedFasta uses 0-based coordinates
|
|
71
|
+
// * the seqId is a numeric identifier, so we convert it back to a name with idToName
|
|
72
|
+
// * you can return an empty string from this function for testing if you want, but you may not get proper interpretation of record.readFeatures
|
|
73
|
+
return t.getSequence(idToName[seqId], start - 1, end)
|
|
74
|
+
},
|
|
75
|
+
checkSequenceMD5: false,
|
|
76
|
+
})
|
|
77
|
+
const samHeader = await indexedFile.cram.getSamHeader()
|
|
78
|
+
|
|
79
|
+
// use the @SQ lines in the header to figure out the
|
|
80
|
+
// mapping between ref ref ID numbers and names
|
|
81
|
+
|
|
82
|
+
const sqLines = samHeader.filter(l => l.tag === 'SQ')
|
|
83
|
+
sqLines.forEach((sqLine, refId) => {
|
|
84
|
+
sqLine.data.forEach(item => {
|
|
85
|
+
if (item.tag === 'SN') {
|
|
86
|
+
// this is the ref name
|
|
87
|
+
const refName = item.value
|
|
88
|
+
nameToId[refName] = refId
|
|
89
|
+
idToName[refId] = refName
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const records = await indexedFile.getRecordsForRange(
|
|
95
|
+
nameToId['chr1'],
|
|
96
|
+
10000,
|
|
97
|
+
20000,
|
|
98
|
+
)
|
|
61
99
|
records.forEach(record => {
|
|
62
100
|
console.log(`got a record named ${record.readName}`)
|
|
63
|
-
record.readFeatures
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
record.readName
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
101
|
+
if (record.readFeatures != undefined) {
|
|
102
|
+
record.readFeatures.forEach(({ code, pos, refPos, ref, sub }) => {
|
|
103
|
+
// process the read features. this can be used similar to
|
|
104
|
+
// CIGAR/MD strings in SAM. see CRAM specs for more details.
|
|
105
|
+
if (code === 'X') {
|
|
106
|
+
console.log(
|
|
107
|
+
`${record.readName} shows a base substitution of ${ref}->${sub} at ${refPos}`,
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
}
|
|
73
112
|
})
|
|
74
113
|
}
|
|
75
114
|
|
|
76
115
|
run()
|
|
77
116
|
|
|
78
|
-
|
|
79
117
|
// can also pass `cramUrl` (for the IndexedCramFile class), and `url` (for the CraiIndex) params to open remote URLs
|
|
80
118
|
// alternatively `cramFilehandle` (for the IndexedCramFile class) and `filehandle` (for the CraiIndex) can be used, see for examples https://github.com/gmod/generic-filehandle
|
|
81
119
|
```
|
|
82
120
|
|
|
121
|
+
You can use cram-js without NPM also with the cram-bundle.js. See the example directory for usage with script tag
|
|
122
|
+
|
|
83
123
|
## API (auto-generated)
|
|
84
124
|
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
125
|
+
- [CramRecord](#cramrecord) - format of CRAM records returned by this API
|
|
126
|
+
- [ReadFeatures](#readfeatures) - format of read features on records
|
|
127
|
+
- [IndexedCramFile](#indexedcramfile) - indexed access into a CRAM file
|
|
128
|
+
- [CramFile](#cramfile) - .cram API
|
|
129
|
+
- [CraiIndex](#craiindex) - .crai index API
|
|
130
|
+
- [Error Classes](#error-classes) - special error classes thrown by this API
|
|
91
131
|
|
|
92
132
|
### CramRecord
|
|
93
133
|
|
|
94
|
-
These are the record objects returned by this API. Much of the data
|
|
95
|
-
is stored in them as simple object entries, but there are some accessor
|
|
96
|
-
methods used for conveniently getting the values of each of the flags in
|
|
97
|
-
the `flags` and `cramFlags` fields.
|
|
98
|
-
|
|
99
|
-
#### Static fields
|
|
100
|
-
|
|
101
|
-
- **flags** (`number`): the SAM bit-flags field, see the SAM spec for interpretation. Some of the `is*` methods below interpret this field.
|
|
102
|
-
- **cramFlags** (`number`): the CRAM-specific bit-flags field, see the CRAM spec for interpretation. Some of the `is*` methods below interpret this field.
|
|
103
|
-
- **sequenceId** (`number`): the ID number of the record's reference sequence
|
|
104
|
-
- **readLength** (`number`): length of the read in bases
|
|
105
|
-
- **alignmentStart** (`number`): start coordinate of the alignment on the reference in 1-based closed coordinates
|
|
106
|
-
- **readGroupId** (`number`): ID number of the read group, or -1 if none
|
|
107
|
-
- **readName** (`number`): name of the read (string)
|
|
108
|
-
- **templateSize** (`number`): for paired sequencing, the total size of the template
|
|
109
|
-
- **readFeatures** (`array[ReadFeature]`): array of read features showing insertions, deletions, mismatches, etc. See [ReadFeatures](#readfeatures) for their format.
|
|
110
|
-
- **lengthOnRef** (`number`): span of the alignment along the reference sequence
|
|
111
|
-
- **mappingQuality** (`number`): SAM mapping quality
|
|
112
|
-
- **qualityScores** (`array[number]`): array of numeric quality scores
|
|
113
|
-
- **uniqueId** (`number`): unique ID number of the record within the file
|
|
114
|
-
- **mate** (`object`)
|
|
115
|
-
- **flags** (`number`): CRAM mapping flags for the mate. See CRAM spec for interpretation. Some of the `is*` methods below interpret this field.
|
|
116
|
-
- **sequenceId** (`number`): reference sequence ID for the mate mapping
|
|
117
|
-
- **alignmentStart** (`number`): start coordinate of the mate mapping. 1-based coordinates.
|
|
118
|
-
|
|
119
134
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
120
135
|
|
|
121
|
-
|
|
136
|
+
##### Table of Contents
|
|
137
|
+
|
|
138
|
+
- [CramRecord](#cramrecord)
|
|
139
|
+
- [isPaired](#ispaired)
|
|
140
|
+
- [isProperlyPaired](#isproperlypaired)
|
|
141
|
+
- [isSegmentUnmapped](#issegmentunmapped)
|
|
142
|
+
- [isMateUnmapped](#ismateunmapped)
|
|
143
|
+
- [isReverseComplemented](#isreversecomplemented)
|
|
144
|
+
- [isMateReverseComplemented](#ismatereversecomplemented)
|
|
145
|
+
- [isRead1](#isread1)
|
|
146
|
+
- [isRead2](#isread2)
|
|
147
|
+
- [isSecondary](#issecondary)
|
|
148
|
+
- [isFailedQc](#isfailedqc)
|
|
149
|
+
- [isDuplicate](#isduplicate)
|
|
150
|
+
- [isSupplementary](#issupplementary)
|
|
151
|
+
- [isDetached](#isdetached)
|
|
152
|
+
- [hasMateDownStream](#hasmatedownstream)
|
|
153
|
+
- [isPreservingQualityScores](#ispreservingqualityscores)
|
|
154
|
+
- [isUnknownBases](#isunknownbases)
|
|
155
|
+
- [getReadBases](#getreadbases)
|
|
156
|
+
- [getPairOrientation](#getpairorientation)
|
|
157
|
+
- [addReferenceSequence](#addreferencesequence)
|
|
158
|
+
- [Parameters](#parameters)
|
|
159
|
+
|
|
160
|
+
#### CramRecord
|
|
161
|
+
|
|
162
|
+
Class of each CRAM record returned by this API.
|
|
122
163
|
|
|
123
164
|
##### isPaired
|
|
124
165
|
|
|
@@ -190,6 +231,12 @@ Get the original sequence of this read.
|
|
|
190
231
|
|
|
191
232
|
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** sequence basepairs
|
|
192
233
|
|
|
234
|
+
##### getPairOrientation
|
|
235
|
+
|
|
236
|
+
Get the pair orientation of a paired read. Adapted from igv.js
|
|
237
|
+
|
|
238
|
+
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of paired orientatin
|
|
239
|
+
|
|
193
240
|
##### addReferenceSequence
|
|
194
241
|
|
|
195
242
|
Annotates this feature with the given reference sequence basepair
|
|
@@ -197,13 +244,15 @@ information. This will add a `sub` and a `ref` item to base
|
|
|
197
244
|
subsitution read features given the actual substituted and reference
|
|
198
245
|
base pairs, and will make the `getReadSequence()` method work.
|
|
199
246
|
|
|
200
|
-
|
|
247
|
+
###### Parameters
|
|
201
248
|
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
-
|
|
249
|
+
- `refRegion` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
250
|
+
|
|
251
|
+
- `refRegion.start` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
252
|
+
- `refRegion.end` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
253
|
+
- `refRegion.seq` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
254
|
+
|
|
255
|
+
- `compressionScheme` **CramContainerCompressionScheme**
|
|
207
256
|
|
|
208
257
|
Returns **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)** nothing
|
|
209
258
|
|
|
@@ -220,41 +269,44 @@ The feature objects appearing in the `readFeatures` member of CramRecord objects
|
|
|
220
269
|
|
|
221
270
|
### IndexedCramFile
|
|
222
271
|
|
|
223
|
-
The pairing of an index and a CramFile. Supports efficient fetching of records for sections of reference sequences.
|
|
224
|
-
|
|
225
272
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
226
273
|
|
|
227
274
|
##### Table of Contents
|
|
228
275
|
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
276
|
+
- [constructor](#constructor)
|
|
277
|
+
- [Parameters](#parameters)
|
|
278
|
+
- [getRecordsForRange](#getrecordsforrange)
|
|
279
|
+
- [Parameters](#parameters-1)
|
|
280
|
+
- [hasDataForReferenceSequence](#hasdataforreferencesequence)
|
|
281
|
+
- [Parameters](#parameters-2)
|
|
232
282
|
|
|
233
283
|
#### constructor
|
|
234
284
|
|
|
235
|
-
|
|
285
|
+
##### Parameters
|
|
236
286
|
|
|
237
|
-
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
287
|
+
- `args` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
288
|
+
|
|
289
|
+
- `args.cram` **CramFile**
|
|
290
|
+
- `args.index` **Index-like** object that supports getEntriesForRange(seqId,start,end) -> Promise\[Array\[index entries]]
|
|
291
|
+
- `args.cacheSize` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** optional maximum number of CRAM records to cache. default 20,000
|
|
292
|
+
- `args.fetchSizeLimit` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** optional maximum number of bytes to fetch in a single getRecordsForRange call. Default 3 MiB.
|
|
293
|
+
- `args.checkSequenceMD5` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** default true. if false, disables verifying the MD5
|
|
294
|
+
checksum of the reference sequence underlying a slice. In some applications, this check can cause an inconvenient amount (many megabases) of sequences to be fetched.
|
|
244
295
|
|
|
245
296
|
#### getRecordsForRange
|
|
246
297
|
|
|
247
|
-
|
|
298
|
+
##### Parameters
|
|
248
299
|
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
-
|
|
300
|
+
- `seq` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** numeric ID of the reference sequence
|
|
301
|
+
- `start` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** start of the range of interest. 1-based closed coordinates.
|
|
302
|
+
- `end` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** end of the range of interest. 1-based closed coordinates.
|
|
303
|
+
- `opts` (optional, default `{}`)
|
|
252
304
|
|
|
253
305
|
#### hasDataForReferenceSequence
|
|
254
306
|
|
|
255
|
-
|
|
307
|
+
##### Parameters
|
|
256
308
|
|
|
257
|
-
-
|
|
309
|
+
- `seqId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
258
310
|
|
|
259
311
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** true if the CRAM file contains data for the given
|
|
260
312
|
reference sequence numerical ID
|
|
@@ -265,54 +317,56 @@ reference sequence numerical ID
|
|
|
265
317
|
|
|
266
318
|
##### Table of Contents
|
|
267
319
|
|
|
268
|
-
-
|
|
269
|
-
-
|
|
320
|
+
- [constructor](#constructor)
|
|
321
|
+
- [Parameters](#parameters)
|
|
322
|
+
- [containerCount](#containercount)
|
|
270
323
|
|
|
271
324
|
#### constructor
|
|
272
325
|
|
|
273
|
-
|
|
326
|
+
##### Parameters
|
|
274
327
|
|
|
275
|
-
-
|
|
276
|
-
- `args.filehandle` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** a filehandle that implements the stat() and
|
|
277
|
-
read() methods of the Node filehandle API <https://nodejs.org/api/fs.html#fs_class_filehandle>
|
|
278
|
-
- `args.path` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** path to the cram file
|
|
279
|
-
- `args.url` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** url for the cram file. also supports file:// urls for local files
|
|
280
|
-
- `args.seqFetch` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** a function with signature
|
|
281
|
-
`(seqId, startCoordinate, endCoordinate)` that returns a promise for a string of sequence bases
|
|
282
|
-
- `args.cacheSize` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** optional maximum number of CRAM records to cache. default 20,000
|
|
283
|
-
- `args.checkSequenceMD5` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** default true. if false, disables verifying the MD5
|
|
284
|
-
checksum of the reference sequence underlying a slice. In some applications, this check can cause an inconvenient amount (many megabases) of sequences to be fetched.
|
|
328
|
+
- `args` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
285
329
|
|
|
286
|
-
|
|
330
|
+
- `args.filehandle` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** a filehandle that implements the stat() and
|
|
331
|
+
read() methods of the Node filehandle API <https://nodejs.org/api/fs.html#fs_class_filehandle>
|
|
332
|
+
- `args.path` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** path to the cram file
|
|
333
|
+
- `args.url` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** url for the cram file. also supports file:// urls for local files
|
|
334
|
+
- `args.seqFetch` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** a function with signature
|
|
335
|
+
`(seqId, startCoordinate, endCoordinate)` that returns a promise for a string of sequence bases
|
|
336
|
+
- `args.cacheSize` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** optional maximum number of CRAM records to cache. default 20,000
|
|
337
|
+
- `args.checkSequenceMD5` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** default true. if false, disables verifying the MD5
|
|
338
|
+
checksum of the reference sequence underlying a slice. In some applications, this check can cause an inconvenient amount (many megabases) of sequences to be fetched.
|
|
287
339
|
|
|
288
|
-
|
|
340
|
+
#### containerCount
|
|
289
341
|
|
|
290
342
|
### CraiIndex
|
|
291
343
|
|
|
292
|
-
Represents a .crai index.
|
|
293
|
-
|
|
294
344
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
295
345
|
|
|
296
346
|
##### Table of Contents
|
|
297
347
|
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
348
|
+
- [constructor](#constructor)
|
|
349
|
+
- [Parameters](#parameters)
|
|
350
|
+
- [hasDataForReferenceSequence](#hasdataforreferencesequence)
|
|
351
|
+
- [Parameters](#parameters-1)
|
|
352
|
+
- [getEntriesForRange](#getentriesforrange)
|
|
353
|
+
- [Parameters](#parameters-2)
|
|
301
354
|
|
|
302
355
|
#### constructor
|
|
303
356
|
|
|
304
|
-
|
|
357
|
+
##### Parameters
|
|
305
358
|
|
|
306
|
-
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
359
|
+
- `args` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
360
|
+
|
|
361
|
+
- `args.path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
362
|
+
- `args.url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
363
|
+
- `args.filehandle` **FileHandle?**
|
|
310
364
|
|
|
311
365
|
#### hasDataForReferenceSequence
|
|
312
366
|
|
|
313
|
-
|
|
367
|
+
##### Parameters
|
|
314
368
|
|
|
315
|
-
-
|
|
369
|
+
- `seqId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
316
370
|
|
|
317
371
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** true if the index contains entries for
|
|
318
372
|
the given reference sequence ID, false otherwise
|
|
@@ -321,60 +375,16 @@ the given reference sequence ID, false otherwise
|
|
|
321
375
|
|
|
322
376
|
fetch index entries for the given range
|
|
323
377
|
|
|
324
|
-
|
|
378
|
+
##### Parameters
|
|
325
379
|
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
380
|
+
- `seqId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
381
|
+
- `queryStart` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
382
|
+
- `queryEnd` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
329
383
|
|
|
330
384
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** promise for
|
|
331
385
|
an array of objects of the form
|
|
332
386
|
`{start, span, containerStart, sliceStart, sliceBytes }`
|
|
333
387
|
|
|
334
|
-
#### Error Classes
|
|
335
|
-
|
|
336
|
-
`@gmod/cram/errors` contains some special error classes thrown by cram-js. A list of the error classes is below.
|
|
337
|
-
|
|
338
|
-
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
339
|
-
|
|
340
|
-
##### Table of Contents
|
|
341
|
-
|
|
342
|
-
- [CramUnimplementedError](#cramunimplementederror)
|
|
343
|
-
- [CramMalformedError](#crammalformederror)
|
|
344
|
-
- [CramBufferOverrunError](#crambufferoverrunerror)
|
|
345
|
-
- [CramSizeLimitError](#cramsizelimiterror)
|
|
346
|
-
- [CramArgumentError](#cramargumenterror)
|
|
347
|
-
|
|
348
|
-
#### CramUnimplementedError
|
|
349
|
-
|
|
350
|
-
**Extends Error**
|
|
351
|
-
|
|
352
|
-
Error caused by encountering a part of the CRAM spec that has not yet been implemented
|
|
353
|
-
|
|
354
|
-
#### CramMalformedError
|
|
355
|
-
|
|
356
|
-
**Extends CramError**
|
|
357
|
-
|
|
358
|
-
An error caused by malformed data.
|
|
359
|
-
|
|
360
|
-
#### CramBufferOverrunError
|
|
361
|
-
|
|
362
|
-
**Extends CramMalformedError**
|
|
363
|
-
|
|
364
|
-
An error caused by attempting to read beyond the end of the defined data.
|
|
365
|
-
|
|
366
|
-
#### CramSizeLimitError
|
|
367
|
-
|
|
368
|
-
**Extends CramError**
|
|
369
|
-
|
|
370
|
-
An error caused by data being too big, exceeding a size limit.
|
|
371
|
-
|
|
372
|
-
#### CramArgumentError
|
|
373
|
-
|
|
374
|
-
**Extends CramError**
|
|
375
|
-
|
|
376
|
-
An invalid argument was supplied to a cram-js method or object.
|
|
377
|
-
|
|
378
388
|
### CramUnimplementedError
|
|
379
389
|
|
|
380
390
|
**Extends Error**
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default class CraiIndex {
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param {object} args
|
|
5
|
+
* @param {string} [args.path]
|
|
6
|
+
* @param {string} [args.url]
|
|
7
|
+
* @param {FileHandle} [args.filehandle]
|
|
8
|
+
*/
|
|
9
|
+
constructor(args: {
|
|
10
|
+
path?: string | undefined;
|
|
11
|
+
url?: string | undefined;
|
|
12
|
+
filehandle?: any;
|
|
13
|
+
});
|
|
14
|
+
_parseCache: AbortablePromiseCache<any, any>;
|
|
15
|
+
readFile: any;
|
|
16
|
+
parseIndex(): any;
|
|
17
|
+
getIndex(opts?: {}): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* @param {number} seqId
|
|
20
|
+
* @returns {Promise} true if the index contains entries for
|
|
21
|
+
* the given reference sequence ID, false otherwise
|
|
22
|
+
*/
|
|
23
|
+
hasDataForReferenceSequence(seqId: number): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* fetch index entries for the given range
|
|
26
|
+
*
|
|
27
|
+
* @param {number} seqId
|
|
28
|
+
* @param {number} queryStart
|
|
29
|
+
* @param {number} queryEnd
|
|
30
|
+
*
|
|
31
|
+
* @returns {Promise} promise for
|
|
32
|
+
* an array of objects of the form
|
|
33
|
+
* `{start, span, containerStart, sliceStart, sliceBytes }`
|
|
34
|
+
*/
|
|
35
|
+
getEntriesForRange(seqId: number, queryStart: number, queryEnd: number): Promise<any>;
|
|
36
|
+
}
|
|
37
|
+
import AbortablePromiseCache from "abortable-promise-cache";
|