@gmod/bam 1.1.17 → 2.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/CHANGELOG.md +65 -25
- package/README.md +108 -57
- package/dist/bai.d.ts +34 -15
- package/dist/bai.js +180 -273
- package/dist/bai.js.map +1 -1
- package/dist/bamFile.d.ts +33 -27
- package/dist/bamFile.js +353 -572
- package/dist/bamFile.js.map +1 -1
- package/dist/chunk.d.ts +4 -8
- package/dist/chunk.js +13 -21
- package/dist/chunk.js.map +1 -1
- package/dist/csi.d.ts +74 -10
- package/dist/csi.js +157 -256
- package/dist/csi.js.map +1 -1
- package/dist/errors.js +12 -57
- package/dist/errors.js.map +1 -1
- package/dist/htsget.d.ts +5 -8
- package/dist/htsget.js +120 -209
- package/dist/htsget.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/indexFile.d.ts +0 -6
- package/dist/indexFile.js +3 -77
- package/dist/indexFile.js.map +1 -1
- package/dist/nullIndex.d.ts +7 -0
- package/dist/nullIndex.js +33 -0
- package/dist/nullIndex.js.map +1 -0
- package/dist/record.d.ts +2 -2
- package/dist/record.js +200 -193
- package/dist/record.js.map +1 -1
- package/dist/sam.js +12 -10
- package/dist/sam.js.map +1 -1
- package/dist/util.d.ts +13 -1
- package/dist/util.js +55 -58
- package/dist/util.js.map +1 -1
- package/dist/virtualOffset.js +13 -20
- package/dist/virtualOffset.js.map +1 -1
- package/esm/bai.d.ts +34 -15
- package/esm/bai.js +86 -91
- package/esm/bai.js.map +1 -1
- package/esm/bamFile.d.ts +33 -27
- package/esm/bamFile.js +124 -120
- package/esm/bamFile.js.map +1 -1
- package/esm/chunk.d.ts +4 -8
- package/esm/chunk.js +2 -8
- package/esm/chunk.js.map +1 -1
- package/esm/csi.d.ts +74 -10
- package/esm/csi.js +85 -93
- package/esm/csi.js.map +1 -1
- package/esm/htsget.d.ts +5 -8
- package/esm/htsget.js +68 -43
- package/esm/htsget.js.map +1 -1
- package/esm/index.d.ts +5 -6
- package/esm/index.js +5 -6
- package/esm/index.js.map +1 -1
- package/esm/indexFile.d.ts +0 -6
- package/esm/indexFile.js +0 -22
- package/esm/indexFile.js.map +1 -1
- package/esm/nullIndex.d.ts +7 -0
- package/esm/nullIndex.js +16 -0
- package/esm/nullIndex.js.map +1 -0
- package/esm/record.d.ts +2 -2
- package/esm/record.js +34 -24
- package/esm/record.js.map +1 -1
- package/esm/sam.js +9 -7
- package/esm/sam.js.map +1 -1
- package/esm/util.d.ts +13 -1
- package/esm/util.js +40 -14
- package/esm/util.js.map +1 -1
- package/package.json +19 -20
- package/src/bai.ts +99 -102
- package/src/bamFile.ts +174 -198
- package/src/chunk.ts +6 -20
- package/src/csi.ts +102 -111
- package/src/htsget.ts +81 -61
- package/src/index.ts +5 -7
- package/src/indexFile.ts +0 -27
- package/src/nullIndex.ts +18 -0
- package/src/record.ts +34 -24
- package/src/sam.ts +9 -7
- package/src/util.ts +54 -13
- package/src/declare.d.ts +0 -2
package/dist/bamFile.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
2
3
|
import { GenericFilehandle } from 'generic-filehandle';
|
|
4
|
+
import BAI from './bai';
|
|
5
|
+
import CSI from './csi';
|
|
3
6
|
import Chunk from './chunk';
|
|
4
7
|
import BAMFeature from './record';
|
|
5
8
|
import { BamOpts, BaseOpts } from './util';
|
|
6
9
|
export declare const BAM_MAGIC = 21840194;
|
|
7
10
|
export default class BamFile {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
renameRefSeq: (a: string) => string;
|
|
12
|
+
bam: GenericFilehandle;
|
|
13
|
+
header?: string;
|
|
14
|
+
chrToIndex?: Record<string, number>;
|
|
15
|
+
indexToChr?: {
|
|
16
|
+
refName: string;
|
|
17
|
+
length: number;
|
|
18
|
+
}[];
|
|
19
|
+
yieldThreadTime: number;
|
|
20
|
+
index?: BAI | CSI;
|
|
21
|
+
htsget: boolean;
|
|
22
|
+
headerP?: ReturnType<BamFile['getHeaderPre']>;
|
|
17
23
|
private featureCache;
|
|
18
|
-
|
|
19
|
-
* @param {object} args
|
|
20
|
-
* @param {string} [args.bamPath]
|
|
21
|
-
* @param {FileHandle} [args.bamFilehandle]
|
|
22
|
-
* @param {string} [args.baiPath]
|
|
23
|
-
* @param {FileHandle} [args.baiFilehandle]
|
|
24
|
-
*/
|
|
25
|
-
constructor({ bamFilehandle, bamPath, bamUrl, baiPath, baiFilehandle, baiUrl, csiPath, csiFilehandle, csiUrl, fetchSizeLimit, chunkSizeLimit, yieldThreadTime, renameRefSeqs, }: {
|
|
24
|
+
constructor({ bamFilehandle, bamPath, bamUrl, baiPath, baiFilehandle, baiUrl, csiPath, csiFilehandle, csiUrl, htsget, yieldThreadTime, renameRefSeqs, }: {
|
|
26
25
|
bamFilehandle?: GenericFilehandle;
|
|
27
26
|
bamPath?: string;
|
|
28
27
|
bamUrl?: string;
|
|
@@ -32,19 +31,25 @@ export default class BamFile {
|
|
|
32
31
|
csiPath?: string;
|
|
33
32
|
csiFilehandle?: GenericFilehandle;
|
|
34
33
|
csiUrl?: string;
|
|
35
|
-
fetchSizeLimit?: number;
|
|
36
|
-
chunkSizeLimit?: number;
|
|
37
34
|
renameRefSeqs?: (a: string) => string;
|
|
38
35
|
yieldThreadTime?: number;
|
|
36
|
+
htsget?: boolean;
|
|
39
37
|
});
|
|
40
|
-
|
|
38
|
+
getHeaderPre(origOpts?: BaseOpts): Promise<{
|
|
41
39
|
tag: string;
|
|
42
40
|
data: {
|
|
43
41
|
tag: string;
|
|
44
42
|
value: string;
|
|
45
43
|
}[];
|
|
46
|
-
}[]>;
|
|
47
|
-
|
|
44
|
+
}[] | undefined>;
|
|
45
|
+
getHeader(opts?: BaseOpts): Promise<{
|
|
46
|
+
tag: string;
|
|
47
|
+
data: {
|
|
48
|
+
tag: string;
|
|
49
|
+
value: string;
|
|
50
|
+
}[];
|
|
51
|
+
}[] | undefined>;
|
|
52
|
+
getHeaderText(opts?: BaseOpts): Promise<string | undefined>;
|
|
48
53
|
_readRefSeqs(start: number, refSeqBytes: number, opts?: BaseOpts): Promise<{
|
|
49
54
|
chrToIndex: {
|
|
50
55
|
[key: string]: number;
|
|
@@ -56,19 +61,20 @@ export default class BamFile {
|
|
|
56
61
|
}>;
|
|
57
62
|
getRecordsForRange(chr: string, min: number, max: number, opts?: BamOpts): Promise<BAMFeature[]>;
|
|
58
63
|
streamRecordsForRange(chr: string, min: number, max: number, opts?: BamOpts): AsyncGenerator<BAMFeature[], void, unknown>;
|
|
59
|
-
_fetchChunkFeatures(chunks: Chunk[], chrId: number, min: number, max: number, opts
|
|
64
|
+
_fetchChunkFeatures(chunks: Chunk[], chrId: number, min: number, max: number, opts?: BamOpts): AsyncGenerator<BAMFeature[], void, unknown>;
|
|
60
65
|
fetchPairs(chrId: number, feats: BAMFeature[][], opts: BamOpts): Promise<BAMFeature[]>;
|
|
66
|
+
_readRegion(position: number, size: number, opts?: BaseOpts): Promise<Buffer>;
|
|
61
67
|
_readChunk({ chunk, opts }: {
|
|
62
68
|
chunk: Chunk;
|
|
63
69
|
opts: BaseOpts;
|
|
64
70
|
}): Promise<{
|
|
65
|
-
data:
|
|
66
|
-
cpositions:
|
|
67
|
-
dpositions:
|
|
71
|
+
data: Buffer;
|
|
72
|
+
cpositions: number[];
|
|
73
|
+
dpositions: number[];
|
|
68
74
|
chunk: Chunk;
|
|
69
75
|
}>;
|
|
70
76
|
readBamFeatures(ba: Buffer, cpositions: number[], dpositions: number[], chunk: Chunk): Promise<BAMFeature[]>;
|
|
71
|
-
hasRefSeq(seqName: string): Promise<boolean>;
|
|
77
|
+
hasRefSeq(seqName: string): Promise<boolean | undefined>;
|
|
72
78
|
lineCount(seqName: string): Promise<number>;
|
|
73
79
|
indexCov(seqName: string, start?: number, end?: number): Promise<{
|
|
74
80
|
start: number;
|