@jbrowse/sv-core 2.17.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/BreakendMultiLevelOptionDialog.d.ts +6 -18
- package/dist/BreakendMultiLevelOptionDialog.js +33 -127
- package/dist/BreakendSingleLevelOptionDialog.d.ts +6 -18
- package/dist/BreakendSingleLevelOptionDialog.js +41 -91
- package/dist/Checkbox2.d.ts +1 -2
- package/dist/Checkbox2.js +2 -5
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/dist/navToMultiLevelBreak.d.ts +11 -0
- package/dist/navToMultiLevelBreak.js +77 -0
- package/dist/navToSingleLevelBreak.d.ts +61 -0
- package/dist/navToSingleLevelBreak.js +136 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.js +2 -0
- package/dist/util.d.ts +18 -0
- package/dist/util.js +58 -0
- package/esm/BreakendMultiLevelOptionDialog.d.ts +6 -18
- package/esm/BreakendMultiLevelOptionDialog.js +33 -104
- package/esm/BreakendSingleLevelOptionDialog.d.ts +6 -18
- package/esm/BreakendSingleLevelOptionDialog.js +42 -69
- package/esm/Checkbox2.d.ts +1 -2
- package/esm/Checkbox2.js +2 -2
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/navToMultiLevelBreak.d.ts +11 -0
- package/esm/navToMultiLevelBreak.js +74 -0
- package/esm/navToSingleLevelBreak.d.ts +61 -0
- package/esm/navToSingleLevelBreak.js +131 -0
- package/esm/types.d.ts +13 -0
- package/esm/types.js +1 -0
- package/esm/util.d.ts +18 -0
- package/esm/util.js +53 -0
- package/package.json +5 -3
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Feature } from '@jbrowse/core/util';
|
|
1
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
3
2
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
model: unknown;
|
|
3
|
+
declare const BreakendMultiLevelOptionDialog: ({ session, handleClose, feature, assemblyName, stableViewId, view, }: {
|
|
4
|
+
session: AbstractSessionModel;
|
|
7
5
|
handleClose: () => void;
|
|
8
6
|
feature: Feature;
|
|
9
|
-
view
|
|
7
|
+
view?: LinearGenomeViewModel;
|
|
10
8
|
assemblyName: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
feature: Feature;
|
|
14
|
-
assembly: Assembly;
|
|
15
|
-
}) => {
|
|
16
|
-
pos: number;
|
|
17
|
-
refName: string;
|
|
18
|
-
mateRefName: string;
|
|
19
|
-
matePos: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}) => React.JSX.Element;
|
|
9
|
+
stableViewId?: string;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
11
|
export default BreakendMultiLevelOptionDialog;
|
|
@@ -1,140 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
30
|
-
const
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
31
9
|
const material_1 = require("@mui/material");
|
|
10
|
+
const mobx_react_1 = require("mobx-react");
|
|
32
11
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
33
|
-
const ui_1 = require("@jbrowse/core/ui");
|
|
34
|
-
const mobx_1 = require("mobx");
|
|
35
|
-
const util_1 = require("@jbrowse/core/util");
|
|
36
|
-
// locals
|
|
37
12
|
const Checkbox2_1 = __importDefault(require("./Checkbox2"));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...rest,
|
|
41
|
-
displays: displays.map(({ id, ...rest }) => rest),
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
const BreakendMultiLevelOptionDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, feature, assemblyName, viewType, view, }) {
|
|
13
|
+
const navToMultiLevelBreak_1 = require("./navToMultiLevelBreak");
|
|
14
|
+
const BreakendMultiLevelOptionDialog = (0, mobx_react_1.observer)(function ({ session, handleClose, feature, assemblyName, stableViewId, view, }) {
|
|
45
15
|
const [copyTracks, setCopyTracks] = (0, react_1.useState)(true);
|
|
46
16
|
const [mirror, setMirror] = (0, react_1.useState)(true);
|
|
47
|
-
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (!asm) {
|
|
64
|
-
throw new Error(`assembly ${assemblyName} not found`);
|
|
65
|
-
}
|
|
66
|
-
const { refName, pos, mateRefName, matePos } = viewType.getBreakendCoveringRegions({
|
|
67
|
-
feature,
|
|
68
|
-
assembly: asm,
|
|
69
|
-
});
|
|
70
|
-
const viewTracks = (0, mobx_state_tree_1.getSnapshot)(view.tracks);
|
|
71
|
-
const breakpointSplitView = session.addView('BreakpointSplitView', {
|
|
72
|
-
type: 'BreakpointSplitView',
|
|
73
|
-
displayName: `${feature.get('name') || feature.get('id') || 'breakend'} split detail`,
|
|
74
|
-
views: [
|
|
75
|
-
{
|
|
76
|
-
type: 'LinearGenomeView',
|
|
77
|
-
hideHeader: true,
|
|
78
|
-
tracks: stripIds((0, mobx_state_tree_1.getSnapshot)(view.tracks)),
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: 'LinearGenomeView',
|
|
82
|
-
hideHeader: true,
|
|
83
|
-
tracks: stripIds(mirror ? [...viewTracks].reverse() : viewTracks),
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
});
|
|
87
|
-
const r1 = asm.regions.find(r => r.refName === refName);
|
|
88
|
-
const r2 = asm.regions.find(r => r.refName === mateRefName);
|
|
89
|
-
if (!r1 || !r2) {
|
|
90
|
-
throw new Error("can't find regions");
|
|
91
|
-
}
|
|
92
|
-
await Promise.all([
|
|
93
|
-
breakpointSplitView.views[0].navToLocations([
|
|
94
|
-
{
|
|
95
|
-
refName,
|
|
96
|
-
start: r1.start,
|
|
97
|
-
end: pos,
|
|
98
|
-
assemblyName,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
refName,
|
|
102
|
-
start: pos + 1,
|
|
103
|
-
end: r1.end,
|
|
104
|
-
assemblyName,
|
|
105
|
-
},
|
|
106
|
-
]),
|
|
107
|
-
breakpointSplitView.views[1].navToLocations([
|
|
108
|
-
{
|
|
109
|
-
refName: mateRefName,
|
|
110
|
-
start: r2.start,
|
|
111
|
-
end: matePos,
|
|
112
|
-
assemblyName,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
refName: mateRefName,
|
|
116
|
-
start: matePos + 1,
|
|
117
|
-
end: r2.end,
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Multi-level breakpoint split view options", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsx)("div", { children: "Launch multi-level breakpoint split view" }), view ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Checkbox2_1.default, { checked: copyTracks, label: "Copy tracks into the new view", onChange: event => {
|
|
18
|
+
setCopyTracks(event.target.checked);
|
|
19
|
+
} }), copyTracks ? ((0, jsx_runtime_1.jsx)(Checkbox2_1.default, { checked: mirror, disabled: !copyTracks, label: "Mirror the copied tracks (only available if copying tracks and using two level)", onChange: event => {
|
|
20
|
+
setMirror(event.target.checked);
|
|
21
|
+
} })) : null] })) : null] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
|
|
22
|
+
;
|
|
23
|
+
(async () => {
|
|
24
|
+
try {
|
|
25
|
+
await (0, navToMultiLevelBreak_1.navToMultiLevelBreak)({
|
|
26
|
+
stableViewId,
|
|
27
|
+
session,
|
|
28
|
+
tracks: copyTracks && view
|
|
29
|
+
? (0, mobx_state_tree_1.getSnapshot)(view.tracks)
|
|
30
|
+
: [],
|
|
31
|
+
mirror,
|
|
32
|
+
feature,
|
|
118
33
|
assemblyName,
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
console.error(e);
|
|
131
|
-
session.notify(`${e}`);
|
|
132
|
-
}
|
|
133
|
-
})();
|
|
134
|
-
handleClose();
|
|
135
|
-
}, variant: "contained", color: "primary", autoFocus: true }, "OK"),
|
|
136
|
-
react_1.default.createElement(material_1.Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
137
|
-
handleClose();
|
|
138
|
-
} }, "Cancel"))));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(e);
|
|
38
|
+
session.notifyError(`${e}`, e);
|
|
39
|
+
}
|
|
40
|
+
})();
|
|
41
|
+
handleClose();
|
|
42
|
+
}, variant: "contained", color: "primary", autoFocus: true, children: "OK" }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
43
|
+
handleClose();
|
|
44
|
+
}, children: "Cancel" })] })] }));
|
|
139
45
|
});
|
|
140
46
|
exports.default = BreakendMultiLevelOptionDialog;
|
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Feature } from '@jbrowse/core/util';
|
|
1
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
3
2
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
model: unknown;
|
|
3
|
+
declare const BreakendSingleLevelOptionDialog: ({ session, handleClose, feature, stableViewId, assemblyName, view, }: {
|
|
4
|
+
session: AbstractSessionModel;
|
|
7
5
|
handleClose: () => void;
|
|
6
|
+
stableViewId?: string;
|
|
8
7
|
feature: Feature;
|
|
9
|
-
view
|
|
8
|
+
view?: LinearGenomeViewModel;
|
|
10
9
|
assemblyName: string;
|
|
11
|
-
|
|
12
|
-
getBreakendCoveringRegions: (arg: {
|
|
13
|
-
feature: Feature;
|
|
14
|
-
assembly: Assembly;
|
|
15
|
-
}) => {
|
|
16
|
-
pos: number;
|
|
17
|
-
refName: string;
|
|
18
|
-
mateRefName: string;
|
|
19
|
-
matePos: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}) => React.JSX.Element;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
11
|
export default BreakendSingleLevelOptionDialog;
|
|
@@ -1,103 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const material_1 = require("@mui/material");
|
|
32
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
33
8
|
const ui_1 = require("@jbrowse/core/ui");
|
|
34
9
|
const util_1 = require("@jbrowse/core/util");
|
|
35
|
-
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const mobx_react_1 = require("mobx-react");
|
|
36
12
|
const Checkbox2_1 = __importDefault(require("./Checkbox2"));
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
...rest,
|
|
40
|
-
displays: displays.map(({ id, ...rest }) => rest),
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
const BreakendSingleLevelOptionDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, feature, assemblyName, viewType, view, }) {
|
|
13
|
+
const navToSingleLevelBreak_1 = require("./navToSingleLevelBreak");
|
|
14
|
+
const BreakendSingleLevelOptionDialog = (0, mobx_react_1.observer)(function ({ session, handleClose, feature, stableViewId, assemblyName, view, }) {
|
|
44
15
|
const [copyTracks, setCopyTracks] = (0, react_1.useState)(true);
|
|
16
|
+
const [focusOnBreakends, setFocusOnBreakends] = (0, react_1.useState)(true);
|
|
45
17
|
const [windowSize, setWindowSize] = (0, util_1.useLocalStorage)('breakpointWindowSize', '5000');
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
start: Math.max(0, pos - w),
|
|
81
|
-
end: pos + w,
|
|
82
|
-
assemblyName,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
refName: mateRefName,
|
|
86
|
-
start: Math.max(0, matePos - w),
|
|
87
|
-
end: matePos + w,
|
|
88
|
-
assemblyName,
|
|
89
|
-
},
|
|
90
|
-
], w));
|
|
91
|
-
}
|
|
92
|
-
catch (e) {
|
|
93
|
-
console.error(e);
|
|
94
|
-
session.notify(`${e}`);
|
|
95
|
-
}
|
|
96
|
-
})();
|
|
97
|
-
handleClose();
|
|
98
|
-
}, variant: "contained", color: "primary", autoFocus: true }, "OK"),
|
|
99
|
-
react_1.default.createElement(material_1.Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
100
|
-
handleClose();
|
|
101
|
-
} }, "Cancel"))));
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Single-level breakpoint split view options", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [view ? ((0, jsx_runtime_1.jsx)(Checkbox2_1.default, { checked: copyTracks, label: "Copy tracks into the new view", onChange: event => {
|
|
19
|
+
setCopyTracks(event.target.checked);
|
|
20
|
+
} })) : null, (0, jsx_runtime_1.jsx)(Checkbox2_1.default, { checked: copyTracks, label: "Focus on breakends", onChange: event => {
|
|
21
|
+
setFocusOnBreakends(event.target.checked);
|
|
22
|
+
} }), (0, jsx_runtime_1.jsx)(material_1.TextField, { label: "Window size (bp)", value: windowSize, onChange: event => {
|
|
23
|
+
setWindowSize(event.target.value);
|
|
24
|
+
} })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
|
|
25
|
+
;
|
|
26
|
+
(async () => {
|
|
27
|
+
try {
|
|
28
|
+
const { assemblyManager } = session;
|
|
29
|
+
const assembly = await assemblyManager.waitForAssembly(assemblyName);
|
|
30
|
+
if (!assembly) {
|
|
31
|
+
throw new Error(`assembly ${assemblyName} not found`);
|
|
32
|
+
}
|
|
33
|
+
await (0, navToSingleLevelBreak_1.navToSingleLevelBreak)({
|
|
34
|
+
feature,
|
|
35
|
+
assemblyName,
|
|
36
|
+
focusOnBreakends,
|
|
37
|
+
session,
|
|
38
|
+
stableViewId,
|
|
39
|
+
tracks: view === null || view === void 0 ? void 0 : view.tracks,
|
|
40
|
+
windowSize: +windowSize || 0,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
console.error(e);
|
|
45
|
+
session.notifyError(`${e}`, e);
|
|
46
|
+
}
|
|
47
|
+
})();
|
|
48
|
+
handleClose();
|
|
49
|
+
}, variant: "contained", color: "primary", autoFocus: true, children: "OK" }), (0, jsx_runtime_1.jsx)(material_1.Button, { color: "secondary", variant: "contained", onClick: () => {
|
|
50
|
+
handleClose();
|
|
51
|
+
}, children: "Cancel" })] })] }));
|
|
102
52
|
});
|
|
103
53
|
exports.default = BreakendSingleLevelOptionDialog;
|
package/dist/Checkbox2.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export default function Checkbox2({ checked, disabled, label, onChange, }: {
|
|
3
2
|
checked: boolean;
|
|
4
3
|
disabled?: boolean;
|
|
5
4
|
label: string;
|
|
6
5
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
-
}):
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/Checkbox2.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
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.default = Checkbox2;
|
|
7
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
5
|
const material_1 = require("@mui/material");
|
|
9
6
|
const mui_1 = require("tss-react/mui");
|
|
10
7
|
const useStyles = (0, mui_1.makeStyles)()({
|
|
@@ -14,5 +11,5 @@ const useStyles = (0, mui_1.makeStyles)()({
|
|
|
14
11
|
});
|
|
15
12
|
function Checkbox2({ checked, disabled, label, onChange, }) {
|
|
16
13
|
const { classes } = useStyles();
|
|
17
|
-
return (
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { disabled: disabled, className: classes.block, control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: checked, onChange: onChange }), label: label }));
|
|
18
15
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { default as BreakendMultiLevelOptionDialog } from './BreakendMultiLevelOptionDialog';
|
|
2
2
|
export { default as BreakendSingleLevelOptionDialog } from './BreakendSingleLevelOptionDialog';
|
|
3
|
+
export * from './util';
|
|
4
|
+
export * from './navToSingleLevelBreak';
|
|
5
|
+
export * from './navToMultiLevelBreak';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -8,3 +22,6 @@ var BreakendMultiLevelOptionDialog_1 = require("./BreakendMultiLevelOptionDialog
|
|
|
8
22
|
Object.defineProperty(exports, "BreakendMultiLevelOptionDialog", { enumerable: true, get: function () { return __importDefault(BreakendMultiLevelOptionDialog_1).default; } });
|
|
9
23
|
var BreakendSingleLevelOptionDialog_1 = require("./BreakendSingleLevelOptionDialog");
|
|
10
24
|
Object.defineProperty(exports, "BreakendSingleLevelOptionDialog", { enumerable: true, get: function () { return __importDefault(BreakendSingleLevelOptionDialog_1).default; } });
|
|
25
|
+
__exportStar(require("./util"), exports);
|
|
26
|
+
__exportStar(require("./navToSingleLevelBreak"), exports);
|
|
27
|
+
__exportStar(require("./navToMultiLevelBreak"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Track } from './types';
|
|
2
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
3
|
+
export declare function navToMultiLevelBreak({ stableViewId, feature, assemblyName, session, mirror, tracks: viewTracks, }: {
|
|
4
|
+
stableViewId?: string;
|
|
5
|
+
feature: Feature;
|
|
6
|
+
assemblyName: string;
|
|
7
|
+
windowSize?: number;
|
|
8
|
+
session: AbstractSessionModel;
|
|
9
|
+
mirror?: boolean;
|
|
10
|
+
tracks?: Track[];
|
|
11
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navToMultiLevelBreak = navToMultiLevelBreak;
|
|
4
|
+
const util_1 = require("@jbrowse/core/util");
|
|
5
|
+
const util_2 = require("./util");
|
|
6
|
+
async function navToMultiLevelBreak({ stableViewId, feature, assemblyName, session, mirror, tracks: viewTracks = [], }) {
|
|
7
|
+
const { assemblyManager } = session;
|
|
8
|
+
const assembly = await assemblyManager.waitForAssembly(assemblyName);
|
|
9
|
+
if (!assembly) {
|
|
10
|
+
throw new Error(`assembly ${assemblyName} not found`);
|
|
11
|
+
}
|
|
12
|
+
const { refName, pos, mateRefName, matePos } = (0, util_2.getBreakendCoveringRegions)({
|
|
13
|
+
feature,
|
|
14
|
+
assembly: assembly,
|
|
15
|
+
});
|
|
16
|
+
let view = session.views.find(f => f.id === stableViewId);
|
|
17
|
+
if (!view) {
|
|
18
|
+
view = session.addView('BreakpointSplitView', {
|
|
19
|
+
id: stableViewId,
|
|
20
|
+
type: 'BreakpointSplitView',
|
|
21
|
+
displayName: (0, util_2.makeTitle)(feature),
|
|
22
|
+
views: [
|
|
23
|
+
{
|
|
24
|
+
type: 'LinearGenomeView',
|
|
25
|
+
hideHeader: true,
|
|
26
|
+
tracks: (0, util_2.stripIds)(viewTracks),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'LinearGenomeView',
|
|
30
|
+
hideHeader: true,
|
|
31
|
+
tracks: (0, util_2.stripIds)(mirror ? [...viewTracks].reverse() : viewTracks),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
view.setDisplayName((0, util_2.makeTitle)(feature));
|
|
37
|
+
const r1 = assembly.regions.find(r => r.refName === refName);
|
|
38
|
+
const r2 = assembly.regions.find(r => r.refName === mateRefName);
|
|
39
|
+
if (!r1 || !r2) {
|
|
40
|
+
throw new Error("can't find regions");
|
|
41
|
+
}
|
|
42
|
+
await Promise.all([
|
|
43
|
+
view.views[0].navToLocations([
|
|
44
|
+
{
|
|
45
|
+
refName,
|
|
46
|
+
start: r1.start,
|
|
47
|
+
end: pos,
|
|
48
|
+
assemblyName,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
refName,
|
|
52
|
+
start: pos + 1,
|
|
53
|
+
end: r1.end,
|
|
54
|
+
assemblyName,
|
|
55
|
+
},
|
|
56
|
+
]),
|
|
57
|
+
view.views[1].navToLocations([
|
|
58
|
+
{
|
|
59
|
+
refName: mateRefName,
|
|
60
|
+
start: r2.start,
|
|
61
|
+
end: matePos,
|
|
62
|
+
assemblyName,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
refName: mateRefName,
|
|
66
|
+
start: matePos + 1,
|
|
67
|
+
end: r2.end,
|
|
68
|
+
assemblyName,
|
|
69
|
+
},
|
|
70
|
+
]),
|
|
71
|
+
]);
|
|
72
|
+
await (0, util_1.when)(() => view.views[1].initialized && view.views[0].initialized);
|
|
73
|
+
view.views[1].zoomTo(10);
|
|
74
|
+
view.views[0].zoomTo(10);
|
|
75
|
+
view.views[1].centerAt(matePos, mateRefName);
|
|
76
|
+
view.views[0].centerAt(pos, refName);
|
|
77
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util';
|
|
2
|
+
export declare function singleLevelFocusedSnapshotFromBreakendFeature({ feature, session, assemblyName, windowSize, }: {
|
|
3
|
+
feature: Feature;
|
|
4
|
+
session: AbstractSessionModel;
|
|
5
|
+
assemblyName: string;
|
|
6
|
+
windowSize?: number;
|
|
7
|
+
}): {
|
|
8
|
+
coverage: {
|
|
9
|
+
pos: number;
|
|
10
|
+
refName: string;
|
|
11
|
+
mateRefName: string;
|
|
12
|
+
matePos: any;
|
|
13
|
+
};
|
|
14
|
+
snap: {
|
|
15
|
+
type: string;
|
|
16
|
+
views: {
|
|
17
|
+
type: string;
|
|
18
|
+
displayedRegions: {
|
|
19
|
+
end: number;
|
|
20
|
+
assemblyName: string;
|
|
21
|
+
start: number;
|
|
22
|
+
refName: string;
|
|
23
|
+
}[];
|
|
24
|
+
}[];
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function singleLevelEncompassingSnapshotFromBreakendFeature({ feature, session, assemblyName, }: {
|
|
29
|
+
feature: Feature;
|
|
30
|
+
session: AbstractSessionModel;
|
|
31
|
+
assemblyName: string;
|
|
32
|
+
}): {
|
|
33
|
+
coverage: {
|
|
34
|
+
pos: number;
|
|
35
|
+
refName: string;
|
|
36
|
+
mateRefName: string;
|
|
37
|
+
matePos: any;
|
|
38
|
+
};
|
|
39
|
+
snap: {
|
|
40
|
+
type: string;
|
|
41
|
+
views: {
|
|
42
|
+
type: string;
|
|
43
|
+
displayedRegions: {
|
|
44
|
+
assemblyName: string;
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
refName: string;
|
|
48
|
+
}[];
|
|
49
|
+
}[];
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare function navToSingleLevelBreak({ stableViewId, feature, assemblyName, session, tracks, windowSize, focusOnBreakends, }: {
|
|
54
|
+
stableViewId?: string;
|
|
55
|
+
feature: Feature;
|
|
56
|
+
assemblyName: string;
|
|
57
|
+
windowSize?: number;
|
|
58
|
+
session: AbstractSessionModel;
|
|
59
|
+
tracks?: any;
|
|
60
|
+
focusOnBreakends?: boolean;
|
|
61
|
+
}): Promise<void>;
|