@gmod/cram 1.7.4 → 2.0.1
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 +9 -2
- package/README.md +343 -24
- package/dist/craiIndex.js.map +1 -1
- package/dist/cram-bundle.js +1 -1
- package/dist/cram-bundle.js.LICENSE.txt +6 -0
- package/dist/cramFile/codecs/beta.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/dist/cramFile/codecs/external.js.map +1 -1
- package/dist/cramFile/codecs/gamma.js.map +1 -1
- package/dist/cramFile/codecs/getBits.js.map +1 -1
- package/dist/cramFile/codecs/huffman.js.map +1 -1
- package/dist/cramFile/codecs/index.js.map +1 -1
- package/dist/cramFile/codecs/subexp.js.map +1 -1
- package/dist/cramFile/container/compressionScheme.js.map +1 -1
- package/dist/cramFile/container/index.js.map +1 -1
- package/dist/cramFile/file.d.ts +10 -3
- package/dist/cramFile/file.js +56 -50
- package/dist/cramFile/file.js.map +1 -1
- package/dist/cramFile/record.js.map +1 -1
- package/dist/cramFile/sectionParsers.d.ts +1 -0
- package/dist/cramFile/sectionParsers.js +7 -7
- package/dist/cramFile/sectionParsers.js.map +1 -1
- package/dist/cramFile/slice/decodeRecord.js +1 -1
- package/dist/cramFile/slice/decodeRecord.js.map +1 -1
- package/dist/cramFile/slice/index.js.map +1 -1
- package/dist/cramFile/util.d.ts +1 -0
- package/dist/cramFile/util.js.map +1 -1
- package/dist/indexedCramFile.js.map +1 -1
- package/dist/io/index.js.map +1 -1
- package/dist/rans/constants.d.ts +4 -3
- package/dist/rans/constants.js.map +1 -1
- package/dist/rans/d04.js +1 -0
- package/dist/rans/d04.js.map +1 -1
- package/dist/rans/d14.js +1 -0
- package/dist/rans/d14.js.map +1 -1
- package/dist/rans/decoding.d.ts +16 -19
- package/dist/rans/decoding.js +1 -0
- package/dist/rans/decoding.js.map +1 -1
- package/dist/rans/frequencies.d.ts +2 -2
- package/dist/rans/frequencies.js +1 -0
- package/dist/rans/frequencies.js.map +1 -1
- package/dist/rans/index.js +1 -0
- package/dist/rans/index.js.map +1 -1
- package/dist/sam.d.ts +5 -6
- package/dist/sam.js +23 -7
- package/dist/sam.js.map +1 -1
- package/dist/typescript.js.map +1 -1
- package/dist/unzip.d.ts +1 -0
- package/esm/craiIndex.js.map +1 -1
- package/esm/cramFile/codecs/beta.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/esm/cramFile/codecs/external.js.map +1 -1
- package/esm/cramFile/codecs/gamma.js.map +1 -1
- package/esm/cramFile/codecs/getBits.js.map +1 -1
- package/esm/cramFile/codecs/huffman.js.map +1 -1
- package/esm/cramFile/codecs/index.js.map +1 -1
- package/esm/cramFile/codecs/subexp.js.map +1 -1
- package/esm/cramFile/container/compressionScheme.js.map +1 -1
- package/esm/cramFile/container/index.js.map +1 -1
- package/esm/cramFile/file.d.ts +10 -3
- package/esm/cramFile/file.js +17 -13
- package/esm/cramFile/file.js.map +1 -1
- package/esm/cramFile/record.js.map +1 -1
- package/esm/cramFile/sectionParsers.d.ts +1 -0
- package/esm/cramFile/sectionParsers.js +7 -7
- package/esm/cramFile/sectionParsers.js.map +1 -1
- package/esm/cramFile/slice/decodeRecord.js +1 -1
- package/esm/cramFile/slice/decodeRecord.js.map +1 -1
- package/esm/cramFile/slice/index.js.map +1 -1
- package/esm/cramFile/util.d.ts +1 -0
- package/esm/cramFile/util.js.map +1 -1
- package/esm/indexedCramFile.js.map +1 -1
- package/esm/io/index.js.map +1 -1
- package/esm/rans/constants.d.ts +4 -3
- package/esm/rans/constants.js.map +1 -1
- package/esm/rans/d04.js +1 -0
- package/esm/rans/d04.js.map +1 -1
- package/esm/rans/d14.js +1 -0
- package/esm/rans/d14.js.map +1 -1
- package/esm/rans/decoding.d.ts +16 -19
- package/esm/rans/decoding.js +1 -0
- package/esm/rans/decoding.js.map +1 -1
- package/esm/rans/frequencies.d.ts +2 -2
- package/esm/rans/frequencies.js +1 -0
- package/esm/rans/frequencies.js.map +1 -1
- package/esm/rans/index.js +1 -0
- package/esm/rans/index.js.map +1 -1
- package/esm/sam.d.ts +5 -6
- package/esm/sam.js +23 -7
- package/esm/sam.js.map +1 -1
- package/esm/typescript.js.map +1 -1
- package/esm/unzip.d.ts +1 -0
- package/package.json +11 -10
- package/src/cramFile/container/index.ts +4 -1
- package/src/cramFile/file.ts +23 -19
- package/src/rans/{d04.js → d04.ts} +1 -0
- package/src/rans/{d14.js → d14.ts} +1 -0
- package/src/rans/{decoding.js → decoding.ts} +1 -0
- package/src/rans/{frequencies.js → frequencies.ts} +1 -0
- package/src/rans/{index.js → index.ts} +1 -0
- package/src/sam.ts +30 -14
- /package/src/rans/{constants.js → constants.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# v2.0.0
|
|
2
|
+
|
|
3
|
+
- Add lzma support via xz-decompress. This uses webassembly, so it is a major
|
|
4
|
+
version bump
|
|
5
|
+
|
|
1
6
|
# v1.7.4
|
|
2
7
|
|
|
3
8
|
- Fix import of bzip2 module
|
|
@@ -26,7 +31,8 @@
|
|
|
26
31
|
|
|
27
32
|
# v1.6.3
|
|
28
33
|
|
|
29
|
-
- Optimize CRAM parsing slightly (15% improvement on many short reads). This
|
|
34
|
+
- Optimize CRAM parsing slightly (15% improvement on many short reads). This
|
|
35
|
+
removes support for big endian machines
|
|
30
36
|
- Publish src directory for sourceMap
|
|
31
37
|
|
|
32
38
|
# v1.6.2
|
|
@@ -93,7 +99,8 @@
|
|
|
93
99
|
|
|
94
100
|
# v1.4.3
|
|
95
101
|
|
|
96
|
-
- Make sure mate exists for unmated pair, can exist when coordinate slices of
|
|
102
|
+
- Make sure mate exists for unmated pair, can exist when coordinate slices of
|
|
103
|
+
cram file are made via samtools view
|
|
97
104
|
|
|
98
105
|
# v1.4.2
|
|
99
106
|
|
package/README.md
CHANGED
|
@@ -4,12 +4,17 @@
|
|
|
4
4
|
[](https://codecov.io/gh/GMOD/cram-js/branch/master)
|
|
5
5
|
[](https://github.com/GMOD/cram-js/actions?query=branch%3Amaster+workflow%3APush+)
|
|
6
6
|
|
|
7
|
-
Read CRAM files (indexed or unindexed) with pure JS, works in node or in the
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
Read CRAM files (indexed or unindexed) with pure JS, works in node or in the
|
|
8
|
+
browser.
|
|
9
|
+
|
|
10
|
+
- Reads CRAM 3.x and 2.x (3.1 added in v1.6.0)
|
|
11
|
+
- Does not read CRAM 1.x
|
|
12
|
+
- Can use .crai indexes out of the box, for efficient sequence fetching, but
|
|
13
|
+
also has an [index API](#craiindex) that would allow use with other index
|
|
14
|
+
types
|
|
15
|
+
- Has preliminary support for bzip2 and lzma codecs. lzma requires the latest
|
|
16
|
+
@gmod/cram version, and uses webassembly. If you find you are unable to
|
|
17
|
+
compile it, you can try downgrading
|
|
13
18
|
|
|
14
19
|
## Install
|
|
15
20
|
|
|
@@ -118,57 +123,368 @@ run()
|
|
|
118
123
|
// alternatively `cramFilehandle` (for the IndexedCramFile class) and `filehandle` (for the CraiIndex) can be used, see for examples https://github.com/gmod/generic-filehandle
|
|
119
124
|
```
|
|
120
125
|
|
|
121
|
-
You can use cram-js without NPM also with the cram-bundle.js. See the example
|
|
126
|
+
You can use cram-js without NPM also with the cram-bundle.js. See the example
|
|
127
|
+
directory for usage with script tag
|
|
122
128
|
|
|
123
129
|
## API (auto-generated)
|
|
124
130
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
- [CramRecord](#cramrecord) - format of CRAM records returned by this API
|
|
132
|
+
- [ReadFeatures](#readfeatures) - format of read features on records
|
|
133
|
+
- [IndexedCramFile](#indexedcramfile) - indexed access into a CRAM file
|
|
134
|
+
- [CramFile](#cramfile) - .cram API
|
|
135
|
+
- [CraiIndex](#craiindex) - .crai index API
|
|
136
|
+
- [Error Classes](#error-classes) - special error classes thrown by this API
|
|
131
137
|
|
|
132
138
|
### CramRecord
|
|
133
139
|
|
|
134
140
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
135
141
|
|
|
136
|
-
|
|
142
|
+
##### Table of Contents
|
|
143
|
+
|
|
144
|
+
- [CramRecord](#cramrecord)
|
|
145
|
+
- [isPaired](#ispaired)
|
|
146
|
+
- [isProperlyPaired](#isproperlypaired)
|
|
147
|
+
- [isSegmentUnmapped](#issegmentunmapped)
|
|
148
|
+
- [isMateUnmapped](#ismateunmapped)
|
|
149
|
+
- [isReverseComplemented](#isreversecomplemented)
|
|
150
|
+
- [isMateReverseComplemented](#ismatereversecomplemented)
|
|
151
|
+
- [isRead1](#isread1)
|
|
152
|
+
- [isRead2](#isread2)
|
|
153
|
+
- [isSecondary](#issecondary)
|
|
154
|
+
- [isFailedQc](#isfailedqc)
|
|
155
|
+
- [isDuplicate](#isduplicate)
|
|
156
|
+
- [isSupplementary](#issupplementary)
|
|
157
|
+
- [isDetached](#isdetached)
|
|
158
|
+
- [hasMateDownStream](#hasmatedownstream)
|
|
159
|
+
- [isPreservingQualityScores](#ispreservingqualityscores)
|
|
160
|
+
- [isUnknownBases](#isunknownbases)
|
|
161
|
+
- [getReadBases](#getreadbases)
|
|
162
|
+
- [getPairOrientation](#getpairorientation)
|
|
163
|
+
- [addReferenceSequence](#addreferencesequence)
|
|
164
|
+
- [Parameters](#parameters)
|
|
165
|
+
|
|
166
|
+
#### CramRecord
|
|
167
|
+
|
|
168
|
+
Class of each CRAM record returned by this API.
|
|
169
|
+
|
|
170
|
+
##### isPaired
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
174
|
+
true if the read is paired, regardless of whether both segments are mapped
|
|
175
|
+
|
|
176
|
+
##### isProperlyPaired
|
|
177
|
+
|
|
178
|
+
Returns
|
|
179
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
180
|
+
true if the read is paired, and both segments are mapped
|
|
181
|
+
|
|
182
|
+
##### isSegmentUnmapped
|
|
183
|
+
|
|
184
|
+
Returns
|
|
185
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
186
|
+
true if the read itself is unmapped; conflictive with isProperlyPaired
|
|
187
|
+
|
|
188
|
+
##### isMateUnmapped
|
|
189
|
+
|
|
190
|
+
Returns
|
|
191
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
192
|
+
true if the read itself is unmapped; conflictive with isProperlyPaired
|
|
193
|
+
|
|
194
|
+
##### isReverseComplemented
|
|
195
|
+
|
|
196
|
+
Returns
|
|
197
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
198
|
+
true if the read is mapped to the reverse strand
|
|
199
|
+
|
|
200
|
+
##### isMateReverseComplemented
|
|
201
|
+
|
|
202
|
+
Returns
|
|
203
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
204
|
+
true if the mate is mapped to the reverse strand
|
|
205
|
+
|
|
206
|
+
##### isRead1
|
|
207
|
+
|
|
208
|
+
Returns
|
|
209
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
210
|
+
true if this is read number 1 in a pair
|
|
211
|
+
|
|
212
|
+
##### isRead2
|
|
213
|
+
|
|
214
|
+
Returns
|
|
215
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
216
|
+
true if this is read number 2 in a pair
|
|
217
|
+
|
|
218
|
+
##### isSecondary
|
|
219
|
+
|
|
220
|
+
Returns
|
|
221
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
222
|
+
true if this is a secondary alignment
|
|
223
|
+
|
|
224
|
+
##### isFailedQc
|
|
225
|
+
|
|
226
|
+
Returns
|
|
227
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
228
|
+
true if this read has failed QC checks
|
|
229
|
+
|
|
230
|
+
##### isDuplicate
|
|
231
|
+
|
|
232
|
+
Returns
|
|
233
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
234
|
+
true if the read is an optical or PCR duplicate
|
|
235
|
+
|
|
236
|
+
##### isSupplementary
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
240
|
+
true if this is a supplementary alignment
|
|
241
|
+
|
|
242
|
+
##### isDetached
|
|
243
|
+
|
|
244
|
+
Returns
|
|
245
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
246
|
+
true if the read is detached
|
|
247
|
+
|
|
248
|
+
##### hasMateDownStream
|
|
249
|
+
|
|
250
|
+
Returns
|
|
251
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
252
|
+
true if the read has a mate in this same CRAM segment
|
|
253
|
+
|
|
254
|
+
##### isPreservingQualityScores
|
|
255
|
+
|
|
256
|
+
Returns
|
|
257
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
258
|
+
true if the read contains qual scores
|
|
259
|
+
|
|
260
|
+
##### isUnknownBases
|
|
261
|
+
|
|
262
|
+
Returns
|
|
263
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
|
|
264
|
+
true if the read has no sequence bases
|
|
265
|
+
|
|
266
|
+
##### getReadBases
|
|
267
|
+
|
|
268
|
+
Get the original sequence of this read.
|
|
269
|
+
|
|
270
|
+
Returns
|
|
271
|
+
**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
272
|
+
sequence basepairs
|
|
273
|
+
|
|
274
|
+
##### getPairOrientation
|
|
275
|
+
|
|
276
|
+
Get the pair orientation of a paired read. Adapted from igv.js
|
|
277
|
+
|
|
278
|
+
Returns
|
|
279
|
+
**[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
280
|
+
of paired orientatin
|
|
281
|
+
|
|
282
|
+
##### addReferenceSequence
|
|
283
|
+
|
|
284
|
+
Annotates this feature with the given reference sequence basepair information.
|
|
285
|
+
This will add a `sub` and a `ref` item to base subsitution read features given
|
|
286
|
+
the actual substituted and reference base pairs, and will make the
|
|
287
|
+
`getReadSequence()` method work.
|
|
288
|
+
|
|
289
|
+
###### Parameters
|
|
290
|
+
|
|
291
|
+
- `refRegion`
|
|
292
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
293
|
+
|
|
294
|
+
- `refRegion.start`
|
|
295
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
296
|
+
- `refRegion.end`
|
|
297
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
298
|
+
- `refRegion.seq`
|
|
299
|
+
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
300
|
+
|
|
301
|
+
- `compressionScheme` **CramContainerCompressionScheme**
|
|
302
|
+
|
|
303
|
+
Returns
|
|
304
|
+
**[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined)**
|
|
305
|
+
nothing
|
|
137
306
|
|
|
138
307
|
### ReadFeatures
|
|
139
308
|
|
|
140
|
-
The feature objects appearing in the `readFeatures` member of CramRecord objects
|
|
309
|
+
The feature objects appearing in the `readFeatures` member of CramRecord objects
|
|
310
|
+
that show insertions, deletions, substitutions, etc.
|
|
141
311
|
|
|
142
312
|
#### Static fields
|
|
143
313
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
314
|
+
- **code** (`character`): One of "bqBXIDiQNSPH". See page 15 of the CRAM v3 spec
|
|
315
|
+
for their meanings.
|
|
316
|
+
- **data** (`any`): the data associated with the feature. The format of this
|
|
317
|
+
varies depending on the feature code.
|
|
318
|
+
- **pos** (`number`): location relative to the read (1-based)
|
|
319
|
+
- **refPos** (`number`): location relative to the reference (1-based)
|
|
148
320
|
|
|
149
321
|
### IndexedCramFile
|
|
150
322
|
|
|
151
323
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
152
324
|
|
|
153
|
-
|
|
325
|
+
##### Table of Contents
|
|
326
|
+
|
|
327
|
+
- [constructor](#constructor)
|
|
328
|
+
- [Parameters](#parameters)
|
|
329
|
+
- [getRecordsForRange](#getrecordsforrange)
|
|
330
|
+
- [Parameters](#parameters-1)
|
|
331
|
+
- [hasDataForReferenceSequence](#hasdataforreferencesequence)
|
|
332
|
+
- [Parameters](#parameters-2)
|
|
333
|
+
|
|
334
|
+
#### constructor
|
|
335
|
+
|
|
336
|
+
##### Parameters
|
|
337
|
+
|
|
338
|
+
- `args`
|
|
339
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
340
|
+
|
|
341
|
+
- `args.cram` **CramFile**
|
|
342
|
+
- `args.index` **Index-like** object that supports
|
|
343
|
+
getEntriesForRange(seqId,start,end) -> Promise\[Array\[index entries]]
|
|
344
|
+
- `args.cacheSize`
|
|
345
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
|
|
346
|
+
optional maximum number of CRAM records to cache. default 20,000
|
|
347
|
+
- `args.fetchSizeLimit`
|
|
348
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
|
|
349
|
+
optional maximum number of bytes to fetch in a single getRecordsForRange
|
|
350
|
+
call. Default 3 MiB.
|
|
351
|
+
- `args.checkSequenceMD5`
|
|
352
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**
|
|
353
|
+
default true. if false, disables verifying the MD5 checksum of the reference
|
|
354
|
+
sequence underlying a slice. In some applications, this check can cause an
|
|
355
|
+
inconvenient amount (many megabases) of sequences to be fetched.
|
|
356
|
+
|
|
357
|
+
#### getRecordsForRange
|
|
358
|
+
|
|
359
|
+
##### Parameters
|
|
360
|
+
|
|
361
|
+
- `seq`
|
|
362
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
363
|
+
numeric ID of the reference sequence
|
|
364
|
+
- `start`
|
|
365
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
366
|
+
start of the range of interest. 1-based closed coordinates.
|
|
367
|
+
- `end`
|
|
368
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
369
|
+
end of the range of interest. 1-based closed coordinates.
|
|
370
|
+
- `opts` (optional, default `{}`)
|
|
371
|
+
|
|
372
|
+
#### hasDataForReferenceSequence
|
|
373
|
+
|
|
374
|
+
##### Parameters
|
|
375
|
+
|
|
376
|
+
- `seqId`
|
|
377
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
378
|
+
|
|
379
|
+
Returns
|
|
380
|
+
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
|
|
381
|
+
true if the CRAM file contains data for the given reference sequence numerical
|
|
382
|
+
ID
|
|
154
383
|
|
|
155
384
|
### CramFile
|
|
156
385
|
|
|
157
386
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
158
387
|
|
|
159
|
-
|
|
388
|
+
##### Table of Contents
|
|
389
|
+
|
|
390
|
+
- [constructor](#constructor)
|
|
391
|
+
- [Parameters](#parameters)
|
|
392
|
+
- [containerCount](#containercount)
|
|
393
|
+
|
|
394
|
+
#### constructor
|
|
395
|
+
|
|
396
|
+
##### Parameters
|
|
397
|
+
|
|
398
|
+
- `args`
|
|
399
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
400
|
+
|
|
401
|
+
- `args.filehandle`
|
|
402
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
|
|
403
|
+
a filehandle that implements the stat() and read() methods of the Node
|
|
404
|
+
filehandle API <https://nodejs.org/api/fs.html#fs_class_filehandle>
|
|
405
|
+
- `args.path`
|
|
406
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
|
|
407
|
+
path to the cram file
|
|
408
|
+
- `args.url`
|
|
409
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?**
|
|
410
|
+
url for the cram file. also supports file:// urls for local files
|
|
411
|
+
- `args.seqFetch`
|
|
412
|
+
**[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?**
|
|
413
|
+
a function with signature `(seqId, startCoordinate, endCoordinate)` that
|
|
414
|
+
returns a promise for a string of sequence bases
|
|
415
|
+
- `args.cacheSize`
|
|
416
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
|
|
417
|
+
optional maximum number of CRAM records to cache. default 20,000
|
|
418
|
+
- `args.checkSequenceMD5`
|
|
419
|
+
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**
|
|
420
|
+
default true. if false, disables verifying the MD5 checksum of the reference
|
|
421
|
+
sequence underlying a slice. In some applications, this check can cause an
|
|
422
|
+
inconvenient amount (many megabases) of sequences to be fetched.
|
|
423
|
+
|
|
424
|
+
#### containerCount
|
|
160
425
|
|
|
161
426
|
### CraiIndex
|
|
162
427
|
|
|
163
428
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
164
429
|
|
|
165
|
-
|
|
430
|
+
##### Table of Contents
|
|
431
|
+
|
|
432
|
+
- [constructor](#constructor)
|
|
433
|
+
- [Parameters](#parameters)
|
|
434
|
+
- [hasDataForReferenceSequence](#hasdataforreferencesequence)
|
|
435
|
+
- [Parameters](#parameters-1)
|
|
436
|
+
- [getEntriesForRange](#getentriesforrange)
|
|
437
|
+
- [Parameters](#parameters-2)
|
|
438
|
+
|
|
439
|
+
#### constructor
|
|
440
|
+
|
|
441
|
+
##### Parameters
|
|
442
|
+
|
|
443
|
+
- `args`
|
|
444
|
+
**[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
445
|
+
|
|
446
|
+
- `args.path`
|
|
447
|
+
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
448
|
+
- `args.url`
|
|
449
|
+
**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
450
|
+
- `args.filehandle` **FileHandle?**
|
|
451
|
+
|
|
452
|
+
#### hasDataForReferenceSequence
|
|
453
|
+
|
|
454
|
+
##### Parameters
|
|
455
|
+
|
|
456
|
+
- `seqId`
|
|
457
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
458
|
+
|
|
459
|
+
Returns
|
|
460
|
+
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
|
|
461
|
+
true if the index contains entries for the given reference sequence ID, false
|
|
462
|
+
otherwise
|
|
463
|
+
|
|
464
|
+
#### getEntriesForRange
|
|
465
|
+
|
|
466
|
+
fetch index entries for the given range
|
|
467
|
+
|
|
468
|
+
##### Parameters
|
|
469
|
+
|
|
470
|
+
- `seqId`
|
|
471
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
472
|
+
- `queryStart`
|
|
473
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
474
|
+
- `queryEnd`
|
|
475
|
+
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
476
|
+
|
|
477
|
+
Returns
|
|
478
|
+
**[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
|
|
479
|
+
promise for an array of objects of the form
|
|
480
|
+
`{start, span, containerStart, sliceStart, sliceBytes }`
|
|
166
481
|
|
|
167
482
|
### CramUnimplementedError
|
|
168
483
|
|
|
169
484
|
**Extends Error**
|
|
170
485
|
|
|
171
|
-
Error caused by encountering a part of the CRAM spec that has not yet been
|
|
486
|
+
Error caused by encountering a part of the CRAM spec that has not yet been
|
|
487
|
+
implemented
|
|
172
488
|
|
|
173
489
|
### CramMalformedError
|
|
174
490
|
|
|
@@ -184,7 +500,10 @@ An error caused by attempting to read beyond the end of the defined data.
|
|
|
184
500
|
|
|
185
501
|
## Academic Use
|
|
186
502
|
|
|
187
|
-
This package was written with funding from the [NHGRI](http://genome.gov) as
|
|
503
|
+
This package was written with funding from the [NHGRI](http://genome.gov) as
|
|
504
|
+
part of the [JBrowse](http://jbrowse.org) project. If you use it in an academic
|
|
505
|
+
project that you publish, please cite the most recent JBrowse paper, which will
|
|
506
|
+
be linked from [jbrowse.org](http://jbrowse.org).
|
|
188
507
|
|
|
189
508
|
## License
|
|
190
509
|
|
package/dist/craiIndex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craiIndex.js","sourceRoot":"","sources":["../src/craiIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,sFAA2D;AAC3D,0DAAgC;AAChC,mCAA+B;AAC/B,6BAA2B;AAC3B,qCAA6C;AAI7C,MAAM,SAAS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