@fishka/seqio 0.8.2 → 0.8.4
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/index.d.mts +266 -18
- package/dist/index.d.ts +266 -18
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -184,25 +184,273 @@ declare function formatQual(records: QualRecord | readonly QualRecord[], options
|
|
|
184
184
|
*/
|
|
185
185
|
declare function hasUsableQuality(qualities?: readonly number[]): boolean;
|
|
186
186
|
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*/
|
|
187
|
+
/** A half-open character range in the decoded GenBank source. Lines and columns are one-based. */
|
|
188
|
+
interface GenbankSourceSpan {
|
|
189
|
+
/** Zero-based inclusive character offset. */
|
|
190
|
+
start: number;
|
|
191
|
+
/** Zero-based exclusive character offset. */
|
|
192
|
+
end: number;
|
|
193
|
+
/** One-based starting source line. */
|
|
194
|
+
startLine: number;
|
|
195
|
+
/** One-based starting source column. */
|
|
196
|
+
startColumn: number;
|
|
197
|
+
/** One-based ending source line. */
|
|
198
|
+
endLine: number;
|
|
199
|
+
/** One-based ending source column. */
|
|
200
|
+
endColumn: number;
|
|
201
|
+
}
|
|
202
|
+
type GenbankDiagnosticSeverity = 'warning' | 'error';
|
|
203
|
+
/** A recoverable problem found while reading a GenBank flat file. */
|
|
204
|
+
interface GenbankDiagnostic {
|
|
205
|
+
/** Stable machine-readable diagnostic code. */
|
|
206
|
+
code: string;
|
|
207
|
+
/** Diagnostic severity. */
|
|
208
|
+
severity: GenbankDiagnosticSeverity;
|
|
209
|
+
/** Human-readable diagnostic message. */
|
|
210
|
+
message: string;
|
|
211
|
+
/** Source location associated with the diagnostic. */
|
|
212
|
+
span: GenbankSourceSpan;
|
|
213
|
+
/** Zero-based record index when the diagnostic belongs to a parsed record. */
|
|
214
|
+
recordIndex?: number;
|
|
215
|
+
/** Zero-based feature index when the diagnostic belongs to a feature. */
|
|
216
|
+
featureIndex?: number;
|
|
217
|
+
}
|
|
218
|
+
type GenbankTopology = 'linear' | 'circular' | 'unknown';
|
|
219
|
+
/** Parsed fields from a LOCUS line. Raw tokens remain available when the line is non-canonical. */
|
|
220
|
+
interface GenbankLocus {
|
|
221
|
+
/** LOCUS identifier. */
|
|
222
|
+
name: string;
|
|
223
|
+
/** Declared sequence length. */
|
|
224
|
+
length?: number;
|
|
225
|
+
/** Declared length unit, usually bp or aa. */
|
|
226
|
+
unit?: string;
|
|
227
|
+
/** Declared strandedness token. */
|
|
228
|
+
strandedness?: string;
|
|
229
|
+
/** Declared molecule type. */
|
|
230
|
+
moleculeType?: string;
|
|
231
|
+
/** Declared molecule topology. */
|
|
232
|
+
topology: GenbankTopology;
|
|
233
|
+
/** Three-letter GenBank division code. */
|
|
234
|
+
division?: string;
|
|
235
|
+
/** LOCUS update date token. */
|
|
236
|
+
date?: string;
|
|
237
|
+
/** All whitespace-separated LOCUS tokens. */
|
|
238
|
+
tokens: string[];
|
|
239
|
+
/** Source span of the complete LOCUS line. */
|
|
240
|
+
span: GenbankSourceSpan;
|
|
241
|
+
}
|
|
242
|
+
/** A top-level flat-file section, retained even when the parser does not interpret its semantics. */
|
|
243
|
+
interface GenbankSection {
|
|
244
|
+
/** Normalized top-level section key. */
|
|
245
|
+
key: string;
|
|
246
|
+
/** Continuation lines joined into a normalized value. */
|
|
247
|
+
value: string;
|
|
248
|
+
/** Original section text. */
|
|
249
|
+
raw: string;
|
|
250
|
+
/** Source span of the section. */
|
|
251
|
+
span: GenbankSourceSpan;
|
|
252
|
+
}
|
|
253
|
+
/** SOURCE/ORGANISM information. */
|
|
254
|
+
interface GenbankSource {
|
|
255
|
+
/** Free-form SOURCE description. */
|
|
256
|
+
description: string;
|
|
257
|
+
/** Scientific organism name from ORGANISM. */
|
|
258
|
+
organism?: string;
|
|
259
|
+
/** Semicolon-separated taxonomy lineage. */
|
|
260
|
+
taxonomy: string[];
|
|
261
|
+
/** Source span covering SOURCE or ORGANISM. */
|
|
262
|
+
span?: GenbankSourceSpan;
|
|
263
|
+
}
|
|
264
|
+
/** One REFERENCE block. */
|
|
265
|
+
interface GenbankReference {
|
|
266
|
+
/** Numeric REFERENCE identifier. */
|
|
267
|
+
number?: number;
|
|
268
|
+
/** Referenced sequence range. */
|
|
269
|
+
range?: string;
|
|
270
|
+
/** AUTHORS field. */
|
|
271
|
+
authors?: string;
|
|
272
|
+
/** CONSRTM field. */
|
|
273
|
+
consortium?: string;
|
|
274
|
+
/** TITLE field. */
|
|
275
|
+
title?: string;
|
|
276
|
+
/** JOURNAL field. */
|
|
277
|
+
journal?: string;
|
|
278
|
+
/** PUBMED identifier. */
|
|
279
|
+
pubmed?: string;
|
|
280
|
+
/** REMARK field. */
|
|
281
|
+
remark?: string;
|
|
282
|
+
/** All reference subfields, including unknown ones. */
|
|
283
|
+
fields: Readonly<Record<string, string>>;
|
|
284
|
+
/** Source span of the reference block. */
|
|
285
|
+
span: GenbankSourceSpan;
|
|
286
|
+
}
|
|
287
|
+
type GenbankPositionKind = 'exact' | 'before' | 'after' | 'within' | 'one-of' | 'unknown';
|
|
288
|
+
/** A one-based INSDC feature-table position. */
|
|
289
|
+
interface GenbankPosition {
|
|
290
|
+
/** Position uncertainty kind. */
|
|
291
|
+
kind: GenbankPositionKind;
|
|
292
|
+
/** Single numeric position when applicable. */
|
|
293
|
+
value?: number;
|
|
294
|
+
/** Numeric alternatives or within-range values. */
|
|
295
|
+
values?: number[];
|
|
296
|
+
/** Original position expression. */
|
|
297
|
+
raw: string;
|
|
298
|
+
}
|
|
299
|
+
interface GenbankPointLocation {
|
|
300
|
+
/** Location node discriminator. */
|
|
301
|
+
kind: 'point';
|
|
302
|
+
/** Single position. */
|
|
303
|
+
position: GenbankPosition;
|
|
304
|
+
/** Original location expression. */
|
|
305
|
+
raw: string;
|
|
306
|
+
}
|
|
307
|
+
interface GenbankRangeLocation {
|
|
308
|
+
/** Location node discriminator. */
|
|
309
|
+
kind: 'range';
|
|
310
|
+
/** First position. */
|
|
311
|
+
start: GenbankPosition;
|
|
312
|
+
/** Last position. */
|
|
313
|
+
end: GenbankPosition;
|
|
314
|
+
/** Original location expression. */
|
|
315
|
+
raw: string;
|
|
316
|
+
}
|
|
317
|
+
interface GenbankBetweenLocation {
|
|
318
|
+
/** Location node discriminator. */
|
|
319
|
+
kind: 'between';
|
|
320
|
+
/** Position before the caret. */
|
|
321
|
+
left: GenbankPosition;
|
|
322
|
+
/** Position after the caret. */
|
|
323
|
+
right: GenbankPosition;
|
|
324
|
+
/** Original location expression. */
|
|
325
|
+
raw: string;
|
|
326
|
+
}
|
|
327
|
+
interface GenbankRemoteLocation {
|
|
328
|
+
/** Location node discriminator. */
|
|
329
|
+
kind: 'remote';
|
|
330
|
+
/** Remote accession identifier. */
|
|
331
|
+
accession: string;
|
|
332
|
+
/** Location within the remote accession. */
|
|
333
|
+
location: GenbankLocation;
|
|
334
|
+
/** Original location expression. */
|
|
335
|
+
raw: string;
|
|
336
|
+
}
|
|
337
|
+
interface GenbankOperatorLocation {
|
|
338
|
+
/** Location node discriminator. */
|
|
339
|
+
kind: 'operator';
|
|
340
|
+
/** Operator name, such as join or complement. */
|
|
341
|
+
operator: string;
|
|
342
|
+
/** Child location nodes. */
|
|
343
|
+
parts: GenbankLocation[];
|
|
344
|
+
/** Original location expression. */
|
|
345
|
+
raw: string;
|
|
346
|
+
}
|
|
347
|
+
interface GenbankUnparsedLocation {
|
|
348
|
+
/** Location node discriminator. */
|
|
349
|
+
kind: 'unparsed';
|
|
350
|
+
/** Original unsupported or malformed expression. */
|
|
351
|
+
raw: string;
|
|
352
|
+
}
|
|
353
|
+
type GenbankLocation = GenbankPointLocation | GenbankRangeLocation | GenbankBetweenLocation | GenbankRemoteLocation | GenbankOperatorLocation | GenbankUnparsedLocation;
|
|
354
|
+
/** A `/name[=value]` feature qualifier. Repeated names remain repeated and ordered. */
|
|
355
|
+
interface GenbankQualifier {
|
|
356
|
+
/** Qualifier name without the leading slash. */
|
|
357
|
+
name: string;
|
|
358
|
+
/** Decoded qualifier value. */
|
|
359
|
+
value?: string;
|
|
360
|
+
/** Original value text, including quotes when present. */
|
|
361
|
+
rawValue?: string;
|
|
362
|
+
/** Whether the value used GenBank double-quote syntax. */
|
|
363
|
+
quoted: boolean;
|
|
364
|
+
/** Whether a quoted value had a closing quote. */
|
|
365
|
+
terminated: boolean;
|
|
366
|
+
/** Source span of the complete qualifier. */
|
|
367
|
+
span: GenbankSourceSpan;
|
|
368
|
+
}
|
|
369
|
+
/** One feature-table entry. */
|
|
370
|
+
interface GenbankFeature {
|
|
371
|
+
/** Feature key, such as CDS or gene. */
|
|
372
|
+
key: string;
|
|
373
|
+
/** Original concatenated location expression. */
|
|
374
|
+
locationText: string;
|
|
375
|
+
/** Parsed location AST. */
|
|
376
|
+
location: GenbankLocation;
|
|
377
|
+
/** Ordered feature qualifiers. */
|
|
378
|
+
qualifiers: GenbankQualifier[];
|
|
379
|
+
/** Source span of the complete feature. */
|
|
380
|
+
span: GenbankSourceSpan;
|
|
381
|
+
/** Source span of the location expression. */
|
|
382
|
+
locationSpan: GenbankSourceSpan;
|
|
383
|
+
}
|
|
384
|
+
/** A complete read-only view of one GenBank/GenPept flat-file record. */
|
|
385
|
+
interface GenbankDocument {
|
|
386
|
+
/** Stable record identifier. */
|
|
387
|
+
id: string;
|
|
388
|
+
/** Parsed LOCUS fields. */
|
|
389
|
+
locus: GenbankLocus;
|
|
390
|
+
/** DEFINITION text. */
|
|
391
|
+
definition?: string;
|
|
392
|
+
/** ACCESSION identifiers. */
|
|
393
|
+
accessions: string[];
|
|
394
|
+
/** VERSION accession.version token. */
|
|
395
|
+
version?: string;
|
|
396
|
+
/** Legacy GI identifier. */
|
|
397
|
+
gi?: string;
|
|
398
|
+
/** KEYWORDS split on semicolons. */
|
|
399
|
+
keywords: string[];
|
|
400
|
+
/** DBLINK cross-references. */
|
|
401
|
+
dbLinks: string[];
|
|
402
|
+
/** SOURCE and ORGANISM metadata. */
|
|
403
|
+
sourceInfo?: GenbankSource;
|
|
404
|
+
/** Parsed literature references. */
|
|
405
|
+
references: GenbankReference[];
|
|
406
|
+
/** COMMENT sections. */
|
|
407
|
+
comments: string[];
|
|
408
|
+
/** Parsed feature table. */
|
|
409
|
+
features: GenbankFeature[];
|
|
410
|
+
/** Sequence from ORIGIN, with layout removed. */
|
|
411
|
+
sequence: string;
|
|
412
|
+
/** CONTIG expression when present. */
|
|
413
|
+
contig?: string;
|
|
414
|
+
/** BASE COUNT values keyed by residue. */
|
|
415
|
+
baseCount?: Readonly<Record<string, number>>;
|
|
416
|
+
/** Retained top-level sections. */
|
|
417
|
+
sections: GenbankSection[];
|
|
418
|
+
/** Absolute span in the original input text. */
|
|
419
|
+
span: GenbankSourceSpan;
|
|
420
|
+
/** Whether the record ended with an explicit // terminator. */
|
|
421
|
+
terminated: boolean;
|
|
422
|
+
/** The original text belonging only to this record, including its // terminator when present. */
|
|
423
|
+
originalText: string;
|
|
424
|
+
/** Diagnostics attached to this record. */
|
|
425
|
+
diagnostics: GenbankDiagnostic[];
|
|
426
|
+
}
|
|
427
|
+
/** Backward-compatible alias for code that called one parsed record a GenBank record. */
|
|
428
|
+
type GenbankRecord = GenbankDocument;
|
|
429
|
+
/** Select expensive or optional parts of the detailed parser. Every part is enabled by default. */
|
|
430
|
+
interface GenbankDocumentParseOptions {
|
|
431
|
+
/** Parse the feature table. */
|
|
432
|
+
features?: boolean;
|
|
433
|
+
/** Parse REFERENCE blocks. */
|
|
434
|
+
references?: boolean;
|
|
435
|
+
/** Parse and normalize ORIGIN sequence. */
|
|
436
|
+
sequence?: boolean;
|
|
437
|
+
/** Retain generic top-level sections. */
|
|
438
|
+
sections?: boolean;
|
|
439
|
+
}
|
|
204
440
|
|
|
441
|
+
/** GenBank / GenPept flat-file readers. */
|
|
442
|
+
|
|
443
|
+
/** Extract every sequence through the lightweight path without parsing annotations. */
|
|
205
444
|
declare function parseGenbank(input: string | Uint8Array): SeqRecord[];
|
|
445
|
+
/** Parse every concatenated GenBank/GenPept record into its own document object. */
|
|
446
|
+
declare function parseGenbankDocument(input: string | Uint8Array, options?: GenbankDocumentParseOptions): GenbankDocument[];
|
|
447
|
+
|
|
448
|
+
interface LocationParseResult {
|
|
449
|
+
location: GenbankLocation;
|
|
450
|
+
complete: boolean;
|
|
451
|
+
}
|
|
452
|
+
/** Parse an INSDC feature location while retaining unrecognized input as an unparsed node. */
|
|
453
|
+
declare function parseGenbankLocation(source: string): LocationParseResult;
|
|
206
454
|
|
|
207
455
|
/**
|
|
208
456
|
* GFA (Graphical Fragment Assembly, `.gfa`) reader — sequence extraction.
|
|
@@ -393,4 +641,4 @@ declare function parseSam(input: string | Uint8Array): SeqRecord[];
|
|
|
393
641
|
|
|
394
642
|
declare function parseScf(input: string | Uint8Array): SeqRecord[];
|
|
395
643
|
|
|
396
|
-
export { type FastaRecord, type FastqRecord, MAX_PHRED, type QualRecord, type SeqFileFormat, type SeqRecord, type WrapOptions, detectFormat, formatFasta, formatFastq, formatQual, hasUsableQuality, makeSeqRecord, parseAce, parseBam, parseClustal, parseEmbl, parseFasta, parseFastq, parseGenbank, parseGfa, parseGff, parseMega, parseMsf, parseNexus, parsePdb, parsePhylip, parsePir, parseSam, parseScf, parseStockholm, parseSwissprot };
|
|
644
|
+
export { type FastaRecord, type FastqRecord, type GenbankBetweenLocation, type GenbankDiagnostic, type GenbankDiagnosticSeverity, type GenbankDocument, type GenbankDocumentParseOptions, type GenbankFeature, type GenbankLocation, type GenbankLocus, type GenbankOperatorLocation, type GenbankPointLocation, type GenbankPosition, type GenbankPositionKind, type GenbankQualifier, type GenbankRangeLocation, type GenbankRecord, type GenbankReference, type GenbankRemoteLocation, type GenbankSection, type GenbankSource, type GenbankSourceSpan, type GenbankTopology, type GenbankUnparsedLocation, type LocationParseResult, MAX_PHRED, type QualRecord, type SeqFileFormat, type SeqRecord, type WrapOptions, detectFormat, formatFasta, formatFastq, formatQual, hasUsableQuality, makeSeqRecord, parseAce, parseBam, parseClustal, parseEmbl, parseFasta, parseFastq, parseGenbank, parseGenbankDocument, parseGenbankLocation, parseGfa, parseGff, parseMega, parseMsf, parseNexus, parsePdb, parsePhylip, parsePir, parseSam, parseScf, parseStockholm, parseSwissprot };
|
package/dist/index.d.ts
CHANGED
|
@@ -184,25 +184,273 @@ declare function formatQual(records: QualRecord | readonly QualRecord[], options
|
|
|
184
184
|
*/
|
|
185
185
|
declare function hasUsableQuality(qualities?: readonly number[]): boolean;
|
|
186
186
|
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*/
|
|
187
|
+
/** A half-open character range in the decoded GenBank source. Lines and columns are one-based. */
|
|
188
|
+
interface GenbankSourceSpan {
|
|
189
|
+
/** Zero-based inclusive character offset. */
|
|
190
|
+
start: number;
|
|
191
|
+
/** Zero-based exclusive character offset. */
|
|
192
|
+
end: number;
|
|
193
|
+
/** One-based starting source line. */
|
|
194
|
+
startLine: number;
|
|
195
|
+
/** One-based starting source column. */
|
|
196
|
+
startColumn: number;
|
|
197
|
+
/** One-based ending source line. */
|
|
198
|
+
endLine: number;
|
|
199
|
+
/** One-based ending source column. */
|
|
200
|
+
endColumn: number;
|
|
201
|
+
}
|
|
202
|
+
type GenbankDiagnosticSeverity = 'warning' | 'error';
|
|
203
|
+
/** A recoverable problem found while reading a GenBank flat file. */
|
|
204
|
+
interface GenbankDiagnostic {
|
|
205
|
+
/** Stable machine-readable diagnostic code. */
|
|
206
|
+
code: string;
|
|
207
|
+
/** Diagnostic severity. */
|
|
208
|
+
severity: GenbankDiagnosticSeverity;
|
|
209
|
+
/** Human-readable diagnostic message. */
|
|
210
|
+
message: string;
|
|
211
|
+
/** Source location associated with the diagnostic. */
|
|
212
|
+
span: GenbankSourceSpan;
|
|
213
|
+
/** Zero-based record index when the diagnostic belongs to a parsed record. */
|
|
214
|
+
recordIndex?: number;
|
|
215
|
+
/** Zero-based feature index when the diagnostic belongs to a feature. */
|
|
216
|
+
featureIndex?: number;
|
|
217
|
+
}
|
|
218
|
+
type GenbankTopology = 'linear' | 'circular' | 'unknown';
|
|
219
|
+
/** Parsed fields from a LOCUS line. Raw tokens remain available when the line is non-canonical. */
|
|
220
|
+
interface GenbankLocus {
|
|
221
|
+
/** LOCUS identifier. */
|
|
222
|
+
name: string;
|
|
223
|
+
/** Declared sequence length. */
|
|
224
|
+
length?: number;
|
|
225
|
+
/** Declared length unit, usually bp or aa. */
|
|
226
|
+
unit?: string;
|
|
227
|
+
/** Declared strandedness token. */
|
|
228
|
+
strandedness?: string;
|
|
229
|
+
/** Declared molecule type. */
|
|
230
|
+
moleculeType?: string;
|
|
231
|
+
/** Declared molecule topology. */
|
|
232
|
+
topology: GenbankTopology;
|
|
233
|
+
/** Three-letter GenBank division code. */
|
|
234
|
+
division?: string;
|
|
235
|
+
/** LOCUS update date token. */
|
|
236
|
+
date?: string;
|
|
237
|
+
/** All whitespace-separated LOCUS tokens. */
|
|
238
|
+
tokens: string[];
|
|
239
|
+
/** Source span of the complete LOCUS line. */
|
|
240
|
+
span: GenbankSourceSpan;
|
|
241
|
+
}
|
|
242
|
+
/** A top-level flat-file section, retained even when the parser does not interpret its semantics. */
|
|
243
|
+
interface GenbankSection {
|
|
244
|
+
/** Normalized top-level section key. */
|
|
245
|
+
key: string;
|
|
246
|
+
/** Continuation lines joined into a normalized value. */
|
|
247
|
+
value: string;
|
|
248
|
+
/** Original section text. */
|
|
249
|
+
raw: string;
|
|
250
|
+
/** Source span of the section. */
|
|
251
|
+
span: GenbankSourceSpan;
|
|
252
|
+
}
|
|
253
|
+
/** SOURCE/ORGANISM information. */
|
|
254
|
+
interface GenbankSource {
|
|
255
|
+
/** Free-form SOURCE description. */
|
|
256
|
+
description: string;
|
|
257
|
+
/** Scientific organism name from ORGANISM. */
|
|
258
|
+
organism?: string;
|
|
259
|
+
/** Semicolon-separated taxonomy lineage. */
|
|
260
|
+
taxonomy: string[];
|
|
261
|
+
/** Source span covering SOURCE or ORGANISM. */
|
|
262
|
+
span?: GenbankSourceSpan;
|
|
263
|
+
}
|
|
264
|
+
/** One REFERENCE block. */
|
|
265
|
+
interface GenbankReference {
|
|
266
|
+
/** Numeric REFERENCE identifier. */
|
|
267
|
+
number?: number;
|
|
268
|
+
/** Referenced sequence range. */
|
|
269
|
+
range?: string;
|
|
270
|
+
/** AUTHORS field. */
|
|
271
|
+
authors?: string;
|
|
272
|
+
/** CONSRTM field. */
|
|
273
|
+
consortium?: string;
|
|
274
|
+
/** TITLE field. */
|
|
275
|
+
title?: string;
|
|
276
|
+
/** JOURNAL field. */
|
|
277
|
+
journal?: string;
|
|
278
|
+
/** PUBMED identifier. */
|
|
279
|
+
pubmed?: string;
|
|
280
|
+
/** REMARK field. */
|
|
281
|
+
remark?: string;
|
|
282
|
+
/** All reference subfields, including unknown ones. */
|
|
283
|
+
fields: Readonly<Record<string, string>>;
|
|
284
|
+
/** Source span of the reference block. */
|
|
285
|
+
span: GenbankSourceSpan;
|
|
286
|
+
}
|
|
287
|
+
type GenbankPositionKind = 'exact' | 'before' | 'after' | 'within' | 'one-of' | 'unknown';
|
|
288
|
+
/** A one-based INSDC feature-table position. */
|
|
289
|
+
interface GenbankPosition {
|
|
290
|
+
/** Position uncertainty kind. */
|
|
291
|
+
kind: GenbankPositionKind;
|
|
292
|
+
/** Single numeric position when applicable. */
|
|
293
|
+
value?: number;
|
|
294
|
+
/** Numeric alternatives or within-range values. */
|
|
295
|
+
values?: number[];
|
|
296
|
+
/** Original position expression. */
|
|
297
|
+
raw: string;
|
|
298
|
+
}
|
|
299
|
+
interface GenbankPointLocation {
|
|
300
|
+
/** Location node discriminator. */
|
|
301
|
+
kind: 'point';
|
|
302
|
+
/** Single position. */
|
|
303
|
+
position: GenbankPosition;
|
|
304
|
+
/** Original location expression. */
|
|
305
|
+
raw: string;
|
|
306
|
+
}
|
|
307
|
+
interface GenbankRangeLocation {
|
|
308
|
+
/** Location node discriminator. */
|
|
309
|
+
kind: 'range';
|
|
310
|
+
/** First position. */
|
|
311
|
+
start: GenbankPosition;
|
|
312
|
+
/** Last position. */
|
|
313
|
+
end: GenbankPosition;
|
|
314
|
+
/** Original location expression. */
|
|
315
|
+
raw: string;
|
|
316
|
+
}
|
|
317
|
+
interface GenbankBetweenLocation {
|
|
318
|
+
/** Location node discriminator. */
|
|
319
|
+
kind: 'between';
|
|
320
|
+
/** Position before the caret. */
|
|
321
|
+
left: GenbankPosition;
|
|
322
|
+
/** Position after the caret. */
|
|
323
|
+
right: GenbankPosition;
|
|
324
|
+
/** Original location expression. */
|
|
325
|
+
raw: string;
|
|
326
|
+
}
|
|
327
|
+
interface GenbankRemoteLocation {
|
|
328
|
+
/** Location node discriminator. */
|
|
329
|
+
kind: 'remote';
|
|
330
|
+
/** Remote accession identifier. */
|
|
331
|
+
accession: string;
|
|
332
|
+
/** Location within the remote accession. */
|
|
333
|
+
location: GenbankLocation;
|
|
334
|
+
/** Original location expression. */
|
|
335
|
+
raw: string;
|
|
336
|
+
}
|
|
337
|
+
interface GenbankOperatorLocation {
|
|
338
|
+
/** Location node discriminator. */
|
|
339
|
+
kind: 'operator';
|
|
340
|
+
/** Operator name, such as join or complement. */
|
|
341
|
+
operator: string;
|
|
342
|
+
/** Child location nodes. */
|
|
343
|
+
parts: GenbankLocation[];
|
|
344
|
+
/** Original location expression. */
|
|
345
|
+
raw: string;
|
|
346
|
+
}
|
|
347
|
+
interface GenbankUnparsedLocation {
|
|
348
|
+
/** Location node discriminator. */
|
|
349
|
+
kind: 'unparsed';
|
|
350
|
+
/** Original unsupported or malformed expression. */
|
|
351
|
+
raw: string;
|
|
352
|
+
}
|
|
353
|
+
type GenbankLocation = GenbankPointLocation | GenbankRangeLocation | GenbankBetweenLocation | GenbankRemoteLocation | GenbankOperatorLocation | GenbankUnparsedLocation;
|
|
354
|
+
/** A `/name[=value]` feature qualifier. Repeated names remain repeated and ordered. */
|
|
355
|
+
interface GenbankQualifier {
|
|
356
|
+
/** Qualifier name without the leading slash. */
|
|
357
|
+
name: string;
|
|
358
|
+
/** Decoded qualifier value. */
|
|
359
|
+
value?: string;
|
|
360
|
+
/** Original value text, including quotes when present. */
|
|
361
|
+
rawValue?: string;
|
|
362
|
+
/** Whether the value used GenBank double-quote syntax. */
|
|
363
|
+
quoted: boolean;
|
|
364
|
+
/** Whether a quoted value had a closing quote. */
|
|
365
|
+
terminated: boolean;
|
|
366
|
+
/** Source span of the complete qualifier. */
|
|
367
|
+
span: GenbankSourceSpan;
|
|
368
|
+
}
|
|
369
|
+
/** One feature-table entry. */
|
|
370
|
+
interface GenbankFeature {
|
|
371
|
+
/** Feature key, such as CDS or gene. */
|
|
372
|
+
key: string;
|
|
373
|
+
/** Original concatenated location expression. */
|
|
374
|
+
locationText: string;
|
|
375
|
+
/** Parsed location AST. */
|
|
376
|
+
location: GenbankLocation;
|
|
377
|
+
/** Ordered feature qualifiers. */
|
|
378
|
+
qualifiers: GenbankQualifier[];
|
|
379
|
+
/** Source span of the complete feature. */
|
|
380
|
+
span: GenbankSourceSpan;
|
|
381
|
+
/** Source span of the location expression. */
|
|
382
|
+
locationSpan: GenbankSourceSpan;
|
|
383
|
+
}
|
|
384
|
+
/** A complete read-only view of one GenBank/GenPept flat-file record. */
|
|
385
|
+
interface GenbankDocument {
|
|
386
|
+
/** Stable record identifier. */
|
|
387
|
+
id: string;
|
|
388
|
+
/** Parsed LOCUS fields. */
|
|
389
|
+
locus: GenbankLocus;
|
|
390
|
+
/** DEFINITION text. */
|
|
391
|
+
definition?: string;
|
|
392
|
+
/** ACCESSION identifiers. */
|
|
393
|
+
accessions: string[];
|
|
394
|
+
/** VERSION accession.version token. */
|
|
395
|
+
version?: string;
|
|
396
|
+
/** Legacy GI identifier. */
|
|
397
|
+
gi?: string;
|
|
398
|
+
/** KEYWORDS split on semicolons. */
|
|
399
|
+
keywords: string[];
|
|
400
|
+
/** DBLINK cross-references. */
|
|
401
|
+
dbLinks: string[];
|
|
402
|
+
/** SOURCE and ORGANISM metadata. */
|
|
403
|
+
sourceInfo?: GenbankSource;
|
|
404
|
+
/** Parsed literature references. */
|
|
405
|
+
references: GenbankReference[];
|
|
406
|
+
/** COMMENT sections. */
|
|
407
|
+
comments: string[];
|
|
408
|
+
/** Parsed feature table. */
|
|
409
|
+
features: GenbankFeature[];
|
|
410
|
+
/** Sequence from ORIGIN, with layout removed. */
|
|
411
|
+
sequence: string;
|
|
412
|
+
/** CONTIG expression when present. */
|
|
413
|
+
contig?: string;
|
|
414
|
+
/** BASE COUNT values keyed by residue. */
|
|
415
|
+
baseCount?: Readonly<Record<string, number>>;
|
|
416
|
+
/** Retained top-level sections. */
|
|
417
|
+
sections: GenbankSection[];
|
|
418
|
+
/** Absolute span in the original input text. */
|
|
419
|
+
span: GenbankSourceSpan;
|
|
420
|
+
/** Whether the record ended with an explicit // terminator. */
|
|
421
|
+
terminated: boolean;
|
|
422
|
+
/** The original text belonging only to this record, including its // terminator when present. */
|
|
423
|
+
originalText: string;
|
|
424
|
+
/** Diagnostics attached to this record. */
|
|
425
|
+
diagnostics: GenbankDiagnostic[];
|
|
426
|
+
}
|
|
427
|
+
/** Backward-compatible alias for code that called one parsed record a GenBank record. */
|
|
428
|
+
type GenbankRecord = GenbankDocument;
|
|
429
|
+
/** Select expensive or optional parts of the detailed parser. Every part is enabled by default. */
|
|
430
|
+
interface GenbankDocumentParseOptions {
|
|
431
|
+
/** Parse the feature table. */
|
|
432
|
+
features?: boolean;
|
|
433
|
+
/** Parse REFERENCE blocks. */
|
|
434
|
+
references?: boolean;
|
|
435
|
+
/** Parse and normalize ORIGIN sequence. */
|
|
436
|
+
sequence?: boolean;
|
|
437
|
+
/** Retain generic top-level sections. */
|
|
438
|
+
sections?: boolean;
|
|
439
|
+
}
|
|
204
440
|
|
|
441
|
+
/** GenBank / GenPept flat-file readers. */
|
|
442
|
+
|
|
443
|
+
/** Extract every sequence through the lightweight path without parsing annotations. */
|
|
205
444
|
declare function parseGenbank(input: string | Uint8Array): SeqRecord[];
|
|
445
|
+
/** Parse every concatenated GenBank/GenPept record into its own document object. */
|
|
446
|
+
declare function parseGenbankDocument(input: string | Uint8Array, options?: GenbankDocumentParseOptions): GenbankDocument[];
|
|
447
|
+
|
|
448
|
+
interface LocationParseResult {
|
|
449
|
+
location: GenbankLocation;
|
|
450
|
+
complete: boolean;
|
|
451
|
+
}
|
|
452
|
+
/** Parse an INSDC feature location while retaining unrecognized input as an unparsed node. */
|
|
453
|
+
declare function parseGenbankLocation(source: string): LocationParseResult;
|
|
206
454
|
|
|
207
455
|
/**
|
|
208
456
|
* GFA (Graphical Fragment Assembly, `.gfa`) reader — sequence extraction.
|
|
@@ -393,4 +641,4 @@ declare function parseSam(input: string | Uint8Array): SeqRecord[];
|
|
|
393
641
|
|
|
394
642
|
declare function parseScf(input: string | Uint8Array): SeqRecord[];
|
|
395
643
|
|
|
396
|
-
export { type FastaRecord, type FastqRecord, MAX_PHRED, type QualRecord, type SeqFileFormat, type SeqRecord, type WrapOptions, detectFormat, formatFasta, formatFastq, formatQual, hasUsableQuality, makeSeqRecord, parseAce, parseBam, parseClustal, parseEmbl, parseFasta, parseFastq, parseGenbank, parseGfa, parseGff, parseMega, parseMsf, parseNexus, parsePdb, parsePhylip, parsePir, parseSam, parseScf, parseStockholm, parseSwissprot };
|
|
644
|
+
export { type FastaRecord, type FastqRecord, type GenbankBetweenLocation, type GenbankDiagnostic, type GenbankDiagnosticSeverity, type GenbankDocument, type GenbankDocumentParseOptions, type GenbankFeature, type GenbankLocation, type GenbankLocus, type GenbankOperatorLocation, type GenbankPointLocation, type GenbankPosition, type GenbankPositionKind, type GenbankQualifier, type GenbankRangeLocation, type GenbankRecord, type GenbankReference, type GenbankRemoteLocation, type GenbankSection, type GenbankSource, type GenbankSourceSpan, type GenbankTopology, type GenbankUnparsedLocation, type LocationParseResult, MAX_PHRED, type QualRecord, type SeqFileFormat, type SeqRecord, type WrapOptions, detectFormat, formatFasta, formatFastq, formatQual, hasUsableQuality, makeSeqRecord, parseAce, parseBam, parseClustal, parseEmbl, parseFasta, parseFastq, parseGenbank, parseGenbankDocument, parseGenbankLocation, parseGfa, parseGff, parseMega, parseMsf, parseNexus, parsePdb, parsePhylip, parsePir, parseSam, parseScf, parseStockholm, parseSwissprot };
|