react-msaview 5.10.0 → 6.0.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 (148) hide show
  1. package/bundle/index.js +99 -99
  2. package/bundle/index.js.map +4 -4
  3. package/dist/clustalX.js +22 -22
  4. package/dist/clustalX.js.map +1 -1
  5. package/dist/components/CopyButton.d.ts +9 -0
  6. package/dist/components/CopyButton.js +23 -0
  7. package/dist/components/CopyButton.js.map +1 -0
  8. package/dist/components/Loading.js +2 -2
  9. package/dist/components/Loading.js.map +1 -1
  10. package/dist/components/MSAView.js +2 -2
  11. package/dist/components/MSAView.js.map +1 -1
  12. package/dist/components/ResizeHandles.js +24 -40
  13. package/dist/components/ResizeHandles.js.map +1 -1
  14. package/dist/components/ScrollbarThumb.d.ts +14 -0
  15. package/dist/components/ScrollbarThumb.js +28 -0
  16. package/dist/components/ScrollbarThumb.js.map +1 -0
  17. package/dist/components/SequenceTextArea.js +3 -10
  18. package/dist/components/SequenceTextArea.js.map +1 -1
  19. package/dist/components/VerticalScrollbar.js +11 -25
  20. package/dist/components/VerticalScrollbar.js.map +1 -1
  21. package/dist/components/dialogs/FeatureDialog.js +3 -3
  22. package/dist/components/dialogs/FeatureDialog.js.map +1 -1
  23. package/dist/components/dialogs/{UserProvidedDomainsDialog.d.ts → InterProScanFileDialog.d.ts} +2 -2
  24. package/dist/components/dialogs/{UserProvidedDomainsDialog.js → InterProScanFileDialog.js} +6 -10
  25. package/dist/components/dialogs/InterProScanFileDialog.js.map +1 -0
  26. package/dist/components/dialogs/TrackInfoDialog.d.ts +2 -4
  27. package/dist/components/dialogs/TrackInfoDialog.js +8 -14
  28. package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
  29. package/dist/components/header/FileMenu.js +3 -3
  30. package/dist/components/header/FileMenu.js.map +1 -1
  31. package/dist/components/header/GappynessSlider.js +1 -1
  32. package/dist/components/header/GappynessSlider.js.map +1 -1
  33. package/dist/components/header/{getDomainsMenu.d.ts → getAnnotationsMenu.d.ts} +1 -1
  34. package/dist/components/header/{getDomainsMenu.js → getAnnotationsMenu.js} +10 -9
  35. package/dist/components/header/getAnnotationsMenu.js.map +1 -0
  36. package/dist/components/import/ImportForm.js +1 -1
  37. package/dist/components/import/ImportForm.js.map +1 -1
  38. package/dist/components/import/ImportFormExamples.js +66 -57
  39. package/dist/components/import/ImportFormExamples.js.map +1 -1
  40. package/dist/components/minimap/Minimap.js +11 -22
  41. package/dist/components/minimap/Minimap.js.map +1 -1
  42. package/dist/components/minimap/MinimapSVG.d.ts +2 -1
  43. package/dist/components/minimap/MinimapSVG.js +3 -4
  44. package/dist/components/minimap/MinimapSVG.js.map +1 -1
  45. package/dist/components/minimap/minimapLayout.d.ts +10 -1
  46. package/dist/components/minimap/minimapLayout.js +15 -10
  47. package/dist/components/minimap/minimapLayout.js.map +1 -1
  48. package/dist/components/msa/{DomainLegend.d.ts → AnnotationLegend.d.ts} +2 -2
  49. package/dist/components/msa/{DomainLegend.js → AnnotationLegend.js} +4 -4
  50. package/dist/components/msa/AnnotationLegend.js.map +1 -0
  51. package/dist/components/msa/MSACanvas.js +2 -2
  52. package/dist/components/msa/MSACanvas.js.map +1 -1
  53. package/dist/components/msa/MSAMouseoverCanvas.js +1 -2
  54. package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
  55. package/dist/components/msa/MSAPanel.js +2 -2
  56. package/dist/components/msa/MSAPanel.js.map +1 -1
  57. package/dist/components/msa/domainBandCursor.d.ts +17 -0
  58. package/dist/components/msa/domainBandCursor.js +39 -0
  59. package/dist/components/msa/domainBandCursor.js.map +1 -0
  60. package/dist/components/msa/renderMSABlock.js +14 -20
  61. package/dist/components/msa/renderMSABlock.js.map +1 -1
  62. package/dist/components/msa/renderMSAMouseover.js +1 -2
  63. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  64. package/dist/components/tree/TreeRuler.js +5 -2
  65. package/dist/components/tree/TreeRuler.js.map +1 -1
  66. package/dist/ggplotPalettes.d.ts +0 -1
  67. package/dist/ggplotPalettes.js +0 -3
  68. package/dist/ggplotPalettes.js.map +1 -1
  69. package/dist/hierarchy.d.ts +2 -6
  70. package/dist/hierarchy.js +4 -6
  71. package/dist/hierarchy.js.map +1 -1
  72. package/dist/index.d.ts +2 -2
  73. package/dist/launchInterProScan.d.ts +0 -23
  74. package/dist/launchInterProScan.js +2 -5
  75. package/dist/launchInterProScan.js.map +1 -1
  76. package/dist/measureTextCanvas.js +21 -6
  77. package/dist/measureTextCanvas.js.map +1 -1
  78. package/dist/model.d.ts +50 -100
  79. package/dist/model.js +128 -107
  80. package/dist/model.js.map +1 -1
  81. package/dist/renderToSvg.js +2 -2
  82. package/dist/renderToSvg.js.map +1 -1
  83. package/dist/rowCoordinateCalculations.d.ts +13 -17
  84. package/dist/rowCoordinateCalculations.js +45 -39
  85. package/dist/rowCoordinateCalculations.js.map +1 -1
  86. package/dist/types.d.ts +4 -11
  87. package/dist/version.d.ts +1 -1
  88. package/dist/version.js +1 -1
  89. package/dist/version.js.map +1 -1
  90. package/package.json +5 -5
  91. package/src/clustalX.ts +22 -22
  92. package/src/colSpace.test.ts +27 -0
  93. package/src/components/CopyButton.tsx +44 -0
  94. package/src/components/Loading.tsx +10 -1
  95. package/src/components/MSAView.tsx +2 -3
  96. package/src/components/ResizeHandles.tsx +60 -69
  97. package/src/components/ScrollbarThumb.tsx +48 -0
  98. package/src/components/SequenceTextArea.tsx +3 -16
  99. package/src/components/VerticalScrollbar.tsx +19 -33
  100. package/src/components/dialogs/FeatureDialog.tsx +3 -4
  101. package/src/components/dialogs/{UserProvidedDomainsDialog.tsx → InterProScanFileDialog.tsx} +6 -14
  102. package/src/components/dialogs/TrackInfoDialog.tsx +18 -20
  103. package/src/components/header/FileMenu.tsx +3 -3
  104. package/src/components/header/GappynessSlider.tsx +4 -1
  105. package/src/components/header/{getDomainsMenu.ts → getAnnotationsMenu.ts} +10 -9
  106. package/src/components/import/ImportForm.tsx +1 -1
  107. package/src/components/import/ImportFormExamples.tsx +82 -133
  108. package/src/components/minimap/Minimap.tsx +23 -31
  109. package/src/components/minimap/MinimapSVG.tsx +32 -31
  110. package/src/components/minimap/minimapLayout.test.ts +60 -0
  111. package/src/components/minimap/minimapLayout.ts +15 -10
  112. package/src/components/msa/{DomainLegend.tsx → AnnotationLegend.tsx} +7 -3
  113. package/src/components/msa/MSACanvas.tsx +3 -10
  114. package/src/components/msa/MSAMouseoverCanvas.tsx +1 -3
  115. package/src/components/msa/MSAPanel.tsx +2 -2
  116. package/src/components/msa/domainBandCursor.ts +41 -0
  117. package/src/components/msa/renderMSABlock.ts +19 -23
  118. package/src/components/msa/renderMSAMouseover.ts +1 -3
  119. package/src/components/tree/TreeRuler.tsx +7 -2
  120. package/src/components/tree/renderTreeCanvas.test.ts +15 -7
  121. package/src/domainBands.test.ts +24 -0
  122. package/src/domainLetterColor.test.ts +80 -0
  123. package/src/ggplotPalettes.ts +0 -4
  124. package/src/hierarchy.test.ts +7 -7
  125. package/src/hierarchy.ts +6 -9
  126. package/src/index.ts +4 -1
  127. package/src/largeTree.test.ts +23 -2
  128. package/src/launchInterProScan.ts +3 -30
  129. package/src/loadErrorDisplay.test.tsx +102 -0
  130. package/src/measureTextCanvas.ts +22 -6
  131. package/src/model.ts +137 -115
  132. package/src/renderMinimapSvg.test.tsx +109 -0
  133. package/src/renderToSvg.tsx +2 -2
  134. package/src/rowCoordinateCalculations.ts +48 -44
  135. package/src/types.ts +10 -15
  136. package/src/version.ts +1 -1
  137. package/src/viewChrome.test.tsx +134 -0
  138. package/dist/components/dialogs/DomainDialog.d.ts +0 -6
  139. package/dist/components/dialogs/DomainDialog.js +0 -19
  140. package/dist/components/dialogs/DomainDialog.js.map +0 -1
  141. package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +0 -1
  142. package/dist/components/header/SettingsMenu.d.ts +0 -6
  143. package/dist/components/header/SettingsMenu.js +0 -40
  144. package/dist/components/header/SettingsMenu.js.map +0 -1
  145. package/dist/components/header/getDomainsMenu.js.map +0 -1
  146. package/dist/components/msa/DomainLegend.js.map +0 -1
  147. package/src/components/dialogs/DomainDialog.tsx +0 -45
  148. package/src/components/header/SettingsMenu.tsx +0 -57
package/dist/model.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  import type { HierarchyNode } from './hierarchy.ts';
2
- import type { InterProScanResults } from './launchInterProScan.ts';
3
- import type { BasicTrack, DomainBand, NodeWithIds, NodeWithIdsAndLength } from './types.ts';
2
+ import type { Annotation, BasicTrack, DomainBand, NodeWithIds, NodeWithIdsAndLength } from './types.ts';
4
3
  import type { FileLocation as FileLocationType } from '@jbrowse/core/util/types';
5
4
  import type { Instance } from '@jbrowse/mobx-state-tree';
6
5
  import type { Theme } from '@mui/material';
6
+ import type { InterProScanResults } from 'msa-parsers';
7
7
  /**
8
8
  * #stateModel MsaView
9
9
  *
10
10
  * The main MSAView state model. Holds the loaded alignment, tree, and optional
11
- * InterProScan domain annotations, plus all display state (color scheme, zoom,
11
+ * overlay annotations, plus all display state (color scheme, zoom,
12
12
  * scroll, collapsed clades). It composes in members from `DialogQueueSessionMixin`,
13
13
  * `Tree`, and `MSAModel` (see Inherited members below). Data is loaded reactively
14
14
  * from the `msaFilehandle` / `treeFilehandle` / `gffFilehandle` properties, or set
@@ -405,7 +405,7 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
405
405
  }>, import("@jbrowse/mobx-state-tree")._NotCustomized>>;
406
406
  /**
407
407
  * #property
408
- * filehandle object for InterProScan GFF file
408
+ * filehandle object for a GFF file of overlay annotations
409
409
  */
410
410
  gffFilehandle: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISnapshotProcessor<import("@jbrowse/mobx-state-tree").ITypeUnion<import("@jbrowse/mobx-state-tree").ModelCreationType<{
411
411
  locationType: "LocalPathLocation";
@@ -674,8 +674,12 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
674
674
  error: unknown;
675
675
  /**
676
676
  * #volatile
677
+ * overlay annotations drawn on the alignment, whatever their source.
678
+ * Every source -- InterProScan, GFF, a user upload -- converts to this
679
+ * flat list before it reaches the model, so nothing downstream of here
680
+ * knows which one it came from
677
681
  */
678
- interProAnnotations: undefined | Record<string, InterProScanResults>;
682
+ annotations: Annotation[];
679
683
  } & {
680
684
  /**
681
685
  * #action
@@ -740,7 +744,7 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
740
744
  setHighlightedColumns(columns?: number[]): void;
741
745
  /**
742
746
  * #action
743
- * toggle the InterProScan protein-domain overlay on the alignment
747
+ * toggle the annotation overlay on the alignment
744
748
  */
745
749
  setShowDomains(arg: boolean): void;
746
750
  /**
@@ -767,11 +771,6 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
767
771
  * set col width (px)
768
772
  */
769
773
  setColWidth(n: number): void;
770
- /**
771
- * #action
772
- * set scroll Y-offset (px)
773
- */
774
- setScrollY(n: number): void;
775
774
  /**
776
775
  * #action
777
776
  *
@@ -938,10 +937,6 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
938
937
  * #getter
939
938
  */
940
939
  readonly blanks: number[];
941
- /**
942
- * #getter
943
- */
944
- readonly blanksSet: Set<number>;
945
940
  /**
946
941
  * #getter
947
942
  * Returns a map of row name to array of insertions with display position and letters
@@ -989,11 +984,6 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
989
984
  * #getter
990
985
  */
991
986
  readonly colStats: import("./columnCounts.ts").ColumnCounts;
992
- /**
993
- * #getter
994
- * per-column residue totals (gaps included)
995
- */
996
- readonly colStatsSums: Uint32Array<ArrayBufferLike>;
997
987
  /**
998
988
  * #getter
999
989
  * Detects sequence type based on letters present in the alignment.
@@ -1173,9 +1163,21 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
1173
1163
  doScrollY(deltaY: number): void;
1174
1164
  /**
1175
1165
  * #action
1176
- * Set domain annotations and reveal the overlay in a single step (or clear
1177
- * both when passed undefined). Shared by every domain source: InterProScan,
1178
- * GFF, user-provided uploads, and NCBI CDD.
1166
+ * set scroll Y-offset (px), clamped to keep the alignment in view
1167
+ */
1168
+ setScrollY(n: number): void;
1169
+ /**
1170
+ * #action
1171
+ * Set the overlay annotations and reveal the overlay in a single step (an
1172
+ * empty list clears both). Every source funnels through here after its
1173
+ * own adapter has flattened it: InterProScan, GFF, user uploads, NCBI CDD.
1174
+ */
1175
+ setAnnotations(annotations: Annotation[]): void;
1176
+ /**
1177
+ * #action
1178
+ * set the overlay from raw InterProScan results keyed by row name. Kept
1179
+ * for downstream plugins that hold the EBI wire format; new code should
1180
+ * adapt to Annotation[] and call setAnnotations.
1179
1181
  */
1180
1182
  setDomains(data?: Record<string, InterProScanResults>): void;
1181
1183
  applyGFFText(gffText: string): void;
@@ -1303,46 +1305,13 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
1303
1305
  * total height of track area (px)
1304
1306
  */
1305
1307
  readonly totalTrackAreaHeight: number;
1306
- readonly tidyInterProAnnotationTypes: Map<string, {
1307
- id: string;
1308
- name: string;
1309
- accession: string;
1310
- description: string;
1311
- featureType: string | undefined;
1312
- start: number;
1313
- end: number;
1314
- strand: number | undefined;
1315
- }>;
1316
- readonly tidyInterProAnnotations: {
1317
- id: string;
1318
- name: string;
1319
- accession: string;
1320
- description: string;
1321
- featureType: string | undefined;
1322
- start: number;
1323
- end: number;
1324
- strand: number | undefined;
1325
- }[];
1326
- readonly tidyFilteredInterProAnnotations: {
1327
- id: string;
1328
- name: string;
1329
- accession: string;
1330
- description: string;
1331
- featureType: string | undefined;
1332
- start: number;
1333
- end: number;
1334
- strand: number | undefined;
1335
- }[];
1336
- readonly tidyFilteredGatheredInterProAnnotations: Record<string, {
1337
- id: string;
1338
- name: string;
1339
- accession: string;
1340
- description: string;
1341
- featureType: string | undefined;
1342
- start: number;
1343
- end: number;
1344
- strand: number | undefined;
1345
- }[]>;
1308
+ /**
1309
+ * one representative annotation per accession, which is what the legend,
1310
+ * the filter dialog and the palettes key off
1311
+ */
1312
+ readonly annotationTypes: Map<string, Annotation>;
1313
+ readonly filteredAnnotations: Annotation[];
1314
+ readonly annotationsByRow: Record<string, Annotation[]>;
1346
1315
  } & {
1347
1316
  /**
1348
1317
  * #getter
@@ -1353,37 +1322,26 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
1353
1322
  * #getter
1354
1323
  */
1355
1324
  readonly verticalScrollbarWidth: 0 | 20;
1325
+ /**
1326
+ * #getter
1327
+ * width of the alignment canvas itself: the msa area less the vertical
1328
+ * scrollbar sitting in it. Not usable from showHorizontalScrollbar, which
1329
+ * feeds msaAreaHeight -> showVerticalScrollbar and would close a cycle
1330
+ */
1331
+ readonly msaCanvasWidth: number;
1356
1332
  /**
1357
1333
  * #getter
1358
1334
  * ordinal segment types (exons etc.), ordered by sequence position so
1359
1335
  * exon-1..exon-14 read left-to-right; colored by alternating shade and
1360
1336
  * labeled by number rather than each getting a distinct hue + legend row
1361
1337
  */
1362
- readonly segmentDomainTypes: {
1363
- id: string;
1364
- name: string;
1365
- accession: string;
1366
- description: string;
1367
- featureType: string | undefined;
1368
- start: number;
1369
- end: number;
1370
- strand: number | undefined;
1371
- }[];
1338
+ readonly segmentDomainTypes: Annotation[];
1372
1339
  /**
1373
1340
  * #getter
1374
1341
  * categorical feature types (InterPro domains and the like) that each get
1375
1342
  * their own color and a legend entry
1376
1343
  */
1377
- readonly categoricalDomainTypes: {
1378
- id: string;
1379
- name: string;
1380
- accession: string;
1381
- description: string;
1382
- featureType: string | undefined;
1383
- start: number;
1384
- end: number;
1385
- strand: number | undefined;
1386
- }[];
1344
+ readonly categoricalDomainTypes: Annotation[];
1387
1345
  readonly fillPalette: {
1388
1346
  [x: string]: string;
1389
1347
  };
@@ -1403,24 +1361,16 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
1403
1361
  * (exons) are excluded — they read as a numbered gene model, not a color
1404
1362
  * key — so this is the categorical types ordered by sequence position
1405
1363
  */
1406
- readonly visibleDomainTypes: {
1407
- id: string;
1408
- name: string;
1409
- accession: string;
1410
- description: string;
1411
- featureType: string | undefined;
1412
- start: number;
1413
- end: number;
1414
- strand: number | undefined;
1415
- }[];
1364
+ readonly visibleDomainTypes: Annotation[];
1416
1365
  /**
1417
1366
  * #getter
1418
- * every filtered-on domain annotation resolved to the visible column span
1419
- * it is drawn across, keyed by row name and in draw order (largest first,
1420
- * as tidyInterProAnnotations orders them). Resolving these once here rather
1421
- * than inside each canvas block removes a per-feature, per-block sequence
1422
- * position conversion from every redraw, and gives the letter renderer the
1423
- * band colors it needs to keep residues readable on top of the boxes.
1367
+ * every filtered-on annotation resolved to the visible column span it is
1368
+ * drawn across, keyed by row name. Each row is ordered longest-first so a
1369
+ * short domain nested inside a long one draws on top of it rather than
1370
+ * under it. Resolving these once here rather than inside each canvas
1371
+ * block removes a per-feature, per-block sequence position conversion
1372
+ * from every redraw, and gives the letter renderer the band colors it
1373
+ * needs to keep residues readable on top of the boxes.
1424
1374
  */
1425
1375
  readonly domainBands: Map<string, DomainBand[]>;
1426
1376
  /**
@@ -1434,7 +1384,7 @@ declare function stateModelFactory(): import("@jbrowse/mobx-state-tree").IModelT
1434
1384
  * domain annotations under the mouse, hit-tested against the exact visible
1435
1385
  * column span each box is drawn at (so it matches the overlay across gaps)
1436
1386
  */
1437
- readonly mouseOverDomains: import("./types.ts").TidyDomainAnnotation[];
1387
+ readonly mouseOverDomains: Annotation[];
1438
1388
  /**
1439
1389
  * #getter
1440
1390
  * row index of the reference row (`relativeTo`), undefined when unset