jbrowse-plugin-mafviewer 1.4.3 → 1.4.6
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/README.md +1 -1
- package/dist/BigMafAdapter/BigMafAdapter.js +4 -5
- package/dist/BigMafAdapter/BigMafAdapter.js.map +1 -1
- package/dist/BigMafAdapter/configSchema.d.ts +2 -2
- package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js +39 -109
- package/dist/LinearMafDisplay/components/LinearMafDisplayComponent.js.map +1 -1
- package/dist/LinearMafDisplay/components/MAFTooltip.d.ts +0 -3
- package/dist/LinearMafDisplay/components/MAFTooltip.js.map +1 -1
- package/dist/LinearMafDisplay/components/MsaHighlightOverlay.d.ts +9 -0
- package/dist/LinearMafDisplay/components/MsaHighlightOverlay.js +34 -0
- package/dist/LinearMafDisplay/components/MsaHighlightOverlay.js.map +1 -0
- package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.js +2 -2
- package/dist/LinearMafDisplay/components/Sidebar/ColorLegend.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.d.ts +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.js +2 -3
- package/dist/LinearMafDisplay/components/Sidebar/RectBg.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/SvgWrapper.js +81 -11
- package/dist/LinearMafDisplay/components/Sidebar/SvgWrapper.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/Tree.js +30 -9
- package/dist/LinearMafDisplay/components/Sidebar/Tree.js.map +1 -1
- package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.d.ts +0 -1
- package/dist/LinearMafDisplay/components/Sidebar/YScaleBars.js.map +1 -1
- package/dist/LinearMafDisplay/components/useDragSelection.d.ts +25 -0
- package/dist/LinearMafDisplay/components/useDragSelection.js +103 -0
- package/dist/LinearMafDisplay/components/useDragSelection.js.map +1 -0
- package/dist/LinearMafDisplay/configSchema.d.ts +3 -30
- package/dist/LinearMafDisplay/renderSvg.js +1 -1
- package/dist/LinearMafDisplay/renderSvg.js.map +1 -1
- package/dist/LinearMafDisplay/stateModel.d.ts +1090 -102
- package/dist/LinearMafDisplay/stateModel.js +156 -17
- package/dist/LinearMafDisplay/stateModel.js.map +1 -1
- package/dist/LinearMafDisplay/types.d.ts +2 -2
- package/dist/LinearMafDisplay/util.d.ts +6 -0
- package/dist/LinearMafDisplay/util.js +28 -6
- package/dist/LinearMafDisplay/util.js.map +1 -1
- package/dist/LinearMafRenderer/LinearMafRenderer.d.ts +43 -10
- package/dist/LinearMafRenderer/LinearMafRenderer.js +1 -1
- package/dist/LinearMafRenderer/LinearMafRenderer.js.map +1 -1
- package/dist/LinearMafRenderer/components/LinearMafRendering.d.ts +14 -5
- package/dist/LinearMafRenderer/components/LinearMafRendering.js +40 -20
- package/dist/LinearMafRenderer/components/LinearMafRendering.js.map +1 -1
- package/dist/LinearMafRenderer/configSchema.d.ts +1 -6
- package/dist/LinearMafRenderer/configSchema.js +1 -6
- package/dist/LinearMafRenderer/configSchema.js.map +1 -1
- package/dist/LinearMafRenderer/makeImageData.js +6 -7
- package/dist/LinearMafRenderer/makeImageData.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/features.d.ts +0 -1
- package/dist/LinearMafRenderer/rendering/features.js +1 -14
- package/dist/LinearMafRenderer/rendering/features.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/insertions.d.ts +1 -1
- package/dist/LinearMafRenderer/rendering/insertions.js +10 -8
- package/dist/LinearMafRenderer/rendering/insertions.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/matches.d.ts +1 -1
- package/dist/LinearMafRenderer/rendering/matches.js +3 -15
- package/dist/LinearMafRenderer/rendering/matches.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/mismatches.d.ts +1 -1
- package/dist/LinearMafRenderer/rendering/mismatches.js +3 -3
- package/dist/LinearMafRenderer/rendering/spatialIndex.js +8 -2
- package/dist/LinearMafRenderer/rendering/spatialIndex.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/text.js +1 -3
- package/dist/LinearMafRenderer/rendering/text.js.map +1 -1
- package/dist/LinearMafRenderer/rendering/types.d.ts +6 -5
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js +1 -1
- package/dist/MafAddTrackWorkflow/AddTrackWorkflow.js.map +1 -1
- package/dist/MafAddTrackWorkflow/index.js +1 -1
- package/dist/MafAddTrackWorkflow/index.js.map +1 -1
- package/dist/MafGetSequences/MafGetSequences.d.ts +1 -0
- package/dist/MafGetSequences/MafGetSequences.js +2 -1
- package/dist/MafGetSequences/MafGetSequences.js.map +1 -1
- package/dist/MafSequenceWidget/LabelsCanvas.d.ts +8 -0
- package/dist/MafSequenceWidget/LabelsCanvas.js +37 -0
- package/dist/MafSequenceWidget/LabelsCanvas.js.map +1 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlight.d.ts +6 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlight.js +52 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlight.js.map +1 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlightExtension.d.ts +2 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlightExtension.js +12 -0
- package/dist/MafSequenceWidget/MafSequenceHoverHighlightExtension.js.map +1 -0
- package/dist/MafSequenceWidget/MafSequenceWidget.d.ts +6 -0
- package/dist/MafSequenceWidget/MafSequenceWidget.js +189 -0
- package/dist/MafSequenceWidget/MafSequenceWidget.js.map +1 -0
- package/dist/MafSequenceWidget/SequenceCanvas.d.ts +12 -0
- package/dist/MafSequenceWidget/SequenceCanvas.js +86 -0
- package/dist/MafSequenceWidget/SequenceCanvas.js.map +1 -0
- package/dist/MafSequenceWidget/SequenceDisplay.d.ts +12 -0
- package/dist/MafSequenceWidget/SequenceDisplay.js +117 -0
- package/dist/MafSequenceWidget/SequenceDisplay.js.map +1 -0
- package/dist/MafSequenceWidget/SequenceTooltip.d.ts +11 -0
- package/dist/MafSequenceWidget/SequenceTooltip.js +39 -0
- package/dist/MafSequenceWidget/SequenceTooltip.js.map +1 -0
- package/dist/MafSequenceWidget/baseColors.d.ts +3 -0
- package/dist/MafSequenceWidget/baseColors.js +64 -0
- package/dist/MafSequenceWidget/baseColors.js.map +1 -0
- package/dist/MafSequenceWidget/colToGenomePos.d.ts +13 -0
- package/dist/MafSequenceWidget/colToGenomePos.js +32 -0
- package/dist/MafSequenceWidget/colToGenomePos.js.map +1 -0
- package/dist/MafSequenceWidget/colToGenomePos.test.d.ts +1 -0
- package/dist/MafSequenceWidget/colToGenomePos.test.js +136 -0
- package/dist/MafSequenceWidget/colToGenomePos.test.js.map +1 -0
- package/dist/MafSequenceWidget/configSchema.d.ts +1 -0
- package/dist/MafSequenceWidget/configSchema.js +3 -0
- package/dist/MafSequenceWidget/configSchema.js.map +1 -0
- package/dist/MafSequenceWidget/constants.d.ts +4 -0
- package/dist/MafSequenceWidget/constants.js +5 -0
- package/dist/MafSequenceWidget/constants.js.map +1 -0
- package/dist/MafSequenceWidget/index.d.ts +2 -0
- package/dist/MafSequenceWidget/index.js +16 -0
- package/dist/MafSequenceWidget/index.js.map +1 -0
- package/dist/MafSequenceWidget/stateModelFactory.d.ts +67 -0
- package/dist/MafSequenceWidget/stateModelFactory.js +21 -0
- package/dist/MafSequenceWidget/stateModelFactory.js.map +1 -0
- package/dist/MafTabixAdapter/MafTabixAdapter.js +4 -35
- package/dist/MafTabixAdapter/MafTabixAdapter.js.map +1 -1
- package/dist/MafTabixAdapter/configSchema.d.ts +4 -4
- package/dist/MafTrack/configSchema.d.ts +16 -11
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js +12 -24
- package/dist/jbrowse-plugin-mafviewer.umd.production.min.js.map +4 -4
- package/dist/util/clipboard.d.ts +2 -0
- package/dist/util/clipboard.js +28 -0
- package/dist/util/clipboard.js.map +1 -0
- package/dist/util/fastaUtils.d.ts +2 -1
- package/dist/util/fastaUtils.js +93 -50
- package/dist/util/fastaUtils.js.map +1 -1
- package/dist/util/fastaUtils.test.js +190 -0
- package/dist/util/fastaUtils.test.js.map +1 -1
- package/dist/util/parseAssemblyName.d.ts +32 -0
- package/dist/util/parseAssemblyName.js +87 -0
- package/dist/util/parseAssemblyName.js.map +1 -0
- package/dist/util/parseAssemblyName.test.d.ts +1 -0
- package/dist/util/parseAssemblyName.test.js +269 -0
- package/dist/util/parseAssemblyName.test.js.map +1 -0
- package/package.json +12 -12
- package/src/BigMafAdapter/BigMafAdapter.ts +5 -5
- package/src/LinearMafDisplay/components/LinearMafDisplayComponent.tsx +63 -145
- package/src/LinearMafDisplay/components/MAFTooltip.tsx +0 -3
- package/src/LinearMafDisplay/components/MsaHighlightOverlay.tsx +62 -0
- package/src/LinearMafDisplay/components/Sidebar/ColorLegend.tsx +2 -6
- package/src/LinearMafDisplay/components/Sidebar/RectBg.tsx +8 -3
- package/src/LinearMafDisplay/components/Sidebar/SvgWrapper.tsx +117 -15
- package/src/LinearMafDisplay/components/Sidebar/Tree.tsx +53 -8
- package/src/LinearMafDisplay/components/Sidebar/YScaleBars.tsx +0 -1
- package/src/LinearMafDisplay/components/useDragSelection.ts +159 -0
- package/src/LinearMafDisplay/renderSvg.tsx +1 -1
- package/src/LinearMafDisplay/stateModel.ts +215 -20
- package/src/LinearMafDisplay/types.ts +2 -2
- package/src/LinearMafDisplay/util.ts +35 -7
- package/src/LinearMafRenderer/LinearMafRenderer.ts +3 -5
- package/src/LinearMafRenderer/components/LinearMafRendering.tsx +67 -33
- package/src/LinearMafRenderer/configSchema.ts +1 -6
- package/src/LinearMafRenderer/makeImageData.ts +5 -14
- package/src/LinearMafRenderer/rendering/features.ts +2 -36
- package/src/LinearMafRenderer/rendering/insertions.ts +13 -8
- package/src/LinearMafRenderer/rendering/matches.ts +2 -27
- package/src/LinearMafRenderer/rendering/mismatches.ts +3 -3
- package/src/LinearMafRenderer/rendering/spatialIndex.ts +9 -2
- package/src/LinearMafRenderer/rendering/text.ts +1 -2
- package/src/LinearMafRenderer/rendering/types.ts +8 -5
- package/src/MafAddTrackWorkflow/AddTrackWorkflow.tsx +1 -1
- package/src/MafAddTrackWorkflow/index.ts +1 -1
- package/src/MafGetSequences/MafGetSequences.ts +10 -2
- package/src/MafSequenceWidget/LabelsCanvas.tsx +58 -0
- package/src/MafSequenceWidget/MafSequenceHoverHighlight.tsx +83 -0
- package/src/MafSequenceWidget/MafSequenceHoverHighlightExtension.tsx +24 -0
- package/src/MafSequenceWidget/MafSequenceWidget.tsx +294 -0
- package/src/MafSequenceWidget/SequenceCanvas.tsx +136 -0
- package/src/MafSequenceWidget/SequenceDisplay.tsx +188 -0
- package/src/MafSequenceWidget/SequenceTooltip.tsx +70 -0
- package/src/MafSequenceWidget/baseColors.ts +76 -0
- package/src/MafSequenceWidget/colToGenomePos.test.ts +166 -0
- package/src/MafSequenceWidget/colToGenomePos.ts +40 -0
- package/src/MafSequenceWidget/configSchema.ts +3 -0
- package/src/MafSequenceWidget/constants.ts +4 -0
- package/src/MafSequenceWidget/index.ts +24 -0
- package/src/MafSequenceWidget/stateModelFactory.ts +43 -0
- package/src/MafTabixAdapter/MafTabixAdapter.ts +12 -51
- package/src/index.ts +2 -0
- package/src/util/__snapshots__/fastaUtils.test.ts.snap +35 -0
- package/src/util/clipboard.ts +35 -0
- package/src/util/fastaUtils.test.ts +199 -0
- package/src/util/fastaUtils.ts +118 -51
- package/src/util/parseAssemblyName.test.ts +350 -0
- package/src/util/parseAssemblyName.ts +106 -0
- package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.d.ts +0 -11
- package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.js +0 -97
- package/dist/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.js.map +0 -1
- package/dist/LinearMafDisplay/components/util.d.ts +0 -1
- package/dist/LinearMafDisplay/components/util.js +0 -8
- package/dist/LinearMafDisplay/components/util.js.map +0 -1
- package/dist/LinearMafRenderer/components/util.d.ts +0 -1
- package/dist/LinearMafRenderer/components/util.js +0 -13
- package/dist/LinearMafRenderer/components/util.js.map +0 -1
- package/dist/util/fetchSequences.d.ts +0 -18
- package/dist/util/fetchSequences.js +0 -39
- package/dist/util/fetchSequences.js.map +0 -1
- package/dist/util/useSequences.d.ts +0 -21
- package/dist/util/useSequences.js +0 -64
- package/dist/util/useSequences.js.map +0 -1
- package/src/LinearMafDisplay/components/GetSequenceDialog/GetSequenceDialog.tsx +0 -175
- package/src/LinearMafDisplay/components/util.ts +0 -7
- package/src/LinearMafRenderer/components/util.ts +0 -13
- package/src/util/fetchSequences.ts +0 -57
- package/src/util/useSequences.ts +0 -90
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearMafRendering.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/components/LinearMafRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"LinearMafRendering.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/components/LinearMafRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAgBrC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,UAAU,KAO7C;IACC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAChE,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAA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KAAK,EAAE;YACL,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,UAAU;YACpB,MAAM;YACN,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAChD;QAED,oBAAC,iBAAiB,OACZ,KAAK,EACT,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,CAAC;aACR,GACD,CACE,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,kBAAkB,CAAA"}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
baseColor: {
|
|
3
|
-
type: string;
|
|
4
|
-
defaultValue: string;
|
|
5
|
-
};
|
|
6
|
-
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
1
|
+
declare const configSchema: import("@jbrowse/core/esm/configuration/configurationSchema").ConfigurationSchemaType<{}, import("@jbrowse/core/esm/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
7
2
|
export default configSchema;
|
|
@@ -3,12 +3,7 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
|
3
3
|
* #config LinearMafRenderer
|
|
4
4
|
*/
|
|
5
5
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
|
-
const configSchema = ConfigurationSchema('LinearMafRenderer', {
|
|
7
|
-
baseColor: {
|
|
8
|
-
type: 'color',
|
|
9
|
-
defaultValue: 'lightgrey',
|
|
10
|
-
},
|
|
11
|
-
}, {
|
|
6
|
+
const configSchema = ConfigurationSchema('LinearMafRenderer', {}, {
|
|
12
7
|
/**
|
|
13
8
|
* #baseConfiguration
|
|
14
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/LinearMafRenderer/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,mBAAmB,CACtC,mBAAmB,EACnB
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/LinearMafRenderer/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,mBAAmB,CACtC,mBAAmB,EACnB,EAAE,EACF;IACE;;OAEG;IACH,eAAe,EAAE,IAAI;CACtB,CACF,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createJBrowseTheme } from '@jbrowse/core/ui';
|
|
2
2
|
import Flatbush from 'flatbush';
|
|
3
|
-
import { FONT_CONFIG, processFeatureAlignment,
|
|
4
|
-
import { getColorBaseMap, getContrastBaseMap } from './util';
|
|
3
|
+
import { FONT_CONFIG, processFeatureAlignment, } from './rendering';
|
|
4
|
+
import { getCharWidthHeight, getColorBaseMap, getContrastBaseMap } from './util';
|
|
5
5
|
export function makeImageData({ ctx, renderArgs, }) {
|
|
6
6
|
const { regions, bpPerPx, rowHeight, showAllLetters, theme: configTheme, mismatchRendering, samples, rowProportion, features, showAsUpperCase, } = renderArgs;
|
|
7
7
|
const region = regions[0];
|
|
@@ -14,10 +14,12 @@ export function makeImageData({ ctx, renderArgs, }) {
|
|
|
14
14
|
const scale = 1 / bpPerPx;
|
|
15
15
|
const hp2 = h / 2;
|
|
16
16
|
const offset = (rowHeight - h) / 2;
|
|
17
|
+
const { charWidth, charHeight } = getCharWidthHeight();
|
|
17
18
|
ctx.font = FONT_CONFIG;
|
|
18
19
|
const renderingContext = {
|
|
19
20
|
ctx,
|
|
20
21
|
scale,
|
|
22
|
+
bpPerPx,
|
|
21
23
|
canvasWidth,
|
|
22
24
|
rowHeight,
|
|
23
25
|
h,
|
|
@@ -28,18 +30,15 @@ export function makeImageData({ ctx, renderArgs, }) {
|
|
|
28
30
|
showAllLetters,
|
|
29
31
|
mismatchRendering,
|
|
30
32
|
showAsUpperCase,
|
|
33
|
+
charWidth,
|
|
34
|
+
charHeight,
|
|
31
35
|
spatialIndex: [],
|
|
32
36
|
spatialIndexCoords: [],
|
|
33
37
|
lastInsertedX: -Infinity, // Start with -Infinity so first item is always inserted
|
|
34
38
|
};
|
|
35
|
-
// First pass: render alignments (gaps, matches, mismatches, text)
|
|
36
39
|
for (const feature of features.values()) {
|
|
37
40
|
processFeatureAlignment(feature, region, bpPerPx, sampleToRowMap, renderingContext);
|
|
38
41
|
}
|
|
39
|
-
// Second pass: render insertions on top
|
|
40
|
-
for (const feature of features.values()) {
|
|
41
|
-
processFeatureInsertions(feature, region, bpPerPx, sampleToRowMap, renderingContext);
|
|
42
|
-
}
|
|
43
42
|
const flatbush = new Flatbush(renderingContext.spatialIndex.length || 1);
|
|
44
43
|
if (renderingContext.spatialIndex.length === 0) {
|
|
45
44
|
flatbush.add(0, 0, 1, 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeImageData.js","sourceRoot":"","sources":["../../src/LinearMafRenderer/makeImageData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,OAAO,EACL,WAAW,EAGX,uBAAuB,
|
|
1
|
+
{"version":3,"file":"makeImageData.js","sourceRoot":"","sources":["../../src/LinearMafRenderer/makeImageData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,OAAO,EACL,WAAW,EAGX,uBAAuB,GACxB,MAAM,aAAa,CAAA;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,4 +1,3 @@
|
|
|
1
1
|
import { Feature } from '@jbrowse/core/util';
|
|
2
2
|
import type { GenomicRegion, RenderingContext } from './types';
|
|
3
3
|
export declare function processFeatureAlignment(feature: Feature, region: GenomicRegion, bpPerPx: number, sampleToRowMap: Map<string, number>, renderingContext: RenderingContext): void;
|
|
4
|
-
export declare function processFeatureInsertions(feature: Feature, region: GenomicRegion, bpPerPx: number, sampleToRowMap: Map<string, number>, renderingContext: RenderingContext): void;
|
|
@@ -17,22 +17,9 @@ export function processFeatureAlignment(feature, region, bpPerPx, sampleToRowMap
|
|
|
17
17
|
const alignment = originalAlignment.toLowerCase();
|
|
18
18
|
const rowTop = renderingContext.offset + renderingContext.rowHeight * row;
|
|
19
19
|
renderGaps(renderingContext, alignment, referenceSeq, leftPx, rowTop);
|
|
20
|
-
renderMatches(renderingContext, alignment, referenceSeq, leftPx, rowTop
|
|
20
|
+
renderMatches(renderingContext, alignment, referenceSeq, leftPx, rowTop);
|
|
21
21
|
renderMismatches(renderingContext, alignment, referenceSeq, leftPx, rowTop, row, alignmentData.start, alignmentData.chr);
|
|
22
22
|
renderText(renderingContext, alignment, originalAlignment, referenceSeq, leftPx, rowTop);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export function processFeatureInsertions(feature, region, bpPerPx, sampleToRowMap, renderingContext) {
|
|
26
|
-
const [leftPx] = featureSpanPx(feature, region, bpPerPx);
|
|
27
|
-
const alignments = feature.get('alignments');
|
|
28
|
-
const referenceSeq = feature.get('seq').toLowerCase();
|
|
29
|
-
for (const [sampleId, alignmentData] of Object.entries(alignments)) {
|
|
30
|
-
const row = sampleToRowMap.get(sampleId);
|
|
31
|
-
if (row === undefined) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
const alignment = alignmentData.seq.toLowerCase();
|
|
35
|
-
const rowTop = renderingContext.offset + renderingContext.rowHeight * row;
|
|
36
23
|
renderInsertions(renderingContext, alignment, referenceSeq, leftPx, rowTop, bpPerPx, row, alignmentData.start, alignmentData.chr);
|
|
37
24
|
}
|
|
38
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAInC,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,MAAqB,EACrB,OAAe,EACf,cAAmC,EACnC,gBAAkC;IAElC,MAAM,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IACxD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAG1C,CAAA;IACD,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAInC,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,MAAqB,EACrB,OAAe,EACf,cAAmC,EACnC,gBAAkC;IAElC,MAAM,CAAC,MAA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H,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RenderingContext } from './types';
|
|
2
|
-
export declare function renderInsertions(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number, bpPerPx: number,
|
|
2
|
+
export declare function renderInsertions(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number, bpPerPx: number, rowIndex: number, alignmentStart: number, chr: string): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { measureText } from '@jbrowse/core/util';
|
|
2
|
-
import { fillRect
|
|
2
|
+
import { fillRect } from '../util';
|
|
3
3
|
import { addToSpatialIndex, shouldAddToSpatialIndex } from './spatialIndex';
|
|
4
4
|
import { CHAR_SIZE_WIDTH, HIGH_BP_PER_PX_THRESHOLD, HIGH_ZOOM_THRESHOLD, INSERTION_BORDER_HEIGHT, INSERTION_BORDER_WIDTH, INSERTION_LINE_WIDTH, INSERTION_PADDING, LARGE_INSERTION_THRESHOLD, MIN_ROW_HEIGHT_FOR_BORDERS, } from './types';
|
|
5
|
-
export function renderInsertions(context, alignment, seq, leftPx, rowTop, bpPerPx,
|
|
6
|
-
const { ctx, scale, h, canvasWidth, rowHeight } = context;
|
|
7
|
-
const { charHeight } = getCharWidthHeight();
|
|
5
|
+
export function renderInsertions(context, alignment, seq, leftPx, rowTop, bpPerPx, rowIndex, alignmentStart, chr) {
|
|
6
|
+
const { ctx, scale, h, canvasWidth, rowHeight, charHeight } = context;
|
|
8
7
|
for (let i = 0, genomicOffset = 0, seqLength = alignment.length; i < seqLength; i++) {
|
|
9
8
|
let insertionSequence = '';
|
|
10
9
|
while (seq[i] === '-') {
|
|
@@ -50,25 +49,28 @@ export function renderInsertions(context, alignment, seq, leftPx, rowTop, bpPerP
|
|
|
50
49
|
actualXPos = xPos;
|
|
51
50
|
actualWidth = INSERTION_LINE_WIDTH;
|
|
52
51
|
fillRect(ctx, actualXPos, rowTop, actualWidth, h, canvasWidth, 'purple');
|
|
52
|
+
// Always use a wider hit box for spatial index, even if visual is 1px
|
|
53
|
+
const hitBoxPadding = 2;
|
|
54
|
+
actualXPos = xPos - hitBoxPadding;
|
|
55
|
+
actualWidth = INSERTION_LINE_WIDTH + 2 * hitBoxPadding;
|
|
53
56
|
if (bpPerPx < HIGH_ZOOM_THRESHOLD &&
|
|
54
57
|
rowHeight > MIN_ROW_HEIGHT_FOR_BORDERS) {
|
|
55
58
|
// Add horizontal borders for visibility at high zoom
|
|
56
|
-
// Note: borders extend the effective clickable area
|
|
57
|
-
actualXPos = xPos - INSERTION_BORDER_WIDTH;
|
|
58
|
-
actualWidth = INSERTION_BORDER_HEIGHT;
|
|
59
59
|
fillRect(ctx, xPos - INSERTION_BORDER_WIDTH, rowTop, INSERTION_BORDER_HEIGHT, INSERTION_LINE_WIDTH, canvasWidth);
|
|
60
60
|
fillRect(ctx, xPos - INSERTION_BORDER_WIDTH, rowTop + h - INSERTION_LINE_WIDTH, INSERTION_BORDER_HEIGHT, INSERTION_LINE_WIDTH, canvasWidth);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
// Add insertion to spatial index with actual rendered dimensions
|
|
64
64
|
// Insertions always bypass distance filter
|
|
65
|
+
const isLargeInsertion = insertionSequence.length > LARGE_INSERTION_THRESHOLD;
|
|
65
66
|
if (shouldAddToSpatialIndex(actualXPos, context, true)) {
|
|
66
67
|
addToSpatialIndex(context, actualXPos, rowTop, actualXPos + actualWidth, rowTop + context.h, {
|
|
67
68
|
pos: genomicOffset + alignmentStart,
|
|
68
69
|
chr,
|
|
69
70
|
base: insertionSequence,
|
|
70
|
-
|
|
71
|
+
rowIndex,
|
|
71
72
|
isInsertion: true,
|
|
73
|
+
isLargeInsertion,
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertions.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/insertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"insertions.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/insertions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAC3E,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,SAAS,CAAA;AAIhB,MAAM,UAAU,gBAAgB,CAC9B,OAAyB,EACzB,SAAiB,EACjB,GAAW,EACX,MAAc,EACd,MAAc,EACd,OAAe,EACf,QAAgB,EAChB,cAAsB,EACtB,GAAW;IAEX,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAErE,KACE,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,MAAM,EAC1D,CAAC,GAAG,SAAS,EACb,CAAC,EAAE,EACH,CAAC;QACD,IAAI,iBAAiB,GAAG,EAAE,CAAA;QAC1B,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACtB,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACjD,iBAAiB,IAAI,SAAS,CAAC,CAAC,CAAC,CAAA;YACnC,CAAC;YACD,CAAC,EAAE,CAAA;QACL,CAAC;QACD,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACj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AAG;oBACH,IAAI,EAAE,iBAAiB;oBACvB,QAAQ;oBACR,WAAW,EAAE,IAAI;oBACjB,gBAAgB;iBACjB,CACF,CAAA;YACH,CAAC;QACH,CAAC;QACD,aAAa,EAAE,CAAA;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RenderingContext } from './types';
|
|
2
|
-
export declare function renderMatches(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number
|
|
2
|
+
export declare function renderMatches(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number): void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { fillRect } from '../util';
|
|
2
|
-
import { addToSpatialIndex, shouldAddToSpatialIndex } from './spatialIndex';
|
|
3
2
|
import { GAP_STROKE_OFFSET } from './types';
|
|
4
|
-
export function renderMatches(context, alignment, seq, leftPx, rowTop
|
|
3
|
+
export function renderMatches(context, alignment, seq, leftPx, rowTop) {
|
|
5
4
|
if (context.showAllLetters) {
|
|
6
5
|
return;
|
|
7
6
|
}
|
|
@@ -12,20 +11,9 @@ export function renderMatches(context, alignment, seq, leftPx, rowTop, sampleId,
|
|
|
12
11
|
if (seq[i] !== '-') {
|
|
13
12
|
// Only process non-gap positions in reference
|
|
14
13
|
const currentChar = alignment[i];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
currentChar !== '-' &&
|
|
18
|
-
currentChar !== ' ') {
|
|
14
|
+
if (seq[i] === currentChar && currentChar !== ' ') {
|
|
15
|
+
const xPos = leftPx + scale * genomicOffset;
|
|
19
16
|
fillRect(ctx, xPos, rowTop, scale + GAP_STROKE_OFFSET, h, canvasWidth);
|
|
20
|
-
// Add to spatial index if distance filter allows
|
|
21
|
-
if (shouldAddToSpatialIndex(xPos, context)) {
|
|
22
|
-
addToSpatialIndex(context, xPos, rowTop, xPos + context.scale + GAP_STROKE_OFFSET, rowTop + context.h, {
|
|
23
|
-
pos: genomicOffset + alignmentStart,
|
|
24
|
-
chr,
|
|
25
|
-
base: currentChar || '',
|
|
26
|
-
sampleId,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
17
|
}
|
|
30
18
|
genomicOffset++;
|
|
31
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matches.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/matches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"matches.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/matches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAI3C,MAAM,UAAU,aAAa,CAC3B,OAAyB,EACzB,SAAiB,EACjB,GAAW,EACX,MAAc,EACd,MAAc;IAEd,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC3B,OAAM;IACR,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;IAC9C,GAAG,CAAC,SAAS,GAAG,WAAW,CAAA;IAE3B,sDAAsD;IACtD,KACE,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,MAAM,EAC1D,CAAC,GAAG,SAAS,EACb,CAAC,EAAE,EACH,CAAC;QACD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACnB,8CAA8C;YAC9C,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAA;YAChC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,WAAW,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;gBAClD,MAAM,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,CAAA;gBAC3C,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,iBAAiB,EAAE,CAAC,EAAE,WAAW,CAAC,CAAA;YACxE,CAAC;YACD,aAAa,EAAE,CAAA;QACjB,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -10,4 +10,4 @@ import type { RenderingContext } from './types';
|
|
|
10
10
|
* @param alignmentStart - Start position of the alignment
|
|
11
11
|
* @param chr - Chromosome/sequence name
|
|
12
12
|
*/
|
|
13
|
-
export declare function renderMismatches(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number,
|
|
13
|
+
export declare function renderMismatches(context: RenderingContext, alignment: string, seq: string, leftPx: number, rowTop: number, rowIndex: number, alignmentStart: number, chr: string): void;
|
|
@@ -12,7 +12,7 @@ import { GAP_STROKE_OFFSET } from './types';
|
|
|
12
12
|
* @param alignmentStart - Start position of the alignment
|
|
13
13
|
* @param chr - Chromosome/sequence name
|
|
14
14
|
*/
|
|
15
|
-
export function renderMismatches(context, alignment, seq, leftPx, rowTop,
|
|
15
|
+
export function renderMismatches(context, alignment, seq, leftPx, rowTop, rowIndex, alignmentStart, chr) {
|
|
16
16
|
const { ctx, scale, h, canvasWidth, showAllLetters, mismatchRendering, colorForBase, } = context;
|
|
17
17
|
for (let i = 0, genomicOffset = 0, seqLength = alignment.length; i < seqLength; i++) {
|
|
18
18
|
const currentChar = alignment[i];
|
|
@@ -30,7 +30,7 @@ export function renderMismatches(context, alignment, seq, leftPx, rowTop, sample
|
|
|
30
30
|
pos: genomicOffset + alignmentStart,
|
|
31
31
|
chr,
|
|
32
32
|
base: currentChar,
|
|
33
|
-
|
|
33
|
+
rowIndex,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -45,7 +45,7 @@ export function renderMismatches(context, alignment, seq, leftPx, rowTop, sample
|
|
|
45
45
|
pos: genomicOffset + alignmentStart,
|
|
46
46
|
chr,
|
|
47
47
|
base: currentChar,
|
|
48
|
-
|
|
48
|
+
rowIndex,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -8,8 +8,14 @@ export function createRenderedBaseCoords(xPos, rowTop, context) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
export function shouldAddToSpatialIndex(xPos, context, bypassDistanceFilter = false) {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
if (bypassDistanceFilter) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
// Zoom-aware distance threshold: scale threshold based on zoom level
|
|
15
|
+
// At high zoom (small bpPerPx), use smaller threshold for more precision
|
|
16
|
+
// At low zoom (large bpPerPx), use larger threshold to reduce index size
|
|
17
|
+
return (Math.abs(xPos - context.lastInsertedX) >
|
|
18
|
+
MIN_X_DISTANCE * Math.max(1, context.bpPerPx));
|
|
13
19
|
}
|
|
14
20
|
export function addToSpatialIndex(context, minX, minY, maxX, maxY, renderedBase) {
|
|
15
21
|
context.spatialIndex.push(renderedBase);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spatialIndex.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/spatialIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI3D,MAAM,UAAU,wBAAwB,CACtC,IAAY,EACZ,MAAc,EACd,OAAyB;IAEzB,OAAO;QACL,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,iBAAiB;QAC9C,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;KACzB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,IAAY,EACZ,OAAyB,EACzB,oBAAoB,GAAG,KAAK;IAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"spatialIndex.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/spatialIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI3D,MAAM,UAAU,wBAAwB,CACtC,IAAY,EACZ,MAAc,EACd,OAAyB;IAEzB,OAAO;QACL,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,iBAAiB;QAC9C,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;KACzB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,IAAY,EACZ,OAAyB,EACzB,oBAAoB,GAAG,KAAK;IAE5B,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,qEAAqE;IACrE,yEAAyE;IACzE,yEAAyE;IACzE,OAAO,CACL,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC;QACtC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAC9C,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAAyB,EACzB,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,YAA0B;IAE1B,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACvC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACvD,OAAO,CAAC,aAAa,GAAG,IAAI,CAAA;AAC9B,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getCharWidthHeight } from '../util';
|
|
2
1
|
import { CHAR_SIZE_WIDTH, VERTICAL_TEXT_OFFSET } from './types';
|
|
3
2
|
function getLetter(a, showAsUpperCase) {
|
|
4
3
|
return showAsUpperCase ? a.toUpperCase() : a;
|
|
@@ -14,8 +13,7 @@ function getLetter(a, showAsUpperCase) {
|
|
|
14
13
|
* @param rowTop - Top pixel position of the row
|
|
15
14
|
*/
|
|
16
15
|
export function renderText(context, alignment, origAlignment, seq, leftPx, rowTop) {
|
|
17
|
-
const { ctx, scale, hp2, rowHeight, showAllLetters, mismatchRendering, contrastForBase, showAsUpperCase, } = context;
|
|
18
|
-
const { charHeight } = getCharWidthHeight();
|
|
16
|
+
const { ctx, scale, hp2, rowHeight, showAllLetters, mismatchRendering, contrastForBase, showAsUpperCase, charHeight, } = context;
|
|
19
17
|
// Render text labels when zoomed in enough and row is tall enough
|
|
20
18
|
if (scale >= CHAR_SIZE_WIDTH) {
|
|
21
19
|
for (let i = 0, genomicOffset = 0, seqLength = alignment.length; i < seqLength; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/LinearMafRenderer/rendering/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAI/D,SAAS,SAAS,CAAC,CAAS,EAAE,eAAwB;IACpD,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CACxB,OAAyB,EACzB,SAAiB,EACjB,aAAqB,EACrB,GAAW,EACX,MAAc,EACd,MAAc;IAEd,MAAM,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,UAAU,GACX,GAAG,OAAO,CAAA;IAEX,kEAAkE;IAClE,IAAI,KAAK,IAAI,eAAe,EAAE,CAAC;QAC7B,KACE,IAAI,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC,MAAM,EAC1D,CAAC,GAAG,SAAS,EACb,CAAC,EAAE,EACH,CAAC;YACD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACnB,8CAA8C;gBAC9C,MAAM,IAAI,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,CAAA;gBAC3C,MAAM,UAAU,GAAG,CAAC,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA,CAAC,iCAAiC;gBACtF,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAE,CAAA;gBACjC,iEAAiE;gBACjE,IAAI,CAAC,cAAc,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;oBACtE,GAAG,CAAC,SAAS,GAAG,iBAAiB;wBAC/B,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,CAAC,wCAAwC;wBACpF,CAAC,CAAC,OAAO,CAAA;oBACX,IAAI,SAAS,GAAG,UAAU,EAAE,CAAC;wBAC3B,oCAAoC;wBACpC,GAAG,CAAC,QAAQ,CACV,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,eAAe,CAAC,EAClD,IAAI,GAAG,UAAU,EACjB,GAAG,GAAG,MAAM,GAAG,oBAAoB,CACpC,CAAA;oBACH,CAAC;gBACH,CAAC;gBACD,aAAa,EAAE,CAAA;YACjB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -11,10 +11,7 @@ export declare const MIN_ROW_HEIGHT_FOR_BORDERS = 5;
|
|
|
11
11
|
export declare const HIGH_BP_PER_PX_THRESHOLD = 10;
|
|
12
12
|
export declare const INSERTION_BORDER_HEIGHT = 5;
|
|
13
13
|
export declare const MIN_X_DISTANCE = 0.5;
|
|
14
|
-
export
|
|
15
|
-
id: string;
|
|
16
|
-
color?: string;
|
|
17
|
-
}
|
|
14
|
+
export type { Sample } from '../../LinearMafDisplay/types';
|
|
18
15
|
export interface GenomicRegion {
|
|
19
16
|
start: number;
|
|
20
17
|
end: number;
|
|
@@ -24,8 +21,9 @@ export interface RenderedBase {
|
|
|
24
21
|
pos: number;
|
|
25
22
|
chr: string;
|
|
26
23
|
base: string;
|
|
27
|
-
|
|
24
|
+
rowIndex: number;
|
|
28
25
|
isInsertion?: boolean;
|
|
26
|
+
isLargeInsertion?: boolean;
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
29
|
* Shared rendering context containing all necessary parameters for rendering operations
|
|
@@ -33,6 +31,7 @@ export interface RenderedBase {
|
|
|
33
31
|
export interface RenderingContext {
|
|
34
32
|
ctx: CanvasRenderingContext2D;
|
|
35
33
|
scale: number;
|
|
34
|
+
bpPerPx: number;
|
|
36
35
|
canvasWidth: number;
|
|
37
36
|
rowHeight: number;
|
|
38
37
|
h: number;
|
|
@@ -43,6 +42,8 @@ export interface RenderingContext {
|
|
|
43
42
|
showAllLetters: boolean;
|
|
44
43
|
mismatchRendering: boolean;
|
|
45
44
|
showAsUpperCase: boolean;
|
|
45
|
+
charWidth: number;
|
|
46
|
+
charHeight: number;
|
|
46
47
|
spatialIndex: RenderedBase[];
|
|
47
48
|
spatialIndexCoords: number[];
|
|
48
49
|
lastInsertedX: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession, isSessionModelWithWidgets, isSessionWithAddTracks, } from '@jbrowse/core/util';
|
|
4
|
+
import { getRoot } from '@jbrowse/mobx-state-tree';
|
|
4
5
|
import { Button, FormControl, FormControlLabel, FormLabel, Paper, Radio, RadioGroup, TextField, } from '@mui/material';
|
|
5
|
-
import { getRoot } from 'mobx-state-tree';
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
const useStyles = makeStyles()(theme => ({
|
|
8
8
|
textbox: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddTrackWorkflow.js","sourceRoot":"","sources":["../../src/MafAddTrackWorkflow/AddTrackWorkflow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAEL,UAAU,EACV,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AddTrackWorkflow.js","sourceRoot":"","sources":["../../src/MafAddTrackWorkflow/AddTrackWorkflow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC7D,OAAO,EAEL,UAAU,EACV,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EACL,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,KAAK,EACL,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI1C,MAAM,SAAS,GAAG,UAAU,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,OAAO,EAAE;QACP,KAAK,EAAE,MAAM;KACd;IACD,KAAK,EAAE;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oCACvE,cAAc,KAAK,iBAAiB;wCACpC,CAAC,CAAC;4CACE,IAAI,EAAE,cAAc;4CACpB,aAAa,EAAE,GAAG;4CAClB,UAAU,EAAE,KAAK;4CACjB,KAAK,EAAE;gDACL,SAAS,EAAE,eAAe;gDAC1B,QAAQ,EAAE,QAAQ;6CACnB;4CACD,OAAO,EAAE,WAAW;yCACrB;wCACH,CAAC,CAAC;4CACE,IAAI,EAAE,cAAc;4CACpB,aAAa,EAAE,GAAG;4CAClB,WAAW,EAAE,QAAQ;4CACrB,UAAU,EAAE,KAAK;4CACjB,OAAO,EAAE,WAAW;yCACrB;yBACV,CAAC,CAAA;wBAEF,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;oBAChC,CAAC;oBACD,KAAK,CAAC,SAAS,EAAE,CAAA;oBACjB,IAAI,yBAAyB,CAAC,OAAO,CAAC,EAAE,CAAC;wBACvC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;oBAC3B,CAAC;gBACH,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,QAAQ,CAAC,CAAC,CAAC,CAAA;gBACb,CAAC;YACH,CAAC,aAGM,CACH,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AddTrackWorkflowType } from '@jbrowse/core/pluggableElementTypes';
|
|
2
|
-
import { types } from 'mobx-state-tree';
|
|
2
|
+
import { types } from '@jbrowse/mobx-state-tree';
|
|
3
3
|
import MultiMAFWidget from './AddTrackWorkflow';
|
|
4
4
|
export default function MafAddTrackWorkflowF(pluginManager) {
|
|
5
5
|
pluginManager.addAddTrackWorkflowType(() => new AddTrackWorkflowType({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MafAddTrackWorkflow/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MafAddTrackWorkflow/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAEhD,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAE/C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,aAA4B;IACvE,aAAa,CAAC,uBAAuB,CACnC,GAAG,EAAE,CACH,IAAI,oBAAoB,CAAC;QACvB,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,cAAc;QAC9B,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;KAC5B,CAAC,CACL,CAAA;AACH,CAAC"}
|
|
@@ -6,7 +6,7 @@ export default class MafGetSequences extends RpcMethodTypeWithFiltersAndRenameRe
|
|
|
6
6
|
name = 'MafGetSequences';
|
|
7
7
|
async execute(args, rpcDriverClassName) {
|
|
8
8
|
const deserializedArgs = await this.deserializeArguments(args, rpcDriverClassName);
|
|
9
|
-
const { samples, regions, adapterConfig, sessionId, showAllLetters } = deserializedArgs;
|
|
9
|
+
const { samples, regions, adapterConfig, sessionId, showAllLetters, includeInsertions, } = deserializedArgs;
|
|
10
10
|
const dataAdapter = (await getAdapter(this.pluginManager, sessionId, adapterConfig)).dataAdapter;
|
|
11
11
|
const features = await firstValueFrom(dataAdapter.getFeatures(regions[0], deserializedArgs).pipe(toArray()));
|
|
12
12
|
return processFeaturesToFasta({
|
|
@@ -14,6 +14,7 @@ export default class MafGetSequences extends RpcMethodTypeWithFiltersAndRenameRe
|
|
|
14
14
|
samples,
|
|
15
15
|
regions,
|
|
16
16
|
showAllLetters,
|
|
17
|
+
includeInsertions,
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MafGetSequences.js","sourceRoot":"","sources":["../../src/MafGetSequences/MafGetSequences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACzE,OAAO,wCAAwC,MAAM,8EAA8E,CAAA;AACnI,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAO3D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,wCAAwC;IACnF,IAAI,GAAG,iBAAiB,CAAA;IAExB,KAAK,CAAC,OAAO,CACX,
|
|
1
|
+
{"version":3,"file":"MafGetSequences.js","sourceRoot":"","sources":["../../src/MafGetSequences/MafGetSequences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAA;AACzE,OAAO,wCAAwC,MAAM,8EAA8E,CAAA;AACnI,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAO3D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,wCAAwC;IACnF,IAAI,GAAG,iBAAiB,CAAA;IAExB,KAAK,CAAC,OAAO,CACX,IASC,EACD,kBAA0B;QAE1B,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CACtD,IAAI,EACJ,kBAAkB,CACnB,CAAA;QACD,MAAM,EACJ,OAAO,EACP,OAAO,EACP,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,GAClB,GAAG,gBAAgB,CAAA;QACpB,MAAM,WAAW,GAAG,CAClB,MAAM,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,aAAa,CAAC,CAC/D,CAAC,WAAqC,CAAA;QAEvC,MAAM,QAAQ,GAAG,MAAM,cAAc,CACnC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAE,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CACvE,CAAA;QACD,OAAO,sBAAsB,CAAC;YAC5B,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO;YACP,OAAO;YACP,cAAc;YACd,iBAAiB;SAClB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Sample } from '../LinearMafDisplay/types';
|
|
3
|
+
interface LabelsCanvasProps {
|
|
4
|
+
samples: Sample[];
|
|
5
|
+
maxLabelLength: number;
|
|
6
|
+
}
|
|
7
|
+
export default function LabelsCanvas({ samples, maxLabelLength, }: LabelsCanvasProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { useTheme } from '@mui/material';
|
|
3
|
+
import { CHAR_WIDTH, FONT, LABEL_PADDING, ROW_HEIGHT } from './constants';
|
|
4
|
+
export default function LabelsCanvas({ samples, maxLabelLength, }) {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
const canvasRef = useRef(null);
|
|
7
|
+
const labelWidth = maxLabelLength * CHAR_WIDTH + LABEL_PADDING;
|
|
8
|
+
const canvasHeight = samples.length * ROW_HEIGHT;
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const canvas = canvasRef.current;
|
|
11
|
+
if (!canvas) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const ctx = canvas.getContext('2d');
|
|
15
|
+
if (!ctx) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const dpr = window.devicePixelRatio || 1;
|
|
19
|
+
canvas.width = labelWidth * dpr;
|
|
20
|
+
canvas.height = canvasHeight * dpr;
|
|
21
|
+
canvas.style.width = `${labelWidth}px`;
|
|
22
|
+
canvas.style.height = `${canvasHeight}px`;
|
|
23
|
+
ctx.scale(dpr, dpr);
|
|
24
|
+
ctx.fillStyle = theme.palette.background.paper;
|
|
25
|
+
ctx.fillRect(0, 0, labelWidth, canvasHeight);
|
|
26
|
+
ctx.font = FONT;
|
|
27
|
+
ctx.textBaseline = 'top';
|
|
28
|
+
for (let rowIdx = 0; rowIdx < samples.length; rowIdx++) {
|
|
29
|
+
const sample = samples[rowIdx];
|
|
30
|
+
const y = rowIdx * ROW_HEIGHT;
|
|
31
|
+
ctx.fillStyle = theme.palette.text.secondary;
|
|
32
|
+
ctx.fillText(sample.label ?? sample.id, 2, y + 2);
|
|
33
|
+
}
|
|
34
|
+
}, [samples, labelWidth, canvasHeight, theme]);
|
|
35
|
+
return React.createElement("canvas", { ref: canvasRef, style: { display: 'block' } });
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=LabelsCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelsCanvas.js","sourceRoot":"","sources":["../../src/MafSequenceWidget/LabelsCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AASzE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,OAAO,EACP,cAAc,GACI;IAClB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAEjD,MAAM,UAAU,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,CAAA;IAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,CAAA;I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EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;QACnD,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;IAE9C,OAAO,gCAAQ,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAI,CAAA;AAChE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
|
|
3
|
+
declare const MafSequenceHoverHighlight: ({ model, }: {
|
|
4
|
+
model: LinearGenomeViewModel;
|
|
5
|
+
}) => React.JSX.Element | null;
|
|
6
|
+
export default MafSequenceHoverHighlight;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { colord } from '@jbrowse/core/util/colord';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
|
+
highlight: {
|
|
8
|
+
height: '100%',
|
|
9
|
+
position: 'absolute',
|
|
10
|
+
background: colord(theme.palette.primary.main).alpha(0.4).toRgbString(),
|
|
11
|
+
borderLeft: `2px solid ${theme.palette.primary.main}`,
|
|
12
|
+
borderRight: `2px solid ${theme.palette.primary.main}`,
|
|
13
|
+
pointerEvents: 'none',
|
|
14
|
+
zIndex: 10,
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
17
|
+
const MafSequenceHoverHighlight = observer(function MafSequenceHoverHighlight({ model, }) {
|
|
18
|
+
const { classes } = useStyles();
|
|
19
|
+
const session = getSession(model);
|
|
20
|
+
const { assemblyManager } = session;
|
|
21
|
+
// Find MafSequenceWidget instances that are connected to this view
|
|
22
|
+
const widgets = 'widgets' in session ? session.widgets : undefined;
|
|
23
|
+
if (!widgets) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const highlights = [];
|
|
27
|
+
for (const [, widget] of widgets) {
|
|
28
|
+
const w = widget;
|
|
29
|
+
if (w.type === 'MafSequenceWidget' && w.connectedViewId === model.id) {
|
|
30
|
+
const mafWidget = widget;
|
|
31
|
+
const { hoverHighlight } = mafWidget;
|
|
32
|
+
if (hoverHighlight) {
|
|
33
|
+
const { refName, start, end, assemblyName } = hoverHighlight;
|
|
34
|
+
const assembly = assemblyManager.get(assemblyName);
|
|
35
|
+
const canonicalRefName = assembly?.getCanonicalRefName(refName) ?? refName;
|
|
36
|
+
const startPx = model.bpToPx({
|
|
37
|
+
refName: canonicalRefName,
|
|
38
|
+
coord: start,
|
|
39
|
+
});
|
|
40
|
+
const endPx = model.bpToPx({ refName: canonicalRefName, coord: end });
|
|
41
|
+
if (startPx && endPx) {
|
|
42
|
+
const left = Math.min(startPx.offsetPx, endPx.offsetPx) - model.offsetPx;
|
|
43
|
+
const width = Math.max(Math.abs(endPx.offsetPx - startPx.offsetPx), 3);
|
|
44
|
+
highlights.push(React.createElement("div", { key: `maf-hover-${mafWidget.id}`, className: classes.highlight, style: { left, width } }));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return React.createElement(React.Fragment, null, highlights);
|
|
50
|
+
});
|
|
51
|
+
export default MafSequenceHoverHighlight;
|
|
52
|
+
//# sourceMappingURL=MafSequenceHoverHighlight.js.map
|