@jbrowse/plugin-alignments 2.6.3 → 2.7.1

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.
Files changed (123) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +2 -2
  2. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +2 -1
  3. package/dist/AlignmentsFeatureDetail/util.d.ts +1 -3
  4. package/dist/BamAdapter/BamAdapter.d.ts +2 -9
  5. package/dist/CramAdapter/CramAdapter.d.ts +3 -11
  6. package/dist/CramAdapter/CramAdapter.js +2 -1
  7. package/dist/CramAdapter/util.js +3 -6
  8. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +3 -4
  9. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +3 -3
  10. package/dist/LinearAlignmentsDisplay/models/model.d.ts +5 -9
  11. package/dist/LinearAlignmentsDisplay/models/model.js +1 -0
  12. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +49 -27
  13. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +20 -2
  14. package/dist/LinearPileupDisplay/components/ColorByModifications.d.ts +4 -5
  15. package/dist/LinearPileupDisplay/components/ColorByModifications.js +3 -4
  16. package/dist/LinearPileupDisplay/components/ColorByTag.d.ts +7 -5
  17. package/dist/LinearPileupDisplay/components/ColorByTag.js +4 -7
  18. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +3 -4
  19. package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +2 -2
  20. package/dist/LinearPileupDisplay/components/SetFeatureHeight.d.ts +4 -5
  21. package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +3 -3
  22. package/dist/LinearPileupDisplay/components/SetMaxHeight.d.ts +3 -4
  23. package/dist/LinearPileupDisplay/components/SetMaxHeight.js +3 -3
  24. package/dist/LinearPileupDisplay/components/SortByTag.d.ts +3 -4
  25. package/dist/LinearPileupDisplay/components/SortByTag.js +3 -3
  26. package/dist/LinearPileupDisplay/model.d.ts +56 -35
  27. package/dist/LinearPileupDisplay/model.js +3 -2
  28. package/dist/LinearReadArcsDisplay/components/ReactComponent.d.ts +2 -2
  29. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +2 -1
  30. package/dist/LinearReadArcsDisplay/model.d.ts +9 -14
  31. package/dist/LinearReadCloudDisplay/components/ReactComponent.d.ts +2 -2
  32. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +2 -1
  33. package/dist/LinearReadCloudDisplay/drawPairChains.js +1 -2
  34. package/dist/LinearReadCloudDisplay/model.d.ts +13 -15
  35. package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
  36. package/dist/LinearSNPCoverageDisplay/models/model.d.ts +18 -423
  37. package/dist/LinearSNPCoverageDisplay/models/model.js +18 -0
  38. package/dist/MismatchParser/index.js +6 -8
  39. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +2 -2
  40. package/dist/PileupRenderer/PileupRenderer.js +0 -25
  41. package/dist/PileupRenderer/colorBy.js +1 -1
  42. package/dist/PileupRenderer/components/PileupRendering.d.ts +9 -10
  43. package/dist/PileupRenderer/components/PileupRendering.js +3 -5
  44. package/dist/PileupRenderer/getAlignmentShapeColor.js +1 -1
  45. package/dist/PileupRenderer/layoutFeature.js +1 -2
  46. package/dist/PileupRenderer/makeImageData.d.ts +1 -3
  47. package/dist/PileupRenderer/renderMethylation.js +5 -10
  48. package/dist/PileupRenderer/renderMismatches.d.ts +2 -6
  49. package/dist/PileupRenderer/renderMismatches.js +8 -11
  50. package/dist/PileupRenderer/renderModifications.js +4 -8
  51. package/dist/PileupRenderer/renderSoftClipping.js +26 -25
  52. package/dist/PileupRenderer/sortUtil.js +2 -2
  53. package/dist/SNPCoverageAdapter/util.d.ts +9 -13
  54. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +6 -12
  55. package/dist/shared/BaseDisplayComponent.d.ts +2 -2
  56. package/dist/shared/BaseDisplayComponent.js +2 -1
  57. package/dist/shared/FilterByTag.d.ts +6 -15
  58. package/dist/shared/FilterByTag.js +4 -6
  59. package/dist/shared/fetchChains.js +1 -0
  60. package/dist/shared/index.d.ts +9 -0
  61. package/dist/util.d.ts +3 -9
  62. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +2 -2
  63. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +2 -1
  64. package/esm/AlignmentsFeatureDetail/util.d.ts +1 -3
  65. package/esm/BamAdapter/BamAdapter.d.ts +2 -9
  66. package/esm/CramAdapter/CramAdapter.d.ts +3 -11
  67. package/esm/CramAdapter/CramAdapter.js +2 -1
  68. package/esm/CramAdapter/util.js +3 -6
  69. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +3 -4
  70. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +3 -3
  71. package/esm/LinearAlignmentsDisplay/models/model.d.ts +5 -9
  72. package/esm/LinearAlignmentsDisplay/models/model.js +1 -0
  73. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +49 -27
  74. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +20 -2
  75. package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +4 -5
  76. package/esm/LinearPileupDisplay/components/ColorByModifications.js +3 -4
  77. package/esm/LinearPileupDisplay/components/ColorByTag.d.ts +7 -5
  78. package/esm/LinearPileupDisplay/components/ColorByTag.js +4 -7
  79. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +3 -4
  80. package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +2 -2
  81. package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +4 -5
  82. package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +3 -3
  83. package/esm/LinearPileupDisplay/components/SetMaxHeight.d.ts +3 -4
  84. package/esm/LinearPileupDisplay/components/SetMaxHeight.js +3 -3
  85. package/esm/LinearPileupDisplay/components/SortByTag.d.ts +3 -4
  86. package/esm/LinearPileupDisplay/components/SortByTag.js +3 -3
  87. package/esm/LinearPileupDisplay/model.d.ts +56 -35
  88. package/esm/LinearPileupDisplay/model.js +3 -2
  89. package/esm/LinearReadArcsDisplay/components/ReactComponent.d.ts +2 -2
  90. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +2 -1
  91. package/esm/LinearReadArcsDisplay/model.d.ts +9 -14
  92. package/esm/LinearReadCloudDisplay/components/ReactComponent.d.ts +2 -2
  93. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +2 -1
  94. package/esm/LinearReadCloudDisplay/drawPairChains.js +1 -2
  95. package/esm/LinearReadCloudDisplay/model.d.ts +13 -15
  96. package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +1 -1
  97. package/esm/LinearSNPCoverageDisplay/models/model.d.ts +18 -423
  98. package/esm/LinearSNPCoverageDisplay/models/model.js +18 -0
  99. package/esm/MismatchParser/index.js +6 -8
  100. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +2 -2
  101. package/esm/PileupRenderer/PileupRenderer.js +0 -2
  102. package/esm/PileupRenderer/colorBy.js +1 -1
  103. package/esm/PileupRenderer/components/PileupRendering.d.ts +9 -10
  104. package/esm/PileupRenderer/components/PileupRendering.js +3 -5
  105. package/esm/PileupRenderer/getAlignmentShapeColor.js +1 -1
  106. package/esm/PileupRenderer/layoutFeature.js +1 -2
  107. package/esm/PileupRenderer/makeImageData.d.ts +1 -3
  108. package/esm/PileupRenderer/renderMethylation.js +5 -10
  109. package/esm/PileupRenderer/renderMismatches.d.ts +2 -6
  110. package/esm/PileupRenderer/renderMismatches.js +8 -11
  111. package/esm/PileupRenderer/renderModifications.js +4 -8
  112. package/esm/PileupRenderer/renderSoftClipping.js +26 -25
  113. package/esm/PileupRenderer/sortUtil.js +2 -2
  114. package/esm/SNPCoverageAdapter/util.d.ts +9 -13
  115. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +6 -12
  116. package/esm/shared/BaseDisplayComponent.d.ts +2 -2
  117. package/esm/shared/BaseDisplayComponent.js +3 -2
  118. package/esm/shared/FilterByTag.d.ts +6 -15
  119. package/esm/shared/FilterByTag.js +4 -6
  120. package/esm/shared/fetchChains.js +1 -0
  121. package/esm/shared/index.d.ts +9 -0
  122. package/esm/util.d.ts +3 -9
  123. package/package.json +3 -4
@@ -5,6 +5,7 @@ import { openLocation } from '@jbrowse/core/util/io';
5
5
  import { ObservableCreate } from '@jbrowse/core/util/rxjs';
6
6
  import { toArray } from 'rxjs/operators';
7
7
  import { firstValueFrom } from 'rxjs';
8
+ // locals
8
9
  import CramSlightlyLazyFeature from './CramSlightlyLazyFeature';
9
10
  export default class CramAdapter extends BaseFeatureDataAdapter {
10
11
  constructor() {
@@ -49,7 +50,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
49
50
  }
50
51
  return this.configureP;
51
52
  }
52
- async getHeader(opts) {
53
+ async getHeader(_opts) {
53
54
  const { cram } = await this.configure();
54
55
  return cram.cram.getHeaderText();
55
56
  }
@@ -8,9 +8,7 @@ export function readFeaturesToMismatches(readFeatures, start, qual) {
8
8
  let refPos = 0;
9
9
  let sublen = 0;
10
10
  let lastPos = start;
11
- for (let i = 0; i < readFeatures.length; i++) {
12
- const f = readFeatures[i];
13
- const { code, pos, data, sub, ref } = f;
11
+ for (const { refPos: p, code, pos, data, sub, ref } of readFeatures) {
14
12
  sublen = refPos - lastPos;
15
13
  lastPos = refPos;
16
14
  if (sublen && insLen > 0) {
@@ -22,7 +20,7 @@ export function readFeaturesToMismatches(readFeatures, start, qual) {
22
20
  };
23
21
  insLen = 0;
24
22
  }
25
- refPos = f.refPos - 1 - start;
23
+ refPos = p - 1 - start;
26
24
  if (code === 'X') {
27
25
  // substitution
28
26
  mismatches[j++] = {
@@ -130,8 +128,7 @@ export function readFeaturesToCIGAR(readFeatures, alignmentStart, readLen, refRe
130
128
  let sublen = 0;
131
129
  let insLen = 0;
132
130
  if (readFeatures !== undefined) {
133
- for (let i = 0; i < readFeatures.length; i++) {
134
- const { code, refPos, sub, data } = readFeatures[i];
131
+ for (const { code, refPos, sub, data } of readFeatures) {
135
132
  sublen = refPos - lastPos;
136
133
  seq += ref.slice(lastPos - refStart, refPos - refStart);
137
134
  lastPos = refPos;
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AlignmentsDisplayModel } from '../models/model';
3
- declare function AlignmentsDisplay({ model }: {
3
+ declare const AlignmentsDisplay: ({ model, }: {
4
4
  model: AlignmentsDisplayModel;
5
- }): React.JSX.Element | null;
6
- declare const _default: typeof AlignmentsDisplay;
7
- export default _default;
5
+ }) => React.JSX.Element | null;
6
+ export default AlignmentsDisplay;
@@ -10,7 +10,7 @@ const useStyles = makeStyles()({
10
10
  zIndex: 2,
11
11
  },
12
12
  });
13
- function AlignmentsDisplay({ model }) {
13
+ const AlignmentsDisplay = observer(function AlignmentsDisplay({ model, }) {
14
14
  var _a;
15
15
  const { PileupDisplay, SNPCoverageDisplay } = model;
16
16
  const { classes } = useStyles();
@@ -30,5 +30,5 @@ function AlignmentsDisplay({ model }) {
30
30
  top,
31
31
  } },
32
32
  React.createElement(PileupDisplay.RenderingComponent, { model: PileupDisplay }))));
33
- }
34
- export default observer(AlignmentsDisplay);
33
+ });
34
+ export default AlignmentsDisplay;
@@ -55,10 +55,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
55
55
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
56
56
  rendererTypeName: string;
57
57
  error: unknown;
58
- message: string | undefined; /**
59
- * #property
60
- * refers to LinearPileupDisplay sub-display model
61
- */
58
+ message: string | undefined;
62
59
  } & IStateTreeNode<import("mobx-state-tree").IModelType<{
63
60
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
64
61
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -69,14 +66,13 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
69
66
  message: string | undefined;
70
67
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
71
68
  }> | null;
72
- readonly adapterConfig: any; /**
73
- * #stateModel LinearAlignmentsDisplay
74
- * extends `BaseDisplay`
75
- */
69
+ readonly adapterConfig: any;
76
70
  readonly parentTrack: any;
77
71
  renderProps(): any;
78
72
  readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
79
- readonly DisplayMessageComponent: React.FC<any> | undefined;
73
+ readonly DisplayMessageComponent: React.FC<any> | undefined; /**
74
+ * #action
75
+ */
80
76
  trackMenuItems(): MenuItem[];
81
77
  readonly viewMenuActions: MenuItem[];
82
78
  regionCannotBeRendered(): null;
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react-refresh/only-export-components */
1
2
  import React from 'react';
2
3
  import { autorun, when } from 'mobx';
3
4
  import { addDisposer, getSnapshot, isAlive, types, } from 'mobx-state-tree';
@@ -1,17 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  import { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
3
4
  import { Feature } from '@jbrowse/core/util';
4
5
  import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
6
+ import { IFilter } from '../shared';
5
7
  import { ExtraColorBy } from '../shared/color';
6
- export interface Filter {
7
- flagInclude: number;
8
- flagExclude: number;
9
- readName?: string;
10
- tagFilter?: {
11
- tag: string;
12
- value: string;
13
- };
14
- }
15
8
  /**
16
9
  * #stateModel SharedLinearPileupDisplayMixin
17
10
  * #category display
@@ -61,17 +54,20 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
61
54
  afterAttach(): void;
62
55
  setStatus(message: string): void;
63
56
  setLoading(abortController: AbortController): void;
64
- setMessage(messageText: string): void; /**
65
- * #action
66
- */
57
+ setMessage(messageText: string): void;
67
58
  setRendered(props: {
68
59
  reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
60
+ /**
61
+ * #action
62
+ */
69
63
  features: Map<string, Feature>;
70
64
  layout: any;
71
65
  maxHeightReached: boolean;
72
66
  renderProps: any;
73
67
  } | undefined): void;
74
- setError(error: unknown): void;
68
+ setError(error: unknown): void; /**
69
+ * #action
70
+ */
75
71
  reload(): void;
76
72
  beforeDestroy(): void;
77
73
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
@@ -139,6 +135,10 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
139
135
  value: import("mobx-state-tree").ISimpleType<string>;
140
136
  }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
141
137
  }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
138
+ /**
139
+ * #property
140
+ */
141
+ jexlFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
142
142
  }, {
143
143
  rendererTypeName: string;
144
144
  error: unknown;
@@ -173,11 +173,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
173
173
  } & import("mobx-state-tree/dist/internal").NonEmptyObject & {
174
174
  rendererTypeName: string;
175
175
  error: unknown;
176
- message: string | undefined; /**
176
+ message: string | undefined;
177
+ } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
178
+ id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>; /**
177
179
  * #property
178
180
  */
179
- } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
180
- id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
181
181
  type: import("mobx-state-tree").ISimpleType<string>;
182
182
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
183
183
  }, {
@@ -233,9 +233,14 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
233
233
  regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
234
234
  regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): import("react").JSX.Element | null;
235
235
  } & {
236
- featureIdUnderMouse: string | undefined;
236
+ featureIdUnderMouse: string | undefined; /**
237
+ * #property
238
+ */
237
239
  contextMenuFeature: Feature | undefined;
238
240
  } & {
241
+ /**
242
+ * #property
243
+ */
239
244
  readonly blockType: "dynamicBlocks" | "staticBlocks";
240
245
  readonly blockDefinitions: import("@jbrowse/core/util/blockTypes").BlockSet;
241
246
  } & {
@@ -250,10 +255,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
250
255
  getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
251
256
  searchFeatureByID(id: string): [number, number, number, number] | undefined;
252
257
  } & {
253
- addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void; /**
254
- * #action
255
- * uses copy-to-clipboard and generates notification
256
- */
258
+ addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
257
259
  deleteBlock(key: string): void;
258
260
  selectFeature(feature: Feature): void;
259
261
  clearFeatureSelection(): void;
@@ -323,7 +325,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
323
325
  /**
324
326
  * #action
325
327
  */
326
- setFilterBy(filter: Filter): void;
328
+ setFilterBy(filter: IFilter): void;
329
+ /**
330
+ * #action
331
+ */
332
+ setJexlFilters(filters: string[]): void;
327
333
  } & {
328
334
  /**
329
335
  * #getter
@@ -350,6 +356,10 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
350
356
  * #getter
351
357
  */
352
358
  renderReady(): boolean;
359
+ /**
360
+ * #getter
361
+ */
362
+ readonly filters: SerializableFilterChain;
353
363
  } & {
354
364
  /**
355
365
  * #getter
@@ -372,7 +382,16 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
372
382
  /**
373
383
  * #getter
374
384
  */
375
- readonly DisplayBlurb: (props: import("./components/LinearPileupDisplayBlurb").LinearPileupDisplayBlurbProps) => import("react").JSX.Element | null;
385
+ readonly DisplayBlurb: ({ model, }: {
386
+ model: {
387
+ sortedBy?: {
388
+ pos: number;
389
+ refName: number;
390
+ type: string;
391
+ tag?: string | undefined;
392
+ } | undefined;
393
+ };
394
+ }) => import("react").JSX.Element | null;
376
395
  /**
377
396
  * #method
378
397
  */
@@ -444,17 +463,20 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
444
463
  afterAttach(): void;
445
464
  setStatus(message: string): void;
446
465
  setLoading(abortController: AbortController): void;
447
- setMessage(messageText: string): void; /**
448
- * #action
449
- */
466
+ setMessage(messageText: string): void;
450
467
  setRendered(props: {
451
468
  reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
469
+ /**
470
+ * #action
471
+ */
452
472
  features: Map<string, Feature>;
453
473
  layout: any;
454
474
  maxHeightReached: boolean;
455
475
  renderProps: any;
456
476
  } | undefined): void;
457
- setError(error: unknown): void;
477
+ setError(error: unknown): void; /**
478
+ * #action
479
+ */
458
480
  reload(): void;
459
481
  beforeDestroy(): void;
460
482
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
@@ -3,6 +3,7 @@ import { autorun, observable } from 'mobx';
3
3
  import { cast, types, addDisposer, getSnapshot } from 'mobx-state-tree';
4
4
  import copy from 'copy-to-clipboard';
5
5
  import { ConfigurationReference, readConfObject, getConf, } from '@jbrowse/core/configuration';
6
+ import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
6
7
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
7
8
  import { getEnv, getSession, isSessionModelWithWidgets, getContainingView, SimpleFeature, } from '@jbrowse/core/util';
8
9
  import { BaseLinearDisplay, } from '@jbrowse/plugin-linear-genome-view';
@@ -61,6 +62,10 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
61
62
  * #property
62
63
  */
63
64
  filterBy: types.optional(FilterModel, {}),
65
+ /**
66
+ * #property
67
+ */
68
+ jexlFilters: types.optional(types.array(types.string), []),
64
69
  }))
65
70
  .volatile(() => ({
66
71
  colorTagMap: observable.map({}),
@@ -175,6 +180,12 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
175
180
  setFilterBy(filter) {
176
181
  self.filterBy = cast(filter);
177
182
  },
183
+ /**
184
+ * #action
185
+ */
186
+ setJexlFilters(filters) {
187
+ self.jexlFilters = cast(filters);
188
+ },
178
189
  }))
179
190
  .views(self => ({
180
191
  /**
@@ -218,6 +229,12 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
218
229
  renderReady() {
219
230
  return self.tagsReady;
220
231
  },
232
+ /**
233
+ * #getter
234
+ */
235
+ get filters() {
236
+ return new SerializableFilterChain({ filters: self.jexlFilters });
237
+ },
221
238
  }))
222
239
  .views(self => {
223
240
  const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
@@ -281,6 +298,7 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
281
298
  displayModel: self,
282
299
  colorBy: colorBy ? getSnapshot(colorBy) : undefined,
283
300
  filterBy: JSON.parse(JSON.stringify(filterBy)),
301
+ filters: self.filters,
284
302
  colorTagMap: Object.fromEntries(colorTagMap.toJSON()),
285
303
  config: self.rendererConfig,
286
304
  async onFeatureClick(_, featureId) {
@@ -450,9 +468,9 @@ export function SharedLinearPileupDisplayMixin(configSchema) {
450
468
  if (!self.autorunReady) {
451
469
  return;
452
470
  }
453
- const { colorBy } = self;
471
+ const { colorBy, tagsReady } = self;
454
472
  const { staticBlocks } = view;
455
- if (colorBy === null || colorBy === void 0 ? void 0 : colorBy.tag) {
473
+ if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.tag) && !tagsReady) {
456
474
  const vals = await getUniqueTagValues(self, colorBy, staticBlocks);
457
475
  self.updateColorTagMap(vals);
458
476
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ObservableMap } from 'mobx';
3
- declare function ColorByTagDlg(props: {
3
+ declare const ColorByModificationsDialog: ({ model, handleClose, }: {
4
4
  model: {
5
5
  setColorScheme: (arg: {
6
6
  type: string;
@@ -8,9 +8,8 @@ declare function ColorByTagDlg(props: {
8
8
  modificationTagMap: ObservableMap<string, string>;
9
9
  colorBy?: {
10
10
  type: string;
11
- };
11
+ } | undefined;
12
12
  };
13
13
  handleClose: () => void;
14
- }): React.JSX.Element;
15
- declare const _default: typeof ColorByTagDlg;
16
- export default _default;
14
+ }) => React.JSX.Element;
15
+ export default ColorByModificationsDialog;
@@ -3,8 +3,7 @@ import { observer } from 'mobx-react';
3
3
  import { Button, CircularProgress, DialogActions, DialogContent, Typography, } from '@mui/material';
4
4
  import { Dialog } from '@jbrowse/core/ui';
5
5
  import ModificationTable from './ModificationsTable';
6
- function ColorByTagDlg(props) {
7
- const { model, handleClose } = props;
6
+ const ColorByModificationsDialog = observer(function ({ model, handleClose, }) {
8
7
  const { colorBy, modificationTagMap } = model;
9
8
  const modifications = [...modificationTagMap.entries()];
10
9
  return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Color by modifications" },
@@ -31,5 +30,5 @@ function ColorByTagDlg(props) {
31
30
  handleClose();
32
31
  } }, "Methylation"),
33
32
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel")))));
34
- }
35
- export default observer(ColorByTagDlg);
33
+ });
34
+ export default ColorByModificationsDialog;
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
- declare function ColorByTagDlg(props: {
2
+ declare const ColorByTagDialog: ({ model, handleClose, }: {
3
3
  model: {
4
- setColorScheme: Function;
4
+ setColorScheme: (arg: {
5
+ type: string;
6
+ tag: string;
7
+ }) => void;
5
8
  };
6
9
  handleClose: () => void;
7
- }): React.JSX.Element;
8
- declare const _default: typeof ColorByTagDlg;
9
- export default _default;
10
+ }) => React.JSX.Element;
11
+ export default ColorByTagDialog;
@@ -2,22 +2,19 @@ import React, { useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { Button, DialogContent, DialogActions, TextField, Typography, } from '@mui/material';
4
4
  import { Dialog } from '@jbrowse/core/ui';
5
- function ColorByTagDlg(props) {
6
- const { model, handleClose } = props;
5
+ const ColorByTagDialog = observer(function ({ model, handleClose, }) {
7
6
  const [tag, setTag] = useState('');
8
7
  const validTag = tag.match(/^[A-Za-z][A-Za-z0-9]$/);
9
8
  return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Color by tag" },
10
9
  React.createElement(DialogContent, { style: { overflowX: 'hidden' } },
11
10
  React.createElement(Typography, null, "Enter tag to color by: "),
12
11
  React.createElement(Typography, { color: "textSecondary" }, "Examples: XS or TS for RNA-seq inferred read strand, ts (lower-case) for minimap2 read strand, HP for haplotype, RG for read group, etc."),
13
- React.createElement(TextField, { value: tag, onChange: event => setTag(event.target.value), placeholder: "Enter tag name", inputProps: {
14
- maxLength: 2,
15
- }, error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', autoComplete: "off" }),
12
+ React.createElement(TextField, { value: tag, onChange: event => setTag(event.target.value), placeholder: "Enter tag name", inputProps: { maxLength: 2 }, error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', autoComplete: "off" }),
16
13
  React.createElement(DialogActions, null,
17
14
  React.createElement(Button, { variant: "contained", color: "primary", onClick: () => {
18
15
  model.setColorScheme({ type: 'tag', tag });
19
16
  handleClose();
20
17
  }, disabled: !validTag }, "Submit"),
21
18
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: handleClose }, "Cancel")))));
22
- }
23
- export default observer(ColorByTagDlg);
19
+ });
20
+ export default ColorByTagDialog;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export interface LinearPileupDisplayBlurbProps {
2
+ declare const LinearPileupDisplayBlurb: ({ model, }: {
3
3
  model: {
4
4
  sortedBy?: {
5
5
  pos: number;
@@ -8,6 +8,5 @@ export interface LinearPileupDisplayBlurbProps {
8
8
  tag?: string;
9
9
  };
10
10
  };
11
- }
12
- declare const _default: (props: LinearPileupDisplayBlurbProps) => React.JSX.Element | null;
13
- export default _default;
11
+ }) => React.JSX.Element | null;
12
+ export default LinearPileupDisplayBlurb;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { Typography } from '@mui/material';
4
- export default observer(function LinearPileupDisplayBlurb(props) {
4
+ const LinearPileupDisplayBlurb = observer(function ({ model, }) {
5
5
  var _a;
6
- const { model } = props;
7
6
  const { sortedBy } = model;
8
7
  return sortedBy ? (React.createElement("div", { "data-testid": `blurb-${sortedBy}` },
9
8
  React.createElement(Typography, { color: "secondary", variant: "caption" }, sortedBy
10
9
  ? `Sorted by ${(_a = sortedBy.tag) !== null && _a !== void 0 ? _a : sortedBy.type} at ${sortedBy.refName}:${sortedBy.pos}`
11
10
  : null))) : null;
12
11
  });
12
+ export default LinearPileupDisplayBlurb;
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
- declare function SetFeatureHeightDlg(props: {
2
+ declare const SetFeatureHeightDialog: (props: {
3
3
  model: {
4
4
  setFeatureHeight: (arg?: number) => void;
5
5
  setNoSpacing: (arg?: boolean) => void;
6
6
  featureHeightSetting: number;
7
- noSpacing?: boolean;
7
+ noSpacing?: boolean | undefined;
8
8
  };
9
9
  handleClose: () => void;
10
- }): React.JSX.Element;
11
- declare const _default: typeof SetFeatureHeightDlg;
12
- export default _default;
10
+ }) => React.JSX.Element;
11
+ export default SetFeatureHeightDialog;
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { Button, Checkbox, DialogActions, DialogContent, FormControlLabel, TextField, Typography, } from '@mui/material';
4
4
  import { Dialog } from '@jbrowse/core/ui';
5
- function SetFeatureHeightDlg(props) {
5
+ const SetFeatureHeightDialog = observer(function (props) {
6
6
  const { model, handleClose } = props;
7
7
  const { featureHeightSetting, noSpacing: noSpacingSetting } = model;
8
8
  const [height, setHeight] = useState(`${featureHeightSetting}`);
@@ -20,5 +20,5 @@ function SetFeatureHeightDlg(props) {
20
20
  handleClose();
21
21
  } }, "Submit"),
22
22
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel")))));
23
- }
24
- export default observer(SetFeatureHeightDlg);
23
+ });
24
+ export default SetFeatureHeightDialog;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- declare function SetMaxHeightDlg(props: {
2
+ declare const SetMaxHeightDialog: (props: {
3
3
  model: {
4
4
  maxHeight?: number;
5
5
  setMaxHeight: Function;
6
6
  };
7
7
  handleClose: () => void;
8
- }): React.JSX.Element;
9
- declare const _default: typeof SetMaxHeightDlg;
10
- export default _default;
8
+ }) => React.JSX.Element;
9
+ export default SetMaxHeightDialog;
@@ -8,7 +8,7 @@ const useStyles = makeStyles()({
8
8
  width: 500,
9
9
  },
10
10
  });
11
- function SetMaxHeightDlg(props) {
11
+ const SetMaxHeightDialog = observer(function (props) {
12
12
  const { model, handleClose } = props;
13
13
  const { classes } = useStyles();
14
14
  const { maxHeight = '' } = model;
@@ -23,5 +23,5 @@ function SetMaxHeightDlg(props) {
23
23
  handleClose();
24
24
  } }, "Submit"),
25
25
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel")))));
26
- }
27
- export default observer(SetMaxHeightDlg);
26
+ });
27
+ export default SetMaxHeightDialog;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- declare function SortByTagDlg(props: {
2
+ declare const SortByTagDialog: (props: {
3
3
  model: {
4
4
  setSortedBy: Function;
5
5
  };
6
6
  handleClose: () => void;
7
- }): React.JSX.Element;
8
- declare const _default: typeof SortByTagDlg;
9
- export default _default;
7
+ }) => React.JSX.Element;
8
+ export default SortByTagDialog;
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
4
4
  import { Dialog } from '@jbrowse/core/ui';
5
- function SortByTagDlg(props) {
5
+ const SortByTagDialog = observer(function (props) {
6
6
  const { model, handleClose } = props;
7
7
  const [tag, setTag] = useState('');
8
8
  const validTag = tag.match(/^[A-Za-z][A-Za-z0-9]$/);
@@ -20,5 +20,5 @@ function SortByTagDlg(props) {
20
20
  handleClose();
21
21
  } }, "Submit"),
22
22
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel")))));
23
- }
24
- export default observer(SortByTagDlg);
23
+ });
24
+ export default SortByTagDialog;