@gmod/cram 4.0.10 → 5.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/README.md +6 -6
- package/dist/craiIndex.d.ts +1 -1
- package/dist/craiIndex.js +7 -7
- package/dist/craiIndex.js.map +1 -1
- package/dist/cram-bundle.js +1 -2
- package/dist/cramFile/codecs/_base.d.ts +3 -3
- package/dist/cramFile/codecs/beta.d.ts +5 -5
- package/dist/cramFile/codecs/beta.js +7 -7
- package/dist/cramFile/codecs/beta.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayLength.d.ts +5 -5
- package/dist/cramFile/codecs/byteArrayLength.js +4 -4
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/dist/cramFile/codecs/byteArrayStop.d.ts +5 -5
- package/dist/cramFile/codecs/byteArrayStop.js +7 -7
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/dist/cramFile/codecs/dataSeriesTypes.d.ts +1 -1
- package/dist/cramFile/codecs/external.d.ts +5 -5
- package/dist/cramFile/codecs/external.js +12 -11
- package/dist/cramFile/codecs/external.js.map +1 -1
- package/dist/cramFile/codecs/gamma.d.ts +5 -5
- package/dist/cramFile/codecs/gamma.js +8 -8
- package/dist/cramFile/codecs/gamma.js.map +1 -1
- package/dist/cramFile/codecs/huffman.d.ts +6 -6
- package/dist/cramFile/codecs/huffman.js +9 -9
- package/dist/cramFile/codecs/huffman.js.map +1 -1
- package/dist/cramFile/codecs/index.d.ts +3 -3
- package/dist/cramFile/codecs/index.js +16 -16
- package/dist/cramFile/codecs/index.js.map +1 -1
- package/dist/cramFile/codecs/subexp.d.ts +5 -5
- package/dist/cramFile/codecs/subexp.js +9 -9
- package/dist/cramFile/codecs/subexp.js.map +1 -1
- package/dist/cramFile/container/compressionScheme.d.ts +4 -4
- package/dist/cramFile/container/compressionScheme.js +5 -5
- package/dist/cramFile/container/compressionScheme.js.map +1 -1
- package/dist/cramFile/container/index.d.ts +8 -8
- package/dist/cramFile/container/index.js +15 -16
- package/dist/cramFile/container/index.js.map +1 -1
- package/dist/cramFile/file.d.ts +3 -3
- package/dist/cramFile/file.js +29 -35
- package/dist/cramFile/file.js.map +1 -1
- package/dist/cramFile/index.d.ts +2 -2
- package/dist/cramFile/index.js +4 -4
- package/dist/cramFile/index.js.map +1 -1
- package/dist/cramFile/record.d.ts +2 -2
- package/dist/cramFile/record.js +17 -17
- package/dist/cramFile/record.js.map +1 -1
- package/dist/cramFile/sectionParsers.d.ts +3 -3
- package/dist/cramFile/sectionParsers.js +56 -56
- package/dist/cramFile/sectionParsers.js.map +1 -1
- package/dist/cramFile/slice/decodeRecord.d.ts +6 -6
- package/dist/cramFile/slice/decodeRecord.js +17 -17
- package/dist/cramFile/slice/decodeRecord.js.map +1 -1
- package/dist/cramFile/slice/index.d.ts +5 -5
- package/dist/cramFile/slice/index.js +46 -52
- package/dist/cramFile/slice/index.js.map +1 -1
- package/dist/htscodecs/arith_gen.d.ts +1 -1
- package/dist/htscodecs/arith_gen.js +17 -17
- package/dist/htscodecs/arith_gen.js.map +1 -1
- package/dist/htscodecs/fqzcomp.js +10 -10
- package/dist/htscodecs/fqzcomp.js.map +1 -1
- package/dist/htscodecs/index.js +6 -6
- package/dist/htscodecs/index.js.map +1 -1
- package/dist/htscodecs/rans.js +2 -2
- package/dist/htscodecs/rans.js.map +1 -1
- package/dist/htscodecs/rans4x16.js +7 -7
- package/dist/htscodecs/rans4x16.js.map +1 -1
- package/dist/htscodecs/tok3.js +9 -9
- package/dist/htscodecs/tok3.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/indexedCramFile.d.ts +4 -4
- package/dist/indexedCramFile.js +5 -5
- package/dist/indexedCramFile.js.map +1 -1
- package/dist/{io/index.js → io.js} +1 -1
- package/dist/io.js.map +1 -0
- package/dist/rans/d04.js +28 -28
- package/dist/rans/d04.js.map +1 -1
- package/dist/rans/d14.js +16 -16
- package/dist/rans/d14.js.map +1 -1
- package/dist/rans/decoding.js +8 -8
- package/dist/rans/decoding.js.map +1 -1
- package/dist/rans/frequencies.js +15 -15
- package/dist/rans/frequencies.js.map +1 -1
- package/dist/rans/index.js +17 -17
- package/dist/rans/index.js.map +1 -1
- package/esm/craiIndex.d.ts +1 -1
- package/esm/craiIndex.js +3 -3
- package/esm/craiIndex.js.map +1 -1
- package/esm/cramFile/codecs/_base.d.ts +3 -3
- package/esm/cramFile/codecs/beta.d.ts +5 -5
- package/esm/cramFile/codecs/beta.js +4 -4
- package/esm/cramFile/codecs/beta.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayLength.d.ts +5 -5
- package/esm/cramFile/codecs/byteArrayLength.js +2 -2
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -1
- package/esm/cramFile/codecs/byteArrayStop.d.ts +5 -5
- package/esm/cramFile/codecs/byteArrayStop.js +4 -4
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -1
- package/esm/cramFile/codecs/dataSeriesTypes.d.ts +1 -1
- package/esm/cramFile/codecs/external.d.ts +5 -5
- package/esm/cramFile/codecs/external.js +8 -7
- package/esm/cramFile/codecs/external.js.map +1 -1
- package/esm/cramFile/codecs/gamma.d.ts +5 -5
- package/esm/cramFile/codecs/gamma.js +4 -4
- package/esm/cramFile/codecs/gamma.js.map +1 -1
- package/esm/cramFile/codecs/huffman.d.ts +6 -6
- package/esm/cramFile/codecs/huffman.js +5 -5
- package/esm/cramFile/codecs/huffman.js.map +1 -1
- package/esm/cramFile/codecs/index.d.ts +3 -3
- package/esm/cramFile/codecs/index.js +8 -8
- package/esm/cramFile/codecs/index.js.map +1 -1
- package/esm/cramFile/codecs/subexp.d.ts +5 -5
- package/esm/cramFile/codecs/subexp.js +4 -4
- package/esm/cramFile/codecs/subexp.js.map +1 -1
- package/esm/cramFile/container/compressionScheme.d.ts +4 -4
- package/esm/cramFile/container/compressionScheme.js +2 -2
- package/esm/cramFile/container/compressionScheme.js.map +1 -1
- package/esm/cramFile/container/index.d.ts +8 -8
- package/esm/cramFile/container/index.js +5 -6
- package/esm/cramFile/container/index.js.map +1 -1
- package/esm/cramFile/file.d.ts +3 -3
- package/esm/cramFile/file.js +11 -17
- package/esm/cramFile/file.js.map +1 -1
- package/esm/cramFile/index.d.ts +2 -2
- package/esm/cramFile/index.js +2 -2
- package/esm/cramFile/index.js.map +1 -1
- package/esm/cramFile/record.d.ts +2 -2
- package/esm/cramFile/record.js +1 -1
- package/esm/cramFile/record.js.map +1 -1
- package/esm/cramFile/sectionParsers.d.ts +3 -3
- package/esm/cramFile/sectionParsers.js +1 -1
- package/esm/cramFile/sectionParsers.js.map +1 -1
- package/esm/cramFile/slice/decodeRecord.d.ts +6 -6
- package/esm/cramFile/slice/decodeRecord.js +3 -3
- package/esm/cramFile/slice/decodeRecord.js.map +1 -1
- package/esm/cramFile/slice/index.d.ts +5 -5
- package/esm/cramFile/slice/index.js +18 -24
- package/esm/cramFile/slice/index.js.map +1 -1
- package/esm/htscodecs/arith_gen.d.ts +1 -1
- package/esm/htscodecs/arith_gen.js +4 -4
- package/esm/htscodecs/arith_gen.js.map +1 -1
- package/esm/htscodecs/fqzcomp.js +3 -3
- package/esm/htscodecs/fqzcomp.js.map +1 -1
- package/esm/htscodecs/index.js +5 -5
- package/esm/htscodecs/index.js.map +1 -1
- package/esm/htscodecs/rans.js +1 -1
- package/esm/htscodecs/rans.js.map +1 -1
- package/esm/htscodecs/rans4x16.js +1 -1
- package/esm/htscodecs/rans4x16.js.map +1 -1
- package/esm/htscodecs/tok3.js +4 -4
- package/esm/htscodecs/tok3.js.map +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -3
- package/esm/index.js.map +1 -1
- package/esm/indexedCramFile.d.ts +4 -4
- package/esm/indexedCramFile.js +2 -2
- package/esm/indexedCramFile.js.map +1 -1
- package/esm/{io/index.js → io.js} +1 -1
- package/esm/io.js.map +1 -0
- package/esm/rans/d04.js +3 -3
- package/esm/rans/d04.js.map +1 -1
- package/esm/rans/d14.js +2 -2
- package/esm/rans/d14.js.map +1 -1
- package/esm/rans/decoding.js +2 -2
- package/esm/rans/decoding.js.map +1 -1
- package/esm/rans/frequencies.js +3 -3
- package/esm/rans/frequencies.js.map +1 -1
- package/esm/rans/index.js +5 -5
- package/esm/rans/index.js.map +1 -1
- package/package.json +15 -9
- package/src/craiIndex.ts +4 -4
- package/src/cramFile/codecs/_base.ts +3 -3
- package/src/cramFile/codecs/beta.ts +8 -8
- package/src/cramFile/codecs/byteArrayLength.ts +6 -6
- package/src/cramFile/codecs/byteArrayStop.ts +8 -8
- package/src/cramFile/codecs/dataSeriesTypes.ts +1 -1
- package/src/cramFile/codecs/external.ts +15 -12
- package/src/cramFile/codecs/gamma.ts +8 -8
- package/src/cramFile/codecs/huffman.ts +8 -8
- package/src/cramFile/codecs/index.ts +11 -11
- package/src/cramFile/codecs/subexp.ts +8 -8
- package/src/cramFile/container/compressionScheme.ts +6 -6
- package/src/cramFile/container/index.ts +6 -7
- package/src/cramFile/file.ts +12 -18
- package/src/cramFile/index.ts +2 -2
- package/src/cramFile/record.ts +3 -3
- package/src/cramFile/sectionParsers.ts +4 -4
- package/src/cramFile/slice/decodeRecord.ts +8 -8
- package/src/cramFile/slice/index.ts +23 -29
- package/src/htscodecs/arith_gen.ts +5 -5
- package/src/htscodecs/fqzcomp.ts +3 -3
- package/src/htscodecs/index.ts +5 -5
- package/src/htscodecs/rans.ts +1 -1
- package/src/htscodecs/rans4x16.ts +1 -1
- package/src/htscodecs/tok3.ts +4 -4
- package/src/index.ts +3 -3
- package/src/indexedCramFile.ts +5 -5
- package/src/rans/d04.ts +3 -3
- package/src/rans/d14.ts +2 -2
- package/src/rans/decoding.ts +2 -2
- package/src/rans/frequencies.ts +3 -3
- package/src/rans/index.ts +5 -5
- package/dist/cram-bundle.js.LICENSE.txt +0 -12
- package/dist/io/index.js.map +0 -1
- package/esm/io/index.js.map +0 -1
- package/src/cramFile/declare.d.ts +0 -1
- /package/dist/{io/index.d.ts → io.d.ts} +0 -0
- /package/esm/{io/index.d.ts → io.d.ts} +0 -0
- /package/src/{io/index.ts → io.ts} +0 -0
package/src/cramFile/file.ts
CHANGED
|
@@ -2,22 +2,22 @@ import crc32 from 'crc/calculators/crc32'
|
|
|
2
2
|
import QuickLRU from 'quick-lru'
|
|
3
3
|
import { XzReadableStream } from 'xz-decompress'
|
|
4
4
|
|
|
5
|
-
import { CramMalformedError, CramUnimplementedError } from '../errors'
|
|
6
|
-
import * as htscodecs from '../htscodecs'
|
|
7
|
-
import { open } from '../io'
|
|
8
|
-
import ransuncompress from '../rans'
|
|
9
|
-
import { parseHeaderText } from '../sam'
|
|
10
|
-
import { decode } from '../seek-bzip'
|
|
11
|
-
import { unzip } from '../unzip'
|
|
12
|
-
import CramContainer from './container'
|
|
13
|
-
import CramRecord from './record'
|
|
5
|
+
import { CramMalformedError, CramUnimplementedError } from '../errors.ts'
|
|
6
|
+
import * as htscodecs from '../htscodecs/index.ts'
|
|
7
|
+
import { open } from '../io.ts'
|
|
8
|
+
import ransuncompress from '../rans/index.ts'
|
|
9
|
+
import { parseHeaderText } from '../sam.ts'
|
|
10
|
+
import { decode } from '../seek-bzip/index.ts'
|
|
11
|
+
import { unzip } from '../unzip.ts'
|
|
12
|
+
import CramContainer from './container/index.ts'
|
|
13
|
+
import CramRecord from './record.ts'
|
|
14
14
|
import {
|
|
15
15
|
BlockHeader,
|
|
16
16
|
CompressionMethod,
|
|
17
17
|
cramFileDefinition,
|
|
18
18
|
getSectionParsers,
|
|
19
|
-
} from './sectionParsers'
|
|
20
|
-
import { parseItem, tinyMemoize } from './util'
|
|
19
|
+
} from './sectionParsers.ts'
|
|
20
|
+
import { parseItem, tinyMemoize } from './util.ts'
|
|
21
21
|
|
|
22
22
|
import type { GenericFilehandle } from 'generic-filehandle2'
|
|
23
23
|
|
|
@@ -282,11 +282,7 @@ export default class CramFile {
|
|
|
282
282
|
) {
|
|
283
283
|
// console.log({ compressionMethod })
|
|
284
284
|
if (compressionMethod === 'gzip') {
|
|
285
|
-
|
|
286
|
-
if (ret[0] === 24) {
|
|
287
|
-
// console.log(ret.slice(0, 500).join(','))
|
|
288
|
-
}
|
|
289
|
-
return ret
|
|
285
|
+
return unzip(inputBuffer)
|
|
290
286
|
} else if (compressionMethod === 'bzip2') {
|
|
291
287
|
return decode(inputBuffer)
|
|
292
288
|
} else if (compressionMethod === 'lzma') {
|
|
@@ -298,8 +294,6 @@ export default class CramFile {
|
|
|
298
294
|
const outputBuffer = new Uint8Array(uncompressedSize)
|
|
299
295
|
ransuncompress(inputBuffer, outputBuffer)
|
|
300
296
|
return outputBuffer
|
|
301
|
-
// htscodecs r4x8 is slower, but compatible.
|
|
302
|
-
// htscodecs.r4x8_uncompress(inputBuffer, outputBuffer);
|
|
303
297
|
} else if (compressionMethod === 'rans4x16') {
|
|
304
298
|
return htscodecs.r4x16_uncompress(inputBuffer)
|
|
305
299
|
} else if (compressionMethod === 'arith') {
|
package/src/cramFile/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as CramRecord } from './record'
|
|
1
|
+
export { default as CramRecord } from './record.ts'
|
|
2
2
|
|
|
3
|
-
export { default } from './file'
|
|
3
|
+
export { default } from './file.ts'
|
package/src/cramFile/record.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Constants from './constants'
|
|
2
|
-
import CramContainerCompressionScheme from './container/compressionScheme'
|
|
1
|
+
import Constants from './constants.ts'
|
|
2
|
+
import CramContainerCompressionScheme from './container/compressionScheme.ts'
|
|
3
3
|
|
|
4
|
-
import type decodeRecord from './slice/decodeRecord'
|
|
4
|
+
import type decodeRecord from './slice/decodeRecord.ts'
|
|
5
5
|
|
|
6
6
|
export interface RefRegion {
|
|
7
7
|
start: number
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TupleOf } from '../typescript'
|
|
2
|
-
import { DataSeriesEncodingMap } from './codecs/dataSeriesTypes'
|
|
3
|
-
import { CramEncoding } from './encoding'
|
|
4
|
-
import { parseItf8, parseLtf8 } from './util'
|
|
1
|
+
import { TupleOf } from '../typescript.ts'
|
|
2
|
+
import { DataSeriesEncodingMap } from './codecs/dataSeriesTypes.ts'
|
|
3
|
+
import { CramEncoding } from './encoding.ts'
|
|
4
|
+
import { parseItf8, parseLtf8 } from './util.ts'
|
|
5
5
|
|
|
6
6
|
export function cramFileDefinition() {
|
|
7
7
|
return {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CramMalformedError } from '../../errors'
|
|
2
|
-
import { Cursors, DataTypeMapping } from '../codecs/_base'
|
|
3
|
-
import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes'
|
|
1
|
+
import { CramMalformedError } from '../../errors.ts'
|
|
2
|
+
import { Cursors, DataTypeMapping } from '../codecs/_base.ts'
|
|
3
|
+
import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes.ts'
|
|
4
4
|
import CramContainerCompressionScheme, {
|
|
5
5
|
DataSeriesTypes,
|
|
6
|
-
} from '../container/compressionScheme'
|
|
6
|
+
} from '../container/compressionScheme.ts'
|
|
7
7
|
import {
|
|
8
8
|
BamFlagsDecoder,
|
|
9
9
|
CramFlagsDecoder,
|
|
10
10
|
MateFlagsDecoder,
|
|
11
11
|
ReadFeature,
|
|
12
|
-
} from '../record'
|
|
13
|
-
import CramSlice, { SliceHeader } from './index'
|
|
14
|
-
import { CramFileBlock } from '../file'
|
|
15
|
-
import { isMappedSliceHeader } from '../sectionParsers'
|
|
12
|
+
} from '../record.ts'
|
|
13
|
+
import CramSlice, { SliceHeader } from './index.ts'
|
|
14
|
+
import { CramFileBlock } from '../file.ts'
|
|
15
|
+
import { isMappedSliceHeader } from '../sectionParsers.ts'
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* given a Buffer, read a string up to the first null character
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { CramArgumentError, CramMalformedError } from '../../errors'
|
|
2
|
-
import { Cursors, DataTypeMapping } from '../codecs/_base'
|
|
3
|
-
import { CramBufferOverrunError } from '../codecs/getBits'
|
|
4
|
-
import Constants from '../constants'
|
|
5
|
-
import decodeRecord, { DataSeriesDecoder } from './decodeRecord'
|
|
6
|
-
import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes'
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import CramFile, { CramFileBlock } from '../file'
|
|
10
|
-
import CramRecord from '../record'
|
|
1
|
+
import { CramArgumentError, CramMalformedError } from '../../errors.ts'
|
|
2
|
+
import { Cursors, DataTypeMapping } from '../codecs/_base.ts'
|
|
3
|
+
import { CramBufferOverrunError } from '../codecs/getBits.ts'
|
|
4
|
+
import Constants from '../constants.ts'
|
|
5
|
+
import decodeRecord, { DataSeriesDecoder } from './decodeRecord.ts'
|
|
6
|
+
import { DataSeriesEncodingKey } from '../codecs/dataSeriesTypes.ts'
|
|
7
|
+
import { DataSeriesTypes } from '../container/compressionScheme.ts'
|
|
8
|
+
import CramContainer from '../container/index.ts'
|
|
9
|
+
import CramFile, { CramFileBlock } from '../file.ts'
|
|
10
|
+
import CramRecord from '../record.ts'
|
|
11
11
|
import {
|
|
12
12
|
MappedSliceHeader,
|
|
13
13
|
UnmappedSliceHeader,
|
|
14
14
|
getSectionParsers,
|
|
15
15
|
isMappedSliceHeader,
|
|
16
|
-
} from '../sectionParsers'
|
|
17
|
-
import { parseItem, sequenceMD5, tinyMemoize } from '../util'
|
|
16
|
+
} from '../sectionParsers.ts'
|
|
17
|
+
import { parseItem, sequenceMD5, tinyMemoize } from '../util.ts'
|
|
18
18
|
|
|
19
19
|
export type SliceHeader = CramFileBlock & {
|
|
20
20
|
parsedContent: MappedSliceHeader | UnmappedSliceHeader
|
|
@@ -28,15 +28,12 @@ interface RefRegion {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @param {Array[CramRecord]} allRecords
|
|
34
|
-
* @param {number} currentRecordNumber
|
|
35
|
-
* @param {CramRecord} thisRecord
|
|
31
|
+
* Try to estimate the template length from a bunch of interrelated
|
|
32
|
+
* multi-segment reads.
|
|
36
33
|
*/
|
|
37
34
|
function calculateMultiSegmentMatedTemplateLength(
|
|
38
35
|
allRecords: CramRecord[],
|
|
39
|
-
|
|
36
|
+
_currentRecordNumber: number,
|
|
40
37
|
thisRecord: CramRecord,
|
|
41
38
|
) {
|
|
42
39
|
function getAllMatedRecords(startRecord: CramRecord) {
|
|
@@ -73,18 +70,16 @@ function calculateMultiSegmentMatedTemplateLength(
|
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* Ported from htslib. Algorithm is imperfect.
|
|
79
|
-
* @param {CramRecord} thisRecord
|
|
80
|
-
* @param {CramRecord} mateRecord
|
|
73
|
+
* Attempt to calculate the `templateLength` for a pair of intra-slice paired
|
|
74
|
+
* reads. Ported from htslib. Algorithm is imperfect.
|
|
81
75
|
*/
|
|
82
76
|
function calculateIntraSliceMatePairTemplateLength(
|
|
83
77
|
thisRecord: CramRecord,
|
|
84
78
|
mateRecord: CramRecord,
|
|
85
79
|
) {
|
|
86
|
-
// this just estimates the template length by using the simple (non-gapped)
|
|
87
|
-
// read, because gapping in the alignment doesn't mean
|
|
80
|
+
// this just estimates the template length by using the simple (non-gapped)
|
|
81
|
+
// end coordinate of each read, because gapping in the alignment doesn't mean
|
|
82
|
+
// the template is longer or shorter
|
|
88
83
|
const start = Math.min(thisRecord.alignmentStart, mateRecord.alignmentStart)
|
|
89
84
|
const end = Math.max(
|
|
90
85
|
thisRecord.alignmentStart + thisRecord.readLength - 1,
|
|
@@ -96,10 +91,9 @@ function calculateIntraSliceMatePairTemplateLength(
|
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* mate
|
|
94
|
+
* establishes a mate-pair relationship between two records in the same slice.
|
|
95
|
+
* CRAM compresses mate-pair relationships between records in the same slice
|
|
96
|
+
* down into just one record having the index in the slice of its mate
|
|
103
97
|
*/
|
|
104
98
|
function associateIntraSliceMate(
|
|
105
99
|
allRecords: CramRecord[],
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import { decode } from '../seek-bzip'
|
|
37
|
+
import { decode } from '../seek-bzip/index.ts'
|
|
38
38
|
|
|
39
|
-
import RangeCoder from './arith_sh'
|
|
40
|
-
import ByteModel from './byte_model'
|
|
41
|
-
import IOStream from './iostream'
|
|
42
|
-
import { concatUint8Array } from '../util'
|
|
39
|
+
import RangeCoder from './arith_sh.ts'
|
|
40
|
+
import ByteModel from './byte_model.ts'
|
|
41
|
+
import IOStream from './iostream.ts'
|
|
42
|
+
import { concatUint8Array } from '../util.ts'
|
|
43
43
|
|
|
44
44
|
const ARITH_ORDER = 1
|
|
45
45
|
const ARITH_EXT = 4
|
package/src/htscodecs/fqzcomp.ts
CHANGED
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import RangeCoder from './arith_sh'
|
|
38
|
-
import ByteModel from './byte_model'
|
|
39
|
-
import IOStream from './iostream'
|
|
37
|
+
import RangeCoder from './arith_sh.ts'
|
|
38
|
+
import ByteModel from './byte_model.ts'
|
|
39
|
+
import IOStream from './iostream.ts'
|
|
40
40
|
|
|
41
41
|
// ----------------------------------------------------------------------
|
|
42
42
|
// Main arithmetic entry function: decodes a compressed src and
|
package/src/htscodecs/index.ts
CHANGED
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
// This JavaScript file is not part of the reference implementation
|
|
40
40
|
// and is simply and interface to get a consistent interface for cram-js.
|
|
41
41
|
|
|
42
|
-
import arith from './arith_gen'
|
|
43
|
-
import * as fqzcomp from './fqzcomp'
|
|
44
|
-
import * as r4x8 from './rans'
|
|
45
|
-
import * as r4x16 from './rans4x16'
|
|
46
|
-
import * as tok3 from './tok3'
|
|
42
|
+
import arith from './arith_gen.ts'
|
|
43
|
+
import * as fqzcomp from './fqzcomp.ts'
|
|
44
|
+
import * as r4x8 from './rans.ts'
|
|
45
|
+
import * as r4x16 from './rans4x16.ts'
|
|
46
|
+
import * as tok3 from './tok3.ts'
|
|
47
47
|
|
|
48
48
|
export function r4x8_uncompress(inputBuffer: Uint8Array) {
|
|
49
49
|
return r4x8.decode(inputBuffer)
|
package/src/htscodecs/rans.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import IOStream from './iostream'
|
|
37
|
+
import IOStream from './iostream.ts'
|
|
38
38
|
|
|
39
39
|
// ----------------------------------------------------------------------
|
|
40
40
|
// rANS primitives itself
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import IOStream from './iostream'
|
|
37
|
+
import IOStream from './iostream.ts'
|
|
38
38
|
|
|
39
39
|
// ----------------------------------------------------------------------
|
|
40
40
|
// rANS primitives itself
|
package/src/htscodecs/tok3.ts
CHANGED
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
// written specification as closely as possible. It is *NOT*
|
|
41
41
|
// an efficient implementation, but see comments below.
|
|
42
42
|
|
|
43
|
-
import { concatUint8Array } from '../util'
|
|
44
|
-
import arith_gen from './arith_gen'
|
|
45
|
-
import IOStream from './iostream'
|
|
46
|
-
import * as rans from './rans4x16'
|
|
43
|
+
import { concatUint8Array } from '../util.ts'
|
|
44
|
+
import arith_gen from './arith_gen.ts'
|
|
45
|
+
import IOStream from './iostream.ts'
|
|
46
|
+
import * as rans from './rans4x16.ts'
|
|
47
47
|
|
|
48
48
|
const arith = new arith_gen()
|
|
49
49
|
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { CramRecord, default as CramFile } from './cramFile'
|
|
2
|
-
export { default as CraiIndex } from './craiIndex'
|
|
3
|
-
export { default as IndexedCramFile } from './indexedCramFile'
|
|
1
|
+
export { CramRecord, default as CramFile } from './cramFile/index.ts'
|
|
2
|
+
export { default as CraiIndex } from './craiIndex.ts'
|
|
3
|
+
export { default as IndexedCramFile } from './indexedCramFile.ts'
|
package/src/indexedCramFile.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Slice } from './craiIndex'
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import CramRecord from './cramFile/record'
|
|
5
|
-
import { CramUnimplementedError } from './errors'
|
|
1
|
+
import { Slice } from './craiIndex.ts'
|
|
2
|
+
import { SeqFetch } from './cramFile/file.ts'
|
|
3
|
+
import CramFile from './cramFile/index.ts'
|
|
4
|
+
import CramRecord from './cramFile/record.ts'
|
|
5
|
+
import { CramUnimplementedError } from './errors.ts'
|
|
6
6
|
|
|
7
7
|
import type { GenericFilehandle } from 'generic-filehandle2'
|
|
8
8
|
|
package/src/rans/d04.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CramMalformedError } from '../errors'
|
|
3
|
-
import { TF_SHIFT } from './constants'
|
|
4
|
-
import Decoding from './decoding'
|
|
2
|
+
import { CramMalformedError } from '../errors.ts'
|
|
3
|
+
import { TF_SHIFT } from './constants.ts'
|
|
4
|
+
import Decoding from './decoding.ts'
|
|
5
5
|
|
|
6
6
|
export default function uncompress(
|
|
7
7
|
/* ByteBuffer */ input,
|
package/src/rans/d14.ts
CHANGED
package/src/rans/decoding.ts
CHANGED
package/src/rans/frequencies.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CramMalformedError } from '../errors'
|
|
3
|
-
import { TOTFREQ } from './constants'
|
|
4
|
-
import Decoding from './decoding'
|
|
2
|
+
import { CramMalformedError } from '../errors.ts'
|
|
3
|
+
import { TOTFREQ } from './constants.ts'
|
|
4
|
+
import Decoding from './decoding.ts'
|
|
5
5
|
|
|
6
6
|
function assert(result) {
|
|
7
7
|
if (!result) {
|
package/src/rans/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CramMalformedError } from '../errors'
|
|
3
|
-
import D04 from './d04'
|
|
4
|
-
import D14 from './d14'
|
|
5
|
-
import Decoding from './decoding'
|
|
6
|
-
import { readStatsO0, readStatsO1 } from './frequencies'
|
|
2
|
+
import { CramMalformedError } from '../errors.ts'
|
|
3
|
+
import D04 from './d04.ts'
|
|
4
|
+
import D14 from './d14.ts'
|
|
5
|
+
import Decoding from './decoding.ts'
|
|
6
|
+
import { readStatsO0, readStatsO1 } from './frequencies.ts'
|
|
7
7
|
|
|
8
8
|
// const /* int */ ORDER_BYTE_LENGTH = 1
|
|
9
9
|
// const /* int */ COMPRESSED_BYTE_LENGTH = 4
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Based on xzwasm (c) Steve Sanderson. License: MIT - https://github.com/SteveSanderson/xzwasm
|
|
3
|
-
* Contains xz-embedded by Lasse Collin and Igor Pavlov. License: Public domain - https://tukaani.org/xz/embedded.html
|
|
4
|
-
* and walloc (c) 2020 Igalia, S.L. License: MIT - https://github.com/wingo/walloc
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
* Determine if an object is a Buffer
|
|
9
|
-
*
|
|
10
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
11
|
-
* @license MIT
|
|
12
|
-
*/
|
package/dist/io/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;AAqBS,oBAAI;AArBb,6DAA2D;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,gCAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,+BAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAID,2DAA2D;AAAlD,gHAAA,SAAS,OAAA;AAAE,iHAAA,UAAU,OAAA"}
|
package/esm/io/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare module 'seek-bzip'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|