@jbrowse/plugin-linear-comparative-view 2.6.2 → 2.7.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/model.d.ts +29 -78
- package/dist/LGVSyntenyDisplay/model.js +22 -3
- 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 -1
- 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 +29 -78
- package/esm/LGVSyntenyDisplay/model.js +23 -4
- 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 -1
- 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 -3
|
@@ -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
|
|
@@ -86,21 +86,11 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
86
86
|
};
|
|
87
87
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
88
88
|
} & {
|
|
89
|
-
type: import("mobx-state-tree").ISimpleType<"LinearPileupDisplay">;
|
|
90
89
|
configuration: AnyConfigurationSchemaType;
|
|
91
|
-
showSoftClipping: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
92
90
|
featureHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
93
91
|
noSpacing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
94
92
|
fadeLikelihood: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
95
93
|
trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
96
|
-
mismatchAlpha: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
97
|
-
sortedBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
98
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
99
|
-
pos: import("mobx-state-tree").ISimpleType<number>;
|
|
100
|
-
tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
101
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
102
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
103
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
104
94
|
colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
105
95
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
106
96
|
tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -115,6 +105,7 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
115
105
|
value: import("mobx-state-tree").ISimpleType<string>;
|
|
116
106
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
117
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]>;
|
|
118
109
|
} & {
|
|
119
110
|
/**
|
|
120
111
|
* #property
|
|
@@ -250,45 +241,31 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
250
241
|
afterAttach(): void;
|
|
251
242
|
} & {
|
|
252
243
|
colorTagMap: import("mobx").ObservableMap<string, string>;
|
|
253
|
-
modificationTagMap: import("mobx").ObservableMap<string, string>; /**
|
|
254
|
-
* #property
|
|
255
|
-
*/
|
|
256
244
|
featureUnderMouseVolatile: Feature | undefined;
|
|
257
|
-
currSortBpPerPx: number;
|
|
258
|
-
modificationsReady: boolean;
|
|
259
|
-
sortReady: boolean;
|
|
260
245
|
tagsReady: boolean;
|
|
261
246
|
} & {
|
|
262
247
|
readonly autorunReady: boolean;
|
|
263
248
|
} & {
|
|
264
|
-
setModificationsReady(flag: boolean): void;
|
|
265
249
|
setTagsReady(flag: boolean): void;
|
|
266
|
-
setSortReady(flag: boolean): void;
|
|
267
|
-
setCurrSortBpPerPx(n: number): void;
|
|
268
250
|
setMaxHeight(n: number): void;
|
|
269
251
|
setFeatureHeight(n?: number | undefined): void;
|
|
270
252
|
setNoSpacing(flag?: boolean | undefined): void;
|
|
271
253
|
setColorScheme(colorScheme: {
|
|
272
254
|
type: string;
|
|
273
255
|
tag?: string | undefined;
|
|
256
|
+
extra?: import("@jbrowse/plugin-alignments/src/shared/color").ExtraColorBy | undefined;
|
|
274
257
|
}): void;
|
|
275
|
-
updateModificationColorMap(uniqueModifications: string[]): void;
|
|
276
258
|
updateColorTagMap(uniqueTag: string[]): void;
|
|
277
259
|
setFeatureUnderMouse(feat?: Feature | undefined): void;
|
|
278
260
|
selectFeature(feature: Feature): void;
|
|
279
|
-
clearSelected(): void;
|
|
280
261
|
copyFeatureToClipboard(feature: Feature): void;
|
|
281
|
-
toggleSoftClipping(): void;
|
|
282
|
-
toggleMismatchAlpha(): void;
|
|
283
262
|
setConfig(conf: {
|
|
284
263
|
[x: string]: any;
|
|
285
264
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
286
265
|
setSubschema(slotName: string, data: unknown): any;
|
|
287
266
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>): void;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
} & {
|
|
291
|
-
reload(): void;
|
|
267
|
+
setFilterBy(filter: import("@jbrowse/plugin-alignments/src/shared").IFilter): void;
|
|
268
|
+
setJexlFilters(filters: string[]): void;
|
|
292
269
|
} & {
|
|
293
270
|
readonly rendererConfig: {
|
|
294
271
|
[x: string]: any;
|
|
@@ -298,9 +275,9 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
298
275
|
} & {
|
|
299
276
|
readonly maxHeight: any;
|
|
300
277
|
readonly featureHeightSetting: any;
|
|
301
|
-
readonly mismatchAlphaSetting: any;
|
|
302
278
|
readonly featureUnderMouse: Feature | undefined;
|
|
303
|
-
|
|
279
|
+
renderReady(): boolean;
|
|
280
|
+
readonly filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
304
281
|
} & {
|
|
305
282
|
readonly rendererTypeName: string;
|
|
306
283
|
contextMenuItems(): ({
|
|
@@ -314,68 +291,42 @@ declare function stateModelFactory(schema: AnyConfigurationSchemaType): import("
|
|
|
314
291
|
icon: typeof import("@jbrowse/core/ui/Icons").ContentCopy;
|
|
315
292
|
onClick: () => void;
|
|
316
293
|
})[];
|
|
317
|
-
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;
|
|
318
304
|
renderPropsPre(): any;
|
|
319
|
-
|
|
320
|
-
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
305
|
+
colorSchemeSubMenuItems(): {
|
|
321
306
|
label: string;
|
|
322
|
-
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
323
|
-
muiName: string;
|
|
324
|
-
};
|
|
325
|
-
type: string;
|
|
326
|
-
checked: boolean;
|
|
327
307
|
onClick: () => void;
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
} | {
|
|
331
|
-
label: string;
|
|
332
|
-
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
333
|
-
muiName: string;
|
|
334
|
-
};
|
|
335
|
-
disabled: boolean;
|
|
336
|
-
subMenu: {
|
|
337
|
-
label: string;
|
|
338
|
-
onClick: () => void;
|
|
339
|
-
}[];
|
|
340
|
-
type?: undefined;
|
|
341
|
-
checked?: undefined;
|
|
342
|
-
onClick?: undefined;
|
|
343
|
-
} | {
|
|
344
|
-
label: string;
|
|
345
|
-
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
346
|
-
muiName: string;
|
|
347
|
-
};
|
|
348
|
-
subMenu: {
|
|
349
|
-
label: string;
|
|
350
|
-
onClick: () => void;
|
|
351
|
-
}[];
|
|
352
|
-
type?: undefined;
|
|
353
|
-
checked?: undefined;
|
|
354
|
-
onClick?: undefined;
|
|
355
|
-
disabled?: undefined;
|
|
356
|
-
} | {
|
|
308
|
+
}[];
|
|
309
|
+
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
357
310
|
label: string;
|
|
358
311
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
359
312
|
muiName: string;
|
|
360
313
|
};
|
|
361
314
|
onClick: () => void;
|
|
362
|
-
type?: undefined;
|
|
363
|
-
checked?: undefined;
|
|
364
|
-
disabled?: undefined;
|
|
365
|
-
subMenu?: undefined;
|
|
366
|
-
} | {
|
|
367
|
-
label: string;
|
|
368
|
-
type: string;
|
|
369
|
-
checked: any;
|
|
370
|
-
onClick: () => void;
|
|
371
|
-
icon?: undefined;
|
|
372
|
-
disabled?: undefined;
|
|
373
|
-
subMenu?: undefined;
|
|
374
315
|
})[];
|
|
316
|
+
} & {
|
|
317
|
+
renderProps(): any;
|
|
375
318
|
} & {
|
|
376
319
|
afterAttach(): void;
|
|
377
320
|
} & {
|
|
378
321
|
contextMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
322
|
+
} & {
|
|
323
|
+
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
324
|
+
label: string;
|
|
325
|
+
subMenu: {
|
|
326
|
+
label: string;
|
|
327
|
+
onClick: () => void;
|
|
328
|
+
}[];
|
|
329
|
+
})[];
|
|
379
330
|
} & {
|
|
380
331
|
afterCreate(): void;
|
|
381
332
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfigurationReference, } from '@jbrowse/core/configuration';
|
|
2
2
|
import { getSession, getContainingTrack, getContainingView, } from '@jbrowse/core/util';
|
|
3
|
-
import { MismatchParser,
|
|
3
|
+
import { MismatchParser, SharedLinearPileupDisplayMixin, } from '@jbrowse/plugin-alignments';
|
|
4
4
|
import { types } from 'mobx-state-tree';
|
|
5
5
|
import { when } from 'mobx';
|
|
6
6
|
const { parseCigar } = MismatchParser;
|
|
@@ -112,7 +112,7 @@ async function navToSynteny(feature, self) {
|
|
|
112
112
|
*/
|
|
113
113
|
function stateModelFactory(schema) {
|
|
114
114
|
return types
|
|
115
|
-
.compose('LGVSyntenyDisplay',
|
|
115
|
+
.compose('LGVSyntenyDisplay', SharedLinearPileupDisplayMixin(schema), types.model({
|
|
116
116
|
/**
|
|
117
117
|
* #property
|
|
118
118
|
*/
|
|
@@ -140,11 +140,30 @@ function stateModelFactory(schema) {
|
|
|
140
140
|
];
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
|
+
})
|
|
144
|
+
.views(self => {
|
|
145
|
+
const { trackMenuItems: superTrackMenuItems, colorSchemeSubMenuItems: superColorSchemeSubMenuItems, } = self;
|
|
146
|
+
return {
|
|
147
|
+
trackMenuItems() {
|
|
148
|
+
return [
|
|
149
|
+
...superTrackMenuItems(),
|
|
150
|
+
{
|
|
151
|
+
label: 'Color scheme',
|
|
152
|
+
subMenu: [...superColorSchemeSubMenuItems()],
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
},
|
|
156
|
+
};
|
|
143
157
|
})
|
|
144
158
|
.actions(self => ({
|
|
145
159
|
afterCreate() {
|
|
146
|
-
// use color by
|
|
147
|
-
self.
|
|
160
|
+
// use color by stand to help indicate inversions better on first load, otherwise use selected orientation
|
|
161
|
+
if (self.colorBy) {
|
|
162
|
+
self.setColorScheme({ ...self.colorBy });
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
self.setColorScheme({ type: 'strand' });
|
|
166
|
+
}
|
|
148
167
|
},
|
|
149
168
|
}));
|
|
150
169
|
}
|
|
@@ -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;
|