@gmod/cram 3.0.6 → 4.0.0
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/dist/craiIndex.js +70 -87
- package/dist/craiIndex.js.map +1 -1
- package/dist/cram-bundle.js +1 -1
- package/dist/cramFile/codecs/_base.d.ts +1 -1
- package/dist/cramFile/codecs/beta.d.ts +2 -2
- package/dist/cramFile/codecs/beta.js +1 -1
- package/dist/cramFile/codecs/beta.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayLength.d.ts +2 -2
- package/dist/cramFile/codecs/byteArrayStop.d.ts +4 -4
- package/dist/cramFile/codecs/byteArrayStop.js +1 -1
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/dist/cramFile/codecs/external.d.ts +1 -1
- package/dist/cramFile/codecs/external.js +1 -1
- package/dist/cramFile/codecs/external.js.map +1 -1
- package/dist/cramFile/codecs/gamma.d.ts +1 -1
- package/dist/cramFile/codecs/gamma.js +1 -1
- package/dist/cramFile/codecs/gamma.js.map +1 -1
- package/dist/cramFile/codecs/getBits.d.ts +1 -1
- package/dist/cramFile/codecs/getBits.js.map +1 -1
- package/dist/cramFile/codecs/huffman.d.ts +1 -1
- package/dist/cramFile/codecs/huffman.js +1 -1
- package/dist/cramFile/codecs/huffman.js.map +1 -1
- package/dist/cramFile/codecs/index.d.ts +1 -1
- package/dist/cramFile/codecs/index.js +5 -5
- package/dist/cramFile/codecs/index.js.map +1 -1
- package/dist/cramFile/codecs/subexp.d.ts +2 -2
- package/dist/cramFile/codecs/subexp.js +1 -1
- package/dist/cramFile/codecs/subexp.js.map +1 -1
- package/dist/cramFile/container/compressionScheme.d.ts +2 -2
- package/dist/cramFile/container/compressionScheme.js +1 -1
- package/dist/cramFile/container/compressionScheme.js.map +1 -1
- package/dist/cramFile/container/index.d.ts +1 -2
- package/dist/cramFile/container/index.js +62 -79
- package/dist/cramFile/container/index.js.map +1 -1
- package/dist/cramFile/file.d.ts +9 -13
- package/dist/cramFile/file.js +218 -249
- package/dist/cramFile/file.js.map +1 -1
- package/dist/cramFile/record.js +2 -2
- package/dist/cramFile/record.js.map +1 -1
- package/dist/cramFile/sectionParsers.d.ts +16 -16
- package/dist/cramFile/sectionParsers.js +12 -9
- package/dist/cramFile/sectionParsers.js.map +1 -1
- package/dist/cramFile/slice/decodeRecord.d.ts +3 -3
- package/dist/cramFile/slice/decodeRecord.js +11 -11
- package/dist/cramFile/slice/decodeRecord.js.map +1 -1
- package/dist/cramFile/slice/index.d.ts +2 -2
- package/dist/cramFile/slice/index.js +241 -262
- package/dist/cramFile/slice/index.js.map +1 -1
- package/dist/cramFile/util.d.ts +4 -2
- package/dist/cramFile/util.js +29 -6
- package/dist/cramFile/util.js.map +1 -1
- package/dist/htscodecs/arith_gen.d.ts +18 -0
- package/dist/htscodecs/arith_gen.js +318 -0
- package/dist/htscodecs/arith_gen.js.map +1 -0
- package/dist/htscodecs/arith_sh.d.ts +16 -0
- package/dist/htscodecs/arith_sh.js +128 -0
- package/dist/htscodecs/arith_sh.js.map +1 -0
- package/dist/htscodecs/byte_model.d.ts +11 -0
- package/dist/htscodecs/byte_model.js +113 -0
- package/dist/htscodecs/byte_model.js.map +1 -0
- package/dist/htscodecs/fqzcomp.d.ts +1 -0
- package/dist/htscodecs/fqzcomp.js +325 -0
- package/dist/htscodecs/fqzcomp.js.map +1 -0
- package/dist/htscodecs/index.d.ts +5 -0
- package/dist/htscodecs/index.js +70 -0
- package/dist/htscodecs/index.js.map +1 -0
- package/dist/htscodecs/iostream.d.ts +27 -0
- package/dist/htscodecs/iostream.js +243 -0
- package/dist/htscodecs/iostream.js.map +1 -0
- package/dist/htscodecs/rans.d.ts +1 -0
- package/dist/htscodecs/rans.js +213 -0
- package/dist/htscodecs/rans.js.map +1 -0
- package/dist/htscodecs/rans4x16.d.ts +1 -0
- package/dist/htscodecs/rans4x16.js +405 -0
- package/dist/htscodecs/rans4x16.js.map +1 -0
- package/dist/htscodecs/tok3.d.ts +2 -0
- package/dist/htscodecs/tok3.js +363 -0
- package/dist/htscodecs/tok3.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/indexedCramFile.d.ts +4 -4
- package/dist/indexedCramFile.js +97 -108
- package/dist/indexedCramFile.js.map +1 -1
- package/dist/io/index.d.ts +2 -2
- package/dist/io/index.js +6 -6
- package/dist/io/index.js.map +1 -1
- package/dist/rans/constants.d.ts +1 -1
- package/dist/rans/constants.js +1 -1
- package/dist/rans/constants.js.map +1 -1
- package/dist/rans/d04.js.map +1 -1
- package/dist/rans/decoding.js.map +1 -1
- package/dist/rans/frequencies.js.map +1 -1
- package/dist/rans/index.js +5 -5
- package/dist/rans/index.js.map +1 -1
- package/dist/unzip.d.ts +1 -1
- package/dist/unzip.js +5 -3
- package/dist/unzip.js.map +1 -1
- package/esm/craiIndex.js +10 -12
- package/esm/craiIndex.js.map +1 -1
- package/esm/cramFile/codecs/_base.d.ts +1 -1
- package/esm/cramFile/codecs/beta.d.ts +2 -2
- package/esm/cramFile/codecs/beta.js +1 -1
- package/esm/cramFile/codecs/beta.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayLength.d.ts +2 -2
- package/esm/cramFile/codecs/byteArrayStop.d.ts +4 -4
- package/esm/cramFile/codecs/byteArrayStop.js +1 -1
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/esm/cramFile/codecs/external.d.ts +1 -1
- package/esm/cramFile/codecs/external.js +1 -1
- package/esm/cramFile/codecs/external.js.map +1 -1
- package/esm/cramFile/codecs/gamma.d.ts +1 -1
- package/esm/cramFile/codecs/gamma.js +1 -1
- package/esm/cramFile/codecs/gamma.js.map +1 -1
- package/esm/cramFile/codecs/getBits.d.ts +1 -1
- package/esm/cramFile/codecs/getBits.js.map +1 -1
- package/esm/cramFile/codecs/huffman.d.ts +1 -1
- package/esm/cramFile/codecs/huffman.js +1 -1
- package/esm/cramFile/codecs/huffman.js.map +1 -1
- package/esm/cramFile/codecs/index.d.ts +1 -1
- package/esm/cramFile/codecs/index.js +5 -5
- package/esm/cramFile/codecs/index.js.map +1 -1
- package/esm/cramFile/codecs/subexp.d.ts +2 -2
- package/esm/cramFile/codecs/subexp.js +1 -1
- package/esm/cramFile/codecs/subexp.js.map +1 -1
- package/esm/cramFile/container/compressionScheme.d.ts +2 -2
- package/esm/cramFile/container/compressionScheme.js +1 -1
- package/esm/cramFile/container/compressionScheme.js.map +1 -1
- package/esm/cramFile/container/index.d.ts +1 -2
- package/esm/cramFile/container/index.js +4 -7
- package/esm/cramFile/container/index.js.map +1 -1
- package/esm/cramFile/file.d.ts +9 -13
- package/esm/cramFile/file.js +54 -61
- package/esm/cramFile/file.js.map +1 -1
- package/esm/cramFile/record.js +2 -2
- package/esm/cramFile/record.js.map +1 -1
- package/esm/cramFile/sectionParsers.d.ts +16 -16
- package/esm/cramFile/sectionParsers.js +7 -7
- package/esm/cramFile/sectionParsers.js.map +1 -1
- package/esm/cramFile/slice/decodeRecord.d.ts +3 -3
- package/esm/cramFile/slice/decodeRecord.js +11 -11
- package/esm/cramFile/slice/decodeRecord.js.map +1 -1
- package/esm/cramFile/slice/index.d.ts +2 -2
- package/esm/cramFile/slice/index.js +7 -6
- package/esm/cramFile/slice/index.js.map +1 -1
- package/esm/cramFile/util.d.ts +4 -2
- package/esm/cramFile/util.js +19 -2
- package/esm/cramFile/util.js.map +1 -1
- package/esm/htscodecs/arith_gen.d.ts +18 -0
- package/esm/htscodecs/arith_gen.js +318 -0
- package/esm/htscodecs/arith_gen.js.map +1 -0
- package/esm/htscodecs/arith_sh.d.ts +16 -0
- package/esm/htscodecs/arith_sh.js +128 -0
- package/esm/htscodecs/arith_sh.js.map +1 -0
- package/esm/htscodecs/byte_model.d.ts +11 -0
- package/esm/htscodecs/byte_model.js +113 -0
- package/esm/htscodecs/byte_model.js.map +1 -0
- package/esm/htscodecs/fqzcomp.d.ts +1 -0
- package/esm/htscodecs/fqzcomp.js +325 -0
- package/esm/htscodecs/fqzcomp.js.map +1 -0
- package/esm/htscodecs/index.d.ts +5 -0
- package/esm/htscodecs/index.js +70 -0
- package/esm/htscodecs/index.js.map +1 -0
- package/esm/htscodecs/iostream.d.ts +27 -0
- package/esm/htscodecs/iostream.js +243 -0
- package/esm/htscodecs/iostream.js.map +1 -0
- package/esm/htscodecs/rans.d.ts +1 -0
- package/esm/htscodecs/rans.js +213 -0
- package/esm/htscodecs/rans.js.map +1 -0
- package/esm/htscodecs/rans4x16.d.ts +1 -0
- package/esm/htscodecs/rans4x16.js +405 -0
- package/esm/htscodecs/rans4x16.js.map +1 -0
- package/esm/htscodecs/tok3.d.ts +2 -0
- package/esm/htscodecs/tok3.js +363 -0
- package/esm/htscodecs/tok3.js.map +1 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/indexedCramFile.d.ts +4 -4
- package/esm/indexedCramFile.js +10 -10
- package/esm/indexedCramFile.js.map +1 -1
- package/esm/io/index.d.ts +2 -2
- package/esm/io/index.js +1 -1
- package/esm/io/index.js.map +1 -1
- package/esm/rans/constants.d.ts +1 -1
- package/esm/rans/constants.js +1 -1
- package/esm/rans/constants.js.map +1 -1
- package/esm/rans/d04.js.map +1 -1
- package/esm/rans/decoding.js.map +1 -1
- package/esm/rans/frequencies.js.map +1 -1
- package/esm/rans/index.js +5 -5
- package/esm/rans/index.js.map +1 -1
- package/esm/unzip.d.ts +1 -1
- package/esm/unzip.js +4 -1
- package/esm/unzip.js.map +1 -1
- package/package.json +7 -10
- package/src/craiIndex.ts +17 -16
- package/src/cramFile/codecs/_base.ts +1 -1
- package/src/cramFile/codecs/beta.ts +3 -3
- package/src/cramFile/codecs/byteArrayLength.ts +1 -1
- package/src/cramFile/codecs/byteArrayStop.ts +3 -4
- package/src/cramFile/codecs/external.ts +3 -3
- package/src/cramFile/codecs/gamma.ts +2 -2
- package/src/cramFile/codecs/getBits.ts +1 -1
- package/src/cramFile/codecs/huffman.ts +2 -3
- package/src/cramFile/codecs/index.ts +7 -8
- package/src/cramFile/codecs/subexp.ts +3 -3
- package/src/cramFile/container/compressionScheme.ts +3 -3
- package/src/cramFile/container/index.ts +7 -10
- package/src/cramFile/file.ts +78 -86
- package/src/cramFile/record.ts +3 -3
- package/src/cramFile/sectionParsers.ts +27 -22
- package/src/cramFile/slice/decodeRecord.ts +17 -17
- package/src/cramFile/slice/index.ts +8 -9
- package/src/cramFile/util.ts +24 -6
- package/src/htscodecs/arith_gen.js +344 -0
- package/src/htscodecs/arith_sh.js +138 -0
- package/src/htscodecs/byte_model.js +126 -0
- package/src/htscodecs/fqzcomp.js +360 -0
- package/src/htscodecs/index.js +77 -0
- package/src/htscodecs/iostream.js +257 -0
- package/src/htscodecs/rans.js +233 -0
- package/src/htscodecs/rans4x16.js +452 -0
- package/src/htscodecs/tok3.js +413 -0
- package/src/index.ts +1 -1
- package/src/indexedCramFile.ts +6 -5
- package/src/io/index.ts +5 -4
- package/src/rans/constants.ts +1 -1
- package/src/rans/d04.ts +0 -1
- package/src/rans/decoding.ts +0 -1
- package/src/rans/frequencies.ts +0 -1
- package/src/rans/index.ts +5 -7
- package/src/unzip.ts +5 -1
- package/dist/cramFile/filehandle.d.ts +0 -1
- package/dist/cramFile/filehandle.js +0 -3
- package/dist/cramFile/filehandle.js.map +0 -1
- package/dist/unzip-pako.d.ts +0 -2
- package/dist/unzip-pako.js +0 -9
- package/dist/unzip-pako.js.map +0 -1
- package/esm/cramFile/filehandle.d.ts +0 -1
- package/esm/cramFile/filehandle.js +0 -2
- package/esm/cramFile/filehandle.js.map +0 -1
- package/esm/unzip-pako.d.ts +0 -2
- package/esm/unzip-pako.js +0 -6
- package/esm/unzip-pako.js.map +0 -1
- package/src/cramFile/filehandle.ts +0 -1
- package/src/typings/htscodecs.d.ts +0 -6
- package/src/unzip-pako.ts +0 -6
package/esm/rans/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rans/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rans/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAExD,wCAAwC;AACxC,6CAA6C;AAC7C,MAAM,SAAS,CAAC,eAAe,GAAG,CAAC,CAAA;AACnC,uCAAuC;AACvC,iEAAiE;AAEjE,eAAe;AACf,iBAAiB;AAEjB,oDAAoD;AACpD,gBAAgB;AAChB,4CAA4C;AAC5C,6DAA6D;AAC7D,0EAA0E;AAC1E,YAAY;AACZ,QAAQ;AACR,IAAI;AAEJ,gGAAgG;AAChG,kCAAkC;AAClC,+BAA+B;AAE/B,iCAAiC;AACjC,iDAAiD;AAEjD,uBAAuB;AACvB,qBAAqB;AACrB,qDAAqD;AACrD,oBAAoB;AACpB,qDAAqD;AAErD,mBAAmB;AACnB,0EAA0E;AAC1E,QAAQ;AACR,IAAI;AAEJ,oEAAoE;AACpE,+EAA+E;AAC/E,yFAAyF;AACzF,2BAA2B;AAC3B,sDAAsD;AACtD,gDAAgD;AAChD,mEAAmE;AACnE,8CAA8C;AAC9C,sBAAsB;AACtB,IAAI;AAEJ,+DAA+D;AAC/D,qEAAqE;AACrE,mDAAmD;AACnD,oDAAoD;AACpD,2DAA2D;AAC3D,wCAAwC;AAExC,gEAAgE;AAChE,gEAAgE;AAEhE,6CAA6C;AAC7C,oFAAoF;AAEpF,sBAAsB;AACtB,2EAA2E;AAE3E,mEAAmE;AACnE,oCAAoC;AACpC,sBAAsB;AACtB,IAAI;AAEJ,+DAA+D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AwC;IAExC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;IACzB,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,kBAAkB,CAAC,sBAAsB,KAAK,EAAE,CAAC,CAAA;IAC7D,CAAC;IAED,MAAM,SAAS,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;IAC1C,IAAI,SAAS,KAAK,KAAK,CAAC,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;QACtD,MAAM,IAAI,kBAAkB,CAAC,yBAAyB,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,SAAS,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE,CAAA;IAC3C,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,YAAY,IAAI,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;IACzE,gCAAgC;IAEhC,IAAI,MAAM,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;QAC/B,MAAM,IAAI,kBAAkB,CAC1B,kCAAkC,UAAU,SAAS,CACtD,CAAA;IACH,CAAC;IAED,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,CAAC;YACJ,OAAO,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAE5C,KAAK,CAAC;YACJ,OAAO,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAE5C;YACE,MAAM,IAAI,kBAAkB,CAAC,uBAAuB,KAAK,EAAE,CAAC,CAAA;IAChE,CAAC;AACH,CAAC"}
|
package/esm/unzip.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function unzip(input: Uint8Array): Uint8Array<ArrayBufferLike>;
|
package/esm/unzip.js
CHANGED
package/esm/unzip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unzip.js","sourceRoot":"","sources":["../src/unzip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"unzip.js","sourceRoot":"","sources":["../src/unzip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,OAAO,OAAO,CAAC,KAAK,CAAC,CAAA;AACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmod/cram",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "read CRAM files with pure Javascript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "GMOD/cram-js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"docs": "documentation readme --shallow src/indexedCramFile.ts --section=IndexedCramFile; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/craiIndex.ts --section=CraiIndex; documentation readme --shallow errors.ts '--section=Exception Classes'; documentation readme --shallow src/cramFile/file.ts --section=CramFile; documentation readme --shallow src/cramFile/record.ts --section=CramRecord",
|
|
28
28
|
"prebuild": "npm run clean",
|
|
29
29
|
"clean": "rimraf dist esm",
|
|
30
|
-
"build:esm": "tsc --
|
|
31
|
-
"build:es5": "tsc --
|
|
30
|
+
"build:esm": "tsc --outDir esm",
|
|
31
|
+
"build:es5": "tsc --module commonjs --outDir dist",
|
|
32
32
|
"build": "npm run build:esm && npm run build:es5",
|
|
33
33
|
"postbuild": "webpack",
|
|
34
34
|
"prepack": "npm test run && npm run build && cp dist/errors.js errors.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"biojs"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jkbonfield/htscodecs": "^0.5.1",
|
|
46
45
|
"bzip2": "^0.1.1",
|
|
47
46
|
"crc": "^4.3.2",
|
|
47
|
+
"generic-filehandle2": "^0.0.2",
|
|
48
48
|
"long": "^4.0.0",
|
|
49
49
|
"md5": "^2.2.1",
|
|
50
50
|
"pako": "^1.0.4",
|
|
@@ -62,13 +62,12 @@
|
|
|
62
62
|
"buffer": "^6.0.3",
|
|
63
63
|
"documentation": "^14.0.3",
|
|
64
64
|
"eslint": "^9.9.0",
|
|
65
|
-
"eslint-
|
|
66
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
65
|
+
"eslint-plugin-import": "^2.31.0",
|
|
67
66
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
68
67
|
"mock-fs": "^5.2.0",
|
|
69
68
|
"prettier": "^3.2.5",
|
|
70
69
|
"rimraf": "^6.0.1",
|
|
71
|
-
"typescript": "^5.0
|
|
70
|
+
"typescript": "^5.7.0",
|
|
72
71
|
"typescript-eslint": "^8.0.1",
|
|
73
72
|
"vitest": "^2.0.5",
|
|
74
73
|
"webpack": "^5.90.3",
|
|
@@ -79,8 +78,6 @@
|
|
|
79
78
|
},
|
|
80
79
|
"browser": {
|
|
81
80
|
"./dist/io/localFile.js": false,
|
|
82
|
-
"./esm/io/localFile.js": false
|
|
83
|
-
"./esm/unzip.js": "./esm/unzip-pako.js",
|
|
84
|
-
"./dist/unzip.js": "./dist/unzip-pako.js"
|
|
81
|
+
"./esm/io/localFile.js": false
|
|
85
82
|
}
|
|
86
83
|
}
|
package/src/craiIndex.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { unzip } from './unzip'
|
|
2
|
-
import { open } from './io'
|
|
3
|
-
import { CramMalformedError } from './errors'
|
|
4
1
|
import { CramFileSource } from './cramFile/file'
|
|
5
|
-
import {
|
|
2
|
+
import { CramMalformedError } from './errors'
|
|
3
|
+
import { open } from './io'
|
|
4
|
+
import { unzip } from './unzip'
|
|
5
|
+
|
|
6
|
+
import type { GenericFilehandle } from 'generic-filehandle2'
|
|
6
7
|
|
|
7
8
|
const BAI_MAGIC = 21_578_050 // BAI\1
|
|
8
9
|
|
|
@@ -33,11 +34,8 @@ function addRecordToIndex(index: ParsedIndex, record: number[]) {
|
|
|
33
34
|
})
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
function maybeUnzip(data:
|
|
37
|
-
|
|
38
|
-
return unzip(data)
|
|
39
|
-
}
|
|
40
|
-
return data
|
|
37
|
+
function maybeUnzip(data: Uint8Array) {
|
|
38
|
+
return data[0] === 31 && data[1] === 139 ? unzip(data) : data
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
export default class CraiIndex {
|
|
@@ -50,10 +48,12 @@ export default class CraiIndex {
|
|
|
50
48
|
// 4. Container start byte position in the file
|
|
51
49
|
// 5. Slice start byte position in the container data (‘blocks’)
|
|
52
50
|
// 6. Slice size in bytes
|
|
53
|
-
//
|
|
51
|
+
//
|
|
52
|
+
// Each line represents a slice in the CRAM file. Please note that all slices
|
|
53
|
+
// must be listed in index file.
|
|
54
54
|
private parseIndexP?: Promise<ParsedIndex>
|
|
55
55
|
|
|
56
|
-
private filehandle:
|
|
56
|
+
private filehandle: GenericFilehandle
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
*
|
|
@@ -69,18 +69,19 @@ export default class CraiIndex {
|
|
|
69
69
|
async parseIndex() {
|
|
70
70
|
const index: ParsedIndex = {}
|
|
71
71
|
const uncompressedBuffer = maybeUnzip(await this.filehandle.readFile())
|
|
72
|
+
const dataView = new DataView(uncompressedBuffer.buffer)
|
|
72
73
|
if (
|
|
73
74
|
uncompressedBuffer.length > 4 &&
|
|
74
|
-
|
|
75
|
+
dataView.getUint32(0, true) === BAI_MAGIC
|
|
75
76
|
) {
|
|
76
77
|
throw new CramMalformedError(
|
|
77
78
|
'invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support',
|
|
78
79
|
)
|
|
79
80
|
}
|
|
80
|
-
// interpret the text as regular ascii, since it is
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
81
|
+
// interpret the text as regular ascii, since it is supposed to be only
|
|
82
|
+
// digits and whitespace characters this is written in a deliberately
|
|
83
|
+
// low-level fashion for performance, because some .crai files can be
|
|
84
|
+
// pretty large.
|
|
84
85
|
let currentRecord: number[] = []
|
|
85
86
|
let currentString = ''
|
|
86
87
|
for (const charCode of uncompressedBuffer) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CramUnimplementedError } from '../../errors'
|
|
2
1
|
import CramCodec, { Cursors } from './_base'
|
|
3
2
|
import { getBits } from './getBits'
|
|
4
|
-
import
|
|
5
|
-
import { CramFileBlock } from '../file'
|
|
3
|
+
import { CramUnimplementedError } from '../../errors'
|
|
6
4
|
import { BetaEncoding } from '../encoding'
|
|
5
|
+
import { CramFileBlock } from '../file'
|
|
6
|
+
import CramSlice from '../slice'
|
|
7
7
|
|
|
8
8
|
export default class BetaCodec extends CramCodec<
|
|
9
9
|
'int',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import CramCodec, { Cursors } from './_base'
|
|
2
2
|
import { ByteArrayLengthEncoding, CramEncoding } from '../encoding'
|
|
3
|
-
import CramSlice from '../slice'
|
|
4
3
|
import { CramFileBlock } from '../file'
|
|
4
|
+
import CramSlice from '../slice'
|
|
5
5
|
import { DataType } from './dataSeriesTypes'
|
|
6
6
|
import { tinyMemoize } from '../util'
|
|
7
7
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { CramMalformedError } from '../../errors'
|
|
2
|
-
|
|
3
1
|
import CramCodec, { Cursor, Cursors } from './_base'
|
|
4
|
-
import
|
|
5
|
-
import { CramFileBlock } from '../file'
|
|
2
|
+
import { CramMalformedError } from '../../errors'
|
|
6
3
|
import { ByteArrayStopCramEncoding } from '../encoding'
|
|
4
|
+
import { CramFileBlock } from '../file'
|
|
5
|
+
import CramSlice from '../slice'
|
|
7
6
|
import { CramBufferOverrunError } from './getBits'
|
|
8
7
|
|
|
9
8
|
export default class ByteArrayStopCodec extends CramCodec<
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CramMalformedError, CramUnimplementedError } from '../../errors'
|
|
2
1
|
import CramCodec, { Cursor, Cursors } from './_base'
|
|
3
|
-
import {
|
|
4
|
-
import CramSlice from '../slice'
|
|
2
|
+
import { CramMalformedError, CramUnimplementedError } from '../../errors'
|
|
5
3
|
import { CramFileBlock } from '../file'
|
|
4
|
+
import CramSlice from '../slice'
|
|
5
|
+
import { parseItf8 } from '../util'
|
|
6
6
|
import { CramBufferOverrunError } from './getBits'
|
|
7
7
|
import { ExternalCramEncoding } from '../encoding'
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CramUnimplementedError } from '../../errors'
|
|
2
1
|
import CramCodec, { Cursors } from './_base'
|
|
3
2
|
import { getBits } from './getBits'
|
|
3
|
+
import { CramUnimplementedError } from '../../errors'
|
|
4
4
|
import { GammaEncoding } from '../encoding'
|
|
5
|
-
import CramSlice from '../slice'
|
|
6
5
|
import { CramFileBlock } from '../file'
|
|
6
|
+
import CramSlice from '../slice'
|
|
7
7
|
|
|
8
8
|
export default class GammaCodec extends CramCodec<
|
|
9
9
|
'int',
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CramMalformedError } from '../../errors'
|
|
2
1
|
import CramCodec, { Cursor, Cursors } from './_base'
|
|
3
2
|
import { getBits } from './getBits'
|
|
3
|
+
import { CramMalformedError } from '../../errors'
|
|
4
4
|
import { HuffmanEncoding } from '../encoding'
|
|
5
|
-
|
|
6
|
-
import CramSlice from '../slice'
|
|
7
5
|
import { CramFileBlock } from '../file'
|
|
6
|
+
import CramSlice from '../slice'
|
|
8
7
|
|
|
9
8
|
function numberOfSetBits(ii: number) {
|
|
10
9
|
let i = (ii - (ii >> 1)) & 0x55555555
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import HuffmanIntCodec from './huffman'
|
|
4
|
-
import ExternalCodec from './external'
|
|
5
|
-
import ByteArrayStopCodec from './byteArrayStop'
|
|
6
|
-
import ByteArrayLengthCodec from './byteArrayLength'
|
|
1
|
+
import CramCodec from './_base'
|
|
7
2
|
import BetaCodec from './beta'
|
|
3
|
+
import ByteArrayLengthCodec from './byteArrayLength'
|
|
4
|
+
import ByteArrayStopCodec from './byteArrayStop'
|
|
5
|
+
import { DataType } from './dataSeriesTypes'
|
|
6
|
+
import ExternalCodec from './external'
|
|
8
7
|
import GammaCodec from './gamma'
|
|
8
|
+
import HuffmanIntCodec from './huffman'
|
|
9
9
|
import SubexpCodec from './subexp'
|
|
10
|
-
import
|
|
10
|
+
import { CramUnimplementedError } from '../../errors'
|
|
11
11
|
import { CramEncoding } from '../encoding'
|
|
12
|
-
import { DataType } from './dataSeriesTypes'
|
|
13
12
|
|
|
14
13
|
const codecClasses = {
|
|
15
14
|
1: ExternalCodec,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CramUnimplementedError } from '../../errors'
|
|
2
1
|
import CramCodec, { Cursors } from './_base'
|
|
3
2
|
import { getBits } from './getBits'
|
|
4
|
-
import
|
|
5
|
-
import { CramFileBlock } from '../file'
|
|
3
|
+
import { CramUnimplementedError } from '../../errors'
|
|
6
4
|
import { SubexpEncoding } from '../encoding'
|
|
5
|
+
import { CramFileBlock } from '../file'
|
|
6
|
+
import CramSlice from '../slice'
|
|
7
7
|
|
|
8
8
|
export default class SubexpCodec extends CramCodec<
|
|
9
9
|
'int',
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { CramMalformedError } from '../../errors'
|
|
1
2
|
import { instantiateCodec } from '../codecs'
|
|
2
3
|
import CramCodec from '../codecs/_base'
|
|
3
|
-
import { CramCompressionHeader } from '../sectionParsers'
|
|
4
|
-
import { CramEncoding } from '../encoding'
|
|
5
|
-
import { CramMalformedError } from '../../errors'
|
|
6
4
|
import {
|
|
7
5
|
DataSeriesEncodingKey,
|
|
8
6
|
DataSeriesEncodingMap,
|
|
9
7
|
} from '../codecs/dataSeriesTypes'
|
|
8
|
+
import { CramEncoding } from '../encoding'
|
|
9
|
+
import { CramCompressionHeader } from '../sectionParsers'
|
|
10
10
|
|
|
11
11
|
// the hardcoded data type to be decoded for each core
|
|
12
12
|
// data field
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Buffer } from 'buffer'
|
|
2
1
|
import { CramMalformedError } from '../../errors'
|
|
3
2
|
// locals
|
|
4
|
-
import { itf8Size, parseItem, tinyMemoize } from '../util'
|
|
5
3
|
import CramSlice from '../slice'
|
|
4
|
+
import { itf8Size, parseItem, tinyMemoize } from '../util'
|
|
6
5
|
import CramContainerCompressionScheme from './compressionScheme'
|
|
7
6
|
import CramFile from '../file'
|
|
8
7
|
import { getSectionParsers } from '../sectionParsers'
|
|
@@ -88,8 +87,10 @@ export default class CramContainer {
|
|
|
88
87
|
|
|
89
88
|
// parse the container header. do it in 2 pieces because you cannot tell
|
|
90
89
|
// how much to buffer until you read numLandmarks
|
|
91
|
-
const bytes1 =
|
|
92
|
-
|
|
90
|
+
const bytes1 = await this.file.read(
|
|
91
|
+
cramContainerHeader1.maxLength,
|
|
92
|
+
position,
|
|
93
|
+
)
|
|
93
94
|
const header1 = parseItem(bytes1, cramContainerHeader1.parser)
|
|
94
95
|
const numLandmarksSize = itf8Size(header1.numLandmarks)
|
|
95
96
|
if (position + header1.length >= fileSize) {
|
|
@@ -99,12 +100,8 @@ export default class CramContainer {
|
|
|
99
100
|
)
|
|
100
101
|
return undefined
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
)
|
|
105
|
-
await this.file.read(
|
|
106
|
-
bytes2,
|
|
107
|
-
0,
|
|
103
|
+
|
|
104
|
+
const bytes2 = await this.file.read(
|
|
108
105
|
cramContainerHeader2.maxLength(header1.numLandmarks),
|
|
109
106
|
position + header1._size - numLandmarksSize,
|
|
110
107
|
)
|