@jbrowse/plugin-linear-genome-view 2.4.1 → 2.5.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/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -4
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +8 -43
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js +9 -9
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +81 -35
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +105 -143
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +35 -1
- package/dist/BaseLinearDisplay/models/configSchema.js +9 -0
- package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/BaseLinearDisplay/models/util.d.ts +8 -0
- package/dist/BaseLinearDisplay/models/util.js +33 -1
- package/dist/BaseLinearDisplay/models/util.js.map +1 -1
- package/dist/BasicTrack/configSchema.d.ts +73 -1
- package/dist/FeatureTrack/configSchema.d.ts +75 -1
- package/dist/LinearBareDisplay/configSchema.d.ts +28 -1
- package/dist/LinearBareDisplay/index.js +1 -0
- package/dist/LinearBareDisplay/index.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +66 -23
- package/dist/LinearBareDisplay/model.js +2 -2
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -2
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +2 -5
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearBasicDisplay/configSchema.d.ts +28 -1
- package/dist/LinearBasicDisplay/configSchema.js +0 -9
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/index.js +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +76 -36
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -1
- package/dist/LinearGenomeView/components/Cytobands.d.ts +22 -23
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +14 -16
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -1
- package/dist/LinearGenomeView/components/Header.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -1
- package/dist/LinearGenomeView/components/ImportForm.js +4 -7
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -4
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.js +2 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +53 -52
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +6 -82
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
- package/dist/LinearGenomeView/components/SearchResultsTable.js +83 -0
- package/dist/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +8 -2
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +5 -7
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +0 -1
- package/dist/LinearGenomeView/components/util.js +1 -1
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/model.d.ts +49 -36
- package/dist/LinearGenomeView/model.js +121 -198
- package/dist/LinearGenomeView/model.js.map +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
- package/dist/LinearGenomeView/util.d.ts +29 -0
- package/dist/LinearGenomeView/util.js +79 -1
- package/dist/LinearGenomeView/util.js.map +1 -1
- package/dist/index.d.ts +201 -106
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -4
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +8 -20
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +3 -4
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +9 -9
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +81 -35
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +105 -143
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +35 -1
- package/esm/BaseLinearDisplay/models/configSchema.js +9 -0
- package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +10 -6
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/BaseLinearDisplay/models/util.d.ts +8 -0
- package/esm/BaseLinearDisplay/models/util.js +30 -0
- package/esm/BaseLinearDisplay/models/util.js.map +1 -1
- package/esm/BasicTrack/configSchema.d.ts +73 -1
- package/esm/FeatureTrack/configSchema.d.ts +75 -1
- package/esm/LinearBareDisplay/configSchema.d.ts +28 -1
- package/esm/LinearBareDisplay/index.js +1 -0
- package/esm/LinearBareDisplay/index.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +66 -23
- package/esm/LinearBareDisplay/model.js +1 -1
- package/esm/LinearBareDisplay/model.js.map +1 -1
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -2
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +2 -5
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/esm/LinearBasicDisplay/configSchema.d.ts +28 -1
- package/esm/LinearBasicDisplay/configSchema.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
- package/esm/LinearBasicDisplay/index.js +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +76 -36
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +0 -1
- package/esm/LinearGenomeView/components/Cytobands.d.ts +22 -23
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +15 -17
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/Gridlines.d.ts +0 -1
- package/esm/LinearGenomeView/components/Header.d.ts +0 -1
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/esm/LinearGenomeView/components/ImportForm.d.ts +0 -1
- package/esm/LinearGenomeView/components/ImportForm.js +5 -8
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +0 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +0 -4
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/MiniControls.d.ts +0 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.js +2 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +53 -52
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -1
- package/esm/LinearGenomeView/components/SearchBox.d.ts +0 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -3
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -83
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchResultsTable.js +77 -0
- package/esm/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -1
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +0 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +8 -2
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +5 -7
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +0 -1
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +0 -1
- package/esm/LinearGenomeView/components/util.js +1 -1
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/model.d.ts +49 -36
- package/esm/LinearGenomeView/model.js +122 -199
- package/esm/LinearGenomeView/model.js.map +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -1
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -1
- package/esm/LinearGenomeView/util.d.ts +29 -0
- package/esm/LinearGenomeView/util.js +76 -0
- package/esm/LinearGenomeView/util.js.map +1 -1
- package/esm/index.d.ts +201 -106
- package/package.json +3 -3
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +8 -28
- package/src/BaseLinearDisplay/components/TooLargeMessage.tsx +13 -11
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +148 -197
- package/src/BaseLinearDisplay/models/configSchema.ts +10 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +19 -13
- package/src/BaseLinearDisplay/models/util.ts +43 -0
- package/src/LinearBareDisplay/index.ts +1 -0
- package/src/LinearBareDisplay/model.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +3 -7
- package/src/LinearBasicDisplay/configSchema.ts +0 -10
- package/src/LinearBasicDisplay/index.ts +1 -1
- package/src/LinearBasicDisplay/model.ts +1 -1
- package/src/LinearGenomeView/components/GetSequenceDialog.tsx +15 -25
- package/src/LinearGenomeView/components/ImportForm.tsx +4 -14
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +0 -14
- package/src/LinearGenomeView/components/OverviewScalebar.tsx +2 -1
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +122 -82
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -112
- package/src/LinearGenomeView/components/SearchResultsTable.tsx +121 -0
- package/src/LinearGenomeView/components/TrackContainer.tsx +12 -3
- package/src/LinearGenomeView/components/TracksContainer.tsx +9 -6
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +11 -11
- package/src/LinearGenomeView/components/util.ts +2 -1
- package/src/LinearGenomeView/index.test.ts +10 -12
- package/src/LinearGenomeView/model.ts +163 -236
- package/src/LinearGenomeView/util.ts +98 -0
|
@@ -39,7 +39,7 @@ exports.getRelativeX = getRelativeX;
|
|
|
39
39
|
function getCytobands(assembly, refName) {
|
|
40
40
|
var _a;
|
|
41
41
|
return (((_a = assembly === null || assembly === void 0 ? void 0 : assembly.cytobands) === null || _a === void 0 ? void 0 : _a.map(f => ({
|
|
42
|
-
refName: assembly.getCanonicalRefName(f.get('refName')),
|
|
42
|
+
refName: assembly.getCanonicalRefName(f.get('refName')) || f.get('refName'),
|
|
43
43
|
start: f.get('start'),
|
|
44
44
|
end: f.get('end'),
|
|
45
45
|
type: f.get('type'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/LinearGenomeView/components/util.ts"],"names":[],"mappings":";;;;;;AAGA,6CAA8D;AAC9D,uFAA6D;AAEtD,KAAK,UAAU,YAAY,CAAC,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,CAAC,SAAS,CAAC;QACpE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;QACrB,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;KACpB,CAAC,EACD,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,KAAI,EAAE,CAC5C,CAAA;AACH,CAAC;AAZD,oCAYC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Region } from '@jbrowse/core/util/types';
|
|
3
3
|
import { MenuItem } from '@jbrowse/core/ui';
|
|
4
|
+
import { ParsedLocString } from '@jbrowse/core/util';
|
|
4
5
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
5
6
|
import { BlockSet, BaseBlock } from '@jbrowse/core/util/blockTypes';
|
|
6
7
|
import { Instance } from 'mobx-state-tree';
|
|
@@ -95,9 +96,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
95
96
|
coarseTotalBp: number;
|
|
96
97
|
leftOffset: BpOffset | undefined;
|
|
97
98
|
rightOffset: BpOffset | undefined;
|
|
98
|
-
searchResults: BaseResult[] | undefined;
|
|
99
|
-
searchQuery: string | undefined;
|
|
100
|
-
seqDialogDisplayed: boolean;
|
|
101
99
|
} & {
|
|
102
100
|
/**
|
|
103
101
|
* #getter
|
|
@@ -136,10 +134,6 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
136
134
|
* #getter
|
|
137
135
|
*/
|
|
138
136
|
readonly hasDisplayedRegions: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* #getter
|
|
141
|
-
*/
|
|
142
|
-
readonly isSearchDialogDisplayed: boolean;
|
|
143
137
|
/**
|
|
144
138
|
* #getter
|
|
145
139
|
*/
|
|
@@ -256,17 +250,15 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
256
250
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
257
251
|
/**
|
|
258
252
|
* #action
|
|
259
|
-
* sets offsets used in the get sequence dialog
|
|
253
|
+
* sets offsets of rubberband, used in the get sequence dialog can call
|
|
254
|
+
* view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
|
|
255
|
+
* the selected regions from the offsets
|
|
260
256
|
*/
|
|
261
257
|
setOffsets(left?: BpOffset, right?: BpOffset): void;
|
|
262
258
|
/**
|
|
263
259
|
* #action
|
|
264
260
|
*/
|
|
265
|
-
setSearchResults(
|
|
266
|
-
/**
|
|
267
|
-
* #action
|
|
268
|
-
*/
|
|
269
|
-
setGetSequenceDialogOpen(open: boolean): void;
|
|
261
|
+
setSearchResults(searchResults: BaseResult[], searchQuery: string, assemblyName?: string): void;
|
|
270
262
|
/**
|
|
271
263
|
* #action
|
|
272
264
|
*/
|
|
@@ -315,10 +307,13 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
315
307
|
/**
|
|
316
308
|
* #method
|
|
317
309
|
* Helper method for the fetchSequence.
|
|
318
|
-
* Retrieves the corresponding regions that were selected by the
|
|
310
|
+
* Retrieves the corresponding regions that were selected by the
|
|
311
|
+
* rubberband
|
|
319
312
|
*
|
|
320
|
-
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
321
|
-
*
|
|
313
|
+
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
314
|
+
* of user drag
|
|
315
|
+
* @param rightOffset - `object as {start, end, index, offset}`,
|
|
316
|
+
* offset = end of user drag
|
|
322
317
|
* @returns array of Region[]
|
|
323
318
|
*/
|
|
324
319
|
getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset): {
|
|
@@ -336,7 +331,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
336
331
|
}[];
|
|
337
332
|
/**
|
|
338
333
|
* #action
|
|
339
|
-
* schedule something to be run after the next time displayedRegions is
|
|
334
|
+
* schedule something to be run after the next time displayedRegions is
|
|
335
|
+
* set
|
|
340
336
|
*/
|
|
341
337
|
afterDisplayedRegionsSet(cb: Function): void;
|
|
342
338
|
/**
|
|
@@ -392,8 +388,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
392
388
|
readonly anyCytobandsExist: boolean;
|
|
393
389
|
/**
|
|
394
390
|
* #getter
|
|
395
|
-
* the cytoband is displayed to the right of the chromosome name,
|
|
396
|
-
*
|
|
391
|
+
* the cytoband is displayed to the right of the chromosome name, and
|
|
392
|
+
* that offset is calculated manually with this method
|
|
397
393
|
*/
|
|
398
394
|
readonly cytobandOffset: number;
|
|
399
395
|
} & {
|
|
@@ -406,19 +402,18 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
406
402
|
/**
|
|
407
403
|
* #getter
|
|
408
404
|
* static blocks are an important concept jbrowse uses to avoid
|
|
409
|
-
* re-rendering when you scroll to the side. when you horizontally
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
* the block
|
|
405
|
+
* re-rendering when you scroll to the side. when you horizontally scroll to the
|
|
406
|
+
* right, old blocks to the left may be removed, and new blocks may be
|
|
407
|
+
* instantiated on the right. tracks may use the static blocks to render their
|
|
408
|
+
* data for the region represented by the block
|
|
414
409
|
*/
|
|
415
410
|
readonly staticBlocks: BlockSet;
|
|
416
411
|
/**
|
|
417
412
|
* #getter
|
|
418
413
|
* dynamic blocks represent the exact coordinates of the currently
|
|
419
|
-
* visible genome regions on the screen. they are similar to static
|
|
420
|
-
*
|
|
421
|
-
*
|
|
414
|
+
* visible genome regions on the screen. they are similar to static blocks, but
|
|
415
|
+
* static blocks can go offscreen while dynamic blocks represent exactly what
|
|
416
|
+
* is on screen
|
|
422
417
|
*/
|
|
423
418
|
readonly dynamicBlocks: BlockSet;
|
|
424
419
|
/**
|
|
@@ -446,8 +441,8 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
446
441
|
} & {
|
|
447
442
|
/**
|
|
448
443
|
* #action
|
|
449
|
-
* offset is the base-pair-offset in the displayed region, index is the
|
|
450
|
-
* displayed region in the linear genome view
|
|
444
|
+
* offset is the base-pair-offset in the displayed region, index is the
|
|
445
|
+
* index of the displayed region in the linear genome view
|
|
451
446
|
*
|
|
452
447
|
* @param start - object as `{start, end, offset, index}`
|
|
453
448
|
* @param end - object as `{start, end, offset, index}`
|
|
@@ -455,18 +450,27 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
455
450
|
moveTo(start?: BpOffset, end?: BpOffset): void;
|
|
456
451
|
/**
|
|
457
452
|
* #action
|
|
458
|
-
*
|
|
453
|
+
* Navigate to the given locstring, will change displayed regions if
|
|
454
|
+
* needed, and wait for assemblies to be initialized
|
|
459
455
|
*
|
|
460
|
-
* @param
|
|
461
|
-
* @param optAssemblyName - (optional) the assembly name to use when
|
|
456
|
+
* @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
|
|
457
|
+
* @param optAssemblyName - (optional) the assembly name to use when
|
|
458
|
+
* navigating to the locstring
|
|
459
|
+
*/
|
|
460
|
+
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
461
|
+
/**
|
|
462
|
+
* #action
|
|
463
|
+
* Similar to `navToLocString`, but accepts parsed location objects
|
|
464
|
+
* instead of strings. Will try to perform `setDisplayedRegions` if
|
|
465
|
+
* changing regions
|
|
462
466
|
*/
|
|
463
|
-
|
|
467
|
+
navToLocations(parsedLocStrings: ParsedLocString[], assemblyName?: string): Promise<void>;
|
|
464
468
|
/**
|
|
465
469
|
* #action
|
|
466
470
|
* Navigate to a location based on its refName and optionally start, end,
|
|
467
|
-
* and assemblyName.
|
|
468
|
-
*
|
|
469
|
-
* within a displayedRegion. Navigates to the first matching location
|
|
471
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
472
|
+
* `navToLocations` instead. Only navigates to a location if it is
|
|
473
|
+
* entirely within a displayedRegion. Navigates to the first matching location
|
|
470
474
|
* encountered.
|
|
471
475
|
*
|
|
472
476
|
* Throws an error if navigation was unsuccessful
|
|
@@ -476,6 +480,15 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
476
480
|
navTo(query: NavLocation): void;
|
|
477
481
|
/**
|
|
478
482
|
* #action
|
|
483
|
+
* Navigate to a location based on its refName and optionally start, end,
|
|
484
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
485
|
+
* navToLocations instead. Only navigates to a location if it is entirely
|
|
486
|
+
* within a displayedRegion. Navigates to the first matching location
|
|
487
|
+
* encountered.
|
|
488
|
+
*
|
|
489
|
+
* Throws an error if navigation was unsuccessful
|
|
490
|
+
*
|
|
491
|
+
* @param locations - proposed location to navigate to
|
|
479
492
|
*/
|
|
480
493
|
navToMultiple(locations: NavLocation[]): void;
|
|
481
494
|
} & {
|
|
@@ -56,8 +56,11 @@ const SVGLinearGenomeView_1 = require("./svgcomponents/SVGLinearGenomeView");
|
|
|
56
56
|
const ExportSvgDialog_1 = __importDefault(require("./components/ExportSvgDialog"));
|
|
57
57
|
const MiniControls_1 = __importDefault(require("./components/MiniControls"));
|
|
58
58
|
const Header_1 = __importDefault(require("./components/Header"));
|
|
59
|
+
const util_2 = require("./util");
|
|
59
60
|
// lazies
|
|
60
61
|
const SequenceSearchDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SequenceSearchDialog'))));
|
|
62
|
+
const GetSequenceDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/GetSequenceDialog'))));
|
|
63
|
+
const SearchResultsDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SearchResultsDialog'))));
|
|
61
64
|
function calculateVisibleLocStrings(contentBlocks) {
|
|
62
65
|
if (!contentBlocks.length) {
|
|
63
66
|
return '';
|
|
@@ -137,7 +140,8 @@ function stateModelFactory(pluginManager) {
|
|
|
137
140
|
trackSelectorType: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.enumeration(['hierarchical']), 'hierarchical'),
|
|
138
141
|
/**
|
|
139
142
|
* #property
|
|
140
|
-
* how to display the track labels, can be "overlapping", "offset", or
|
|
143
|
+
* how to display the track labels, can be "overlapping", "offset", or
|
|
144
|
+
* "hidden"
|
|
141
145
|
*/
|
|
142
146
|
trackLabels: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, () => (0, util_1.localStorageGetItem)('lgv-trackLabels') || 'overlapping'),
|
|
143
147
|
/**
|
|
@@ -171,9 +175,6 @@ function stateModelFactory(pluginManager) {
|
|
|
171
175
|
coarseTotalBp: 0,
|
|
172
176
|
leftOffset: undefined,
|
|
173
177
|
rightOffset: undefined,
|
|
174
|
-
searchResults: undefined,
|
|
175
|
-
searchQuery: undefined,
|
|
176
|
-
seqDialogDisplayed: false,
|
|
177
178
|
}))
|
|
178
179
|
.views(self => ({
|
|
179
180
|
/**
|
|
@@ -246,12 +247,6 @@ function stateModelFactory(pluginManager) {
|
|
|
246
247
|
get hasDisplayedRegions() {
|
|
247
248
|
return self.displayedRegions.length > 0;
|
|
248
249
|
},
|
|
249
|
-
/**
|
|
250
|
-
* #getter
|
|
251
|
-
*/
|
|
252
|
-
get isSearchDialogDisplayed() {
|
|
253
|
-
return self.searchResults !== undefined;
|
|
254
|
-
},
|
|
255
250
|
/**
|
|
256
251
|
* #getter
|
|
257
252
|
*/
|
|
@@ -486,7 +481,9 @@ function stateModelFactory(pluginManager) {
|
|
|
486
481
|
},
|
|
487
482
|
/**
|
|
488
483
|
* #action
|
|
489
|
-
* sets offsets used in the get sequence dialog
|
|
484
|
+
* sets offsets of rubberband, used in the get sequence dialog can call
|
|
485
|
+
* view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
|
|
486
|
+
* the selected regions from the offsets
|
|
490
487
|
*/
|
|
491
488
|
setOffsets(left, right) {
|
|
492
489
|
self.leftOffset = left;
|
|
@@ -495,15 +492,18 @@ function stateModelFactory(pluginManager) {
|
|
|
495
492
|
/**
|
|
496
493
|
* #action
|
|
497
494
|
*/
|
|
498
|
-
setSearchResults(
|
|
499
|
-
self.
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
495
|
+
setSearchResults(searchResults, searchQuery, assemblyName) {
|
|
496
|
+
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
497
|
+
SearchResultsDialog,
|
|
498
|
+
{
|
|
499
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
500
|
+
model: self,
|
|
501
|
+
searchResults,
|
|
502
|
+
searchQuery,
|
|
503
|
+
handleClose,
|
|
504
|
+
assemblyName,
|
|
505
|
+
},
|
|
506
|
+
]);
|
|
507
507
|
},
|
|
508
508
|
/**
|
|
509
509
|
* #action
|
|
@@ -650,10 +650,13 @@ function stateModelFactory(pluginManager) {
|
|
|
650
650
|
/**
|
|
651
651
|
* #method
|
|
652
652
|
* Helper method for the fetchSequence.
|
|
653
|
-
* Retrieves the corresponding regions that were selected by the
|
|
653
|
+
* Retrieves the corresponding regions that were selected by the
|
|
654
|
+
* rubberband
|
|
654
655
|
*
|
|
655
|
-
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
656
|
-
*
|
|
656
|
+
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
657
|
+
* of user drag
|
|
658
|
+
* @param rightOffset - `object as {start, end, index, offset}`,
|
|
659
|
+
* offset = end of user drag
|
|
657
660
|
* @returns array of Region[]
|
|
658
661
|
*/
|
|
659
662
|
getSelectedRegions(leftOffset, rightOffset) {
|
|
@@ -672,7 +675,8 @@ function stateModelFactory(pluginManager) {
|
|
|
672
675
|
},
|
|
673
676
|
/**
|
|
674
677
|
* #action
|
|
675
|
-
* schedule something to be run after the next time displayedRegions is
|
|
678
|
+
* schedule something to be run after the next time displayedRegions is
|
|
679
|
+
* set
|
|
676
680
|
*/
|
|
677
681
|
afterDisplayedRegionsSet(cb) {
|
|
678
682
|
self.afterDisplayedRegionsSetCallbacks.push(cb);
|
|
@@ -824,8 +828,8 @@ function stateModelFactory(pluginManager) {
|
|
|
824
828
|
},
|
|
825
829
|
/**
|
|
826
830
|
* #getter
|
|
827
|
-
* the cytoband is displayed to the right of the chromosome name,
|
|
828
|
-
*
|
|
831
|
+
* the cytoband is displayed to the right of the chromosome name, and
|
|
832
|
+
* that offset is calculated manually with this method
|
|
829
833
|
*/
|
|
830
834
|
get cytobandOffset() {
|
|
831
835
|
return this.showCytobands
|
|
@@ -981,11 +985,10 @@ function stateModelFactory(pluginManager) {
|
|
|
981
985
|
/**
|
|
982
986
|
* #getter
|
|
983
987
|
* static blocks are an important concept jbrowse uses to avoid
|
|
984
|
-
* re-rendering when you scroll to the side. when you horizontally
|
|
985
|
-
*
|
|
986
|
-
*
|
|
987
|
-
*
|
|
988
|
-
* the block
|
|
988
|
+
* re-rendering when you scroll to the side. when you horizontally scroll to the
|
|
989
|
+
* right, old blocks to the left may be removed, and new blocks may be
|
|
990
|
+
* instantiated on the right. tracks may use the static blocks to render their
|
|
991
|
+
* data for the region represented by the block
|
|
989
992
|
*/
|
|
990
993
|
get staticBlocks() {
|
|
991
994
|
const ret = (0, calculateStaticBlocks_1.default)(self);
|
|
@@ -999,9 +1002,9 @@ function stateModelFactory(pluginManager) {
|
|
|
999
1002
|
/**
|
|
1000
1003
|
* #getter
|
|
1001
1004
|
* dynamic blocks represent the exact coordinates of the currently
|
|
1002
|
-
* visible genome regions on the screen. they are similar to static
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
+
* visible genome regions on the screen. they are similar to static blocks, but
|
|
1006
|
+
* static blocks can go offscreen while dynamic blocks represent exactly what
|
|
1007
|
+
* is on screen
|
|
1005
1008
|
*/
|
|
1006
1009
|
get dynamicBlocks() {
|
|
1007
1010
|
return (0, calculateDynamicBlocks_1.default)(self);
|
|
@@ -1062,8 +1065,8 @@ function stateModelFactory(pluginManager) {
|
|
|
1062
1065
|
.actions(self => ({
|
|
1063
1066
|
/**
|
|
1064
1067
|
* #action
|
|
1065
|
-
* offset is the base-pair-offset in the displayed region, index is the
|
|
1066
|
-
* displayed region in the linear genome view
|
|
1068
|
+
* offset is the base-pair-offset in the displayed region, index is the
|
|
1069
|
+
* index of the displayed region in the linear genome view
|
|
1067
1070
|
*
|
|
1068
1071
|
* @param start - object as `{start, end, offset, index}`
|
|
1069
1072
|
* @param end - object as `{start, end, offset, index}`
|
|
@@ -1073,76 +1076,38 @@ function stateModelFactory(pluginManager) {
|
|
|
1073
1076
|
},
|
|
1074
1077
|
/**
|
|
1075
1078
|
* #action
|
|
1076
|
-
*
|
|
1079
|
+
* Navigate to the given locstring, will change displayed regions if
|
|
1080
|
+
* needed, and wait for assemblies to be initialized
|
|
1077
1081
|
*
|
|
1078
|
-
* @param
|
|
1079
|
-
* @param optAssemblyName - (optional) the assembly name to use when
|
|
1082
|
+
* @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
|
|
1083
|
+
* @param optAssemblyName - (optional) the assembly name to use when
|
|
1084
|
+
* navigating to the locstring
|
|
1080
1085
|
*/
|
|
1081
|
-
async navToLocString(
|
|
1086
|
+
async navToLocString(input, optAssemblyName) {
|
|
1082
1087
|
const { assemblyNames } = self;
|
|
1083
1088
|
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
1084
1089
|
const { isValidRefName } = assemblyManager;
|
|
1085
|
-
await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
|
|
1086
1090
|
const assemblyName = optAssemblyName || assemblyNames[0];
|
|
1087
|
-
let parsedLocStrings;
|
|
1088
|
-
const inputs = locString
|
|
1089
|
-
.split(/(\s+)/)
|
|
1090
|
-
.map(f => f.trim())
|
|
1091
|
-
.filter(f => !!f);
|
|
1092
1091
|
if (assemblyName) {
|
|
1092
|
+
// wait before isValidRefName can be called
|
|
1093
1093
|
await assemblyManager.waitForAssembly(assemblyName);
|
|
1094
1094
|
}
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
parsedLocStrings = [
|
|
1108
|
-
(0, util_1.parseLocString)(refName + ':' + start + '..' + end, ref => isValidRefName(ref, assemblyName)),
|
|
1109
|
-
];
|
|
1110
|
-
}
|
|
1111
|
-
else {
|
|
1112
|
-
throw e;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
const locations = await Promise.all(parsedLocStrings === null || parsedLocStrings === void 0 ? void 0 : parsedLocStrings.map(async (region) => {
|
|
1116
|
-
const asmName = region.assemblyName || assemblyName;
|
|
1117
|
-
const asm = await assemblyManager.waitForAssembly(asmName);
|
|
1118
|
-
const { refName } = region;
|
|
1119
|
-
if (!asm) {
|
|
1120
|
-
throw new Error(`assembly ${asmName} not found`);
|
|
1121
|
-
}
|
|
1122
|
-
const { regions } = asm;
|
|
1123
|
-
if (!regions) {
|
|
1124
|
-
throw new Error(`regions not loaded yet for ${asmName}`);
|
|
1125
|
-
}
|
|
1126
|
-
const canonicalRefName = asm.getCanonicalRefName(region.refName);
|
|
1127
|
-
if (!canonicalRefName) {
|
|
1128
|
-
throw new Error(`Could not find refName ${refName} in ${asm.name}`);
|
|
1129
|
-
}
|
|
1130
|
-
const parentRegion = regions.find(r => r.refName === canonicalRefName);
|
|
1131
|
-
if (!parentRegion) {
|
|
1132
|
-
throw new Error(`Could not find refName ${refName} in ${asmName}`);
|
|
1133
|
-
}
|
|
1134
|
-
return {
|
|
1135
|
-
...region,
|
|
1136
|
-
assemblyName: asmName,
|
|
1137
|
-
parentRegion,
|
|
1138
|
-
};
|
|
1139
|
-
}));
|
|
1095
|
+
return this.navToLocations((0, util_2.parseLocStrings)(input, assemblyName, isValidRefName), assemblyName);
|
|
1096
|
+
},
|
|
1097
|
+
/**
|
|
1098
|
+
* #action
|
|
1099
|
+
* Similar to `navToLocString`, but accepts parsed location objects
|
|
1100
|
+
* instead of strings. Will try to perform `setDisplayedRegions` if
|
|
1101
|
+
* changing regions
|
|
1102
|
+
*/
|
|
1103
|
+
async navToLocations(parsedLocStrings, assemblyName) {
|
|
1104
|
+
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
1105
|
+
await (0, mobx_1.when)(() => self.volatileWidth !== undefined);
|
|
1106
|
+
const locations = await (0, util_2.generateLocations)(parsedLocStrings, assemblyManager, assemblyName);
|
|
1140
1107
|
if (locations.length === 1) {
|
|
1141
1108
|
const loc = locations[0];
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
]);
|
|
1145
|
-
const { start, end, parentRegion } = loc;
|
|
1109
|
+
const { reversed, parentRegion, start, end } = loc;
|
|
1110
|
+
self.setDisplayedRegions([{ reversed, ...parentRegion }]);
|
|
1146
1111
|
this.navTo({
|
|
1147
1112
|
...loc,
|
|
1148
1113
|
start: (0, util_1.clamp)(start !== null && start !== void 0 ? start : 0, 0, parentRegion.end),
|
|
@@ -1159,9 +1124,9 @@ function stateModelFactory(pluginManager) {
|
|
|
1159
1124
|
/**
|
|
1160
1125
|
* #action
|
|
1161
1126
|
* Navigate to a location based on its refName and optionally start, end,
|
|
1162
|
-
* and assemblyName.
|
|
1163
|
-
*
|
|
1164
|
-
* within a displayedRegion. Navigates to the first matching location
|
|
1127
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
1128
|
+
* `navToLocations` instead. Only navigates to a location if it is
|
|
1129
|
+
* entirely within a displayedRegion. Navigates to the first matching location
|
|
1165
1130
|
* encountered.
|
|
1166
1131
|
*
|
|
1167
1132
|
* Throws an error if navigation was unsuccessful
|
|
@@ -1173,105 +1138,62 @@ function stateModelFactory(pluginManager) {
|
|
|
1173
1138
|
},
|
|
1174
1139
|
/**
|
|
1175
1140
|
* #action
|
|
1141
|
+
* Navigate to a location based on its refName and optionally start, end,
|
|
1142
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
1143
|
+
* navToLocations instead. Only navigates to a location if it is entirely
|
|
1144
|
+
* within a displayedRegion. Navigates to the first matching location
|
|
1145
|
+
* encountered.
|
|
1146
|
+
*
|
|
1147
|
+
* Throws an error if navigation was unsuccessful
|
|
1148
|
+
*
|
|
1149
|
+
* @param locations - proposed location to navigate to
|
|
1176
1150
|
*/
|
|
1177
1151
|
navToMultiple(locations) {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
const { start, end, assemblyName = self.assemblyNames[0], } = firstLocation;
|
|
1181
|
-
if (start !== undefined && end !== undefined && start > end) {
|
|
1182
|
-
throw new Error(`start "${start + 1}" is greater than end "${end}"`);
|
|
1152
|
+
if (locations.some(l => l.start !== undefined && l.end !== undefined && l.start > l.end)) {
|
|
1153
|
+
throw new Error('found start greater than end');
|
|
1183
1154
|
}
|
|
1184
|
-
const
|
|
1185
|
-
const
|
|
1186
|
-
const
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1155
|
+
const f1 = locations[0];
|
|
1156
|
+
const f2 = locations[locations.length - 1];
|
|
1157
|
+
const a = self.assemblyNames[0];
|
|
1158
|
+
const { assemblyManager } = (0, util_1.getSession)(self);
|
|
1159
|
+
const assembly1 = assemblyManager.get(f1.assemblyName || a);
|
|
1160
|
+
const assembly2 = assemblyManager.get(f2.assemblyName || a);
|
|
1161
|
+
const ref1 = (assembly1 === null || assembly1 === void 0 ? void 0 : assembly1.getCanonicalRefName(f1.refName)) || f1.refName;
|
|
1162
|
+
const ref2 = (assembly2 === null || assembly2 === void 0 ? void 0 : assembly2.getCanonicalRefName(f2.refName)) || f2.refName;
|
|
1163
|
+
const r1 = self.displayedRegions.find(r => r.refName === ref1);
|
|
1164
|
+
const r2 = (0, util_1.findLast)(self.displayedRegions, r => r.refName === ref2);
|
|
1165
|
+
if (!r1) {
|
|
1166
|
+
throw new Error(`could not find a region with refName "${ref1}"`);
|
|
1192
1167
|
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
};
|
|
1213
|
-
const lastIndex = (0, util_1.findLastIndex)(self.displayedRegions, predicate);
|
|
1214
|
-
let index;
|
|
1215
|
-
while (index !== lastIndex) {
|
|
1216
|
-
try {
|
|
1217
|
-
const previousIndex = index;
|
|
1218
|
-
index = self.displayedRegions
|
|
1219
|
-
.slice(previousIndex === undefined ? 0 : previousIndex + 1)
|
|
1220
|
-
.findIndex(predicate);
|
|
1221
|
-
if (previousIndex !== undefined) {
|
|
1222
|
-
index += previousIndex + 1;
|
|
1223
|
-
}
|
|
1224
|
-
if (!refNameMatched) {
|
|
1225
|
-
throw new Error(`could not find a region with refName "${refName}"`);
|
|
1226
|
-
}
|
|
1227
|
-
if (s === undefined) {
|
|
1228
|
-
throw new Error(`could not find a region with refName "${refName}" that contained an end position ${e}`);
|
|
1229
|
-
}
|
|
1230
|
-
if (e === undefined) {
|
|
1231
|
-
throw new Error(`could not find a region with refName "${refName}" that contained a start position ${s + 1}`);
|
|
1232
|
-
}
|
|
1233
|
-
if (index === -1) {
|
|
1234
|
-
throw new Error(`could not find a region that completely contained "${(0, util_1.assembleLocString)(firstLocation)}"`);
|
|
1235
|
-
}
|
|
1236
|
-
if (locations.length === 1) {
|
|
1237
|
-
const f = self.displayedRegions[index];
|
|
1238
|
-
this.moveTo({ index, offset: f.reversed ? f.end - e : s - f.start }, { index, offset: f.reversed ? f.end - s : e - f.start });
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
let idx = 0;
|
|
1242
|
-
let start = 0;
|
|
1243
|
-
let end = 0;
|
|
1244
|
-
for (idx; idx < locations.length; idx++) {
|
|
1245
|
-
const location = locations[idx];
|
|
1246
|
-
const region = self.displayedRegions[index + idx];
|
|
1247
|
-
start = location.start || region.start;
|
|
1248
|
-
end = location.end || region.end;
|
|
1249
|
-
if (location.refName !== region.refName) {
|
|
1250
|
-
throw new Error(`Entered location ${(0, util_1.assembleLocString)(location)} does not match with displayed regions`);
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
idx -= 1;
|
|
1254
|
-
const startDisplayedRegion = self.displayedRegions[index];
|
|
1255
|
-
const endDisplayedRegion = self.displayedRegions[index + idx];
|
|
1256
|
-
this.moveTo({
|
|
1257
|
-
index,
|
|
1258
|
-
offset: startDisplayedRegion.reversed
|
|
1259
|
-
? startDisplayedRegion.end - e
|
|
1260
|
-
: s - startDisplayedRegion.start,
|
|
1261
|
-
}, {
|
|
1262
|
-
index: index + idx,
|
|
1263
|
-
offset: endDisplayedRegion.reversed
|
|
1264
|
-
? endDisplayedRegion.end - start
|
|
1265
|
-
: end - endDisplayedRegion.start,
|
|
1266
|
-
});
|
|
1267
|
-
return;
|
|
1268
|
-
}
|
|
1269
|
-
catch (error) {
|
|
1270
|
-
if (index === lastIndex) {
|
|
1271
|
-
throw error;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1168
|
+
if (!r2) {
|
|
1169
|
+
throw new Error(`could not find a region with refName "${ref2}"`);
|
|
1170
|
+
}
|
|
1171
|
+
const s1 = f1.start === undefined ? r1.start : f1.start;
|
|
1172
|
+
const e1 = f1.end === undefined ? r1.end : f1.end;
|
|
1173
|
+
const s2 = f2.start === undefined ? r2.start : f2.start;
|
|
1174
|
+
const e2 = f2.end === undefined ? r2.end : f2.end;
|
|
1175
|
+
const index = self.displayedRegions.findIndex(r => ref1 === r.refName &&
|
|
1176
|
+
s1 >= r.start &&
|
|
1177
|
+
s1 <= r.end &&
|
|
1178
|
+
e1 <= r.end &&
|
|
1179
|
+
e1 >= r.start);
|
|
1180
|
+
const index2 = self.displayedRegions.findIndex(r => ref2 === r.refName &&
|
|
1181
|
+
s2 >= r.start &&
|
|
1182
|
+
s2 <= r.end &&
|
|
1183
|
+
e2 <= r.end &&
|
|
1184
|
+
e2 >= r.start);
|
|
1185
|
+
if (index === -1 || index2 === -1) {
|
|
1186
|
+
throw new Error(`could not find a region that contained "${locations.map(l => (0, util_1.assembleLocString)(l))}"`);
|
|
1274
1187
|
}
|
|
1188
|
+
const sd = self.displayedRegions[index];
|
|
1189
|
+
const ed = self.displayedRegions[index2];
|
|
1190
|
+
this.moveTo({
|
|
1191
|
+
index,
|
|
1192
|
+
offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
|
|
1193
|
+
}, {
|
|
1194
|
+
index: index2,
|
|
1195
|
+
offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
|
|
1196
|
+
});
|
|
1275
1197
|
},
|
|
1276
1198
|
}))
|
|
1277
1199
|
.views(self => ({
|
|
@@ -1283,15 +1205,16 @@ function stateModelFactory(pluginManager) {
|
|
|
1283
1205
|
{
|
|
1284
1206
|
label: 'Zoom to region',
|
|
1285
1207
|
icon: ZoomIn_1.default,
|
|
1286
|
-
onClick: () =>
|
|
1287
|
-
const { leftOffset, rightOffset } = self;
|
|
1288
|
-
self.moveTo(leftOffset, rightOffset);
|
|
1289
|
-
},
|
|
1208
|
+
onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
|
|
1290
1209
|
},
|
|
1291
1210
|
{
|
|
1292
1211
|
label: 'Get sequence',
|
|
1293
1212
|
icon: MenuOpen_1.default,
|
|
1294
|
-
onClick: () => self.
|
|
1213
|
+
onClick: () => (0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
1214
|
+
GetSequenceDialog,
|
|
1215
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1216
|
+
{ model: self, handleClose },
|
|
1217
|
+
]),
|
|
1295
1218
|
},
|
|
1296
1219
|
];
|
|
1297
1220
|
},
|
|
@@ -1315,7 +1238,7 @@ function stateModelFactory(pluginManager) {
|
|
|
1315
1238
|
coord,
|
|
1316
1239
|
regionNumber,
|
|
1317
1240
|
});
|
|
1318
|
-
if (centerPx) {
|
|
1241
|
+
if (centerPx !== undefined) {
|
|
1319
1242
|
self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2));
|
|
1320
1243
|
}
|
|
1321
1244
|
},
|