@nanalogue/node 0.1.3 → 0.2.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 +219 -46
- package/index.d.ts +35 -1
- package/index.js +23 -20
- package/package.json +21 -9
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ in a BAM file in the mod BAM format (using MM/ML tags as specified in the
|
|
|
28
28
|
- [seqTable](#seqtable)
|
|
29
29
|
- [simulateModBam](#simulatemodbam)
|
|
30
30
|
- [TypeScript Support](#typescript-support)
|
|
31
|
+
- [Pagination](#pagination)
|
|
31
32
|
- [Filtering Options](#filtering-options)
|
|
32
33
|
- [Further Documentation](#further-documentation)
|
|
33
34
|
- [Versioning](#versioning)
|
|
@@ -52,83 +53,168 @@ All functions return Promises and support extensive filtering options.
|
|
|
52
53
|
|
|
53
54
|
Quickly extract BAM file metadata without processing all records.
|
|
54
55
|
|
|
56
|
+
<!-- TEST CODE: START peek -->
|
|
55
57
|
```typescript
|
|
56
58
|
import { peek } from '@nanalogue/node';
|
|
57
59
|
|
|
58
60
|
const result = await peek({ bamPath: 'tests/data/examples/example_1.bam' });
|
|
59
|
-
console.log(result);
|
|
60
|
-
// Output:
|
|
61
|
-
// {
|
|
62
|
-
// contigs: { dummyI: 22, dummyII: 48, dummyIII: 76 },
|
|
63
|
-
// modifications: [ [ 'G', '-', '7200' ], [ 'T', '+', 'T' ] ]
|
|
64
|
-
// }
|
|
61
|
+
console.log(JSON.stringify(result));
|
|
65
62
|
```
|
|
63
|
+
<!-- TEST CODE: END peek -->
|
|
64
|
+
|
|
65
|
+
The output is a JSON object with two keys: `contigs` (contig names to lengths)
|
|
66
|
+
and `modifications` (modification entries as `[base, strand, code]` where
|
|
67
|
+
`+` indicates the basecalled strand and `-` indicates its complement).
|
|
68
|
+
|
|
69
|
+
<!-- TEST OUTPUT: START peek -->
|
|
70
|
+
```json
|
|
71
|
+
{"contigs":{"dummyI":22,"dummyII":48,"dummyIII":76},"modifications":[["G","-","7200"],["T","+","T"]]}
|
|
72
|
+
```
|
|
73
|
+
<!-- TEST OUTPUT: END peek -->
|
|
66
74
|
|
|
67
75
|
### readInfo
|
|
68
76
|
|
|
69
77
|
Get information about reads in the BAM file.
|
|
70
78
|
|
|
79
|
+
<!-- TEST CODE: START readInfo -->
|
|
71
80
|
```typescript
|
|
72
81
|
import { readInfo } from '@nanalogue/node';
|
|
73
82
|
|
|
74
83
|
const reads = await readInfo({ bamPath: 'tests/data/examples/example_1.bam' });
|
|
75
|
-
console.log(reads[0]);
|
|
76
|
-
// Output (first read):
|
|
77
|
-
// {
|
|
78
|
-
// read_id: '5d10eb9a-aae1-4db8-8ec6-7ebb34d32575',
|
|
79
|
-
// sequence_length: 8,
|
|
80
|
-
// contig: 'dummyI',
|
|
81
|
-
// reference_start: 9,
|
|
82
|
-
// reference_end: 17,
|
|
83
|
-
// alignment_length: 8,
|
|
84
|
-
// alignment_type: 'primary_forward',
|
|
85
|
-
// mod_count: 'T+T:0;(probabilities >= 0.5020, PHRED base qual >= 0)'
|
|
86
|
-
// }
|
|
84
|
+
console.log(JSON.stringify(reads[0], null, 2));
|
|
87
85
|
```
|
|
86
|
+
<!-- TEST CODE: END readInfo -->
|
|
87
|
+
|
|
88
|
+
The output is a JSON object for the first read:
|
|
89
|
+
|
|
90
|
+
<!-- TEST OUTPUT: START readInfo -->
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"read_id": "5d10eb9a-aae1-4db8-8ec6-7ebb34d32575",
|
|
94
|
+
"sequence_length": 8,
|
|
95
|
+
"contig": "dummyI",
|
|
96
|
+
"reference_start": 9,
|
|
97
|
+
"reference_end": 17,
|
|
98
|
+
"alignment_length": 8,
|
|
99
|
+
"alignment_type": "primary_forward",
|
|
100
|
+
"mod_count": "T+T:0;(probabilities >= 0.5020, PHRED base qual >= 0)",
|
|
101
|
+
"mapq": 255
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
<!-- TEST OUTPUT: END readInfo -->
|
|
88
105
|
|
|
89
106
|
### bamMods
|
|
90
107
|
|
|
91
108
|
Extract detailed modification data for each read.
|
|
92
109
|
|
|
110
|
+
<!-- TEST CODE: START bamMods -->
|
|
93
111
|
```typescript
|
|
94
112
|
import { bamMods } from '@nanalogue/node';
|
|
95
113
|
|
|
96
114
|
const mods = await bamMods({ bamPath: 'tests/data/examples/example_1.bam' });
|
|
97
|
-
console.log(mods[0]);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
console.log(JSON.stringify(mods[0], null, 2));
|
|
116
|
+
```
|
|
117
|
+
<!-- TEST CODE: END bamMods -->
|
|
118
|
+
|
|
119
|
+
The output is a JSON object for the first read. The `data` arrays contain
|
|
120
|
+
`[seq_pos, ref_pos, mod_quality]` tuples:
|
|
121
|
+
|
|
122
|
+
<!-- TEST OUTPUT: START bamMods -->
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"alignment_type": "primary_forward",
|
|
126
|
+
"alignment": {
|
|
127
|
+
"start": 9,
|
|
128
|
+
"end": 17,
|
|
129
|
+
"contig": "dummyI",
|
|
130
|
+
"contig_id": 0
|
|
131
|
+
},
|
|
132
|
+
"mod_table": [
|
|
133
|
+
{
|
|
134
|
+
"base": "T",
|
|
135
|
+
"is_strand_plus": true,
|
|
136
|
+
"mod_code": "T",
|
|
137
|
+
"data": [
|
|
138
|
+
[
|
|
139
|
+
0,
|
|
140
|
+
9,
|
|
141
|
+
4
|
|
142
|
+
],
|
|
143
|
+
[
|
|
144
|
+
3,
|
|
145
|
+
12,
|
|
146
|
+
7
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
4,
|
|
150
|
+
13,
|
|
151
|
+
9
|
|
152
|
+
],
|
|
153
|
+
[
|
|
154
|
+
7,
|
|
155
|
+
16,
|
|
156
|
+
6
|
|
157
|
+
]
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"read_id": "5d10eb9a-aae1-4db8-8ec6-7ebb34d32575",
|
|
162
|
+
"seq_len": 8,
|
|
163
|
+
"mapq": 255
|
|
164
|
+
}
|
|
111
165
|
```
|
|
166
|
+
<!-- TEST OUTPUT: END bamMods -->
|
|
112
167
|
|
|
113
168
|
### windowReads
|
|
114
169
|
|
|
115
170
|
Compute windowed modification densities across reads.
|
|
116
171
|
|
|
172
|
+
<!-- TEST CODE: START windowReads -->
|
|
117
173
|
```typescript
|
|
118
174
|
import { windowReads } from '@nanalogue/node';
|
|
119
175
|
|
|
120
|
-
const
|
|
176
|
+
const entries = await windowReads({
|
|
121
177
|
bamPath: 'tests/data/examples/example_1.bam',
|
|
122
178
|
win: 2,
|
|
123
179
|
step: 1
|
|
124
180
|
});
|
|
125
|
-
console.log(
|
|
126
|
-
// Output (first 3 data rows):
|
|
127
|
-
// #contig ref_win_start ref_win_end read_id win_val strand base mod_strand mod_type win_start win_end basecall_qual
|
|
128
|
-
// dummyI 9 13 5d10eb9a-aae1-4db8-8ec6-7ebb34d32575 0 + T + T 0 4 255
|
|
129
|
-
// dummyI 12 14 5d10eb9a-aae1-4db8-8ec6-7ebb34d32575 0 + T + T 3 5 255
|
|
130
|
-
// (basecall_qual is 255 as base quality scores are unavailable in this example file)
|
|
181
|
+
console.log(JSON.stringify(entries[0], null, 2));
|
|
131
182
|
```
|
|
183
|
+
<!-- TEST CODE: END windowReads -->
|
|
184
|
+
|
|
185
|
+
The output is a JSON array of per-read entries. Each entry contains alignment
|
|
186
|
+
info and a `mod_table` with windowed data tuples
|
|
187
|
+
`[win_start, win_end, win_val, mean_base_qual, ref_win_start, ref_win_end]`.
|
|
188
|
+
(mean\_base\_qual is 255 as base quality scores are unavailable in this example file.).
|
|
189
|
+
NOTE: If the `alignment_type` is "unmapped", then the `alignment` field is not present.
|
|
190
|
+
|
|
191
|
+
<!-- TEST OUTPUT: START windowReads -->
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"alignment_type": "primary_forward",
|
|
195
|
+
"alignment": {
|
|
196
|
+
"start": 9,
|
|
197
|
+
"end": 17,
|
|
198
|
+
"contig": "dummyI",
|
|
199
|
+
"contig_id": 0
|
|
200
|
+
},
|
|
201
|
+
"mod_table": [
|
|
202
|
+
{
|
|
203
|
+
"base": "T",
|
|
204
|
+
"is_strand_plus": true,
|
|
205
|
+
"mod_code": "T",
|
|
206
|
+
"data": [
|
|
207
|
+
[0, 4, 0.0, 255, 9, 13],
|
|
208
|
+
[3, 5, 0.0, 255, 12, 14],
|
|
209
|
+
[4, 8, 0.0, 255, 13, 17]
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"read_id": "5d10eb9a-aae1-4db8-8ec6-7ebb34d32575",
|
|
214
|
+
"seq_len": 8
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
<!-- TEST OUTPUT: END windowReads -->
|
|
132
218
|
|
|
133
219
|
Supports `winOp: 'grad_density'` for gradient mode.
|
|
134
220
|
|
|
@@ -136,25 +222,36 @@ Supports `winOp: 'grad_density'` for gradient mode.
|
|
|
136
222
|
|
|
137
223
|
Extract sequences and qualities for a genomic region.
|
|
138
224
|
|
|
225
|
+
<!-- TEST CODE: START seqTable -->
|
|
139
226
|
```typescript
|
|
140
227
|
import { seqTable } from '@nanalogue/node';
|
|
141
228
|
|
|
142
229
|
const tsv = await seqTable({
|
|
143
230
|
bamPath: 'tests/data/examples/example_pynanalogue_1.bam',
|
|
144
|
-
region: 'contig_00000:0-10'
|
|
231
|
+
region: 'contig_00000:0-10'
|
|
145
232
|
});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// 1... ACGTACGTAC 30.30.30.30.30.30.30.30.30.30
|
|
150
|
-
// 0... AZGTAZGTAZ 20.20.20.20.20.20.20.20.20.20
|
|
151
|
-
// Sequence uses: . for deletion, lowercase for insertion, Z for modification
|
|
233
|
+
const lines = tsv.trimEnd().split('\n');
|
|
234
|
+
const sorted = [lines[0], ...lines.slice(1).sort()].join('\n');
|
|
235
|
+
console.log(sorted);
|
|
152
236
|
```
|
|
237
|
+
<!-- TEST CODE: END seqTable -->
|
|
238
|
+
|
|
239
|
+
The output is a TSV with three columns: `read_id`, `sequence`, and `qualities`.
|
|
240
|
+
Sequence uses: `.` for deletion, lowercase for insertion, `Z` for modification.
|
|
241
|
+
|
|
242
|
+
<!-- TEST OUTPUT: START seqTable -->
|
|
243
|
+
```text
|
|
244
|
+
read_id sequence qualities
|
|
245
|
+
0.dc09ae0d-6b6e-4cb2-b092-078f251a778e AZGTAZGTAZ 20.20.20.20.20.20.20.20.20.20
|
|
246
|
+
1.cb098e1d-26d6-4e14-b979-b089e492c068 ACGTACGTAC 30.30.30.30.30.30.30.30.30.30
|
|
247
|
+
```
|
|
248
|
+
<!-- TEST OUTPUT: END seqTable -->
|
|
153
249
|
|
|
154
250
|
### simulateModBam
|
|
155
251
|
|
|
156
252
|
Generate synthetic BAM files with defined modification patterns (useful for testing).
|
|
157
253
|
|
|
254
|
+
<!-- TEST CODE: NOOUTPUT simulateModBam -->
|
|
158
255
|
```typescript
|
|
159
256
|
import { simulateModBam } from '@nanalogue/node';
|
|
160
257
|
|
|
@@ -179,6 +276,7 @@ await simulateModBam({
|
|
|
179
276
|
fastaPath: 'output.fasta'
|
|
180
277
|
});
|
|
181
278
|
```
|
|
279
|
+
<!-- TEST CODE: END simulateModBam -->
|
|
182
280
|
|
|
183
281
|
## TypeScript Support
|
|
184
282
|
|
|
@@ -190,6 +288,61 @@ to enforce constraints at compile time (e.g., `fullRegion` can only be set when
|
|
|
190
288
|
import type { ReadOptions, BamModRecord, ReadInfoRecord } from '@nanalogue/node';
|
|
191
289
|
```
|
|
192
290
|
|
|
291
|
+
## Pagination
|
|
292
|
+
|
|
293
|
+
All query functions (`readInfo`, `bamMods`, `windowReads`, `seqTable`) support pagination
|
|
294
|
+
via `limit` and `offset` parameters. Pagination is applied after filtering, using lazy
|
|
295
|
+
`.skip(offset).take(limit)` on the BAM record iterator, so only the requested records
|
|
296
|
+
are processed.
|
|
297
|
+
|
|
298
|
+
<!-- TEST CODE: NOOUTPUT pagination_readInfo -->
|
|
299
|
+
```typescript
|
|
300
|
+
import { readInfo } from '@nanalogue/node';
|
|
301
|
+
|
|
302
|
+
// Get the first 10 reads
|
|
303
|
+
const page1 = await readInfo({
|
|
304
|
+
bamPath: 'tests/data/examples/example_1.bam',
|
|
305
|
+
limit: 10,
|
|
306
|
+
offset: 0
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// Get the next 10 reads
|
|
310
|
+
const page2 = await readInfo({
|
|
311
|
+
bamPath: 'tests/data/examples/example_1.bam',
|
|
312
|
+
limit: 10,
|
|
313
|
+
offset: 10
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
<!-- TEST CODE: END pagination_readInfo -->
|
|
317
|
+
|
|
318
|
+
When combining pagination with `sampleFraction`, use `sampleSeed` to ensure
|
|
319
|
+
deterministic sampling across pages. Without a seed, each call may sample
|
|
320
|
+
different reads, making pagination unstable.
|
|
321
|
+
|
|
322
|
+
<!-- TEST CODE: NOOUTPUT pagination_bamMods -->
|
|
323
|
+
```typescript
|
|
324
|
+
import { bamMods } from '@nanalogue/node';
|
|
325
|
+
|
|
326
|
+
// Deterministic 50% subsample, paginated
|
|
327
|
+
const page1 = await bamMods({
|
|
328
|
+
bamPath: 'tests/data/examples/example_1.bam',
|
|
329
|
+
sampleFraction: 0.5,
|
|
330
|
+
sampleSeed: 42,
|
|
331
|
+
limit: 10,
|
|
332
|
+
offset: 0
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Same seed ensures consistent ordering across pages
|
|
336
|
+
const page2 = await bamMods({
|
|
337
|
+
bamPath: 'tests/data/examples/example_1.bam',
|
|
338
|
+
sampleFraction: 0.5,
|
|
339
|
+
sampleSeed: 42,
|
|
340
|
+
limit: 10,
|
|
341
|
+
offset: 10
|
|
342
|
+
});
|
|
343
|
+
```
|
|
344
|
+
<!-- TEST CODE: END pagination_bamMods -->
|
|
345
|
+
|
|
193
346
|
## Filtering Options
|
|
194
347
|
|
|
195
348
|
All read functions support extensive filtering:
|
|
@@ -206,6 +359,7 @@ All read functions support extensive filtering:
|
|
|
206
359
|
| `mapqFilter` | Minimum mapping quality |
|
|
207
360
|
| `excludeMapqUnavail` | Exclude reads without mapping quality |
|
|
208
361
|
| `sampleFraction` | Subsample reads (0.0 to 1.0) |
|
|
362
|
+
| `sampleSeed` | Seed for deterministic sampling (for reproducible subsampling) |
|
|
209
363
|
| `threads` | Number of threads for BAM reading |
|
|
210
364
|
| `tag` | Filter by modification type |
|
|
211
365
|
| `modStrand` | Filter by modification strand ("bc" or "bc_comp") |
|
|
@@ -214,6 +368,8 @@ All read functions support extensive filtering:
|
|
|
214
368
|
| `trimReadEndsMod` | Trim modification info from read ends |
|
|
215
369
|
| `baseQualFilterMod` | Base quality filter for modifications |
|
|
216
370
|
| `modRegion` | Genomic region for modification filtering |
|
|
371
|
+
| `limit` | Maximum number of records to return (must be > 0) |
|
|
372
|
+
| `offset` | Number of records to skip before returning results (default: 0) |
|
|
217
373
|
|
|
218
374
|
## Further Documentation
|
|
219
375
|
|
|
@@ -237,6 +393,23 @@ While in 0.x.y versions:
|
|
|
237
393
|
|
|
238
394
|
After 1.0.0, we will guarantee backwards compatibility in minor/patch releases.
|
|
239
395
|
|
|
396
|
+
## README Example Testing
|
|
397
|
+
|
|
398
|
+
Code examples in this README are automatically tested by `tests/readme-examples.test.ts`.
|
|
399
|
+
HTML comment markers identify which code blocks to test and what output to expect.
|
|
400
|
+
|
|
401
|
+
The following marker types are used (shown without angle brackets to avoid parser interference;
|
|
402
|
+
in practice, wrap each marker in standard HTML comment delimiters i.e. `<` + `!--` ... `--` + `>`):
|
|
403
|
+
|
|
404
|
+
- `!-- TEST CODE: START my_example --` / `!-- TEST CODE: END my_example --` wraps a testable code block.
|
|
405
|
+
- `!-- TEST OUTPUT: START my_example --` / `!-- TEST OUTPUT: END my_example --` wraps the expected stdout.
|
|
406
|
+
- `!-- TEST CODE: NOOUTPUT my_example --` / `!-- TEST CODE: END my_example --` wraps code that is executed
|
|
407
|
+
but has no expected output (e.g. it just verifies the code runs without error).
|
|
408
|
+
|
|
409
|
+
The marker name (e.g. `my_example` above) is a plain identifier that links a code block
|
|
410
|
+
to its output block. Each tested code block must include `console.log()` calls that produce
|
|
411
|
+
exactly the text shown in the corresponding output block.
|
|
412
|
+
|
|
240
413
|
## License
|
|
241
414
|
|
|
242
415
|
MIT License - see [LICENSE](LICENSE) for details.
|
package/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export interface MappedReadInfo {
|
|
|
24
24
|
alignment_length: number;
|
|
25
25
|
alignment_type: 'primary_forward' | 'primary_reverse' | 'secondary_forward' | 'secondary_reverse' | 'supplementary_forward' | 'supplementary_reverse';
|
|
26
26
|
mod_count: string;
|
|
27
|
+
mapq: number;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export interface UnmappedReadInfo {
|
|
@@ -31,6 +32,7 @@ export interface UnmappedReadInfo {
|
|
|
31
32
|
sequence_length: number;
|
|
32
33
|
alignment_type: 'unmapped';
|
|
33
34
|
mod_count: string;
|
|
35
|
+
mapq: number;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
export type ReadInfoRecord = MappedReadInfo | UnmappedReadInfo;
|
|
@@ -146,6 +148,7 @@ export interface MappedBamModRecord {
|
|
|
146
148
|
mod_table: ModTableEntry[];
|
|
147
149
|
read_id: string;
|
|
148
150
|
seq_len: number;
|
|
151
|
+
mapq: number;
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
export interface UnmappedBamModRecord {
|
|
@@ -153,12 +156,43 @@ export interface UnmappedBamModRecord {
|
|
|
153
156
|
mod_table: ModTableEntry[];
|
|
154
157
|
read_id: string;
|
|
155
158
|
seq_len: number;
|
|
159
|
+
mapq: number;
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
export type BamModRecord = MappedBamModRecord | UnmappedBamModRecord;
|
|
159
163
|
|
|
160
164
|
export declare function bamMods(options: ReadOptions): Promise<BamModRecord[]>;
|
|
161
165
|
|
|
166
|
+
// Window output types
|
|
167
|
+
export interface WindowModTableEntry {
|
|
168
|
+
base: string;
|
|
169
|
+
is_strand_plus: boolean;
|
|
170
|
+
mod_code: string;
|
|
171
|
+
data: [number, number, number, number, number, number][];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface MappedWindowReadEntry {
|
|
175
|
+
alignment_type: 'primary_forward' | 'primary_reverse' | 'secondary_forward' | 'secondary_reverse' | 'supplementary_forward' | 'supplementary_reverse';
|
|
176
|
+
alignment: {
|
|
177
|
+
start: number;
|
|
178
|
+
end: number;
|
|
179
|
+
contig: string;
|
|
180
|
+
contig_id: number;
|
|
181
|
+
};
|
|
182
|
+
mod_table: WindowModTableEntry[];
|
|
183
|
+
read_id: string;
|
|
184
|
+
seq_len: number;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface UnmappedWindowReadEntry {
|
|
188
|
+
alignment_type: 'unmapped';
|
|
189
|
+
mod_table: WindowModTableEntry[];
|
|
190
|
+
read_id: string;
|
|
191
|
+
seq_len: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export type WindowReadEntry = MappedWindowReadEntry | UnmappedWindowReadEntry;
|
|
195
|
+
|
|
162
196
|
// Base options shared by WindowOptions (excluding region/fullRegion)
|
|
163
197
|
interface BaseWindowOptionsCore {
|
|
164
198
|
/** Path to the BAM file (local path or URL). */
|
|
@@ -246,6 +280,6 @@ interface WindowOptionsWithoutRegion extends BaseWindowOptionsCore {
|
|
|
246
280
|
*/
|
|
247
281
|
export type WindowOptions = WindowOptionsWithRegion | WindowOptionsWithoutRegion;
|
|
248
282
|
|
|
249
|
-
export declare function windowReads(options: WindowOptions): Promise<
|
|
283
|
+
export declare function windowReads(options: WindowOptions): Promise<WindowReadEntry[]>;
|
|
250
284
|
|
|
251
285
|
export declare function seqTable(options: ReadOptions): Promise<string>;
|
package/index.js
CHANGED
|
@@ -253,48 +253,51 @@ switch (platform) {
|
|
|
253
253
|
}
|
|
254
254
|
break
|
|
255
255
|
case 'riscv64':
|
|
256
|
+
if (isMusl()) {
|
|
257
|
+
throw new Error(`Unsupported architecture on Linux musl: ${arch}`)
|
|
258
|
+
}
|
|
259
|
+
localFileExisted = existsSync(
|
|
260
|
+
join(__dirname, 'nanalogue.linux-riscv64-gnu.node')
|
|
261
|
+
)
|
|
262
|
+
try {
|
|
263
|
+
if (localFileExisted) {
|
|
264
|
+
nativeBinding = require('./nanalogue.linux-riscv64-gnu.node')
|
|
265
|
+
} else {
|
|
266
|
+
nativeBinding = require('@nanalogue/node-linux-riscv64-gnu')
|
|
267
|
+
}
|
|
268
|
+
} catch (e) {
|
|
269
|
+
loadError = e
|
|
270
|
+
}
|
|
271
|
+
break
|
|
272
|
+
case 'ppc64':
|
|
256
273
|
if (isMusl()) {
|
|
257
274
|
localFileExisted = existsSync(
|
|
258
|
-
join(__dirname, 'nanalogue.linux-
|
|
275
|
+
join(__dirname, 'nanalogue.linux-ppc64-musl.node')
|
|
259
276
|
)
|
|
260
277
|
try {
|
|
261
278
|
if (localFileExisted) {
|
|
262
|
-
nativeBinding = require('./nanalogue.linux-
|
|
279
|
+
nativeBinding = require('./nanalogue.linux-ppc64-musl.node')
|
|
263
280
|
} else {
|
|
264
|
-
nativeBinding = require('@nanalogue/node-linux-
|
|
281
|
+
nativeBinding = require('@nanalogue/node-linux-ppc64-musl')
|
|
265
282
|
}
|
|
266
283
|
} catch (e) {
|
|
267
284
|
loadError = e
|
|
268
285
|
}
|
|
269
286
|
} else {
|
|
270
287
|
localFileExisted = existsSync(
|
|
271
|
-
join(__dirname, 'nanalogue.linux-
|
|
288
|
+
join(__dirname, 'nanalogue.linux-ppc64-gnu.node')
|
|
272
289
|
)
|
|
273
290
|
try {
|
|
274
291
|
if (localFileExisted) {
|
|
275
|
-
nativeBinding = require('./nanalogue.linux-
|
|
292
|
+
nativeBinding = require('./nanalogue.linux-ppc64-gnu.node')
|
|
276
293
|
} else {
|
|
277
|
-
nativeBinding = require('@nanalogue/node-linux-
|
|
294
|
+
nativeBinding = require('@nanalogue/node-linux-ppc64-gnu')
|
|
278
295
|
}
|
|
279
296
|
} catch (e) {
|
|
280
297
|
loadError = e
|
|
281
298
|
}
|
|
282
299
|
}
|
|
283
300
|
break
|
|
284
|
-
case 's390x':
|
|
285
|
-
localFileExisted = existsSync(
|
|
286
|
-
join(__dirname, 'nanalogue.linux-s390x-gnu.node')
|
|
287
|
-
)
|
|
288
|
-
try {
|
|
289
|
-
if (localFileExisted) {
|
|
290
|
-
nativeBinding = require('./nanalogue.linux-s390x-gnu.node')
|
|
291
|
-
} else {
|
|
292
|
-
nativeBinding = require('@nanalogue/node-linux-s390x-gnu')
|
|
293
|
-
}
|
|
294
|
-
} catch (e) {
|
|
295
|
-
loadError = e
|
|
296
|
-
}
|
|
297
|
-
break
|
|
298
301
|
default:
|
|
299
302
|
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
300
303
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanalogue/node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Node.js bindings for Nanalogue: single-molecule BAM/Mod-BAM analysis",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"index.js",
|
|
9
|
-
"index.d.ts"
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"README.md"
|
|
10
11
|
],
|
|
11
12
|
"napi": {
|
|
12
13
|
"binaryName": "nanalogue",
|
|
@@ -16,7 +17,12 @@
|
|
|
16
17
|
"x86_64-unknown-linux-gnu",
|
|
17
18
|
"x86_64-unknown-linux-musl",
|
|
18
19
|
"aarch64-unknown-linux-gnu",
|
|
19
|
-
"aarch64-unknown-linux-musl"
|
|
20
|
+
"aarch64-unknown-linux-musl",
|
|
21
|
+
"armv7-unknown-linux-gnueabihf",
|
|
22
|
+
"armv7-unknown-linux-musleabihf",
|
|
23
|
+
"riscv64gc-unknown-linux-gnu",
|
|
24
|
+
"powerpc64le-unknown-linux-gnu",
|
|
25
|
+
"powerpc64le-unknown-linux-musl"
|
|
20
26
|
]
|
|
21
27
|
},
|
|
22
28
|
"engines": {
|
|
@@ -30,6 +36,7 @@
|
|
|
30
36
|
"lint": "biome check .",
|
|
31
37
|
"lint:fix": "biome check --write .",
|
|
32
38
|
"format": "biome format --write .",
|
|
39
|
+
"prepare": "git config core.hooksPath .githooks || true",
|
|
33
40
|
"prepublishOnly": "napi pre-publish --npm-dir npm --no-gh-release"
|
|
34
41
|
},
|
|
35
42
|
"devDependencies": {
|
|
@@ -57,11 +64,16 @@
|
|
|
57
64
|
},
|
|
58
65
|
"author": "Sathish Thiyagarajan <mail@unintegrable.com>",
|
|
59
66
|
"optionalDependencies": {
|
|
60
|
-
"@nanalogue/node-darwin-x64": "0.
|
|
61
|
-
"@nanalogue/node-darwin-arm64": "0.
|
|
62
|
-
"@nanalogue/node-linux-x64-gnu": "0.
|
|
63
|
-
"@nanalogue/node-linux-x64-musl": "0.
|
|
64
|
-
"@nanalogue/node-linux-arm64-gnu": "0.
|
|
65
|
-
"@nanalogue/node-linux-arm64-musl": "0.
|
|
67
|
+
"@nanalogue/node-darwin-x64": "0.2.0",
|
|
68
|
+
"@nanalogue/node-darwin-arm64": "0.2.0",
|
|
69
|
+
"@nanalogue/node-linux-x64-gnu": "0.2.0",
|
|
70
|
+
"@nanalogue/node-linux-x64-musl": "0.2.0",
|
|
71
|
+
"@nanalogue/node-linux-arm64-gnu": "0.2.0",
|
|
72
|
+
"@nanalogue/node-linux-arm64-musl": "0.2.0",
|
|
73
|
+
"@nanalogue/node-linux-arm-gnueabihf": "0.2.0",
|
|
74
|
+
"@nanalogue/node-linux-arm-musleabihf": "0.2.0",
|
|
75
|
+
"@nanalogue/node-linux-riscv64-gnu": "0.2.0",
|
|
76
|
+
"@nanalogue/node-linux-ppc64-gnu": "0.2.0",
|
|
77
|
+
"@nanalogue/node-linux-ppc64-musl": "0.2.0"
|
|
66
78
|
}
|
|
67
79
|
}
|