gff-nostream 1.3.7 → 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/dist/api.d.ts +23 -2
- package/dist/api.js +58 -3
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -0
- package/dist/parse.d.ts +3 -16
- package/dist/parse.js +78 -120
- package/dist/parse.js.map +1 -1
- package/dist/util.d.ts +1 -0
- package/dist/util.js +92 -59
- package/dist/util.js.map +1 -1
- package/esm/api.d.ts +23 -2
- package/esm/api.js +55 -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 +101 -138
- package/esm/parse.js.map +1 -1
- package/esm/util.d.ts +1 -0
- package/esm/util.js +82 -58
- package/esm/util.js.map +1 -1
- package/package.json +31 -20
- package/src/api.ts +77 -12
- package/src/index.ts +6 -5
- package/src/parse.ts +76 -141
- package/src/util.ts +91 -62
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { GFF3Feature } from './util';
|
|
1
|
+
import type { GFF3Feature } from './util.ts';
|
|
2
|
+
export interface LineRecord {
|
|
3
|
+
fields: string[];
|
|
4
|
+
lineHash?: string | number;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Synchronously parse a string containing GFF3 and return an array of the
|
|
4
8
|
* parsed items.
|
|
@@ -8,4 +12,21 @@ import { GFF3Feature } from './util';
|
|
|
8
12
|
* @returns array of parsed features, directives, comments and/or sequences
|
|
9
13
|
*/
|
|
10
14
|
export declare function parseStringSync(str: string): GFF3Feature[];
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Synchronously parse an array of strings containing GFF3 and return an array of the
|
|
17
|
+
* parsed items.
|
|
18
|
+
*
|
|
19
|
+
* @param arr - GFF3 array of strings
|
|
20
|
+
* @param inputOptions - Parsing options
|
|
21
|
+
* @returns array of parsed features, directives, comments and/or sequences
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseArraySync(arr: string[]): GFF3Feature[];
|
|
24
|
+
/**
|
|
25
|
+
* Synchronously parse an array of LineRecord objects containing pre-split GFF3
|
|
26
|
+
* fields and return an array of the parsed items.
|
|
27
|
+
*
|
|
28
|
+
* @param records - Array of LineRecord objects with fields array and optional lineHash
|
|
29
|
+
* @returns array of parsed features
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseRecordsSync(records: LineRecord[]): GFF3Feature[];
|
|
32
|
+
export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, } from './util.ts';
|
package/dist/api.js
CHANGED
|
@@ -4,7 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.parseStringSync = parseStringSync;
|
|
7
|
-
|
|
7
|
+
exports.parseArraySync = parseArraySync;
|
|
8
|
+
exports.parseRecordsSync = parseRecordsSync;
|
|
9
|
+
const parse_ts_1 = __importDefault(require("./parse.js"));
|
|
10
|
+
const util_ts_1 = require("./util.js");
|
|
8
11
|
/**
|
|
9
12
|
* Synchronously parse a string containing GFF3 and return an array of the
|
|
10
13
|
* parsed items.
|
|
@@ -15,11 +18,11 @@ const parse_1 = __importDefault(require("./parse"));
|
|
|
15
18
|
*/
|
|
16
19
|
function parseStringSync(str) {
|
|
17
20
|
const items = [];
|
|
18
|
-
const parser = new
|
|
21
|
+
const parser = new parse_ts_1.default({
|
|
19
22
|
featureCallback: arg => items.push(arg),
|
|
20
23
|
disableDerivesFromReferences: true,
|
|
21
24
|
errorCallback: err => {
|
|
22
|
-
throw err;
|
|
25
|
+
throw new Error(err);
|
|
23
26
|
},
|
|
24
27
|
});
|
|
25
28
|
for (const line of str.split(/\r?\n/)) {
|
|
@@ -28,4 +31,56 @@ function parseStringSync(str) {
|
|
|
28
31
|
parser.finish();
|
|
29
32
|
return items;
|
|
30
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Synchronously parse an array of strings containing GFF3 and return an array of the
|
|
36
|
+
* parsed items.
|
|
37
|
+
*
|
|
38
|
+
* @param arr - GFF3 array of strings
|
|
39
|
+
* @param inputOptions - Parsing options
|
|
40
|
+
* @returns array of parsed features, directives, comments and/or sequences
|
|
41
|
+
*/
|
|
42
|
+
function parseArraySync(arr) {
|
|
43
|
+
const items = [];
|
|
44
|
+
const parser = new parse_ts_1.default({
|
|
45
|
+
featureCallback: arg => items.push(arg),
|
|
46
|
+
disableDerivesFromReferences: true,
|
|
47
|
+
errorCallback: err => {
|
|
48
|
+
throw new Error(err);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
for (const line of arr) {
|
|
52
|
+
parser.addLine(line);
|
|
53
|
+
}
|
|
54
|
+
parser.finish();
|
|
55
|
+
return items;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Synchronously parse an array of LineRecord objects containing pre-split GFF3
|
|
59
|
+
* fields and return an array of the parsed items.
|
|
60
|
+
*
|
|
61
|
+
* @param records - Array of LineRecord objects with fields array and optional lineHash
|
|
62
|
+
* @returns array of parsed features
|
|
63
|
+
*/
|
|
64
|
+
function parseRecordsSync(records) {
|
|
65
|
+
const items = [];
|
|
66
|
+
const parser = new parse_ts_1.default({
|
|
67
|
+
featureCallback: arg => items.push(arg),
|
|
68
|
+
disableDerivesFromReferences: true,
|
|
69
|
+
errorCallback: err => {
|
|
70
|
+
throw new Error(err);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
for (const record of records) {
|
|
74
|
+
const featureLine = (0, util_ts_1.parseFieldsArray)(record.fields);
|
|
75
|
+
if (record.lineHash !== undefined) {
|
|
76
|
+
if (!featureLine.attributes) {
|
|
77
|
+
featureLine.attributes = {};
|
|
78
|
+
}
|
|
79
|
+
featureLine.attributes._lineHash = [String(record.lineHash)];
|
|
80
|
+
}
|
|
81
|
+
parser.addParsedFeatureLine(featureLine);
|
|
82
|
+
}
|
|
83
|
+
parser.finish();
|
|
84
|
+
return items;
|
|
85
|
+
}
|
|
31
86
|
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;AAkBA,0CAgBC;AAUD,wCAgBC;AASD,4CAuBC;AA5FD,0DAA+B;AAC/B,uCAA4C;AAS5C;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAkB,EAAE,CAAA;IAC/B,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC;QACxB,eAAe,EAAE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;QACvC,4BAA4B,EAAE,IAAI;QAClC,aAAa,EAAE,GAAG,CAAC,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;QACtB,CAAC;KACF,CAAC,CAAA;IAEF,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IACD,MAAM,CAAC,MAAM,EAAE,CAAA;IAEf,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,GAAa;IAC1C,MAAM,KAAK,GAAkB,EAAE,CAAA;IAC/B,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC;QACxB,eAAe,EAAE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,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ED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { parseStringSync } from './api';
|
|
2
|
-
export { parseStringSync };
|
|
3
|
-
export type { GFF3Comment, GFF3Feature,
|
|
1
|
+
import { parseArraySync, parseRecordsSync, parseStringSync } from './api.ts';
|
|
2
|
+
export { parseArraySync, parseRecordsSync, parseStringSync };
|
|
3
|
+
export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, LineRecord, } from './api.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseStringSync = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.parseStringSync = exports.parseRecordsSync = exports.parseArraySync = void 0;
|
|
4
|
+
const api_ts_1 = require("./api.js");
|
|
5
|
+
Object.defineProperty(exports, "parseArraySync", { enumerable: true, get: function () { return api_ts_1.parseArraySync; } });
|
|
6
|
+
Object.defineProperty(exports, "parseRecordsSync", { enumerable: true, get: function () { return api_ts_1.parseRecordsSync; } });
|
|
7
|
+
Object.defineProperty(exports, "parseStringSync", { enumerable: true, get: function () { return api_ts_1.parseStringSync; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAA4E;AACnE,+FADA,uBAAc,OACA;AAAE,iGADA,yBAAgB,OACA;AAAE,gGADA,wBAAe,OACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "commonjs"}
|
package/dist/parse.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import * as GFF3 from './util';
|
|
2
|
-
export declare class FASTAParser {
|
|
3
|
-
seqCallback: (sequence: GFF3.GFF3Sequence) => void;
|
|
4
|
-
currentSequence: {
|
|
5
|
-
id: string;
|
|
6
|
-
sequence: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
} | undefined;
|
|
9
|
-
constructor(seqCallback: (sequence: GFF3.GFF3Sequence) => void);
|
|
10
|
-
addLine(line: string): void;
|
|
11
|
-
private _flush;
|
|
12
|
-
finish(): void;
|
|
13
|
-
}
|
|
1
|
+
import * as GFF3 from './util.ts';
|
|
14
2
|
interface ParserArgs {
|
|
15
3
|
featureCallback?(feature: GFF3.GFF3Feature): void;
|
|
16
4
|
endCallback?(): void;
|
|
17
5
|
commentCallback?(comment: GFF3.GFF3Comment): void;
|
|
18
6
|
errorCallback?(error: string): void;
|
|
19
7
|
directiveCallback?(directive: GFF3.GFF3Directive): void;
|
|
20
|
-
sequenceCallback?(sequence: GFF3.GFF3Sequence): void;
|
|
21
8
|
bufferSize?: number;
|
|
22
9
|
disableDerivesFromReferences?: boolean;
|
|
23
10
|
}
|
|
@@ -28,9 +15,7 @@ export default class Parser {
|
|
|
28
15
|
errorCallback: (error: string) => void;
|
|
29
16
|
disableDerivesFromReferences: boolean;
|
|
30
17
|
directiveCallback: (directive: GFF3.GFF3Directive) => void;
|
|
31
|
-
sequenceCallback: (sequence: GFF3.GFF3Sequence) => void;
|
|
32
18
|
bufferSize: number;
|
|
33
|
-
fastaParser: FASTAParser | undefined;
|
|
34
19
|
eof: boolean;
|
|
35
20
|
lineNumber: number;
|
|
36
21
|
private _underConstructionTopLevel;
|
|
@@ -39,6 +24,7 @@ export default class Parser {
|
|
|
39
24
|
private _underConstructionOrphans;
|
|
40
25
|
constructor(args: ParserArgs);
|
|
41
26
|
addLine(line: string): void;
|
|
27
|
+
addParsedFeatureLine(featureLine: GFF3.GFF3FeatureLine): void;
|
|
42
28
|
finish(): void;
|
|
43
29
|
private _emitItem;
|
|
44
30
|
private _enforceBufferSizeLimit;
|
|
@@ -48,6 +34,7 @@ export default class Parser {
|
|
|
48
34
|
*/
|
|
49
35
|
private _emitAllUnderConstructionFeatures;
|
|
50
36
|
private _bufferLine;
|
|
37
|
+
private _bufferParsedLine;
|
|
51
38
|
private _resolveReferencesTo;
|
|
52
39
|
private _parseError;
|
|
53
40
|
private _resolveReferencesFrom;
|
package/dist/parse.js
CHANGED
|
@@ -33,46 +33,18 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
|
|
37
|
-
const GFF3 = __importStar(require("./util"));
|
|
36
|
+
const GFF3 = __importStar(require("./util.js"));
|
|
38
37
|
const containerAttributes = {
|
|
39
38
|
Parent: 'child_features',
|
|
40
39
|
Derives_from: 'derived_features',
|
|
41
40
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
addLine(line) {
|
|
48
|
-
const defMatch = /^>\s*(\S+)\s*(.*)/.exec(line);
|
|
49
|
-
if (defMatch) {
|
|
50
|
-
this._flush();
|
|
51
|
-
this.currentSequence = { id: defMatch[1], sequence: '' };
|
|
52
|
-
if (defMatch[2]) {
|
|
53
|
-
this.currentSequence.description = defMatch[2].trim();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else if (this.currentSequence && /\S/.test(line)) {
|
|
57
|
-
this.currentSequence.sequence += line.replaceAll(/\s/g, '');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
_flush() {
|
|
61
|
-
if (this.currentSequence) {
|
|
62
|
-
this.seqCallback(this.currentSequence);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
finish() {
|
|
66
|
-
this._flush();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.FASTAParser = FASTAParser;
|
|
41
|
+
const featureLineRegex = /^\s*[^#\s>]/;
|
|
42
|
+
const commentOrDirectiveRegex = /^\s*(#+)(.*)/;
|
|
43
|
+
const blankLineRegex = /^\s*$/;
|
|
44
|
+
const fastaStartRegex = /^\s*>/;
|
|
45
|
+
const lineEndingRegex = /\r?\n?$/g;
|
|
70
46
|
class Parser {
|
|
71
47
|
constructor(args) {
|
|
72
|
-
this.fastaParser = undefined;
|
|
73
|
-
// if this is true, the parser ignores the
|
|
74
|
-
// rest of the lines in the file. currently
|
|
75
|
-
// set when the file switches over to FASTA
|
|
76
48
|
this.eof = false;
|
|
77
49
|
this.lineNumber = 0;
|
|
78
50
|
// features that we have to keep on hand for now because they
|
|
@@ -96,29 +68,22 @@ class Parser {
|
|
|
96
68
|
this.commentCallback = args.commentCallback || nullFunc;
|
|
97
69
|
this.errorCallback = args.errorCallback || nullFunc;
|
|
98
70
|
this.directiveCallback = args.directiveCallback || nullFunc;
|
|
99
|
-
this.sequenceCallback = args.sequenceCallback || nullFunc;
|
|
100
71
|
this.disableDerivesFromReferences =
|
|
101
72
|
args.disableDerivesFromReferences || false;
|
|
102
73
|
// number of lines to buffer
|
|
103
74
|
this.bufferSize = args.bufferSize === undefined ? Infinity : args.bufferSize;
|
|
104
75
|
}
|
|
105
76
|
addLine(line) {
|
|
106
|
-
// if we have transitioned to a fasta section, just delegate to that parser
|
|
107
|
-
if (this.fastaParser) {
|
|
108
|
-
this.fastaParser.addLine(line);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
77
|
if (this.eof) {
|
|
112
|
-
// otherwise, if we are done, ignore this line
|
|
113
78
|
return;
|
|
114
79
|
}
|
|
115
80
|
this.lineNumber += 1;
|
|
116
|
-
if (
|
|
81
|
+
if (featureLineRegex.test(line)) {
|
|
117
82
|
// feature line, most common case
|
|
118
83
|
this._bufferLine(line);
|
|
119
84
|
return;
|
|
120
85
|
}
|
|
121
|
-
const match =
|
|
86
|
+
const match = commentOrDirectiveRegex.exec(line);
|
|
122
87
|
if (match) {
|
|
123
88
|
// directive or comment
|
|
124
89
|
const [, hashsigns] = match;
|
|
@@ -133,7 +98,6 @@ class Parser {
|
|
|
133
98
|
if (directive.directive === 'FASTA') {
|
|
134
99
|
this._emitAllUnderConstructionFeatures();
|
|
135
100
|
this.eof = true;
|
|
136
|
-
this.fastaParser = new FASTAParser(this.sequenceCallback);
|
|
137
101
|
}
|
|
138
102
|
else {
|
|
139
103
|
this._emitItem(directive);
|
|
@@ -141,31 +105,32 @@ class Parser {
|
|
|
141
105
|
}
|
|
142
106
|
}
|
|
143
107
|
else {
|
|
144
|
-
|
|
145
|
-
this._emitItem({ comment: contents });
|
|
108
|
+
this._emitItem({ comment: contents.trimStart() });
|
|
146
109
|
}
|
|
147
110
|
}
|
|
148
|
-
else if (
|
|
111
|
+
else if (blankLineRegex.test(line)) {
|
|
149
112
|
// blank line, do nothing
|
|
150
113
|
}
|
|
151
|
-
else if (
|
|
152
|
-
// implicit beginning of a FASTA section
|
|
114
|
+
else if (fastaStartRegex.test(line)) {
|
|
115
|
+
// implicit beginning of a FASTA section, stop parsing
|
|
153
116
|
this._emitAllUnderConstructionFeatures();
|
|
154
117
|
this.eof = true;
|
|
155
|
-
this.fastaParser = new FASTAParser(this.sequenceCallback);
|
|
156
|
-
this.fastaParser.addLine(line);
|
|
157
118
|
}
|
|
158
119
|
else {
|
|
159
120
|
// it's a parse error
|
|
160
|
-
const errLine = line.replaceAll(
|
|
121
|
+
const errLine = line.replaceAll(lineEndingRegex, '');
|
|
161
122
|
throw new Error(`GFF3 parse error. Cannot parse '${errLine}'.`);
|
|
162
123
|
}
|
|
163
124
|
}
|
|
125
|
+
addParsedFeatureLine(featureLine) {
|
|
126
|
+
if (this.eof) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
this.lineNumber += 1;
|
|
130
|
+
this._bufferParsedLine(featureLine);
|
|
131
|
+
}
|
|
164
132
|
finish() {
|
|
165
133
|
this._emitAllUnderConstructionFeatures();
|
|
166
|
-
if (this.fastaParser) {
|
|
167
|
-
this.fastaParser.finish();
|
|
168
|
-
}
|
|
169
134
|
this.endCallback();
|
|
170
135
|
}
|
|
171
136
|
_emitItem(i) {
|
|
@@ -181,19 +146,24 @@ class Parser {
|
|
|
181
146
|
}
|
|
182
147
|
_enforceBufferSizeLimit(additionalItemCount = 0) {
|
|
183
148
|
const _unbufferItem = (item) => {
|
|
184
|
-
|
|
185
|
-
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])) {
|
|
149
|
+
if (item && Array.isArray(item) && item[0].attributes?.ID?.[0]) {
|
|
186
150
|
const ids = item[0].attributes.ID;
|
|
187
151
|
ids.forEach(id => {
|
|
188
152
|
delete this._underConstructionById[id];
|
|
189
153
|
delete this._completedReferences[id];
|
|
190
154
|
});
|
|
191
155
|
item.forEach(i => {
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
192
157
|
if (i.child_features) {
|
|
193
|
-
i.child_features.forEach(c =>
|
|
158
|
+
i.child_features.forEach(c => {
|
|
159
|
+
_unbufferItem(c);
|
|
160
|
+
});
|
|
194
161
|
}
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
195
163
|
if (i.derived_features) {
|
|
196
|
-
i.derived_features.forEach(d =>
|
|
164
|
+
i.derived_features.forEach(d => {
|
|
165
|
+
_unbufferItem(d);
|
|
166
|
+
});
|
|
197
167
|
}
|
|
198
168
|
});
|
|
199
169
|
}
|
|
@@ -218,25 +188,24 @@ class Parser {
|
|
|
218
188
|
this._completedReferences = {};
|
|
219
189
|
// if we have any orphans hanging around still, this is a
|
|
220
190
|
// problem. die with a parse error
|
|
221
|
-
|
|
222
|
-
|
|
191
|
+
const orphanKeys = Object.keys(this._underConstructionOrphans);
|
|
192
|
+
if (orphanKeys.length) {
|
|
193
|
+
throw new Error(`some features reference other features that do not exist in the file (or in the same '###' scope). ${orphanKeys.join(',')}`);
|
|
223
194
|
}
|
|
224
195
|
}
|
|
225
|
-
// do the right thing with a newly-parsed feature line
|
|
226
196
|
_bufferLine(line) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const
|
|
197
|
+
this._bufferParsedLine(GFF3.parseFeature(line));
|
|
198
|
+
}
|
|
199
|
+
_bufferParsedLine(rawFeatureLine) {
|
|
200
|
+
const featureLine = rawFeatureLine;
|
|
201
|
+
featureLine.child_features = [];
|
|
202
|
+
featureLine.derived_features = [];
|
|
203
|
+
const ids = featureLine.attributes?.ID || [];
|
|
204
|
+
const parents = featureLine.attributes?.Parent || [];
|
|
234
205
|
const derives = this.disableDerivesFromReferences
|
|
235
206
|
? []
|
|
236
|
-
:
|
|
207
|
+
: featureLine.attributes?.Derives_from || [];
|
|
237
208
|
if (!ids.length && !parents.length && !derives.length) {
|
|
238
|
-
// if it has no IDs and does not refer to anything, we can just
|
|
239
|
-
// output it
|
|
240
209
|
this._emitItem([featureLine]);
|
|
241
210
|
return;
|
|
242
211
|
}
|
|
@@ -244,7 +213,6 @@ class Parser {
|
|
|
244
213
|
ids.forEach(id => {
|
|
245
214
|
const existing = this._underConstructionById[id];
|
|
246
215
|
if (existing) {
|
|
247
|
-
// another location of the same feature
|
|
248
216
|
if (existing[existing.length - 1].type !== featureLine.type) {
|
|
249
217
|
this._parseError(`multi-line feature "${id}" has inconsistent types: "${featureLine.type}", "${existing[existing.length - 1].type}"`);
|
|
250
218
|
}
|
|
@@ -252,37 +220,28 @@ class Parser {
|
|
|
252
220
|
feature = existing;
|
|
253
221
|
}
|
|
254
222
|
else {
|
|
255
|
-
// haven't seen it yet, so buffer it so we can attach
|
|
256
|
-
// child features to it
|
|
257
223
|
feature = [featureLine];
|
|
258
224
|
this._enforceBufferSizeLimit(1);
|
|
259
225
|
if (!parents.length && !derives.length) {
|
|
260
226
|
this._underConstructionTopLevel.push(feature);
|
|
261
227
|
}
|
|
262
228
|
this._underConstructionById[id] = feature;
|
|
263
|
-
// see if we have anything buffered that refers to it
|
|
264
229
|
this._resolveReferencesTo(feature, id);
|
|
265
230
|
}
|
|
266
231
|
});
|
|
267
|
-
|
|
268
|
-
|
|
232
|
+
this._resolveReferencesFrom(
|
|
233
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
234
|
+
feature || [featureLine], { Parent: parents, Derives_from: derives }, ids);
|
|
269
235
|
}
|
|
270
236
|
_resolveReferencesTo(feature, id) {
|
|
271
237
|
const references = this._underConstructionOrphans[id];
|
|
272
|
-
// references is of the form
|
|
273
|
-
// {
|
|
274
|
-
// 'Parent' : [ orphans that have a Parent attr referencing this feature ],
|
|
275
|
-
// 'Derives_from' : [ orphans that have a Derives_from attr referencing this feature ],
|
|
276
|
-
// }
|
|
277
238
|
if (!references) {
|
|
278
239
|
return;
|
|
279
240
|
}
|
|
280
|
-
|
|
241
|
+
for (const loc of feature) {
|
|
281
242
|
loc.child_features.push(...references.Parent);
|
|
282
|
-
});
|
|
283
|
-
feature.forEach(loc => {
|
|
284
243
|
loc.derived_features.push(...references.Derives_from);
|
|
285
|
-
}
|
|
244
|
+
}
|
|
286
245
|
delete this._underConstructionOrphans[id];
|
|
287
246
|
}
|
|
288
247
|
_parseError(message) {
|
|
@@ -290,61 +249,60 @@ class Parser {
|
|
|
290
249
|
this.errorCallback(`${this.lineNumber}: ${message}`);
|
|
291
250
|
}
|
|
292
251
|
_resolveReferencesFrom(feature, references, ids) {
|
|
293
|
-
|
|
294
|
-
function postSet(obj, slot1, slot2) {
|
|
295
|
-
let subObj = obj[slot1];
|
|
296
|
-
if (!subObj) {
|
|
297
|
-
subObj = {};
|
|
298
|
-
obj[slot1] = subObj;
|
|
299
|
-
}
|
|
300
|
-
const returnVal = subObj[slot2] || false;
|
|
301
|
-
subObj[slot2] = true;
|
|
302
|
-
return returnVal;
|
|
303
|
-
}
|
|
304
|
-
references.Parent.forEach(toId => {
|
|
252
|
+
for (const toId of references.Parent) {
|
|
305
253
|
const otherFeature = this._underConstructionById[toId];
|
|
306
254
|
if (otherFeature) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
255
|
+
let dominated = false;
|
|
256
|
+
for (const id of ids) {
|
|
257
|
+
const domKey = `Parent,${toId}`;
|
|
258
|
+
const rec = this._completedReferences[id] || (this._completedReferences[id] = {});
|
|
259
|
+
if (rec[domKey]) {
|
|
260
|
+
dominated = true;
|
|
261
|
+
}
|
|
262
|
+
rec[domKey] = true;
|
|
263
|
+
}
|
|
264
|
+
if (!dominated) {
|
|
265
|
+
for (const location of otherFeature) {
|
|
266
|
+
location.child_features.push(feature);
|
|
267
|
+
}
|
|
312
268
|
}
|
|
313
269
|
}
|
|
314
270
|
else {
|
|
315
271
|
let ref = this._underConstructionOrphans[toId];
|
|
316
272
|
if (!ref) {
|
|
317
|
-
ref = {
|
|
318
|
-
Parent: [],
|
|
319
|
-
Derives_from: [],
|
|
320
|
-
};
|
|
273
|
+
ref = { Parent: [], Derives_from: [] };
|
|
321
274
|
this._underConstructionOrphans[toId] = ref;
|
|
322
275
|
}
|
|
323
276
|
ref.Parent.push(feature);
|
|
324
277
|
}
|
|
325
|
-
}
|
|
326
|
-
references.Derives_from
|
|
278
|
+
}
|
|
279
|
+
for (const toId of references.Derives_from) {
|
|
327
280
|
const otherFeature = this._underConstructionById[toId];
|
|
328
281
|
if (otherFeature) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
282
|
+
let dominated = false;
|
|
283
|
+
for (const id of ids) {
|
|
284
|
+
const domKey = `Derives_from,${toId}`;
|
|
285
|
+
const rec = this._completedReferences[id] || (this._completedReferences[id] = {});
|
|
286
|
+
if (rec[domKey]) {
|
|
287
|
+
dominated = true;
|
|
288
|
+
}
|
|
289
|
+
rec[domKey] = true;
|
|
290
|
+
}
|
|
291
|
+
if (!dominated) {
|
|
292
|
+
for (const location of otherFeature) {
|
|
293
|
+
location.derived_features.push(feature);
|
|
294
|
+
}
|
|
334
295
|
}
|
|
335
296
|
}
|
|
336
297
|
else {
|
|
337
298
|
let ref = this._underConstructionOrphans[toId];
|
|
338
299
|
if (!ref) {
|
|
339
|
-
ref = {
|
|
340
|
-
Parent: [],
|
|
341
|
-
Derives_from: [],
|
|
342
|
-
};
|
|
300
|
+
ref = { Parent: [], Derives_from: [] };
|
|
343
301
|
this._underConstructionOrphans[toId] = ref;
|
|
344
302
|
}
|
|
345
303
|
ref.Derives_from.push(feature);
|
|
346
304
|
}
|
|
347
|
-
}
|
|
305
|
+
}
|
|
348
306
|
}
|
|
349
307
|
}
|
|
350
308
|
exports.default = Parser;
|
package/dist/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8B;AAE9B,MAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAE,gBAAyB;IACjC,YAAY,EAAE,kBAA2B;CAC1C,CAAA;AAED,MAAa,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,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC/C,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,EAAE,CAAA;YACb,IAAI,CAAC,eAAe,GAAG,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;YACxD,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBAChB,IAAI,CAAC,eAAe,CAAC,WAAW,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,E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,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;AAlTD,yBAkTC"}
|
package/dist/util.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare function parseAttributes(attrString: string): GFF3Attributes;
|
|
|
33
33
|
* @returns The parsed feature
|
|
34
34
|
*/
|
|
35
35
|
export declare function parseFeature(line: string): GFF3FeatureLine;
|
|
36
|
+
export declare function parseFieldsArray(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
36
37
|
/**
|
|
37
38
|
* Parse a GFF3 directive line.
|
|
38
39
|
*
|