gff-nostream 2.0.0 → 3.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 +9 -16
- package/dist/api.js +87 -58
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/util.d.ts +26 -55
- package/dist/util.js +195 -207
- package/dist/util.js.map +1 -1
- package/esm/api.d.ts +9 -16
- package/esm/api.js +87 -54
- package/esm/api.js.map +1 -1
- package/esm/index.d.ts +1 -2
- package/esm/index.js +1 -2
- package/esm/index.js.map +1 -1
- package/esm/util.d.ts +26 -55
- package/esm/util.js +192 -199
- package/esm/util.js.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +96 -61
- package/src/index.ts +1 -2
- package/src/util.ts +208 -249
- package/dist/parse.d.ts +0 -42
- package/dist/parse.js +0 -309
- package/dist/parse.js.map +0 -1
- package/esm/parse.d.ts +0 -42
- package/esm/parse.js +0 -280
- package/esm/parse.js.map +0 -1
- package/src/parse.ts +0 -335
package/dist/api.d.ts
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import type { GFF3Feature } from './util.ts';
|
|
2
2
|
export interface LineRecord {
|
|
3
|
-
|
|
3
|
+
line: string;
|
|
4
4
|
lineHash?: string | number;
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
hasEscapes: boolean;
|
|
5
8
|
}
|
|
6
9
|
/**
|
|
7
10
|
* Synchronously parse a string containing GFF3 and return an array of the
|
|
8
11
|
* parsed items.
|
|
9
12
|
*
|
|
10
13
|
* @param str - GFF3 string
|
|
11
|
-
* @
|
|
12
|
-
* @returns array of parsed features, directives, comments and/or sequences
|
|
14
|
+
* @returns array of parsed features
|
|
13
15
|
*/
|
|
14
16
|
export declare function parseStringSync(str: string): GFF3Feature[];
|
|
15
17
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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.
|
|
18
|
+
* Parse an array of LineRecord objects containing raw GFF3 lines.
|
|
19
|
+
* Supports parent/child relationships.
|
|
27
20
|
*
|
|
28
|
-
* @param records - Array of LineRecord objects with
|
|
21
|
+
* @param records - Array of LineRecord objects with raw line and metadata
|
|
29
22
|
* @returns array of parsed features
|
|
30
23
|
*/
|
|
31
|
-
export declare function
|
|
24
|
+
export declare function parseRecords(records: LineRecord[]): GFF3Feature[];
|
|
32
25
|
export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, } from './util.ts';
|
package/dist/api.js
CHANGED
|
@@ -1,86 +1,115 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseStringSync = parseStringSync;
|
|
7
|
-
exports.
|
|
8
|
-
exports.parseRecordsSync = parseRecordsSync;
|
|
9
|
-
const parse_ts_1 = __importDefault(require("./parse.js"));
|
|
4
|
+
exports.parseRecords = parseRecords;
|
|
10
5
|
const util_ts_1 = require("./util.js");
|
|
11
6
|
/**
|
|
12
7
|
* Synchronously parse a string containing GFF3 and return an array of the
|
|
13
8
|
* parsed items.
|
|
14
9
|
*
|
|
15
10
|
* @param str - GFF3 string
|
|
16
|
-
* @
|
|
17
|
-
* @returns array of parsed features, directives, comments and/or sequences
|
|
11
|
+
* @returns array of parsed features
|
|
18
12
|
*/
|
|
19
13
|
function parseStringSync(str) {
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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);
|
|
14
|
+
const lines = str.split(/\r?\n/);
|
|
15
|
+
const records = [];
|
|
16
|
+
for (let i = 0; i < lines.length; i++) {
|
|
17
|
+
const line = lines[i];
|
|
18
|
+
if (line.length === 0 || line[0] === '#') {
|
|
19
|
+
if (line.startsWith('##FASTA')) {
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (line[0] === '>') {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
records.push({
|
|
28
|
+
line,
|
|
29
|
+
start: 0,
|
|
30
|
+
end: 0,
|
|
31
|
+
hasEscapes: line.includes('%'),
|
|
32
|
+
});
|
|
53
33
|
}
|
|
54
|
-
|
|
55
|
-
return items;
|
|
34
|
+
return parseRecords(records);
|
|
56
35
|
}
|
|
57
36
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
37
|
+
* Parse an array of LineRecord objects containing raw GFF3 lines.
|
|
38
|
+
* Supports parent/child relationships.
|
|
60
39
|
*
|
|
61
|
-
* @param records - Array of LineRecord objects with
|
|
40
|
+
* @param records - Array of LineRecord objects with raw line and metadata
|
|
62
41
|
* @returns array of parsed features
|
|
63
42
|
*/
|
|
64
|
-
function
|
|
43
|
+
function parseRecords(records) {
|
|
65
44
|
const items = [];
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
45
|
+
const byId = new Map();
|
|
46
|
+
const orphans = new Map();
|
|
47
|
+
for (let i = 0; i < records.length; i++) {
|
|
48
|
+
const record = records[i];
|
|
49
|
+
const featureLine = (record.hasEscapes
|
|
50
|
+
? (0, util_ts_1.parseFeature)(record.line)
|
|
51
|
+
: (0, util_ts_1.parseFeatureNoUnescape)(record.line));
|
|
52
|
+
featureLine.child_features = [];
|
|
53
|
+
featureLine.derived_features = [];
|
|
75
54
|
if (record.lineHash !== undefined) {
|
|
76
55
|
if (!featureLine.attributes) {
|
|
77
56
|
featureLine.attributes = {};
|
|
78
57
|
}
|
|
79
58
|
featureLine.attributes._lineHash = [String(record.lineHash)];
|
|
80
59
|
}
|
|
81
|
-
|
|
60
|
+
const attrs = featureLine.attributes;
|
|
61
|
+
const ids = attrs?.ID;
|
|
62
|
+
const parents = attrs?.Parent;
|
|
63
|
+
if (!ids && !parents) {
|
|
64
|
+
items.push([featureLine]);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
let feature;
|
|
68
|
+
if (ids) {
|
|
69
|
+
const id = ids[0];
|
|
70
|
+
const existing = byId.get(id);
|
|
71
|
+
if (existing) {
|
|
72
|
+
existing.push(featureLine);
|
|
73
|
+
feature = existing;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
feature = [featureLine];
|
|
77
|
+
if (!parents) {
|
|
78
|
+
items.push(feature);
|
|
79
|
+
}
|
|
80
|
+
byId.set(id, feature);
|
|
81
|
+
const waiting = orphans.get(id);
|
|
82
|
+
if (waiting) {
|
|
83
|
+
for (let j = 0; j < waiting.length; j++) {
|
|
84
|
+
featureLine.child_features.push(waiting[j]);
|
|
85
|
+
}
|
|
86
|
+
orphans.delete(id);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
feature = [featureLine];
|
|
92
|
+
}
|
|
93
|
+
if (parents) {
|
|
94
|
+
for (let j = 0; j < parents.length; j++) {
|
|
95
|
+
const parentId = parents[j];
|
|
96
|
+
const parent = byId.get(parentId);
|
|
97
|
+
if (parent) {
|
|
98
|
+
for (let k = 0; k < parent.length; k++) {
|
|
99
|
+
parent[k].child_features.push(feature);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
let arr = orphans.get(parentId);
|
|
104
|
+
if (!arr) {
|
|
105
|
+
arr = [];
|
|
106
|
+
orphans.set(parentId, arr);
|
|
107
|
+
}
|
|
108
|
+
arr.push(feature);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
82
112
|
}
|
|
83
|
-
parser.finish();
|
|
84
113
|
return items;
|
|
85
114
|
}
|
|
86
115
|
//# 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":";;AAmBA,0CAsBC;AASD,oCA6EC;AA/HD,uCAAgE;AAYhE;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAChC,MAAM,OAAO,GAAiB,EAAE,CAAA;IAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAA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ync } from './api.ts';
|
|
3
2
|
export type { GFF3Comment, GFF3Directive, GFF3Feature, GFF3FeatureLine, GFF3FeatureLineWithRefs, GFF3Item, GFF3Sequence, LineRecord, } from './api.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseStringSync = exports.
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "parseRecordsSync", { enumerable: true, get: function () { return api_ts_1.parseRecordsSync; } });
|
|
3
|
+
exports.parseStringSync = exports.parseRecords = void 0;
|
|
4
|
+
var api_ts_1 = require("./api.js");
|
|
5
|
+
Object.defineProperty(exports, "parseRecords", { enumerable: true, get: function () { return api_ts_1.parseRecords; } });
|
|
7
6
|
Object.defineProperty(exports, "parseStringSync", { enumerable: true, get: function () { return api_ts_1.parseStringSync; } });
|
|
8
7
|
//# 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,mCAAwD;AAA/C,sGAAA,YAAY,OAAA;AAAE,yGAAA,eAAe,OAAA"}
|
package/dist/util.d.ts
CHANGED
|
@@ -4,28 +4,22 @@
|
|
|
4
4
|
* @param stringVal - Escaped GFF3 string value
|
|
5
5
|
* @returns An unescaped string value
|
|
6
6
|
*/
|
|
7
|
-
export declare function unescape(
|
|
7
|
+
export declare function unescape(s: string): string;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param rawVal - Raw GFF3 attribute value
|
|
12
|
-
* @returns An escaped string value
|
|
13
|
-
*/
|
|
14
|
-
export declare function escape(rawVal: string | number): string;
|
|
15
|
-
/**
|
|
16
|
-
* Escape a value for use in a GFF3 column value.
|
|
9
|
+
* Parse the 9th column (attributes) of a GFF3 feature line.
|
|
17
10
|
*
|
|
18
|
-
* @param
|
|
19
|
-
* @returns
|
|
11
|
+
* @param attrString - String of GFF3 9th column
|
|
12
|
+
* @returns Parsed attributes
|
|
20
13
|
*/
|
|
21
|
-
export declare function
|
|
14
|
+
export declare function parseAttributes(attrString: string): GFF3Attributes;
|
|
22
15
|
/**
|
|
23
|
-
* Parse the 9th column (attributes) of a GFF3 feature line.
|
|
16
|
+
* Parse the 9th column (attributes) of a GFF3 feature line without unescaping.
|
|
17
|
+
* Fast path for data known to contain no escaped characters.
|
|
24
18
|
*
|
|
25
19
|
* @param attrString - String of GFF3 9th column
|
|
26
20
|
* @returns Parsed attributes
|
|
27
21
|
*/
|
|
28
|
-
export declare function
|
|
22
|
+
export declare function parseAttributesNoUnescape(attrString: string): GFF3Attributes;
|
|
29
23
|
/**
|
|
30
24
|
* Parse a GFF3 feature line
|
|
31
25
|
*
|
|
@@ -33,59 +27,36 @@ export declare function parseAttributes(attrString: string): GFF3Attributes;
|
|
|
33
27
|
* @returns The parsed feature
|
|
34
28
|
*/
|
|
35
29
|
export declare function parseFeature(line: string): GFF3FeatureLine;
|
|
36
|
-
export declare function parseFieldsArray(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
37
|
-
/**
|
|
38
|
-
* Parse a GFF3 directive line.
|
|
39
|
-
*
|
|
40
|
-
* @param line - GFF3 directive line
|
|
41
|
-
* @returns The parsed directive
|
|
42
|
-
*/
|
|
43
|
-
export declare function parseDirective(line: string): GFF3Directive | GFF3SequenceRegionDirective | GFF3GenomeBuildDirective | null;
|
|
44
|
-
/**
|
|
45
|
-
* Format an attributes object into a string suitable for the 9th column of GFF3.
|
|
46
|
-
*
|
|
47
|
-
* @param attrs - Attributes
|
|
48
|
-
* @returns GFF3 9th column string
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatAttributes(attrs: GFF3Attributes): string;
|
|
51
30
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
31
|
+
* Parse a GFF3 feature line without unescaping.
|
|
32
|
+
* Fast path for data known to contain no escaped characters.
|
|
54
33
|
*
|
|
55
|
-
* @param
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
export declare function formatFeature(featureOrFeatures: GFF3FeatureLine | GFF3FeatureLineWithRefs | (GFF3FeatureLine | GFF3FeatureLineWithRefs)[]): string;
|
|
59
|
-
/**
|
|
60
|
-
* Format a directive into a line of GFF3.
|
|
61
|
-
*
|
|
62
|
-
* @param directive - A directive object
|
|
63
|
-
* @returns A directive line string
|
|
34
|
+
* @param line - GFF3 feature line
|
|
35
|
+
* @returns The parsed feature
|
|
64
36
|
*/
|
|
65
|
-
export declare function
|
|
37
|
+
export declare function parseFeatureNoUnescape(line: string): GFF3FeatureLine;
|
|
66
38
|
/**
|
|
67
|
-
*
|
|
68
|
-
* Yes I know this is just adding a # and a newline.
|
|
39
|
+
* Parse a GFF3 feature from a pre-split fields array
|
|
69
40
|
*
|
|
70
|
-
* @param
|
|
71
|
-
* @returns
|
|
41
|
+
* @param f - Array of 9 GFF3 column values (use null or '.' for empty values)
|
|
42
|
+
* @returns The parsed feature
|
|
72
43
|
*/
|
|
73
|
-
export declare function
|
|
44
|
+
export declare function parseFieldsArray(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
74
45
|
/**
|
|
75
|
-
*
|
|
46
|
+
* Parse a GFF3 feature from a pre-split fields array without unescaping.
|
|
47
|
+
* Fast path for data known to contain no escaped characters.
|
|
76
48
|
*
|
|
77
|
-
* @param
|
|
78
|
-
* @returns
|
|
49
|
+
* @param f - Array of 9 GFF3 column values (use null or '.' for empty values)
|
|
50
|
+
* @returns The parsed feature
|
|
79
51
|
*/
|
|
80
|
-
export declare function
|
|
52
|
+
export declare function parseFieldsArrayNoUnescape(f: (string | null | undefined)[]): GFF3FeatureLine;
|
|
81
53
|
/**
|
|
82
|
-
*
|
|
83
|
-
* into one or more lines of GFF3.
|
|
54
|
+
* Parse a GFF3 directive line.
|
|
84
55
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @returns
|
|
56
|
+
* @param line - GFF3 directive line
|
|
57
|
+
* @returns The parsed directive
|
|
87
58
|
*/
|
|
88
|
-
export declare function
|
|
59
|
+
export declare function parseDirective(line: string): GFF3Directive | GFF3SequenceRegionDirective | GFF3GenomeBuildDirective | null;
|
|
89
60
|
/** A record of GFF3 attribute identifiers and the values of those identifiers */
|
|
90
61
|
export type GFF3Attributes = Record<string, string[] | undefined>;
|
|
91
62
|
/** A representation of a single line of a GFF3 file */
|