react-msaview 9.5.0 → 9.7.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 +71 -71
- package/bundle/index.js.map +4 -4
- package/dist/constants.d.ts +8 -0
- package/dist/constants.js +26 -2
- package/dist/constants.js.map +1 -1
- package/dist/createPaletteMap.d.ts +4 -3
- package/dist/createPaletteMap.js +16 -8
- package/dist/createPaletteMap.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model.d.ts +7 -4
- package/dist/model.js +17 -10
- package/dist/model.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/src/constants.ts +28 -2
- package/src/createPaletteMap.ts +22 -8
- package/src/index.ts +1 -1
- package/src/model.ts +20 -14
- package/src/version.ts +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ export declare const subFeatureRowHeight = 4;
|
|
|
15
15
|
export declare const domainUnderlineHeight = 3;
|
|
16
16
|
export declare const segmentFeatureTypes: Set<string>;
|
|
17
17
|
export declare const segmentShades: string[];
|
|
18
|
+
/**
|
|
19
|
+
* A site's feature type: CDD's GenPept `Site`, a Sequence Ontology `*_site`,
|
|
20
|
+
* InterPro's `Binding_site`, `Active_site` and `Conserved_site`, and UniProt's
|
|
21
|
+
* `Binding site`. A site is a set of scattered residues, often single columns
|
|
22
|
+
*/
|
|
23
|
+
export declare function isSiteType(featureType: string | undefined): boolean;
|
|
24
|
+
export declare const domainFills: string[];
|
|
25
|
+
export declare const siteFills: string[];
|
|
18
26
|
export declare const defaultDrawMsaLetters = true;
|
|
19
27
|
export declare const defaultScrollZoom = false;
|
|
20
28
|
export declare const scrollZoomAxes: readonly ['both', 'horizontal', 'vertical'];
|
package/dist/constants.js
CHANGED
|
@@ -20,8 +20,8 @@ export const subFeatureRowHeight = 4;
|
|
|
20
20
|
// height of the bar the overlay draws under a row in letter-color mode
|
|
21
21
|
export const domainUnderlineHeight = 3;
|
|
22
22
|
// Feature types that are ordinal segments of one transcript. The overlay
|
|
23
|
-
// alternates two shades across them and labels them by number,
|
|
24
|
-
// type gets its own
|
|
23
|
+
// alternates two shades across them and labels them by number, and every other
|
|
24
|
+
// type gets its own color and legend row.
|
|
25
25
|
export const segmentFeatureTypes = new Set([
|
|
26
26
|
'exon',
|
|
27
27
|
'CDS',
|
|
@@ -32,6 +32,30 @@ export const segmentFeatureTypes = new Set([
|
|
|
32
32
|
]);
|
|
33
33
|
// the two shades alternated across adjacent segments (exons)
|
|
34
34
|
export const segmentShades = ['#9fb6d4', '#d4dcea'];
|
|
35
|
+
/**
|
|
36
|
+
* A site's feature type: CDD's GenPept `Site`, a Sequence Ontology `*_site`,
|
|
37
|
+
* InterPro's `Binding_site`, `Active_site` and `Conserved_site`, and UniProt's
|
|
38
|
+
* `Binding site`. A site is a set of scattered residues, often single columns
|
|
39
|
+
*/
|
|
40
|
+
export function isSiteType(featureType) {
|
|
41
|
+
return !!featureType && /(^|[_ ])site$/i.test(featureType);
|
|
42
|
+
}
|
|
43
|
+
// A domain fills a span the residue letters draw over, so it takes a mid-light
|
|
44
|
+
// color, CIELAB L* 70 to 80, dark enough that its ends show against unfilled
|
|
45
|
+
// cells. A site marks a few residues inside a domain, so it takes a dark one,
|
|
46
|
+
// L* 45 or less: a thin mark needs lightness contrast to show on a fill, and
|
|
47
|
+
// hue alone gives none. Neither list holds a grey or a magenta, which a
|
|
48
|
+
// structure view draws for uncolored chains and for the hovered residue
|
|
49
|
+
export const domainFills = [
|
|
50
|
+
'#8fb3d9',
|
|
51
|
+
'#f2b277',
|
|
52
|
+
'#9fd18f',
|
|
53
|
+
'#c3a5d9',
|
|
54
|
+
'#ee9f9f',
|
|
55
|
+
'#d4c08f',
|
|
56
|
+
'#8fd1cb',
|
|
57
|
+
];
|
|
58
|
+
export const siteFills = ['#0f6e52', '#a84a00', '#5a54a0', '#3f6b12', '#7a5514'];
|
|
35
59
|
export const defaultDrawMsaLetters = true;
|
|
36
60
|
export const defaultScrollZoom = false;
|
|
37
61
|
// Which cell dimensions a wheel zoom scales. 'horizontal' holds the row height,
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,sBAAsB;AACtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;AACjC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;AAChC,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAClC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAA;AAC/B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACxC,0EAA0E;AAC1E,2BAA2B;AAC3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAA;AACtC,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAC3C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAA;AACnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAA;AAC1C,2EAA2E;AAC3E,kEAAkE;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAA;AACpC,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAEtC,yEAAyE;AACzE
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,sBAAsB;AACtB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAClC,MAAM,CAAC,MAAM,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AAM,sBAAsB,GAAG,GAAG,CAAA;AAEzC,+EAA+E;AAC/E,2EAA2E;AAC3E,YAAY;AACZ,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAEtC,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,8EAA8E;AAC9E,6BAA6B;AAC7B,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAA;AAE5C,8EAA8E;AAC9E,8EAA8E;AAC9E,4DAA4D;AAC5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAEtC,wDAAwD;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAEpC,0EAA0E;AAC1E,wCAAwC;AACxC,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAA;AAE3C,+EAA+E;AAC/E,6EAA6E;AAC7E,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,GAAG,CAAC,CAAA"}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* order, such as the list a scale asked for by name; without it the keys take
|
|
4
4
|
* the ggplot palette of their own size. Beyond the colors available — a
|
|
5
5
|
* gene-structure overlay with one feature per exon, or nine keys on an
|
|
6
|
-
* eight-color palette — every key gets an evenly spaced
|
|
7
|
-
* two keys share a color.
|
|
6
|
+
* eight-color palette — every key gets an evenly spaced hue instead, so no
|
|
7
|
+
* two keys share a color. The hues sit at CIELAB `lightness` where one is
|
|
8
|
+
* given, else at HSL lightness 60.
|
|
8
9
|
*/
|
|
9
|
-
export declare function createPaletteMap(keys: string[], palette?: readonly string[]): {
|
|
10
|
+
export declare function createPaletteMap(keys: string[], palette?: readonly string[], lightness?: number): {
|
|
10
11
|
[k: string]: string;
|
|
11
12
|
};
|
package/dist/createPaletteMap.js
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { colord } from 'colord';
|
|
1
|
+
import { colord, extend } from 'colord';
|
|
2
|
+
import lchPlugin from 'colord/plugins/lch';
|
|
2
3
|
import palettes from './ggplotPalettes.js';
|
|
4
|
+
extend([lchPlugin]);
|
|
3
5
|
/**
|
|
4
6
|
* Creates a map from keys to colors. `palette` names the colors to take in
|
|
5
7
|
* order, such as the list a scale asked for by name; without it the keys take
|
|
6
8
|
* the ggplot palette of their own size. Beyond the colors available — a
|
|
7
9
|
* gene-structure overlay with one feature per exon, or nine keys on an
|
|
8
|
-
* eight-color palette — every key gets an evenly spaced
|
|
9
|
-
* two keys share a color.
|
|
10
|
+
* eight-color palette — every key gets an evenly spaced hue instead, so no
|
|
11
|
+
* two keys share a color. The hues sit at CIELAB `lightness` where one is
|
|
12
|
+
* given, else at HSL lightness 60.
|
|
10
13
|
*/
|
|
11
|
-
export function createPaletteMap(keys, palette) {
|
|
14
|
+
export function createPaletteMap(keys, palette, lightness) {
|
|
12
15
|
const n = keys.length;
|
|
13
16
|
const colors = palette ?? palettes[n - 1];
|
|
14
17
|
if (colors && n <= colors.length) {
|
|
15
18
|
return Object.fromEntries(keys.map((key, i) => [key, colors[i]]));
|
|
16
19
|
}
|
|
17
|
-
return Object.fromEntries(keys.map((key, i) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
return Object.fromEntries(keys.map((key, i) => {
|
|
21
|
+
const h = (i * 360) / n;
|
|
22
|
+
return [
|
|
23
|
+
key,
|
|
24
|
+
(lightness === undefined
|
|
25
|
+
? colord({ h, s: 60, l: 60 })
|
|
26
|
+
: colord({ l: lightness, c: 40, h })).toHex(),
|
|
27
|
+
];
|
|
28
|
+
}));
|
|
21
29
|
}
|
|
22
30
|
//# sourceMappingURL=createPaletteMap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPaletteMap.js","sourceRoot":"","sources":["../src/createPaletteMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"createPaletteMap.js","sourceRoot":"","sources":["../src/createPaletteMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAE1C,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAE1C,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAEnB;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAc,EACd,OAA2B,EAC3B,SAAkB;IAElB,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;IACrB,MAAM,MAAM,GAAG,OAAO,IAAI,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;IACzC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,CAAA;IACpE,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CACvB,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAClB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;QACvB,OAAO;YACL,GAAG;YACH,CAAC,SAAS,KAAK,SAAS;gBACtB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;gBAC7B,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CACrC,CAAC,KAAK,EAAE;SACV,CAAA;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { renderToSvg } from './renderToSvg.tsx';
|
|
|
2
2
|
export type { ExportSvgOptions } from './renderToSvg.tsx';
|
|
3
3
|
export { installHeadlessRenderEnv } from './headlessRenderEnv.ts';
|
|
4
4
|
export { CHAR_WIDTH_RATIO } from './measureTextCanvas.ts';
|
|
5
|
-
export { maxNeighborJoiningRows } from './constants.ts';
|
|
5
|
+
export { isSiteType, maxNeighborJoiningRows } from './constants.ts';
|
|
6
6
|
export { expandSpec, residueLabel } from './expandSpec.ts';
|
|
7
7
|
export type { ColumnTrackShorthand, HighlightShorthand, MsaSpec, RegionShorthand, } from './expandSpec.ts';
|
|
8
8
|
export { default as MSAView } from './components/Loading.tsx';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export { installHeadlessRenderEnv } from './headlessRenderEnv.js';
|
|
|
14
14
|
export { CHAR_WIDTH_RATIO } from './measureTextCanvas.js';
|
|
15
15
|
// the row count above which calculateNeighborJoiningTreeFromMSA throws, for
|
|
16
16
|
// hosts gating their own menu item
|
|
17
|
-
export { maxNeighborJoiningRows } from './constants.js';
|
|
17
|
+
export { isSiteType, maxNeighborJoiningRows } from './constants.js';
|
|
18
18
|
// the short forms a link or a script can write a view in; see docs/layers.md
|
|
19
19
|
export { expandSpec, residueLabel } from './expandSpec.js';
|
|
20
20
|
export { default as MSAView } from './components/Loading.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,yDAAyD;AACzD,6EAA6E;AAC7E,+DAA+D;AAC/D,gFAAgF;AAChF,0EAA0E;AAC1E,yEAA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cAAc,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,OAAO,EAAqB,OAAO,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/model.d.ts
CHANGED
|
@@ -2074,12 +2074,15 @@ declare function stateModelFactory({ maxInlineSnapshotBytes, }?: {
|
|
|
2074
2074
|
/**
|
|
2075
2075
|
* #getter
|
|
2076
2076
|
* categorical feature types (InterPro domains and the like) that each get
|
|
2077
|
-
* their own color and a legend entry
|
|
2078
|
-
* feature type, types in the order they first appear. A GenPept
|
|
2079
|
-
* record's CDD Sites follow every Region, so the palette spends the
|
|
2080
|
-
* colors after the domains' on the sites inside them
|
|
2077
|
+
* their own color and a legend entry
|
|
2081
2078
|
*/
|
|
2082
2079
|
readonly categoricalDomainTypes: Annotation[];
|
|
2080
|
+
/**
|
|
2081
|
+
* #getter
|
|
2082
|
+
* accession -> fill: segments alternate two shades, a domain takes a
|
|
2083
|
+
* mid-light color and a site a dark one, so a site's residues stand out on
|
|
2084
|
+
* the domain around them
|
|
2085
|
+
*/
|
|
2083
2086
|
readonly fillPalette: {
|
|
2084
2087
|
[x: string]: string;
|
|
2085
2088
|
};
|
package/dist/model.js
CHANGED
|
@@ -13,7 +13,7 @@ import { packDomainLanes } from './components/msa/packDomainLanes.js';
|
|
|
13
13
|
import { visibleColRange } from './components/msa/visibleColRange.js';
|
|
14
14
|
import { cladeGutterWidth } from './components/tree/cladeBrackets.js';
|
|
15
15
|
import { scaleBarLength } from './components/tree/scaleBar.js';
|
|
16
|
-
import { defaultAllowedGappyness, defaultColWidth, defaultColorSchemeName, defaultCurrentAlignment, defaultDrawMsaLetters, defaultHeight, defaultHideGaps, defaultRowHeight, defaultScrollX, defaultScrollY, defaultScrollZoom, defaultScrollZoomAxis, defaultShowDomainLegend, defaultShowDomains, defaultSubFeatureRows, fontSizeFor, labelFitFontSize, maxCellSize, maxFitTreeWidth, maxTreeAreaShare, maxInlineSnapshotBytes as defaultMaxInlineSnapshotBytes, maxNeighborJoiningRows, minColWidth, minLetterColWidth, minLetterRowHeight, minRowHeight, minTreeWidth, pxPerTreeDepth, resizeHandleWidth, rowPanelHeaderHeight, rowTintAlpha, scrollZoomAxes, segmentFeatureTypes, segmentShades, settingsPanelWidth, treeScaleBarHeight, } from './constants.js';
|
|
16
|
+
import { defaultAllowedGappyness, defaultColWidth, defaultColorSchemeName, defaultCurrentAlignment, defaultDrawMsaLetters, defaultHeight, defaultHideGaps, defaultRowHeight, defaultScrollX, defaultScrollY, defaultScrollZoom, defaultScrollZoomAxis, defaultShowDomainLegend, defaultShowDomains, domainFills, defaultSubFeatureRows, fontSizeFor, labelFitFontSize, maxCellSize, maxFitTreeWidth, maxTreeAreaShare, maxInlineSnapshotBytes as defaultMaxInlineSnapshotBytes, maxNeighborJoiningRows, minColWidth, minLetterColWidth, minLetterRowHeight, isSiteType, minRowHeight, minTreeWidth, pxPerTreeDepth, resizeHandleWidth, rowPanelHeaderHeight, rowTintAlpha, scrollZoomAxes, segmentFeatureTypes, segmentShades, settingsPanelWidth, siteFills, treeScaleBarHeight, } from './constants.js';
|
|
17
17
|
import { createPaletteMap } from './createPaletteMap.js';
|
|
18
18
|
import { exportFileName } from './exportFileName.js';
|
|
19
19
|
import { featureField, featureName } from './featureFields.js';
|
|
@@ -3055,23 +3055,30 @@ function stateModelFactory({ maxInlineSnapshotBytes = defaultMaxInlineSnapshotBy
|
|
|
3055
3055
|
/**
|
|
3056
3056
|
* #getter
|
|
3057
3057
|
* categorical feature types (InterPro domains and the like) that each get
|
|
3058
|
-
* their own color and a legend entry
|
|
3059
|
-
* feature type, types in the order they first appear. A GenPept
|
|
3060
|
-
* record's CDD Sites follow every Region, so the palette spends the
|
|
3061
|
-
* colors after the domains' on the sites inside them
|
|
3058
|
+
* their own color and a legend entry
|
|
3062
3059
|
*/
|
|
3063
3060
|
get categoricalDomainTypes() {
|
|
3064
|
-
|
|
3065
|
-
const typeOrder = [...new Set(types.map(d => d.featureType))];
|
|
3066
|
-
return types.toSorted((a, b) => typeOrder.indexOf(a.featureType) - typeOrder.indexOf(b.featureType));
|
|
3061
|
+
return [...self.annotationTypes.values()].filter(d => !segmentFeatureTypes.has(d.featureType ?? ''));
|
|
3067
3062
|
},
|
|
3063
|
+
/**
|
|
3064
|
+
* #getter
|
|
3065
|
+
* accession -> fill: segments alternate two shades, a domain takes a
|
|
3066
|
+
* mid-light color and a site a dark one, so a site's residues stand out on
|
|
3067
|
+
* the domain around them
|
|
3068
|
+
*/
|
|
3068
3069
|
get fillPalette() {
|
|
3069
3070
|
const segments = Object.fromEntries(this.segmentDomainTypes.map((d, i) => [
|
|
3070
3071
|
d.accession,
|
|
3071
3072
|
segmentShades[i % segmentShades.length],
|
|
3072
3073
|
]));
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3074
|
+
const accessions = (site) => this.categoricalDomainTypes
|
|
3075
|
+
.filter(d => isSiteType(d.featureType) === site)
|
|
3076
|
+
.map(d => d.accession);
|
|
3077
|
+
return {
|
|
3078
|
+
...segments,
|
|
3079
|
+
...createPaletteMap(accessions(false), domainFills, 75),
|
|
3080
|
+
...createPaletteMap(accessions(true), siteFills, 40),
|
|
3081
|
+
};
|
|
3075
3082
|
},
|
|
3076
3083
|
/**
|
|
3077
3084
|
* #getter
|