@jbrowse/plugin-bed 2.15.0 → 2.15.2
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.
|
@@ -10,6 +10,7 @@ const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
|
10
10
|
const util_1 = require("@jbrowse/core/util");
|
|
11
11
|
const interval_tree_1 = __importDefault(require("@flatten-js/interval-tree"));
|
|
12
12
|
const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
|
|
13
|
+
const svTypes = new Set(['DUP', 'TRA', 'INV', 'CNV', 'DEL']);
|
|
13
14
|
function featureData(line, uniqueId, flip, names) {
|
|
14
15
|
const l = line.split('\t');
|
|
15
16
|
const ref1 = l[flip ? 3 : 0];
|
|
@@ -26,20 +27,24 @@ function featureData(line, uniqueId, flip, names) {
|
|
|
26
27
|
const rest = names
|
|
27
28
|
? Object.fromEntries(names.slice(10).map((n, idx) => [n, extra[idx]]))
|
|
28
29
|
: extra;
|
|
29
|
-
const ALT = [
|
|
30
|
-
? `<${extra[0]}>`
|
|
31
|
-
: undefined;
|
|
30
|
+
const ALT = svTypes.has(extra[0]) ? `<${extra[0]}>` : undefined;
|
|
32
31
|
return new util_1.SimpleFeature({
|
|
32
|
+
...rest,
|
|
33
33
|
start: start1,
|
|
34
34
|
end: end1,
|
|
35
|
+
type: 'paired_feature',
|
|
35
36
|
refName: ref1,
|
|
36
|
-
...(ALT ? { ALT: [ALT] } : {}), // it's an array in VCF
|
|
37
37
|
strand: strand1,
|
|
38
38
|
name,
|
|
39
|
-
...rest,
|
|
40
39
|
score,
|
|
41
40
|
uniqueId,
|
|
42
|
-
mate: {
|
|
41
|
+
mate: {
|
|
42
|
+
refName: ref2,
|
|
43
|
+
start: start2,
|
|
44
|
+
end: end2,
|
|
45
|
+
strand: strand2,
|
|
46
|
+
},
|
|
47
|
+
...(ALT ? { ALT: [ALT] } : {}), // ALT is an array in VCF
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
function parseStrand(strand) {
|
|
@@ -4,6 +4,7 @@ import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
|
4
4
|
import { SimpleFeature, isGzip } from '@jbrowse/core/util';
|
|
5
5
|
import IntervalTree from '@flatten-js/interval-tree';
|
|
6
6
|
import { unzip } from '@gmod/bgzf-filehandle';
|
|
7
|
+
const svTypes = new Set(['DUP', 'TRA', 'INV', 'CNV', 'DEL']);
|
|
7
8
|
export function featureData(line, uniqueId, flip, names) {
|
|
8
9
|
const l = line.split('\t');
|
|
9
10
|
const ref1 = l[flip ? 3 : 0];
|
|
@@ -20,20 +21,24 @@ export function featureData(line, uniqueId, flip, names) {
|
|
|
20
21
|
const rest = names
|
|
21
22
|
? Object.fromEntries(names.slice(10).map((n, idx) => [n, extra[idx]]))
|
|
22
23
|
: extra;
|
|
23
|
-
const ALT = [
|
|
24
|
-
? `<${extra[0]}>`
|
|
25
|
-
: undefined;
|
|
24
|
+
const ALT = svTypes.has(extra[0]) ? `<${extra[0]}>` : undefined;
|
|
26
25
|
return new SimpleFeature({
|
|
26
|
+
...rest,
|
|
27
27
|
start: start1,
|
|
28
28
|
end: end1,
|
|
29
|
+
type: 'paired_feature',
|
|
29
30
|
refName: ref1,
|
|
30
|
-
...(ALT ? { ALT: [ALT] } : {}), // it's an array in VCF
|
|
31
31
|
strand: strand1,
|
|
32
32
|
name,
|
|
33
|
-
...rest,
|
|
34
33
|
score,
|
|
35
34
|
uniqueId,
|
|
36
|
-
mate: {
|
|
35
|
+
mate: {
|
|
36
|
+
refName: ref2,
|
|
37
|
+
start: start2,
|
|
38
|
+
end: end2,
|
|
39
|
+
strand: strand2,
|
|
40
|
+
},
|
|
41
|
+
...(ALT ? { ALT: [ALT] } : {}), // ALT is an array in VCF
|
|
37
42
|
});
|
|
38
43
|
}
|
|
39
44
|
function parseStrand(strand) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-bed",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.2",
|
|
4
4
|
"description": "JBrowse 2 bed adapters, tracks, etc.",
|
|
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": "8a58cefbfe39af4c97bcb6ead354d72c9fef9224"
|
|
59
59
|
}
|