@jbrowse/plugin-breakpoint-split-view 2.10.2 → 2.10.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.
|
@@ -31,6 +31,17 @@ const mobx_state_tree_1 = require("mobx-state-tree");
|
|
|
31
31
|
const util_2 = require("./util");
|
|
32
32
|
const util_3 = require("../util");
|
|
33
33
|
const [LEFT] = [0, 1, 2, 3];
|
|
34
|
+
function str(s) {
|
|
35
|
+
if (s === '+') {
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
38
|
+
else if (s === '-') {
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
34
45
|
const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
35
46
|
const { views } = model;
|
|
36
47
|
const session = (0, util_1.getSession)(model);
|
|
@@ -57,6 +68,7 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
|
|
|
57
68
|
return null;
|
|
58
69
|
}
|
|
59
70
|
return (react_1.default.createElement("g", { fill: "none", stroke: "green", strokeWidth: 5, "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
|
|
71
|
+
var _a, _b;
|
|
60
72
|
// we follow a path in the list of chunks, not from top to bottom,
|
|
61
73
|
// just in series following x1,y1 -> x2,y2
|
|
62
74
|
const ret = [];
|
|
@@ -69,7 +81,8 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
|
|
|
69
81
|
const info = f1.get('INFO');
|
|
70
82
|
const chr2 = info.CHR2[0];
|
|
71
83
|
const end2 = info.END[0];
|
|
72
|
-
const
|
|
84
|
+
const res = (_b = (_a = info.STRANDS) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.split(''); // not all files have STRANDS
|
|
85
|
+
const [myDirection, mateDirection] = res !== null && res !== void 0 ? res : ['.', '.'];
|
|
73
86
|
const r = (0, util_3.getPxFromCoordinate)(views[level2], chr2, end2);
|
|
74
87
|
if (r) {
|
|
75
88
|
const c2 = [r, 0, r + 1, 0];
|
|
@@ -84,7 +97,7 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
|
|
|
84
97
|
yOffset;
|
|
85
98
|
const path = [
|
|
86
99
|
'M', // move to
|
|
87
|
-
x1 - 20 * (myDirection
|
|
100
|
+
x1 - 20 * str(myDirection) * (reversed1 ? -1 : 1),
|
|
88
101
|
y1,
|
|
89
102
|
'L', // line to
|
|
90
103
|
x1,
|
|
@@ -93,7 +106,7 @@ const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, pa
|
|
|
93
106
|
x2,
|
|
94
107
|
y2,
|
|
95
108
|
'L', // line to
|
|
96
|
-
x2 - 20 * (mateDirection
|
|
109
|
+
x2 - 20 * str(mateDirection) * (reversed2 ? -1 : 1),
|
|
97
110
|
y2,
|
|
98
111
|
].join(' ');
|
|
99
112
|
ret.push(react_1.default.createElement("path", { d: path, key: JSON.stringify(path), strokeWidth: id === mouseoverElt ? 10 : 5, onClick: () => {
|
|
@@ -70,6 +70,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
70
70
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
71
71
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
72
72
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
73
|
+
highlight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>>>;
|
|
73
74
|
}, {
|
|
74
75
|
width: number;
|
|
75
76
|
} & {
|
|
@@ -81,16 +82,21 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
81
82
|
} & {
|
|
82
83
|
volatileWidth: number | undefined;
|
|
83
84
|
minimumBlockWidth: number;
|
|
85
|
+
/**
|
|
86
|
+
* #action
|
|
87
|
+
*/
|
|
84
88
|
draggingTrackId: string | undefined;
|
|
85
89
|
volatileError: unknown;
|
|
86
90
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
87
|
-
scaleFactor: number;
|
|
91
|
+
scaleFactor: number; /**
|
|
92
|
+
* #action
|
|
93
|
+
*/
|
|
88
94
|
trackRefs: Record<string, HTMLDivElement>;
|
|
89
95
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
90
|
-
coarseTotalBp: number;
|
|
91
|
-
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined; /**
|
|
96
|
+
coarseTotalBp: number; /**
|
|
92
97
|
* #action
|
|
93
98
|
*/
|
|
99
|
+
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
94
100
|
rightOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
95
101
|
} & {
|
|
96
102
|
readonly trackLabelsSetting: any;
|
|
@@ -134,6 +140,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
134
140
|
setHideHeaderOverview(b: boolean): void;
|
|
135
141
|
setHideNoTracksActive(b: boolean): void;
|
|
136
142
|
setShowGridlines(b: boolean): void;
|
|
143
|
+
setHighlight(highlight: Required<import("@jbrowse/core/util").ParsedLocString> | undefined): void;
|
|
137
144
|
scrollTo(offsetPx: number): number;
|
|
138
145
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
139
146
|
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined): void;
|
|
@@ -6,6 +6,17 @@ import { getSnapshot } from 'mobx-state-tree';
|
|
|
6
6
|
import { getMatchedTranslocationFeatures } from './util';
|
|
7
7
|
import { yPos, getPxFromCoordinate, useNextFrame } from '../util';
|
|
8
8
|
const [LEFT] = [0, 1, 2, 3];
|
|
9
|
+
function str(s) {
|
|
10
|
+
if (s === '+') {
|
|
11
|
+
return 1;
|
|
12
|
+
}
|
|
13
|
+
else if (s === '-') {
|
|
14
|
+
return -1;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
9
20
|
const Translocations = observer(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
10
21
|
const { views } = model;
|
|
11
22
|
const session = getSession(model);
|
|
@@ -32,6 +43,7 @@ const Translocations = observer(function ({ model, trackId, parentRef: ref, getT
|
|
|
32
43
|
return null;
|
|
33
44
|
}
|
|
34
45
|
return (React.createElement("g", { fill: "none", stroke: "green", strokeWidth: 5, "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
|
|
46
|
+
var _a, _b;
|
|
35
47
|
// we follow a path in the list of chunks, not from top to bottom,
|
|
36
48
|
// just in series following x1,y1 -> x2,y2
|
|
37
49
|
const ret = [];
|
|
@@ -44,7 +56,8 @@ const Translocations = observer(function ({ model, trackId, parentRef: ref, getT
|
|
|
44
56
|
const info = f1.get('INFO');
|
|
45
57
|
const chr2 = info.CHR2[0];
|
|
46
58
|
const end2 = info.END[0];
|
|
47
|
-
const
|
|
59
|
+
const res = (_b = (_a = info.STRANDS) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.split(''); // not all files have STRANDS
|
|
60
|
+
const [myDirection, mateDirection] = res !== null && res !== void 0 ? res : ['.', '.'];
|
|
48
61
|
const r = getPxFromCoordinate(views[level2], chr2, end2);
|
|
49
62
|
if (r) {
|
|
50
63
|
const c2 = [r, 0, r + 1, 0];
|
|
@@ -59,7 +72,7 @@ const Translocations = observer(function ({ model, trackId, parentRef: ref, getT
|
|
|
59
72
|
yOffset;
|
|
60
73
|
const path = [
|
|
61
74
|
'M', // move to
|
|
62
|
-
x1 - 20 * (myDirection
|
|
75
|
+
x1 - 20 * str(myDirection) * (reversed1 ? -1 : 1),
|
|
63
76
|
y1,
|
|
64
77
|
'L', // line to
|
|
65
78
|
x1,
|
|
@@ -68,7 +81,7 @@ const Translocations = observer(function ({ model, trackId, parentRef: ref, getT
|
|
|
68
81
|
x2,
|
|
69
82
|
y2,
|
|
70
83
|
'L', // line to
|
|
71
|
-
x2 - 20 * (mateDirection
|
|
84
|
+
x2 - 20 * str(mateDirection) * (reversed2 ? -1 : 1),
|
|
72
85
|
y2,
|
|
73
86
|
].join(' ');
|
|
74
87
|
ret.push(React.createElement("path", { d: path, key: JSON.stringify(path), strokeWidth: id === mouseoverElt ? 10 : 5, onClick: () => {
|
|
@@ -70,6 +70,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
70
70
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
71
71
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
72
72
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
73
|
+
highlight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IType<Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>, Required<import("@jbrowse/core/util").ParsedLocString>>>;
|
|
73
74
|
}, {
|
|
74
75
|
width: number;
|
|
75
76
|
} & {
|
|
@@ -81,16 +82,21 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
81
82
|
} & {
|
|
82
83
|
volatileWidth: number | undefined;
|
|
83
84
|
minimumBlockWidth: number;
|
|
85
|
+
/**
|
|
86
|
+
* #action
|
|
87
|
+
*/
|
|
84
88
|
draggingTrackId: string | undefined;
|
|
85
89
|
volatileError: unknown;
|
|
86
90
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
87
|
-
scaleFactor: number;
|
|
91
|
+
scaleFactor: number; /**
|
|
92
|
+
* #action
|
|
93
|
+
*/
|
|
88
94
|
trackRefs: Record<string, HTMLDivElement>;
|
|
89
95
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
90
|
-
coarseTotalBp: number;
|
|
91
|
-
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined; /**
|
|
96
|
+
coarseTotalBp: number; /**
|
|
92
97
|
* #action
|
|
93
98
|
*/
|
|
99
|
+
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
94
100
|
rightOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
95
101
|
} & {
|
|
96
102
|
readonly trackLabelsSetting: any;
|
|
@@ -134,6 +140,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
134
140
|
setHideHeaderOverview(b: boolean): void;
|
|
135
141
|
setHideNoTracksActive(b: boolean): void;
|
|
136
142
|
setShowGridlines(b: boolean): void;
|
|
143
|
+
setHighlight(highlight: Required<import("@jbrowse/core/util").ParsedLocString> | undefined): void;
|
|
137
144
|
scrollTo(offsetPx: number): number;
|
|
138
145
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
139
146
|
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-breakpoint-split-view",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.3",
|
|
4
4
|
"description": "JBrowse 2 breakpoint detail split view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c8fc800cd17decd72b2e971c7a6add3b95214e72"
|
|
62
62
|
}
|