@gmod/hic 1.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/LICENSE +25 -0
- package/README.md +91 -0
- package/dist/binWindow.d.ts +24 -0
- package/dist/binWindow.js +32 -0
- package/dist/binWindow.js.map +1 -0
- package/dist/binary.d.ts +15 -0
- package/dist/binary.js +67 -0
- package/dist/binary.js.map +1 -0
- package/dist/bufferedFile.d.ts +13 -0
- package/dist/bufferedFile.js +78 -0
- package/dist/bufferedFile.js.map +1 -0
- package/dist/contactRecords.d.ts +25 -0
- package/dist/contactRecords.js +3 -0
- package/dist/contactRecords.js.map +1 -0
- package/dist/hicFile.d.ts +94 -0
- package/dist/hicFile.js +769 -0
- package/dist/hicFile.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lru.d.ts +29 -0
- package/dist/lru.js +55 -0
- package/dist/lru.js.map +1 -0
- package/dist/matrix.d.ts +9 -0
- package/dist/matrix.js +41 -0
- package/dist/matrix.js.map +1 -0
- package/dist/matrixZoomData.d.ts +14 -0
- package/dist/matrixZoomData.js +96 -0
- package/dist/matrixZoomData.js.map +1 -0
- package/dist/normalizationVector.d.ts +10 -0
- package/dist/normalizationVector.js +51 -0
- package/dist/normalizationVector.js.map +1 -0
- package/dist/package.json +1 -0
- package/dist/reader.d.ts +3 -0
- package/dist/reader.js +12 -0
- package/dist/reader.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/esm/binWindow.d.ts +24 -0
- package/esm/binWindow.js +29 -0
- package/esm/binWindow.js.map +1 -0
- package/esm/binary.d.ts +15 -0
- package/esm/binary.js +64 -0
- package/esm/binary.js.map +1 -0
- package/esm/bufferedFile.d.ts +13 -0
- package/esm/bufferedFile.js +75 -0
- package/esm/bufferedFile.js.map +1 -0
- package/esm/contactRecords.d.ts +25 -0
- package/esm/contactRecords.js +2 -0
- package/esm/contactRecords.js.map +1 -0
- package/esm/hicFile.d.ts +94 -0
- package/esm/hicFile.js +762 -0
- package/esm/hicFile.js.map +1 -0
- package/esm/index.d.ts +5 -0
- package/esm/index.js +3 -0
- package/esm/index.js.map +1 -0
- package/esm/lru.d.ts +29 -0
- package/esm/lru.js +52 -0
- package/esm/lru.js.map +1 -0
- package/esm/matrix.d.ts +9 -0
- package/esm/matrix.js +35 -0
- package/esm/matrix.js.map +1 -0
- package/esm/matrixZoomData.d.ts +14 -0
- package/esm/matrixZoomData.js +93 -0
- package/esm/matrixZoomData.js.map +1 -0
- package/esm/normalizationVector.d.ts +10 -0
- package/esm/normalizationVector.js +45 -0
- package/esm/normalizationVector.js.map +1 -0
- package/esm/reader.d.ts +3 -0
- package/esm/reader.js +9 -0
- package/esm/reader.js.map +1 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +2 -0
- package/esm/types.js.map +1 -0
- package/package.json +73 -0
- package/src/binWindow.ts +30 -0
- package/src/binary.ts +72 -0
- package/src/bufferedFile.ts +74 -0
- package/src/contactRecords.ts +25 -0
- package/src/hicFile.ts +943 -0
- package/src/index.ts +12 -0
- package/src/lru.ts +77 -0
- package/src/matrix.ts +43 -0
- package/src/matrixZoomData.ts +133 -0
- package/src/normalizationVector.ts +58 -0
- package/src/reader.ts +11 -0
- package/src/types.ts +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,QAAQ,GAAG,CAAC,CAAA;IACJ,IAAI,CAAU;IACd,MAAM,CAAQ;IACd,YAAY,CAAS;IAE7B,YAAY,QAAkB,EAAE,YAAY,GAAG,IAAI;QACjD,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAA;QACjC,IAAI,CAAC,YAA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CAAC,CAAC,CAAC,KAAK,GAAG,aAAa,GAAG,MAAM,CAAA;IAC7E,CAAC;IAED,SAAS;QACP,IAAI,CAAC,GAAG,EAAE,CAAA;QACV,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;QAC3C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACf,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;YAC3B,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAA;QACzC,CAAC;QACD,OAAO,CAAC,CAAA;IACV,CAAC;IAED,QAAQ;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAClE,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAA;QAClB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,SAAS;QACP,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAClE,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAA;QAClB,OAAO,GAAG,CAAA;IACZ,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Reader } from './types.ts';
|
|
2
|
+
export default class BufferedFile {
|
|
3
|
+
private file;
|
|
4
|
+
private size;
|
|
5
|
+
private bufferStart;
|
|
6
|
+
private bufferLength;
|
|
7
|
+
private buffer;
|
|
8
|
+
constructor(args: {
|
|
9
|
+
file: Reader;
|
|
10
|
+
size?: number;
|
|
11
|
+
});
|
|
12
|
+
read(position: number, length: number): Promise<ArrayBuffer>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function concatBuffers(buffer1, buffer2) {
|
|
2
|
+
const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
|
|
3
|
+
tmp.set(new Uint8Array(buffer1), 0);
|
|
4
|
+
tmp.set(new Uint8Array(buffer2), buffer1.byteLength);
|
|
5
|
+
return tmp.buffer;
|
|
6
|
+
}
|
|
7
|
+
export default class BufferedFile {
|
|
8
|
+
file;
|
|
9
|
+
size;
|
|
10
|
+
bufferStart = 0;
|
|
11
|
+
bufferLength = 0;
|
|
12
|
+
buffer;
|
|
13
|
+
constructor(args) {
|
|
14
|
+
this.file = args.file;
|
|
15
|
+
this.size = args.size ?? 64000;
|
|
16
|
+
}
|
|
17
|
+
async read(position, length) {
|
|
18
|
+
const start = position;
|
|
19
|
+
const end = position + length;
|
|
20
|
+
const bufferStart = this.bufferStart;
|
|
21
|
+
const bufferEnd = this.bufferStart + this.bufferLength;
|
|
22
|
+
const buf = this.buffer;
|
|
23
|
+
let result;
|
|
24
|
+
if (length > this.size) {
|
|
25
|
+
// Request larger than max buffer size, pass through to underlying file
|
|
26
|
+
this.buffer = undefined;
|
|
27
|
+
this.bufferStart = 0;
|
|
28
|
+
this.bufferLength = 0;
|
|
29
|
+
result = await this.file.read(position, length);
|
|
30
|
+
}
|
|
31
|
+
else if (buf && start >= bufferStart && end <= bufferEnd) {
|
|
32
|
+
// Request within buffer bounds
|
|
33
|
+
const sliceStart = start - bufferStart;
|
|
34
|
+
result = buf.slice(sliceStart, sliceStart + length);
|
|
35
|
+
}
|
|
36
|
+
else if (buf && start < bufferStart && end > bufferStart) {
|
|
37
|
+
// Overlap left (unexpected in straw); we don't adjust the buffer
|
|
38
|
+
const l1 = bufferStart - start;
|
|
39
|
+
const a1 = await this.file.read(position, l1);
|
|
40
|
+
const l2 = length - l1;
|
|
41
|
+
if (l2 > 0) {
|
|
42
|
+
result = concatBuffers(a1, buf.slice(0, l2));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
result = a1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (buf && start < bufferEnd && end > bufferEnd) {
|
|
49
|
+
// Overlap right
|
|
50
|
+
const l1 = bufferEnd - start;
|
|
51
|
+
const a1 = buf.slice(this.bufferLength - l1, this.bufferLength);
|
|
52
|
+
const l2 = length - l1;
|
|
53
|
+
if (l2 > 0) {
|
|
54
|
+
const next = await this.file.read(bufferEnd, this.size);
|
|
55
|
+
this.buffer = next;
|
|
56
|
+
this.bufferStart = bufferEnd;
|
|
57
|
+
this.bufferLength = next.byteLength;
|
|
58
|
+
result = concatBuffers(a1, next.slice(0, l2));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
result = a1;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
// No overlap with buffer
|
|
66
|
+
const next = await this.file.read(position, this.size);
|
|
67
|
+
this.buffer = next;
|
|
68
|
+
this.bufferStart = position;
|
|
69
|
+
this.bufferLength = next.byteLength;
|
|
70
|
+
result = next.slice(0, length);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=bufferedFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferedFile.js","sourceRoot":"","sources":["../src/bufferedFile.ts"],"names":[],"mappings":"AAEA,SAAS,aAAa,CAAC,OAAoB,EAAE,OAAoB;IAC/D,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACnE,GAAG,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;IACnC,GAAG,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACpD,OAAO,GAAG,CAAC,MAAM,CAAA;AACnB,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IACvB,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IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;YACtD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAA;YAClB,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAA;YAC3B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,CAAA;YACnC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QAChC,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A run of contact records, held struct-of-arrays.
|
|
3
|
+
*
|
|
4
|
+
* hic-straw models a contact as an object, and the whole read path inherits
|
|
5
|
+
* that shape: a block holds `ContactRecord[]` and the window filter rebuilds
|
|
6
|
+
* the array. A renderer then has to unpack that into typed arrays anyway, so a
|
|
7
|
+
* contact was allocated several times over on its way to a vertex buffer — and
|
|
8
|
+
* a matrix is routinely millions of contacts.
|
|
9
|
+
*
|
|
10
|
+
* The per-contact allocation is the obvious cost, but the block cache is the
|
|
11
|
+
* expensive one: cached blocks are long-lived, so as objects they left millions
|
|
12
|
+
* of live pointers for every GC to trace for the rest of the session. Twelve
|
|
13
|
+
* bytes a contact here against ~50 for an object, and nothing for the collector
|
|
14
|
+
* to walk.
|
|
15
|
+
*
|
|
16
|
+
* The three arrays are always exactly the same length — `bin1.length` is the
|
|
17
|
+
* record count. Counts are float32 because that is what the file stores
|
|
18
|
+
* (`getFloat`/`getShort`) and what a GPU renderer takes, so carrying them as
|
|
19
|
+
* doubles only ever widened a value on its way back down to float32.
|
|
20
|
+
*/
|
|
21
|
+
export interface ContactRecords {
|
|
22
|
+
bin1: Int32Array;
|
|
23
|
+
bin2: Int32Array;
|
|
24
|
+
counts: Float32Array;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contactRecords.js","sourceRoot":"","sources":["../src/contactRecords.ts"],"names":[],"mappings":""}
|
package/esm/hicFile.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import BinaryParser from './binary.ts';
|
|
2
|
+
import Matrix from './matrix.ts';
|
|
3
|
+
import NormalizationVector from './normalizationVector.ts';
|
|
4
|
+
import type { ContactRecords } from './contactRecords.ts';
|
|
5
|
+
import type MatrixZoomData from './matrixZoomData.ts';
|
|
6
|
+
import type { BlockIndexEntry, HicMetadata, HicRegion, Reader } from './types.ts';
|
|
7
|
+
import type { GenericFilehandle } from 'generic-filehandle2';
|
|
8
|
+
/**
|
|
9
|
+
* Prefix of the error thrown when a region pair has no matrix at the requested
|
|
10
|
+
* binsize. A caller fetching many region pairs at once will want to drop that
|
|
11
|
+
* pair rather than fail the whole fetch, and it can only tell this apart from a
|
|
12
|
+
* real failure by the message — so it is exported instead of hand-copied.
|
|
13
|
+
*/
|
|
14
|
+
export declare const NO_DATA_FOR_RESOLUTION = "No data available for resolution";
|
|
15
|
+
export interface HicConfig {
|
|
16
|
+
/** a `generic-filehandle2` handle, e.g. `RemoteFile` for a URL */
|
|
17
|
+
filehandle?: GenericFilehandle;
|
|
18
|
+
/** a local path, node only */
|
|
19
|
+
path?: string;
|
|
20
|
+
/** any object that can read `length` bytes at `position` */
|
|
21
|
+
reader?: Reader;
|
|
22
|
+
/**
|
|
23
|
+
* `"position,size"` of the normalization vector index, if it is known. Skips
|
|
24
|
+
* the walk through the expected-value vectors that locating it otherwise
|
|
25
|
+
* costs on a pre-v9 file.
|
|
26
|
+
*/
|
|
27
|
+
nvi?: string;
|
|
28
|
+
}
|
|
29
|
+
interface Block {
|
|
30
|
+
blockNumber: number;
|
|
31
|
+
records: ContactRecords;
|
|
32
|
+
}
|
|
33
|
+
export declare class HicFile {
|
|
34
|
+
private config;
|
|
35
|
+
private file;
|
|
36
|
+
private normVectorCache;
|
|
37
|
+
private normalizationTypes;
|
|
38
|
+
private matrixCache;
|
|
39
|
+
private blockCache;
|
|
40
|
+
private normVectorIndexPosition;
|
|
41
|
+
private normVectorIndexSize;
|
|
42
|
+
private initPromise;
|
|
43
|
+
private normVectorIndexP;
|
|
44
|
+
private version;
|
|
45
|
+
private genomeId;
|
|
46
|
+
private footerPosition;
|
|
47
|
+
normExpectedValueVectorsPosition: number | undefined;
|
|
48
|
+
private normVectorIndex;
|
|
49
|
+
private chromosomes;
|
|
50
|
+
private chromosomeIndexMap;
|
|
51
|
+
private chrAliasTable;
|
|
52
|
+
private bpResolutions;
|
|
53
|
+
private masterIndex;
|
|
54
|
+
private meta;
|
|
55
|
+
constructor(config: HicConfig);
|
|
56
|
+
init(): Promise<void>;
|
|
57
|
+
getMetaData(): Promise<HicMetadata>;
|
|
58
|
+
readHeaderAndFooter(): Promise<void>;
|
|
59
|
+
readFooter(): Promise<void>;
|
|
60
|
+
getMatrix(chrIdx1: number, chrIdx2: number): Promise<Matrix | undefined>;
|
|
61
|
+
readMatrix(chrIdx1: number, chrIdx2: number): Promise<Matrix | undefined>;
|
|
62
|
+
getContactRecords(normalization: string, region1: HicRegion, region2: HicRegion, units: string, binsize: number): Promise<{
|
|
63
|
+
records: ContactRecords;
|
|
64
|
+
appliedNormalization: string;
|
|
65
|
+
transposed: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
private getNormVectors;
|
|
68
|
+
getBlocks(region1: HicRegion, region2: HicRegion, binSize: number): Promise<(Block | undefined)[]>;
|
|
69
|
+
readBlock(blockNumber: number, zd: MatrixZoomData): Promise<Block | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* Decode one block's records straight into typed arrays.
|
|
72
|
+
*
|
|
73
|
+
* Every encoding here knows its length up front, so each array is allocated
|
|
74
|
+
* once and filled by a write cursor. Where a filter can drop records (the
|
|
75
|
+
* dense encoding's empty cells) the arrays are sized to the upper bound and
|
|
76
|
+
* copied down to the true length at the end — blocks are cached for the life
|
|
77
|
+
* of the session, so it is worth one memcpy not to pin an oversized buffer.
|
|
78
|
+
*/
|
|
79
|
+
private parseBlockRecords;
|
|
80
|
+
getNormalizationVector(type: string, chr: string, unit: string, binSize: number): Promise<NormalizationVector | undefined>;
|
|
81
|
+
private readNormalizationVector;
|
|
82
|
+
getNormVectorIndex(): Promise<Record<string, BlockIndexEntry> | undefined>;
|
|
83
|
+
private loadNormVectorIndex;
|
|
84
|
+
getNormalizationOptions(): Promise<string[]>;
|
|
85
|
+
readNormVectorIndex(range: {
|
|
86
|
+
start: number;
|
|
87
|
+
size: number;
|
|
88
|
+
}): Promise<Record<string, BlockIndexEntry>>;
|
|
89
|
+
readNormExpectedValuesAndNormVectorIndex(): Promise<void>;
|
|
90
|
+
skipExpectedValues(start: number): Promise<number>;
|
|
91
|
+
parseNormVectorEntry(binaryParser: BinaryParser): void;
|
|
92
|
+
getFileChrName(chrAlias: string): string;
|
|
93
|
+
}
|
|
94
|
+
export {};
|