@jbrowse/plugin-breakpoint-split-view 3.7.0 → 4.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/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +1 -1
- package/esm/BreakpointAlignmentsFeatureDetail/index.js +2 -2
- package/esm/BreakpointGetFeatures/BreakpointGetFeatures.d.ts +51 -0
- package/esm/BreakpointGetFeatures/BreakpointGetFeatures.js +57 -0
- package/esm/BreakpointGetFeatures/index.d.ts +2 -0
- package/esm/BreakpointGetFeatures/index.js +4 -0
- package/esm/BreakpointSplitView/BreakpointSplitView.js +33 -47
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +2 -7
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +20 -25
- package/esm/BreakpointSplitView/components/Breakends.d.ts +2 -7
- package/esm/BreakpointSplitView/components/Breakends.js +28 -59
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +1 -1
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +19 -6
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +1 -1
- package/esm/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +3 -3
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +5 -1
- package/esm/BreakpointSplitView/components/Header.d.ts +2 -2
- package/esm/BreakpointSplitView/components/Header.js +4 -4
- package/esm/BreakpointSplitView/components/HeaderSearchBoxes.js +2 -2
- package/esm/BreakpointSplitView/components/Overlay.d.ts +1 -1
- package/esm/BreakpointSplitView/components/Overlay.js +8 -11
- package/esm/BreakpointSplitView/components/PairedFeatures.d.ts +2 -7
- package/esm/BreakpointSplitView/components/PairedFeatures.js +22 -47
- package/esm/BreakpointSplitView/components/Rubberband.d.ts +6 -0
- package/esm/BreakpointSplitView/components/Rubberband.js +27 -0
- package/esm/BreakpointSplitView/components/RubberbandSpan.d.ts +15 -0
- package/esm/BreakpointSplitView/components/RubberbandSpan.js +30 -0
- package/esm/BreakpointSplitView/components/RubberbandTooltip.d.ts +5 -0
- package/esm/BreakpointSplitView/components/RubberbandTooltip.js +17 -0
- package/esm/BreakpointSplitView/components/Translocations.d.ts +2 -7
- package/esm/BreakpointSplitView/components/Translocations.js +23 -58
- package/esm/BreakpointSplitView/components/VerticalGuide.d.ts +6 -0
- package/esm/BreakpointSplitView/components/VerticalGuide.js +24 -0
- package/esm/BreakpointSplitView/components/overlayUtils.d.ts +24 -0
- package/esm/BreakpointSplitView/components/overlayUtils.js +47 -0
- package/esm/BreakpointSplitView/components/rubberbandUtil.d.ts +4 -0
- package/esm/BreakpointSplitView/components/rubberbandUtil.js +3 -0
- package/esm/BreakpointSplitView/components/useRangeSelect.d.ts +59 -0
- package/esm/BreakpointSplitView/components/useRangeSelect.js +121 -0
- package/esm/BreakpointSplitView/components/util.js +1 -2
- package/esm/BreakpointSplitView/getClip.js +4 -4
- package/esm/BreakpointSplitView/index.js +2 -2
- package/esm/BreakpointSplitView/model.d.ts +402 -117
- package/esm/BreakpointSplitView/model.js +105 -41
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +2 -2
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +8 -8
- package/esm/BreakpointSplitView/types.d.ts +8 -0
- package/esm/BreakpointSplitView/util.d.ts +1 -1
- package/esm/BreakpointSplitView/util.js +8 -17
- package/esm/LaunchBreakpointSplitView/index.d.ts +2 -0
- package/esm/LaunchBreakpointSplitView/index.js +12 -0
- package/esm/index.js +7 -6
- package/package.json +28 -34
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +0 -10
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +0 -12
- package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +0 -2
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +0 -67
- package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +0 -34
- package/dist/BreakpointSplitView/BreakpointSplitView.js +0 -84
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +0 -8
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +0 -133
- package/dist/BreakpointSplitView/components/Breakends.d.ts +0 -8
- package/dist/BreakpointSplitView/components/Breakends.js +0 -95
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +0 -5
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +0 -46
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.d.ts +0 -5
- package/dist/BreakpointSplitView/components/BreakpointSplitViewOverlay.js +0 -33
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +0 -57
- package/dist/BreakpointSplitView/components/Header.d.ts +0 -5
- package/dist/BreakpointSplitView/components/Header.js +0 -52
- package/dist/BreakpointSplitView/components/HeaderSearchBoxes.d.ts +0 -5
- package/dist/BreakpointSplitView/components/HeaderSearchBoxes.js +0 -24
- package/dist/BreakpointSplitView/components/Overlay.d.ts +0 -8
- package/dist/BreakpointSplitView/components/Overlay.js +0 -27
- package/dist/BreakpointSplitView/components/PairedFeatures.d.ts +0 -8
- package/dist/BreakpointSplitView/components/PairedFeatures.js +0 -75
- package/dist/BreakpointSplitView/components/Translocations.d.ts +0 -8
- package/dist/BreakpointSplitView/components/Translocations.js +0 -99
- package/dist/BreakpointSplitView/components/getOrientationColor.d.ts +0 -41
- package/dist/BreakpointSplitView/components/getOrientationColor.js +0 -103
- package/dist/BreakpointSplitView/components/util.d.ts +0 -8
- package/dist/BreakpointSplitView/components/util.js +0 -142
- package/dist/BreakpointSplitView/getClip.d.ts +0 -1
- package/dist/BreakpointSplitView/getClip.js +0 -10
- package/dist/BreakpointSplitView/index.d.ts +0 -2
- package/dist/BreakpointSplitView/index.js +0 -52
- package/dist/BreakpointSplitView/model.d.ts +0 -344
- package/dist/BreakpointSplitView/model.js +0 -256
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +0 -5
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +0 -10
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +0 -5
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +0 -41
- package/dist/BreakpointSplitView/svgcomponents/util.d.ts +0 -4
- package/dist/BreakpointSplitView/svgcomponents/util.js +0 -18
- package/dist/BreakpointSplitView/types.d.ts +0 -22
- package/dist/BreakpointSplitView/types.js +0 -2
- package/dist/BreakpointSplitView/util.d.ts +0 -28
- package/dist/BreakpointSplitView/util.js +0 -67
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -20
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
|
-
const util_2 = require("./util");
|
|
9
|
-
const util_3 = require("../util");
|
|
10
|
-
const [LEFT] = [0, 1, 2, 3];
|
|
11
|
-
const PairedFeatures = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
12
|
-
const { interactiveOverlay, views } = model;
|
|
13
|
-
const session = (0, util_1.getSession)(model);
|
|
14
|
-
const { assemblyManager } = session;
|
|
15
|
-
const totalFeatures = model.getTrackFeatures(trackId);
|
|
16
|
-
const layoutMatches = (0, react_1.useMemo)(() => model.getMatchedFeaturesInLayout(trackId, (0, util_2.getMatchedPairedFeatures)(totalFeatures)), [totalFeatures, trackId, model]);
|
|
17
|
-
const [mouseoverElt, setMouseoverElt] = (0, react_1.useState)();
|
|
18
|
-
const snap = (0, mobx_state_tree_1.getSnapshot)(model);
|
|
19
|
-
(0, util_3.useNextFrame)(snap);
|
|
20
|
-
const assembly = assemblyManager.get(views[0].assemblyNames[0]);
|
|
21
|
-
if (!assembly) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
let yoff = 0;
|
|
25
|
-
if (ref.current) {
|
|
26
|
-
const rect = ref.current.getBoundingClientRect();
|
|
27
|
-
yoff = rect.top;
|
|
28
|
-
}
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("g", { stroke: "green", strokeWidth: 5, fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId, children: layoutMatches.map(chunk => {
|
|
30
|
-
const ret = [];
|
|
31
|
-
for (let i = 0; i < chunk.length - 1; i += 1) {
|
|
32
|
-
const { layout: c1, feature: f1, level: level1 } = chunk[i];
|
|
33
|
-
const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
|
|
34
|
-
const id = f1.id();
|
|
35
|
-
if (!c1 || !c2) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
const f1origref = f1.get('refName');
|
|
39
|
-
const f2origref = f2.get('refName');
|
|
40
|
-
const f1ref = assembly.getCanonicalRefName(f1origref);
|
|
41
|
-
const f2ref = assembly.getCanonicalRefName(f2origref);
|
|
42
|
-
if (!f1ref || !f2ref) {
|
|
43
|
-
throw new Error(`unable to find ref for ${f1ref || f2ref}`);
|
|
44
|
-
}
|
|
45
|
-
const x1 = (0, util_3.getPxFromCoordinate)(views[level1], f1ref, c1[LEFT]);
|
|
46
|
-
const x2 = (0, util_3.getPxFromCoordinate)(views[level2], f2ref, c2[LEFT]);
|
|
47
|
-
const tracks = views.map(v => v.getTrack(trackId));
|
|
48
|
-
const y1 = (0, util_3.yPos)(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
49
|
-
yoff;
|
|
50
|
-
const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
51
|
-
yoff;
|
|
52
|
-
const path = [
|
|
53
|
-
'M',
|
|
54
|
-
x1,
|
|
55
|
-
y1,
|
|
56
|
-
'L',
|
|
57
|
-
x2,
|
|
58
|
-
y2,
|
|
59
|
-
].join(' ');
|
|
60
|
-
ret.push((0, jsx_runtime_1.jsx)("path", { d: path, "data-testid": "r2", pointerEvents: interactiveOverlay ? 'auto' : undefined, strokeWidth: id === mouseoverElt ? 10 : 5, onClick: () => {
|
|
61
|
-
var _a, _b, _c;
|
|
62
|
-
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'VariantFeatureWidget', 'variantFeature', {
|
|
63
|
-
featureData: (_b = totalFeatures.get(id)) === null || _b === void 0 ? void 0 : _b.toJSON(),
|
|
64
|
-
});
|
|
65
|
-
(_c = session.showWidget) === null || _c === void 0 ? void 0 : _c.call(session, featureWidget);
|
|
66
|
-
}, onMouseOver: () => {
|
|
67
|
-
setMouseoverElt(id);
|
|
68
|
-
}, onMouseOut: () => {
|
|
69
|
-
setMouseoverElt(undefined);
|
|
70
|
-
} }, JSON.stringify(path)));
|
|
71
|
-
}
|
|
72
|
-
return ret;
|
|
73
|
-
}) }));
|
|
74
|
-
});
|
|
75
|
-
exports.default = PairedFeatures;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BreakpointViewModel } from '../model';
|
|
2
|
-
declare const Translocations: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
|
|
3
|
-
model: BreakpointViewModel;
|
|
4
|
-
trackId: string;
|
|
5
|
-
parentRef: React.RefObject<SVGSVGElement | null>;
|
|
6
|
-
getTrackYPosOverride?: (trackId: string, level: number) => number;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
export default Translocations;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const util_1 = require("@jbrowse/core/util");
|
|
6
|
-
const mobx_react_1 = require("mobx-react");
|
|
7
|
-
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
|
-
const util_2 = require("./util");
|
|
9
|
-
const util_3 = require("../util");
|
|
10
|
-
const [LEFT] = [0, 1, 2, 3];
|
|
11
|
-
function str(s) {
|
|
12
|
-
if (s === '+') {
|
|
13
|
-
return 1;
|
|
14
|
-
}
|
|
15
|
-
else if (s === '-') {
|
|
16
|
-
return -1;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const Translocations = (0, mobx_react_1.observer)(function ({ model, trackId, parentRef: ref, getTrackYPosOverride, }) {
|
|
23
|
-
const { interactiveOverlay, views } = model;
|
|
24
|
-
const session = (0, util_1.getSession)(model);
|
|
25
|
-
const { assemblyManager } = session;
|
|
26
|
-
const totalFeatures = model.getTrackFeatures(trackId);
|
|
27
|
-
const layoutMatches = (0, react_1.useMemo)(() => model.getMatchedFeaturesInLayout(trackId, (0, util_2.getMatchedTranslocationFeatures)(totalFeatures)), [totalFeatures, trackId, model]);
|
|
28
|
-
const [mouseoverElt, setMouseoverElt] = (0, react_1.useState)();
|
|
29
|
-
const snap = (0, mobx_state_tree_1.getSnapshot)(model);
|
|
30
|
-
(0, util_3.useNextFrame)(snap);
|
|
31
|
-
const assembly = assemblyManager.get(views[0].assemblyNames[0]);
|
|
32
|
-
if (!assembly) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
let yOffset = 0;
|
|
36
|
-
if (ref.current) {
|
|
37
|
-
const rect = ref.current.getBoundingClientRect();
|
|
38
|
-
yOffset = rect.top;
|
|
39
|
-
}
|
|
40
|
-
if (views.length < 2) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
return ((0, jsx_runtime_1.jsx)("g", { fill: "none", stroke: "green", strokeWidth: 5, "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId, children: layoutMatches.map(chunk => {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
const ret = [];
|
|
46
|
-
for (const { layout: c1, feature: f1, level: level1 } of chunk) {
|
|
47
|
-
const level2 = level1 === 0 ? 1 : 0;
|
|
48
|
-
const id = f1.id();
|
|
49
|
-
if (!c1) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
const info = f1.get('INFO');
|
|
53
|
-
const chr2 = info.CHR2[0];
|
|
54
|
-
const end2 = info.END[0];
|
|
55
|
-
const res = (_b = (_a = info.STRANDS) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.split('');
|
|
56
|
-
const [myDirection, mateDirection] = res !== null && res !== void 0 ? res : ['.', '.'];
|
|
57
|
-
const r = (0, util_3.getPxFromCoordinate)(views[level2], chr2, end2);
|
|
58
|
-
if (r) {
|
|
59
|
-
const c2 = [r, 0, r + 1, 0];
|
|
60
|
-
const x1 = (0, util_3.getPxFromCoordinate)(views[level1], f1.get('refName'), c1[LEFT]);
|
|
61
|
-
const x2 = r;
|
|
62
|
-
const reversed1 = views[level1].pxToBp(x1).reversed;
|
|
63
|
-
const reversed2 = views[level2].pxToBp(x2).reversed;
|
|
64
|
-
const tracks = views.map(v => v.getTrack(trackId));
|
|
65
|
-
const y1 = (0, util_3.yPos)(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
66
|
-
yOffset;
|
|
67
|
-
const y2 = (0, util_3.yPos)(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
68
|
-
yOffset;
|
|
69
|
-
const path = [
|
|
70
|
-
'M',
|
|
71
|
-
x1 - 20 * str(myDirection) * (reversed1 ? -1 : 1),
|
|
72
|
-
y1,
|
|
73
|
-
'L',
|
|
74
|
-
x1,
|
|
75
|
-
y1,
|
|
76
|
-
'L',
|
|
77
|
-
x2,
|
|
78
|
-
y2,
|
|
79
|
-
'L',
|
|
80
|
-
x2 - 20 * str(mateDirection) * (reversed2 ? -1 : 1),
|
|
81
|
-
y2,
|
|
82
|
-
].join(' ');
|
|
83
|
-
ret.push((0, jsx_runtime_1.jsx)("path", { d: path, pointerEvents: interactiveOverlay ? 'auto' : undefined, strokeWidth: id === mouseoverElt ? 10 : 5, onClick: () => {
|
|
84
|
-
var _a, _b;
|
|
85
|
-
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'VariantFeatureWidget', 'variantFeature', {
|
|
86
|
-
featureData: (totalFeatures.get(id) || { toJSON: () => { } }).toJSON(),
|
|
87
|
-
});
|
|
88
|
-
(_b = session.showWidget) === null || _b === void 0 ? void 0 : _b.call(session, featureWidget);
|
|
89
|
-
}, onMouseOver: () => {
|
|
90
|
-
setMouseoverElt(id);
|
|
91
|
-
}, onMouseOut: () => {
|
|
92
|
-
setMouseoverElt(undefined);
|
|
93
|
-
} }, JSON.stringify(path)));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return ret;
|
|
97
|
-
}) }));
|
|
98
|
-
});
|
|
99
|
-
exports.default = Translocations;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export declare const orientationTypes: {
|
|
2
|
-
fr: Record<string, string>;
|
|
3
|
-
rf: Record<string, string>;
|
|
4
|
-
ff: Record<string, string>;
|
|
5
|
-
};
|
|
6
|
-
export declare const pairMap: {
|
|
7
|
-
readonly LR: "color_pair_lr";
|
|
8
|
-
readonly LL: "color_pair_ll";
|
|
9
|
-
readonly RR: "color_pair_rr";
|
|
10
|
-
readonly RL: "color_pair_rl";
|
|
11
|
-
};
|
|
12
|
-
export declare const strokeColor: {
|
|
13
|
-
color_fwd_strand_not_proper: string;
|
|
14
|
-
color_rev_strand_not_proper: string;
|
|
15
|
-
color_fwd_strand: string;
|
|
16
|
-
color_rev_strand: string;
|
|
17
|
-
color_fwd_missing_mate: string;
|
|
18
|
-
color_rev_missing_mate: string;
|
|
19
|
-
color_fwd_diff_chr: string;
|
|
20
|
-
color_rev_diff_chr: string;
|
|
21
|
-
color_pair_lr: string;
|
|
22
|
-
color_pair_rr: string;
|
|
23
|
-
color_pair_rl: string;
|
|
24
|
-
color_pair_ll: string;
|
|
25
|
-
color_nostrand: string;
|
|
26
|
-
color_interchrom: string;
|
|
27
|
-
color_longinsert: string;
|
|
28
|
-
color_shortinsert: string;
|
|
29
|
-
color_unknown: string;
|
|
30
|
-
};
|
|
31
|
-
export declare function getPairedOrientationColorOrDefault(f: {
|
|
32
|
-
pair_orientation?: string;
|
|
33
|
-
}): string | undefined;
|
|
34
|
-
export declare function getLongReadOrientationColorOrDefault(s1: number, s2: number): string;
|
|
35
|
-
export declare function getLongReadOrientationAbnormal(s1: number, s2: number): boolean;
|
|
36
|
-
export declare function isAbnormalOrientation(f: {
|
|
37
|
-
pair_orientation?: string;
|
|
38
|
-
}): boolean;
|
|
39
|
-
export declare function getPairedOrientationColor(f: {
|
|
40
|
-
pair_orientation?: string;
|
|
41
|
-
}): string;
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.strokeColor = exports.pairMap = exports.orientationTypes = void 0;
|
|
4
|
-
exports.getPairedOrientationColorOrDefault = getPairedOrientationColorOrDefault;
|
|
5
|
-
exports.getLongReadOrientationColorOrDefault = getLongReadOrientationColorOrDefault;
|
|
6
|
-
exports.getLongReadOrientationAbnormal = getLongReadOrientationAbnormal;
|
|
7
|
-
exports.isAbnormalOrientation = isAbnormalOrientation;
|
|
8
|
-
exports.getPairedOrientationColor = getPairedOrientationColor;
|
|
9
|
-
const material_1 = require("@mui/material");
|
|
10
|
-
exports.orientationTypes = {
|
|
11
|
-
fr: {
|
|
12
|
-
F1R2: 'LR',
|
|
13
|
-
F2R1: 'LR',
|
|
14
|
-
F1F2: 'LL',
|
|
15
|
-
F2F1: 'LL',
|
|
16
|
-
R1R2: 'RR',
|
|
17
|
-
R2R1: 'RR',
|
|
18
|
-
R1F2: 'RL',
|
|
19
|
-
R2F1: 'RL',
|
|
20
|
-
},
|
|
21
|
-
rf: {
|
|
22
|
-
R1F2: 'LR',
|
|
23
|
-
R2F1: 'LR',
|
|
24
|
-
R1R2: 'LL',
|
|
25
|
-
R2R1: 'LL',
|
|
26
|
-
F1F2: 'RR',
|
|
27
|
-
F2F1: 'RR',
|
|
28
|
-
F1R2: 'RL',
|
|
29
|
-
F2R1: 'RL',
|
|
30
|
-
},
|
|
31
|
-
ff: {
|
|
32
|
-
F2F1: 'LR',
|
|
33
|
-
R1R2: 'LR',
|
|
34
|
-
F2R1: 'LL',
|
|
35
|
-
R1F2: 'LL',
|
|
36
|
-
R2F1: 'RR',
|
|
37
|
-
F1R2: 'RR',
|
|
38
|
-
R2R1: 'RL',
|
|
39
|
-
F1F2: 'RL',
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
exports.pairMap = {
|
|
43
|
-
LR: 'color_pair_lr',
|
|
44
|
-
LL: 'color_pair_ll',
|
|
45
|
-
RR: 'color_pair_rr',
|
|
46
|
-
RL: 'color_pair_rl',
|
|
47
|
-
};
|
|
48
|
-
exports.strokeColor = {
|
|
49
|
-
color_fwd_strand_not_proper: (0, material_1.alpha)('#CA6767', 0.8),
|
|
50
|
-
color_rev_strand_not_proper: (0, material_1.alpha)('#7272AA', 0.8),
|
|
51
|
-
color_fwd_strand: (0, material_1.alpha)('#DC2A2A', 0.8),
|
|
52
|
-
color_rev_strand: (0, material_1.alpha)('#4141BA', 0.8),
|
|
53
|
-
color_fwd_missing_mate: (0, material_1.alpha)('#921111', 0.8),
|
|
54
|
-
color_rev_missing_mate: (0, material_1.alpha)('#111192', 0.8),
|
|
55
|
-
color_fwd_diff_chr: (0, material_1.alpha)('#000000', 0.8),
|
|
56
|
-
color_rev_diff_chr: (0, material_1.alpha)('#696969', 0.8),
|
|
57
|
-
color_pair_lr: (0, material_1.alpha)('#8C8C8C', 0.8),
|
|
58
|
-
color_pair_rr: (0, material_1.alpha)('#00005A', 0.8),
|
|
59
|
-
color_pair_rl: (0, material_1.alpha)('#005A5A', 0.8),
|
|
60
|
-
color_pair_ll: (0, material_1.alpha)('#005A00', 0.8),
|
|
61
|
-
color_nostrand: (0, material_1.alpha)('#8C8C8C', 0.8),
|
|
62
|
-
color_interchrom: (0, material_1.alpha)('#5A005A', 0.8),
|
|
63
|
-
color_longinsert: (0, material_1.alpha)('#B30000', 0.8),
|
|
64
|
-
color_shortinsert: (0, material_1.alpha)('#FF3A5C', 0.8),
|
|
65
|
-
color_unknown: (0, material_1.alpha)('#555', 0.8),
|
|
66
|
-
};
|
|
67
|
-
const defaultColor = exports.strokeColor.color_unknown;
|
|
68
|
-
function getPairedOrientationColorOrDefault(f) {
|
|
69
|
-
const type = exports.orientationTypes.fr;
|
|
70
|
-
const r = type[f.pair_orientation || ''];
|
|
71
|
-
const type2 = exports.pairMap[r];
|
|
72
|
-
return r === 'LR' ? undefined : exports.strokeColor[type2];
|
|
73
|
-
}
|
|
74
|
-
function getLongReadOrientationColorOrDefault(s1, s2) {
|
|
75
|
-
if (s1 === -1 && s2 === 1) {
|
|
76
|
-
return exports.strokeColor.color_pair_rr;
|
|
77
|
-
}
|
|
78
|
-
else if (s1 === 1 && s2 === -1) {
|
|
79
|
-
return exports.strokeColor.color_pair_ll;
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return exports.strokeColor.color_unknown;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function getLongReadOrientationAbnormal(s1, s2) {
|
|
86
|
-
if (s1 === -1 && s2 === 1) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
else if (s1 === 1 && s2 === -1) {
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function isAbnormalOrientation(f) {
|
|
97
|
-
const type = exports.orientationTypes.fr;
|
|
98
|
-
const r = type[f.pair_orientation || ''];
|
|
99
|
-
return r !== 'LR';
|
|
100
|
-
}
|
|
101
|
-
function getPairedOrientationColor(f) {
|
|
102
|
-
return getPairedOrientationColorOrDefault(f) || defaultColor;
|
|
103
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
2
|
-
export declare function getBadlyPairedAlignments(features: Map<string, Feature>): Feature[][];
|
|
3
|
-
export declare function getMatchedAlignmentFeatures(features: Map<string, Feature>): Feature[][];
|
|
4
|
-
export declare function hasPairedReads(features: Map<string, Feature>): boolean;
|
|
5
|
-
export declare function findMatchingAlt(feat1: Feature, feat2: Feature): import("@gmod/vcf").Breakend | undefined;
|
|
6
|
-
export declare function getMatchedBreakendFeatures(feats: Map<string, Feature>): Feature[][];
|
|
7
|
-
export declare function getMatchedTranslocationFeatures(feats: Map<string, Feature>): Feature[][];
|
|
8
|
-
export declare function getMatchedPairedFeatures(feats: Map<string, Feature>): Feature[][];
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBadlyPairedAlignments = getBadlyPairedAlignments;
|
|
4
|
-
exports.getMatchedAlignmentFeatures = getMatchedAlignmentFeatures;
|
|
5
|
-
exports.hasPairedReads = hasPairedReads;
|
|
6
|
-
exports.findMatchingAlt = findMatchingAlt;
|
|
7
|
-
exports.getMatchedBreakendFeatures = getMatchedBreakendFeatures;
|
|
8
|
-
exports.getMatchedTranslocationFeatures = getMatchedTranslocationFeatures;
|
|
9
|
-
exports.getMatchedPairedFeatures = getMatchedPairedFeatures;
|
|
10
|
-
const vcf_1 = require("@gmod/vcf");
|
|
11
|
-
const util_1 = require("@jbrowse/core/util");
|
|
12
|
-
function getBadlyPairedAlignments(features) {
|
|
13
|
-
const candidates = new Map();
|
|
14
|
-
const alreadySeen = new Set();
|
|
15
|
-
const alreadyPairedWithSamePosition = new Set();
|
|
16
|
-
for (const feature of features.values()) {
|
|
17
|
-
const flags = feature.get('flags');
|
|
18
|
-
const id = feature.id();
|
|
19
|
-
const supp = (0, util_1.assembleLocStringFast)({
|
|
20
|
-
refName: feature.get('refName'),
|
|
21
|
-
start: feature.get('start'),
|
|
22
|
-
end: feature.get('end'),
|
|
23
|
-
});
|
|
24
|
-
const unmapped = flags & 4;
|
|
25
|
-
const correctlyPaired = flags & 2;
|
|
26
|
-
if (!alreadySeen.has(id) &&
|
|
27
|
-
!alreadyPairedWithSamePosition.has(supp) &&
|
|
28
|
-
!correctlyPaired &&
|
|
29
|
-
!unmapped) {
|
|
30
|
-
const n = feature.get('name');
|
|
31
|
-
let val = candidates.get(n);
|
|
32
|
-
if (!val) {
|
|
33
|
-
val = [];
|
|
34
|
-
candidates.set(n, val);
|
|
35
|
-
}
|
|
36
|
-
val.push(feature);
|
|
37
|
-
}
|
|
38
|
-
alreadySeen.add(feature.id());
|
|
39
|
-
alreadyPairedWithSamePosition.add(supp);
|
|
40
|
-
}
|
|
41
|
-
return [...candidates.values()].filter(v => v.length > 1);
|
|
42
|
-
}
|
|
43
|
-
function getMatchedAlignmentFeatures(features) {
|
|
44
|
-
var _a;
|
|
45
|
-
const candidates = new Map();
|
|
46
|
-
const alreadySeen = new Set();
|
|
47
|
-
for (const feature of features.values()) {
|
|
48
|
-
const id = feature.id();
|
|
49
|
-
const unmapped = feature.get('flags') & 4;
|
|
50
|
-
const hasSA = !!((_a = feature.get('tags')) === null || _a === void 0 ? void 0 : _a.SA);
|
|
51
|
-
if (!alreadySeen.has(id) && !unmapped && hasSA) {
|
|
52
|
-
const n = feature.get('name');
|
|
53
|
-
let val = candidates.get(n);
|
|
54
|
-
if (!val) {
|
|
55
|
-
val = [];
|
|
56
|
-
candidates.set(n, val);
|
|
57
|
-
}
|
|
58
|
-
val.push(feature);
|
|
59
|
-
}
|
|
60
|
-
alreadySeen.add(feature.id());
|
|
61
|
-
}
|
|
62
|
-
return [...candidates.values()].filter(v => v.length > 1);
|
|
63
|
-
}
|
|
64
|
-
function hasPairedReads(features) {
|
|
65
|
-
for (const f of features.values()) {
|
|
66
|
-
if (f.get('flags') & 1) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
function findMatchingAlt(feat1, feat2) {
|
|
73
|
-
const alts = feat1.get('ALT');
|
|
74
|
-
if (alts) {
|
|
75
|
-
return new Map(alts
|
|
76
|
-
.map(alt => (0, vcf_1.parseBreakend)(alt))
|
|
77
|
-
.filter(util_1.notEmpty)
|
|
78
|
-
.map(bnd => [bnd.MatePosition, bnd])).get(`${feat2.get('refName')}:${feat2.get('start') + 1}`);
|
|
79
|
-
}
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
function getMatchedBreakendFeatures(feats) {
|
|
83
|
-
const candidates = new Map();
|
|
84
|
-
const alreadySeen = new Set();
|
|
85
|
-
for (const f of feats.values()) {
|
|
86
|
-
if (!alreadySeen.has(f.id()) && f.get('type') === 'breakend') {
|
|
87
|
-
const alts = f.get('ALT');
|
|
88
|
-
if (alts) {
|
|
89
|
-
for (const a of alts) {
|
|
90
|
-
const cur = `${f.get('refName')}:${f.get('start') + 1}`;
|
|
91
|
-
const bnd = (0, vcf_1.parseBreakend)(a);
|
|
92
|
-
if (bnd) {
|
|
93
|
-
const val = candidates.get(cur);
|
|
94
|
-
if (!val) {
|
|
95
|
-
candidates.set(bnd.MatePosition || 'none', [f]);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
val.push(f);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
alreadySeen.add(f.id());
|
|
105
|
-
}
|
|
106
|
-
return [...candidates.values()].filter(v => v.length > 1);
|
|
107
|
-
}
|
|
108
|
-
function getMatchedTranslocationFeatures(feats) {
|
|
109
|
-
const ret = [];
|
|
110
|
-
const alreadySeen = new Set();
|
|
111
|
-
for (const f of feats.values()) {
|
|
112
|
-
if (!alreadySeen.has(f.id()) && f.get('ALT')[0] === '<TRA>') {
|
|
113
|
-
ret.push([f]);
|
|
114
|
-
}
|
|
115
|
-
alreadySeen.add(f.id());
|
|
116
|
-
}
|
|
117
|
-
return ret;
|
|
118
|
-
}
|
|
119
|
-
function getMatchedPairedFeatures(feats) {
|
|
120
|
-
const candidates = new Map();
|
|
121
|
-
const alreadySeen = new Set();
|
|
122
|
-
for (const f of feats.values()) {
|
|
123
|
-
if (!alreadySeen.has(f.id()) && f.get('type') === 'paired_feature') {
|
|
124
|
-
const r1 = f.id().replace('-r1', '');
|
|
125
|
-
const r2 = f.id().replace('-r2', '');
|
|
126
|
-
if (f.id().endsWith('-r1')) {
|
|
127
|
-
if (!candidates.get(r1)) {
|
|
128
|
-
candidates.set(r1, []);
|
|
129
|
-
}
|
|
130
|
-
candidates.get(r1).push(f);
|
|
131
|
-
}
|
|
132
|
-
else if (f.id().endsWith('-r2')) {
|
|
133
|
-
if (!candidates.get(r2)) {
|
|
134
|
-
candidates.set(r2, []);
|
|
135
|
-
}
|
|
136
|
-
candidates.get(r2).push(f);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
alreadySeen.add(f.id());
|
|
140
|
-
}
|
|
141
|
-
return [...candidates.values()].filter(v => v.length > 1);
|
|
142
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getClip(cigar: string, strand: number): number;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getClip = getClip;
|
|
4
|
-
const startClip = new RegExp(/(\d+)[SH]$/);
|
|
5
|
-
const endClip = new RegExp(/^(\d+)([SH])/);
|
|
6
|
-
function getClip(cigar, strand) {
|
|
7
|
-
return strand === -1
|
|
8
|
-
? +(startClip.exec(cigar) || [])[1] || 0
|
|
9
|
-
: +(endClip.exec(cigar) || [])[1] || 0;
|
|
10
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.default = BreakpointSplitViewF;
|
|
40
|
-
const react_1 = require("react");
|
|
41
|
-
const pluggableElementTypes_1 = require("@jbrowse/core/pluggableElementTypes");
|
|
42
|
-
const model_1 = __importDefault(require("./model"));
|
|
43
|
-
function BreakpointSplitViewF(pluginManager) {
|
|
44
|
-
pluginManager.addViewType(() => {
|
|
45
|
-
return new pluggableElementTypes_1.ViewType({
|
|
46
|
-
name: 'BreakpointSplitView',
|
|
47
|
-
displayName: 'Breakpoint split view',
|
|
48
|
-
stateModel: (0, model_1.default)(pluginManager),
|
|
49
|
-
ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/BreakpointSplitView')))),
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|