@jbrowse/plugin-alignments 3.6.4 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +4 -4
- package/dist/CramAdapter/CramAdapter.js +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +8 -7
- package/dist/CramAdapter/{util.js → readFeaturesToCIGAR.js} +4 -5
- package/dist/CramAdapter/readFeaturesToMismatches.d.ts +5 -0
- package/dist/CramAdapter/readFeaturesToMismatches.js +106 -0
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +6 -2
- package/dist/LinearAlignmentsDisplay/model.js +3 -2
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +17 -2
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +2 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +4 -4
- package/dist/LinearPileupDisplay/components/SetModificationThresholdDialog.d.ts +10 -0
- package/dist/LinearPileupDisplay/components/SetModificationThresholdDialog.js +39 -0
- package/dist/LinearPileupDisplay/doAfterAttach.d.ts +1 -0
- package/dist/LinearPileupDisplay/doAfterAttach.js +3 -2
- package/dist/LinearPileupDisplay/model.d.ts +20 -2
- package/dist/LinearPileupDisplay/model.js +39 -4
- package/dist/LinearReadArcsDisplay/index.js +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +23 -30
- package/dist/LinearReadArcsDisplay/model.js +5 -86
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +84 -2
- package/dist/LinearReadCloudDisplay/components/SetFeatureHeightDialog.d.ts +10 -0
- package/dist/LinearReadCloudDisplay/components/SetFeatureHeightDialog.js +26 -0
- package/dist/LinearReadCloudDisplay/configSchema.d.ts +7 -0
- package/dist/LinearReadCloudDisplay/configSchema.js +5 -0
- package/dist/LinearReadCloudDisplay/drawFeatsAbstract.js +13 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCloud.js +24 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCommon.d.ts +23 -0
- package/dist/LinearReadCloudDisplay/drawFeatsCommon.js +198 -0
- package/dist/LinearReadCloudDisplay/drawFeatsStack.d.ts +2 -0
- package/dist/LinearReadCloudDisplay/drawFeatsStack.js +36 -0
- package/dist/LinearReadCloudDisplay/index.js +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +51 -31
- package/dist/LinearReadCloudDisplay/model.js +93 -78
- package/dist/LinearSNPCoverageDisplay/components/TooltipContents.d.ts +3 -0
- package/dist/LinearSNPCoverageDisplay/components/TooltipContents.js +148 -19
- package/dist/LinearSNPCoverageDisplay/model.js +14 -3
- package/dist/MismatchParser/cigarToMismatches.js +1 -0
- package/dist/ModificationParser/detectSimplexModifications.d.ts +4 -0
- package/dist/ModificationParser/detectSimplexModifications.js +20 -0
- package/dist/ModificationParser/getModPositions.d.ts +1 -1
- package/dist/ModificationParser/getModPositions.js +13 -16
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +4 -1
- package/dist/PileupRPC/methods/GetVisibleModifications.js +16 -3
- package/dist/PileupRenderer/PileupRenderer.d.ts +6 -1
- package/dist/PileupRenderer/PileupRenderer.js +11 -14
- package/dist/PileupRenderer/components/PileupRendering.d.ts +8 -15
- package/dist/PileupRenderer/components/PileupRendering.js +18 -2
- package/dist/PileupRenderer/makeImageData.d.ts +5 -2
- package/dist/PileupRenderer/makeImageData.js +37 -6
- package/dist/PileupRenderer/{getAlignmentShapeColor.js → renderers/getAlignmentShapeColor.js} +2 -2
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderAlignment.d.ts +6 -3
- package/dist/PileupRenderer/{renderAlignment.js → renderers/renderAlignment.js} +12 -3
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderAlignmentShape.d.ts +2 -2
- package/dist/PileupRenderer/{renderAlignmentShape.js → renderers/renderAlignmentShape.js} +1 -1
- package/dist/PileupRenderer/{renderMethylation.d.ts → renderers/renderMethylation.d.ts} +2 -2
- package/dist/PileupRenderer/{renderMethylation.js → renderers/renderMethylation.js} +2 -2
- package/dist/PileupRenderer/{renderMismatches.d.ts → renderers/renderMismatches.d.ts} +6 -3
- package/dist/PileupRenderer/{renderMismatches.js → renderers/renderMismatches.js} +29 -5
- package/dist/PileupRenderer/{renderModifications.d.ts → renderers/renderModifications.d.ts} +6 -3
- package/dist/PileupRenderer/renderers/renderModifications.js +84 -0
- package/dist/PileupRenderer/{renderPerBaseLettering.d.ts → renderers/renderPerBaseLettering.d.ts} +1 -1
- package/dist/PileupRenderer/{renderPerBaseLettering.js → renderers/renderPerBaseLettering.js} +1 -1
- package/{esm/PileupRenderer → dist/PileupRenderer/renderers}/renderPerBaseQuality.d.ts +1 -1
- package/dist/PileupRenderer/{renderPerBaseQuality.js → renderers/renderPerBaseQuality.js} +1 -1
- package/dist/PileupRenderer/{renderSoftClipping.d.ts → renderers/renderSoftClipping.d.ts} +2 -2
- package/dist/PileupRenderer/{renderSoftClipping.js → renderers/renderSoftClipping.js} +2 -2
- package/dist/PileupRenderer/types.d.ts +6 -0
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +5 -4
- package/dist/SNPCoverageAdapter/processModifications.js +14 -4
- package/dist/SNPCoverageRenderer/makeImage.js +44 -33
- package/dist/SNPCoverageRenderer/types.d.ts +1 -0
- package/dist/shared/LinearReadDisplayBaseMixin.d.ts +24 -0
- package/dist/shared/LinearReadDisplayBaseMixin.js +50 -0
- package/dist/shared/LinearReadDisplayWithLayoutMixin.d.ts +11 -0
- package/dist/shared/LinearReadDisplayWithLayoutMixin.js +24 -0
- package/dist/shared/LinearReadDisplayWithPairFiltersMixin.d.ts +11 -0
- package/dist/shared/LinearReadDisplayWithPairFiltersMixin.js +27 -0
- package/dist/shared/afterAttach.js +3 -2
- package/dist/shared/chainToSimpleFeature.d.ts +3 -0
- package/dist/shared/chainToSimpleFeature.js +43 -0
- package/dist/shared/chevron.d.ts +1 -0
- package/dist/shared/chevron.js +27 -0
- package/dist/shared/color.d.ts +43 -6
- package/dist/shared/color.js +101 -22
- package/dist/shared/components/BaseDisplayComponent.d.ts +12 -3
- package/dist/shared/components/BaseDisplayComponent.js +2 -2
- package/dist/shared/components/SetFeatureHeightDialog.d.ts +10 -0
- package/dist/shared/components/SetFeatureHeightDialog.js +26 -0
- package/dist/shared/components/SetMaxHeightDialog.d.ts +8 -0
- package/dist/shared/components/SetMaxHeightDialog.js +28 -0
- package/dist/shared/drawLongReadChains.d.ts +24 -0
- package/dist/shared/drawLongReadChains.js +104 -0
- package/dist/shared/drawPairChains.d.ts +24 -0
- package/dist/shared/drawPairChains.js +94 -0
- package/dist/shared/flatbushType.d.ts +12 -0
- package/dist/shared/flatbushType.js +2 -0
- package/dist/shared/getUniqueModifications.d.ts +4 -1
- package/dist/shared/menuItems.d.ts +23 -0
- package/dist/shared/menuItems.js +89 -0
- package/dist/shared/modificationData.d.ts +6 -0
- package/dist/shared/modificationData.js +22 -0
- package/dist/shared/primaryStrand.d.ts +3 -0
- package/dist/shared/primaryStrand.js +24 -0
- package/dist/shared/types.d.ts +2 -0
- package/dist/shared/util.d.ts +2 -0
- package/dist/shared/util.js +6 -1
- package/dist/util.d.ts +1 -6
- package/dist/util.js +4 -15
- package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +4 -4
- package/esm/CramAdapter/CramAdapter.js +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +2 -1
- package/esm/CramAdapter/{util.js → readFeaturesToCIGAR.js} +4 -5
- package/esm/CramAdapter/readFeaturesToMismatches.d.ts +5 -0
- package/esm/CramAdapter/readFeaturesToMismatches.js +103 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +6 -2
- package/esm/LinearAlignmentsDisplay/model.js +3 -2
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +17 -2
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +2 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +4 -4
- package/esm/LinearPileupDisplay/components/SetModificationThresholdDialog.d.ts +10 -0
- package/esm/LinearPileupDisplay/components/SetModificationThresholdDialog.js +37 -0
- package/esm/LinearPileupDisplay/doAfterAttach.d.ts +1 -0
- package/esm/LinearPileupDisplay/doAfterAttach.js +3 -2
- package/esm/LinearPileupDisplay/model.d.ts +20 -2
- package/esm/LinearPileupDisplay/model.js +39 -4
- package/esm/LinearReadArcsDisplay/index.js +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +23 -30
- package/esm/LinearReadArcsDisplay/model.js +5 -83
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +86 -4
- package/esm/LinearReadCloudDisplay/components/SetFeatureHeightDialog.d.ts +10 -0
- package/esm/LinearReadCloudDisplay/components/SetFeatureHeightDialog.js +24 -0
- package/esm/LinearReadCloudDisplay/configSchema.d.ts +7 -0
- package/esm/LinearReadCloudDisplay/configSchema.js +5 -0
- package/esm/LinearReadCloudDisplay/drawFeatsAbstract.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsAbstract.js +10 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCloud.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCloud.js +21 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCommon.d.ts +23 -0
- package/esm/LinearReadCloudDisplay/drawFeatsCommon.js +187 -0
- package/esm/LinearReadCloudDisplay/drawFeatsStack.d.ts +2 -0
- package/esm/LinearReadCloudDisplay/drawFeatsStack.js +30 -0
- package/esm/LinearReadCloudDisplay/index.js +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +51 -31
- package/esm/LinearReadCloudDisplay/model.js +94 -76
- package/esm/LinearSNPCoverageDisplay/components/TooltipContents.d.ts +3 -0
- package/esm/LinearSNPCoverageDisplay/components/TooltipContents.js +149 -20
- package/esm/LinearSNPCoverageDisplay/model.js +14 -3
- package/esm/MismatchParser/cigarToMismatches.js +1 -0
- package/esm/ModificationParser/detectSimplexModifications.d.ts +4 -0
- package/esm/ModificationParser/detectSimplexModifications.js +17 -0
- package/esm/ModificationParser/getModPositions.d.ts +1 -1
- package/esm/ModificationParser/getModPositions.js +13 -16
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +4 -1
- package/esm/PileupRPC/methods/GetVisibleModifications.js +16 -3
- package/esm/PileupRenderer/PileupRenderer.d.ts +6 -1
- package/esm/PileupRenderer/PileupRenderer.js +11 -14
- package/esm/PileupRenderer/components/PileupRendering.d.ts +8 -15
- package/esm/PileupRenderer/components/PileupRendering.js +16 -3
- package/esm/PileupRenderer/makeImageData.d.ts +5 -2
- package/esm/PileupRenderer/makeImageData.js +34 -6
- package/esm/PileupRenderer/{getAlignmentShapeColor.js → renderers/getAlignmentShapeColor.js} +2 -2
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderAlignment.d.ts +6 -3
- package/esm/PileupRenderer/{renderAlignment.js → renderers/renderAlignment.js} +12 -3
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderAlignmentShape.d.ts +2 -2
- package/esm/PileupRenderer/{renderAlignmentShape.js → renderers/renderAlignmentShape.js} +1 -1
- package/esm/PileupRenderer/{renderMethylation.d.ts → renderers/renderMethylation.d.ts} +2 -2
- package/esm/PileupRenderer/{renderMethylation.js → renderers/renderMethylation.js} +2 -2
- package/esm/PileupRenderer/{renderMismatches.d.ts → renderers/renderMismatches.d.ts} +6 -3
- package/esm/PileupRenderer/{renderMismatches.js → renderers/renderMismatches.js} +29 -5
- package/esm/PileupRenderer/{renderModifications.d.ts → renderers/renderModifications.d.ts} +6 -3
- package/esm/PileupRenderer/renderers/renderModifications.js +81 -0
- package/esm/PileupRenderer/{renderPerBaseLettering.d.ts → renderers/renderPerBaseLettering.d.ts} +1 -1
- package/esm/PileupRenderer/{renderPerBaseLettering.js → renderers/renderPerBaseLettering.js} +1 -1
- package/{dist/PileupRenderer → esm/PileupRenderer/renderers}/renderPerBaseQuality.d.ts +1 -1
- package/esm/PileupRenderer/{renderPerBaseQuality.js → renderers/renderPerBaseQuality.js} +1 -1
- package/esm/PileupRenderer/{renderSoftClipping.d.ts → renderers/renderSoftClipping.d.ts} +2 -2
- package/esm/PileupRenderer/{renderSoftClipping.js → renderers/renderSoftClipping.js} +2 -2
- package/esm/PileupRenderer/types.d.ts +6 -0
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +5 -4
- package/esm/SNPCoverageAdapter/processModifications.js +14 -4
- package/esm/SNPCoverageRenderer/makeImage.js +44 -33
- package/esm/SNPCoverageRenderer/types.d.ts +1 -0
- package/esm/shared/LinearReadDisplayBaseMixin.d.ts +24 -0
- package/esm/shared/LinearReadDisplayBaseMixin.js +47 -0
- package/esm/shared/LinearReadDisplayWithLayoutMixin.d.ts +11 -0
- package/esm/shared/LinearReadDisplayWithLayoutMixin.js +21 -0
- package/esm/shared/LinearReadDisplayWithPairFiltersMixin.d.ts +11 -0
- package/esm/shared/LinearReadDisplayWithPairFiltersMixin.js +24 -0
- package/esm/shared/afterAttach.js +3 -2
- package/esm/shared/chainToSimpleFeature.d.ts +3 -0
- package/esm/shared/chainToSimpleFeature.js +40 -0
- package/esm/shared/chevron.d.ts +1 -0
- package/esm/shared/chevron.js +24 -0
- package/esm/shared/color.d.ts +43 -6
- package/esm/shared/color.js +96 -20
- package/esm/shared/components/BaseDisplayComponent.d.ts +12 -3
- package/esm/shared/components/BaseDisplayComponent.js +2 -2
- package/esm/shared/components/SetFeatureHeightDialog.d.ts +10 -0
- package/esm/shared/components/SetFeatureHeightDialog.js +24 -0
- package/esm/shared/components/SetMaxHeightDialog.d.ts +8 -0
- package/esm/shared/components/SetMaxHeightDialog.js +26 -0
- package/esm/shared/drawLongReadChains.d.ts +24 -0
- package/esm/shared/drawLongReadChains.js +101 -0
- package/esm/shared/drawPairChains.d.ts +24 -0
- package/esm/shared/drawPairChains.js +91 -0
- package/esm/shared/flatbushType.d.ts +12 -0
- package/esm/shared/flatbushType.js +1 -0
- package/esm/shared/getUniqueModifications.d.ts +4 -1
- package/esm/shared/menuItems.d.ts +23 -0
- package/esm/shared/menuItems.js +49 -0
- package/esm/shared/modificationData.d.ts +6 -0
- package/esm/shared/modificationData.js +18 -0
- package/esm/shared/primaryStrand.d.ts +3 -0
- package/esm/shared/primaryStrand.js +20 -0
- package/esm/shared/types.d.ts +2 -0
- package/esm/shared/util.d.ts +2 -0
- package/esm/shared/util.js +4 -0
- package/esm/util.d.ts +1 -6
- package/esm/util.js +2 -14
- package/package.json +6 -6
- package/dist/LinearReadCloudDisplay/drawFeats.js +0 -27
- package/dist/LinearReadCloudDisplay/drawLongReadChains.d.ts +0 -11
- package/dist/LinearReadCloudDisplay/drawLongReadChains.js +0 -64
- package/dist/LinearReadCloudDisplay/drawPairChains.d.ts +0 -17
- package/dist/LinearReadCloudDisplay/drawPairChains.js +0 -94
- package/dist/PileupRenderer/renderModifications.js +0 -44
- package/esm/LinearReadCloudDisplay/drawFeats.js +0 -24
- package/esm/LinearReadCloudDisplay/drawLongReadChains.d.ts +0 -11
- package/esm/LinearReadCloudDisplay/drawLongReadChains.js +0 -61
- package/esm/LinearReadCloudDisplay/drawPairChains.d.ts +0 -17
- package/esm/LinearReadCloudDisplay/drawPairChains.js +0 -90
- package/esm/PileupRenderer/renderModifications.js +0 -41
- /package/dist/CramAdapter/{util.d.ts → readFeaturesToCIGAR.d.ts} +0 -0
- /package/dist/LinearReadCloudDisplay/{drawFeats.d.ts → drawFeatsAbstract.d.ts} +0 -0
- /package/{esm/LinearReadCloudDisplay/drawFeats.d.ts → dist/LinearReadCloudDisplay/drawFeatsCloud.d.ts} +0 -0
- /package/dist/PileupRenderer/{getAlignmentShapeColor.d.ts → renderers/getAlignmentShapeColor.d.ts} +0 -0
- /package/dist/{LinearReadCloudDisplay/util.d.ts → shared/canvasUtils.d.ts} +0 -0
- /package/dist/{LinearReadCloudDisplay/util.js → shared/canvasUtils.js} +0 -0
- /package/esm/CramAdapter/{util.d.ts → readFeaturesToCIGAR.d.ts} +0 -0
- /package/esm/PileupRenderer/{getAlignmentShapeColor.d.ts → renderers/getAlignmentShapeColor.d.ts} +0 -0
- /package/esm/{LinearReadCloudDisplay/util.d.ts → shared/canvasUtils.d.ts} +0 -0
- /package/esm/{LinearReadCloudDisplay/util.js → shared/canvasUtils.js} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { ColorBy, FilterBy } from '../shared/types';
|
|
2
|
+
import type { ReducedFeature } from '../shared/fetchChains';
|
|
4
3
|
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
5
4
|
import type { Instance } from 'mobx-state-tree';
|
|
6
5
|
declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
@@ -12,12 +11,20 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
12
11
|
} & {
|
|
13
12
|
userBpPerPxLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
14
13
|
userByteSizeLimit: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
14
|
+
} & {
|
|
15
|
+
filterBySetting: import("mobx-state-tree").IType<import("../shared/types").FilterBy | undefined, import("../shared/types").FilterBy | undefined, import("../shared/types").FilterBy | undefined>;
|
|
16
|
+
colorBySetting: import("mobx-state-tree").IType<import("../shared/types").ColorBy | undefined, import("../shared/types").ColorBy | undefined, import("../shared/types").ColorBy | undefined>;
|
|
17
|
+
} & {
|
|
18
|
+
drawSingletons: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
19
|
+
drawProperPairs: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
20
|
+
flipStrandLongReadChains: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
21
|
+
featureHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
15
22
|
} & {
|
|
16
23
|
type: import("mobx-state-tree").ISimpleType<"LinearReadCloudDisplay">;
|
|
17
24
|
configuration: AnyConfigurationSchemaType;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
drawCloud: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
26
|
+
noSpacing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
27
|
+
trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
21
28
|
}, {
|
|
22
29
|
rendererTypeName: string;
|
|
23
30
|
error: unknown;
|
|
@@ -112,57 +119,70 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
112
119
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react/jsx-runtime").JSX.Element | null;
|
|
113
120
|
} & {
|
|
114
121
|
loading: boolean;
|
|
115
|
-
chainData: ChainData | undefined;
|
|
122
|
+
chainData: import("../shared/fetchChains").ChainData | undefined;
|
|
116
123
|
lastDrawnOffsetPx: number | undefined;
|
|
117
124
|
lastDrawnBpPerPx: number;
|
|
118
125
|
ref: HTMLCanvasElement | null;
|
|
119
126
|
} & {
|
|
120
|
-
readonly colorBy: any;
|
|
121
|
-
readonly filterBy: any;
|
|
122
|
-
} & {
|
|
123
|
-
setDrawSingletons(f: boolean): void;
|
|
124
127
|
setLastDrawnOffsetPx(n: number): void;
|
|
125
128
|
setLastDrawnBpPerPx(n: number): void;
|
|
126
129
|
setLoading(f: boolean): void;
|
|
127
|
-
reload(): void;
|
|
128
130
|
setRef(ref: HTMLCanvasElement | null): void;
|
|
129
131
|
setColorScheme(colorBy: {
|
|
130
132
|
type: string;
|
|
131
133
|
}): void;
|
|
132
|
-
setChainData(args: ChainData): void;
|
|
133
|
-
setFilterBy(filter: FilterBy): void;
|
|
134
|
+
setChainData(args: import("../shared/fetchChains").ChainData): void;
|
|
135
|
+
setFilterBy(filter: import("../shared/types").FilterBy): void;
|
|
134
136
|
} & {
|
|
135
137
|
readonly drawn: boolean;
|
|
138
|
+
} & {
|
|
139
|
+
featureLayout: import("@jbrowse/core/util/flatbush").default | undefined;
|
|
140
|
+
mouseoverRef: HTMLCanvasElement | null;
|
|
141
|
+
featuresForFlatbush: import("../shared/flatbushType").FlatbushEntry[];
|
|
142
|
+
} & {
|
|
143
|
+
setFeatureLayout(layout: import("@jbrowse/core/util/flatbush").default): void;
|
|
144
|
+
setMouseoverRef(ref: HTMLCanvasElement | null): void;
|
|
145
|
+
setFeaturesForFlatbush(features: import("../shared/flatbushType").FlatbushEntry[]): void;
|
|
146
|
+
} & {
|
|
147
|
+
setDrawSingletons(f: boolean): void;
|
|
148
|
+
setDrawProperPairs(f: boolean): void;
|
|
149
|
+
setFlipStrandLongReadChains(f: boolean): void;
|
|
150
|
+
setFeatureHeight(n?: number): void;
|
|
151
|
+
} & {
|
|
152
|
+
layoutHeight: number;
|
|
153
|
+
} & {
|
|
154
|
+
readonly colorBy: any;
|
|
155
|
+
readonly filterBy: any;
|
|
156
|
+
readonly featureHeightSetting: any;
|
|
157
|
+
} & {
|
|
158
|
+
reload(): void;
|
|
159
|
+
setNoSpacing(flag?: boolean): void;
|
|
160
|
+
setMaxHeight(n?: number): void;
|
|
161
|
+
setLayoutHeight(n: number): void;
|
|
162
|
+
selectFeature(chain: ReducedFeature[]): void;
|
|
163
|
+
setDrawCloud(b: boolean): void;
|
|
136
164
|
} & {
|
|
137
165
|
renderProps(): any;
|
|
138
166
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
139
|
-
label: string;
|
|
140
|
-
type: string;
|
|
141
|
-
checked: boolean;
|
|
142
|
-
onClick: () => void;
|
|
143
|
-
icon?: undefined;
|
|
144
|
-
subMenu?: undefined;
|
|
145
|
-
} | {
|
|
146
167
|
label: string;
|
|
147
168
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
148
169
|
muiName: string;
|
|
149
170
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
171
|
+
subMenu: {
|
|
172
|
+
label: string;
|
|
173
|
+
onClick: () => void;
|
|
174
|
+
}[];
|
|
154
175
|
} | {
|
|
155
176
|
label: string;
|
|
156
177
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
157
178
|
muiName: string;
|
|
158
179
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
onClick?: undefined;
|
|
180
|
+
onClick: () => void;
|
|
181
|
+
} | {
|
|
182
|
+
label: string;
|
|
183
|
+
type: string;
|
|
184
|
+
checked: boolean;
|
|
185
|
+
onClick: () => void;
|
|
166
186
|
})[];
|
|
167
187
|
renderSvg(opts: {
|
|
168
188
|
rasterizeLayers?: boolean;
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
|
|
3
3
|
import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes';
|
|
4
|
-
import { getSession } from '@jbrowse/core/util';
|
|
4
|
+
import { getContainingTrack, getContainingView, getSession, isSessionModelWithWidgets, } from '@jbrowse/core/util';
|
|
5
5
|
import { FeatureDensityMixin, TrackHeightMixin, } from '@jbrowse/plugin-linear-genome-view';
|
|
6
|
-
import FilterListIcon from '@mui/icons-material/ClearAll';
|
|
7
|
-
import PaletteIcon from '@mui/icons-material/Palette';
|
|
8
6
|
import { types } from 'mobx-state-tree';
|
|
9
|
-
|
|
7
|
+
import { LinearReadDisplayBaseMixin } from '../shared/LinearReadDisplayBaseMixin';
|
|
8
|
+
import { LinearReadDisplayWithLayoutMixin } from '../shared/LinearReadDisplayWithLayoutMixin';
|
|
9
|
+
import { LinearReadDisplayWithPairFiltersMixin } from '../shared/LinearReadDisplayWithPairFiltersMixin';
|
|
10
|
+
import { chainToSimpleFeature } from '../shared/chainToSimpleFeature';
|
|
11
|
+
import { getColorSchemeMenuItem, getFilterByMenuItem, } from '../shared/menuItems';
|
|
12
|
+
const SetFeatureHeightDialog = lazy(() => import('./components/SetFeatureHeightDialog'));
|
|
10
13
|
function stateModelFactory(configSchema) {
|
|
11
14
|
return types
|
|
12
|
-
.compose('LinearReadCloudDisplay', BaseDisplay, TrackHeightMixin(), FeatureDensityMixin(), types.model({
|
|
15
|
+
.compose('LinearReadCloudDisplay', BaseDisplay, TrackHeightMixin(), FeatureDensityMixin(), LinearReadDisplayBaseMixin(), LinearReadDisplayWithLayoutMixin(), LinearReadDisplayWithPairFiltersMixin(), types.model({
|
|
13
16
|
type: types.literal('LinearReadCloudDisplay'),
|
|
14
17
|
configuration: ConfigurationReference(configSchema),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
drawCloud: false,
|
|
19
|
+
noSpacing: types.maybe(types.boolean),
|
|
20
|
+
trackMaxHeight: types.maybe(types.number),
|
|
18
21
|
}))
|
|
19
22
|
.volatile(() => ({
|
|
20
|
-
|
|
21
|
-
chainData: undefined,
|
|
22
|
-
lastDrawnOffsetPx: undefined,
|
|
23
|
-
lastDrawnBpPerPx: 0,
|
|
24
|
-
ref: null,
|
|
23
|
+
layoutHeight: 0,
|
|
25
24
|
}))
|
|
26
25
|
.views(self => ({
|
|
27
26
|
get colorBy() {
|
|
@@ -32,43 +31,39 @@ function stateModelFactory(configSchema) {
|
|
|
32
31
|
var _a;
|
|
33
32
|
return (_a = self.filterBySetting) !== null && _a !== void 0 ? _a : getConf(self, 'filterBy');
|
|
34
33
|
},
|
|
34
|
+
get featureHeightSetting() {
|
|
35
|
+
var _a;
|
|
36
|
+
return (_a = self.featureHeight) !== null && _a !== void 0 ? _a : getConf(self, 'featureHeight');
|
|
37
|
+
},
|
|
35
38
|
}))
|
|
36
39
|
.actions(self => ({
|
|
37
|
-
setDrawSingletons(f) {
|
|
38
|
-
self.drawSingletons = f;
|
|
39
|
-
},
|
|
40
|
-
setLastDrawnOffsetPx(n) {
|
|
41
|
-
self.lastDrawnOffsetPx = n;
|
|
42
|
-
},
|
|
43
|
-
setLastDrawnBpPerPx(n) {
|
|
44
|
-
self.lastDrawnBpPerPx = n;
|
|
45
|
-
},
|
|
46
|
-
setLoading(f) {
|
|
47
|
-
self.loading = f;
|
|
48
|
-
},
|
|
49
40
|
reload() {
|
|
50
41
|
self.error = undefined;
|
|
51
42
|
},
|
|
52
|
-
|
|
53
|
-
self.
|
|
43
|
+
setNoSpacing(flag) {
|
|
44
|
+
self.noSpacing = flag;
|
|
54
45
|
},
|
|
55
|
-
|
|
56
|
-
self.
|
|
57
|
-
...colorBy,
|
|
58
|
-
};
|
|
46
|
+
setMaxHeight(n) {
|
|
47
|
+
self.trackMaxHeight = n;
|
|
59
48
|
},
|
|
60
|
-
|
|
61
|
-
self.
|
|
49
|
+
setLayoutHeight(n) {
|
|
50
|
+
self.layoutHeight = n;
|
|
62
51
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
selectFeature(chain) {
|
|
53
|
+
const session = getSession(self);
|
|
54
|
+
const syntheticFeature = chainToSimpleFeature(chain);
|
|
55
|
+
if (isSessionModelWithWidgets(session)) {
|
|
56
|
+
const featureWidget = session.addWidget('AlignmentsFeatureWidget', 'alignmentFeature', {
|
|
57
|
+
featureData: syntheticFeature.toJSON(),
|
|
58
|
+
view: getContainingView(self),
|
|
59
|
+
track: getContainingTrack(self),
|
|
60
|
+
});
|
|
61
|
+
session.showWidget(featureWidget);
|
|
62
|
+
}
|
|
63
|
+
session.setSelection(syntheticFeature);
|
|
67
64
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
get drawn() {
|
|
71
|
-
return self.lastDrawnOffsetPx !== undefined;
|
|
65
|
+
setDrawCloud(b) {
|
|
66
|
+
self.drawCloud = b;
|
|
72
67
|
},
|
|
73
68
|
}))
|
|
74
69
|
.views(self => {
|
|
@@ -84,59 +79,82 @@ function stateModelFactory(configSchema) {
|
|
|
84
79
|
return [
|
|
85
80
|
...superTrackMenuItems(),
|
|
86
81
|
{
|
|
87
|
-
label: '
|
|
88
|
-
type: 'checkbox',
|
|
89
|
-
checked: self.drawSingletons,
|
|
90
|
-
onClick: () => {
|
|
91
|
-
self.setDrawSingletons(!self.drawSingletons);
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: 'Filter by',
|
|
96
|
-
icon: FilterListIcon,
|
|
97
|
-
onClick: () => {
|
|
98
|
-
getSession(self).queueDialog(handleClose => [
|
|
99
|
-
FilterByTagDialog,
|
|
100
|
-
{ model: self, handleClose },
|
|
101
|
-
]);
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: 'Color scheme',
|
|
106
|
-
icon: PaletteIcon,
|
|
82
|
+
label: 'Set feature height...',
|
|
107
83
|
subMenu: [
|
|
108
84
|
{
|
|
109
|
-
label: '
|
|
110
|
-
onClick: () => {
|
|
111
|
-
self.setColorScheme({ type: 'insertSizeAndOrientation' });
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
label: 'Insert size ± 3σ',
|
|
85
|
+
label: 'Normal',
|
|
116
86
|
onClick: () => {
|
|
117
|
-
self.
|
|
87
|
+
self.setFeatureHeight(7);
|
|
88
|
+
self.setNoSpacing(false);
|
|
118
89
|
},
|
|
119
90
|
},
|
|
120
91
|
{
|
|
121
|
-
label: '
|
|
92
|
+
label: 'Compact',
|
|
122
93
|
onClick: () => {
|
|
123
|
-
self.
|
|
94
|
+
self.setFeatureHeight(3);
|
|
95
|
+
self.setNoSpacing(true);
|
|
124
96
|
},
|
|
125
97
|
},
|
|
126
98
|
{
|
|
127
|
-
label: '
|
|
99
|
+
label: 'Manually set height...',
|
|
128
100
|
onClick: () => {
|
|
129
|
-
self.
|
|
101
|
+
getSession(self).queueDialog(handleClose => [
|
|
102
|
+
SetFeatureHeightDialog,
|
|
103
|
+
{
|
|
104
|
+
model: self,
|
|
105
|
+
handleClose,
|
|
106
|
+
},
|
|
107
|
+
]);
|
|
130
108
|
},
|
|
131
109
|
},
|
|
132
110
|
],
|
|
133
111
|
},
|
|
112
|
+
{
|
|
113
|
+
label: 'Toggle read cloud (y-coordinate proportional to TLEN)',
|
|
114
|
+
type: 'checkbox',
|
|
115
|
+
checked: self.drawCloud,
|
|
116
|
+
onClick: () => {
|
|
117
|
+
self.setDrawCloud(!self.drawCloud);
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'Draw singletons',
|
|
122
|
+
type: 'checkbox',
|
|
123
|
+
checked: self.drawSingletons,
|
|
124
|
+
onClick: () => {
|
|
125
|
+
self.setDrawSingletons(!self.drawSingletons);
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: 'Draw proper pairs',
|
|
130
|
+
type: 'checkbox',
|
|
131
|
+
checked: self.drawProperPairs,
|
|
132
|
+
onClick: () => {
|
|
133
|
+
self.setDrawProperPairs(!self.drawProperPairs);
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
label: 'Flip strand relative to primary alignment for long read chains',
|
|
138
|
+
type: 'checkbox',
|
|
139
|
+
checked: self.flipStrandLongReadChains,
|
|
140
|
+
onClick: () => {
|
|
141
|
+
self.setFlipStrandLongReadChains(!self.flipStrandLongReadChains);
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
getFilterByMenuItem(self),
|
|
145
|
+
getColorSchemeMenuItem(self),
|
|
134
146
|
];
|
|
135
147
|
},
|
|
136
148
|
async renderSvg(opts) {
|
|
137
149
|
const { renderSvg } = await import('../shared/renderSvgUtil');
|
|
138
|
-
|
|
139
|
-
|
|
150
|
+
if (self.drawCloud) {
|
|
151
|
+
const { drawFeats } = await import('./drawFeatsCloud');
|
|
152
|
+
return renderSvg(self, opts, drawFeats);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const { drawFeats } = await import('./drawFeatsStack');
|
|
156
|
+
return renderSvg(self, opts, drawFeats);
|
|
157
|
+
}
|
|
140
158
|
},
|
|
141
159
|
};
|
|
142
160
|
})
|
|
@@ -146,7 +164,7 @@ function stateModelFactory(configSchema) {
|
|
|
146
164
|
(async () => {
|
|
147
165
|
try {
|
|
148
166
|
const { doAfterAttach } = await import('../shared/afterAttach');
|
|
149
|
-
const { drawFeats } = await import('./
|
|
167
|
+
const { drawFeats } = await import('./drawFeatsAbstract');
|
|
150
168
|
doAfterAttach(self, drawFeats);
|
|
151
169
|
}
|
|
152
170
|
catch (e) {
|
|
@@ -4,7 +4,10 @@ interface Props {
|
|
|
4
4
|
model: {
|
|
5
5
|
visibleModifications: Map<string, {
|
|
6
6
|
color: string;
|
|
7
|
+
base: string;
|
|
8
|
+
strand: string;
|
|
7
9
|
}>;
|
|
10
|
+
simplexModifications?: Set<string>;
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
13
|
declare const TooltipContents: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,22 +1,160 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { toLocale } from '@jbrowse/core/util';
|
|
4
4
|
import { makeStyles } from 'tss-react/mui';
|
|
5
|
+
import { getModificationName } from '../../shared/modificationData';
|
|
5
6
|
const useStyles = makeStyles()(() => ({
|
|
6
7
|
td: {
|
|
7
8
|
whiteSpace: 'nowrap',
|
|
8
9
|
},
|
|
10
|
+
table: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
tableLayout: 'auto',
|
|
13
|
+
},
|
|
9
14
|
}));
|
|
10
|
-
const toP = (s = 0) => +
|
|
15
|
+
const toP = (s = 0) => +s.toFixed(1);
|
|
11
16
|
const pct = (n, total = 1) => `${toP((n / (total || 1)) * 100)}%`;
|
|
12
|
-
function
|
|
17
|
+
function getModificationColor(base, model) {
|
|
13
18
|
var _a;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
if (!base.startsWith('mod_') && !base.startsWith('nonmod_')) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (base.startsWith('nonmod_')) {
|
|
23
|
+
return 'blue';
|
|
24
|
+
}
|
|
25
|
+
return (_a = model.visibleModifications.get(base.replace(/^mod_/, ''))) === null || _a === void 0 ? void 0 : _a.color;
|
|
26
|
+
}
|
|
27
|
+
function isModification(base) {
|
|
28
|
+
return base.startsWith('mod_') || base.startsWith('nonmod_');
|
|
29
|
+
}
|
|
30
|
+
function getModificationType(base) {
|
|
31
|
+
return base.replace(/^(mod_|nonmod_)/, '');
|
|
32
|
+
}
|
|
33
|
+
function formatStrandCounts(score) {
|
|
34
|
+
const neg = score['-1'] ? `${score['-1']}(-)` : '';
|
|
35
|
+
const pos = score['1'] ? `${score['1']}(+)` : '';
|
|
36
|
+
return neg + pos;
|
|
37
|
+
}
|
|
38
|
+
function shouldShowPercentage(base) {
|
|
39
|
+
return base !== 'depth' && base !== 'skip';
|
|
40
|
+
}
|
|
41
|
+
function getModificationLabel(base, model) {
|
|
42
|
+
const isNonmod = base.startsWith('nonmod_');
|
|
43
|
+
if (isNonmod) {
|
|
44
|
+
const genomicBase = base.replace('nonmod_', '');
|
|
45
|
+
return `Unmodified ${genomicBase}`;
|
|
46
|
+
}
|
|
47
|
+
const modType = getModificationType(base);
|
|
48
|
+
const mod = model.visibleModifications.get(modType);
|
|
49
|
+
if (mod) {
|
|
50
|
+
const modName = getModificationName(modType);
|
|
51
|
+
return modName;
|
|
52
|
+
}
|
|
53
|
+
return base.toUpperCase();
|
|
54
|
+
}
|
|
55
|
+
function getDuplexModificationLabel(base, model) {
|
|
56
|
+
const isNonmod = base.startsWith('nonmod_');
|
|
57
|
+
if (isNonmod) {
|
|
58
|
+
const genomicBase = base.replace('nonmod_', '');
|
|
59
|
+
return `Unmodified ${genomicBase}`;
|
|
60
|
+
}
|
|
61
|
+
const modType = getModificationType(base);
|
|
62
|
+
const mod = model.visibleModifications.get(modType);
|
|
63
|
+
if (!mod) {
|
|
64
|
+
return base.toUpperCase();
|
|
65
|
+
}
|
|
66
|
+
const modName = getModificationName(modType);
|
|
67
|
+
return modName;
|
|
68
|
+
}
|
|
69
|
+
function ColorSquare({ base, model }) {
|
|
70
|
+
const color = getModificationColor(base, model);
|
|
71
|
+
if (!color) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return _jsx("div", { style: { width: 10, height: 10, background: color } });
|
|
75
|
+
}
|
|
76
|
+
function TableHeader() {
|
|
77
|
+
return (_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", {}), _jsx("th", { children: "Base" }), _jsx("th", { children: "Count" }), _jsx("th", { children: "% of Reads" }), _jsx("th", { children: "Strands" }), _jsx("th", { children: "Avg Prob" })] }) }));
|
|
78
|
+
}
|
|
79
|
+
function TotalRow({ readsCounted }) {
|
|
80
|
+
return (_jsxs("tr", { children: [_jsx("td", {}), _jsx("td", { children: "Total" }), _jsx("td", { children: readsCounted }), _jsx("td", { children: " " }), _jsx("td", { children: " " }), _jsx("td", { children: " " })] }));
|
|
81
|
+
}
|
|
82
|
+
function RefRow({ referenceBase, reference, readsCounted, }) {
|
|
83
|
+
return (_jsxs("tr", { children: [_jsx("td", {}), _jsxs("td", { children: ["REF ", referenceBase ? `(${referenceBase.toUpperCase()})` : ''] }), _jsx("td", { children: reference.entryDepth }), _jsx("td", { children: pct(reference.entryDepth, readsCounted) }), _jsx("td", { children: formatStrandCounts(reference) }), _jsx("td", { children: " " })] }));
|
|
84
|
+
}
|
|
85
|
+
function DuplexModificationRow({ base, score, readsCounted, model, tdClass, rowKey, }) {
|
|
86
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx(ColorSquare, { model: model, base: base }) }), _jsx("td", { children: getDuplexModificationLabel(base, model) }), _jsx("td", { className: tdClass, children: score.entryDepth }), _jsx("td", { children: shouldShowPercentage(base)
|
|
87
|
+
? pct(score.entryDepth, readsCounted)
|
|
88
|
+
: '---' }), _jsx("td", { children: formatStrandCounts(score) }), _jsx("td", { children: score.avgProbability !== undefined ? pct(score.avgProbability) : '' })] }, rowKey));
|
|
89
|
+
}
|
|
90
|
+
function SimplexOrRegularRow({ base, score, isMod, readsCounted, model, tdClass, rowKey, }) {
|
|
91
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: _jsx(ColorSquare, { model: model, base: base }) }), _jsx("td", { children: isMod ? getModificationLabel(base, model) : base.toUpperCase() }), _jsx("td", { className: tdClass, children: score.entryDepth }), _jsx("td", { children: shouldShowPercentage(base)
|
|
92
|
+
? pct(score.entryDepth, readsCounted)
|
|
93
|
+
: '---' }), _jsx("td", { children: formatStrandCounts(score) }), _jsx("td", { children: score.avgProbability !== undefined ? pct(score.avgProbability) : '' })] }, rowKey));
|
|
94
|
+
}
|
|
95
|
+
function ModificationRows({ info, readsCounted, model, tdClass, }) {
|
|
96
|
+
const consolidatedEntries = {};
|
|
97
|
+
for (const [key, entry] of Object.entries(info)) {
|
|
98
|
+
for (const [base, score] of Object.entries(entry)) {
|
|
99
|
+
const isNonmod = base.startsWith('nonmod_');
|
|
100
|
+
if (isNonmod) {
|
|
101
|
+
const modType = getModificationType(base);
|
|
102
|
+
const mod = model.visibleModifications.get(modType);
|
|
103
|
+
const genomicBase = (mod === null || mod === void 0 ? void 0 : mod.base) || 'X';
|
|
104
|
+
const consolidatedKey = `${key}_nonmod_${genomicBase}`;
|
|
105
|
+
if (!consolidatedEntries[consolidatedKey]) {
|
|
106
|
+
consolidatedEntries[consolidatedKey] = {
|
|
107
|
+
base: `nonmod_${genomicBase}`,
|
|
108
|
+
score: {
|
|
109
|
+
entryDepth: 0,
|
|
110
|
+
'1': 0,
|
|
111
|
+
'-1': 0,
|
|
112
|
+
avgProbability: 0,
|
|
113
|
+
},
|
|
114
|
+
isNonmod: true,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const consolidated = consolidatedEntries[consolidatedKey];
|
|
118
|
+
consolidated.score.entryDepth += score.entryDepth;
|
|
119
|
+
consolidated.score['1'] += score['1'];
|
|
120
|
+
consolidated.score['-1'] += score['-1'];
|
|
121
|
+
if (score.avgProbability !== undefined) {
|
|
122
|
+
const prevAvg = consolidated.score.avgProbability || 0;
|
|
123
|
+
const prevCount = consolidated.score.entryDepth - score.entryDepth;
|
|
124
|
+
consolidated.score.avgProbability =
|
|
125
|
+
prevCount > 0
|
|
126
|
+
? (prevAvg * prevCount +
|
|
127
|
+
score.avgProbability * score.entryDepth) /
|
|
128
|
+
consolidated.score.entryDepth
|
|
129
|
+
: score.avgProbability;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
consolidatedEntries[`${key}_${base}`] = {
|
|
134
|
+
base,
|
|
135
|
+
score: { ...score },
|
|
136
|
+
isNonmod: false,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return (_jsx(_Fragment, { children: Object.entries(consolidatedEntries).map(([rowKey, { base, score, isNonmod }]) => {
|
|
142
|
+
var _a;
|
|
143
|
+
const modType = getModificationType(base);
|
|
144
|
+
const isMod = isModification(base) || isNonmod;
|
|
145
|
+
const isSimplex = !isNonmod && isMod && ((_a = model.simplexModifications) === null || _a === void 0 ? void 0 : _a.has(modType));
|
|
146
|
+
const posStrandCount = score['1'] || 0;
|
|
147
|
+
const negStrandCount = score['-1'] || 0;
|
|
148
|
+
if (isNonmod) {
|
|
149
|
+
return (_jsx(SimplexOrRegularRow, { base: base, score: score, isMod: true, isSimplex: false, readsCounted: readsCounted, model: model, tdClass: tdClass, rowKey: rowKey }, rowKey));
|
|
150
|
+
}
|
|
151
|
+
if (isMod &&
|
|
152
|
+
!isSimplex &&
|
|
153
|
+
(posStrandCount > 0 || negStrandCount > 0)) {
|
|
154
|
+
return (_jsx(DuplexModificationRow, { base: base, score: score, posStrandCount: posStrandCount, negStrandCount: negStrandCount, readsCounted: readsCounted, model: model, tdClass: tdClass, rowKey: rowKey }, rowKey));
|
|
155
|
+
}
|
|
156
|
+
return (_jsx(SimplexOrRegularRow, { base: base, score: score, isMod: isMod, isSimplex: isSimplex, readsCounted: readsCounted, model: model, tdClass: tdClass, rowKey: rowKey }, rowKey));
|
|
157
|
+
}) }));
|
|
20
158
|
}
|
|
21
159
|
const TooltipContents = forwardRef(function TooltipContents2(props, reactRef) {
|
|
22
160
|
const { feature, model } = props;
|
|
@@ -24,7 +162,7 @@ const TooltipContents = forwardRef(function TooltipContents2(props, reactRef) {
|
|
|
24
162
|
const start = feature.get('start') + 1;
|
|
25
163
|
const end = feature.get('end');
|
|
26
164
|
const name = feature.get('refName');
|
|
27
|
-
const { refbase, readsCounted, depth, ref, ...info } = feature.get('snpinfo');
|
|
165
|
+
const { refbase: referenceBase, readsCounted, depth, ref: reference, ...info } = feature.get('snpinfo');
|
|
28
166
|
return (_jsx("div", { ref: reactRef, children: _jsxs("table", { children: [_jsx("caption", { children: [
|
|
29
167
|
name,
|
|
30
168
|
start === end
|
|
@@ -32,15 +170,6 @@ const TooltipContents = forwardRef(function TooltipContents2(props, reactRef) {
|
|
|
32
170
|
: `${toLocale(start)}..${toLocale(end)}`,
|
|
33
171
|
]
|
|
34
172
|
.filter(f => !!f)
|
|
35
|
-
.join(':') }), _jsx(
|
|
36
|
-
score.entryDepth,
|
|
37
|
-
score.avgProbability !== undefined
|
|
38
|
-
? `(avg. ${pct(score.avgProbability)} prob.)`
|
|
39
|
-
: '',
|
|
40
|
-
]
|
|
41
|
-
.filter(f => !!f)
|
|
42
|
-
.join(' ') }), _jsx("td", { children: base === 'depth' || base === 'skip'
|
|
43
|
-
? '---'
|
|
44
|
-
: pct(score.entryDepth, readsCounted) }), _jsxs("td", { children: [score['-1'] ? `${score['-1']}(-)` : '', score['1'] ? `${score['1']}(+)` : ''] })] }, `${key}_${base}`))))] })] }) }));
|
|
173
|
+
.join(':') }), _jsx(TableHeader, {}), _jsxs("tbody", { children: [_jsx(TotalRow, { readsCounted: readsCounted }), _jsx(RefRow, { referenceBase: referenceBase, reference: reference, readsCounted: readsCounted }), _jsx(ModificationRows, { info: info, readsCounted: readsCounted, model: model, tdClass: classes.td })] })] }) }));
|
|
45
174
|
});
|
|
46
175
|
export default TooltipContents;
|
|
@@ -23,6 +23,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
23
23
|
}))
|
|
24
24
|
.volatile(() => ({
|
|
25
25
|
visibleModifications: observable.map({}),
|
|
26
|
+
simplexModifications: new Set(),
|
|
26
27
|
modificationsReady: false,
|
|
27
28
|
}))
|
|
28
29
|
.views(self => ({
|
|
@@ -64,10 +65,17 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
},
|
|
68
|
+
setSimplexModifications(simplex) {
|
|
69
|
+
self.simplexModifications = new Set(simplex);
|
|
70
|
+
},
|
|
67
71
|
}))
|
|
68
72
|
.views(self => {
|
|
69
73
|
const { adapterProps: superAdapterProps } = self;
|
|
70
74
|
return {
|
|
75
|
+
get modificationThreshold() {
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
return (_c = (_b = (_a = self.colorBy) === null || _a === void 0 ? void 0 : _a.modifications) === null || _b === void 0 ? void 0 : _b.threshold) !== null && _c !== void 0 ? _c : 10;
|
|
78
|
+
},
|
|
71
79
|
get rendererConfig() {
|
|
72
80
|
const configBlob = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
73
81
|
const { showArcs, showInterbaseCounts, showInterbaseIndicators } = self;
|
|
@@ -103,6 +111,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
103
111
|
...superProps,
|
|
104
112
|
filters,
|
|
105
113
|
filterBy,
|
|
114
|
+
modificationThreshold: this.modificationThreshold,
|
|
106
115
|
};
|
|
107
116
|
},
|
|
108
117
|
};
|
|
@@ -132,13 +141,14 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
132
141
|
const { staticBlocks } = view;
|
|
133
142
|
const { colorBy } = self;
|
|
134
143
|
if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
|
|
135
|
-
const
|
|
144
|
+
const { modifications, simplexModifications } = await getUniqueModifications({
|
|
136
145
|
model: self,
|
|
137
146
|
adapterConfig: getConf(self.parentTrack, 'adapter'),
|
|
138
147
|
blocks: staticBlocks,
|
|
139
148
|
});
|
|
140
149
|
if (isAlive(self)) {
|
|
141
|
-
self.updateVisibleModifications(
|
|
150
|
+
self.updateVisibleModifications(modifications);
|
|
151
|
+
self.setSimplexModifications(simplexModifications);
|
|
142
152
|
self.setModificationsReady(true);
|
|
143
153
|
}
|
|
144
154
|
}
|
|
@@ -156,12 +166,13 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
156
166
|
return !superProps.notReady && self.modificationsReady;
|
|
157
167
|
},
|
|
158
168
|
renderProps() {
|
|
159
|
-
const { colorBy, visibleModifications } = self;
|
|
169
|
+
const { colorBy, visibleModifications, simplexModifications } = self;
|
|
160
170
|
return {
|
|
161
171
|
...superRenderProps(),
|
|
162
172
|
notReady: !this.renderReady(),
|
|
163
173
|
colorBy,
|
|
164
174
|
visibleModifications: Object.fromEntries(visibleModifications.toJSON()),
|
|
175
|
+
simplexModifications: [...simplexModifications],
|
|
165
176
|
};
|
|
166
177
|
},
|
|
167
178
|
get TooltipComponent() {
|