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/src/model.ts
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
defaultScrollZoomAxis,
|
|
47
47
|
defaultShowDomainLegend,
|
|
48
48
|
defaultShowDomains,
|
|
49
|
+
domainFills,
|
|
49
50
|
defaultSubFeatureRows,
|
|
50
51
|
fontSizeFor,
|
|
51
52
|
labelFitFontSize,
|
|
@@ -57,6 +58,7 @@ import {
|
|
|
57
58
|
minColWidth,
|
|
58
59
|
minLetterColWidth,
|
|
59
60
|
minLetterRowHeight,
|
|
61
|
+
isSiteType,
|
|
60
62
|
minRowHeight,
|
|
61
63
|
minTreeWidth,
|
|
62
64
|
pxPerTreeDepth,
|
|
@@ -67,6 +69,7 @@ import {
|
|
|
67
69
|
segmentFeatureTypes,
|
|
68
70
|
segmentShades,
|
|
69
71
|
settingsPanelWidth,
|
|
72
|
+
siteFills,
|
|
70
73
|
treeScaleBarHeight,
|
|
71
74
|
} from './constants.ts'
|
|
72
75
|
import { createPaletteMap } from './createPaletteMap.ts'
|
|
@@ -3591,21 +3594,19 @@ function stateModelFactory({
|
|
|
3591
3594
|
/**
|
|
3592
3595
|
* #getter
|
|
3593
3596
|
* categorical feature types (InterPro domains and the like) that each get
|
|
3594
|
-
* their own color and a legend entry
|
|
3595
|
-
* feature type, types in the order they first appear. A GenPept
|
|
3596
|
-
* record's CDD Sites follow every Region, so the palette spends the
|
|
3597
|
-
* colors after the domains' on the sites inside them
|
|
3597
|
+
* their own color and a legend entry
|
|
3598
3598
|
*/
|
|
3599
3599
|
get categoricalDomainTypes() {
|
|
3600
|
-
|
|
3600
|
+
return [...self.annotationTypes.values()].filter(
|
|
3601
3601
|
d => !segmentFeatureTypes.has(d.featureType ?? ''),
|
|
3602
3602
|
)
|
|
3603
|
-
const typeOrder = [...new Set(types.map(d => d.featureType))]
|
|
3604
|
-
return types.toSorted(
|
|
3605
|
-
(a, b) =>
|
|
3606
|
-
typeOrder.indexOf(a.featureType) - typeOrder.indexOf(b.featureType),
|
|
3607
|
-
)
|
|
3608
3603
|
},
|
|
3604
|
+
/**
|
|
3605
|
+
* #getter
|
|
3606
|
+
* accession -> fill: segments alternate two shades, a domain takes a
|
|
3607
|
+
* mid-light color and a site a dark one, so a site's residues stand out on
|
|
3608
|
+
* the domain around them
|
|
3609
|
+
*/
|
|
3609
3610
|
get fillPalette() {
|
|
3610
3611
|
const segments = Object.fromEntries(
|
|
3611
3612
|
this.segmentDomainTypes.map((d, i) => [
|
|
@@ -3613,10 +3614,15 @@ function stateModelFactory({
|
|
|
3613
3614
|
segmentShades[i % segmentShades.length]!,
|
|
3614
3615
|
]),
|
|
3615
3616
|
)
|
|
3616
|
-
const
|
|
3617
|
-
this.categoricalDomainTypes
|
|
3618
|
-
|
|
3619
|
-
|
|
3617
|
+
const accessions = (site: boolean) =>
|
|
3618
|
+
this.categoricalDomainTypes
|
|
3619
|
+
.filter(d => isSiteType(d.featureType) === site)
|
|
3620
|
+
.map(d => d.accession)
|
|
3621
|
+
return {
|
|
3622
|
+
...segments,
|
|
3623
|
+
...createPaletteMap(accessions(false), domainFills, 75),
|
|
3624
|
+
...createPaletteMap(accessions(true), siteFills, 40),
|
|
3625
|
+
}
|
|
3620
3626
|
},
|
|
3621
3627
|
/**
|
|
3622
3628
|
* #getter
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '9.
|
|
1
|
+
export const version = '9.7.0'
|