@jbrowse/plugin-gff3 2.15.1 → 2.15.3
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/featureData.d.ts +15 -1
- package/dist/featureData.js +25 -32
- package/esm/featureData.d.ts +15 -1
- package/esm/featureData.js +25 -32
- package/package.json +2 -2
package/dist/featureData.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import { GFF3FeatureLineWithRefs } from 'gff-nostream';
|
|
2
|
-
|
|
2
|
+
interface GFF3Feature {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
strand?: number;
|
|
6
|
+
type: string | null;
|
|
7
|
+
source: string | null;
|
|
8
|
+
refName: string;
|
|
9
|
+
derived_features: unknown[] | null;
|
|
10
|
+
phase?: number;
|
|
11
|
+
score?: number;
|
|
12
|
+
subfeatures: GFF3Feature[] | undefined;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function featureData(data: GFF3FeatureLineWithRefs): GFF3Feature;
|
|
16
|
+
export {};
|
package/dist/featureData.js
CHANGED
|
@@ -2,24 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.featureData = featureData;
|
|
4
4
|
function featureData(data) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
|
|
5
|
+
const { end, start, child_features, derived_features, attributes, type, source, phase, seq_id, score, strand, } = data;
|
|
6
|
+
let strand2;
|
|
7
|
+
if (strand === '+') {
|
|
8
|
+
strand2 = 1;
|
|
9
9
|
}
|
|
10
|
-
else if (
|
|
11
|
-
|
|
10
|
+
else if (strand === '-') {
|
|
11
|
+
strand2 = -1;
|
|
12
12
|
}
|
|
13
|
-
else if (
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
f.strand = undefined;
|
|
18
|
-
}
|
|
19
|
-
f.phase = data.phase === null ? undefined : Number(data.phase);
|
|
20
|
-
f.refName = data.seq_id;
|
|
21
|
-
if (data.score === null) {
|
|
22
|
-
f.score = undefined;
|
|
13
|
+
else if (strand === '.') {
|
|
14
|
+
strand2 = 0;
|
|
23
15
|
}
|
|
24
16
|
const defaultFields = new Set([
|
|
25
17
|
'start',
|
|
@@ -31,7 +23,8 @@ function featureData(data) {
|
|
|
31
23
|
'phase',
|
|
32
24
|
'strand',
|
|
33
25
|
]);
|
|
34
|
-
const dataAttributes =
|
|
26
|
+
const dataAttributes = attributes || {};
|
|
27
|
+
const resultAttributes = {};
|
|
35
28
|
for (const a of Object.keys(dataAttributes)) {
|
|
36
29
|
let b = a.toLowerCase();
|
|
37
30
|
if (defaultFields.has(b)) {
|
|
@@ -39,26 +32,26 @@ function featureData(data) {
|
|
|
39
32
|
// reproduces behavior of NCList
|
|
40
33
|
b += '2';
|
|
41
34
|
}
|
|
42
|
-
if (dataAttributes[a]) {
|
|
35
|
+
if (dataAttributes[a] && a !== '_lineHash') {
|
|
43
36
|
let attr = dataAttributes[a];
|
|
44
37
|
if (Array.isArray(attr) && attr.length === 1) {
|
|
45
38
|
;
|
|
46
39
|
[attr] = attr;
|
|
47
40
|
}
|
|
48
|
-
|
|
41
|
+
resultAttributes[b] = attr;
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
return {
|
|
45
|
+
...resultAttributes,
|
|
46
|
+
start: start - 1,
|
|
47
|
+
end: end,
|
|
48
|
+
strand: strand2,
|
|
49
|
+
type,
|
|
50
|
+
source,
|
|
51
|
+
refName: seq_id,
|
|
52
|
+
derived_features,
|
|
53
|
+
phase: phase === null ? undefined : Number(phase),
|
|
54
|
+
score: score === null ? undefined : score,
|
|
55
|
+
subfeatures: child_features.flatMap(childLocs => childLocs.map(childLoc => featureData(childLoc))),
|
|
56
|
+
};
|
|
64
57
|
}
|
package/esm/featureData.d.ts
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import { GFF3FeatureLineWithRefs } from 'gff-nostream';
|
|
2
|
-
|
|
2
|
+
interface GFF3Feature {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
strand?: number;
|
|
6
|
+
type: string | null;
|
|
7
|
+
source: string | null;
|
|
8
|
+
refName: string;
|
|
9
|
+
derived_features: unknown[] | null;
|
|
10
|
+
phase?: number;
|
|
11
|
+
score?: number;
|
|
12
|
+
subfeatures: GFF3Feature[] | undefined;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function featureData(data: GFF3FeatureLineWithRefs): GFF3Feature;
|
|
16
|
+
export {};
|
package/esm/featureData.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
export function featureData(data) {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
if (
|
|
5
|
-
|
|
2
|
+
const { end, start, child_features, derived_features, attributes, type, source, phase, seq_id, score, strand, } = data;
|
|
3
|
+
let strand2;
|
|
4
|
+
if (strand === '+') {
|
|
5
|
+
strand2 = 1;
|
|
6
6
|
}
|
|
7
|
-
else if (
|
|
8
|
-
|
|
7
|
+
else if (strand === '-') {
|
|
8
|
+
strand2 = -1;
|
|
9
9
|
}
|
|
10
|
-
else if (
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
f.strand = undefined;
|
|
15
|
-
}
|
|
16
|
-
f.phase = data.phase === null ? undefined : Number(data.phase);
|
|
17
|
-
f.refName = data.seq_id;
|
|
18
|
-
if (data.score === null) {
|
|
19
|
-
f.score = undefined;
|
|
10
|
+
else if (strand === '.') {
|
|
11
|
+
strand2 = 0;
|
|
20
12
|
}
|
|
21
13
|
const defaultFields = new Set([
|
|
22
14
|
'start',
|
|
@@ -28,7 +20,8 @@ export function featureData(data) {
|
|
|
28
20
|
'phase',
|
|
29
21
|
'strand',
|
|
30
22
|
]);
|
|
31
|
-
const dataAttributes =
|
|
23
|
+
const dataAttributes = attributes || {};
|
|
24
|
+
const resultAttributes = {};
|
|
32
25
|
for (const a of Object.keys(dataAttributes)) {
|
|
33
26
|
let b = a.toLowerCase();
|
|
34
27
|
if (defaultFields.has(b)) {
|
|
@@ -36,26 +29,26 @@ export function featureData(data) {
|
|
|
36
29
|
// reproduces behavior of NCList
|
|
37
30
|
b += '2';
|
|
38
31
|
}
|
|
39
|
-
if (dataAttributes[a]) {
|
|
32
|
+
if (dataAttributes[a] && a !== '_lineHash') {
|
|
40
33
|
let attr = dataAttributes[a];
|
|
41
34
|
if (Array.isArray(attr) && attr.length === 1) {
|
|
42
35
|
;
|
|
43
36
|
[attr] = attr;
|
|
44
37
|
}
|
|
45
|
-
|
|
38
|
+
resultAttributes[b] = attr;
|
|
46
39
|
}
|
|
47
40
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
41
|
+
return {
|
|
42
|
+
...resultAttributes,
|
|
43
|
+
start: start - 1,
|
|
44
|
+
end: end,
|
|
45
|
+
strand: strand2,
|
|
46
|
+
type,
|
|
47
|
+
source,
|
|
48
|
+
refName: seq_id,
|
|
49
|
+
derived_features,
|
|
50
|
+
phase: phase === null ? undefined : Number(phase),
|
|
51
|
+
score: score === null ? undefined : score,
|
|
52
|
+
subfeatures: child_features.flatMap(childLocs => childLocs.map(childLoc => featureData(childLoc))),
|
|
53
|
+
};
|
|
61
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-gff3",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.3",
|
|
4
4
|
"description": "JBrowse 2 gff3.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"distModule": "esm/index.js",
|
|
56
56
|
"srcModule": "src/index.ts",
|
|
57
57
|
"module": "esm/index.js",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c0f82fe7b210622dd462e702641cc6da01109c6e"
|
|
59
59
|
}
|