@jbrowse/plugin-alignments 2.16.1 → 2.17.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.
Files changed (215) hide show
  1. package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -2
  2. package/dist/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
  3. package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
  4. package/dist/BamAdapter/BamAdapter.d.ts +3 -2
  5. package/dist/BamAdapter/BamAdapter.js +34 -11
  6. package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
  7. package/dist/BamAdapter/BamSlightlyLazyFeature.js +42 -72
  8. package/dist/CramAdapter/CramAdapter.d.ts +4 -3
  9. package/dist/CramAdapter/CramAdapter.js +24 -7
  10. package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
  11. package/dist/CramAdapter/CramSlightlyLazyFeature.js +74 -73
  12. package/dist/CramAdapter/util.d.ts +1 -10
  13. package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
  14. package/dist/LinearAlignmentsDisplay/index.js +2 -2
  15. package/dist/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
  16. package/dist/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
  17. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
  18. package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +43 -21
  19. package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
  20. package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
  21. package/dist/LinearPileupDisplay/components/GroupByDialog.js +8 -6
  22. package/dist/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
  23. package/dist/LinearPileupDisplay/model.d.ts +40 -40
  24. package/dist/LinearPileupDisplay/model.js +118 -41
  25. package/dist/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
  26. package/dist/LinearReadArcsDisplay/model.d.ts +22 -21
  27. package/dist/LinearReadArcsDisplay/model.js +13 -14
  28. package/dist/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
  29. package/dist/LinearReadCloudDisplay/model.d.ts +14 -22
  30. package/dist/LinearReadCloudDisplay/model.js +12 -13
  31. package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
  32. package/dist/LinearSNPCoverageDisplay/index.js +3 -2
  33. package/dist/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
  34. package/dist/LinearSNPCoverageDisplay/{models/model.js → model.js} +71 -45
  35. package/dist/MismatchParser/cigarToMismatches.d.ts +3 -0
  36. package/dist/MismatchParser/cigarToMismatches.js +94 -0
  37. package/dist/MismatchParser/getNextRefPos.d.ts +4 -0
  38. package/dist/MismatchParser/getNextRefPos.js +40 -0
  39. package/dist/MismatchParser/index.d.ts +4 -29
  40. package/dist/MismatchParser/index.js +10 -327
  41. package/dist/MismatchParser/mdToMismatches.d.ts +3 -0
  42. package/dist/MismatchParser/mdToMismatches.js +80 -0
  43. package/dist/ModificationParser/index.d.ts +19 -0
  44. package/dist/ModificationParser/index.js +144 -0
  45. package/dist/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  46. package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
  47. package/dist/PileupRPC/methods/GetReducedFeatures.js +19 -16
  48. package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
  49. package/dist/PileupRPC/methods/GetVisibleModifications.js +9 -6
  50. package/dist/PileupRenderer/PileupLayoutSession.d.ts +8 -7
  51. package/dist/PileupRenderer/PileupRenderer.d.ts +6 -14
  52. package/dist/PileupRenderer/PileupRenderer.js +7 -5
  53. package/dist/PileupRenderer/renderAlignment.js +17 -4
  54. package/dist/PileupRenderer/renderAlignmentShape.js +102 -21
  55. package/dist/PileupRenderer/renderMethylation.d.ts +2 -1
  56. package/dist/PileupRenderer/renderMethylation.js +17 -9
  57. package/dist/PileupRenderer/renderMismatches.js +19 -19
  58. package/dist/PileupRenderer/renderModifications.d.ts +3 -2
  59. package/dist/PileupRenderer/renderModifications.js +31 -34
  60. package/dist/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
  61. package/dist/PileupRenderer/renderPerBaseLettering.js +1 -3
  62. package/dist/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
  63. package/dist/PileupRenderer/renderPerBaseQuality.js +1 -3
  64. package/dist/PileupRenderer/renderSoftClipping.js +6 -6
  65. package/dist/PileupRenderer/sortUtil.d.ts +2 -7
  66. package/dist/PileupRenderer/sortUtil.js +13 -13
  67. package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
  68. package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
  69. package/dist/SNPCoverageAdapter/generateCoverageBins.js +269 -166
  70. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
  71. package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
  72. package/dist/shared/color.d.ts +0 -10
  73. package/dist/shared/color.js +1 -7
  74. package/{esm/shared → dist/shared/components}/BaseDisplayComponent.d.ts +2 -2
  75. package/{esm/shared → dist/shared/components}/FilterByTagDialog.d.ts +3 -3
  76. package/dist/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
  77. package/dist/shared/fetchChains.js +1 -2
  78. package/dist/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
  79. package/dist/shared/getMaximumModificationAtEachPosition.js +42 -0
  80. package/dist/shared/getUniqueModifications.d.ts +14 -0
  81. package/dist/shared/getUniqueModifications.js +16 -0
  82. package/dist/shared/getUniqueTags.d.ts +15 -0
  83. package/dist/shared/getUniqueTags.js +18 -0
  84. package/dist/shared/types.d.ts +94 -0
  85. package/dist/shared/util.d.ts +8 -0
  86. package/dist/shared/util.js +26 -0
  87. package/dist/util.d.ts +6 -3
  88. package/dist/util.js +24 -29
  89. package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +1 -2
  90. package/esm/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
  91. package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
  92. package/esm/BamAdapter/BamAdapter.d.ts +3 -2
  93. package/esm/BamAdapter/BamAdapter.js +31 -8
  94. package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
  95. package/esm/BamAdapter/BamSlightlyLazyFeature.js +43 -73
  96. package/esm/CramAdapter/CramAdapter.d.ts +4 -3
  97. package/esm/CramAdapter/CramAdapter.js +22 -5
  98. package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
  99. package/esm/CramAdapter/CramSlightlyLazyFeature.js +74 -73
  100. package/esm/CramAdapter/util.d.ts +1 -10
  101. package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
  102. package/esm/LinearAlignmentsDisplay/index.js +2 -2
  103. package/esm/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
  104. package/esm/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
  105. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
  106. package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +45 -23
  107. package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
  108. package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
  109. package/esm/LinearPileupDisplay/components/GroupByDialog.js +8 -6
  110. package/esm/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
  111. package/esm/LinearPileupDisplay/model.d.ts +40 -40
  112. package/esm/LinearPileupDisplay/model.js +119 -42
  113. package/esm/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
  114. package/esm/LinearReadArcsDisplay/model.d.ts +22 -21
  115. package/esm/LinearReadArcsDisplay/model.js +14 -15
  116. package/esm/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
  117. package/esm/LinearReadCloudDisplay/model.d.ts +14 -22
  118. package/esm/LinearReadCloudDisplay/model.js +13 -14
  119. package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
  120. package/esm/LinearSNPCoverageDisplay/index.js +3 -2
  121. package/esm/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
  122. package/esm/LinearSNPCoverageDisplay/{models/model.js → model.js} +72 -46
  123. package/esm/MismatchParser/cigarToMismatches.d.ts +3 -0
  124. package/esm/MismatchParser/cigarToMismatches.js +91 -0
  125. package/esm/MismatchParser/getNextRefPos.d.ts +4 -0
  126. package/esm/MismatchParser/getNextRefPos.js +37 -0
  127. package/esm/MismatchParser/index.d.ts +4 -29
  128. package/esm/MismatchParser/index.js +5 -317
  129. package/esm/MismatchParser/mdToMismatches.d.ts +3 -0
  130. package/esm/MismatchParser/mdToMismatches.js +77 -0
  131. package/esm/ModificationParser/index.d.ts +19 -0
  132. package/esm/ModificationParser/index.js +138 -0
  133. package/esm/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
  134. package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
  135. package/esm/PileupRPC/methods/GetReducedFeatures.js +19 -16
  136. package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
  137. package/esm/PileupRPC/methods/GetVisibleModifications.js +9 -6
  138. package/esm/PileupRenderer/PileupLayoutSession.d.ts +8 -7
  139. package/esm/PileupRenderer/PileupRenderer.d.ts +6 -14
  140. package/esm/PileupRenderer/PileupRenderer.js +8 -6
  141. package/esm/PileupRenderer/renderAlignment.js +17 -4
  142. package/esm/PileupRenderer/renderAlignmentShape.js +102 -21
  143. package/esm/PileupRenderer/renderMethylation.d.ts +2 -1
  144. package/esm/PileupRenderer/renderMethylation.js +17 -9
  145. package/esm/PileupRenderer/renderMismatches.js +19 -19
  146. package/esm/PileupRenderer/renderModifications.d.ts +3 -2
  147. package/esm/PileupRenderer/renderModifications.js +30 -33
  148. package/esm/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
  149. package/esm/PileupRenderer/renderPerBaseLettering.js +1 -3
  150. package/esm/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
  151. package/esm/PileupRenderer/renderPerBaseQuality.js +1 -3
  152. package/esm/PileupRenderer/renderSoftClipping.js +6 -6
  153. package/esm/PileupRenderer/sortUtil.d.ts +2 -7
  154. package/esm/PileupRenderer/sortUtil.js +13 -13
  155. package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
  156. package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
  157. package/esm/SNPCoverageAdapter/generateCoverageBins.js +269 -166
  158. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
  159. package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
  160. package/esm/shared/color.d.ts +0 -10
  161. package/esm/shared/color.js +0 -6
  162. package/{dist/shared → esm/shared/components}/BaseDisplayComponent.d.ts +2 -2
  163. package/{dist/shared → esm/shared/components}/FilterByTagDialog.d.ts +3 -3
  164. package/esm/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
  165. package/esm/shared/fetchChains.js +1 -2
  166. package/esm/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
  167. package/esm/shared/getMaximumModificationAtEachPosition.js +39 -0
  168. package/esm/shared/getUniqueModifications.d.ts +14 -0
  169. package/esm/shared/getUniqueModifications.js +13 -0
  170. package/esm/shared/getUniqueTags.d.ts +15 -0
  171. package/esm/shared/getUniqueTags.js +15 -0
  172. package/esm/shared/types.d.ts +94 -0
  173. package/esm/shared/util.d.ts +8 -0
  174. package/esm/shared/util.js +23 -0
  175. package/esm/util.d.ts +6 -3
  176. package/esm/util.js +22 -26
  177. package/package.json +4 -4
  178. package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
  179. package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -41
  180. package/dist/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
  181. package/dist/LinearPileupDisplay/components/ModificationsTable.js +0 -28
  182. package/dist/SNPCoverageAdapter/util.d.ts +0 -25
  183. package/dist/shared/index.d.ts +0 -49
  184. package/dist/shared/index.js +0 -41
  185. package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
  186. package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -36
  187. package/esm/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
  188. package/esm/LinearPileupDisplay/components/ModificationsTable.js +0 -22
  189. package/esm/SNPCoverageAdapter/util.d.ts +0 -25
  190. package/esm/shared/index.d.ts +0 -49
  191. package/esm/shared/index.js +0 -36
  192. /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
  193. /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
  194. /package/dist/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
  195. /package/dist/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
  196. /package/dist/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
  197. /package/dist/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
  198. /package/dist/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
  199. /package/dist/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
  200. /package/dist/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
  201. /package/dist/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
  202. /package/dist/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
  203. /package/dist/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
  204. /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
  205. /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
  206. /package/esm/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
  207. /package/esm/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
  208. /package/esm/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
  209. /package/esm/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
  210. /package/esm/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
  211. /package/esm/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
  212. /package/esm/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
  213. /package/esm/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
  214. /package/esm/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
  215. /package/esm/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  import { Instance } from 'mobx-state-tree';
2
2
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
3
+ import { ModificationType, ModificationTypeWithColor, SortedBy } from '../shared/types';
3
4
  /**
4
5
  * #stateModel LinearPileupDisplay
5
6
  * #category display
@@ -48,9 +49,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
48
49
  message: React.ReactNode;
49
50
  filled?: boolean;
50
51
  status?: string;
51
- reactElement? /**
52
- * #property
53
- */: React.ReactElement;
52
+ reactElement?: React.ReactElement;
54
53
  };
55
54
  }) => import("react").JSX.Element | undefined;
56
55
  renderProps: any;
@@ -61,9 +60,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
61
60
  setLoading(abortController: AbortController): void;
62
61
  setMessage(messageText: string): void;
63
62
  setRendered(props: {
64
- reactElement: React.ReactElement /**
65
- * #action
66
- */;
63
+ reactElement: React.ReactElement;
67
64
  features: Map<string, import("@jbrowse/core/util").Feature>;
68
65
  layout: any;
69
66
  maxHeightReached: boolean;
@@ -107,33 +104,15 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
107
104
  noSpacing: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
108
105
  fadeLikelihood: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
109
106
  trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
110
- colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
111
- type: import("mobx-state-tree").ISimpleType<string>;
112
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
113
- extra: import("mobx-state-tree").IType<any, any, any>;
114
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
115
- filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
116
- flagInclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
117
- flagExclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
118
- readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
119
- tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
120
- tag: import("mobx-state-tree").ISimpleType<string>;
121
- value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
122
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
123
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
107
+ colorBy: import("mobx-state-tree").IType<import("../shared/types").ColorBy | undefined, import("../shared/types").ColorBy | undefined, import("../shared/types").ColorBy | undefined>;
108
+ filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("../shared/types").FilterBy, import("../shared/types").FilterBy, import("../shared/types").FilterBy>, [undefined]>;
124
109
  jexlFilters: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>, [undefined]>;
125
110
  } & {
126
111
  type: import("mobx-state-tree").ISimpleType<"LinearPileupDisplay">;
127
112
  configuration: AnyConfigurationSchemaType;
128
113
  showSoftClipping: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
129
114
  mismatchAlpha: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
130
- sortedBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
131
- type: import("mobx-state-tree").ISimpleType<string>;
132
- pos: import("mobx-state-tree").ISimpleType<number>;
133
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
134
- refName: import("mobx-state-tree").ISimpleType<string>;
135
- assemblyName: import("mobx-state-tree").ISimpleType<string>;
136
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
115
+ sortedBy: import("mobx-state-tree").IType<SortedBy | undefined, SortedBy | undefined, SortedBy | undefined>;
137
116
  }, {
138
117
  rendererTypeName: string;
139
118
  error: unknown;
@@ -156,10 +135,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
156
135
  rendererTypeName: string;
157
136
  error: unknown;
158
137
  message: string | undefined;
159
- }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree" /**
138
+ }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
139
+ onHorizontalScroll? /**
160
140
  * #property
161
- */)._NotCustomized>>;
162
- onHorizontalScroll?: () => void;
141
+ */: () => void;
163
142
  blockState?: Record<string, any>;
164
143
  }>;
165
144
  readonly DisplayBlurb: React.FC<{
@@ -272,17 +251,13 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
272
251
  setMaxHeight(n?: number): void;
273
252
  setFeatureHeight(n?: number): void;
274
253
  setNoSpacing(flag?: boolean): void;
275
- setColorScheme(colorScheme: {
276
- type: string;
277
- tag?: string;
278
- extra?: import("../shared/color").ExtraColorBy;
279
- }): void;
254
+ setColorScheme(colorScheme: import("../shared/types").ColorBy): void;
280
255
  updateColorTagMap(uniqueTag: string[]): void;
281
256
  setFeatureUnderMouse(feat?: import("@jbrowse/core/util").Feature): void;
282
257
  selectFeature(feature: import("@jbrowse/core/util").Feature): void;
283
258
  copyFeatureToClipboard(feature: import("@jbrowse/core/util").Feature): void;
284
259
  setConfig(conf: import("@jbrowse/core/configuration").AnyConfigurationModel): void;
285
- setFilterBy(filter: import("../shared").IFilter): void;
260
+ setFilterBy(filter: import("../shared/types").FilterBy): void;
286
261
  setJexlFilters(filters: string[]): void;
287
262
  } & {
288
263
  readonly rendererConfig: {
@@ -342,9 +317,21 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
342
317
  } & {
343
318
  afterAttach(): void;
344
319
  } & {
320
+ /**
321
+ * #volatile
322
+ */
345
323
  sortReady: boolean;
324
+ /**
325
+ * #volatile
326
+ */
346
327
  currSortBpPerPx: number;
347
- modificationTagMap: import("mobx").ObservableMap<string, string>;
328
+ /**
329
+ * #volatile
330
+ */
331
+ visibleModifications: import("mobx").ObservableMap<string, ModificationTypeWithColor>;
332
+ /**
333
+ * #volatile
334
+ */
348
335
  modificationsReady: boolean;
349
336
  } & {
350
337
  /**
@@ -354,7 +341,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
354
341
  /**
355
342
  * #action
356
343
  */
357
- updateModificationColorMap(uniqueModifications: string[]): void;
344
+ updateVisibleModifications(uniqueModifications: ModificationType[]): void;
358
345
  /**
359
346
  * #action
360
347
  */
@@ -391,6 +378,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
391
378
  */
392
379
  reload(): void;
393
380
  } & {
381
+ /**
382
+ * #getter
383
+ */
384
+ readonly visibleModificationTypes: string[];
394
385
  /**
395
386
  * #getter
396
387
  */
@@ -451,8 +442,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
451
442
  readonly label: "Pair orientation";
452
443
  readonly onClick: () => void;
453
444
  }, {
454
- readonly label: "Modifications or methylation";
455
- readonly onClick: () => void;
445
+ readonly label: "Modifications";
446
+ readonly type: "subMenu";
447
+ readonly subMenu: ({
448
+ label: string;
449
+ onClick: () => void;
450
+ type?: undefined;
451
+ } | {
452
+ type: string;
453
+ label?: undefined;
454
+ onClick?: undefined;
455
+ })[];
456
456
  }, {
457
457
  readonly label: "Insert size";
458
458
  readonly onClick: () => void;
@@ -1,22 +1,21 @@
1
1
  import { lazy } from 'react';
2
- import { types } from 'mobx-state-tree';
2
+ import { observable } from 'mobx';
3
+ import { types, isAlive } from 'mobx-state-tree';
3
4
  import { ConfigurationReference, readConfObject, getConf, } from '@jbrowse/core/configuration';
4
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
5
6
  import { getEnv, getSession, getContainingView } from '@jbrowse/core/util';
6
- import { getUniqueModificationValues } from '../shared';
7
- import { createAutorun, randomColor, modificationColors } from '../util';
8
7
  // icons
9
8
  import VisibilityIcon from '@mui/icons-material/Visibility';
10
- import SortIcon from '@mui/icons-material/Sort';
9
+ import SwapVertIcon from '@mui/icons-material/SwapVert';
11
10
  import WorkspacesIcon from '@mui/icons-material/Workspaces';
12
11
  import ColorLensIcon from '@mui/icons-material/ColorLens';
13
12
  // locals
14
13
  import { SharedLinearPileupDisplayMixin } from './SharedLinearPileupDisplayMixin';
15
- import { observable } from 'mobx';
14
+ import { createAutorun, getColorForModification, modificationData, } from '../util';
15
+ import { getUniqueModifications } from '../shared/getUniqueModifications';
16
16
  // lazies
17
17
  const SortByTagDialog = lazy(() => import('./components/SortByTagDialog'));
18
18
  const GroupByDialog = lazy(() => import('./components/GroupByDialog'));
19
- const ModificationsDialog = lazy(() => import('./components/ColorByModificationsDialog'));
20
19
  /**
21
20
  * #stateModel LinearPileupDisplay
22
21
  * #category display
@@ -45,18 +44,24 @@ function stateModelFactory(configSchema) {
45
44
  /**
46
45
  * #property
47
46
  */
48
- sortedBy: types.maybe(types.model({
49
- type: types.string,
50
- pos: types.number,
51
- tag: types.maybe(types.string),
52
- refName: types.string,
53
- assemblyName: types.string,
54
- })),
47
+ sortedBy: types.frozen(),
55
48
  }))
56
49
  .volatile(() => ({
50
+ /**
51
+ * #volatile
52
+ */
57
53
  sortReady: false,
54
+ /**
55
+ * #volatile
56
+ */
58
57
  currSortBpPerPx: 0,
59
- modificationTagMap: observable.map({}),
58
+ /**
59
+ * #volatile
60
+ */
61
+ visibleModifications: observable.map({}),
62
+ /**
63
+ * #volatile
64
+ */
60
65
  modificationsReady: false,
61
66
  }))
62
67
  .actions(self => ({
@@ -69,10 +74,13 @@ function stateModelFactory(configSchema) {
69
74
  /**
70
75
  * #action
71
76
  */
72
- updateModificationColorMap(uniqueModifications) {
77
+ updateVisibleModifications(uniqueModifications) {
73
78
  uniqueModifications.forEach(value => {
74
- if (!self.modificationTagMap.has(value)) {
75
- self.modificationTagMap.set(value, modificationColors[value] || randomColor(value));
79
+ if (!self.visibleModifications.has(value.type)) {
80
+ self.visibleModifications.set(value.type, {
81
+ ...value,
82
+ color: getColorForModification(value.type),
83
+ });
76
84
  }
77
85
  });
78
86
  },
@@ -152,6 +160,12 @@ function stateModelFactory(configSchema) {
152
160
  };
153
161
  })
154
162
  .views(self => ({
163
+ /**
164
+ * #getter
165
+ */
166
+ get visibleModificationTypes() {
167
+ return [...self.visibleModifications.keys()];
168
+ },
155
169
  /**
156
170
  * #getter
157
171
  */
@@ -196,13 +210,13 @@ function stateModelFactory(configSchema) {
196
210
  * #method
197
211
  */
198
212
  renderPropsPre() {
199
- const { sortedBy, showSoftClipping, modificationTagMap } = self;
213
+ const { sortedBy, showSoftClipping, visibleModifications } = self;
200
214
  const superProps = superRenderPropsPre();
201
215
  return {
202
216
  ...superProps,
203
217
  showSoftClip: showSoftClipping,
204
218
  sortedBy,
205
- modificationTagMap: Object.fromEntries(modificationTagMap.toJSON()),
219
+ visibleModifications: Object.fromEntries(visibleModifications.toJSON()),
206
220
  };
207
221
  },
208
222
  /**
@@ -224,7 +238,7 @@ function stateModelFactory(configSchema) {
224
238
  ...superTrackMenuItems(),
225
239
  {
226
240
  label: 'Sort by...',
227
- icon: SortIcon,
241
+ icon: SwapVertIcon,
228
242
  disabled: self.showSoftClipping,
229
243
  subMenu: [
230
244
  ...['Start location', 'Read strand', 'Base pair'].map(option => ({
@@ -260,25 +274,88 @@ function stateModelFactory(configSchema) {
260
274
  {
261
275
  label: 'Pair orientation',
262
276
  onClick: () => {
263
- self.setColorScheme({ type: 'pairOrientation' });
277
+ self.setColorScheme({
278
+ type: 'pairOrientation',
279
+ });
264
280
  },
265
281
  },
266
282
  {
267
- label: 'Modifications or methylation',
268
- onClick: () => {
269
- getSession(self).queueDialog(doneCallback => [
270
- ModificationsDialog,
283
+ label: 'Modifications',
284
+ type: 'subMenu',
285
+ subMenu: self.modificationsReady
286
+ ? [
271
287
  {
272
- model: self,
273
- handleClose: doneCallback,
288
+ label: 'All modifications',
289
+ onClick: () => {
290
+ self.setColorScheme({
291
+ type: 'modifications',
292
+ });
293
+ },
274
294
  },
275
- ]);
276
- },
295
+ ...self.visibleModificationTypes.map(key => {
296
+ var _a;
297
+ return ({
298
+ label: `Show only ${((_a = modificationData[key]) === null || _a === void 0 ? void 0 : _a.name) || key}`,
299
+ onClick: () => {
300
+ self.setColorScheme({
301
+ type: 'modifications',
302
+ modifications: {
303
+ isolatedModification: key,
304
+ },
305
+ });
306
+ },
307
+ });
308
+ }),
309
+ { type: 'divider' },
310
+ {
311
+ label: 'All modifications (<50% prob colored blue)',
312
+ onClick: () => {
313
+ self.setColorScheme({
314
+ type: 'modifications',
315
+ modifications: {
316
+ twoColor: true,
317
+ },
318
+ });
319
+ },
320
+ },
321
+ ...self.visibleModificationTypes.map(key => {
322
+ var _a;
323
+ return ({
324
+ label: `Show only ${((_a = modificationData[key]) === null || _a === void 0 ? void 0 : _a.name) || key} (<50% prob colored blue)`,
325
+ onClick: () => {
326
+ self.setColorScheme({
327
+ type: 'modifications',
328
+ modifications: {
329
+ isolatedModification: key,
330
+ twoColor: true,
331
+ },
332
+ });
333
+ },
334
+ });
335
+ }),
336
+ { type: 'divider' },
337
+ {
338
+ label: 'All reference CpGs',
339
+ onClick: () => {
340
+ self.setColorScheme({
341
+ type: 'methylation',
342
+ });
343
+ },
344
+ },
345
+ ]
346
+ : [
347
+ {
348
+ label: 'Loading modifications...',
349
+ onClick: () => { },
350
+ },
351
+ ],
277
352
  },
278
353
  {
279
354
  label: 'Insert size',
280
355
  onClick: () => {
281
- self.setColorScheme({ type: 'insertSize' });
356
+ self.setColorScheme({
357
+ type: 'insertSize',
358
+ });
282
359
  },
283
360
  },
284
361
  ...superColorSchemeSubMenuItems(),
@@ -360,25 +437,25 @@ function stateModelFactory(configSchema) {
360
437
  ...self.renderPropsPre(),
361
438
  });
362
439
  }
363
- self.setCurrSortBpPerPx(bpPerPx);
364
- self.setSortReady(true);
440
+ if (isAlive(self)) {
441
+ self.setCurrSortBpPerPx(bpPerPx);
442
+ self.setSortReady(true);
443
+ }
365
444
  }, { delay: 1000 });
366
445
  createAutorun(self, async () => {
367
446
  if (!self.autorunReady) {
368
447
  return;
369
448
  }
370
- const { parentTrack, colorBy } = self;
371
449
  const { staticBlocks } = getContainingView(self);
372
- if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
373
- const adapter = getConf(parentTrack, ['adapter']);
374
- const vals = await getUniqueModificationValues({
375
- self,
376
- adapterConfig: adapter,
377
- blocks: staticBlocks,
378
- });
379
- self.updateModificationColorMap(vals);
450
+ const vals = await getUniqueModifications({
451
+ self,
452
+ adapterConfig: getConf(self.parentTrack, 'adapter'),
453
+ blocks: staticBlocks,
454
+ });
455
+ if (isAlive(self)) {
456
+ self.updateVisibleModifications(vals);
457
+ self.setModificationsReady(true);
380
458
  }
381
- self.setModificationsReady(true);
382
459
  });
383
460
  },
384
461
  }));
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { getContainingView } from '@jbrowse/core/util';
4
- import BaseDisplayComponent from '../../shared/BaseDisplayComponent';
4
+ import BaseDisplayComponent from '../../shared/components/BaseDisplayComponent';
5
5
  const Arcs = observer(function ({ model, }) {
6
6
  const view = getContainingView(model);
7
7
  const width = Math.round(view.dynamicBlocks.totalWidthPx);
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Instance } from 'mobx-state-tree';
3
3
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
4
- import { IFilter } from '../shared';
4
+ import { ColorBy, FilterBy } from '../shared/types';
5
5
  import { ChainData } from '../shared/fetchChains';
6
6
  /**
7
7
  * #stateModel LinearReadArcsDisplay
@@ -24,22 +24,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
24
24
  } & {
25
25
  type: import("mobx-state-tree").ISimpleType<"LinearReadArcsDisplay">;
26
26
  configuration: AnyConfigurationSchemaType;
27
- filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{
28
- flagInclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
29
- flagExclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
30
- readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
31
- tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
32
- tag: import("mobx-state-tree").ISimpleType<string>;
33
- value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
34
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
35
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
27
+ filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<FilterBy, FilterBy, FilterBy>, [undefined]>;
36
28
  lineWidth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
37
29
  jitter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
38
- colorBy: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
39
- type: import("mobx-state-tree").ISimpleType<string>;
40
- tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
41
- extra: import("mobx-state-tree").IType<any, any, any>;
42
- }, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
30
+ colorBy: import("mobx-state-tree").IType<ColorBy | undefined, ColorBy | undefined, ColorBy | undefined>;
43
31
  drawInter: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
44
32
  drawLongRange: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
45
33
  }, {
@@ -66,9 +54,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
66
54
  message: string | undefined;
67
55
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
68
56
  onHorizontalScroll?: () => void;
69
- blockState?: Record<string, any>;
57
+ blockState? /**
58
+ * #property
59
+ */: Record<string, any>;
70
60
  }>;
71
- readonly DisplayBlurb: React.FC<{
61
+ readonly DisplayBlurb: React.
62
+ /**
63
+ * #property
64
+ */
65
+ FC /**
66
+ * #property
67
+ */<{
72
68
  model: {
73
69
  id: string;
74
70
  type: string;
@@ -79,7 +75,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
79
75
  message: string | undefined;
80
76
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
81
77
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
82
- type: import("mobx-state-tree").ISimpleType<string>;
78
+ type: import("mobx-state-tree" /**
79
+ * #action
80
+ */).ISimpleType<string>;
83
81
  rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
84
82
  }, {
85
83
  rendererTypeName: string;
@@ -91,7 +89,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
91
89
  readonly parentTrack: any;
92
90
  renderProps(): any;
93
91
  readonly rendererType: import("@jbrowse/core/pluggableElementTypes").RendererType;
94
- readonly DisplayMessageComponent: undefined | React.FC<any>;
92
+ readonly DisplayMessageComponent: undefined | React.FC /**
93
+ * #action
94
+ * thin, bold, extrabold, etc
95
+ */<any>;
95
96
  trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
96
97
  readonly viewMenuActions: import("@jbrowse/core/ui").MenuItem[];
97
98
  regionCannotBeRendered(): null;
@@ -165,7 +166,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
165
166
  /**
166
167
  * #action
167
168
  */
168
- setColorScheme(s: {
169
+ setColorScheme(colorBy: {
169
170
  type: string;
170
171
  }): void;
171
172
  /**
@@ -183,7 +184,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
183
184
  /**
184
185
  * #action
185
186
  */
186
- setFilterBy(filter: IFilter): void;
187
+ setFilterBy(filter: FilterBy): void;
187
188
  /**
188
189
  * #action
189
190
  * thin, bold, extrabold, etc
@@ -1,5 +1,5 @@
1
1
  import { lazy } from 'react';
2
- import { cast, types } from 'mobx-state-tree';
2
+ import { types } from 'mobx-state-tree';
3
3
  import { ConfigurationReference, getConf, } from '@jbrowse/core/configuration';
4
4
  import { getSession } from '@jbrowse/core/util';
5
5
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes';
@@ -7,10 +7,9 @@ import { FeatureDensityMixin, TrackHeightMixin, } from '@jbrowse/plugin-linear-g
7
7
  // icons
8
8
  import PaletteIcon from '@mui/icons-material/Palette';
9
9
  import FilterListIcon from '@mui/icons-material/ClearAll';
10
- // locals
11
- import { FilterModel } from '../shared';
12
- // async
13
- const FilterByTagDialog = lazy(() => import('../shared/FilterByTagDialog'));
10
+ import { defaultFilterFlags } from '../shared/util';
11
+ // lazies
12
+ const FilterByTagDialog = lazy(() => import('../shared/components/FilterByTagDialog'));
14
13
  /**
15
14
  * #stateModel LinearReadArcsDisplay
16
15
  * the arc display is a non-block-based track, so draws to a single canvas and
@@ -34,7 +33,7 @@ function stateModelFactory(configSchema) {
34
33
  /**
35
34
  * #property
36
35
  */
37
- filterBy: types.optional(FilterModel, {}),
36
+ filterBy: types.optional(types.frozen(), defaultFilterFlags),
38
37
  /**
39
38
  * #property
40
39
  */
@@ -46,11 +45,7 @@ function stateModelFactory(configSchema) {
46
45
  /**
47
46
  * #property
48
47
  */
49
- colorBy: types.maybe(types.model({
50
- type: types.string,
51
- tag: types.maybe(types.string),
52
- extra: types.frozen(),
53
- })),
48
+ colorBy: types.frozen(),
54
49
  /**
55
50
  * #property
56
51
  */
@@ -103,8 +98,10 @@ function stateModelFactory(configSchema) {
103
98
  /**
104
99
  * #action
105
100
  */
106
- setColorScheme(s) {
107
- self.colorBy = cast(s);
101
+ setColorScheme(colorBy) {
102
+ self.colorBy = {
103
+ ...colorBy,
104
+ };
108
105
  },
109
106
  /**
110
107
  * #action
@@ -128,7 +125,9 @@ function stateModelFactory(configSchema) {
128
125
  * #action
129
126
  */
130
127
  setFilterBy(filter) {
131
- self.filterBy = cast(filter);
128
+ self.filterBy = {
129
+ ...filter,
130
+ };
132
131
  },
133
132
  /**
134
133
  * #action
@@ -304,7 +303,7 @@ function stateModelFactory(configSchema) {
304
303
  * #method
305
304
  */
306
305
  async renderSvg(opts) {
307
- const { renderSvg } = await import('../shared/renderSvg');
306
+ const { renderSvg } = await import('../shared/renderSvgUtil');
308
307
  const { drawFeats } = await import('./drawFeats');
309
308
  return renderSvg(self, opts, drawFeats);
310
309
  },
@@ -1,7 +1,7 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { observer } from 'mobx-react';
3
3
  import { getContainingView } from '@jbrowse/core/util';
4
- import BaseDisplayComponent from '../../shared/BaseDisplayComponent';
4
+ import BaseDisplayComponent from '../../shared/components/BaseDisplayComponent';
5
5
  const Cloud = observer(function ({ model, }) {
6
6
  const view = getContainingView(model);
7
7
  const width = Math.round(view.dynamicBlocks.totalWidthPx);