@jbrowse/plugin-alignments 2.13.1 → 2.14.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/AlignmentsFeatureDetail.js +5 -3
- package/dist/AlignmentsFeatureDetail/BreakendOptionDialog.js +12 -4
- package/dist/AlignmentsFeatureDetail/Formatter.js +6 -2
- package/dist/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +4 -2
- package/dist/AlignmentsFeatureDetail/getSAFeatures.js +4 -4
- package/dist/AlignmentsFeatureDetail/launchBreakpointSplitView.js +2 -2
- package/dist/BamAdapter/BamAdapter.js +12 -18
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +0 -1
- package/dist/CramAdapter/CramAdapter.d.ts +1 -1
- package/dist/CramAdapter/CramAdapter.js +7 -6
- package/dist/CramAdapter/CramTestAdapters.js +8 -2
- package/dist/GuessAlignmentsTypes/index.js +2 -2
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -2
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +13 -20
- package/dist/LinearAlignmentsDisplay/models/model.js +13 -3
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +7 -4
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +36 -21
- package/dist/LinearPileupDisplay/components/{ColorByModifications.js → ColorByModificationsDialog.js} +3 -1
- package/dist/LinearPileupDisplay/components/{ColorByTag.js → ColorByTagDialog.js} +4 -2
- package/dist/LinearPileupDisplay/components/GroupByDialog.d.ts +11 -0
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +129 -0
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -3
- package/dist/LinearPileupDisplay/components/{SetFeatureHeight.js → SetFeatureHeightDialog.js} +9 -3
- package/{esm/LinearPileupDisplay/components/SetMaxHeight.d.ts → dist/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts} +1 -1
- package/dist/LinearPileupDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +6 -2
- package/dist/LinearPileupDisplay/components/{SortByTag.d.ts → SortByTagDialog.d.ts} +1 -1
- package/dist/LinearPileupDisplay/components/{SortByTag.js → SortByTagDialog.js} +7 -3
- package/dist/LinearPileupDisplay/configSchema.js +0 -1
- package/dist/LinearPileupDisplay/model.d.ts +58 -46
- package/dist/LinearPileupDisplay/model.js +69 -41
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +1 -0
- package/dist/LinearReadArcsDisplay/model.d.ts +2 -2
- package/dist/LinearReadArcsDisplay/model.js +37 -13
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +4 -1
- package/dist/LinearReadCloudDisplay/drawPairChains.js +3 -3
- package/dist/LinearReadCloudDisplay/model.d.ts +4 -8
- package/dist/LinearReadCloudDisplay/model.js +16 -6
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.js +15 -5
- package/dist/MismatchParser/index.js +11 -9
- package/dist/PileupRPC/base.d.ts +1 -1
- package/dist/PileupRPC/methods/GetGlobalValueForTag.d.ts +1 -1
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +3 -3
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/dist/PileupRenderer/PileupLayoutSession.js +3 -2
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +16 -13
- package/dist/PileupRenderer/colorBy.js +3 -5
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +65 -60
- package/dist/PileupRenderer/getAlignmentShapeColor.js +24 -16
- package/dist/PileupRenderer/layoutFeature.js +6 -1
- package/dist/PileupRenderer/layoutFeatures.js +1 -7
- package/dist/PileupRenderer/makeImageData.d.ts +1 -1
- package/dist/PileupRenderer/makeImageData.js +1 -0
- package/dist/PileupRenderer/renderAlignmentShape.js +1 -1
- package/dist/PileupRenderer/renderMismatches.js +1 -1
- package/dist/PileupRenderer/renderSoftClipping.js +1 -1
- package/dist/PileupRenderer/util.js +3 -5
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +4 -10
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -2
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +2 -5
- package/dist/index.js +3 -1
- package/dist/shared/BaseDisplayComponent.js +3 -1
- package/dist/shared/{FilterByTag.js → FilterByTagDialog.js} +16 -6
- package/dist/shared/color.js +2 -2
- package/dist/shared/index.d.ts +24 -20
- package/dist/shared/index.js +4 -5
- package/dist/shared/renderSvg.js +1 -3
- package/dist/util.d.ts +1 -1
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +5 -3
- package/esm/AlignmentsFeatureDetail/BreakendOptionDialog.js +12 -4
- package/esm/AlignmentsFeatureDetail/Formatter.js +6 -2
- package/esm/AlignmentsFeatureDetail/SuppAlignmentsLocStrings.js +4 -2
- package/esm/AlignmentsFeatureDetail/getSAFeatures.js +4 -4
- package/esm/AlignmentsFeatureDetail/launchBreakpointSplitView.js +2 -2
- package/esm/BamAdapter/BamAdapter.js +12 -18
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +0 -1
- package/esm/CramAdapter/CramAdapter.d.ts +1 -1
- package/esm/CramAdapter/CramAdapter.js +7 -6
- package/esm/CramAdapter/CramTestAdapters.js +8 -2
- package/esm/GuessAlignmentsTypes/index.js +2 -2
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +2 -2
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +13 -20
- package/esm/LinearAlignmentsDisplay/models/model.js +13 -3
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +7 -4
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +36 -21
- package/esm/LinearPileupDisplay/components/{ColorByModifications.js → ColorByModificationsDialog.js} +3 -1
- package/esm/LinearPileupDisplay/components/{ColorByTag.js → ColorByTagDialog.js} +4 -2
- package/esm/LinearPileupDisplay/components/GroupByDialog.d.ts +11 -0
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +104 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +1 -3
- package/esm/LinearPileupDisplay/components/{SetFeatureHeight.js → SetFeatureHeightDialog.js} +9 -3
- package/{dist/LinearPileupDisplay/components/SetMaxHeight.d.ts → esm/LinearPileupDisplay/components/SetMaxHeightDialog.d.ts} +1 -1
- package/esm/LinearPileupDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +6 -2
- package/esm/LinearPileupDisplay/components/{SortByTag.d.ts → SortByTagDialog.d.ts} +1 -1
- package/esm/LinearPileupDisplay/components/{SortByTag.js → SortByTagDialog.js} +7 -3
- package/esm/LinearPileupDisplay/configSchema.js +0 -1
- package/esm/LinearPileupDisplay/model.d.ts +58 -46
- package/esm/LinearPileupDisplay/model.js +69 -41
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +1 -0
- package/esm/LinearReadArcsDisplay/model.d.ts +2 -2
- package/esm/LinearReadArcsDisplay/model.js +37 -13
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +4 -1
- package/esm/LinearReadCloudDisplay/drawPairChains.js +3 -3
- package/esm/LinearReadCloudDisplay/model.d.ts +4 -8
- package/esm/LinearReadCloudDisplay/model.js +16 -6
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.js +15 -5
- package/esm/MismatchParser/index.js +11 -9
- package/esm/PileupRPC/base.d.ts +1 -1
- package/esm/PileupRPC/methods/GetGlobalValueForTag.d.ts +1 -1
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +3 -3
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +1 -1
- package/esm/PileupRenderer/PileupLayoutSession.js +3 -2
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +16 -13
- package/esm/PileupRenderer/colorBy.js +3 -5
- package/esm/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/esm/PileupRenderer/components/PileupRendering.js +65 -60
- package/esm/PileupRenderer/getAlignmentShapeColor.js +24 -16
- package/esm/PileupRenderer/layoutFeature.js +6 -1
- package/esm/PileupRenderer/layoutFeatures.js +1 -7
- package/esm/PileupRenderer/makeImageData.d.ts +1 -1
- package/esm/PileupRenderer/makeImageData.js +1 -0
- package/esm/PileupRenderer/renderAlignmentShape.js +1 -1
- package/esm/PileupRenderer/renderMismatches.js +1 -1
- package/esm/PileupRenderer/renderSoftClipping.js +1 -1
- package/esm/PileupRenderer/util.js +3 -5
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +4 -10
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -2
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +2 -5
- package/esm/index.js +3 -1
- package/esm/shared/BaseDisplayComponent.js +3 -1
- package/esm/shared/{FilterByTag.js → FilterByTagDialog.js} +16 -6
- package/esm/shared/color.js +2 -2
- package/esm/shared/index.d.ts +24 -20
- package/esm/shared/index.js +4 -5
- package/esm/shared/renderSvg.js +1 -3
- package/esm/util.d.ts +1 -1
- package/package.json +4 -4
- /package/dist/LinearPileupDisplay/components/{ColorByModifications.d.ts → ColorByModificationsDialog.d.ts} +0 -0
- /package/dist/LinearPileupDisplay/components/{ColorByTag.d.ts → ColorByTagDialog.d.ts} +0 -0
- /package/dist/LinearPileupDisplay/components/{SetFeatureHeight.d.ts → SetFeatureHeightDialog.d.ts} +0 -0
- /package/dist/shared/{FilterByTag.d.ts → FilterByTagDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{ColorByModifications.d.ts → ColorByModificationsDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{ColorByTag.d.ts → ColorByTagDialog.d.ts} +0 -0
- /package/esm/LinearPileupDisplay/components/{SetFeatureHeight.d.ts → SetFeatureHeightDialog.d.ts} +0 -0
- /package/esm/shared/{FilterByTag.d.ts → FilterByTagDialog.d.ts} +0 -0
|
@@ -10,7 +10,7 @@ import FilterListIcon from '@mui/icons-material/ClearAll';
|
|
|
10
10
|
// locals
|
|
11
11
|
import { FilterModel } from '../shared';
|
|
12
12
|
// async
|
|
13
|
-
const FilterByTagDialog = lazy(() => import('../shared/
|
|
13
|
+
const FilterByTagDialog = lazy(() => import('../shared/FilterByTagDialog'));
|
|
14
14
|
/**
|
|
15
15
|
* #stateModel LinearReadArcsDisplay
|
|
16
16
|
* the arc display is a non-block-based track, so draws to a single canvas and
|
|
@@ -202,15 +202,21 @@ function stateModelFactory(configSchema) {
|
|
|
202
202
|
subMenu: [
|
|
203
203
|
{
|
|
204
204
|
label: 'Thin',
|
|
205
|
-
onClick: () =>
|
|
205
|
+
onClick: () => {
|
|
206
|
+
self.setLineWidth(1);
|
|
207
|
+
},
|
|
206
208
|
},
|
|
207
209
|
{
|
|
208
210
|
label: 'Bold',
|
|
209
|
-
onClick: () =>
|
|
211
|
+
onClick: () => {
|
|
212
|
+
self.setLineWidth(2);
|
|
213
|
+
},
|
|
210
214
|
},
|
|
211
215
|
{
|
|
212
216
|
label: 'Extra bold',
|
|
213
|
-
onClick: () =>
|
|
217
|
+
onClick: () => {
|
|
218
|
+
self.setLineWidth(5);
|
|
219
|
+
},
|
|
214
220
|
},
|
|
215
221
|
],
|
|
216
222
|
},
|
|
@@ -221,19 +227,25 @@ function stateModelFactory(configSchema) {
|
|
|
221
227
|
type: 'checkbox',
|
|
222
228
|
checked: self.jitterVal === 0,
|
|
223
229
|
label: 'None',
|
|
224
|
-
onClick: () =>
|
|
230
|
+
onClick: () => {
|
|
231
|
+
self.setJitter(0);
|
|
232
|
+
},
|
|
225
233
|
},
|
|
226
234
|
{
|
|
227
235
|
type: 'checkbox',
|
|
228
236
|
checked: self.jitterVal === 2,
|
|
229
237
|
label: 'Small',
|
|
230
|
-
onClick: () =>
|
|
238
|
+
onClick: () => {
|
|
239
|
+
self.setJitter(2);
|
|
240
|
+
},
|
|
231
241
|
},
|
|
232
242
|
{
|
|
233
243
|
type: 'checkbox',
|
|
234
244
|
checked: self.jitterVal === 10,
|
|
235
245
|
label: 'Large',
|
|
236
|
-
onClick: () =>
|
|
246
|
+
onClick: () => {
|
|
247
|
+
self.setJitter(10);
|
|
248
|
+
},
|
|
237
249
|
},
|
|
238
250
|
],
|
|
239
251
|
},
|
|
@@ -241,13 +253,17 @@ function stateModelFactory(configSchema) {
|
|
|
241
253
|
label: 'Draw inter-region vertical lines',
|
|
242
254
|
type: 'checkbox',
|
|
243
255
|
checked: self.drawInter,
|
|
244
|
-
onClick: () =>
|
|
256
|
+
onClick: () => {
|
|
257
|
+
self.setDrawInter(!self.drawInter);
|
|
258
|
+
},
|
|
245
259
|
},
|
|
246
260
|
{
|
|
247
261
|
label: 'Draw long range connections',
|
|
248
262
|
type: 'checkbox',
|
|
249
263
|
checked: self.drawLongRange,
|
|
250
|
-
onClick: () =>
|
|
264
|
+
onClick: () => {
|
|
265
|
+
self.setDrawLongRange(!self.drawLongRange);
|
|
266
|
+
},
|
|
251
267
|
},
|
|
252
268
|
{
|
|
253
269
|
label: 'Color scheme',
|
|
@@ -255,19 +271,27 @@ function stateModelFactory(configSchema) {
|
|
|
255
271
|
subMenu: [
|
|
256
272
|
{
|
|
257
273
|
label: 'Insert size ± 3σ and orientation',
|
|
258
|
-
onClick: () =>
|
|
274
|
+
onClick: () => {
|
|
275
|
+
self.setColorScheme({ type: 'insertSizeAndOrientation' });
|
|
276
|
+
},
|
|
259
277
|
},
|
|
260
278
|
{
|
|
261
279
|
label: 'Insert size ± 3σ',
|
|
262
|
-
onClick: () =>
|
|
280
|
+
onClick: () => {
|
|
281
|
+
self.setColorScheme({ type: 'insertSize' });
|
|
282
|
+
},
|
|
263
283
|
},
|
|
264
284
|
{
|
|
265
285
|
label: 'Orientation',
|
|
266
|
-
onClick: () =>
|
|
286
|
+
onClick: () => {
|
|
287
|
+
self.setColorScheme({ type: 'orientation' });
|
|
288
|
+
},
|
|
267
289
|
},
|
|
268
290
|
{
|
|
269
291
|
label: 'Insert size gradient',
|
|
270
|
-
onClick: () =>
|
|
292
|
+
onClick: () => {
|
|
293
|
+
self.setColorScheme({ type: 'gradient' });
|
|
294
|
+
},
|
|
271
295
|
},
|
|
272
296
|
],
|
|
273
297
|
},
|
|
@@ -6,7 +6,10 @@ const Cloud = observer(function ({ model, }) {
|
|
|
6
6
|
const view = getContainingView(model);
|
|
7
7
|
const width = Math.round(view.dynamicBlocks.totalWidthPx);
|
|
8
8
|
const height = model.height;
|
|
9
|
-
|
|
9
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies:
|
|
10
|
+
const cb = useCallback((ref) => {
|
|
11
|
+
model.setRef(ref);
|
|
12
|
+
},
|
|
10
13
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
14
|
[model, width, height]);
|
|
12
15
|
// note: the position absolute below avoids scrollbar from appearing on track
|
|
@@ -75,13 +75,13 @@ export function getPairedColor({ type, v0, v1, stats, }) {
|
|
|
75
75
|
if (type === 'insertSizeAndOrientation') {
|
|
76
76
|
return getPairedInsertSizeAndOrientationColor(v0, v1, stats);
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
if (type === 'orientation') {
|
|
79
79
|
return getPairedOrientationColor(v0);
|
|
80
80
|
}
|
|
81
|
-
|
|
81
|
+
if (type === 'insertSize') {
|
|
82
82
|
return getPairedInsertSizeColor(v0, v1, stats);
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
if (type === 'gradient') {
|
|
85
85
|
const s = Math.min(v0.start, v1.start);
|
|
86
86
|
const e = Math.max(v0.end, v1.end);
|
|
87
87
|
return [
|
|
@@ -29,7 +29,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
29
29
|
readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
30
30
|
tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
31
31
|
tag: import("mobx-state-tree").ISimpleType<string>;
|
|
32
|
-
value: import("mobx-state-tree").ISimpleType<string
|
|
32
|
+
value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
33
33
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
34
34
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
35
35
|
colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -53,9 +53,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
53
53
|
error: unknown;
|
|
54
54
|
message: string | undefined;
|
|
55
55
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
56
|
-
id: import("mobx-state-tree"
|
|
57
|
-
* #property
|
|
58
|
-
*/).IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
56
|
+
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
59
57
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
60
58
|
rpcDriverName: import("mobx-state-tree" /**
|
|
61
59
|
* #property
|
|
@@ -65,7 +63,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
65
63
|
error: unknown;
|
|
66
64
|
message: string | undefined;
|
|
67
65
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
68
|
-
onHorizontalScroll?:
|
|
66
|
+
onHorizontalScroll?: () => void;
|
|
69
67
|
blockState?: Record<string, any>;
|
|
70
68
|
}>;
|
|
71
69
|
readonly DisplayBlurb: React.FC<{
|
|
@@ -85,9 +83,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
85
83
|
rendererTypeName: string;
|
|
86
84
|
error: unknown;
|
|
87
85
|
message: string | undefined;
|
|
88
|
-
}, import("mobx-state-tree"
|
|
89
|
-
* #action
|
|
90
|
-
*/)._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
86
|
+
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
91
87
|
}> | null;
|
|
92
88
|
readonly adapterConfig: any;
|
|
93
89
|
readonly parentTrack: any;
|
|
@@ -10,7 +10,7 @@ import FilterListIcon from '@mui/icons-material/ClearAll';
|
|
|
10
10
|
// locals
|
|
11
11
|
import { FilterModel } from '../shared';
|
|
12
12
|
// async
|
|
13
|
-
const FilterByTagDialog = lazy(() => import('../shared/
|
|
13
|
+
const FilterByTagDialog = lazy(() => import('../shared/FilterByTagDialog'));
|
|
14
14
|
/**
|
|
15
15
|
* #stateModel LinearReadCloudDisplay
|
|
16
16
|
* it is not a block based track, hence not BaseLinearDisplay
|
|
@@ -135,7 +135,9 @@ function stateModelFactory(configSchema) {
|
|
|
135
135
|
label: 'Draw singletons',
|
|
136
136
|
type: 'checkbox',
|
|
137
137
|
checked: self.drawSingletons,
|
|
138
|
-
onClick: () =>
|
|
138
|
+
onClick: () => {
|
|
139
|
+
self.setDrawSingletons(!self.drawSingletons);
|
|
140
|
+
},
|
|
139
141
|
},
|
|
140
142
|
{
|
|
141
143
|
label: 'Filter by',
|
|
@@ -153,19 +155,27 @@ function stateModelFactory(configSchema) {
|
|
|
153
155
|
subMenu: [
|
|
154
156
|
{
|
|
155
157
|
label: 'Insert size ± 3σ and orientation',
|
|
156
|
-
onClick: () =>
|
|
158
|
+
onClick: () => {
|
|
159
|
+
self.setColorScheme({ type: 'insertSizeAndOrientation' });
|
|
160
|
+
},
|
|
157
161
|
},
|
|
158
162
|
{
|
|
159
163
|
label: 'Insert size ± 3σ',
|
|
160
|
-
onClick: () =>
|
|
164
|
+
onClick: () => {
|
|
165
|
+
self.setColorScheme({ type: 'insertSize' });
|
|
166
|
+
},
|
|
161
167
|
},
|
|
162
168
|
{
|
|
163
169
|
label: 'Orientation',
|
|
164
|
-
onClick: () =>
|
|
170
|
+
onClick: () => {
|
|
171
|
+
self.setColorScheme({ type: 'orientation' });
|
|
172
|
+
},
|
|
165
173
|
},
|
|
166
174
|
{
|
|
167
175
|
label: 'Insert size gradient',
|
|
168
|
-
onClick: () =>
|
|
176
|
+
onClick: () => {
|
|
177
|
+
self.setColorScheme({ type: 'gradient' });
|
|
178
|
+
},
|
|
169
179
|
},
|
|
170
180
|
],
|
|
171
181
|
},
|
|
@@ -50,7 +50,7 @@ const TooltipContents = React.forwardRef(function TooltipContents2({ feature },
|
|
|
50
50
|
score['1'] ? `${score['1']}(+)` : ''),
|
|
51
51
|
React.createElement("td", null, key)))))))));
|
|
52
52
|
});
|
|
53
|
-
const SNPCoverageTooltip = observer((props)
|
|
53
|
+
const SNPCoverageTooltip = observer(function (props) {
|
|
54
54
|
const { model } = props;
|
|
55
55
|
const { featureUnderMouse: feat } = model;
|
|
56
56
|
return feat && feat.get('type') === 'skip' ? null : (React.createElement(Tooltip, { TooltipContents: TooltipContents, ...props }));
|
|
@@ -142,7 +142,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
142
142
|
readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
143
143
|
tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
144
144
|
tag: import("mobx-state-tree").ISimpleType<string>;
|
|
145
|
-
value: import("mobx-state-tree").ISimpleType<string
|
|
145
|
+
value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
146
146
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
147
147
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
148
148
|
/**
|
|
@@ -159,7 +159,7 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
159
159
|
// must use getSnapshot because otherwise changes to e.g. just the
|
|
160
160
|
// colorBy.type are not read
|
|
161
161
|
colorBy: colorBy ? getSnapshot(colorBy) : undefined,
|
|
162
|
-
filterBy:
|
|
162
|
+
filterBy: getSnapshot(filterBy),
|
|
163
163
|
};
|
|
164
164
|
},
|
|
165
165
|
};
|
|
@@ -202,7 +202,11 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
202
202
|
const { colorBy } = self;
|
|
203
203
|
if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
|
|
204
204
|
const adapter = getConf(self.parentTrack, 'adapter');
|
|
205
|
-
const vals = await getUniqueModificationValues(
|
|
205
|
+
const vals = await getUniqueModificationValues({
|
|
206
|
+
self,
|
|
207
|
+
adapterConfig: adapter,
|
|
208
|
+
blocks: staticBlocks,
|
|
209
|
+
});
|
|
206
210
|
if (isAlive(self)) {
|
|
207
211
|
self.updateModificationColorMap(vals);
|
|
208
212
|
self.setModificationsReady(true);
|
|
@@ -261,19 +265,25 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
261
265
|
label: 'Draw insertion/clipping indicators',
|
|
262
266
|
type: 'checkbox',
|
|
263
267
|
checked: self.drawIndicatorsSetting,
|
|
264
|
-
onClick: () =>
|
|
268
|
+
onClick: () => {
|
|
269
|
+
self.toggleDrawIndicators();
|
|
270
|
+
},
|
|
265
271
|
},
|
|
266
272
|
{
|
|
267
273
|
label: 'Draw insertion/clipping counts',
|
|
268
274
|
type: 'checkbox',
|
|
269
275
|
checked: self.drawInterbaseCountsSetting,
|
|
270
|
-
onClick: () =>
|
|
276
|
+
onClick: () => {
|
|
277
|
+
self.toggleDrawInterbaseCounts();
|
|
278
|
+
},
|
|
271
279
|
},
|
|
272
280
|
{
|
|
273
281
|
label: 'Draw arcs',
|
|
274
282
|
type: 'checkbox',
|
|
275
283
|
checked: self.drawArcsSetting,
|
|
276
|
-
onClick: () =>
|
|
284
|
+
onClick: () => {
|
|
285
|
+
self.toggleDrawArcs();
|
|
286
|
+
},
|
|
277
287
|
},
|
|
278
288
|
];
|
|
279
289
|
},
|
|
@@ -267,7 +267,7 @@ export function getModificationPositions(mm, fseq, fstrand) {
|
|
|
267
267
|
for (const mod of mods) {
|
|
268
268
|
const [basemod, ...skips] = mod.split(',');
|
|
269
269
|
// regexes based on parse_mm.pl from hts-specs
|
|
270
|
-
const matches =
|
|
270
|
+
const matches = modificationRegex.exec(basemod);
|
|
271
271
|
if (!matches) {
|
|
272
272
|
throw new Error('bad format for MM tag');
|
|
273
273
|
}
|
|
@@ -314,8 +314,8 @@ export function getModificationTypes(mm) {
|
|
|
314
314
|
.split(';')
|
|
315
315
|
.filter(mod => !!mod)
|
|
316
316
|
.flatMap(mod => {
|
|
317
|
-
const
|
|
318
|
-
const matches =
|
|
317
|
+
const basemod = mod.split(',')[0];
|
|
318
|
+
const matches = modificationRegex.exec(basemod);
|
|
319
319
|
if (!matches) {
|
|
320
320
|
throw new Error(`bad format for MM tag: ${mm}`);
|
|
321
321
|
}
|
|
@@ -341,9 +341,7 @@ export function getOrientedCigar(flip, cigar) {
|
|
|
341
341
|
}
|
|
342
342
|
return ret;
|
|
343
343
|
}
|
|
344
|
-
|
|
345
|
-
return cigar;
|
|
346
|
-
}
|
|
344
|
+
return cigar;
|
|
347
345
|
}
|
|
348
346
|
export function getOrientedMismatches(flip, cigar) {
|
|
349
347
|
const p = parseCigar(cigar);
|
|
@@ -387,8 +385,8 @@ export function getLengthSansClipping(cigar) {
|
|
|
387
385
|
}
|
|
388
386
|
export function getClip(cigar, strand) {
|
|
389
387
|
return strand === -1
|
|
390
|
-
? +(
|
|
391
|
-
: +(
|
|
388
|
+
? +(startClip.exec(cigar) || [])[1] || 0
|
|
389
|
+
: +(endClip.exec(cigar) || [])[1] || 0;
|
|
392
390
|
}
|
|
393
391
|
export function getTag(f, tag) {
|
|
394
392
|
const tags = f.get('tags');
|
|
@@ -402,7 +400,11 @@ export function getTag(f, tag) {
|
|
|
402
400
|
// usage can keep this false
|
|
403
401
|
export function featurizeSA(SA, id, strand, readName, normalize) {
|
|
404
402
|
return ((SA === null || SA === void 0 ? void 0 : SA.split(';').filter(aln => !!aln).map((aln, index) => {
|
|
405
|
-
const
|
|
403
|
+
const ret = aln.split(',');
|
|
404
|
+
const saRef = ret[0];
|
|
405
|
+
const saStart = ret[1];
|
|
406
|
+
const saStrand = ret[2];
|
|
407
|
+
const saCigar = ret[3];
|
|
406
408
|
const saLengthOnRef = getLengthOnRef(saCigar);
|
|
407
409
|
const saLength = getLength(saCigar);
|
|
408
410
|
const saLengthSansClipping = getLengthSansClipping(saCigar);
|
package/esm/PileupRPC/base.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export default abstract class PileupBaseRPC extends RpcMethodType {
|
|
|
4
4
|
serializeArguments(args: RenderArgs & {
|
|
5
5
|
signal?: AbortSignal;
|
|
6
6
|
statusCallback?: (arg: string) => void;
|
|
7
|
-
}, rpcDriver: string): Promise<
|
|
7
|
+
}, rpcDriver: string): Promise<Record<string, unknown>>;
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@ import PileupBaseRPC from '../base';
|
|
|
4
4
|
export default class PileupGetGlobalValueForTag extends PileupBaseRPC {
|
|
5
5
|
name: string;
|
|
6
6
|
execute(args: {
|
|
7
|
-
adapterConfig:
|
|
7
|
+
adapterConfig: Record<string, unknown>;
|
|
8
8
|
signal?: RemoteAbortSignal;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
regions: Region[];
|
|
@@ -4,14 +4,14 @@ import PileupBaseRPC from '../base';
|
|
|
4
4
|
export default class PileupGetReducedFeatures extends PileupBaseRPC {
|
|
5
5
|
name: string;
|
|
6
6
|
execute(args: {
|
|
7
|
-
adapterConfig:
|
|
7
|
+
adapterConfig: Record<string, unknown>;
|
|
8
8
|
signal?: RemoteAbortSignal;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
regions: Region[];
|
|
11
11
|
sessionId: string;
|
|
12
12
|
tag: string;
|
|
13
13
|
}, rpcDriver: string): Promise<{
|
|
14
|
-
chains:
|
|
14
|
+
chains: {
|
|
15
15
|
id: string;
|
|
16
16
|
refName: string;
|
|
17
17
|
name: any;
|
|
@@ -25,7 +25,7 @@ export default class PileupGetReducedFeatures extends PileupBaseRPC {
|
|
|
25
25
|
next_pos: any;
|
|
26
26
|
clipPos: any;
|
|
27
27
|
SA: any;
|
|
28
|
-
}[]
|
|
28
|
+
}[][];
|
|
29
29
|
stats: {
|
|
30
30
|
upper: number;
|
|
31
31
|
lower: number;
|
|
@@ -4,7 +4,7 @@ import PileupBaseRPC from '../base';
|
|
|
4
4
|
export default class PileupGetVisibleModifications extends PileupBaseRPC {
|
|
5
5
|
name: string;
|
|
6
6
|
execute(args: {
|
|
7
|
-
adapterConfig:
|
|
7
|
+
adapterConfig: Record<string, unknown>;
|
|
8
8
|
signal?: RemoteAbortSignal;
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
regions: Region[];
|
|
@@ -15,7 +15,7 @@ type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
|
15
15
|
interface CachedPileupLayout {
|
|
16
16
|
layout: MyMultiLayout;
|
|
17
17
|
config: AnyConfigurationModel;
|
|
18
|
-
filters
|
|
18
|
+
filters?: SerializableFilterChain;
|
|
19
19
|
filterBy: unknown;
|
|
20
20
|
sortedBy: unknown;
|
|
21
21
|
showSoftClip: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import deepEqual from 'fast-deep-equal';
|
|
2
2
|
import { LayoutSession } from '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType';
|
|
3
3
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// The pileup layout session adds
|
|
5
|
+
// - sorting and revealing soft clip changes the layout of pileup renderer
|
|
6
|
+
// - extra conditions to see if cached layout is valid
|
|
6
7
|
export class PileupLayoutSession extends LayoutSession {
|
|
7
8
|
constructor(args) {
|
|
8
9
|
super(args);
|
|
@@ -8,7 +8,7 @@ export interface RenderArgsDeserialized extends BoxRenderArgsDeserialized {
|
|
|
8
8
|
tag?: string;
|
|
9
9
|
};
|
|
10
10
|
colorTagMap?: Record<string, string>;
|
|
11
|
-
modificationTagMap?: Record<string, string
|
|
11
|
+
modificationTagMap?: Record<string, string>;
|
|
12
12
|
sortedBy?: {
|
|
13
13
|
type: string;
|
|
14
14
|
pos: number;
|
|
@@ -19,7 +19,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
19
19
|
}
|
|
20
20
|
const pm = this.pluginManager;
|
|
21
21
|
const { dataAdapter } = await getAdapter(pm, sessionId, sequenceAdapter);
|
|
22
|
-
const
|
|
22
|
+
const region = regions[0];
|
|
23
23
|
return fetchSequence(region, dataAdapter);
|
|
24
24
|
}
|
|
25
25
|
getExpandedRegion(region, renderArgs) {
|
|
@@ -39,7 +39,7 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
39
39
|
const features = await this.getFeatures(renderProps);
|
|
40
40
|
const layout = this.createLayoutInWorker(renderProps);
|
|
41
41
|
const { regions, bpPerPx } = renderProps;
|
|
42
|
-
const
|
|
42
|
+
const region = regions[0];
|
|
43
43
|
const layoutRecords = layoutFeats({
|
|
44
44
|
...renderProps,
|
|
45
45
|
features,
|
|
@@ -53,17 +53,20 @@ export default class PileupRenderer extends BoxRendererType {
|
|
|
53
53
|
const width = (region.end - region.start) / bpPerPx;
|
|
54
54
|
const height = Math.max(layout.getTotalHeight(), 1);
|
|
55
55
|
const { makeImageData } = await import('./makeImageData');
|
|
56
|
-
const res = await renderToAbstractCanvas(width, height, renderProps, ctx =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
const res = await renderToAbstractCanvas(width, height, renderProps, ctx => {
|
|
57
|
+
makeImageData({
|
|
58
|
+
ctx,
|
|
59
|
+
layoutRecords: layoutRecords.filter(notEmpty),
|
|
60
|
+
canvasWidth: width,
|
|
61
|
+
renderArgs: {
|
|
62
|
+
...renderProps,
|
|
63
|
+
layout,
|
|
64
|
+
features,
|
|
65
|
+
regionSequence,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
return undefined;
|
|
69
|
+
});
|
|
67
70
|
const results = await super.render({
|
|
68
71
|
...renderProps,
|
|
69
72
|
...res,
|
|
@@ -39,21 +39,19 @@ function getStranded(feature) {
|
|
|
39
39
|
return strand * flipper === 1 ? 'color_rev_strand' : 'color_fwd_strand';
|
|
40
40
|
}
|
|
41
41
|
// mate missing, separate color
|
|
42
|
-
|
|
42
|
+
if (flags & 8) {
|
|
43
43
|
return strand * flipper === 1
|
|
44
44
|
? 'color_rev_missing_mate'
|
|
45
45
|
: 'color_fwd_missing_mate';
|
|
46
46
|
}
|
|
47
47
|
// same chrom without proper pairing gets separate color
|
|
48
|
-
|
|
48
|
+
if (feature.get('refName') === feature.get('next_ref')) {
|
|
49
49
|
return strand * flipper === 1
|
|
50
50
|
? 'color_rev_strand_not_proper'
|
|
51
51
|
: 'color_fwd_strand_not_proper';
|
|
52
52
|
}
|
|
53
53
|
// abberant chrom
|
|
54
|
-
|
|
55
|
-
return strand === 1 ? 'color_fwd_diff_chr' : 'color_rev_diff_chr';
|
|
56
|
-
}
|
|
54
|
+
return strand === 1 ? 'color_fwd_diff_chr' : 'color_rev_diff_chr';
|
|
57
55
|
}
|
|
58
56
|
return 'color_unknown';
|
|
59
57
|
}
|
|
@@ -3,7 +3,7 @@ import { Region } from '@jbrowse/core/util/types';
|
|
|
3
3
|
import type { BaseLinearDisplayModel } from '@jbrowse/plugin-linear-genome-view';
|
|
4
4
|
declare const PileupRendering: (props: {
|
|
5
5
|
blockKey: string;
|
|
6
|
-
displayModel
|
|
6
|
+
displayModel?: BaseLinearDisplayModel;
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
regions: Region[];
|