@jbrowse/plugin-linear-comparative-view 2.13.1 → 2.14.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/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
- package/dist/LGVSyntenyDisplay/components/util.js +4 -3
- package/dist/LGVSyntenyDisplay/model.d.ts +4 -3
- package/dist/LaunchLinearSyntenyView.js +7 -3
- package/dist/LinearComparativeDisplay/configSchemaF.js +0 -1
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
- package/dist/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/dist/LinearComparativeView/components/Header.js +6 -2
- package/dist/LinearComparativeView/components/Rubberband.js +9 -9
- package/dist/LinearComparativeView/model.d.ts +9 -16
- package/dist/LinearComparativeView/model.js +10 -14
- package/dist/LinearReadVsRef/LinearReadVsRef.js +6 -4
- package/dist/LinearSyntenyDisplay/afterAttach.js +2 -2
- package/dist/LinearSyntenyDisplay/components/Component.js +6 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
- package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.js +16 -8
- package/dist/LinearSyntenyDisplay/model.d.ts +9 -5
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
- package/dist/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
- package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
- package/dist/LinearSyntenyView/components/ImportForm/index.js +15 -5
- package/dist/LinearSyntenyView/model.d.ts +9 -11
- package/dist/LinearSyntenyView/model.js +3 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
- package/dist/util.js +4 -3
- package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +9 -3
- package/esm/LGVSyntenyDisplay/components/util.js +4 -3
- package/esm/LGVSyntenyDisplay/model.d.ts +4 -3
- package/esm/LaunchLinearSyntenyView.js +7 -3
- package/esm/LinearComparativeDisplay/configSchemaF.js +0 -1
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +3 -3
- package/esm/LinearComparativeDisplay/stateModelFactory.js +2 -2
- package/esm/LinearComparativeView/components/Header.js +6 -2
- package/esm/LinearComparativeView/components/Rubberband.js +9 -9
- package/esm/LinearComparativeView/model.d.ts +9 -16
- package/esm/LinearComparativeView/model.js +11 -15
- package/esm/LinearReadVsRef/LinearReadVsRef.js +6 -4
- package/esm/LinearSyntenyDisplay/afterAttach.js +2 -2
- package/esm/LinearSyntenyDisplay/components/Component.js +6 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +29 -15
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +4 -1
- package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +2 -6
- package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
- package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +16 -8
- package/esm/LinearSyntenyDisplay/model.d.ts +9 -5
- package/esm/LinearSyntenyView/components/ExportSvgDialog.js +16 -6
- package/esm/LinearSyntenyView/components/ImportForm/ImportCustomTrack.js +14 -4
- package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelector.js +3 -1
- package/esm/LinearSyntenyView/components/ImportForm/index.js +15 -5
- package/esm/LinearSyntenyView/model.d.ts +9 -11
- package/esm/LinearSyntenyView/model.js +3 -1
- package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +9 -7
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +3 -1
- package/esm/util.js +4 -3
- package/package.json +3 -3
|
@@ -43,8 +43,12 @@ function LaunchSyntenyViewDialog({ model, feature, handleClose, }) {
|
|
|
43
43
|
const [windowSize, setWindowSize] = (0, react_1.useState)('1000');
|
|
44
44
|
return (react_1.default.createElement(ui_1.Dialog, { open: true, title: "Launch synteny view", onClose: handleClose },
|
|
45
45
|
react_1.default.createElement(material_1.DialogContent, null,
|
|
46
|
-
inverted ? (react_1.default.createElement(material_1.FormControlLabel, { className: classes.padding, control: react_1.default.createElement(material_1.Checkbox, { checked: horizontallyFlip, onChange: event =>
|
|
47
|
-
|
|
46
|
+
inverted ? (react_1.default.createElement(material_1.FormControlLabel, { className: classes.padding, control: react_1.default.createElement(material_1.Checkbox, { checked: horizontallyFlip, onChange: event => {
|
|
47
|
+
setHorizontallyFlip(event.target.checked);
|
|
48
|
+
} }), label: "Note: The feature is inverted in orientation on the target\n sequence. This will result in the lower panel having genomic\n coordinates decreasing left to right. Horizontally flip?" })) : null,
|
|
49
|
+
react_1.default.createElement(material_1.TextField, { label: "Add window size in bp", value: windowSize, onChange: event => {
|
|
50
|
+
setWindowSize(event.target.value);
|
|
51
|
+
} })),
|
|
48
52
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
49
53
|
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
50
54
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -65,5 +69,7 @@ function LaunchSyntenyViewDialog({ model, feature, handleClose, }) {
|
|
|
65
69
|
})();
|
|
66
70
|
handleClose();
|
|
67
71
|
} }, "Submit"),
|
|
68
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () =>
|
|
72
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
73
|
+
handleClose();
|
|
74
|
+
} }, "Cancel"))));
|
|
69
75
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.navToSynteny = navToSynteny;
|
|
4
4
|
const util_1 = require("@jbrowse/core/util");
|
|
5
5
|
const plugin_alignments_1 = require("@jbrowse/plugin-alignments");
|
|
6
|
-
const mobx_1 = require("mobx");
|
|
7
6
|
const { parseCigar } = plugin_alignments_1.MismatchParser;
|
|
8
7
|
function f(n) {
|
|
9
8
|
return Math.floor(n);
|
|
@@ -18,7 +17,7 @@ function findPosInCigar(cigar, startX) {
|
|
|
18
17
|
if (featX >= startX) {
|
|
19
18
|
break;
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
if (op === 'I') {
|
|
22
21
|
mateX += len;
|
|
23
22
|
}
|
|
24
23
|
else if (op === 'D') {
|
|
@@ -36,6 +35,9 @@ async function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip,
|
|
|
36
35
|
const track = (0, util_1.getContainingTrack)(model);
|
|
37
36
|
const view = (0, util_1.getContainingView)(model);
|
|
38
37
|
const reg = view.dynamicBlocks.contentBlocks[0];
|
|
38
|
+
if (!reg) {
|
|
39
|
+
throw new Error('no visible region');
|
|
40
|
+
}
|
|
39
41
|
const cigar = feature.get('CIGAR');
|
|
40
42
|
const strand = feature.get('strand');
|
|
41
43
|
const regStart = reg.start;
|
|
@@ -102,7 +104,6 @@ async function navToSynteny({ feature, windowSize: ws, model, horizontallyFlip,
|
|
|
102
104
|
const m1 = Math.min(rMateStart, rMateEnd);
|
|
103
105
|
const m2 = Math.max(rMateStart, rMateEnd);
|
|
104
106
|
const l2 = `${mateRef}:${f(m1 - ws)}-${f(m2 + ws)}${horizontallyFlip ? '[rev]' : ''}`;
|
|
105
|
-
await (0, mobx_1.when)(() => view2.width !== undefined);
|
|
106
107
|
await Promise.all([
|
|
107
108
|
view2.views[0].navToLocString(l1, featAsm),
|
|
108
109
|
view2.views[1].navToLocString(l2, mateAsm),
|
|
@@ -117,7 +117,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
117
117
|
readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
118
118
|
tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
119
119
|
tag: import("mobx-state-tree").ISimpleType<string>;
|
|
120
|
-
value: import("mobx-state-tree").ISimpleType<string
|
|
120
|
+
value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
121
121
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
122
122
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
123
123
|
jexlFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
@@ -153,7 +153,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
153
153
|
error: unknown;
|
|
154
154
|
message: string | undefined;
|
|
155
155
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
156
|
-
onHorizontalScroll?:
|
|
156
|
+
onHorizontalScroll?: () => void;
|
|
157
157
|
blockState?: Record<string, any>;
|
|
158
158
|
}>;
|
|
159
159
|
readonly DisplayBlurb: import("react").FC<{
|
|
@@ -263,7 +263,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
263
263
|
readonly autorunReady: boolean;
|
|
264
264
|
} & {
|
|
265
265
|
setTagsReady(flag: boolean): void;
|
|
266
|
-
setMaxHeight(n
|
|
266
|
+
setMaxHeight(n?: number): void;
|
|
267
267
|
setFeatureHeight(n?: number): void;
|
|
268
268
|
setNoSpacing(flag?: boolean): void;
|
|
269
269
|
setColorScheme(colorScheme: {
|
|
@@ -329,6 +329,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
329
329
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
330
330
|
muiName: string;
|
|
331
331
|
};
|
|
332
|
+
priority: number;
|
|
332
333
|
onClick: () => void;
|
|
333
334
|
})[];
|
|
334
335
|
} & {
|
|
@@ -33,9 +33,13 @@ function LaunchLinearSyntenyView(pluginManager) {
|
|
|
33
33
|
throw new Error(`Assembly ${data.assembly} failed to load`);
|
|
34
34
|
}
|
|
35
35
|
await view.navToSearchString({ input: loc, assembly: asm });
|
|
36
|
-
tracks.forEach(track =>
|
|
36
|
+
tracks.forEach(track => {
|
|
37
|
+
tryTrack(view, track, idsNotFound);
|
|
38
|
+
});
|
|
37
39
|
}));
|
|
38
|
-
tracks.forEach(track =>
|
|
40
|
+
tracks.forEach(track => {
|
|
41
|
+
tryTrack(model, track, idsNotFound);
|
|
42
|
+
});
|
|
39
43
|
if (idsNotFound.length) {
|
|
40
44
|
throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
|
|
41
45
|
}
|
|
@@ -51,7 +55,7 @@ function tryTrack(model, trackId, idsNotFound) {
|
|
|
51
55
|
model.showTrack(trackId);
|
|
52
56
|
}
|
|
53
57
|
catch (e) {
|
|
54
|
-
if (
|
|
58
|
+
if (/Could not resolve identifier/.exec(`${e}`)) {
|
|
55
59
|
idsNotFound.push(trackId);
|
|
56
60
|
}
|
|
57
61
|
else {
|
|
@@ -39,7 +39,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
39
39
|
error: unknown;
|
|
40
40
|
message: string | undefined;
|
|
41
41
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
42
|
-
onHorizontalScroll?:
|
|
42
|
+
onHorizontalScroll?: () => void;
|
|
43
43
|
blockState?: Record<string, any>;
|
|
44
44
|
}>;
|
|
45
45
|
readonly DisplayBlurb: import("react").FC<{
|
|
@@ -125,7 +125,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
125
125
|
error: unknown;
|
|
126
126
|
message: string | undefined;
|
|
127
127
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
128
|
-
onHorizontalScroll?:
|
|
128
|
+
onHorizontalScroll?: () => void;
|
|
129
129
|
blockState?: Record<string, any>;
|
|
130
130
|
}>;
|
|
131
131
|
readonly DisplayBlurb: import("react").FC<{
|
|
@@ -195,7 +195,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
195
195
|
error: unknown;
|
|
196
196
|
message: string | undefined;
|
|
197
197
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
198
|
-
onHorizontalScroll?:
|
|
198
|
+
onHorizontalScroll?: () => void;
|
|
199
199
|
blockState?: Record<string, any>;
|
|
200
200
|
}>;
|
|
201
201
|
readonly DisplayBlurb: import("react").FC<{
|
|
@@ -77,8 +77,8 @@ function stateModelFactory(configSchema) {
|
|
|
77
77
|
}
|
|
78
78
|
const { features } = args;
|
|
79
79
|
const existingFeatures = self.features || [];
|
|
80
|
-
const featIds = new Set(existingFeatures.map(f => f.id())
|
|
81
|
-
const newFeatIds = new Set(
|
|
80
|
+
const featIds = new Set(existingFeatures.map(f => f.id()));
|
|
81
|
+
const newFeatIds = new Set(features.map(f => f.id()));
|
|
82
82
|
let foundNewFeatureNotInExistingMap = false;
|
|
83
83
|
let foundExistingFeatureNotInNewMap = false;
|
|
84
84
|
for (const feat of features) {
|
|
@@ -78,7 +78,9 @@ const Header = (0, mobx_react_1.observer)(function ({ model }) {
|
|
|
78
78
|
const anyShowHeaders = model.views.some(view => !view.hideHeader);
|
|
79
79
|
return (react_1.default.createElement("div", { className: classes.headerBar },
|
|
80
80
|
react_1.default.createElement(TrackSelector, { model: model }),
|
|
81
|
-
react_1.default.createElement(material_1.IconButton, { onClick: event =>
|
|
81
|
+
react_1.default.createElement(material_1.IconButton, { onClick: event => {
|
|
82
|
+
setMenuAnchorEl(event.currentTarget);
|
|
83
|
+
}, className: classes.iconButton },
|
|
82
84
|
react_1.default.createElement(MoreVert_1.default, null)),
|
|
83
85
|
!anyShowHeaders
|
|
84
86
|
? model.views.map(view => (react_1.default.createElement("div", { key: view.id, className: classes.searchBox },
|
|
@@ -93,6 +95,8 @@ const Header = (0, mobx_react_1.observer)(function ({ model }) {
|
|
|
93
95
|
menuAnchorEl ? (react_1.default.createElement(ui_1.Menu, { anchorEl: menuAnchorEl, open: true, onMenuItemClick: (_event, callback) => {
|
|
94
96
|
callback();
|
|
95
97
|
setMenuAnchorEl(undefined);
|
|
96
|
-
}, menuItems: model.headerMenuItems(), onClose: () =>
|
|
98
|
+
}, menuItems: model.headerMenuItems(), onClose: () => {
|
|
99
|
+
setMenuAnchorEl(undefined);
|
|
100
|
+
} })) : null));
|
|
97
101
|
});
|
|
98
102
|
exports.default = Header;
|
|
@@ -34,14 +34,10 @@ const util_1 = require("@jbrowse/core/util");
|
|
|
34
34
|
const ui_1 = require("@jbrowse/core/ui");
|
|
35
35
|
const VerticalGuide_1 = __importDefault(require("./VerticalGuide"));
|
|
36
36
|
const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
37
|
-
const { tertiary, primary } = theme.palette;
|
|
38
|
-
const background = tertiary
|
|
39
|
-
? (0, material_1.alpha)(tertiary.main, 0.7)
|
|
40
|
-
: (0, material_1.alpha)(primary.main, 0.7);
|
|
41
37
|
return {
|
|
42
38
|
rubberband: {
|
|
43
39
|
height: '100%',
|
|
44
|
-
background,
|
|
40
|
+
background: (0, material_1.alpha)(theme.palette.tertiary.main, 0.7),
|
|
45
41
|
position: 'absolute',
|
|
46
42
|
zIndex: 10,
|
|
47
43
|
textAlign: 'center',
|
|
@@ -53,7 +49,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
|
53
49
|
minHeight: 8,
|
|
54
50
|
},
|
|
55
51
|
rubberbandText: {
|
|
56
|
-
color: tertiary
|
|
52
|
+
color: theme.palette.tertiary.contrastText,
|
|
57
53
|
},
|
|
58
54
|
popover: {
|
|
59
55
|
mouseEvents: 'none',
|
|
@@ -129,7 +125,7 @@ const LinearComparativeRubberband = (0, mobx_react_1.observer)(function Rubberba
|
|
|
129
125
|
};
|
|
130
126
|
}
|
|
131
127
|
return () => { };
|
|
132
|
-
}, [startX, mouseDragging,
|
|
128
|
+
}, [startX, mouseDragging, model]);
|
|
133
129
|
(0, react_1.useEffect)(() => {
|
|
134
130
|
if (!mouseDragging &&
|
|
135
131
|
currentX !== undefined &&
|
|
@@ -152,7 +148,9 @@ const LinearComparativeRubberband = (0, mobx_react_1.observer)(function Rubberba
|
|
|
152
148
|
}
|
|
153
149
|
function mouseOut() {
|
|
154
150
|
setGuideX(undefined);
|
|
155
|
-
model.views.forEach(view =>
|
|
151
|
+
model.views.forEach(view => {
|
|
152
|
+
view.setOffsets(undefined, undefined);
|
|
153
|
+
});
|
|
156
154
|
}
|
|
157
155
|
function handleClose() {
|
|
158
156
|
setAnchorPosition(undefined);
|
|
@@ -193,7 +191,9 @@ const LinearComparativeRubberband = (0, mobx_react_1.observer)(function Rubberba
|
|
|
193
191
|
horizontal: 'left',
|
|
194
192
|
}, keepMounted: true, disableRestoreFocus: true }, rightBpOffset.map((l, idx) => (react_1.default.createElement(material_1.Typography, { key: [JSON.stringify(l), idx, 'right'].join('-') }, (0, util_1.stringify)(l, true))))))) : null,
|
|
195
193
|
react_1.default.createElement("div", { ref: rubberbandRef, className: classes.rubberband, style: { left, width } },
|
|
196
|
-
react_1.default.createElement(material_1.Typography, { variant: "h6", className: classes.rubberbandText }, numOfBpSelected.map((n, i) => (
|
|
194
|
+
react_1.default.createElement(material_1.Typography, { variant: "h6", className: classes.rubberbandText }, numOfBpSelected.map((n, i) => (
|
|
195
|
+
/* biome-ignore lint/suspicious/noArrayIndexKey: */
|
|
196
|
+
react_1.default.createElement(material_1.Typography, { key: `${n}_${i}` }, `${n.toLocaleString('en-US')}bp`))))),
|
|
197
197
|
react_1.default.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent),
|
|
198
198
|
anchorPosition ? (react_1.default.createElement(ui_1.Menu, { anchorReference: "anchorPosition", anchorPosition: {
|
|
199
199
|
left: anchorPosition.clientX,
|
|
@@ -38,7 +38,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
38
38
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
39
39
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
40
40
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
41
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<
|
|
41
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
42
42
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
43
43
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
44
44
|
}, {
|
|
@@ -54,7 +54,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
54
54
|
minimumBlockWidth: number;
|
|
55
55
|
draggingTrackId: undefined | string;
|
|
56
56
|
volatileError: unknown;
|
|
57
|
-
afterDisplayedRegionsSetCallbacks:
|
|
57
|
+
afterDisplayedRegionsSetCallbacks: (() => void)[];
|
|
58
58
|
scaleFactor: number;
|
|
59
59
|
trackRefs: Record<string, HTMLDivElement>;
|
|
60
60
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
@@ -67,7 +67,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
67
67
|
readonly interRegionPaddingWidth: number;
|
|
68
68
|
readonly assemblyNames: string[];
|
|
69
69
|
} & {
|
|
70
|
-
scaleBarDisplayPrefix(): string;
|
|
70
|
+
scaleBarDisplayPrefix(): string | undefined;
|
|
71
71
|
MiniControlsComponent(): import("react").FC<any>;
|
|
72
72
|
HeaderComponent(): import("react").FC<any>;
|
|
73
73
|
readonly assemblyErrors: string;
|
|
@@ -82,7 +82,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
82
82
|
readonly totalBp: number;
|
|
83
83
|
readonly maxBpPerPx: number;
|
|
84
84
|
readonly minBpPerPx: number;
|
|
85
|
-
readonly error:
|
|
85
|
+
readonly error: unknown;
|
|
86
86
|
readonly maxOffset: number;
|
|
87
87
|
readonly minOffset: number;
|
|
88
88
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -106,9 +106,9 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
106
106
|
setHideHeaderOverview(b: boolean): void;
|
|
107
107
|
setHideNoTracksActive(b: boolean): void;
|
|
108
108
|
setShowGridlines(b: boolean): void;
|
|
109
|
-
addToHighlights(highlight:
|
|
110
|
-
setHighlight(highlight
|
|
111
|
-
removeHighlight(highlight:
|
|
109
|
+
addToHighlights(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
110
|
+
setHighlight(highlight?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType[]): void;
|
|
111
|
+
removeHighlight(highlight: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType): void;
|
|
112
112
|
scrollTo(offsetPx: number): number;
|
|
113
113
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
114
114
|
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
@@ -123,7 +123,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
123
123
|
moveTrackToTop(id: string): void;
|
|
124
124
|
moveTrackToBottom(id: string): void;
|
|
125
125
|
moveTrack(movingId: string, targetId: string): void;
|
|
126
|
-
closeView(): void;
|
|
127
126
|
toggleTrack(trackId: string): boolean;
|
|
128
127
|
setTrackLabels(setting: "overlapping" | "offset" | "hidden"): void;
|
|
129
128
|
setShowCenterLine(b: boolean): void;
|
|
@@ -143,7 +142,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
143
142
|
variant?: string;
|
|
144
143
|
isLeftEndOfDisplayedRegion?: boolean;
|
|
145
144
|
}[];
|
|
146
|
-
afterDisplayedRegionsSet(cb:
|
|
145
|
+
afterDisplayedRegionsSet(cb: () => void): void;
|
|
147
146
|
horizontalScroll(distance: number): number;
|
|
148
147
|
center(): void;
|
|
149
148
|
showAllRegions(): void;
|
|
@@ -236,7 +235,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
236
235
|
showCytobandsSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
237
236
|
trackLabels: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
238
237
|
showGridlines: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
239
|
-
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<
|
|
238
|
+
highlight: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IType<import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType, import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").HighlightType>>, [undefined]>;
|
|
240
239
|
colorByCDS: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
241
240
|
showTrackOutlines: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
242
241
|
}>>, import("mobx-state-tree")._NotCustomized>>;
|
|
@@ -286,12 +285,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
286
285
|
* #action
|
|
287
286
|
*/
|
|
288
287
|
removeView(view: LinearGenomeViewModel): void;
|
|
289
|
-
/**
|
|
290
|
-
* #action
|
|
291
|
-
* removes the view itself from the state tree entirely by calling the
|
|
292
|
-
* parent removeView
|
|
293
|
-
*/
|
|
294
|
-
closeView(): void;
|
|
295
288
|
/**
|
|
296
289
|
* #action
|
|
297
290
|
*/
|
|
@@ -105,7 +105,9 @@ function stateModelFactory(pluginManager) {
|
|
|
105
105
|
* #getter
|
|
106
106
|
*/
|
|
107
107
|
get initialized() {
|
|
108
|
-
return (
|
|
108
|
+
return (
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
110
|
+
self.width !== undefined &&
|
|
109
111
|
self.views.length > 0 &&
|
|
110
112
|
self.views.every(view => view.initialized));
|
|
111
113
|
},
|
|
@@ -161,15 +163,6 @@ function stateModelFactory(pluginManager) {
|
|
|
161
163
|
removeView(view) {
|
|
162
164
|
self.views.remove(view);
|
|
163
165
|
},
|
|
164
|
-
/**
|
|
165
|
-
* #action
|
|
166
|
-
* removes the view itself from the state tree entirely by calling the
|
|
167
|
-
* parent removeView
|
|
168
|
-
*/
|
|
169
|
-
closeView() {
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
171
|
-
(0, mobx_state_tree_1.getParent)(self, 2).removeView(self);
|
|
172
|
-
},
|
|
173
166
|
/**
|
|
174
167
|
* #action
|
|
175
168
|
*/
|
|
@@ -236,7 +229,9 @@ function stateModelFactory(pluginManager) {
|
|
|
236
229
|
const schema = pluginManager.pluggableConfigSchemaType('track');
|
|
237
230
|
const config = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
|
|
238
231
|
const shownTracks = self.tracks.filter(t => t.configuration === config);
|
|
239
|
-
(0, mobx_1.transaction)(() =>
|
|
232
|
+
(0, mobx_1.transaction)(() => {
|
|
233
|
+
shownTracks.forEach(t => self.tracks.remove(t));
|
|
234
|
+
});
|
|
240
235
|
return shownTracks.length;
|
|
241
236
|
},
|
|
242
237
|
/**
|
|
@@ -278,8 +273,7 @@ function stateModelFactory(pluginManager) {
|
|
|
278
273
|
menuItems() {
|
|
279
274
|
return [
|
|
280
275
|
...self.views
|
|
281
|
-
.map((view, idx) =>
|
|
282
|
-
.filter(f => !!f[1])
|
|
276
|
+
.map((view, idx) => [idx, view.menuItems()])
|
|
283
277
|
.map(f => ({ label: `View ${f[0] + 1} Menu`, subMenu: f[1] })),
|
|
284
278
|
{
|
|
285
279
|
label: 'Return to import form',
|
|
@@ -321,7 +315,9 @@ function stateModelFactory(pluginManager) {
|
|
|
321
315
|
afterAttach() {
|
|
322
316
|
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
323
317
|
if (self.width) {
|
|
324
|
-
self.views.forEach(v =>
|
|
318
|
+
self.views.forEach(v => {
|
|
319
|
+
v.setWidth(self.width);
|
|
320
|
+
});
|
|
325
321
|
}
|
|
326
322
|
}));
|
|
327
323
|
},
|
|
@@ -136,7 +136,7 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
|
136
136
|
const totalLength = flags & 2048 ? getLength(suppAlns[0].CIGAR) : getLength(cigar);
|
|
137
137
|
const features = [feat, ...suppAlns];
|
|
138
138
|
features.forEach((f, idx) => {
|
|
139
|
-
f.refName =
|
|
139
|
+
f.refName = assembly.getCanonicalRefName(f.refName) || f.refName;
|
|
140
140
|
f.syntenyId = idx;
|
|
141
141
|
f.mate.syntenyId = idx;
|
|
142
142
|
f.mate.uniqueId = `${f.uniqueId}_mate`;
|
|
@@ -157,10 +157,10 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
|
157
157
|
assemblyName: trackAssembly,
|
|
158
158
|
})));
|
|
159
159
|
(_a = session.addTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, {
|
|
160
|
-
name:
|
|
160
|
+
name: readAssembly,
|
|
161
161
|
sequence: {
|
|
162
162
|
type: 'ReferenceSequenceTrack',
|
|
163
|
-
name:
|
|
163
|
+
name: 'Read sequence',
|
|
164
164
|
trackId: seqTrackId,
|
|
165
165
|
assemblyNames: [readAssembly],
|
|
166
166
|
adapter: {
|
|
@@ -277,7 +277,9 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
|
277
277
|
react_1.default.createElement(material_1.CircularProgress, null))) : (react_1.default.createElement("div", { className: classes.root },
|
|
278
278
|
primaryFeature.get('flags') & 256 ? (react_1.default.createElement(material_1.Typography, { style: { color: 'orange' } }, "Note: You selected a secondary alignment (which generally does not have SA tags or SEQ fields) so do a full reconstruction of the alignment")) : null,
|
|
279
279
|
react_1.default.createElement(material_1.Typography, null, "Show an extra window size around each part of the split alignment. Using a larger value can allow you to see more genomic context."),
|
|
280
|
-
react_1.default.createElement(material_1.TextField, { value: windowSize, onChange: event =>
|
|
280
|
+
react_1.default.createElement(material_1.TextField, { value: windowSize, onChange: event => {
|
|
281
|
+
setWindowSize(event.target.value);
|
|
282
|
+
}, label: "Set window size" })))),
|
|
281
283
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
282
284
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: handleClose }, "Cancel"),
|
|
283
285
|
react_1.default.createElement(material_1.Button, { disabled: !primaryFeature, variant: "contained", color: "primary", onClick: onSubmit }, "Submit"))));
|
|
@@ -72,8 +72,8 @@ function doAfterAttach(self) {
|
|
|
72
72
|
;
|
|
73
73
|
[f1e, f1s] = [f1s, f1e];
|
|
74
74
|
}
|
|
75
|
-
const a1 = assemblyManager
|
|
76
|
-
const a2 = assemblyManager
|
|
75
|
+
const a1 = assemblyManager.get(f.get('assemblyName'));
|
|
76
|
+
const a2 = assemblyManager.get(mate.assemblyName);
|
|
77
77
|
const r1 = f.get('refName');
|
|
78
78
|
const r2 = mate.refName;
|
|
79
79
|
const ref1 = (a1 === null || a1 === void 0 ? void 0 : a1.getCanonicalRefName(r1)) || r1;
|
|
@@ -57,8 +57,12 @@ function LoadingMessage() {
|
|
|
57
57
|
const [shown, setShown] = (0, react_1.useState)(false);
|
|
58
58
|
const { classes } = useStyles();
|
|
59
59
|
(0, react_1.useEffect)(() => {
|
|
60
|
-
const timeout = setTimeout(() =>
|
|
61
|
-
|
|
60
|
+
const timeout = setTimeout(() => {
|
|
61
|
+
setShown(true);
|
|
62
|
+
}, 300);
|
|
63
|
+
return () => {
|
|
64
|
+
clearTimeout(timeout);
|
|
65
|
+
};
|
|
62
66
|
});
|
|
63
67
|
return shown ? (react_1.default.createElement("div", { className: classes.loading },
|
|
64
68
|
react_1.default.createElement(ui_1.LoadingEllipses, null))) : null;
|
|
@@ -69,15 +69,20 @@ const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, })
|
|
|
69
69
|
const [mouseInitialDownX, setMouseInitialDownX] = (0, react_1.useState)();
|
|
70
70
|
const [currY, setCurrY] = (0, react_1.useState)();
|
|
71
71
|
const { mouseoverId } = model;
|
|
72
|
-
// these useCallbacks avoid new refs from being created on any mouseover,
|
|
73
|
-
|
|
72
|
+
// these useCallbacks avoid new refs from being created on any mouseover,
|
|
73
|
+
// etc.
|
|
74
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
75
|
+
const k1 = (0, react_1.useCallback)((ref) => {
|
|
76
|
+
model.setMouseoverCanvasRef(ref);
|
|
77
|
+
},
|
|
74
78
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
79
|
[model, height, width]);
|
|
80
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
76
81
|
const k2 = (0, react_1.useCallback)((ref) => {
|
|
77
82
|
model.setMainCanvasRef(ref);
|
|
78
83
|
function onWheel(event) {
|
|
79
84
|
event.preventDefault();
|
|
80
|
-
if (event.ctrlKey
|
|
85
|
+
if (event.ctrlKey) {
|
|
81
86
|
delta.current += event.deltaY / 500;
|
|
82
87
|
for (const v of view.views) {
|
|
83
88
|
v.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
|
|
@@ -112,21 +117,26 @@ const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, })
|
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
return () => { };
|
|
120
|
+
ref === null || ref === void 0 ? void 0 : ref.addEventListener('wheel', onWheel);
|
|
121
|
+
// this is a react 19-ism to have a cleanup in the ref callback
|
|
122
|
+
// https://react.dev/blog/2024/04/25/react-19#cleanup-functions-for-refs
|
|
123
|
+
// note: it warns in earlier versions of react
|
|
124
|
+
return () => {
|
|
125
|
+
ref === null || ref === void 0 ? void 0 : ref.removeEventListener('wheel', onWheel);
|
|
126
|
+
};
|
|
123
127
|
},
|
|
124
128
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
125
129
|
[model, height, width]);
|
|
126
|
-
|
|
130
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
131
|
+
const k3 = (0, react_1.useCallback)((ref) => {
|
|
132
|
+
model.setClickMapCanvasRef(ref);
|
|
133
|
+
},
|
|
127
134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
128
135
|
[model, height, width]);
|
|
129
|
-
|
|
136
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
137
|
+
const k4 = (0, react_1.useCallback)((ref) => {
|
|
138
|
+
model.setCigarClickMapCanvasRef(ref);
|
|
139
|
+
},
|
|
130
140
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
141
|
[model, height, width]);
|
|
132
142
|
return (react_1.default.createElement("div", { className: classes.rel },
|
|
@@ -193,10 +203,14 @@ const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, })
|
|
|
193
203
|
Math.abs(evt.clientX - mouseInitialDownX) < 5) {
|
|
194
204
|
(0, util_2.onSynClick)(evt, model);
|
|
195
205
|
}
|
|
196
|
-
}, onContextMenu: evt =>
|
|
206
|
+
}, onContextMenu: evt => {
|
|
207
|
+
(0, util_2.onSynContextClick)(evt, model, setAnchorEl);
|
|
208
|
+
}, "data-testid": "synteny_canvas", className: classes.abs, width: width, height: height }),
|
|
197
209
|
react_1.default.createElement("canvas", { ref: k3, className: classes.pix, width: width, height: height }),
|
|
198
210
|
react_1.default.createElement("canvas", { ref: k4, className: classes.pix, width: width, height: height }),
|
|
199
211
|
mouseoverId && tooltip && currX && currY ? (react_1.default.createElement(SyntenyTooltip_1.default, { title: tooltip })) : null,
|
|
200
|
-
anchorEl ? (react_1.default.createElement(SyntenyContextMenu_1.default, { model: model, anchorEl: anchorEl, onClose: () =>
|
|
212
|
+
anchorEl ? (react_1.default.createElement(SyntenyContextMenu_1.default, { model: model, anchorEl: anchorEl, onClose: () => {
|
|
213
|
+
setAnchorEl(undefined);
|
|
214
|
+
} })) : null));
|
|
201
215
|
});
|
|
202
216
|
exports.default = LinearSyntenyRendering;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Feature } from '@jbrowse/core/util';
|
|
2
3
|
import { LinearSyntenyDisplayModel } from '../model';
|
|
3
4
|
interface ClickCoord {
|
|
4
5
|
clientX: number;
|
|
5
6
|
clientY: number;
|
|
6
|
-
feature:
|
|
7
|
+
feature: {
|
|
8
|
+
f: Feature;
|
|
9
|
+
};
|
|
7
10
|
}
|
|
8
11
|
export default function SyntenyContextMenu({ model, onClose, anchorEl, }: {
|
|
9
12
|
onClose: () => void;
|
|
@@ -39,15 +39,11 @@ function SyntenyContextMenu({ model, onClose, anchorEl, }) {
|
|
|
39
39
|
const end = f.get('end');
|
|
40
40
|
const refName = f.get('refName');
|
|
41
41
|
const mate = f.get('mate');
|
|
42
|
-
view.views[0]
|
|
43
|
-
.navToLocString(`${refName}:${start}-${end}`)
|
|
44
|
-
.catch(e => {
|
|
42
|
+
view.views[0].navToLocString(`${refName}:${start}-${end}`).catch((e) => {
|
|
45
43
|
console.error(e);
|
|
46
44
|
(0, util_1.getSession)(model).notifyError(`${e}`, e);
|
|
47
45
|
});
|
|
48
|
-
view.views[1]
|
|
49
|
-
.navToLocString(`${mate.refName}:${mate.start}-${mate.end}`)
|
|
50
|
-
.catch(e => {
|
|
46
|
+
view.views[1].navToLocString(`${mate.refName}:${mate.start}-${mate.end}`).catch((e) => {
|
|
51
47
|
console.error(e);
|
|
52
48
|
(0, util_1.getSession)(model).notifyError(`${e}`, e);
|
|
53
49
|
});
|
|
@@ -39,7 +39,7 @@ const SyntenyTooltip = (0, mobx_react_1.observer)(function ({ title }) {
|
|
|
39
39
|
});
|
|
40
40
|
const clientPoint = (0, react_2.useClientPoint)(context);
|
|
41
41
|
const { getFloatingProps } = (0, react_2.useInteractions)([clientPoint]);
|
|
42
|
-
const popperTheme = (_a = theme
|
|
42
|
+
const popperTheme = (_a = theme.components) === null || _a === void 0 ? void 0 : _a.MuiPopper;
|
|
43
43
|
return title ? (react_1.default.createElement(material_1.Portal, { container: (_b = popperTheme === null || popperTheme === void 0 ? void 0 : popperTheme.defaultProps) === null || _b === void 0 ? void 0 : _b.container },
|
|
44
44
|
react_1.default.createElement("div", { className: classes.tooltip, ref: refs.setFloating, style: {
|
|
45
45
|
...floatingStyles,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LinearSyntenyDisplayModel } from './model';
|
|
2
2
|
export declare const MAX_COLOR_RANGE: number;
|
|
3
3
|
export declare function getId(r: number, g: number, b: number, unitMultiplier: number): number;
|
|
4
|
-
export declare function drawRef(model: LinearSyntenyDisplayModel, ctx1: CanvasRenderingContext2D, ctx3?: CanvasRenderingContext2D):
|
|
4
|
+
export declare function drawRef(model: LinearSyntenyDisplayModel, ctx1: CanvasRenderingContext2D, ctx3?: CanvasRenderingContext2D): undefined;
|
|
5
5
|
export declare function drawMouseoverSynteny(model: LinearSyntenyDisplayModel): void;
|