react-msaview 8.3.0 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +77 -287
- package/bundle/index.js.map +4 -4
- package/dist/blockFasta.d.ts +6 -0
- package/dist/blockFasta.js +12 -0
- package/dist/blockFasta.js.map +1 -0
- package/dist/colorSchemes.d.ts +7 -0
- package/dist/colorSchemes.js +15 -0
- package/dist/colorSchemes.js.map +1 -1
- package/dist/components/MSAView.js +15 -9
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/MSAViewer.d.ts +28 -7
- package/dist/components/MSAViewer.js +61 -22
- package/dist/components/MSAViewer.js.map +1 -1
- package/dist/components/MetadataTable.d.ts +5 -0
- package/dist/components/MetadataTable.js +29 -0
- package/dist/components/MetadataTable.js.map +1 -0
- package/dist/components/Track.js +11 -2
- package/dist/components/Track.js.map +1 -1
- package/dist/components/dialogs/MetadataDialog.js +5 -6
- package/dist/components/dialogs/MetadataDialog.js.map +1 -1
- package/dist/components/header/ColorSchemeMenu.d.ts +6 -0
- package/dist/components/header/ColorSchemeMenu.js +23 -5
- package/dist/components/header/ColorSchemeMenu.js.map +1 -1
- package/dist/components/header/{RowSearch.d.ts → GoToBox.d.ts} +2 -2
- package/dist/components/header/GoToBox.js +21 -0
- package/dist/components/header/GoToBox.js.map +1 -0
- package/dist/components/header/Header.js +4 -2
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/SelectionMenu.d.ts +12 -0
- package/dist/components/header/SelectionMenu.js +72 -0
- package/dist/components/header/SelectionMenu.js.map +1 -0
- package/dist/components/header/goTo.d.ts +20 -0
- package/dist/components/header/goTo.js +69 -0
- package/dist/components/header/goTo.js.map +1 -0
- package/dist/components/msa/MSACanvas.js +13 -2
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +5 -1
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/msaKeys.js +6 -0
- package/dist/components/msa/msaKeys.js.map +1 -1
- package/dist/components/msa/msaRaster.js +1 -0
- package/dist/components/msa/msaRaster.js.map +1 -1
- package/dist/components/msa/renderHighlights.d.ts +14 -3
- package/dist/components/msa/renderHighlights.js +29 -4
- package/dist/components/msa/renderHighlights.js.map +1 -1
- package/dist/components/msa/tileColor.js +9 -8
- package/dist/components/msa/tileColor.js.map +1 -1
- package/dist/components/msa/useMsaBlockMouse.d.ts +1 -1
- package/dist/components/msa/useMsaBlockMouse.js +18 -11
- package/dist/components/msa/useMsaBlockMouse.js.map +1 -1
- package/dist/components/overlayColors.d.ts +2 -0
- package/dist/components/overlayColors.js +3 -0
- package/dist/components/overlayColors.js.map +1 -1
- package/dist/components/selectionDrag.d.ts +17 -0
- package/dist/components/selectionDrag.js +30 -0
- package/dist/components/selectionDrag.js.map +1 -0
- package/dist/components/tracks/useTrackHover.d.ts +3 -1
- package/dist/components/tracks/useTrackHover.js +26 -6
- package/dist/components/tracks/useTrackHover.js.map +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +9 -8
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +6 -6
- package/dist/constants.js.map +1 -1
- package/dist/element.d.ts +7 -3
- package/dist/element.js +32 -4
- package/dist/element.js.map +1 -1
- package/dist/featuresLayer.d.ts +8 -0
- package/dist/featuresLayer.js +42 -0
- package/dist/featuresLayer.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/model/DataModel.d.ts +1 -1
- package/dist/model/DataModel.js +3 -3
- package/dist/model/DataModel.js.map +1 -1
- package/dist/model/msaModel.d.ts +14 -1
- package/dist/model/msaModel.js +17 -1
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model.d.ts +122 -11
- package/dist/model.js +260 -41
- package/dist/model.js.map +1 -1
- package/dist/svgTestUtil.d.ts +68 -8
- package/dist/types.d.ts +50 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/src/blockFasta.ts +18 -0
- package/src/colorSchemes.ts +20 -0
- package/src/components/MSAView.tsx +16 -9
- package/src/components/MSAViewer.tsx +95 -26
- package/src/components/MetadataTable.tsx +55 -0
- package/src/components/Track.tsx +14 -1
- package/src/components/dialogs/MetadataDialog.tsx +9 -8
- package/src/components/header/ColorSchemeMenu.tsx +31 -12
- package/src/components/header/GoToBox.tsx +50 -0
- package/src/components/header/Header.tsx +6 -2
- package/src/components/header/SelectionMenu.tsx +117 -0
- package/src/components/header/goTo.ts +75 -0
- package/src/components/msa/MSACanvas.tsx +12 -2
- package/src/components/msa/MSACanvasBlock.tsx +5 -1
- package/src/components/msa/msaKeys.ts +6 -0
- package/src/components/msa/msaRaster.ts +1 -0
- package/src/components/msa/renderHighlights.ts +46 -4
- package/src/components/msa/tileColor.ts +9 -8
- package/src/components/msa/useMsaBlockMouse.ts +24 -27
- package/src/components/overlayColors.ts +4 -0
- package/src/components/selectionDrag.ts +42 -0
- package/src/components/tracks/useTrackHover.ts +28 -6
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +14 -16
- package/src/constants.ts +6 -6
- package/src/element.ts +45 -5
- package/src/featuresLayer.ts +48 -0
- package/src/index.ts +5 -0
- package/src/model/DataModel.ts +3 -3
- package/src/model/msaModel.ts +19 -1
- package/src/model.ts +309 -51
- package/src/types.ts +58 -0
- package/src/version.ts +1 -1
- package/dist/components/header/RowSearch.js +0 -15
- package/dist/components/header/RowSearch.js.map +0 -1
- package/dist/components/header/revealRow.d.ts +0 -3
- package/dist/components/header/revealRow.js +0 -15
- package/dist/components/header/revealRow.js.map +0 -1
- package/src/components/header/RowSearch.tsx +0 -34
- package/src/components/header/revealRow.ts +0 -17
package/dist/svgTestUtil.d.ts
CHANGED
|
@@ -14,12 +14,13 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
14
14
|
showTreeOverview: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
15
15
|
overviewHeight: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
16
16
|
autoTreeAreaWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
17
|
-
}, "bgColor" | "colorSchemeName" | "msaFormat" | "showColumnStats"> & {
|
|
17
|
+
}, "bgColor" | "colorSchemeName" | "customColorScheme" | "msaFormat" | "showColumnStats"> & {
|
|
18
18
|
bgColor: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
19
19
|
colorSchemeName: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
20
|
+
customColorScheme: import("@jbrowse/mobx-state-tree").IType<Record<string, string> | undefined, Record<string, string> | undefined, Record<string, string> | undefined>;
|
|
20
21
|
showColumnStats: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
21
22
|
msaFormat: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<import("msa-parsers").MSAFormat>>;
|
|
22
|
-
}, "allowedGappyness" | "clades" | "colWidth" | "collapsed" | "columnTracks" | "currentAlignment" | "data" | "drawMsaLetters" | "encodings" | "gffFilehandle" | "height" | "hideGaps" | "highlightColumns" | "highlights" | "id" | "msaFilehandle" | "region" | "relativeTo" | "residueMappings" | "rotated" | "rowHeight" | "rowPanels" | "scrollX" | "scrollY" | "scrollZoom" | "scrollZoomAxis" | "showDomainLegend" | "showDomains" | "showOnly" | "subFeatureRows" | "trackHeights" | "treeFilehandle" | "treeMetadataFilehandle" | "treeRoot" | "turnedOffFeatures" | "turnedOffTracks" | "type"> & {
|
|
23
|
+
}, "allowedGappyness" | "clades" | "colWidth" | "collapsed" | "columnTracks" | "currentAlignment" | "data" | "drawMsaLetters" | "encodings" | "features" | "gffFilehandle" | "height" | "hideGaps" | "highlightColumns" | "highlights" | "id" | "msaFilehandle" | "region" | "relativeTo" | "residueMappings" | "rotated" | "rowHeight" | "rowPanels" | "scrollX" | "scrollY" | "scrollZoom" | "scrollZoomAxis" | "selection" | "showDomainLegend" | "showDomains" | "showOnly" | "subFeatureRows" | "trackHeights" | "treeFilehandle" | "treeMetadataFilehandle" | "treeRoot" | "turnedOffFeatures" | "turnedOffTracks" | "type"> & {
|
|
23
24
|
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
24
25
|
showDomains: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
25
26
|
showDomainLegend: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
@@ -437,6 +438,8 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
437
438
|
relativeTo: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
|
|
438
439
|
highlightColumns: import("@jbrowse/mobx-state-tree").IType<number[] | undefined, number[] | undefined, number[] | undefined>;
|
|
439
440
|
highlights: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Highlight, import("./types.ts").Highlight, import("./types.ts").Highlight>>, [undefined]>;
|
|
441
|
+
features: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Feature, import("./types.ts").Feature, import("./types.ts").Feature>>, [undefined]>;
|
|
442
|
+
selection: import("@jbrowse/mobx-state-tree").IType<import("./types.ts").MsaSelection | undefined, import("./types.ts").MsaSelection | undefined, import("./types.ts").MsaSelection | undefined>;
|
|
440
443
|
region: import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Region | undefined, import("./types.ts").Region | undefined, import("./types.ts").Region | undefined>;
|
|
441
444
|
clades: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Clade, import("./types.ts").Clade, import("./types.ts").Clade>>, [undefined]>;
|
|
442
445
|
encodings: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Encoding, import("./types.ts").Encoding, import("./types.ts").Encoding>>, [undefined]>;
|
|
@@ -464,6 +467,7 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
464
467
|
setDrawLabels(arg: boolean): void;
|
|
465
468
|
} & {
|
|
466
469
|
setColorSchemeName(name: string): void;
|
|
470
|
+
setCustomColorScheme(map?: Record<string, string>): void;
|
|
467
471
|
setBgColor(arg: boolean): void;
|
|
468
472
|
setShowColumnStats(arg: boolean): void;
|
|
469
473
|
setMSAFormat(arg?: import("msa-parsers").MSAFormat): void;
|
|
@@ -514,6 +518,9 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
514
518
|
setHighlightedColumns(columns?: number[]): void;
|
|
515
519
|
setRegion(region?: import("./types.ts").Region): void;
|
|
516
520
|
setHighlights(highlights: import("./types.ts").Highlight[]): void;
|
|
521
|
+
setFeatures(features: import("./types.ts").Feature[]): void;
|
|
522
|
+
setSelection(selection?: import("./types.ts").MsaSelection): void;
|
|
523
|
+
clearSelection(): void;
|
|
517
524
|
setClades(clades: import("./types.ts").Clade[]): void;
|
|
518
525
|
applyHighlight(owner: string, highlights: import("./types.ts").Highlight[]): void;
|
|
519
526
|
clearHighlight(owner: string): void;
|
|
@@ -542,16 +549,18 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
542
549
|
setMSA(result: string): void;
|
|
543
550
|
setTree(result: string): void;
|
|
544
551
|
setTreeMetadata(result: string): void;
|
|
545
|
-
setGFF(result
|
|
552
|
+
setGFF(result?: string): void;
|
|
546
553
|
} & {
|
|
547
554
|
readonly hideGapsEffective: boolean;
|
|
548
555
|
readonly realAllowedGappyness: number;
|
|
556
|
+
readonly allAnnotations: import("msa-parsers").Annotation[];
|
|
549
557
|
readonly actuallyShowDomains: boolean;
|
|
550
558
|
readonly hostRestoresData: boolean;
|
|
551
559
|
readonly viewInitialized: boolean;
|
|
552
560
|
readonly width: number;
|
|
553
561
|
} & {
|
|
554
562
|
readonly colorScheme: Record<string, string>;
|
|
563
|
+
readonly dynamicColorSchemeName: string | undefined;
|
|
555
564
|
readonly header: Record<string, unknown> | {
|
|
556
565
|
info: string;
|
|
557
566
|
version: string | undefined;
|
|
@@ -741,7 +750,7 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
741
750
|
doScrollX(deltaX: number): void;
|
|
742
751
|
setScrollX(n: number): void;
|
|
743
752
|
setColumnTracks(tracks: import("./types.ts").ColumnTrackSpec[]): void;
|
|
744
|
-
setRowData(rowData:
|
|
753
|
+
setRowData(rowData: import("./types.ts").RowDataInput): void;
|
|
745
754
|
setEncodings(encodings: import("./types.ts").Encoding[]): void;
|
|
746
755
|
setRowPanels(panels: import("./types.ts").RowPanelSpec[]): void;
|
|
747
756
|
setResidueMappings(mappings: import("./types.ts").ResidueMapping[]): void;
|
|
@@ -781,6 +790,16 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
781
790
|
}[];
|
|
782
791
|
fillHighlightLabel(label: string, row?: string, start?: number): string;
|
|
783
792
|
readonly resolvedHighlights: import("./types.ts").ResolvedHighlight[];
|
|
793
|
+
readonly resolvedSelection: import("./types.ts").ResolvedSelection | undefined;
|
|
794
|
+
readonly selectionSize: {
|
|
795
|
+
columns: number;
|
|
796
|
+
rows: number;
|
|
797
|
+
} | undefined;
|
|
798
|
+
readonly selectionFileSpan: {
|
|
799
|
+
start: number;
|
|
800
|
+
end: number;
|
|
801
|
+
} | undefined;
|
|
802
|
+
readonly selectionFasta: string;
|
|
784
803
|
columnStatsAt(col: number): import("./columnStats.ts").ColumnStats | undefined;
|
|
785
804
|
getRowData(name: string): {
|
|
786
805
|
data: {
|
|
@@ -828,6 +847,14 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
828
847
|
fit(): void;
|
|
829
848
|
fitVertically(): void;
|
|
830
849
|
zoomToRegion(region: import("./types.ts").Region): void;
|
|
850
|
+
zoomToSelection(): void;
|
|
851
|
+
selectBlock(anchor: {
|
|
852
|
+
col: number;
|
|
853
|
+
row?: number;
|
|
854
|
+
}, head: {
|
|
855
|
+
col: number;
|
|
856
|
+
row?: number;
|
|
857
|
+
}): void;
|
|
831
858
|
fitHorizontally(): void;
|
|
832
859
|
afterCreate(): void;
|
|
833
860
|
} & import("@jbrowse/mobx-state-tree").IStateTreeNode<import("@jbrowse/mobx-state-tree").IModelType<Omit<Omit<Omit<{}, "autoTreeAreaWidth" | "drawLabels" | "drawNodeBubbles" | "drawNodeLabels" | "drawTree" | "labelsAlignRight" | "overviewHeight" | "showBranchLen" | "showTreeOverview" | "treeAreaWidth" | "treeOrder" | "treeWidth"> & {
|
|
@@ -843,12 +870,13 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
843
870
|
showTreeOverview: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
844
871
|
overviewHeight: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
845
872
|
autoTreeAreaWidth: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
846
|
-
}, "bgColor" | "colorSchemeName" | "msaFormat" | "showColumnStats"> & {
|
|
873
|
+
}, "bgColor" | "colorSchemeName" | "customColorScheme" | "msaFormat" | "showColumnStats"> & {
|
|
847
874
|
bgColor: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
848
875
|
colorSchemeName: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
876
|
+
customColorScheme: import("@jbrowse/mobx-state-tree").IType<Record<string, string> | undefined, Record<string, string> | undefined, Record<string, string> | undefined>;
|
|
849
877
|
showColumnStats: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
850
878
|
msaFormat: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<import("msa-parsers").MSAFormat>>;
|
|
851
|
-
}, "allowedGappyness" | "clades" | "colWidth" | "collapsed" | "columnTracks" | "currentAlignment" | "data" | "drawMsaLetters" | "encodings" | "gffFilehandle" | "height" | "hideGaps" | "highlightColumns" | "highlights" | "id" | "msaFilehandle" | "region" | "relativeTo" | "residueMappings" | "rotated" | "rowHeight" | "rowPanels" | "scrollX" | "scrollY" | "scrollZoom" | "scrollZoomAxis" | "showDomainLegend" | "showDomains" | "showOnly" | "subFeatureRows" | "trackHeights" | "treeFilehandle" | "treeMetadataFilehandle" | "treeRoot" | "turnedOffFeatures" | "turnedOffTracks" | "type"> & {
|
|
879
|
+
}, "allowedGappyness" | "clades" | "colWidth" | "collapsed" | "columnTracks" | "currentAlignment" | "data" | "drawMsaLetters" | "encodings" | "features" | "gffFilehandle" | "height" | "hideGaps" | "highlightColumns" | "highlights" | "id" | "msaFilehandle" | "region" | "relativeTo" | "residueMappings" | "rotated" | "rowHeight" | "rowPanels" | "scrollX" | "scrollY" | "scrollZoom" | "scrollZoomAxis" | "selection" | "showDomainLegend" | "showDomains" | "showOnly" | "subFeatureRows" | "trackHeights" | "treeFilehandle" | "treeMetadataFilehandle" | "treeRoot" | "turnedOffFeatures" | "turnedOffTracks" | "type"> & {
|
|
852
880
|
id: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
853
881
|
showDomains: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
854
882
|
showDomainLegend: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
@@ -1266,6 +1294,8 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1266
1294
|
relativeTo: import("@jbrowse/mobx-state-tree").IMaybe<import("@jbrowse/mobx-state-tree").ISimpleType<string>>;
|
|
1267
1295
|
highlightColumns: import("@jbrowse/mobx-state-tree").IType<number[] | undefined, number[] | undefined, number[] | undefined>;
|
|
1268
1296
|
highlights: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Highlight, import("./types.ts").Highlight, import("./types.ts").Highlight>>, [undefined]>;
|
|
1297
|
+
features: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Feature, import("./types.ts").Feature, import("./types.ts").Feature>>, [undefined]>;
|
|
1298
|
+
selection: import("@jbrowse/mobx-state-tree").IType<import("./types.ts").MsaSelection | undefined, import("./types.ts").MsaSelection | undefined, import("./types.ts").MsaSelection | undefined>;
|
|
1269
1299
|
region: import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Region | undefined, import("./types.ts").Region | undefined, import("./types.ts").Region | undefined>;
|
|
1270
1300
|
clades: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Clade, import("./types.ts").Clade, import("./types.ts").Clade>>, [undefined]>;
|
|
1271
1301
|
encodings: import("@jbrowse/mobx-state-tree").IOptionalIType<import("@jbrowse/mobx-state-tree").IArrayType<import("@jbrowse/mobx-state-tree").IType<import("./types.ts").Encoding, import("./types.ts").Encoding, import("./types.ts").Encoding>>, [undefined]>;
|
|
@@ -1293,6 +1323,7 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1293
1323
|
setDrawLabels(arg: boolean): void;
|
|
1294
1324
|
} & {
|
|
1295
1325
|
setColorSchemeName(name: string): void;
|
|
1326
|
+
setCustomColorScheme(map?: Record<string, string>): void;
|
|
1296
1327
|
setBgColor(arg: boolean): void;
|
|
1297
1328
|
setShowColumnStats(arg: boolean): void;
|
|
1298
1329
|
setMSAFormat(arg?: import("msa-parsers").MSAFormat): void;
|
|
@@ -1343,6 +1374,9 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1343
1374
|
setHighlightedColumns(columns?: number[]): void;
|
|
1344
1375
|
setRegion(region?: import("./types.ts").Region): void;
|
|
1345
1376
|
setHighlights(highlights: import("./types.ts").Highlight[]): void;
|
|
1377
|
+
setFeatures(features: import("./types.ts").Feature[]): void;
|
|
1378
|
+
setSelection(selection?: import("./types.ts").MsaSelection): void;
|
|
1379
|
+
clearSelection(): void;
|
|
1346
1380
|
setClades(clades: import("./types.ts").Clade[]): void;
|
|
1347
1381
|
applyHighlight(owner: string, highlights: import("./types.ts").Highlight[]): void;
|
|
1348
1382
|
clearHighlight(owner: string): void;
|
|
@@ -1371,16 +1405,18 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1371
1405
|
setMSA(result: string): void;
|
|
1372
1406
|
setTree(result: string): void;
|
|
1373
1407
|
setTreeMetadata(result: string): void;
|
|
1374
|
-
setGFF(result
|
|
1408
|
+
setGFF(result?: string): void;
|
|
1375
1409
|
} & {
|
|
1376
1410
|
readonly hideGapsEffective: boolean;
|
|
1377
1411
|
readonly realAllowedGappyness: number;
|
|
1412
|
+
readonly allAnnotations: import("msa-parsers").Annotation[];
|
|
1378
1413
|
readonly actuallyShowDomains: boolean;
|
|
1379
1414
|
readonly hostRestoresData: boolean;
|
|
1380
1415
|
readonly viewInitialized: boolean;
|
|
1381
1416
|
readonly width: number;
|
|
1382
1417
|
} & {
|
|
1383
1418
|
readonly colorScheme: Record<string, string>;
|
|
1419
|
+
readonly dynamicColorSchemeName: string | undefined;
|
|
1384
1420
|
readonly header: Record<string, unknown> | {
|
|
1385
1421
|
info: string;
|
|
1386
1422
|
version: string | undefined;
|
|
@@ -1570,7 +1606,7 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1570
1606
|
doScrollX(deltaX: number): void;
|
|
1571
1607
|
setScrollX(n: number): void;
|
|
1572
1608
|
setColumnTracks(tracks: import("./types.ts").ColumnTrackSpec[]): void;
|
|
1573
|
-
setRowData(rowData:
|
|
1609
|
+
setRowData(rowData: import("./types.ts").RowDataInput): void;
|
|
1574
1610
|
setEncodings(encodings: import("./types.ts").Encoding[]): void;
|
|
1575
1611
|
setRowPanels(panels: import("./types.ts").RowPanelSpec[]): void;
|
|
1576
1612
|
setResidueMappings(mappings: import("./types.ts").ResidueMapping[]): void;
|
|
@@ -1610,6 +1646,16 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1610
1646
|
}[];
|
|
1611
1647
|
fillHighlightLabel(label: string, row?: string, start?: number): string;
|
|
1612
1648
|
readonly resolvedHighlights: import("./types.ts").ResolvedHighlight[];
|
|
1649
|
+
readonly resolvedSelection: import("./types.ts").ResolvedSelection | undefined;
|
|
1650
|
+
readonly selectionSize: {
|
|
1651
|
+
columns: number;
|
|
1652
|
+
rows: number;
|
|
1653
|
+
} | undefined;
|
|
1654
|
+
readonly selectionFileSpan: {
|
|
1655
|
+
start: number;
|
|
1656
|
+
end: number;
|
|
1657
|
+
} | undefined;
|
|
1658
|
+
readonly selectionFasta: string;
|
|
1613
1659
|
columnStatsAt(col: number): import("./columnStats.ts").ColumnStats | undefined;
|
|
1614
1660
|
getRowData(name: string): {
|
|
1615
1661
|
data: {
|
|
@@ -1657,11 +1703,20 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1657
1703
|
fit(): void;
|
|
1658
1704
|
fitVertically(): void;
|
|
1659
1705
|
zoomToRegion(region: import("./types.ts").Region): void;
|
|
1706
|
+
zoomToSelection(): void;
|
|
1707
|
+
selectBlock(anchor: {
|
|
1708
|
+
col: number;
|
|
1709
|
+
row?: number;
|
|
1710
|
+
}, head: {
|
|
1711
|
+
col: number;
|
|
1712
|
+
row?: number;
|
|
1713
|
+
}): void;
|
|
1660
1714
|
fitHorizontally(): void;
|
|
1661
1715
|
afterCreate(): void;
|
|
1662
1716
|
}, import("@jbrowse/mobx-state-tree")._NotCustomized, {
|
|
1663
1717
|
bgColor: boolean;
|
|
1664
1718
|
colorSchemeName: string;
|
|
1719
|
+
customColorScheme: Record<string, string> | undefined;
|
|
1665
1720
|
showColumnStats: boolean;
|
|
1666
1721
|
msaFormat: import("msa-parsers").MSAFormat | undefined;
|
|
1667
1722
|
drawLabels: boolean;
|
|
@@ -1784,6 +1839,8 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1784
1839
|
relativeTo: string | undefined;
|
|
1785
1840
|
highlightColumns: number[] | undefined;
|
|
1786
1841
|
highlights: import("./types.ts").Highlight[];
|
|
1842
|
+
features: import("./types.ts").Feature[];
|
|
1843
|
+
selection: import("./types.ts").MsaSelection | undefined;
|
|
1787
1844
|
region: import("./types.ts").Region | undefined;
|
|
1788
1845
|
clades: import("./types.ts").Clade[];
|
|
1789
1846
|
encodings: import("./types.ts").Encoding[];
|
|
@@ -1797,6 +1854,7 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1797
1854
|
} | {
|
|
1798
1855
|
bgColor: boolean;
|
|
1799
1856
|
colorSchemeName: string;
|
|
1857
|
+
customColorScheme: Record<string, string> | undefined;
|
|
1800
1858
|
showColumnStats: boolean;
|
|
1801
1859
|
msaFormat: import("msa-parsers").MSAFormat | undefined;
|
|
1802
1860
|
drawLabels: boolean;
|
|
@@ -1919,6 +1977,8 @@ export declare function createTestModel(snapshot: Omit<Snapshot, 'type'>, width?
|
|
|
1919
1977
|
relativeTo: string | undefined;
|
|
1920
1978
|
highlightColumns: number[] | undefined;
|
|
1921
1979
|
highlights: import("./types.ts").Highlight[];
|
|
1980
|
+
features: import("./types.ts").Feature[];
|
|
1981
|
+
selection: import("./types.ts").MsaSelection | undefined;
|
|
1922
1982
|
region: import("./types.ts").Region | undefined;
|
|
1923
1983
|
clades: import("./types.ts").Clade[];
|
|
1924
1984
|
encodings: import("./types.ts").Encoding[];
|
package/dist/types.d.ts
CHANGED
|
@@ -12,6 +12,12 @@ export type TrackKind = 'text' | 'bar' | 'logo' | 'arc' | 'ruler';
|
|
|
12
12
|
* graphics draws between a shape's interior and its own ink.
|
|
13
13
|
*/
|
|
14
14
|
export type ResidueEncoding = 'fill' | 'color';
|
|
15
|
+
/**
|
|
16
|
+
* The residue colors: a scheme name from the built-in table, or a scale's
|
|
17
|
+
* `{map}` of letter to color, which leaves every letter it does not list
|
|
18
|
+
* uncolored
|
|
19
|
+
*/
|
|
20
|
+
export type ColorScheme = string | Required<Pick<ScaleSpec, 'map'>>;
|
|
15
21
|
export interface BasicTrackModel {
|
|
16
22
|
id: string;
|
|
17
23
|
name: string;
|
|
@@ -266,6 +272,25 @@ export interface Highlight {
|
|
|
266
272
|
label?: string;
|
|
267
273
|
color?: string;
|
|
268
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* A feature on one row as data, the JSON form of a GFF line: `start` and `end`
|
|
277
|
+
* are residues of `row`, 1-based and inclusive. `name` is the key the legend,
|
|
278
|
+
* the palette and the filter dialog group features by, `color` overrides the
|
|
279
|
+
* palette and any scale, and a `strand` draws the span as an arrow. Every other
|
|
280
|
+
* field is a column the `featureFill` and `featureLabel` encodings can read.
|
|
281
|
+
*/
|
|
282
|
+
export interface Feature {
|
|
283
|
+
row: string;
|
|
284
|
+
start: number;
|
|
285
|
+
end: number;
|
|
286
|
+
name?: string;
|
|
287
|
+
description?: string;
|
|
288
|
+
/** a GFF feature type; `exon`, `CDS` and the UTRs draw as numbered segments */
|
|
289
|
+
type?: string;
|
|
290
|
+
strand?: '+' | '-';
|
|
291
|
+
color?: string;
|
|
292
|
+
[field: string]: string | number | undefined;
|
|
293
|
+
}
|
|
269
294
|
/**
|
|
270
295
|
* What the viewer draws over a clade. `highlight` fills the rows behind it,
|
|
271
296
|
* across the tree and the alignment. `bracket` draws a bar and the clade's
|
|
@@ -330,6 +355,25 @@ export interface Region {
|
|
|
330
355
|
start: number;
|
|
331
356
|
end: number;
|
|
332
357
|
}
|
|
358
|
+
/**
|
|
359
|
+
* A block of the alignment the reader selected: columns `start` to `end` of the
|
|
360
|
+
* file, 1-based and inclusive like a Highlight without a row, across the rows
|
|
361
|
+
* `rows` names, or across every row where `rows` is absent.
|
|
362
|
+
*/
|
|
363
|
+
export interface MsaSelection {
|
|
364
|
+
start: number;
|
|
365
|
+
end: number;
|
|
366
|
+
rows?: string[];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* An MsaSelection resolved to what is on screen: the visible columns it covers
|
|
370
|
+
* and its rows as runs of consecutive row indices, top to bottom
|
|
371
|
+
*/
|
|
372
|
+
export interface ResolvedSelection {
|
|
373
|
+
startCol: number;
|
|
374
|
+
endCol: number;
|
|
375
|
+
rowRuns: [number, number][];
|
|
376
|
+
}
|
|
333
377
|
/**
|
|
334
378
|
* A cell of the alignment in the host's coordinates, 1-based like Highlight:
|
|
335
379
|
* `column` counts every column of the file, hidden gappy ones included, and
|
|
@@ -348,6 +392,12 @@ export interface Viewport {
|
|
|
348
392
|
startColumn: number;
|
|
349
393
|
endColumn: number;
|
|
350
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* A row table as a host passes it: fields per row name. A number or a boolean
|
|
397
|
+
* reads as its string, the way a GFF value does, and the viewer leaves out any
|
|
398
|
+
* other value. See docs/layers.md
|
|
399
|
+
*/
|
|
400
|
+
export type RowDataInput = Record<string, Record<string, string | number | boolean | null>>;
|
|
351
401
|
/**
|
|
352
402
|
* A channel of a mark the viewer always draws. `tipLabel` colors each tip label
|
|
353
403
|
* in the tree, `rowTint` washes the row across the tree gutter and the
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "8.
|
|
1
|
+
export declare const version = "8.4.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '8.
|
|
1
|
+
export const version = '8.4.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-msaview",
|
|
3
3
|
"author": "Colin",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"repository": {
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@gmod/newick": "^1.0.3",
|
|
53
|
-
"@jbrowse/svgcanvas": "8.
|
|
53
|
+
"@jbrowse/svgcanvas": "8.4.0",
|
|
54
54
|
"colord": "^2.10.0",
|
|
55
55
|
"flatbush": "^4.6.2",
|
|
56
|
-
"msa-parsers": "8.
|
|
56
|
+
"msa-parsers": "8.4.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"clean": "rimraf dist bundle",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FASTA for a block of the alignment: each row's letters from column `start`
|
|
3
|
+
* to `end`, 1-based and inclusive, under its name. Gaps stay in, and a row that
|
|
4
|
+
* ends before `end` is padded with gaps, so every record is the block's width.
|
|
5
|
+
*/
|
|
6
|
+
export function blockFasta(
|
|
7
|
+
rows: readonly (readonly [string, string])[],
|
|
8
|
+
start: number,
|
|
9
|
+
end: number,
|
|
10
|
+
) {
|
|
11
|
+
const width = Math.max(0, end - start + 1)
|
|
12
|
+
return rows
|
|
13
|
+
.map(
|
|
14
|
+
([name, seq]) =>
|
|
15
|
+
`>${name}\n${seq.slice(start - 1, end).padEnd(width, '-')}\n`,
|
|
16
|
+
)
|
|
17
|
+
.join('')
|
|
18
|
+
}
|
package/src/colorSchemes.ts
CHANGED
|
@@ -359,3 +359,23 @@ export default transform(colorSchemes, ([key, val]) => [
|
|
|
359
359
|
key,
|
|
360
360
|
transform(val, ([letter, color]) => [letter, colord(color).toHex()]),
|
|
361
361
|
])
|
|
362
|
+
|
|
363
|
+
const letterTables = new WeakMap<
|
|
364
|
+
Record<string, string>,
|
|
365
|
+
Record<string, string>
|
|
366
|
+
>()
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* A letter map as the renderer looks letters up. The model upper-cases every
|
|
370
|
+
* row before coloring it, so a table keys its letters in upper case and a map
|
|
371
|
+
* may key them in either. The table is cached per map, so its identity is
|
|
372
|
+
* stable enough for the raster cache to key on.
|
|
373
|
+
*/
|
|
374
|
+
export function letterColorTable(map: Record<string, string>) {
|
|
375
|
+
let table = letterTables.get(map)
|
|
376
|
+
if (!table) {
|
|
377
|
+
table = transform(map, ([letter, color]) => [letter.toUpperCase(), color])
|
|
378
|
+
letterTables.set(map, table)
|
|
379
|
+
}
|
|
380
|
+
return table
|
|
381
|
+
}
|
|
@@ -11,7 +11,7 @@ import VerticalScrollbar from './VerticalScrollbar.tsx'
|
|
|
11
11
|
import Header from './header/Header.tsx'
|
|
12
12
|
import Minimap from './minimap/Minimap.tsx'
|
|
13
13
|
import MSAPanel from './msa/MSAPanel.tsx'
|
|
14
|
-
import { clickColor, hoverColor } from './overlayColors.ts'
|
|
14
|
+
import { clickColor, hoverColor, selectionFill } from './overlayColors.ts'
|
|
15
15
|
import RowPanelHeaders from './rowpanels/RowPanelHeaders.tsx'
|
|
16
16
|
import RowPanels from './rowpanels/RowPanels.tsx'
|
|
17
17
|
import TreeOverview from './tree/TreeOverview.tsx'
|
|
@@ -53,12 +53,19 @@ const TrackColumnIndicator = observer(function ({
|
|
|
53
53
|
resizeHandleWidth,
|
|
54
54
|
totalTrackAreaHeight,
|
|
55
55
|
msaCanvasWidth,
|
|
56
|
+
resolvedSelection,
|
|
56
57
|
} = model
|
|
57
58
|
|
|
58
|
-
// hovered column, then the pinned one, matching
|
|
59
|
+
// the selected columns, the hovered column, then the pinned one, matching
|
|
60
|
+
// the alignment's own overlay
|
|
59
61
|
const bands = [
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
+
{
|
|
63
|
+
start: resolvedSelection?.startCol,
|
|
64
|
+
end: resolvedSelection?.endCol,
|
|
65
|
+
color: selectionFill,
|
|
66
|
+
},
|
|
67
|
+
{ start: mouseCol, end: mouseCol, color: hoverColor },
|
|
68
|
+
{ start: mouseClickCol, end: mouseClickCol, color: clickColor },
|
|
62
69
|
]
|
|
63
70
|
|
|
64
71
|
return (
|
|
@@ -73,15 +80,15 @@ const TrackColumnIndicator = observer(function ({
|
|
|
73
80
|
pointerEvents: 'none',
|
|
74
81
|
}}
|
|
75
82
|
>
|
|
76
|
-
{bands.map(({
|
|
77
|
-
|
|
83
|
+
{bands.map(({ start, end, color }) =>
|
|
84
|
+
start === undefined || end === undefined ? null : (
|
|
78
85
|
<div
|
|
79
86
|
key={color}
|
|
80
87
|
style={{
|
|
81
88
|
position: 'absolute',
|
|
82
|
-
left:
|
|
89
|
+
left: start * colWidth + scrollX,
|
|
83
90
|
top: 0,
|
|
84
|
-
width: colWidth,
|
|
91
|
+
width: (end - start + 1) * colWidth,
|
|
85
92
|
height: totalTrackAreaHeight,
|
|
86
93
|
backgroundColor: color,
|
|
87
94
|
zIndex: 100,
|
|
@@ -140,7 +147,7 @@ const MSAView = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
140
147
|
<div>
|
|
141
148
|
{viewInitialized ? (
|
|
142
149
|
<>
|
|
143
|
-
<div style={{ height, overflow: '
|
|
150
|
+
<div style={{ height, overflow: 'clip' }}>
|
|
144
151
|
{hideHeader ? null : <Header model={model} />}
|
|
145
152
|
<View model={model} />
|
|
146
153
|
</div>
|