@jbrowse/plugin-linear-comparative-view 2.6.3 → 2.7.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/dist/LGVSyntenyDisplay/model.d.ts +14 -2
- package/dist/LinearComparativeDisplay/configSchemaF.d.ts +1 -1
- package/dist/LinearComparativeDisplay/configSchemaF.js +1 -1
- package/dist/LinearComparativeDisplay/stateModelFactory.js +4 -4
- package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +2 -2
- package/dist/LinearComparativeView/components/LinearComparativeView.js +2 -1
- package/dist/LinearComparativeView/components/Rubberband.d.ts +4 -5
- package/dist/LinearComparativeView/components/Rubberband.js +3 -3
- package/dist/LinearComparativeView/model.d.ts +6 -6
- package/dist/LinearComparativeView/model.js +5 -2
- package/dist/LinearReadVsRef/LinearReadVsRef.js +2 -1
- package/dist/LinearSyntenyDisplay/afterAttach.js +1 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +2 -1
- package/dist/LinearSyntenyDisplay/drawSynteny.js +2 -4
- package/dist/LinearSyntenyView/components/ImportCustomTrack.d.ts +1 -1
- package/dist/LinearSyntenyView/components/ImportCustomTrack.js +1 -1
- package/dist/LinearSyntenyView/components/ImportForm.d.ts +2 -2
- package/dist/LinearSyntenyView/components/ImportForm.js +2 -1
- package/dist/LinearSyntenyView/model.d.ts +18 -18
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -2
- package/dist/SyntenyTrack/index.d.ts +1 -2
- package/dist/SyntenyTrack/index.js +6 -5
- package/dist/util.js +2 -1
- package/esm/LGVSyntenyDisplay/model.d.ts +14 -2
- package/esm/LinearComparativeDisplay/configSchemaF.d.ts +1 -1
- package/esm/LinearComparativeDisplay/configSchemaF.js +1 -1
- package/esm/LinearComparativeDisplay/stateModelFactory.js +4 -4
- package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +2 -2
- package/esm/LinearComparativeView/components/LinearComparativeView.js +2 -1
- package/esm/LinearComparativeView/components/Rubberband.d.ts +4 -5
- package/esm/LinearComparativeView/components/Rubberband.js +3 -3
- package/esm/LinearComparativeView/model.d.ts +6 -6
- package/esm/LinearComparativeView/model.js +5 -2
- package/esm/LinearReadVsRef/LinearReadVsRef.js +2 -1
- package/esm/LinearSyntenyDisplay/afterAttach.js +1 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -2
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +2 -1
- package/esm/LinearSyntenyDisplay/drawSynteny.js +2 -4
- package/esm/LinearSyntenyView/components/ImportCustomTrack.d.ts +1 -1
- package/esm/LinearSyntenyView/components/ImportCustomTrack.js +1 -1
- package/esm/LinearSyntenyView/components/ImportForm.d.ts +2 -2
- package/esm/LinearSyntenyView/components/ImportForm.js +2 -1
- package/esm/LinearSyntenyView/model.d.ts +18 -18
- package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +2 -2
- package/esm/SyntenyTrack/index.d.ts +1 -2
- package/esm/SyntenyTrack/index.js +5 -5
- package/esm/util.js +2 -1
- package/package.json +3 -4
|
@@ -105,6 +105,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
105
105
|
value: import("mobx-state-tree").ISimpleType<string>;
|
|
106
106
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
107
107
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
108
|
+
jexlFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
108
109
|
} & {
|
|
109
110
|
/**
|
|
110
111
|
* #property
|
|
@@ -263,7 +264,8 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
263
264
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
264
265
|
setSubschema(slotName: string, data: unknown): any;
|
|
265
266
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>): void;
|
|
266
|
-
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/
|
|
267
|
+
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared").IFilter): void;
|
|
268
|
+
setJexlFilters(filters: string[]): void;
|
|
267
269
|
} & {
|
|
268
270
|
readonly rendererConfig: {
|
|
269
271
|
[x: string]: any;
|
|
@@ -275,6 +277,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
275
277
|
readonly featureHeightSetting: any;
|
|
276
278
|
readonly featureUnderMouse: Feature | undefined;
|
|
277
279
|
renderReady(): boolean;
|
|
280
|
+
readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
278
281
|
} & {
|
|
279
282
|
readonly rendererTypeName: string;
|
|
280
283
|
contextMenuItems(): ({
|
|
@@ -288,7 +291,16 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
288
291
|
icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
|
|
289
292
|
onClick: () => void;
|
|
290
293
|
})[];
|
|
291
|
-
readonly DisplayBlurb: (
|
|
294
|
+
readonly DisplayBlurb: ({ model, }: {
|
|
295
|
+
model: {
|
|
296
|
+
sortedBy?: {
|
|
297
|
+
pos: number;
|
|
298
|
+
refName: number;
|
|
299
|
+
type: string;
|
|
300
|
+
tag?: string | undefined;
|
|
301
|
+
} | undefined;
|
|
302
|
+
};
|
|
303
|
+
}) => import("react").JSX.Element | null;
|
|
292
304
|
renderPropsPre(): any;
|
|
293
305
|
colorSchemeSubMenuItems(): {
|
|
294
306
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* #config LinearComparativeDisplay
|
|
3
3
|
*/
|
|
4
|
-
declare function configSchemaFactory(
|
|
4
|
+
declare function configSchemaFactory(_pluginManager: any): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
5
5
|
export default configSchemaFactory;
|
|
@@ -5,7 +5,7 @@ const configuration_1 = require("@jbrowse/core/configuration");
|
|
|
5
5
|
/**
|
|
6
6
|
* #config LinearComparativeDisplay
|
|
7
7
|
*/
|
|
8
|
-
function configSchemaFactory(
|
|
8
|
+
function configSchemaFactory(_pluginManager) {
|
|
9
9
|
return (0, configuration_1.ConfigurationSchema)('LinearComparativeDisplay', {}, {
|
|
10
10
|
explicitlyTyped: true,
|
|
11
11
|
/**
|
|
@@ -79,14 +79,14 @@ function stateModelFactory(configSchema) {
|
|
|
79
79
|
const newFeatIds = new Set((features === null || features === void 0 ? void 0 : features.map(f => f.id())) || []);
|
|
80
80
|
let foundNewFeatureNotInExistingMap = false;
|
|
81
81
|
let foundExistingFeatureNotInNewMap = false;
|
|
82
|
-
for (
|
|
83
|
-
if (!featIds.has(
|
|
82
|
+
for (const feat of features) {
|
|
83
|
+
if (!featIds.has(feat.id())) {
|
|
84
84
|
foundNewFeatureNotInExistingMap = true;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
for (
|
|
89
|
-
if (!newFeatIds.has(
|
|
88
|
+
for (const existingFeat of existingFeatures) {
|
|
89
|
+
if (!newFeatIds.has(existingFeat.id())) {
|
|
90
90
|
foundExistingFeatureNotInNewMap = true;
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearComparativeViewModel } from '../model';
|
|
3
3
|
type LCV = LinearComparativeViewModel;
|
|
4
|
-
declare const
|
|
4
|
+
declare const LinearComparativeView: (props: {
|
|
5
5
|
ExtraButtons?: React.ReactNode;
|
|
6
6
|
model: LCV;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
export default
|
|
8
|
+
export default LinearComparativeView;
|
|
@@ -91,8 +91,9 @@ const OverlayComparativeView = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
91
91
|
})),
|
|
92
92
|
react_1.default.createElement(Overlays, { model: model })))));
|
|
93
93
|
});
|
|
94
|
-
|
|
94
|
+
const LinearComparativeView = (0, mobx_react_1.observer)(function (props) {
|
|
95
95
|
const { model } = props;
|
|
96
96
|
const middle = model.tracks.some(({ displays }) => displays.some((d) => (0, configuration_1.getConf)(d, 'middle')));
|
|
97
97
|
return middle ? (react_1.default.createElement(MiddleComparativeView, { ...props })) : (react_1.default.createElement(OverlayComparativeView, { ...props }));
|
|
98
98
|
});
|
|
99
|
+
exports.default = LinearComparativeView;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearComparativeViewModel } from '../model';
|
|
3
3
|
type LCV = LinearComparativeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const LinearComparativeRubberband: ({ model, ControlComponent, }: {
|
|
5
5
|
model: LCV;
|
|
6
|
-
ControlComponent?: React.ReactElement;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
6
|
+
ControlComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default LinearComparativeRubberband;
|
|
@@ -65,7 +65,7 @@ const useStyles = (0, mui_1.makeStyles)()(theme => {
|
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
|
-
function Rubberband({ model, ControlComponent = react_1.default.createElement("div", null), }) {
|
|
68
|
+
const LinearComparativeRubberband = (0, mobx_react_1.observer)(function Rubberband({ model, ControlComponent = react_1.default.createElement("div", null), }) {
|
|
69
69
|
const [startX, setStartX] = (0, react_1.useState)();
|
|
70
70
|
const [currentX, setCurrentX] = (0, react_1.useState)();
|
|
71
71
|
// clientX and clientY used for anchorPosition for menu
|
|
@@ -199,5 +199,5 @@ function Rubberband({ model, ControlComponent = react_1.default.createElement("d
|
|
|
199
199
|
left: anchorPosition.clientX,
|
|
200
200
|
top: anchorPosition.clientY,
|
|
201
201
|
}, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: model.rubberBandMenuItems() })) : null));
|
|
202
|
-
}
|
|
203
|
-
exports.default =
|
|
202
|
+
});
|
|
203
|
+
exports.default = LinearComparativeRubberband;
|
|
@@ -62,12 +62,10 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
62
62
|
volatileWidth: number | undefined;
|
|
63
63
|
minimumBlockWidth: number;
|
|
64
64
|
draggingTrackId: string | undefined;
|
|
65
|
-
volatileError:
|
|
65
|
+
volatileError: unknown;
|
|
66
66
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
67
67
|
scaleFactor: number;
|
|
68
|
-
trackRefs:
|
|
69
|
-
[key: string]: HTMLDivElement;
|
|
70
|
-
};
|
|
68
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
71
69
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
72
70
|
coarseTotalBp: number;
|
|
73
71
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -91,7 +89,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
91
89
|
readonly totalBp: number;
|
|
92
90
|
readonly maxBpPerPx: number;
|
|
93
91
|
readonly minBpPerPx: number;
|
|
94
|
-
readonly error:
|
|
92
|
+
readonly error: {};
|
|
95
93
|
readonly maxOffset: number;
|
|
96
94
|
readonly minOffset: number;
|
|
97
95
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -108,7 +106,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
108
106
|
} & {
|
|
109
107
|
setShowCytobands(flag: boolean): void;
|
|
110
108
|
setWidth(newWidth: number): void;
|
|
111
|
-
setError(error:
|
|
109
|
+
setError(error: unknown): void;
|
|
112
110
|
toggleHeader(): void;
|
|
113
111
|
toggleHeaderOverview(): void;
|
|
114
112
|
toggleNoTracksActive(): void;
|
|
@@ -210,6 +208,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
210
208
|
end: number;
|
|
211
209
|
reversed: boolean;
|
|
212
210
|
} | undefined;
|
|
211
|
+
} & {
|
|
212
|
+
afterCreate(): void;
|
|
213
213
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
214
214
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
215
215
|
}, {
|
|
@@ -140,13 +140,16 @@ function stateModelFactory(pluginManager) {
|
|
|
140
140
|
// automatically removes session assemblies associated with this view
|
|
141
141
|
// e.g. read vs ref
|
|
142
142
|
beforeDestroy() {
|
|
143
|
+
var _a;
|
|
143
144
|
const session = (0, util_1.getSession)(self);
|
|
144
|
-
|
|
145
|
+
for (const name of self.assemblyNames) {
|
|
146
|
+
(_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
|
|
147
|
+
}
|
|
145
148
|
},
|
|
146
149
|
onSubviewAction(actionName, path, args) {
|
|
147
150
|
self.views.forEach(view => {
|
|
148
151
|
const ret = (0, mobx_state_tree_1.getPath)(view);
|
|
149
|
-
if (ret.
|
|
152
|
+
if (!ret.endsWith(path)) {
|
|
150
153
|
// @ts-expect-error
|
|
151
154
|
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
152
155
|
}
|
|
@@ -93,6 +93,7 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
|
93
93
|
})();
|
|
94
94
|
}, [preFeature, track]);
|
|
95
95
|
function onSubmit() {
|
|
96
|
+
var _a;
|
|
96
97
|
try {
|
|
97
98
|
if (!primaryFeature) {
|
|
98
99
|
return;
|
|
@@ -154,7 +155,7 @@ function ReadVsRefDialog({ track, feature: preFeature, handleClose, }) {
|
|
|
154
155
|
end: f.end + windowSize,
|
|
155
156
|
assemblyName: trackAssembly,
|
|
156
157
|
})));
|
|
157
|
-
session.addTemporaryAssembly({
|
|
158
|
+
(_a = session.addTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, {
|
|
158
159
|
name: `${readAssembly}`,
|
|
159
160
|
sequence: {
|
|
160
161
|
type: 'ReferenceSequenceTrack',
|
|
@@ -62,8 +62,7 @@ function doAfterAttach(self) {
|
|
|
62
62
|
}));
|
|
63
63
|
const map = [];
|
|
64
64
|
const feats = self.features || [];
|
|
65
|
-
for (
|
|
66
|
-
const f = feats[i];
|
|
65
|
+
for (const f of feats) {
|
|
67
66
|
const mate = f.get('mate');
|
|
68
67
|
let f1s = f.get('start');
|
|
69
68
|
let f1e = f.get('end');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearSyntenyDisplayModel } from '../model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const LinearSyntenyRendering: ({ model, }: {
|
|
4
4
|
model: LinearSyntenyDisplayModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default LinearSyntenyRendering;
|
|
@@ -32,7 +32,7 @@ const util_1 = require("@jbrowse/core/util");
|
|
|
32
32
|
// locals
|
|
33
33
|
const SyntenyTooltip_1 = __importDefault(require("./SyntenyTooltip"));
|
|
34
34
|
const drawSynteny_1 = require("../drawSynteny");
|
|
35
|
-
|
|
35
|
+
const LinearSyntenyRendering = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
36
36
|
const highResolutionScaling = 1;
|
|
37
37
|
const view = (0, util_1.getContainingView)(model);
|
|
38
38
|
const height = view.middleComparativeHeight;
|
|
@@ -157,3 +157,4 @@ exports.default = (0, mobx_react_1.observer)(function LinearSyntenyRendering({ m
|
|
|
157
157
|
}, width: width, height: height }),
|
|
158
158
|
model.mouseoverId && tooltip && currX && currY ? (react_1.default.createElement(SyntenyTooltip_1.default, { x: currX, y: currY, title: tooltip })) : null));
|
|
159
159
|
});
|
|
160
|
+
exports.default = LinearSyntenyRendering;
|
|
@@ -43,8 +43,7 @@ function drawRef(model, ctx1, ctx3) {
|
|
|
43
43
|
// call, a separate loop below draws larger boxes
|
|
44
44
|
ctx1.fillStyle = colorMap.M;
|
|
45
45
|
ctx1.strokeStyle = colorMap.M;
|
|
46
|
-
for (
|
|
47
|
-
const { p11, p12, p21, p22 } = featPos[i];
|
|
46
|
+
for (const { p11, p12, p21, p22 } of featPos) {
|
|
48
47
|
const x11 = p11.offsetPx - offsets[0];
|
|
49
48
|
const x12 = p12.offsetPx - offsets[0];
|
|
50
49
|
const x21 = p21.offsetPx - offsets[1];
|
|
@@ -74,8 +73,7 @@ function drawRef(model, ctx1, ctx3) {
|
|
|
74
73
|
// ctx.stroke once is much more efficient than calling stroke() many times
|
|
75
74
|
ctx1.fillStyle = colorMap.M;
|
|
76
75
|
ctx1.strokeStyle = colorMap.M;
|
|
77
|
-
for (
|
|
78
|
-
const { p11, p12, p21, p22, f, cigar } = featPos[i];
|
|
76
|
+
for (const { p11, p12, p21, p22, f, cigar } of featPos) {
|
|
79
77
|
const x11 = p11.offsetPx - offsets[0];
|
|
80
78
|
const x12 = p12.offsetPx - offsets[0];
|
|
81
79
|
const x21 = p21.offsetPx - offsets[1];
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { SnapshotIn } from 'mobx-state-tree';
|
|
3
3
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
4
|
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
|
-
declare const OpenTrack: ({
|
|
5
|
+
declare const OpenTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
|
|
6
6
|
sessionTrackData: Conf;
|
|
7
7
|
assembly1: string;
|
|
8
8
|
assembly2: string;
|
|
@@ -99,7 +99,7 @@ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Locat
|
|
|
99
99
|
throw new Error('Unknown type');
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
const OpenTrack = (0, mobx_react_1.observer)(({
|
|
102
|
+
const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSessionTrackData, }) => {
|
|
103
103
|
const [bed2Location, setBed2Location] = (0, react_1.useState)();
|
|
104
104
|
const [bed1Location, setBed1Location] = (0, react_1.useState)();
|
|
105
105
|
const [fileLocation, setFileLocation] = (0, react_1.useState)();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearSyntenyViewModel } from '../model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const LinearSyntenyViewImportForm: ({ model, }: {
|
|
4
4
|
model: LinearSyntenyViewModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default LinearSyntenyViewImportForm;
|
|
@@ -62,7 +62,7 @@ function TrackSelector({ setSessionTrackData, setShowTrackId, sessionTrackData,
|
|
|
62
62
|
choice === 'custom' ? (react_1.default.createElement(ImportCustomTrack_1.default, { setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, assembly2: assembly2, assembly1: assembly1 })) : null,
|
|
63
63
|
choice === 'tracklist' ? (react_1.default.createElement(ImportSyntenyTrackSelector_1.default, { model: model, assembly1: assembly1, assembly2: assembly2, setShowTrackId: setShowTrackId })) : null));
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
const LinearSyntenyViewImportForm = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
66
66
|
const { classes } = useStyles();
|
|
67
67
|
const session = (0, util_1.getSession)(model);
|
|
68
68
|
const { assemblyNames } = session;
|
|
@@ -124,3 +124,4 @@ exports.default = (0, mobx_react_1.observer)(function ({ model, }) {
|
|
|
124
124
|
react_1.default.createElement(material_1.Button, { onClick: onOpenClick, variant: "contained", color: "primary" }, "Launch"))))),
|
|
125
125
|
react_1.default.createElement(TrackSelector, { setShowTrackId: setShowTrackId, assembly2: assembly2, assembly1: assembly1, setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, model: model })))));
|
|
126
126
|
});
|
|
127
|
+
exports.default = LinearSyntenyViewImportForm;
|
|
@@ -73,12 +73,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
73
73
|
volatileWidth: number | undefined;
|
|
74
74
|
minimumBlockWidth: number;
|
|
75
75
|
draggingTrackId: string | undefined;
|
|
76
|
-
volatileError:
|
|
76
|
+
volatileError: unknown;
|
|
77
77
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
78
78
|
scaleFactor: number;
|
|
79
|
-
trackRefs:
|
|
80
|
-
[key: string]: HTMLDivElement;
|
|
81
|
-
};
|
|
79
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
82
80
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
83
81
|
coarseTotalBp: number;
|
|
84
82
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -102,7 +100,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
102
100
|
readonly totalBp: number;
|
|
103
101
|
readonly maxBpPerPx: number;
|
|
104
102
|
readonly minBpPerPx: number;
|
|
105
|
-
readonly error:
|
|
103
|
+
readonly error: {};
|
|
106
104
|
readonly maxOffset: number;
|
|
107
105
|
readonly minOffset: number;
|
|
108
106
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -119,7 +117,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
119
117
|
} & {
|
|
120
118
|
setShowCytobands(flag: boolean): void;
|
|
121
119
|
setWidth(newWidth: number): void;
|
|
122
|
-
setError(error:
|
|
120
|
+
setError(error: unknown): void;
|
|
123
121
|
toggleHeader(): void;
|
|
124
122
|
toggleHeaderOverview(): void;
|
|
125
123
|
toggleNoTracksActive(): void;
|
|
@@ -221,6 +219,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
221
219
|
end: number;
|
|
222
220
|
reversed: boolean;
|
|
223
221
|
} | undefined;
|
|
222
|
+
} & {
|
|
223
|
+
afterCreate(): void;
|
|
224
224
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
225
225
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
226
226
|
} & {
|
|
@@ -323,12 +323,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
323
323
|
volatileWidth: number | undefined;
|
|
324
324
|
minimumBlockWidth: number;
|
|
325
325
|
draggingTrackId: string | undefined;
|
|
326
|
-
volatileError:
|
|
326
|
+
volatileError: unknown;
|
|
327
327
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
328
328
|
scaleFactor: number;
|
|
329
|
-
trackRefs:
|
|
330
|
-
[key: string]: HTMLDivElement;
|
|
331
|
-
};
|
|
329
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
332
330
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
333
331
|
coarseTotalBp: number;
|
|
334
332
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -352,7 +350,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
352
350
|
readonly totalBp: number;
|
|
353
351
|
readonly maxBpPerPx: number;
|
|
354
352
|
readonly minBpPerPx: number;
|
|
355
|
-
readonly error:
|
|
353
|
+
readonly error: {};
|
|
356
354
|
readonly maxOffset: number;
|
|
357
355
|
readonly minOffset: number;
|
|
358
356
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -369,7 +367,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
369
367
|
} & {
|
|
370
368
|
setShowCytobands(flag: boolean): void;
|
|
371
369
|
setWidth(newWidth: number): void;
|
|
372
|
-
setError(error:
|
|
370
|
+
setError(error: unknown): void;
|
|
373
371
|
toggleHeader(): void;
|
|
374
372
|
toggleHeaderOverview(): void;
|
|
375
373
|
toggleNoTracksActive(): void;
|
|
@@ -471,6 +469,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
471
469
|
end: number;
|
|
472
470
|
reversed: boolean;
|
|
473
471
|
} | undefined;
|
|
472
|
+
} & {
|
|
473
|
+
afterCreate(): void;
|
|
474
474
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
475
475
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
476
476
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -511,12 +511,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
511
511
|
volatileWidth: number | undefined;
|
|
512
512
|
minimumBlockWidth: number;
|
|
513
513
|
draggingTrackId: string | undefined;
|
|
514
|
-
volatileError:
|
|
514
|
+
volatileError: unknown;
|
|
515
515
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
516
516
|
scaleFactor: number;
|
|
517
|
-
trackRefs:
|
|
518
|
-
[key: string]: HTMLDivElement;
|
|
519
|
-
};
|
|
517
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
520
518
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
521
519
|
coarseTotalBp: number;
|
|
522
520
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -540,7 +538,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
540
538
|
readonly totalBp: number;
|
|
541
539
|
readonly maxBpPerPx: number;
|
|
542
540
|
readonly minBpPerPx: number;
|
|
543
|
-
readonly error:
|
|
541
|
+
readonly error: {};
|
|
544
542
|
readonly maxOffset: number;
|
|
545
543
|
readonly minOffset: number;
|
|
546
544
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -557,7 +555,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
557
555
|
} & {
|
|
558
556
|
setShowCytobands(flag: boolean): void;
|
|
559
557
|
setWidth(newWidth: number): void;
|
|
560
|
-
setError(error:
|
|
558
|
+
setError(error: unknown): void;
|
|
561
559
|
toggleHeader(): void;
|
|
562
560
|
toggleHeaderOverview(): void;
|
|
563
561
|
toggleNoTracksActive(): void;
|
|
@@ -659,6 +657,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
659
657
|
end: number;
|
|
660
658
|
reversed: boolean;
|
|
661
659
|
} | undefined;
|
|
660
|
+
} & {
|
|
661
|
+
afterCreate(): void;
|
|
662
662
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
663
663
|
closeView(): void;
|
|
664
664
|
setMiddleComparativeHeight(n: number): number;
|
|
@@ -5,9 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
|
-
const
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
function SVGBackground({ width, height, shift, }) {
|
|
10
10
|
const theme = (0, material_1.useTheme)();
|
|
11
|
-
return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: (0,
|
|
11
|
+
return (react_1.default.createElement("rect", { width: width + shift * 2, height: height, fill: (0, util_1.stripAlpha)(theme.palette.background.default) }));
|
|
12
12
|
}
|
|
13
13
|
exports.default = SVGBackground;
|
|
@@ -6,13 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
7
7
|
const TrackType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/TrackType"));
|
|
8
8
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const configSchema = (0, configSchema_1.default)(
|
|
9
|
+
function registerSyntenyTrack(pluginManager) {
|
|
10
|
+
pluginManager.addTrackType(() => {
|
|
11
|
+
const configSchema = (0, configSchema_1.default)(pluginManager);
|
|
12
12
|
return new TrackType_1.default({
|
|
13
13
|
name: 'SyntenyTrack',
|
|
14
14
|
configSchema,
|
|
15
|
-
stateModel: (0, models_1.createBaseTrackModel)(
|
|
15
|
+
stateModel: (0, models_1.createBaseTrackModel)(pluginManager, 'SyntenyTrack', configSchema),
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = registerSyntenyTrack;
|
package/dist/util.js
CHANGED
|
@@ -30,7 +30,8 @@ exports.getTrackPos = getTrackPos;
|
|
|
30
30
|
// Uses bpToPx to get the screen pixel coordinates but ignores some conditions
|
|
31
31
|
// where bpToPx could return undefined
|
|
32
32
|
function getPxFromCoordinate(view, refName, coord) {
|
|
33
|
-
|
|
33
|
+
var _a;
|
|
34
|
+
return (((_a = bpToPx(view, { refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
|
|
34
35
|
}
|
|
35
36
|
exports.getPxFromCoordinate = getPxFromCoordinate;
|
|
36
37
|
// Retrieves the y-position of a layout record in a track
|
|
@@ -105,6 +105,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
105
105
|
value: import("mobx-state-tree").ISimpleType<string>;
|
|
106
106
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
107
107
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
108
|
+
jexlFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
|
|
108
109
|
} & {
|
|
109
110
|
/**
|
|
110
111
|
* #property
|
|
@@ -263,7 +264,8 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
263
264
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
264
265
|
setSubschema(slotName: string, data: unknown): any;
|
|
265
266
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>): void;
|
|
266
|
-
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/
|
|
267
|
+
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared").IFilter): void;
|
|
268
|
+
setJexlFilters(filters: string[]): void;
|
|
267
269
|
} & {
|
|
268
270
|
readonly rendererConfig: {
|
|
269
271
|
[x: string]: any;
|
|
@@ -275,6 +277,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
275
277
|
readonly featureHeightSetting: any;
|
|
276
278
|
readonly featureUnderMouse: Feature | undefined;
|
|
277
279
|
renderReady(): boolean;
|
|
280
|
+
readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
278
281
|
} & {
|
|
279
282
|
readonly rendererTypeName: string;
|
|
280
283
|
contextMenuItems(): ({
|
|
@@ -288,7 +291,16 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
288
291
|
icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
|
|
289
292
|
onClick: () => void;
|
|
290
293
|
})[];
|
|
291
|
-
readonly DisplayBlurb: (
|
|
294
|
+
readonly DisplayBlurb: ({ model, }: {
|
|
295
|
+
model: {
|
|
296
|
+
sortedBy?: {
|
|
297
|
+
pos: number;
|
|
298
|
+
refName: number;
|
|
299
|
+
type: string;
|
|
300
|
+
tag?: string | undefined;
|
|
301
|
+
} | undefined;
|
|
302
|
+
};
|
|
303
|
+
}) => import("react").JSX.Element | null;
|
|
292
304
|
renderPropsPre(): any;
|
|
293
305
|
colorSchemeSubMenuItems(): {
|
|
294
306
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* #config LinearComparativeDisplay
|
|
3
3
|
*/
|
|
4
|
-
declare function configSchemaFactory(
|
|
4
|
+
declare function configSchemaFactory(_pluginManager: any): import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
5
5
|
export default configSchemaFactory;
|
|
@@ -3,7 +3,7 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
|
3
3
|
/**
|
|
4
4
|
* #config LinearComparativeDisplay
|
|
5
5
|
*/
|
|
6
|
-
function configSchemaFactory(
|
|
6
|
+
function configSchemaFactory(_pluginManager) {
|
|
7
7
|
return ConfigurationSchema('LinearComparativeDisplay', {}, {
|
|
8
8
|
explicitlyTyped: true,
|
|
9
9
|
/**
|
|
@@ -77,14 +77,14 @@ function stateModelFactory(configSchema) {
|
|
|
77
77
|
const newFeatIds = new Set((features === null || features === void 0 ? void 0 : features.map(f => f.id())) || []);
|
|
78
78
|
let foundNewFeatureNotInExistingMap = false;
|
|
79
79
|
let foundExistingFeatureNotInNewMap = false;
|
|
80
|
-
for (
|
|
81
|
-
if (!featIds.has(
|
|
80
|
+
for (const feat of features) {
|
|
81
|
+
if (!featIds.has(feat.id())) {
|
|
82
82
|
foundNewFeatureNotInExistingMap = true;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
for (
|
|
87
|
-
if (!newFeatIds.has(
|
|
86
|
+
for (const existingFeat of existingFeatures) {
|
|
87
|
+
if (!newFeatIds.has(existingFeat.id())) {
|
|
88
88
|
foundExistingFeatureNotInNewMap = true;
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearComparativeViewModel } from '../model';
|
|
3
3
|
type LCV = LinearComparativeViewModel;
|
|
4
|
-
declare const
|
|
4
|
+
declare const LinearComparativeView: (props: {
|
|
5
5
|
ExtraButtons?: React.ReactNode;
|
|
6
6
|
model: LCV;
|
|
7
7
|
}) => React.JSX.Element;
|
|
8
|
-
export default
|
|
8
|
+
export default LinearComparativeView;
|
|
@@ -86,8 +86,9 @@ const OverlayComparativeView = observer(({ model }) => {
|
|
|
86
86
|
})),
|
|
87
87
|
React.createElement(Overlays, { model: model })))));
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
const LinearComparativeView = observer(function (props) {
|
|
90
90
|
const { model } = props;
|
|
91
91
|
const middle = model.tracks.some(({ displays }) => displays.some((d) => getConf(d, 'middle')));
|
|
92
92
|
return middle ? (React.createElement(MiddleComparativeView, { ...props })) : (React.createElement(OverlayComparativeView, { ...props }));
|
|
93
93
|
});
|
|
94
|
+
export default LinearComparativeView;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearComparativeViewModel } from '../model';
|
|
3
3
|
type LCV = LinearComparativeViewModel;
|
|
4
|
-
declare
|
|
4
|
+
declare const LinearComparativeRubberband: ({ model, ControlComponent, }: {
|
|
5
5
|
model: LCV;
|
|
6
|
-
ControlComponent?: React.ReactElement;
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
export default _default;
|
|
6
|
+
ControlComponent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default LinearComparativeRubberband;
|
|
@@ -37,7 +37,7 @@ const useStyles = makeStyles()(theme => {
|
|
|
37
37
|
},
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
|
-
function Rubberband({ model, ControlComponent = React.createElement("div", null), }) {
|
|
40
|
+
const LinearComparativeRubberband = observer(function Rubberband({ model, ControlComponent = React.createElement("div", null), }) {
|
|
41
41
|
const [startX, setStartX] = useState();
|
|
42
42
|
const [currentX, setCurrentX] = useState();
|
|
43
43
|
// clientX and clientY used for anchorPosition for menu
|
|
@@ -171,5 +171,5 @@ function Rubberband({ model, ControlComponent = React.createElement("div", null)
|
|
|
171
171
|
left: anchorPosition.clientX,
|
|
172
172
|
top: anchorPosition.clientY,
|
|
173
173
|
}, onMenuItemClick: handleMenuItemClick, open: open, onClose: handleClose, menuItems: model.rubberBandMenuItems() })) : null));
|
|
174
|
-
}
|
|
175
|
-
export default
|
|
174
|
+
});
|
|
175
|
+
export default LinearComparativeRubberband;
|
|
@@ -62,12 +62,10 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
62
62
|
volatileWidth: number | undefined;
|
|
63
63
|
minimumBlockWidth: number;
|
|
64
64
|
draggingTrackId: string | undefined;
|
|
65
|
-
volatileError:
|
|
65
|
+
volatileError: unknown;
|
|
66
66
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
67
67
|
scaleFactor: number;
|
|
68
|
-
trackRefs:
|
|
69
|
-
[key: string]: HTMLDivElement;
|
|
70
|
-
};
|
|
68
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
71
69
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
72
70
|
coarseTotalBp: number;
|
|
73
71
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -91,7 +89,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
91
89
|
readonly totalBp: number;
|
|
92
90
|
readonly maxBpPerPx: number;
|
|
93
91
|
readonly minBpPerPx: number;
|
|
94
|
-
readonly error:
|
|
92
|
+
readonly error: {};
|
|
95
93
|
readonly maxOffset: number;
|
|
96
94
|
readonly minOffset: number;
|
|
97
95
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -108,7 +106,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
108
106
|
} & {
|
|
109
107
|
setShowCytobands(flag: boolean): void;
|
|
110
108
|
setWidth(newWidth: number): void;
|
|
111
|
-
setError(error:
|
|
109
|
+
setError(error: unknown): void;
|
|
112
110
|
toggleHeader(): void;
|
|
113
111
|
toggleHeaderOverview(): void;
|
|
114
112
|
toggleNoTracksActive(): void;
|
|
@@ -210,6 +208,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
210
208
|
end: number;
|
|
211
209
|
reversed: boolean;
|
|
212
210
|
} | undefined;
|
|
211
|
+
} & {
|
|
212
|
+
afterCreate(): void;
|
|
213
213
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
214
214
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
215
215
|
}, {
|
|
@@ -112,13 +112,16 @@ function stateModelFactory(pluginManager) {
|
|
|
112
112
|
// automatically removes session assemblies associated with this view
|
|
113
113
|
// e.g. read vs ref
|
|
114
114
|
beforeDestroy() {
|
|
115
|
+
var _a;
|
|
115
116
|
const session = getSession(self);
|
|
116
|
-
|
|
117
|
+
for (const name of self.assemblyNames) {
|
|
118
|
+
(_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
|
|
119
|
+
}
|
|
117
120
|
},
|
|
118
121
|
onSubviewAction(actionName, path, args) {
|
|
119
122
|
self.views.forEach(view => {
|
|
120
123
|
const ret = getPath(view);
|
|
121
|
-
if (ret.
|
|
124
|
+
if (!ret.endsWith(path)) {
|
|
122
125
|
// @ts-expect-error
|
|
123
126
|
view[actionName](args === null || args === void 0 ? void 0 : args[0]);
|
|
124
127
|
}
|
|
@@ -68,6 +68,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
68
68
|
})();
|
|
69
69
|
}, [preFeature, track]);
|
|
70
70
|
function onSubmit() {
|
|
71
|
+
var _a;
|
|
71
72
|
try {
|
|
72
73
|
if (!primaryFeature) {
|
|
73
74
|
return;
|
|
@@ -129,7 +130,7 @@ export default function ReadVsRefDialog({ track, feature: preFeature, handleClos
|
|
|
129
130
|
end: f.end + windowSize,
|
|
130
131
|
assemblyName: trackAssembly,
|
|
131
132
|
})));
|
|
132
|
-
session.addTemporaryAssembly({
|
|
133
|
+
(_a = session.addTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, {
|
|
133
134
|
name: `${readAssembly}`,
|
|
134
135
|
sequence: {
|
|
135
136
|
type: 'ReferenceSequenceTrack',
|
|
@@ -59,8 +59,7 @@ export function doAfterAttach(self) {
|
|
|
59
59
|
}));
|
|
60
60
|
const map = [];
|
|
61
61
|
const feats = self.features || [];
|
|
62
|
-
for (
|
|
63
|
-
const f = feats[i];
|
|
62
|
+
for (const f of feats) {
|
|
64
63
|
const mate = f.get('mate');
|
|
65
64
|
let f1s = f.get('start');
|
|
66
65
|
let f1e = f.get('end');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearSyntenyDisplayModel } from '../model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const LinearSyntenyRendering: ({ model, }: {
|
|
4
4
|
model: LinearSyntenyDisplayModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default LinearSyntenyRendering;
|
|
@@ -4,7 +4,7 @@ import { assembleLocString, getContainingView, getSession, isSessionModelWithWid
|
|
|
4
4
|
// locals
|
|
5
5
|
import SyntenyTooltip from './SyntenyTooltip';
|
|
6
6
|
import { getId, MAX_COLOR_RANGE } from '../drawSynteny';
|
|
7
|
-
|
|
7
|
+
const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
8
8
|
const highResolutionScaling = 1;
|
|
9
9
|
const view = getContainingView(model);
|
|
10
10
|
const height = view.middleComparativeHeight;
|
|
@@ -129,3 +129,4 @@ export default observer(function LinearSyntenyRendering({ model, }) {
|
|
|
129
129
|
}, width: width, height: height }),
|
|
130
130
|
model.mouseoverId && tooltip && currX && currY ? (React.createElement(SyntenyTooltip, { x: currX, y: currY, title: tooltip })) : null));
|
|
131
131
|
});
|
|
132
|
+
export default LinearSyntenyRendering;
|
|
@@ -39,8 +39,7 @@ export function drawRef(model, ctx1, ctx3) {
|
|
|
39
39
|
// call, a separate loop below draws larger boxes
|
|
40
40
|
ctx1.fillStyle = colorMap.M;
|
|
41
41
|
ctx1.strokeStyle = colorMap.M;
|
|
42
|
-
for (
|
|
43
|
-
const { p11, p12, p21, p22 } = featPos[i];
|
|
42
|
+
for (const { p11, p12, p21, p22 } of featPos) {
|
|
44
43
|
const x11 = p11.offsetPx - offsets[0];
|
|
45
44
|
const x12 = p12.offsetPx - offsets[0];
|
|
46
45
|
const x21 = p21.offsetPx - offsets[1];
|
|
@@ -70,8 +69,7 @@ export function drawRef(model, ctx1, ctx3) {
|
|
|
70
69
|
// ctx.stroke once is much more efficient than calling stroke() many times
|
|
71
70
|
ctx1.fillStyle = colorMap.M;
|
|
72
71
|
ctx1.strokeStyle = colorMap.M;
|
|
73
|
-
for (
|
|
74
|
-
const { p11, p12, p21, p22, f, cigar } = featPos[i];
|
|
72
|
+
for (const { p11, p12, p21, p22, f, cigar } of featPos) {
|
|
75
73
|
const x11 = p11.offsetPx - offsets[0];
|
|
76
74
|
const x12 = p12.offsetPx - offsets[0];
|
|
77
75
|
const x21 = p21.offsetPx - offsets[1];
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { SnapshotIn } from 'mobx-state-tree';
|
|
3
3
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
4
|
type Conf = SnapshotIn<AnyConfigurationModel>;
|
|
5
|
-
declare const OpenTrack: ({
|
|
5
|
+
declare const OpenTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
|
|
6
6
|
sessionTrackData: Conf;
|
|
7
7
|
assembly1: string;
|
|
8
8
|
assembly2: string;
|
|
@@ -71,7 +71,7 @@ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Locat
|
|
|
71
71
|
throw new Error('Unknown type');
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const OpenTrack = observer(({
|
|
74
|
+
const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
|
|
75
75
|
const [bed2Location, setBed2Location] = useState();
|
|
76
76
|
const [bed1Location, setBed1Location] = useState();
|
|
77
77
|
const [fileLocation, setFileLocation] = useState();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LinearSyntenyViewModel } from '../model';
|
|
3
|
-
declare const
|
|
3
|
+
declare const LinearSyntenyViewImportForm: ({ model, }: {
|
|
4
4
|
model: LinearSyntenyViewModel;
|
|
5
5
|
}) => React.JSX.Element;
|
|
6
|
-
export default
|
|
6
|
+
export default LinearSyntenyViewImportForm;
|
|
@@ -34,7 +34,7 @@ function TrackSelector({ setSessionTrackData, setShowTrackId, sessionTrackData,
|
|
|
34
34
|
choice === 'custom' ? (React.createElement(ImportCustomTrack, { setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, assembly2: assembly2, assembly1: assembly1 })) : null,
|
|
35
35
|
choice === 'tracklist' ? (React.createElement(ImportSyntenyTrackSelector, { model: model, assembly1: assembly1, assembly2: assembly2, setShowTrackId: setShowTrackId })) : null));
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
const LinearSyntenyViewImportForm = observer(function ({ model, }) {
|
|
38
38
|
const { classes } = useStyles();
|
|
39
39
|
const session = getSession(model);
|
|
40
40
|
const { assemblyNames } = session;
|
|
@@ -96,3 +96,4 @@ export default observer(function ({ model, }) {
|
|
|
96
96
|
React.createElement(Button, { onClick: onOpenClick, variant: "contained", color: "primary" }, "Launch"))))),
|
|
97
97
|
React.createElement(TrackSelector, { setShowTrackId: setShowTrackId, assembly2: assembly2, assembly1: assembly1, setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, model: model })))));
|
|
98
98
|
});
|
|
99
|
+
export default LinearSyntenyViewImportForm;
|
|
@@ -73,12 +73,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
73
73
|
volatileWidth: number | undefined;
|
|
74
74
|
minimumBlockWidth: number;
|
|
75
75
|
draggingTrackId: string | undefined;
|
|
76
|
-
volatileError:
|
|
76
|
+
volatileError: unknown;
|
|
77
77
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
78
78
|
scaleFactor: number;
|
|
79
|
-
trackRefs:
|
|
80
|
-
[key: string]: HTMLDivElement;
|
|
81
|
-
};
|
|
79
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
82
80
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
83
81
|
coarseTotalBp: number;
|
|
84
82
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -102,7 +100,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
102
100
|
readonly totalBp: number;
|
|
103
101
|
readonly maxBpPerPx: number;
|
|
104
102
|
readonly minBpPerPx: number;
|
|
105
|
-
readonly error:
|
|
103
|
+
readonly error: {};
|
|
106
104
|
readonly maxOffset: number;
|
|
107
105
|
readonly minOffset: number;
|
|
108
106
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -119,7 +117,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
119
117
|
} & {
|
|
120
118
|
setShowCytobands(flag: boolean): void;
|
|
121
119
|
setWidth(newWidth: number): void;
|
|
122
|
-
setError(error:
|
|
120
|
+
setError(error: unknown): void;
|
|
123
121
|
toggleHeader(): void;
|
|
124
122
|
toggleHeaderOverview(): void;
|
|
125
123
|
toggleNoTracksActive(): void;
|
|
@@ -221,6 +219,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
221
219
|
end: number;
|
|
222
220
|
reversed: boolean;
|
|
223
221
|
} | undefined;
|
|
222
|
+
} & {
|
|
223
|
+
afterCreate(): void;
|
|
224
224
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
225
225
|
viewTrackConfigs: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
226
226
|
} & {
|
|
@@ -323,12 +323,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
323
323
|
volatileWidth: number | undefined;
|
|
324
324
|
minimumBlockWidth: number;
|
|
325
325
|
draggingTrackId: string | undefined;
|
|
326
|
-
volatileError:
|
|
326
|
+
volatileError: unknown;
|
|
327
327
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
328
328
|
scaleFactor: number;
|
|
329
|
-
trackRefs:
|
|
330
|
-
[key: string]: HTMLDivElement;
|
|
331
|
-
};
|
|
329
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
332
330
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
333
331
|
coarseTotalBp: number;
|
|
334
332
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -352,7 +350,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
352
350
|
readonly totalBp: number;
|
|
353
351
|
readonly maxBpPerPx: number;
|
|
354
352
|
readonly minBpPerPx: number;
|
|
355
|
-
readonly error:
|
|
353
|
+
readonly error: {};
|
|
356
354
|
readonly maxOffset: number;
|
|
357
355
|
readonly minOffset: number;
|
|
358
356
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -369,7 +367,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
369
367
|
} & {
|
|
370
368
|
setShowCytobands(flag: boolean): void;
|
|
371
369
|
setWidth(newWidth: number): void;
|
|
372
|
-
setError(error:
|
|
370
|
+
setError(error: unknown): void;
|
|
373
371
|
toggleHeader(): void;
|
|
374
372
|
toggleHeaderOverview(): void;
|
|
375
373
|
toggleNoTracksActive(): void;
|
|
@@ -471,6 +469,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
471
469
|
end: number;
|
|
472
470
|
reversed: boolean;
|
|
473
471
|
} | undefined;
|
|
472
|
+
} & {
|
|
473
|
+
afterCreate(): void;
|
|
474
474
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
475
475
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
476
476
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -511,12 +511,10 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
511
511
|
volatileWidth: number | undefined;
|
|
512
512
|
minimumBlockWidth: number;
|
|
513
513
|
draggingTrackId: string | undefined;
|
|
514
|
-
volatileError:
|
|
514
|
+
volatileError: unknown;
|
|
515
515
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
516
516
|
scaleFactor: number;
|
|
517
|
-
trackRefs:
|
|
518
|
-
[key: string]: HTMLDivElement;
|
|
519
|
-
};
|
|
517
|
+
trackRefs: Record<string, HTMLDivElement>;
|
|
520
518
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
521
519
|
coarseTotalBp: number;
|
|
522
520
|
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset | undefined;
|
|
@@ -540,7 +538,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
540
538
|
readonly totalBp: number;
|
|
541
539
|
readonly maxBpPerPx: number;
|
|
542
540
|
readonly minBpPerPx: number;
|
|
543
|
-
readonly error:
|
|
541
|
+
readonly error: {};
|
|
544
542
|
readonly maxOffset: number;
|
|
545
543
|
readonly minOffset: number;
|
|
546
544
|
readonly displayedRegionsTotalPx: number;
|
|
@@ -557,7 +555,7 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
557
555
|
} & {
|
|
558
556
|
setShowCytobands(flag: boolean): void;
|
|
559
557
|
setWidth(newWidth: number): void;
|
|
560
|
-
setError(error:
|
|
558
|
+
setError(error: unknown): void;
|
|
561
559
|
toggleHeader(): void;
|
|
562
560
|
toggleHeaderOverview(): void;
|
|
563
561
|
toggleNoTracksActive(): void;
|
|
@@ -659,6 +657,8 @@ export default function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
659
657
|
end: number;
|
|
660
658
|
reversed: boolean;
|
|
661
659
|
} | undefined;
|
|
660
|
+
} & {
|
|
661
|
+
afterCreate(): void;
|
|
662
662
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>): void;
|
|
663
663
|
closeView(): void;
|
|
664
664
|
setMiddleComparativeHeight(n: number): number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTheme } from '@mui/material';
|
|
3
|
-
import
|
|
3
|
+
import { stripAlpha } from '@jbrowse/core/util';
|
|
4
4
|
export default function SVGBackground({ width, height, shift, }) {
|
|
5
5
|
const theme = useTheme();
|
|
6
|
-
return (React.createElement("rect", { width: width + shift * 2, height: height, fill:
|
|
6
|
+
return (React.createElement("rect", { width: width + shift * 2, height: height, fill: stripAlpha(theme.palette.background.default) }));
|
|
7
7
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
2
2
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
3
3
|
import configSchemaF from './configSchema';
|
|
4
|
-
export default (
|
|
5
|
-
|
|
6
|
-
const configSchema = configSchemaF(
|
|
4
|
+
export default function registerSyntenyTrack(pluginManager) {
|
|
5
|
+
pluginManager.addTrackType(() => {
|
|
6
|
+
const configSchema = configSchemaF(pluginManager);
|
|
7
7
|
return new TrackType({
|
|
8
8
|
name: 'SyntenyTrack',
|
|
9
9
|
configSchema,
|
|
10
|
-
stateModel: createBaseTrackModel(
|
|
10
|
+
stateModel: createBaseTrackModel(pluginManager, 'SyntenyTrack', configSchema),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
-
}
|
|
13
|
+
}
|
package/esm/util.js
CHANGED
|
@@ -25,7 +25,8 @@ export function getTrackPos(view, trackConfigId) {
|
|
|
25
25
|
// Uses bpToPx to get the screen pixel coordinates but ignores some conditions
|
|
26
26
|
// where bpToPx could return undefined
|
|
27
27
|
export function getPxFromCoordinate(view, refName, coord) {
|
|
28
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
return (((_a = bpToPx(view, { refName, coord })) === null || _a === void 0 ? void 0 : _a.offsetPx) || 0) - view.offsetPx;
|
|
29
30
|
}
|
|
30
31
|
// Retrieves the y-position of a layout record in a track
|
|
31
32
|
// If track not found returns 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-linear-comparative-view",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "JBrowse 2 linear comparative view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"@mui/icons-material": "^5.0.1",
|
|
40
40
|
"@popperjs/core": "^2.0.0",
|
|
41
41
|
"clone": "^2.1.2",
|
|
42
|
-
"color": "^3.1.3",
|
|
43
42
|
"copy-to-clipboard": "^3.3.1",
|
|
44
43
|
"file-saver": "^2.0.0",
|
|
45
44
|
"react-popper": "^2.0.0"
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
51
50
|
"@mui/material": "^5.0.0",
|
|
52
51
|
"mobx": "^6.0.0",
|
|
53
|
-
"mobx-react": "^
|
|
52
|
+
"mobx-react": "^9.0.0",
|
|
54
53
|
"mobx-state-tree": "^5.0.0",
|
|
55
54
|
"react": ">=16.8.0",
|
|
56
55
|
"react-dom": ">=16.8.0",
|
|
@@ -63,5 +62,5 @@
|
|
|
63
62
|
"publishConfig": {
|
|
64
63
|
"access": "public"
|
|
65
64
|
},
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "2cda1611eebd12517f2a3cfc1b612face27005d4"
|
|
67
66
|
}
|