@jbrowse/plugin-breakpoint-split-view 2.6.1
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/LICENSE +201 -0
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +5 -0
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +21 -0
- package/dist/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js.map +1 -0
- package/dist/BreakpointAlignmentsFeatureDetail/index.d.ts +3 -0
- package/dist/BreakpointAlignmentsFeatureDetail/index.js +57 -0
- package/dist/BreakpointAlignmentsFeatureDetail/index.js.map +1 -0
- package/dist/BreakpointSplitView/BreakpointSplitView.d.ts +23 -0
- package/dist/BreakpointSplitView/BreakpointSplitView.js +92 -0
- package/dist/BreakpointSplitView/BreakpointSplitView.js.map +1 -0
- package/dist/BreakpointSplitView/components/AlignmentConnections.d.ts +9 -0
- package/dist/BreakpointSplitView/components/AlignmentConnections.js +133 -0
- package/dist/BreakpointSplitView/components/AlignmentConnections.js.map +1 -0
- package/dist/BreakpointSplitView/components/Breakends.d.ts +9 -0
- package/dist/BreakpointSplitView/components/Breakends.js +117 -0
- package/dist/BreakpointSplitView/components/Breakends.js.map +1 -0
- package/dist/BreakpointSplitView/components/BreakpointSplitView.d.ts +6 -0
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js +89 -0
- package/dist/BreakpointSplitView/components/BreakpointSplitView.js.map +1 -0
- package/dist/BreakpointSplitView/components/ExportSvgDialog.d.ts +8 -0
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js +84 -0
- package/dist/BreakpointSplitView/components/ExportSvgDialog.js.map +1 -0
- package/dist/BreakpointSplitView/components/Overlay.d.ts +9 -0
- package/dist/BreakpointSplitView/components/Overlay.js +23 -0
- package/dist/BreakpointSplitView/components/Overlay.js.map +1 -0
- package/dist/BreakpointSplitView/components/Translocations.d.ts +9 -0
- package/dist/BreakpointSplitView/components/Translocations.js +113 -0
- package/dist/BreakpointSplitView/components/Translocations.js.map +1 -0
- package/dist/BreakpointSplitView/components/util.d.ts +7 -0
- package/dist/BreakpointSplitView/components/util.js +116 -0
- package/dist/BreakpointSplitView/components/util.js.map +1 -0
- package/dist/BreakpointSplitView/index.d.ts +3 -0
- package/dist/BreakpointSplitView/index.js +43 -0
- package/dist/BreakpointSplitView/index.js.map +1 -0
- package/dist/BreakpointSplitView/model.d.ts +299 -0
- package/dist/BreakpointSplitView/model.js +245 -0
- package/dist/BreakpointSplitView/model.js.map +1 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +6 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js +13 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBackground.js.map +1 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +4 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +83 -0
- package/dist/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js.map +1 -0
- package/dist/BreakpointSplitView/util.d.ts +18 -0
- package/dist/BreakpointSplitView/util.js +56 -0
- package/dist/BreakpointSplitView/util.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.d.ts +5 -0
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js +16 -0
- package/esm/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.js.map +1 -0
- package/esm/BreakpointAlignmentsFeatureDetail/index.d.ts +3 -0
- package/esm/BreakpointAlignmentsFeatureDetail/index.js +32 -0
- package/esm/BreakpointAlignmentsFeatureDetail/index.js.map +1 -0
- package/esm/BreakpointSplitView/BreakpointSplitView.d.ts +23 -0
- package/esm/BreakpointSplitView/BreakpointSplitView.js +86 -0
- package/esm/BreakpointSplitView/BreakpointSplitView.js.map +1 -0
- package/esm/BreakpointSplitView/components/AlignmentConnections.d.ts +9 -0
- package/esm/BreakpointSplitView/components/AlignmentConnections.js +108 -0
- package/esm/BreakpointSplitView/components/AlignmentConnections.js.map +1 -0
- package/esm/BreakpointSplitView/components/Breakends.d.ts +9 -0
- package/esm/BreakpointSplitView/components/Breakends.js +92 -0
- package/esm/BreakpointSplitView/components/Breakends.js.map +1 -0
- package/esm/BreakpointSplitView/components/BreakpointSplitView.d.ts +6 -0
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js +61 -0
- package/esm/BreakpointSplitView/components/BreakpointSplitView.js.map +1 -0
- package/esm/BreakpointSplitView/components/ExportSvgDialog.d.ts +8 -0
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js +58 -0
- package/esm/BreakpointSplitView/components/ExportSvgDialog.js.map +1 -0
- package/esm/BreakpointSplitView/components/Overlay.d.ts +9 -0
- package/esm/BreakpointSplitView/components/Overlay.js +18 -0
- package/esm/BreakpointSplitView/components/Overlay.js.map +1 -0
- package/esm/BreakpointSplitView/components/Translocations.d.ts +9 -0
- package/esm/BreakpointSplitView/components/Translocations.js +88 -0
- package/esm/BreakpointSplitView/components/Translocations.js.map +1 -0
- package/esm/BreakpointSplitView/components/util.d.ts +7 -0
- package/esm/BreakpointSplitView/components/util.js +107 -0
- package/esm/BreakpointSplitView/components/util.js.map +1 -0
- package/esm/BreakpointSplitView/index.d.ts +3 -0
- package/esm/BreakpointSplitView/index.js +15 -0
- package/esm/BreakpointSplitView/index.js.map +1 -0
- package/esm/BreakpointSplitView/model.d.ts +299 -0
- package/esm/BreakpointSplitView/model.js +216 -0
- package/esm/BreakpointSplitView/model.js.map +1 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.d.ts +6 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js +7 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBackground.js.map +1 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.d.ts +4 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js +76 -0
- package/esm/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.js.map +1 -0
- package/esm/BreakpointSplitView/util.d.ts +18 -0
- package/esm/BreakpointSplitView/util.js +49 -0
- package/esm/BreakpointSplitView/util.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +15 -0
- package/esm/index.js.map +1 -0
- package/package.json +63 -0
- package/src/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.tsx +24 -0
- package/src/BreakpointAlignmentsFeatureDetail/index.ts +35 -0
- package/src/BreakpointSplitView/BreakpointSplitView.ts +100 -0
- package/src/BreakpointSplitView/components/AlignmentConnections.tsx +166 -0
- package/src/BreakpointSplitView/components/Breakends.tsx +141 -0
- package/src/BreakpointSplitView/components/BreakpointSplitView.tsx +95 -0
- package/src/BreakpointSplitView/components/ExportSvgDialog.tsx +149 -0
- package/src/BreakpointSplitView/components/Overlay.tsx +29 -0
- package/src/BreakpointSplitView/components/Translocations.tsx +147 -0
- package/src/BreakpointSplitView/components/util.ts +127 -0
- package/src/BreakpointSplitView/index.ts +17 -0
- package/src/BreakpointSplitView/model.ts +333 -0
- package/src/BreakpointSplitView/svgcomponents/SVGBackground.tsx +21 -0
- package/src/BreakpointSplitView/svgcomponents/SVGBreakpointSplitView.tsx +179 -0
- package/src/BreakpointSplitView/util.ts +89 -0
- package/src/index.test.ts +3 -0
- package/src/index.ts +15 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renderToSvg = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const server_1 = require("react-dom/server");
|
|
9
|
+
const mobx_1 = require("mobx");
|
|
10
|
+
const util_1 = require("@jbrowse/core/util");
|
|
11
|
+
const material_1 = require("@mui/material");
|
|
12
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
13
|
+
// locals
|
|
14
|
+
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
15
|
+
// locals
|
|
16
|
+
const SVGBackground_1 = __importDefault(require("./SVGBackground"));
|
|
17
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
18
|
+
const Overlay_1 = __importDefault(require("../components/Overlay"));
|
|
19
|
+
function getTrackNameMaxLen(views, fontSize, session) {
|
|
20
|
+
return (0, util_1.max)(views.flatMap(view => view.tracks.map(t => (0, util_1.measureText)((0, tracks_1.getTrackName)(t.configuration, session), fontSize))), 0);
|
|
21
|
+
}
|
|
22
|
+
function getTrackOffsets(view, textOffset, extra = 0) {
|
|
23
|
+
const offsets = {};
|
|
24
|
+
let curr = textOffset;
|
|
25
|
+
for (let i = 0; i < view.tracks.length; i++) {
|
|
26
|
+
const track = view.tracks[i];
|
|
27
|
+
offsets[track.configuration.trackId] = curr + extra;
|
|
28
|
+
curr += track.displays[0].height + textOffset;
|
|
29
|
+
}
|
|
30
|
+
return offsets;
|
|
31
|
+
}
|
|
32
|
+
// render LGV to SVG
|
|
33
|
+
async function renderToSvg(model, opts) {
|
|
34
|
+
var _a;
|
|
35
|
+
const { textHeight = 18, headerHeight = 30, rulerHeight = 30, fontSize = 13, trackLabels = 'offset',
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
Wrapper = ({ children }) => react_1.default.createElement(react_1.default.Fragment, null, children), themeName = 'default', } = opts;
|
|
38
|
+
const session = (0, util_1.getSession)(model);
|
|
39
|
+
const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
|
|
40
|
+
const { width, views } = model;
|
|
41
|
+
const shift = 50;
|
|
42
|
+
const offset = headerHeight + rulerHeight;
|
|
43
|
+
const heights = views.map(v => (0, plugin_linear_genome_view_1.totalHeight)(v.tracks, textHeight, trackLabels) + offset);
|
|
44
|
+
const totalHeightSvg = (0, util_1.sum)(heights) + 100;
|
|
45
|
+
const displayResults = await Promise.all(views.map(async (view) => ({
|
|
46
|
+
view,
|
|
47
|
+
data: await Promise.all(view.tracks.map(async (track) => {
|
|
48
|
+
const d = track.displays[0];
|
|
49
|
+
await (0, mobx_1.when)(() => (d.ready !== undefined ? d.ready : true));
|
|
50
|
+
return { track, result: await d.renderSvg({ ...opts, theme }) };
|
|
51
|
+
})),
|
|
52
|
+
})));
|
|
53
|
+
const trackLabelMaxLen = getTrackNameMaxLen(views, fontSize, session) + 40;
|
|
54
|
+
const trackLabelOffset = trackLabels === 'left' ? trackLabelMaxLen : 0;
|
|
55
|
+
const textOffset = trackLabels === 'offset' ? textHeight : 0;
|
|
56
|
+
const trackOffsets = [
|
|
57
|
+
getTrackOffsets(views[0], textOffset, fontSize + offset),
|
|
58
|
+
getTrackOffsets(views[1], textOffset, fontSize + heights[0] + offset),
|
|
59
|
+
];
|
|
60
|
+
const w = width + trackLabelOffset;
|
|
61
|
+
const t = (0, ui_1.createJBrowseTheme)(theme);
|
|
62
|
+
// the xlink namespace is used for rendering <image> tag
|
|
63
|
+
return (0, server_1.renderToStaticMarkup)(react_1.default.createElement(material_1.ThemeProvider, { theme: t },
|
|
64
|
+
react_1.default.createElement(Wrapper, null,
|
|
65
|
+
react_1.default.createElement("svg", { width: width, height: totalHeightSvg, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, totalHeightSvg].toString() },
|
|
66
|
+
react_1.default.createElement(SVGBackground_1.default, { width: w, height: totalHeightSvg, shift: shift }),
|
|
67
|
+
react_1.default.createElement("g", { transform: `translate(${shift} ${fontSize})` },
|
|
68
|
+
react_1.default.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
69
|
+
react_1.default.createElement("text", { x: 0, fontSize: fontSize, fill: t.palette.text.primary }, views[0].assemblyNames.join(', ')),
|
|
70
|
+
react_1.default.createElement(plugin_linear_genome_view_1.SVGRuler, { model: displayResults[0].view, fontSize: fontSize })),
|
|
71
|
+
react_1.default.createElement(plugin_linear_genome_view_1.SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[0].view, displayResults: displayResults[0].data, offset: offset, trackLabelOffset: trackLabelOffset })),
|
|
72
|
+
react_1.default.createElement("g", { transform: `translate(${shift} ${fontSize + heights[0]})` },
|
|
73
|
+
react_1.default.createElement("g", { transform: `translate(${trackLabelOffset})` },
|
|
74
|
+
react_1.default.createElement("text", { x: 0, fontSize: fontSize, fill: t.palette.text.primary }, views[1].assemblyNames.join(', ')),
|
|
75
|
+
react_1.default.createElement(plugin_linear_genome_view_1.SVGRuler, { model: displayResults[1].view, fontSize: fontSize })),
|
|
76
|
+
react_1.default.createElement(plugin_linear_genome_view_1.SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: displayResults[1].view, displayResults: displayResults[1].data, offset: offset, trackLabelOffset: trackLabelOffset })),
|
|
77
|
+
react_1.default.createElement("defs", null,
|
|
78
|
+
react_1.default.createElement("clipPath", { id: "clip-bsv" },
|
|
79
|
+
react_1.default.createElement("rect", { x: 0, y: 0, width: width, height: totalHeightSvg }))),
|
|
80
|
+
react_1.default.createElement("g", { transform: `translate(${trackLabelOffset + shift})`, clipPath: "url(#clip-bsv)" }, model.matchedTracks.map(track => (react_1.default.createElement(Overlay_1.default, { parentRef: { current: null }, key: track.configuration.trackId, model: model, trackId: track.configuration.trackId, getTrackYPosOverride: (id, level) => trackOffsets[level][id] }))))))));
|
|
81
|
+
}
|
|
82
|
+
exports.renderToSvg = renderToSvg;
|
|
83
|
+
//# sourceMappingURL=SVGBreakpointSplitView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVGBreakpointSplitView.js","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AQ,EAAE,QAAQ,EAClB,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAC7B,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,GAClC,CACA;gBAEJ;oBACE,4CAAU,EAAE,EAAC,UAAU;wBACrB,wCAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,GAAI,CACjD,CACN;gBACP,qCACE,SAAS,EAAE,aAAa,gBAAgB,GAAG,KAAK,GAAG,EACnD,QAAQ,EAAC,gBAAgB,IAExB,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAChC,8BAAC,iBAAO,IACN,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAC5B,GAAG,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EAChC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EACpC,oBAAoB,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAC5D,CACH,CAAC,CACA,CACA,CACE,CACI,CACjB,CAAA;AACH,CAAC;AAvHD,kCAuHC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
2
|
+
import { LayoutRecord } from './model';
|
|
3
|
+
type LGV = LinearGenomeViewModel;
|
|
4
|
+
interface Display {
|
|
5
|
+
height: number;
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
SNPCoverageDisplay?: {
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface Track {
|
|
12
|
+
displays: Display[];
|
|
13
|
+
}
|
|
14
|
+
export declare function getPxFromCoordinate(view: LGV, refName: string, coord: number): number;
|
|
15
|
+
export declare function yPos(trackId: string, level: number, views: LGV[], tracks: Track[], c: LayoutRecord, getYPosOverride?: (trackId: string, level: number) => number): number;
|
|
16
|
+
export declare const useNextFrame: (variable: unknown) => void;
|
|
17
|
+
export declare function intersect<T>(cb: (l: T) => string, a1?: T[], a2?: T[], ...rest: T[][]): T[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.intersect = exports.useNextFrame = exports.yPos = exports.getPxFromCoordinate = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const util_1 = require("@jbrowse/core/util");
|
|
6
|
+
const [, TOP, , BOTTOM] = [0, 1, 2, 3];
|
|
7
|
+
function cheight(chunk) {
|
|
8
|
+
return chunk[BOTTOM] - chunk[TOP];
|
|
9
|
+
}
|
|
10
|
+
function heightFromSpecificLevel(views, trackId, level, getYPosOverride) {
|
|
11
|
+
var _a;
|
|
12
|
+
return getYPosOverride
|
|
13
|
+
? getYPosOverride(trackId, level)
|
|
14
|
+
: ((_a = views[level].trackRefs[trackId]) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().top) || 0;
|
|
15
|
+
}
|
|
16
|
+
function getPxFromCoordinate(view, refName, coord) {
|
|
17
|
+
return ((view.bpToPx({ refName, coord }) || {}).offsetPx || 0) - view.offsetPx;
|
|
18
|
+
}
|
|
19
|
+
exports.getPxFromCoordinate = getPxFromCoordinate;
|
|
20
|
+
// get's the yposition of a layout record in a track
|
|
21
|
+
function yPos(trackId, level, views, tracks, c, getYPosOverride) {
|
|
22
|
+
const display = tracks[level].displays[0];
|
|
23
|
+
const min = 0;
|
|
24
|
+
const max = display.height;
|
|
25
|
+
let offset = 0;
|
|
26
|
+
const { SNPCoverageDisplay } = display;
|
|
27
|
+
if (SNPCoverageDisplay) {
|
|
28
|
+
offset = SNPCoverageDisplay.height;
|
|
29
|
+
}
|
|
30
|
+
const yPos = getYPosOverride ? 0 : display.scrollTop;
|
|
31
|
+
return ((0, util_1.clamp)(c[TOP] - yPos + cheight(c) / 2 + offset, min, max) +
|
|
32
|
+
heightFromSpecificLevel(views, trackId, level, getYPosOverride) +
|
|
33
|
+
display.scrollTop);
|
|
34
|
+
}
|
|
35
|
+
exports.yPos = yPos;
|
|
36
|
+
// we combo a useEffect and useState combo to force rerender on snap changing.
|
|
37
|
+
// the setup of this being a useEffect+useState makes it re-render once the
|
|
38
|
+
// useEffect is called, which is generally the "next frame". If we removed the
|
|
39
|
+
// below use
|
|
40
|
+
const useNextFrame = (variable) => {
|
|
41
|
+
const [, setNextFrameState] = (0, react_1.useState)();
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
setNextFrameState(variable);
|
|
44
|
+
}, [variable]);
|
|
45
|
+
};
|
|
46
|
+
exports.useNextFrame = useNextFrame;
|
|
47
|
+
// https://stackoverflow.com/a/49186706/2129219 the array-intersection package
|
|
48
|
+
// on npm has a large kb size, and we are just intersecting open track ids so
|
|
49
|
+
// simple is better
|
|
50
|
+
function intersect(cb, a1 = [], a2 = [], ...rest) {
|
|
51
|
+
const ids = new Set(a2.map(elt => cb(elt)));
|
|
52
|
+
const a12 = a1.filter(value => ids.has(cb(value)));
|
|
53
|
+
return rest.length === 0 ? a12 : intersect(cb, a12, ...rest);
|
|
54
|
+
}
|
|
55
|
+
exports.intersect = intersect;
|
|
56
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/BreakpointSplitView/util.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAE3C,6CAA0C;AAiB1C,MAAM,CAAC,EAAE,GAAG,EAAE,AAAD,EAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEtC,SAAS,OAAO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__importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
7
|
+
const BreakpointAlignmentsFeatureDetail_1 = __importDefault(require("./BreakpointAlignmentsFeatureDetail"));
|
|
8
|
+
const BreakpointSplitView_1 = __importDefault(require("./BreakpointSplitView"));
|
|
9
|
+
class BreakpointSplitViewPlugin extends Plugin_1.default {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = 'BreakpointSplitViewPlugin';
|
|
13
|
+
}
|
|
14
|
+
install(pluginManager) {
|
|
15
|
+
(0, BreakpointSplitView_1.default)(pluginManager);
|
|
16
|
+
(0, BreakpointAlignmentsFeatureDetail_1.default)(pluginManager);
|
|
17
|
+
}
|
|
18
|
+
configure() { }
|
|
19
|
+
}
|
|
20
|
+
exports.default = BreakpointSplitViewPlugin;
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AACA,kEAAyC;AACzC,4GAA6E;AAC7E,gFAAwD;AAExD,MAAqB,yBAA0B,SAAQ,gBAAM;IAA7D;;QACE,SAAI,GAAG,2BAA2B,CAAA;IAQpC,CAAC;IANC,OAAO,CAAC,aAA4B;QAClC,IAAA,6BAAoB,EAAC,aAAa,CAAC,CAAA;QACnC,IAAA,2CAA2B,EAAC,aAAa,CAAC,CAAA;IAC5C,CAAC;IAED,SAAS,KAAI,CAAC;CACf;AATD,4CASC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Paper from '@mui/material/Paper';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { BaseCoreDetails, BaseAttributes, } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
5
|
+
const BreakpointAlignmentsFeatureDetail = observer(
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
({ model }) => {
|
|
8
|
+
const { feature1, feature2 } = JSON.parse(JSON.stringify(model.featureData));
|
|
9
|
+
return (React.createElement(Paper, { "data-testid": "alignment-side-drawer" },
|
|
10
|
+
React.createElement(BaseCoreDetails, { title: "Feature 1", feature: feature1 }),
|
|
11
|
+
React.createElement(BaseCoreDetails, { title: "Feature 2", feature: feature2 }),
|
|
12
|
+
React.createElement(BaseAttributes, { title: "Feature 1 attributes", feature: feature1 }),
|
|
13
|
+
React.createElement(BaseAttributes, { title: "Feature 2 attributes", feature: feature2 })));
|
|
14
|
+
});
|
|
15
|
+
export default BreakpointAlignmentsFeatureDetail;
|
|
16
|
+
//# sourceMappingURL=BreakpointAlignmentsFeatureDetail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreakpointAlignmentsFeatureDetail.js","sourceRoot":"","sources":["../../src/BreakpointAlignmentsFeatureDetail/BreakpointAlignmentsFeatureDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,qBAAqB,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,mDAAmD,CAAA;AAE1D,MAAM,iCAAiC,GAAG,QAAQ;AAChD,8DAA8D;AAC9D,CAAC,EAAE,KAAK,EAAkB,EAAE,EAAE;IAC5B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;IAC5E,OAAO,CACL,oBAAC,KAAK,mBAAa,uBAAuB;QACxC,oBAAC,eAAe,IAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,QAAQ,GAAI;QACxD,oBAAC,eAAe,IAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,QAAQ,GAAI;QACxD,oBAAC,cAAc,IAAC,KAAK,EAAC,sBAAsB,EAAC,OAAO,EAAE,QAAQ,GAAI;QAClE,oBAAC,cAAc,IAAC,KAAK,EAAC,sBAAsB,EAAC,OAAO,EAAE,QAAQ,GAAI,CAC5D,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
+
import { ElementId } from '@jbrowse/core/util/types/mst';
|
|
4
|
+
import { types } from 'mobx-state-tree';
|
|
5
|
+
import { WidgetType } from '@jbrowse/core/pluggableElementTypes';
|
|
6
|
+
const configSchema = ConfigurationSchema('BreakpointAlignmentsWidget', {});
|
|
7
|
+
const stateModel = types
|
|
8
|
+
.model('BreakpointAlignmentsWidget', {
|
|
9
|
+
id: ElementId,
|
|
10
|
+
type: types.literal('BreakpointAlignmentsWidget'),
|
|
11
|
+
featureData: types.frozen(),
|
|
12
|
+
})
|
|
13
|
+
.actions(self => ({
|
|
14
|
+
setFeatureData(data) {
|
|
15
|
+
self.featureData = data;
|
|
16
|
+
},
|
|
17
|
+
clearFeatureData() {
|
|
18
|
+
self.featureData = undefined;
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
export default (pluginManager) => {
|
|
22
|
+
pluginManager.addWidgetType(() => {
|
|
23
|
+
return new WidgetType({
|
|
24
|
+
name: 'BreakpointAlignmentsWidget',
|
|
25
|
+
heading: 'Breakpoint feature details',
|
|
26
|
+
configSchema,
|
|
27
|
+
stateModel,
|
|
28
|
+
ReactComponent: lazy(() => import('./BreakpointAlignmentsFeatureDetail')),
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BreakpointAlignmentsFeatureDetail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAEhE,MAAM,YAAY,GAAG,mBAAmB,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAA;AAE1E,MAAM,UAAU,GAAG,KAAK;KACrB,KAAK,CAAC,4BAA4B,EAAE;IACnC,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,4BAA4B,CAAC;IACjD,WAAW,EAAE,KAAK,CAAC,MAAM,EAAE;CAC5B,CAAC;KACD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChB,cAAc,CAAC,IAAa;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IACzB,CAAC;IACD,gBAAgB;QACd,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;IAC9B,CAAC;CACF,CAAC,CAAC,CAAA;AAEL,eAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,aAAa,CAAC,GAAG,EAAE;QAC/B,OAAO,IAAI,UAAU,CAAC;YACpB,IAAI,EAAE,4BAA4B;YAClC,OAAO,EAAE,4BAA4B;YACrC,YAAY;YACZ,UAAU;YACV,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,qCAAqC,CAAC,CAAC;SAC1E,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Feature } from '@jbrowse/core/util';
|
|
2
|
+
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
3
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
+
type LGV = LinearGenomeViewModel;
|
|
5
|
+
export default class BreakpointSplitViewType extends ViewType {
|
|
6
|
+
snapshotFromBreakendFeature(feature: Feature, view: LGV): {
|
|
7
|
+
type: string;
|
|
8
|
+
views: {
|
|
9
|
+
type: string;
|
|
10
|
+
displayedRegions: {
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
refName: string;
|
|
14
|
+
assemblyName: string;
|
|
15
|
+
}[];
|
|
16
|
+
hideHeader: boolean;
|
|
17
|
+
bpPerPx: number;
|
|
18
|
+
offsetPx: number;
|
|
19
|
+
}[];
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { getSession } from '@jbrowse/core/util';
|
|
2
|
+
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType';
|
|
3
|
+
import { parseBreakend } from '@gmod/vcf';
|
|
4
|
+
export default class BreakpointSplitViewType extends ViewType {
|
|
5
|
+
snapshotFromBreakendFeature(feature, view) {
|
|
6
|
+
var _a;
|
|
7
|
+
const alt = (_a = feature.get('ALT')) === null || _a === void 0 ? void 0 : _a[0];
|
|
8
|
+
const bnd = alt ? parseBreakend(alt) : undefined;
|
|
9
|
+
const startPos = feature.get('start');
|
|
10
|
+
let endPos;
|
|
11
|
+
const bpPerPx = 10;
|
|
12
|
+
// TODO: Figure this out for multiple assembly names
|
|
13
|
+
const { assemblyName } = view.displayedRegions[0];
|
|
14
|
+
const { assemblyManager } = getSession(view);
|
|
15
|
+
const assembly = assemblyManager.get(assemblyName);
|
|
16
|
+
if (!assembly) {
|
|
17
|
+
throw new Error(`assembly ${assemblyName} not found`);
|
|
18
|
+
}
|
|
19
|
+
if (!assembly.regions) {
|
|
20
|
+
throw new Error(`assembly ${assemblyName} regions not loaded`);
|
|
21
|
+
}
|
|
22
|
+
const { getCanonicalRefName } = assembly;
|
|
23
|
+
const featureRefName = getCanonicalRefName(feature.get('refName'));
|
|
24
|
+
const topRegion = assembly.regions.find(f => f.refName === featureRefName);
|
|
25
|
+
let mateRefName;
|
|
26
|
+
let startMod = 0;
|
|
27
|
+
let endMod = 0;
|
|
28
|
+
// a VCF breakend feature
|
|
29
|
+
if (alt === '<TRA>') {
|
|
30
|
+
const INFO = feature.get('INFO');
|
|
31
|
+
endPos = INFO.END[0] - 1;
|
|
32
|
+
mateRefName = getCanonicalRefName(INFO.CHR2[0]);
|
|
33
|
+
}
|
|
34
|
+
else if (bnd === null || bnd === void 0 ? void 0 : bnd.MatePosition) {
|
|
35
|
+
const matePosition = bnd.MatePosition.split(':');
|
|
36
|
+
endPos = +matePosition[1] - 1;
|
|
37
|
+
mateRefName = getCanonicalRefName(matePosition[0]);
|
|
38
|
+
if (bnd.Join === 'left') {
|
|
39
|
+
startMod = -1;
|
|
40
|
+
}
|
|
41
|
+
if (bnd.MateDirection === 'left') {
|
|
42
|
+
endMod = -1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else if (feature.get('mate')) {
|
|
46
|
+
// a generic 'mate' feature
|
|
47
|
+
const mate = feature.get('mate');
|
|
48
|
+
mateRefName = getCanonicalRefName(mate.refName);
|
|
49
|
+
endPos = mate.start;
|
|
50
|
+
}
|
|
51
|
+
if (!mateRefName) {
|
|
52
|
+
throw new Error(`unable to resolve mate refName ${mateRefName} in reference genome`);
|
|
53
|
+
}
|
|
54
|
+
const bottomRegion = assembly.regions.find(f => f.refName === mateRefName);
|
|
55
|
+
if (!topRegion || !bottomRegion) {
|
|
56
|
+
throw new Error(`unable to find the refName for the top or bottom of the breakpoint view`);
|
|
57
|
+
}
|
|
58
|
+
const topMarkedRegion = [{ ...topRegion }, { ...topRegion }];
|
|
59
|
+
const bottomMarkedRegion = [{ ...bottomRegion }, { ...bottomRegion }];
|
|
60
|
+
topMarkedRegion[0].end = startPos + startMod;
|
|
61
|
+
topMarkedRegion[1].start = startPos + startMod;
|
|
62
|
+
bottomMarkedRegion[0].end = endPos + endMod;
|
|
63
|
+
bottomMarkedRegion[1].start = endPos + endMod;
|
|
64
|
+
return {
|
|
65
|
+
type: 'BreakpointSplitView',
|
|
66
|
+
views: [
|
|
67
|
+
{
|
|
68
|
+
type: 'LinearGenomeView',
|
|
69
|
+
displayedRegions: topMarkedRegion,
|
|
70
|
+
hideHeader: true,
|
|
71
|
+
bpPerPx,
|
|
72
|
+
offsetPx: (topRegion.start + feature.get('start')) / bpPerPx,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'LinearGenomeView',
|
|
76
|
+
displayedRegions: bottomMarkedRegion,
|
|
77
|
+
hideHeader: true,
|
|
78
|
+
bpPerPx,
|
|
79
|
+
offsetPx: (bottomRegion.start + endPos) / bpPerPx,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
displayName: `${feature.get('name') || feature.get('id') || 'breakend'} split detail`,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=BreakpointSplitView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreakpointSplitView.js","sourceRoot":"","sources":["../../src/BreakpointSplitView/BreakpointSplitView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,oBAAoB,CAAA;AACxD,OAAO,QAAQ,MAAM,8CAA8C,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAKzC,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,QAAQ;IAC3D,2BAA2B,CAAC,OAAgB,EAAE,IAAS;;QACrD,MAAM,GAAG,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,0CA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;QAC5D,MAAM,kBAAkB,GAAG,CAAC,EAAE,GAAG,YAAY,EAAE,EAAE,EAAE,GAAG,YAAY,EAAE,CAAC,CAAA;QACrE,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC5C,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC9C,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,GAAG,MAAM,CAAA;QAC3C,kBAAkB,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;QAC7C,OAAO;YACL,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,kBAAkB;oBACxB,gBAAgB,EAAE,eAAe;oBACjC,UAAU,EAAE,IAAI;oBAChB,OAAO;oBACP,QAAQ,EAAE,CAAC,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO;iBAC7D;gBACD;oBACE,IAAI,EAAE,kBAAkB;oBACxB,gBAAgB,EAAE,kBAAkB;oBACpC,UAAU,EAAE,IAAI;oBAChB,OAAO;oBACP,QAAQ,EAAE,CAAC,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,OAAO;iBAClD;aACF;YACD,WAAW,EAAE,GACX,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAC9C,eAAe;SAChB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BreakpointViewModel } from '../model';
|
|
3
|
+
declare const AlignmentConnections: ({ model, trackId, parentRef, getTrackYPosOverride, }: {
|
|
4
|
+
model: BreakpointViewModel;
|
|
5
|
+
trackId: string;
|
|
6
|
+
parentRef: React.RefObject<SVGSVGElement>;
|
|
7
|
+
getTrackYPosOverride?: ((trackId: string, level: number) => number) | undefined;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default AlignmentConnections;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { getSnapshot } from 'mobx-state-tree';
|
|
4
|
+
import { useTheme } from '@mui/material';
|
|
5
|
+
import { getSession } from '@jbrowse/core/util';
|
|
6
|
+
// locals
|
|
7
|
+
import { getBadlyPairedAlignments, getMatchedAlignmentFeatures, hasPairedReads, } from './util';
|
|
8
|
+
import { yPos, useNextFrame, getPxFromCoordinate } from '../util';
|
|
9
|
+
const [LEFT, , RIGHT] = [0, 1, 2, 3];
|
|
10
|
+
const AlignmentConnections = observer(function ({ model, trackId, parentRef, getTrackYPosOverride, }) {
|
|
11
|
+
const { views, showIntraviewLinks } = model;
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const session = getSession(model);
|
|
14
|
+
const snap = getSnapshot(model);
|
|
15
|
+
const { assemblyManager } = session;
|
|
16
|
+
const assembly = assemblyManager.get(views[0].assemblyNames[0]);
|
|
17
|
+
useNextFrame(snap);
|
|
18
|
+
const allFeatures = model.getTrackFeatures(trackId);
|
|
19
|
+
const hasPaired = useMemo(() => hasPairedReads(allFeatures), [allFeatures]);
|
|
20
|
+
const layoutMatches = useMemo(() => {
|
|
21
|
+
const layoutMatches = model.getMatchedFeaturesInLayout(trackId, hasPaired
|
|
22
|
+
? getBadlyPairedAlignments(allFeatures)
|
|
23
|
+
: getMatchedAlignmentFeatures(allFeatures));
|
|
24
|
+
if (!hasPaired) {
|
|
25
|
+
layoutMatches.forEach(m => {
|
|
26
|
+
m.sort((a, b) => a.feature.get('clipPos') - b.feature.get('clipPos'));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return layoutMatches;
|
|
30
|
+
}, [allFeatures, trackId, hasPaired, model]);
|
|
31
|
+
const [mouseoverElt, setMouseoverElt] = useState();
|
|
32
|
+
let yOffset = 0;
|
|
33
|
+
if (parentRef.current) {
|
|
34
|
+
const rect = parentRef.current.getBoundingClientRect();
|
|
35
|
+
yOffset = rect.top;
|
|
36
|
+
}
|
|
37
|
+
if (!assembly) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return (React.createElement("g", { stroke: theme.palette.text.disabled, fill: "none", "data-testid": layoutMatches.length ? `${trackId}-loaded` : trackId }, layoutMatches.map(chunk => {
|
|
41
|
+
const ret = [];
|
|
42
|
+
// we follow a path in the list of chunks, not from top to bottom, just in series
|
|
43
|
+
// following x1,y1 -> x2,y2
|
|
44
|
+
for (let i = 0; i < chunk.length - 1; i++) {
|
|
45
|
+
const { layout: c1, feature: f1, level: level1 } = chunk[i];
|
|
46
|
+
const { layout: c2, feature: f2, level: level2 } = chunk[i + 1];
|
|
47
|
+
if (!c1 || !c2) {
|
|
48
|
+
console.warn('received null layout for a overlay feature');
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// disable rendering connections in a single level
|
|
52
|
+
if (!showIntraviewLinks && level1 === level2) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const f1ref = assembly.getCanonicalRefName(f1.get('refName'));
|
|
56
|
+
const f2ref = assembly.getCanonicalRefName(f2.get('refName'));
|
|
57
|
+
if (!f1ref || !f2ref) {
|
|
58
|
+
throw new Error(`unable to find ref for ${f1ref || f2ref}`);
|
|
59
|
+
}
|
|
60
|
+
const s1 = f1.get('strand');
|
|
61
|
+
const s2 = f2.get('strand');
|
|
62
|
+
const p1 = c1[s1 === -1 ? LEFT : RIGHT];
|
|
63
|
+
const sn1 = s2 === -1;
|
|
64
|
+
const p2 = hasPaired ? c2[sn1 ? LEFT : RIGHT] : c2[sn1 ? RIGHT : LEFT];
|
|
65
|
+
const x1 = getPxFromCoordinate(views[level1], f1ref, p1);
|
|
66
|
+
const x2 = getPxFromCoordinate(views[level2], f2ref, p2);
|
|
67
|
+
const reversed1 = views[level1].pxToBp(x1).reversed;
|
|
68
|
+
const reversed2 = views[level2].pxToBp(x2).reversed;
|
|
69
|
+
const tracks = views.map(v => v.getTrack(trackId));
|
|
70
|
+
const y1 = yPos(trackId, level1, views, tracks, c1, getTrackYPosOverride) -
|
|
71
|
+
yOffset;
|
|
72
|
+
const y2 = yPos(trackId, level2, views, tracks, c2, getTrackYPosOverride) -
|
|
73
|
+
yOffset;
|
|
74
|
+
// possible todo: use totalCurveHeight to possibly make alternative
|
|
75
|
+
// squiggle if the S is too small
|
|
76
|
+
const path = [
|
|
77
|
+
'M',
|
|
78
|
+
x1,
|
|
79
|
+
y1,
|
|
80
|
+
'C',
|
|
81
|
+
x1 + 200 * f1.get('strand') * (reversed1 ? -1 : 1),
|
|
82
|
+
y1,
|
|
83
|
+
x2 -
|
|
84
|
+
200 *
|
|
85
|
+
f2.get('strand') *
|
|
86
|
+
(reversed2 ? -1 : 1) *
|
|
87
|
+
(hasPaired ? -1 : 1),
|
|
88
|
+
y2,
|
|
89
|
+
x2,
|
|
90
|
+
y2,
|
|
91
|
+
].join(' ');
|
|
92
|
+
const id = `${f1.id()}-${f2.id()}`;
|
|
93
|
+
ret.push(React.createElement("path", { d: path, key: id, "data-testid": "r1", strokeWidth: mouseoverElt === id ? 5 : 1, onClick: () => {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
const featureWidget = (_a = session.addWidget) === null || _a === void 0 ? void 0 : _a.call(session, 'BreakpointAlignmentsWidget', 'breakpointAlignments', {
|
|
96
|
+
featureData: {
|
|
97
|
+
feature1: (allFeatures.get(f1.id()) || { toJSON: () => { } }).toJSON(),
|
|
98
|
+
feature2: (allFeatures.get(f2.id()) || { toJSON: () => { } }).toJSON(),
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
(_b = session.showWidget) === null || _b === void 0 ? void 0 : _b.call(session, featureWidget);
|
|
102
|
+
}, onMouseOver: () => setMouseoverElt(id), onMouseOut: () => setMouseoverElt(undefined) }));
|
|
103
|
+
}
|
|
104
|
+
return ret;
|
|
105
|
+
})));
|
|
106
|
+
});
|
|
107
|
+
export default AlignmentConnections;
|
|
108
|
+
//# sourceMappingURL=AlignmentConnections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlignmentConnections.js","sourceRoot":"","sources":["../../../src/BreakpointSplitView/components/AlignmentConnections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,SAAS;AACT,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,cAAc,GACf,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGjE,MAAM,CAAC,IAAI,EAAE,AAAD,EAAG,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAEpC,MAAM,oBAAoB,GAAG,QAAQ,CAAC,UAAU,EAC9C,KAAK,EACL,OAAO,EACP,SAAS,EACT,oBAAoB,GAMrB;IACC,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAA;IAC3C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACjC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;IAC/B,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAA;IACnC,MAAM,QAAQ,GAAG,eAAe,C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,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CACjD,CAAC,MAAM,EAAE;yBACX;qBACF,CACF,CAAA;oBACD,MAAA,OAAO,CAAC,UAAU,wDAAG,aAAa,CAAC,CAAA;gBACrC,CAAC,EACD,WAAW,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,EACtC,UAAU,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,GAC5C,CACH,CAAA;SACF;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CACA,CACL,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BreakpointViewModel } from '../model';
|
|
3
|
+
declare const Breakends: ({ model, trackId, parentRef: ref, getTrackYPosOverride, }: {
|
|
4
|
+
model: BreakpointViewModel;
|
|
5
|
+
trackId: string;
|
|
6
|
+
parentRef: React.RefObject<SVGSVGElement>;
|
|
7
|
+
getTrackYPosOverride?: ((trackId: string, level: number) => number) | undefined;
|
|
8
|
+
}) => React.JSX.Element | null;
|
|
9
|
+
export default Breakends;
|