@jbrowse/plugin-variants 3.2.0 → 3.3.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 (221) hide show
  1. package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
  2. package/dist/MultiLinearVariantDisplay/index.js +1 -1
  3. package/dist/MultiLinearVariantDisplay/model.d.ts +39 -3
  4. package/dist/MultiLinearVariantDisplay/model.js +0 -1
  5. package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
  6. package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
  7. package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
  8. package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
  9. package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
  10. package/dist/MultiLinearVariantMatrixDisplay/model.js +1 -0
  11. package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
  12. package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
  13. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
  14. package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
  15. package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
  16. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
  17. package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +12 -13
  18. package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
  19. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
  20. package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
  21. package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
  22. package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
  23. package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
  24. package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
  25. package/dist/MultiLinearVariantRenderer/index.js +2 -2
  26. package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
  27. package/dist/MultiLinearVariantRenderer/makeImageData.js +60 -28
  28. package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
  29. package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
  30. package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
  31. package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
  32. package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
  33. package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
  34. package/dist/VariantFeatureWidget/Formatter.js +23 -0
  35. package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
  36. package/dist/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
  37. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
  38. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
  39. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
  40. package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
  41. package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
  42. package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
  43. package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
  44. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
  45. package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
  46. package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
  47. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
  48. package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
  49. package/dist/VariantRPC/getGenotypeMatrix.js +10 -5
  50. package/dist/VariantRPC/types.d.ts +23 -0
  51. package/dist/VcfFeature/index.js +0 -1
  52. package/dist/VcfFeature/util.d.ts +2 -0
  53. package/dist/VcfFeature/util.js +123 -25
  54. package/dist/VcfTabixAdapter/VcfTabixAdapter.js +12 -7
  55. package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
  56. package/dist/getMultiVariantFeaturesAutorun.js +9 -2
  57. package/dist/getMultiVariantSourcesAutorun.js +3 -2
  58. package/dist/shared/MultiVariantBaseModel.d.ts +40 -3
  59. package/dist/shared/MultiVariantBaseModel.js +69 -3
  60. package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
  61. package/dist/shared/components/AddFiltersDialog.js +61 -0
  62. package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
  63. package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
  64. package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
  65. package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +8 -3
  66. package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
  67. package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
  68. package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
  69. package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
  70. package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
  71. package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
  72. package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
  73. package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
  74. package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
  75. package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
  76. package/dist/shared/components/MultiVariantTooltip.js +3 -2
  77. package/dist/shared/components/RectBg.js +4 -2
  78. package/dist/shared/components/SetColorDialog.js +1 -1
  79. package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
  80. package/dist/shared/components/SourcesDataGrid.js +40 -47
  81. package/dist/shared/components/SourcesGrid.js +1 -1
  82. package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
  83. package/dist/shared/drawAlleleCount.d.ts +1 -1
  84. package/dist/shared/drawAlleleCount.js +29 -5
  85. package/dist/shared/drawPhased.d.ts +1 -1
  86. package/dist/shared/drawPhased.js +14 -10
  87. package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
  88. package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
  89. package/dist/shared/sourcesGridUtils.d.ts +3 -2
  90. package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
  91. package/esm/MultiLinearVariantDisplay/index.js +1 -1
  92. package/esm/MultiLinearVariantDisplay/model.d.ts +39 -3
  93. package/esm/MultiLinearVariantDisplay/model.js +0 -1
  94. package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
  95. package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
  96. package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
  97. package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
  98. package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +39 -2
  99. package/esm/MultiLinearVariantMatrixDisplay/model.js +1 -0
  100. package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
  101. package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -3
  102. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
  103. package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
  104. package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
  105. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +2 -2
  106. package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +13 -14
  107. package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
  108. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
  109. package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
  110. package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
  111. package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
  112. package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
  113. package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
  114. package/esm/MultiLinearVariantRenderer/index.js +1 -1
  115. package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
  116. package/esm/MultiLinearVariantRenderer/makeImageData.js +61 -29
  117. package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
  118. package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
  119. package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
  120. package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
  121. package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
  122. package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
  123. package/esm/VariantFeatureWidget/Formatter.js +17 -0
  124. package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
  125. package/esm/VariantFeatureWidget/VariantFeatureWidget.js +7 -2
  126. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
  127. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
  128. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
  129. package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
  130. package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
  131. package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
  132. package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
  133. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
  134. package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
  135. package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
  136. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
  137. package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
  138. package/esm/VariantRPC/getGenotypeMatrix.js +10 -5
  139. package/esm/VariantRPC/types.d.ts +23 -0
  140. package/esm/VcfFeature/index.js +0 -1
  141. package/esm/VcfFeature/util.d.ts +2 -0
  142. package/esm/VcfFeature/util.js +121 -25
  143. package/esm/VcfTabixAdapter/VcfTabixAdapter.js +13 -8
  144. package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
  145. package/esm/getMultiVariantFeaturesAutorun.js +9 -2
  146. package/esm/getMultiVariantSourcesAutorun.js +3 -2
  147. package/esm/shared/MultiVariantBaseModel.d.ts +40 -3
  148. package/esm/shared/MultiVariantBaseModel.js +71 -5
  149. package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
  150. package/esm/shared/components/AddFiltersDialog.js +59 -0
  151. package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
  152. package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
  153. package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
  154. package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +9 -4
  155. package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
  156. package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
  157. package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
  158. package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
  159. package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
  160. package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
  161. package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
  162. package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
  163. package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
  164. package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
  165. package/esm/shared/components/MultiVariantTooltip.js +3 -2
  166. package/esm/shared/components/RectBg.js +4 -2
  167. package/esm/shared/components/SetColorDialog.js +1 -1
  168. package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
  169. package/esm/shared/components/SourcesDataGrid.js +40 -47
  170. package/esm/shared/components/SourcesGrid.js +1 -1
  171. package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
  172. package/esm/shared/drawAlleleCount.d.ts +1 -1
  173. package/esm/shared/drawAlleleCount.js +29 -5
  174. package/esm/shared/drawPhased.d.ts +1 -1
  175. package/esm/shared/drawPhased.js +14 -10
  176. package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
  177. package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
  178. package/esm/shared/sourcesGridUtils.d.ts +3 -2
  179. package/package.json +10 -9
  180. package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
  181. package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
  182. package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
  183. package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
  184. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
  185. package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
  186. package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
  187. package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
  188. package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
  189. package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
  190. package/dist/VariantRPC/cluster.d.ts +0 -17
  191. package/dist/VariantRPC/cluster.js +0 -84
  192. package/dist/shared/components/LegendBar.d.ts +0 -18
  193. package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
  194. package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
  195. package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
  196. package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
  197. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
  198. package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
  199. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
  200. package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
  201. package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
  202. package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
  203. package/esm/VariantRPC/cluster.d.ts +0 -17
  204. package/esm/VariantRPC/cluster.js +0 -79
  205. package/esm/shared/components/LegendBar.d.ts +0 -18
  206. /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
  207. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
  208. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
  209. /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
  210. /package/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
  211. /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
  212. /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
  213. /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
  214. /package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
  215. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
  216. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
  217. /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
  218. /package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
  219. /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
  220. /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
  221. /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.default = MultiVariantBaseModelF;
40
40
  const react_1 = require("react");
41
41
  const configuration_1 = require("@jbrowse/core/configuration");
42
+ const serializableFilterChain_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain"));
42
43
  const util_1 = require("@jbrowse/core/util");
43
44
  const stopToken_1 = require("@jbrowse/core/util/stopToken");
44
45
  const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
@@ -52,7 +53,8 @@ const mobx_state_tree_1 = require("mobx-state-tree");
52
53
  const getSources_1 = require("./getSources");
53
54
  const SetColorDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetColorDialog'))));
54
55
  const MAFFilterDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/MAFFilterDialog'))));
55
- const ClusterDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ClusterDialog/ClusterDialog'))));
56
+ const AddFiltersDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/AddFiltersDialog'))));
57
+ const ClusterDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/MultiVariantClusterDialog/ClusterDialog'))));
56
58
  const SetRowHeightDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetRowHeightDialog'))));
57
59
  function MultiVariantBaseModelF(configSchema) {
58
60
  return mobx_state_tree_1.types
@@ -60,14 +62,18 @@ function MultiVariantBaseModelF(configSchema) {
60
62
  type: mobx_state_tree_1.types.literal('LinearVariantMatrixDisplay'),
61
63
  layout: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.frozen(), []),
62
64
  configuration: (0, configuration_1.ConfigurationReference)(configSchema),
63
- minorAlleleFrequencyFilter: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 0.1),
65
+ minorAlleleFrequencyFilter: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 0),
64
66
  showSidebarLabelsSetting: true,
65
67
  renderingMode: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.string, 'alleleCount'),
66
68
  rowHeightSetting: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.number, 8),
67
69
  autoHeight: true,
70
+ lengthCutoffFilter: Number.MAX_SAFE_INTEGER,
71
+ jexlFilters: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.array(mobx_state_tree_1.types.string)),
72
+ referenceDrawingMode: 'skip',
68
73
  }))
69
74
  .volatile(() => ({
70
75
  sourcesLoadingStopToken: undefined,
76
+ simplifiedFeaturesStopToken: undefined,
71
77
  featureUnderMouseVolatile: undefined,
72
78
  sourcesVolatile: undefined,
73
79
  featuresVolatile: undefined,
@@ -76,6 +82,9 @@ function MultiVariantBaseModelF(configSchema) {
76
82
  hoveredGenotype: undefined,
77
83
  }))
78
84
  .actions(self => ({
85
+ setJexlFilters(f) {
86
+ self.jexlFilters = (0, mobx_state_tree_1.cast)(f);
87
+ },
79
88
  setRowHeight(arg) {
80
89
  self.rowHeightSetting = arg;
81
90
  },
@@ -97,6 +106,12 @@ function MultiVariantBaseModelF(configSchema) {
97
106
  }
98
107
  self.sourcesLoadingStopToken = str;
99
108
  },
109
+ setSimplifiedFeaturesLoading(str) {
110
+ if (self.simplifiedFeaturesStopToken) {
111
+ (0, stopToken_1.stopStopToken)(self.simplifiedFeaturesStopToken);
112
+ }
113
+ self.simplifiedFeaturesStopToken = str;
114
+ },
100
115
  setSources(sources) {
101
116
  if (!(0, fast_deep_equal_1.default)(sources, self.sourcesVolatile)) {
102
117
  self.sourcesVolatile = sources;
@@ -122,8 +137,15 @@ function MultiVariantBaseModelF(configSchema) {
122
137
  self.sampleInfo = arg;
123
138
  }
124
139
  },
140
+ setReferenceDrawingMode(arg) {
141
+ self.referenceDrawingMode = arg;
142
+ },
125
143
  }))
126
144
  .views(self => ({
145
+ get activeFilters() {
146
+ var _a;
147
+ return ((_a = self.jexlFilters) !== null && _a !== void 0 ? _a : (0, configuration_1.getConf)(self, 'jexlFilters').map((r) => `jexl:${r}`));
148
+ },
127
149
  get preSources() {
128
150
  return self.layout.length ? self.layout : self.sourcesVolatile;
129
151
  },
@@ -152,6 +174,11 @@ function MultiVariantBaseModelF(configSchema) {
152
174
  .views(self => {
153
175
  const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
154
176
  return {
177
+ get sourceMap() {
178
+ return self.sources
179
+ ? Object.fromEntries(self.sources.map(source => [source.name, source]))
180
+ : undefined;
181
+ },
155
182
  get rowHeight() {
156
183
  const { sources, autoHeight, rowHeightSetting, height } = self;
157
184
  return autoHeight ? height / ((sources === null || sources === void 0 ? void 0 : sources.length) || 1) : rowHeightSetting;
@@ -229,6 +256,28 @@ function MultiVariantBaseModelF(configSchema) {
229
256
  },
230
257
  ],
231
258
  },
259
+ {
260
+ label: 'Reference mode',
261
+ type: 'subMenu',
262
+ subMenu: [
263
+ {
264
+ label: 'Fill background grey, skip reference allele mouseovers (helps with large overlapping SVs)',
265
+ type: 'radio',
266
+ checked: self.referenceDrawingMode === 'skip',
267
+ onClick: () => {
268
+ self.setReferenceDrawingMode('skip');
269
+ },
270
+ },
271
+ {
272
+ label: "Don't fill background grey, only draw actual reference alleles as grey",
273
+ type: 'radio',
274
+ checked: self.referenceDrawingMode === 'draw',
275
+ onClick: () => {
276
+ self.setReferenceDrawingMode('draw');
277
+ },
278
+ },
279
+ ],
280
+ },
232
281
  {
233
282
  label: 'Filter by',
234
283
  icon: FilterList_1.default,
@@ -245,6 +294,18 @@ function MultiVariantBaseModelF(configSchema) {
245
294
  ]);
246
295
  },
247
296
  },
297
+ {
298
+ label: 'Edit filters',
299
+ onClick: () => {
300
+ (0, util_1.getSession)(self).queueDialog(handleClose => [
301
+ AddFiltersDialog,
302
+ {
303
+ model: self,
304
+ handleClose,
305
+ },
306
+ ]);
307
+ },
308
+ },
248
309
  ],
249
310
  },
250
311
  {
@@ -278,7 +339,7 @@ function MultiVariantBaseModelF(configSchema) {
278
339
  })
279
340
  .views(self => ({
280
341
  get canDisplayLabels() {
281
- return self.rowHeight > 8 && self.showSidebarLabelsSetting;
342
+ return self.rowHeight >= 8 && self.showSidebarLabelsSetting;
282
343
  },
283
344
  get totalHeight() {
284
345
  var _a;
@@ -298,9 +359,14 @@ function MultiVariantBaseModelF(configSchema) {
298
359
  totalHeight: self.totalHeight,
299
360
  renderingMode: self.renderingMode,
300
361
  minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
362
+ lengthCutoffFilter: self.lengthCutoffFilter,
301
363
  rowHeight: self.rowHeight,
302
364
  sources: self.sources,
303
365
  scrollTop: self.scrollTop,
366
+ referenceDrawingMode: self.referenceDrawingMode,
367
+ filters: new serializableFilterChain_1.default({
368
+ filters: self.activeFilters,
369
+ }),
304
370
  };
305
371
  },
306
372
  }));
@@ -0,0 +1,9 @@
1
+ declare const AddFiltersDialog: ({ model, handleClose, }: {
2
+ model: {
3
+ jexlFilters?: string[];
4
+ activeFilters: string[];
5
+ setJexlFilters: (arg?: string[]) => void;
6
+ };
7
+ handleClose: () => void;
8
+ }) => import("react/jsx-runtime").JSX.Element;
9
+ export default AddFiltersDialog;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const react_1 = require("react");
5
+ const ui_1 = require("@jbrowse/core/ui");
6
+ const jexlStrings_1 = require("@jbrowse/core/util/jexlStrings");
7
+ const material_1 = require("@mui/material");
8
+ const mobx_react_1 = require("mobx-react");
9
+ const mui_1 = require("tss-react/mui");
10
+ const useStyles = (0, mui_1.makeStyles)()({
11
+ dialogContent: {
12
+ width: '80em',
13
+ },
14
+ textAreaFont: {
15
+ fontFamily: 'Courier New',
16
+ },
17
+ error: {
18
+ color: 'red',
19
+ fontSize: '0.8em',
20
+ },
21
+ });
22
+ function checkJexl(code) {
23
+ (0, jexlStrings_1.stringToJexlExpression)(code);
24
+ }
25
+ const AddFiltersDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
26
+ const { classes } = useStyles();
27
+ const { activeFilters } = model;
28
+ const [data, setData] = (0, react_1.useState)(activeFilters.join('\n'));
29
+ const [error, setError] = (0, react_1.useState)();
30
+ (0, react_1.useEffect)(() => {
31
+ try {
32
+ data
33
+ .split('\n')
34
+ .map(line => line.trim())
35
+ .filter(line => !!line)
36
+ .map(line => {
37
+ checkJexl(line.trim());
38
+ });
39
+ setError(undefined);
40
+ }
41
+ catch (e) {
42
+ console.error(e);
43
+ setError(e);
44
+ }
45
+ }, [data]);
46
+ return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { maxWidth: "xl", open: true, onClose: handleClose, title: "Add track filters", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["Add filters, in jexl format, one per line, starting with the string jexl:. Examples:", ' ', (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("code", { children: "jexl:get(feature,'name')=='BRCA1'" }), " - show only feature where the name attribute is BRCA1"] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("code", { children: "jexl:get(feature,'type')=='gene'" }), " - show only gene type features in a GFF that has many other feature types"] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("code", { children: "jexl:get(feature,'score') > 400" }), " - show only features that have a score greater than 400"] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("code", { children: "jexl:get(feature,'end') - get(feature,'start') < 1000000" }), ' ', "- show only features with length less than 1Mbp"] })] })] }), error ? (0, jsx_runtime_1.jsx)("p", { className: classes.error, children: `${error}` }) : null, (0, jsx_runtime_1.jsx)(material_1.TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, className: classes.dialogContent, fullWidth: true, value: data, onChange: event => {
47
+ setData(event.target.value);
48
+ }, slotProps: {
49
+ input: {
50
+ classes: {
51
+ input: classes.textAreaFont,
52
+ },
53
+ },
54
+ } })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, disabled: !!error, onClick: () => {
55
+ model.setJexlFilters(data.split('\n'));
56
+ handleClose();
57
+ }, children: "Submit" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
58
+ handleClose();
59
+ }, children: "Cancel" })] })] }));
60
+ });
61
+ exports.default = AddFiltersDialog;
@@ -0,0 +1,5 @@
1
+ import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
2
+ declare const MultiVariantBaseDisplayComponent: (props: {
3
+ model: MultiVariantBaseModel;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default MultiVariantBaseDisplayComponent;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
9
+ const mobx_react_1 = require("mobx-react");
10
+ const MultiVariantCrosshairs_1 = __importDefault(require("./MultiVariantCrosshairs"));
11
+ const MultiVariantLegendBar_1 = __importDefault(require("./MultiVariantLegendBar"));
12
+ const MultiVariantBaseDisplayComponent = (0, mobx_react_1.observer)(function (props) {
13
+ const { model } = props;
14
+ const ref = (0, react_1.useRef)(null);
15
+ const [mouseY, setMouseY] = (0, react_1.useState)();
16
+ const [mouseX, setMouseX] = (0, react_1.useState)();
17
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: ref, onMouseMove: event => {
18
+ var _a;
19
+ const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
20
+ const top = (rect === null || rect === void 0 ? void 0 : rect.top) || 0;
21
+ const left = (rect === null || rect === void 0 ? void 0 : rect.left) || 0;
22
+ setMouseY(event.clientY - top);
23
+ setMouseX(event.clientX - left);
24
+ }, onMouseLeave: () => {
25
+ setMouseY(undefined);
26
+ setMouseX(undefined);
27
+ }, children: [(0, jsx_runtime_1.jsx)(plugin_linear_genome_view_1.BaseLinearDisplayComponent, { ...props }), (0, jsx_runtime_1.jsx)(MultiVariantLegendBar_1.default, { model: model }), mouseX && mouseY ? ((0, jsx_runtime_1.jsx)(MultiVariantCrosshairs_1.default, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
28
+ });
29
+ exports.default = MultiVariantBaseDisplayComponent;
@@ -12,8 +12,8 @@ const ClusterDialogAuto_1 = __importDefault(require("./ClusterDialogAuto"));
12
12
  const ClusterDialogManual_1 = __importDefault(require("./ClusterDialogManual"));
13
13
  function Header({ activeMode, setActiveMode, }) {
14
14
  return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { style: { marginBottom: 30 }, children: "This procedure will cluster the visible genotype data using hierarchical clustering" }), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { children: Object.entries({
15
- auto: ((0, jsx_runtime_1.jsx)("div", { children: "Run in-app clustering (slow for large data, built in JS clustering)" })),
16
- manual: ((0, jsx_runtime_1.jsx)("div", { children: "Download R script to run clustering (faster for large data, uses hclust, may be more accurate)" })),
15
+ auto: ((0, jsx_runtime_1.jsx)("div", { children: "Run in-app clustering (slower, particularly for large numbers of samples, uses JS implementation of hclust)" })),
16
+ manual: ((0, jsx_runtime_1.jsx)("div", { children: "Download R script to run clustering (faster, uses R implementation of hclust)" })),
17
17
  }).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Radio, { checked: activeMode === key, onChange: () => {
18
18
  setActiveMode(key);
19
19
  } }), label: val }, key))) })] }));
@@ -11,19 +11,22 @@ const mobx_react_1 = require("mobx-react");
11
11
  const mobx_state_tree_1 = require("mobx-state-tree");
12
12
  const ClusterDialogAuto = (0, mobx_react_1.observer)(function ({ model, children, handleClose, }) {
13
13
  const [progress, setProgress] = (0, react_1.useState)('');
14
+ const [loading, setLoading] = (0, react_1.useState)(false);
14
15
  const [error, setError] = (0, react_1.useState)();
15
16
  const [stopToken, setStopToken] = (0, react_1.useState)('');
16
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [children, (0, jsx_runtime_1.jsxs)("div", { children: [progress ? ((0, jsx_runtime_1.jsxs)("div", { style: { padding: 50 }, children: [(0, jsx_runtime_1.jsxs)("span", { style: { width: 400 }, children: ["Progress: ", progress] }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
17
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [children, (0, jsx_runtime_1.jsxs)("div", { children: [loading ? ((0, jsx_runtime_1.jsxs)("div", { style: { padding: 50 }, children: [(0, jsx_runtime_1.jsx)("span", { children: progress || 'Loading...' }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
17
18
  (0, stopToken_1.stopStopToken)(stopToken);
18
- }, children: "Stop" })] })) : null, error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null] })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: async () => {
19
+ }, children: "Stop" })] })) : null, error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null] })] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", disabled: loading, onClick: async () => {
19
20
  try {
20
21
  setError(undefined);
22
+ setProgress('Initializing');
23
+ setLoading(true);
21
24
  const view = (0, util_1.getContainingView)(model);
22
25
  if (!view.initialized) {
23
26
  return;
24
27
  }
25
28
  const { rpcManager } = (0, util_1.getSession)(model);
26
- const { sourcesWithoutLayout, minorAlleleFrequencyFilter, adapterConfig, } = model;
29
+ const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
27
30
  if (sourcesWithoutLayout) {
28
31
  const sessionId = (0, tracks_1.getRpcSessionId)(model);
29
32
  const stopToken = (0, stopToken_1.createStopToken)();
@@ -32,6 +35,7 @@ const ClusterDialogAuto = (0, mobx_react_1.observer)(function ({ model, children
32
35
  regions: view.dynamicBlocks.contentBlocks,
33
36
  sources: sourcesWithoutLayout,
34
37
  minorAlleleFrequencyFilter,
38
+ lengthCutoffFilter,
35
39
  sessionId,
36
40
  adapterConfig,
37
41
  stopToken,
@@ -56,6 +60,7 @@ const ClusterDialogAuto = (0, mobx_react_1.observer)(function ({ model, children
56
60
  }
57
61
  }
58
62
  finally {
63
+ setLoading(false);
59
64
  setProgress('');
60
65
  setStopToken('');
61
66
  }
@@ -30,8 +30,8 @@ const ClusterDialogManuals = (0, mobx_react_1.observer)(function ({ model, handl
30
30
  const [ret, setRet] = (0, react_1.useState)();
31
31
  const [error, setError] = (0, react_1.useState)();
32
32
  const [loading, setLoading] = (0, react_1.useState)(false);
33
- const [showAdvanced, setShowAdvanced] = (0, react_1.useState)(false);
34
- const [clusterMethod, setClusterMethod] = (0, util_1.useLocalStorage)('cluster-clusterMethod', 'single');
33
+ const [showAdvanced, setShowAdvanced] = (0, util_1.useLocalStorage)('cluster-showAdvanced', false);
34
+ const [clusterMethod, setClusterMethod] = (0, react_1.useState)('single');
35
35
  (0, react_1.useEffect)(() => {
36
36
  ;
37
37
  (async () => {
@@ -44,12 +44,13 @@ const ClusterDialogManuals = (0, mobx_react_1.observer)(function ({ model, handl
44
44
  return;
45
45
  }
46
46
  const { rpcManager } = (0, util_1.getSession)(model);
47
- const { sourcesWithoutLayout, minorAlleleFrequencyFilter, adapterConfig, } = model;
47
+ const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
48
48
  const sessionId = (0, tracks_1.getRpcSessionId)(model);
49
49
  const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
50
50
  regions: view.dynamicBlocks.contentBlocks,
51
51
  sources: sourcesWithoutLayout,
52
52
  minorAlleleFrequencyFilter,
53
+ lengthCutoffFilter,
53
54
  sessionId,
54
55
  adapterConfig,
55
56
  }));
@@ -82,31 +83,31 @@ cat(resultClusters$order,sep='\\n')`
82
83
  .map(([key, val]) => [key, ...val].join('\t'))
83
84
  .join('\n')
84
85
  : undefined;
85
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [children, (0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 16 }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
86
- display: 'flex',
87
- gap: '8px',
88
- flexWrap: 'wrap',
89
- marginBottom: '16px',
90
- }, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
91
- (0, file_saver_1.saveAs)(new Blob([results || ''], {
92
- type: 'text/plain;charset=utf-8',
93
- }), 'cluster.R');
94
- }, children: "Download Rscript" }), ' ', "or", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
95
- (0, copy_to_clipboard_1.default)(results || '');
96
- }, children: "Copy Rscript to clipboard" }), ' ', "or", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
97
- (0, file_saver_1.saveAs)(new Blob([resultsTsv || ''], {
98
- type: 'text/plain;charset=utf-8',
99
- }), 'genotypes.tsv');
100
- }, children: "Download TSV" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
101
- setShowAdvanced(!showAdvanced);
102
- }, children: showAdvanced
103
- ? 'Hide advanced options'
104
- : 'Show advanced options' }), showAdvanced ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: "Advanced options" }), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { children: Object.entries({
105
- single: 'Single',
106
- complete: 'Complete',
107
- }).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Radio, { checked: clusterMethod === key, onChange: () => {
108
- setClusterMethod(key);
109
- } }), label: val }, key))) })] })) : null] }), results ? ((0, jsx_runtime_1.jsx)("div", {})) : loading ? ((0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })) : error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : null] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle2", gutterBottom: true, style: { marginTop: '16px' }, children: "Clustering Results:" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
86
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [children, (0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 16 }, children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
87
+ display: 'flex',
88
+ gap: '8px',
89
+ flexWrap: 'wrap',
90
+ marginBottom: '16px',
91
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
92
+ (0, file_saver_1.saveAs)(new Blob([results || ''], {
93
+ type: 'text/plain;charset=utf-8',
94
+ }), 'cluster.R');
95
+ }, children: "Download Rscript" }), ' ', "or", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
96
+ (0, copy_to_clipboard_1.default)(results || '');
97
+ }, children: "Copy Rscript to clipboard" }), ' ', "or", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
98
+ (0, file_saver_1.saveAs)(new Blob([resultsTsv || ''], {
99
+ type: 'text/plain;charset=utf-8',
100
+ }), 'genotypes.tsv');
101
+ }, children: "Download TSV" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
102
+ setShowAdvanced(!showAdvanced);
103
+ }, children: showAdvanced
104
+ ? 'Hide advanced options'
105
+ : 'Show advanced options' }) })] }), showAdvanced ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: "Advanced options" }), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { children: Object.entries({
106
+ single: 'Single',
107
+ complete: 'Complete',
108
+ }).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Radio, { checked: clusterMethod === key, onChange: () => {
109
+ setClusterMethod(key);
110
+ } }), label: val }, key))) })] })) : null, results ? ((0, jsx_runtime_1.jsx)("div", {})) : loading ? ((0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })) : error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : null] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle2", gutterBottom: true, style: { marginTop: '16px' }, children: "Clustering Results:" }), (0, jsx_runtime_1.jsx)(material_1.TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
110
111
  setPaste(event.target.value);
111
112
  }, slotProps: {
112
113
  input: {
@@ -3,6 +3,7 @@ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
3
  export interface ReducedModel {
4
4
  sourcesWithoutLayout?: Source[];
5
5
  minorAlleleFrequencyFilter?: number;
6
+ lengthCutoffFilter: number;
6
7
  adapterConfig: AnyConfigurationModel;
7
8
  setLayout: (arg: Source[]) => void;
8
9
  clearLayout: () => void;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import type { Source } from '../types';
2
- declare const ColorLegend: ({ model, labelWidth, }: {
2
+ declare const MultiVariantColorLegend: ({ model, labelWidth, }: {
3
3
  model: {
4
4
  canDisplayLabels: boolean;
5
5
  rowHeight: number;
@@ -7,4 +7,4 @@ declare const ColorLegend: ({ model, labelWidth, }: {
7
7
  };
8
8
  labelWidth: number;
9
9
  }) => import("react/jsx-runtime").JSX.Element | null;
10
- export default ColorLegend;
10
+ export default MultiVariantColorLegend;
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const util_1 = require("@jbrowse/core/util");
9
+ const material_1 = require("@mui/material");
9
10
  const mobx_react_1 = require("mobx-react");
10
11
  const RectBg_1 = __importDefault(require("./RectBg"));
11
- const ColorLegend = (0, mobx_react_1.observer)(function ({ model, labelWidth, }) {
12
+ const MultiVariantColorLegend = (0, mobx_react_1.observer)(function ({ model, labelWidth, }) {
12
13
  const { canDisplayLabels, rowHeight, sources } = model;
13
14
  const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
14
15
  const colorBoxWidth = 15;
15
16
  const hasColors = sources === null || sources === void 0 ? void 0 : sources.some(s => s.color);
16
17
  const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
18
+ const theme = (0, material_1.useTheme)();
17
19
  return sources ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [canDisplayLabels ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => {
18
20
  const { color, name, label } = source;
19
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [color ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? ((0, jsx_runtime_1.jsx)("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, children: label || name })) : null] }, `${label}-${idx}`));
21
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [color ? ((0, jsx_runtime_1.jsx)(RectBg_1.default, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? ((0, jsx_runtime_1.jsx)("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, ...(0, util_1.getFillProps)(theme.palette.text.primary), children: label || name })) : null] }, `${label}-${idx}`));
20
22
  })] })) : null;
21
23
  });
22
- exports.default = ColorLegend;
24
+ exports.default = MultiVariantColorLegend;
@@ -0,0 +1,7 @@
1
+ import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
2
+ declare const MultiVariantCrosshairs: ({ mouseX, mouseY, model, }: {
3
+ mouseX: number;
4
+ mouseY: number;
5
+ model: MultiVariantBaseModel;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default MultiVariantCrosshairs;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const util_1 = require("@jbrowse/core/util");
8
+ const material_1 = require("@mui/material");
9
+ const mobx_react_1 = require("mobx-react");
10
+ const mui_1 = require("tss-react/mui");
11
+ const MultiVariantTooltip_1 = __importDefault(require("./MultiVariantTooltip"));
12
+ const useStyles = (0, mui_1.makeStyles)()({
13
+ rel: {
14
+ position: 'relative',
15
+ },
16
+ cursor: {
17
+ pointerEvents: 'none',
18
+ zIndex: 800,
19
+ position: 'absolute',
20
+ },
21
+ color: {
22
+ width: 10,
23
+ height: 10,
24
+ },
25
+ });
26
+ const MultiVariantCrosshairs = (0, mobx_react_1.observer)(function ({ mouseX, mouseY, model, }) {
27
+ const { classes } = useStyles();
28
+ const theme = (0, material_1.useTheme)();
29
+ const { hoveredGenotype, height, scrollTop, sourceMap } = model;
30
+ const { width } = (0, util_1.getContainingView)(model);
31
+ const source = hoveredGenotype ? sourceMap === null || sourceMap === void 0 ? void 0 : sourceMap[hoveredGenotype.name] : undefined;
32
+ const y = mouseY - scrollTop;
33
+ return ((0, jsx_runtime_1.jsxs)("div", { className: classes.rel, children: [(0, jsx_runtime_1.jsxs)("svg", { className: classes.cursor, width: width, height: height, style: {
34
+ top: scrollTop,
35
+ }, children: [(0, jsx_runtime_1.jsx)("line", { x1: 0, x2: width, y1: y, y2: y, stroke: theme.palette.text.primary }), (0, jsx_runtime_1.jsx)("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: theme.palette.text.primary })] }), source ? ((0, jsx_runtime_1.jsx)(MultiVariantTooltip_1.default, { source: {
36
+ ...source,
37
+ ...hoveredGenotype,
38
+ } })) : null] }));
39
+ });
40
+ exports.default = MultiVariantCrosshairs;
@@ -0,0 +1,7 @@
1
+ import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
2
+ export declare const LegendBar: (props: {
3
+ model: MultiVariantBaseModel;
4
+ orientation?: string;
5
+ exportSVG?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default LegendBar;
@@ -7,7 +7,7 @@ exports.LegendBar = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const util_1 = require("@jbrowse/core/util");
9
9
  const mobx_react_1 = require("mobx-react");
10
- const ColorLegend_1 = __importDefault(require("./ColorLegend"));
10
+ const MultiVariantColorLegend_1 = __importDefault(require("./MultiVariantColorLegend"));
11
11
  const Wrapper = (0, mobx_react_1.observer)(function ({ children, model, exportSVG, }) {
12
12
  const { id, scrollTop, height } = model;
13
13
  const clipid = `legend-${id}`;
@@ -25,7 +25,7 @@ exports.LegendBar = (0, mobx_react_1.observer)(function (props) {
25
25
  const { model } = props;
26
26
  const { canDisplayLabels, rowHeight, sources } = model;
27
27
  const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
28
- return sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: (0, jsx_runtime_1.jsx)(ColorLegend_1.default, { model: model, labelWidth: (0, util_1.max)(sources
28
+ return sources ? ((0, jsx_runtime_1.jsx)(Wrapper, { ...props, children: (0, jsx_runtime_1.jsx)(MultiVariantColorLegend_1.default, { model: model, labelWidth: (0, util_1.max)(sources
29
29
  .map(s => (0, util_1.measureText)(s.label, svgFontSize) + 10)
30
30
  .map(width => (canDisplayLabels ? width : 20)), 0) }) })) : null;
31
31
  });
@@ -1,6 +1,10 @@
1
1
  export default function MultiVariantTooltip({ source, }: {
2
2
  source: {
3
3
  color?: string;
4
+ hoveredGenotype?: {
5
+ genotype: string;
6
+ name: string;
7
+ };
4
8
  [key: string]: unknown;
5
9
  };
6
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -7,6 +7,7 @@ exports.default = MultiVariantTooltip;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const ui_1 = require("@jbrowse/core/ui");
9
9
  const BaseTooltip_1 = __importDefault(require("@jbrowse/core/ui/BaseTooltip"));
10
+ const escape_html_1 = __importDefault(require("escape-html"));
10
11
  function MultiVariantTooltip({ source, }) {
11
12
  return ((0, jsx_runtime_1.jsxs)(BaseTooltip_1.default, { children: [source.color ? ((0, jsx_runtime_1.jsx)("div", { style: {
12
13
  width: 10,
@@ -14,10 +15,10 @@ function MultiVariantTooltip({ source, }) {
14
15
  backgroundColor: source.color,
15
16
  } })) : null, (0, jsx_runtime_1.jsx)(ui_1.SanitizedHTML, { html: Object.entries(source)
16
17
  .filter(([key, val]) => key !== 'color' &&
17
- key !== 'name' &&
18
18
  key !== 'HP' &&
19
+ key !== 'name' &&
19
20
  key !== 'id' &&
20
21
  val !== undefined)
21
- .map(([key, value]) => `${key}:${value}`)
22
+ .map(([key, value]) => `${key}:${(0, escape_html_1.default)(`${value}`)}`)
22
23
  .join('<br/>') })] }));
23
24
  }
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const jsx_runtime_1 = require("react/jsx-runtime");
4
4
  const util_1 = require("@jbrowse/core/util");
5
- const RectBg = ({ x, y, width, height, color = 'rgba(255,255,255,0.5)', }) => {
6
- return ((0, jsx_runtime_1.jsx)("rect", { pointerEvents: "auto", x: x, y: y, width: width, height: height, ...(0, util_1.getFillProps)(color) }));
5
+ const material_1 = require("@mui/material");
6
+ const RectBg = ({ x, y, width, height, color, }) => {
7
+ const theme = (0, material_1.useTheme)();
8
+ return ((0, jsx_runtime_1.jsx)("rect", { pointerEvents: "auto", x: x, y: y, width: width, height: height, ...(0, util_1.getFillProps)(color || (0, material_1.alpha)(theme.palette.background.paper, 0.3)) }));
7
9
  };
8
10
  exports.default = RectBg;
@@ -33,7 +33,7 @@ function SetColorDialog({ model, handleClose, }) {
33
33
  const [showBulkEditor, setShowBulkEditor] = (0, react_1.useState)(false);
34
34
  const [currLayout, setCurrLayout] = (0, react_1.useState)(sources || []);
35
35
  const [showTips, setShowTips] = (0, util_1.useLocalStorage)('multivariant-showTips', false);
36
- return ((0, jsx_runtime_1.jsx)(DraggableDialog_1.default, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-variant color/arrangement editor", children: showBulkEditor ? ((0, jsx_runtime_1.jsx)(BulkEditPanel_1.default, { currLayout: currLayout, onClose: arg => {
36
+ return ((0, jsx_runtime_1.jsx)(DraggableDialog_1.default, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-sample variant display - Color/arrangement editor", children: showBulkEditor ? ((0, jsx_runtime_1.jsx)(BulkEditPanel_1.default, { currLayout: currLayout, onClose: arg => {
37
37
  if (arg) {
38
38
  setCurrLayout(arg);
39
39
  }
@@ -1,6 +1,7 @@
1
1
  import type { Source } from '../types';
2
+ import type { GridRowId } from '@mui/x-data-grid';
2
3
  export default function SourcesDataGrid({ rows, onChange, setSelected, }: {
3
4
  rows: Source[];
4
5
  onChange: (arg: Source[]) => void;
5
- setSelected: (arg: string[]) => void;
6
+ setSelected: (arg: GridRowId[]) => void;
6
7
  }): import("react/jsx-runtime").JSX.Element;