gff-nostream 1.3.9 → 2.0.1
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/api.d.ts +33 -2
- package/dist/api.js +91 -3
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/parse.d.ts +3 -16
- package/dist/parse.js +80 -124
- package/dist/parse.js.map +1 -1
- package/dist/util.d.ts +17 -0
- package/dist/util.js +160 -59
- package/dist/util.js.map +1 -1
- package/esm/api.d.ts +33 -2
- package/esm/api.js +87 -2
- package/esm/api.js.map +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/parse.d.ts +3 -16
- package/esm/parse.js +103 -142
- package/esm/parse.js.map +1 -1
- package/esm/util.d.ts +17 -0
- package/esm/util.js +148 -58
- package/esm/util.js.map +1 -1
- package/package.json +27 -16
- package/src/api.ts +113 -12
- package/src/index.ts +6 -5
- package/src/parse.ts +80 -146
- package/src/util.ts +165 -62
package/esm/parse.js
CHANGED
|
@@ -1,57 +1,34 @@
|
|
|
1
|
-
import * as GFF3 from
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
constructor(seqCallback) {
|
|
8
|
-
this.seqCallback = seqCallback;
|
|
9
|
-
this.currentSequence = undefined;
|
|
10
|
-
}
|
|
11
|
-
addLine(line) {
|
|
12
|
-
const defMatch = /^>\s*(\S+)\s*(.*)/.exec(line);
|
|
13
|
-
if (defMatch) {
|
|
14
|
-
this._flush();
|
|
15
|
-
this.currentSequence = { id: defMatch[1], sequence: '' };
|
|
16
|
-
if (defMatch[2]) {
|
|
17
|
-
this.currentSequence.description = defMatch[2].trim();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
else if (this.currentSequence && /\S/.test(line)) {
|
|
21
|
-
this.currentSequence.sequence += line.replaceAll(/\s/g, '');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
_flush() {
|
|
25
|
-
if (this.currentSequence) {
|
|
26
|
-
this.seqCallback(this.currentSequence);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
finish() {
|
|
30
|
-
this._flush();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
import * as GFF3 from "./util.js";
|
|
2
|
+
const featureLineRegex = /^\s*[^#\s>]/;
|
|
3
|
+
const commentOrDirectiveRegex = /^\s*(#+)(.*)/;
|
|
4
|
+
const blankLineRegex = /^\s*$/;
|
|
5
|
+
const fastaStartRegex = /^\s*>/;
|
|
6
|
+
const lineEndingRegex = /\r?\n?$/g;
|
|
33
7
|
export default class Parser {
|
|
8
|
+
featureCallback;
|
|
9
|
+
endCallback;
|
|
10
|
+
commentCallback;
|
|
11
|
+
errorCallback;
|
|
12
|
+
disableDerivesFromReferences;
|
|
13
|
+
directiveCallback;
|
|
14
|
+
bufferSize;
|
|
15
|
+
eof = false;
|
|
16
|
+
lineNumber = 0;
|
|
17
|
+
// features that we have to keep on hand for now because they
|
|
18
|
+
// might be referenced by something else
|
|
19
|
+
_underConstructionTopLevel = [];
|
|
20
|
+
// index of the above by ID
|
|
21
|
+
_underConstructionById = {};
|
|
22
|
+
_completedReferences = {};
|
|
23
|
+
// features that reference something we have not seen yet
|
|
24
|
+
// structured as:
|
|
25
|
+
// { 'some_id' : {
|
|
26
|
+
// 'Parent' : [ orphans that have a Parent attr referencing it ],
|
|
27
|
+
// 'Derives_from' : [ orphans that have a Derives_from attr referencing it ],
|
|
28
|
+
// }
|
|
29
|
+
// }
|
|
30
|
+
_underConstructionOrphans = {};
|
|
34
31
|
constructor(args) {
|
|
35
|
-
this.fastaParser = undefined;
|
|
36
|
-
// if this is true, the parser ignores the
|
|
37
|
-
// rest of the lines in the file. currently
|
|
38
|
-
// set when the file switches over to FASTA
|
|
39
|
-
this.eof = false;
|
|
40
|
-
this.lineNumber = 0;
|
|
41
|
-
// features that we have to keep on hand for now because they
|
|
42
|
-
// might be referenced by something else
|
|
43
|
-
this._underConstructionTopLevel = [];
|
|
44
|
-
// index of the above by ID
|
|
45
|
-
this._underConstructionById = {};
|
|
46
|
-
this._completedReferences = {};
|
|
47
|
-
// features that reference something we have not seen yet
|
|
48
|
-
// structured as:
|
|
49
|
-
// { 'some_id' : {
|
|
50
|
-
// 'Parent' : [ orphans that have a Parent attr referencing it ],
|
|
51
|
-
// 'Derives_from' : [ orphans that have a Derives_from attr referencing it ],
|
|
52
|
-
// }
|
|
53
|
-
// }
|
|
54
|
-
this._underConstructionOrphans = {};
|
|
55
32
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
56
33
|
const nullFunc = () => { };
|
|
57
34
|
this.featureCallback = args.featureCallback || nullFunc;
|
|
@@ -59,29 +36,22 @@ export default class Parser {
|
|
|
59
36
|
this.commentCallback = args.commentCallback || nullFunc;
|
|
60
37
|
this.errorCallback = args.errorCallback || nullFunc;
|
|
61
38
|
this.directiveCallback = args.directiveCallback || nullFunc;
|
|
62
|
-
this.sequenceCallback = args.sequenceCallback || nullFunc;
|
|
63
39
|
this.disableDerivesFromReferences =
|
|
64
40
|
args.disableDerivesFromReferences || false;
|
|
65
41
|
// number of lines to buffer
|
|
66
42
|
this.bufferSize = args.bufferSize === undefined ? Infinity : args.bufferSize;
|
|
67
43
|
}
|
|
68
44
|
addLine(line) {
|
|
69
|
-
// if we have transitioned to a fasta section, just delegate to that parser
|
|
70
|
-
if (this.fastaParser) {
|
|
71
|
-
this.fastaParser.addLine(line);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
45
|
if (this.eof) {
|
|
75
|
-
// otherwise, if we are done, ignore this line
|
|
76
46
|
return;
|
|
77
47
|
}
|
|
78
48
|
this.lineNumber += 1;
|
|
79
|
-
if (
|
|
49
|
+
if (featureLineRegex.test(line)) {
|
|
80
50
|
// feature line, most common case
|
|
81
51
|
this._bufferLine(line);
|
|
82
52
|
return;
|
|
83
53
|
}
|
|
84
|
-
const match =
|
|
54
|
+
const match = commentOrDirectiveRegex.exec(line);
|
|
85
55
|
if (match) {
|
|
86
56
|
// directive or comment
|
|
87
57
|
const [, hashsigns] = match;
|
|
@@ -96,7 +66,6 @@ export default class Parser {
|
|
|
96
66
|
if (directive.directive === 'FASTA') {
|
|
97
67
|
this._emitAllUnderConstructionFeatures();
|
|
98
68
|
this.eof = true;
|
|
99
|
-
this.fastaParser = new FASTAParser(this.sequenceCallback);
|
|
100
69
|
}
|
|
101
70
|
else {
|
|
102
71
|
this._emitItem(directive);
|
|
@@ -104,31 +73,32 @@ export default class Parser {
|
|
|
104
73
|
}
|
|
105
74
|
}
|
|
106
75
|
else {
|
|
107
|
-
|
|
108
|
-
this._emitItem({ comment: contents });
|
|
76
|
+
this._emitItem({ comment: contents.trimStart() });
|
|
109
77
|
}
|
|
110
78
|
}
|
|
111
|
-
else if (
|
|
79
|
+
else if (blankLineRegex.test(line)) {
|
|
112
80
|
// blank line, do nothing
|
|
113
81
|
}
|
|
114
|
-
else if (
|
|
115
|
-
// implicit beginning of a FASTA section
|
|
82
|
+
else if (fastaStartRegex.test(line)) {
|
|
83
|
+
// implicit beginning of a FASTA section, stop parsing
|
|
116
84
|
this._emitAllUnderConstructionFeatures();
|
|
117
85
|
this.eof = true;
|
|
118
|
-
this.fastaParser = new FASTAParser(this.sequenceCallback);
|
|
119
|
-
this.fastaParser.addLine(line);
|
|
120
86
|
}
|
|
121
87
|
else {
|
|
122
88
|
// it's a parse error
|
|
123
|
-
const errLine = line.replaceAll(
|
|
89
|
+
const errLine = line.replaceAll(lineEndingRegex, '');
|
|
124
90
|
throw new Error(`GFF3 parse error. Cannot parse '${errLine}'.`);
|
|
125
91
|
}
|
|
126
92
|
}
|
|
93
|
+
addParsedFeatureLine(featureLine) {
|
|
94
|
+
if (this.eof) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
this.lineNumber += 1;
|
|
98
|
+
this._bufferParsedLine(featureLine);
|
|
99
|
+
}
|
|
127
100
|
finish() {
|
|
128
101
|
this._emitAllUnderConstructionFeatures();
|
|
129
|
-
if (this.fastaParser) {
|
|
130
|
-
this.fastaParser.finish();
|
|
131
|
-
}
|
|
132
102
|
this.endCallback();
|
|
133
103
|
}
|
|
134
104
|
_emitItem(i) {
|
|
@@ -144,19 +114,24 @@ export default class Parser {
|
|
|
144
114
|
}
|
|
145
115
|
_enforceBufferSizeLimit(additionalItemCount = 0) {
|
|
146
116
|
const _unbufferItem = (item) => {
|
|
147
|
-
|
|
148
|
-
if (item && Array.isArray(item) && ((_b = (_a = item[0].attributes) === null || _a === void 0 ? void 0 : _a.ID) === null || _b === void 0 ? void 0 : _b[0])) {
|
|
117
|
+
if (item && Array.isArray(item) && item[0].attributes?.ID?.[0]) {
|
|
149
118
|
const ids = item[0].attributes.ID;
|
|
150
119
|
ids.forEach(id => {
|
|
151
120
|
delete this._underConstructionById[id];
|
|
152
121
|
delete this._completedReferences[id];
|
|
153
122
|
});
|
|
154
123
|
item.forEach(i => {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
155
125
|
if (i.child_features) {
|
|
156
|
-
i.child_features.forEach(c =>
|
|
126
|
+
i.child_features.forEach(c => {
|
|
127
|
+
_unbufferItem(c);
|
|
128
|
+
});
|
|
157
129
|
}
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
158
131
|
if (i.derived_features) {
|
|
159
|
-
i.derived_features.forEach(d =>
|
|
132
|
+
i.derived_features.forEach(d => {
|
|
133
|
+
_unbufferItem(d);
|
|
134
|
+
});
|
|
160
135
|
}
|
|
161
136
|
});
|
|
162
137
|
}
|
|
@@ -181,29 +156,24 @@ export default class Parser {
|
|
|
181
156
|
this._completedReferences = {};
|
|
182
157
|
// if we have any orphans hanging around still, this is a
|
|
183
158
|
// problem. die with a parse error
|
|
184
|
-
|
|
185
|
-
|
|
159
|
+
const orphanKeys = Object.keys(this._underConstructionOrphans);
|
|
160
|
+
if (orphanKeys.length) {
|
|
161
|
+
throw new Error(`some features reference other features that do not exist in the file (or in the same '###' scope). ${orphanKeys.join(',')}`);
|
|
186
162
|
}
|
|
187
163
|
}
|
|
188
|
-
// do the right thing with a newly-parsed feature line
|
|
189
164
|
_bufferLine(line) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// NOTE: a feature is an arrayref of one or more feature lines.
|
|
199
|
-
const ids = ((_a = featureLine.attributes) === null || _a === void 0 ? void 0 : _a.ID) || [];
|
|
200
|
-
const parents = ((_b = featureLine.attributes) === null || _b === void 0 ? void 0 : _b.Parent) || [];
|
|
165
|
+
this._bufferParsedLine(GFF3.parseFeature(line));
|
|
166
|
+
}
|
|
167
|
+
_bufferParsedLine(rawFeatureLine) {
|
|
168
|
+
const featureLine = rawFeatureLine;
|
|
169
|
+
featureLine.child_features = [];
|
|
170
|
+
featureLine.derived_features = [];
|
|
171
|
+
const ids = featureLine.attributes?.ID || [];
|
|
172
|
+
const parents = featureLine.attributes?.Parent || [];
|
|
201
173
|
const derives = this.disableDerivesFromReferences
|
|
202
174
|
? []
|
|
203
|
-
:
|
|
175
|
+
: featureLine.attributes?.Derives_from || [];
|
|
204
176
|
if (!ids.length && !parents.length && !derives.length) {
|
|
205
|
-
// if it has no IDs and does not refer to anything, we can just
|
|
206
|
-
// output it
|
|
207
177
|
this._emitItem([featureLine]);
|
|
208
178
|
return;
|
|
209
179
|
}
|
|
@@ -211,7 +181,6 @@ export default class Parser {
|
|
|
211
181
|
ids.forEach(id => {
|
|
212
182
|
const existing = this._underConstructionById[id];
|
|
213
183
|
if (existing) {
|
|
214
|
-
// another location of the same feature
|
|
215
184
|
if (existing[existing.length - 1].type !== featureLine.type) {
|
|
216
185
|
this._parseError(`multi-line feature "${id}" has inconsistent types: "${featureLine.type}", "${existing[existing.length - 1].type}"`);
|
|
217
186
|
}
|
|
@@ -219,37 +188,28 @@ export default class Parser {
|
|
|
219
188
|
feature = existing;
|
|
220
189
|
}
|
|
221
190
|
else {
|
|
222
|
-
// haven't seen it yet, so buffer it so we can attach
|
|
223
|
-
// child features to it
|
|
224
191
|
feature = [featureLine];
|
|
225
192
|
this._enforceBufferSizeLimit(1);
|
|
226
193
|
if (!parents.length && !derives.length) {
|
|
227
194
|
this._underConstructionTopLevel.push(feature);
|
|
228
195
|
}
|
|
229
196
|
this._underConstructionById[id] = feature;
|
|
230
|
-
// see if we have anything buffered that refers to it
|
|
231
197
|
this._resolveReferencesTo(feature, id);
|
|
232
198
|
}
|
|
233
199
|
});
|
|
234
|
-
|
|
235
|
-
|
|
200
|
+
this._resolveReferencesFrom(
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
202
|
+
feature || [featureLine], { Parent: parents, Derives_from: derives }, ids);
|
|
236
203
|
}
|
|
237
204
|
_resolveReferencesTo(feature, id) {
|
|
238
205
|
const references = this._underConstructionOrphans[id];
|
|
239
|
-
// references is of the form
|
|
240
|
-
// {
|
|
241
|
-
// 'Parent' : [ orphans that have a Parent attr referencing this feature ],
|
|
242
|
-
// 'Derives_from' : [ orphans that have a Derives_from attr referencing this feature ],
|
|
243
|
-
// }
|
|
244
206
|
if (!references) {
|
|
245
207
|
return;
|
|
246
208
|
}
|
|
247
|
-
|
|
209
|
+
for (const loc of feature) {
|
|
248
210
|
loc.child_features.push(...references.Parent);
|
|
249
|
-
});
|
|
250
|
-
feature.forEach(loc => {
|
|
251
211
|
loc.derived_features.push(...references.Derives_from);
|
|
252
|
-
}
|
|
212
|
+
}
|
|
253
213
|
delete this._underConstructionOrphans[id];
|
|
254
214
|
}
|
|
255
215
|
_parseError(message) {
|
|
@@ -257,61 +217,62 @@ export default class Parser {
|
|
|
257
217
|
this.errorCallback(`${this.lineNumber}: ${message}`);
|
|
258
218
|
}
|
|
259
219
|
_resolveReferencesFrom(feature, references, ids) {
|
|
260
|
-
|
|
261
|
-
function postSet(obj, slot1, slot2) {
|
|
262
|
-
let subObj = obj[slot1];
|
|
263
|
-
if (!subObj) {
|
|
264
|
-
subObj = {};
|
|
265
|
-
obj[slot1] = subObj;
|
|
266
|
-
}
|
|
267
|
-
const returnVal = subObj[slot2] || false;
|
|
268
|
-
subObj[slot2] = true;
|
|
269
|
-
return returnVal;
|
|
270
|
-
}
|
|
271
|
-
references.Parent.forEach(toId => {
|
|
220
|
+
for (const toId of references.Parent) {
|
|
272
221
|
const otherFeature = this._underConstructionById[toId];
|
|
273
222
|
if (otherFeature) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
223
|
+
let dominated = false;
|
|
224
|
+
for (const id of ids) {
|
|
225
|
+
const domKey = `Parent,${toId}`;
|
|
226
|
+
const rec = this._completedReferences[id] ||
|
|
227
|
+
(this._completedReferences[id] = {});
|
|
228
|
+
if (rec[domKey]) {
|
|
229
|
+
dominated = true;
|
|
230
|
+
}
|
|
231
|
+
rec[domKey] = true;
|
|
232
|
+
}
|
|
233
|
+
if (!dominated) {
|
|
234
|
+
for (const location of otherFeature) {
|
|
235
|
+
location.child_features.push(feature);
|
|
236
|
+
}
|
|
279
237
|
}
|
|
280
238
|
}
|
|
281
239
|
else {
|
|
282
240
|
let ref = this._underConstructionOrphans[toId];
|
|
283
241
|
if (!ref) {
|
|
284
|
-
ref = {
|
|
285
|
-
Parent: [],
|
|
286
|
-
Derives_from: [],
|
|
287
|
-
};
|
|
242
|
+
ref = { Parent: [], Derives_from: [] };
|
|
288
243
|
this._underConstructionOrphans[toId] = ref;
|
|
289
244
|
}
|
|
290
245
|
ref.Parent.push(feature);
|
|
291
246
|
}
|
|
292
|
-
}
|
|
293
|
-
references.Derives_from
|
|
247
|
+
}
|
|
248
|
+
for (const toId of references.Derives_from) {
|
|
294
249
|
const otherFeature = this._underConstructionById[toId];
|
|
295
250
|
if (otherFeature) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
251
|
+
let dominated = false;
|
|
252
|
+
for (const id of ids) {
|
|
253
|
+
const domKey = `Derives_from,${toId}`;
|
|
254
|
+
const rec = this._completedReferences[id] ||
|
|
255
|
+
(this._completedReferences[id] = {});
|
|
256
|
+
if (rec[domKey]) {
|
|
257
|
+
dominated = true;
|
|
258
|
+
}
|
|
259
|
+
rec[domKey] = true;
|
|
260
|
+
}
|
|
261
|
+
if (!dominated) {
|
|
262
|
+
for (const location of otherFeature) {
|
|
263
|
+
location.derived_features.push(feature);
|
|
264
|
+
}
|
|
301
265
|
}
|
|
302
266
|
}
|
|
303
267
|
else {
|
|
304
268
|
let ref = this._underConstructionOrphans[toId];
|
|
305
269
|
if (!ref) {
|
|
306
|
-
ref = {
|
|
307
|
-
Parent: [],
|
|
308
|
-
Derives_from: [],
|
|
309
|
-
};
|
|
270
|
+
ref = { Parent: [], Derives_from: [] };
|
|
310
271
|
this._underConstructionOrphans[toId] = ref;
|
|
311
272
|
}
|
|
312
273
|
ref.Derives_from.push(feature);
|
|
313
274
|
}
|
|
314
|
-
}
|
|
275
|
+
}
|
|
315
276
|
}
|
|
316
277
|
}
|
|
317
278
|
//# sourceMappingURL=parse.js.map
|
package/esm/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAA;AAE9B,MAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAE,gBAAyB;IACjC,YAAY,EAAE,kBAA2B;CAC1C,CAAA;AAED,MAAM,OAAO,WAAW;IAMtB,YAAY,WAAkD;QAC5D,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,eAAe,GAAG,SAAS,CAAA;IAClC,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,MAAM,QAAQ,GAAG,mBAA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I,CAAC,CAAA;YACtD,IAAI,YAAY,EAAE,CAAC;gBACjB,IAAI,SAAS,GAAG,KAAK,CAAA;gBACrB,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;oBACrB,MAAM,MAAM,GAAG,gBAAgB,IAAI,EAAE,CAAA;oBACrC,MAAM,GAAG,GACP,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;wBAC7B,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAA;oBACtC,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;wBAChB,SAAS,GAAG,IAAI,CAAA;oBAClB,CAAC;oBACD,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;gBACpB,CAAC;gBACD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE,CAAC;wBACpC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,IAAI,GAAG,GAAG,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAA;gBAC9C,IAAI,CAAC,GAAG,EAAE,CAAC;oBACT,GAAG,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;oBACtC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;gBAC5C,CAAC;gBACD,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/esm/util.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ export declare function escapeColumn(rawVal: string | number): string;
|
|
|
26
26
|
* @returns Parsed attributes
|
|
27
27
|
*/
|
|
28
28
|
export declare function parseAttributes(attrString: string): GFF3Attributes;
|
|
29
|
+
/**
|
|
30
|
+
* Parse the 9th column (attributes) of a GFF3 feature line without unescaping.
|
|
31
|
+
* Fast path for data known to contain no escaped characters.
|
|
32
|
+
*
|
|
33
|
+
* @param attrString - String of GFF3 9th column
|
|
34
|
+
* @returns Parsed attributes
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseAttributesNoUnescape(attrString: string): GFF3Attributes;
|
|
29
37
|
/**
|
|
30
38
|
* Parse a GFF3 feature line
|
|
31
39
|
*
|
|
@@ -33,6 +41,15 @@ export declare function parseAttributes(attrString: string): GFF3Attributes;
|
|
|
33
41
|
* @returns The parsed feature
|
|
34
42
|
*/
|
|
35
43
|
export declare function parseFeature(line: string): GFF3FeatureLine;
|
|
44
|
+
export declare function parseFieldsArray(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
45
|
+
/**
|
|
46
|
+
* Parse a GFF3 feature from a pre-split fields array without unescaping.
|
|
47
|
+
* Fast path for data known to contain no escaped characters.
|
|
48
|
+
*
|
|
49
|
+
* @param f - Array of 9 GFF3 column values (use null or '.' for empty values)
|
|
50
|
+
* @returns The parsed feature
|
|
51
|
+
*/
|
|
52
|
+
export declare function parseFieldsArrayNoUnescape(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
36
53
|
/**
|
|
37
54
|
* Parse a GFF3 directive line.
|
|
38
55
|
*
|