react-msaview 3.1.3 → 3.1.4
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 +5 -5
- package/dist/DialogQueue.js +2 -4
- package/dist/DialogQueue.js.map +1 -1
- package/dist/UniprotTrack.js +1 -1
- package/dist/UniprotTrack.js.map +1 -1
- package/dist/components/BoxTrackBlock.js +3 -4
- package/dist/components/BoxTrackBlock.js.map +1 -1
- package/dist/components/ImportForm/util.js +1 -0
- package/dist/components/ImportForm/util.js.map +1 -1
- package/dist/components/Loading.d.ts +6 -0
- package/dist/components/Loading.js +12 -0
- package/dist/components/Loading.js.map +1 -0
- package/dist/components/MSAPanel/MSABlock.js +3 -3
- package/dist/components/MSAPanel/MSABlock.js.map +1 -1
- package/dist/components/MSAPanel/MSAMouseoverCanvas.js +7 -9
- package/dist/components/MSAPanel/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/MSAPanel/index.js +1 -1
- package/dist/components/MSAPanel/index.js.map +1 -1
- package/dist/components/MSAPanel/renderMSABlock.d.ts +3 -1
- package/dist/components/MSAPanel/renderMSABlock.js +10 -10
- package/dist/components/MSAPanel/renderMSABlock.js.map +1 -1
- package/dist/components/MSAPanel/renderMSAMouseover.js +5 -8
- package/dist/components/MSAPanel/renderMSAMouseover.js.map +1 -1
- package/dist/components/MSAView.js +20 -16
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TextTrack.js.map +1 -1
- package/dist/components/TreePanel/TreeCanvasBlock.js +11 -13
- package/dist/components/TreePanel/TreeCanvasBlock.js.map +1 -1
- package/dist/components/TreePanel/TreeNodeMenu.js +4 -6
- package/dist/components/TreePanel/TreeNodeMenu.js.map +1 -1
- package/dist/components/TreePanel/renderTreeCanvas.js +12 -13
- package/dist/components/TreePanel/renderTreeCanvas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/layout.js +5 -0
- package/dist/layout.js.map +1 -1
- package/dist/measureTextCanvas.d.ts +1 -0
- package/dist/measureTextCanvas.js +13 -0
- package/dist/measureTextCanvas.js.map +1 -0
- package/dist/model.d.ts +51 -52
- package/dist/model.js +20 -40
- package/dist/model.js.map +1 -1
- package/dist/parseNewick.js +1 -2
- package/dist/parseNewick.js.map +1 -1
- package/dist/parsers/ClustalMSA.js +3 -4
- package/dist/parsers/ClustalMSA.js.map +1 -1
- package/dist/parsers/FastaMSA.js +3 -4
- package/dist/parsers/FastaMSA.js.map +1 -1
- package/dist/parsers/StockholmMSA.js +13 -19
- package/dist/parsers/StockholmMSA.js.map +1 -1
- package/dist/renderToSvg.js +1 -0
- package/dist/renderToSvg.js.map +1 -1
- package/dist/util.js +7 -4
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/components/ImportForm/util.ts +1 -0
- package/src/components/Loading.tsx +27 -0
- package/src/components/MSAPanel/MSABlock.tsx +2 -1
- package/src/components/MSAPanel/MSAMouseoverCanvas.tsx +6 -6
- package/src/components/MSAPanel/index.tsx +2 -2
- package/src/components/MSAPanel/renderMSABlock.ts +10 -1
- package/src/components/MSAPanel/renderMSAMouseover.ts +3 -17
- package/src/components/MSAView.tsx +28 -30
- package/src/components/TreePanel/TreeCanvasBlock.tsx +5 -6
- package/src/components/TreePanel/renderTreeCanvas.ts +4 -6
- package/src/index.ts +1 -1
- package/src/measureTextCanvas.ts +14 -0
- package/src/model.ts +4 -11
- package/src/renderToSvg.tsx +1 -0
- package/src/version.ts +1 -1
|
@@ -3,7 +3,6 @@ import { Menu, MenuItem } from '@mui/material';
|
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
const TreeNodeInfoDialog = lazy(() => import('./dialogs/TreeNodeInfoDialog'));
|
|
5
5
|
const TreeMenu = observer(function ({ node, onClose, model, }) {
|
|
6
|
-
var _a, _b;
|
|
7
6
|
const { structures } = model;
|
|
8
7
|
const nodeDetails = node ? model.getRowData(node.name) : undefined;
|
|
9
8
|
return (React.createElement(React.Fragment, null,
|
|
@@ -27,8 +26,8 @@ const TreeMenu = observer(function ({ node, onClose, model, }) {
|
|
|
27
26
|
React.createElement(MenuItem, { dense: true, onClick: () => {
|
|
28
27
|
model.hideNode(node.id);
|
|
29
28
|
onClose();
|
|
30
|
-
} }, "Hide node"),
|
|
31
|
-
|
|
29
|
+
} }, "Hide node"),
|
|
30
|
+
structures[node.name]?.map(entry => {
|
|
32
31
|
return !model.selectedStructures.some(n => n.id === node.name) ? (React.createElement(MenuItem, { key: JSON.stringify(entry), dense: true, onClick: () => {
|
|
33
32
|
model.addStructureToSelection({
|
|
34
33
|
structure: entry,
|
|
@@ -49,11 +48,10 @@ const TreeMenu = observer(function ({ node, onClose, model, }) {
|
|
|
49
48
|
entry.pdb,
|
|
50
49
|
")"));
|
|
51
50
|
}), // @ts-expect-error
|
|
52
|
-
|
|
53
|
-
_b.map(accession => (React.createElement(MenuItem, { dense: true, key: accession, onClick: () => {
|
|
51
|
+
nodeDetails?.data.accession?.map(accession => (React.createElement(MenuItem, { dense: true, key: accession, onClick: () => {
|
|
54
52
|
model.addUniprotTrack({
|
|
55
53
|
// @ts-expect-error
|
|
56
|
-
name: nodeDetails
|
|
54
|
+
name: nodeDetails?.data.name,
|
|
57
55
|
accession,
|
|
58
56
|
});
|
|
59
57
|
onClose();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeMenu.js","sourceRoot":"","sources":["../../../src/components/TreePanel/TreeNodeMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKrC,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,8B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AED,mBAAmB;YACpB,WAAW,EAAE,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAC5C,oBAAC,QAAQ,IACP,KAAK,QACL,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,GAAG,EAAE;oBACZ,KAAK,CAAC,eAAe,CAAC;wBACpB,mBAAmB;wBACnB,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI;wBAC5B,SAAS;qBACV,CAAC,CAAA;oBACF,OAAO,EAAE,CAAA;gBACX,CAAC;;gBAEoB,SAAS;oBACrB,CACZ,CAAC,CACG,CACN,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -46,7 +46,7 @@ export function renderNodeBubbles({ ctx, clickMap, offsetY, model, blockSizeYOve
|
|
|
46
46
|
ctx.arc(x, y, radius, 0, 2 * Math.PI);
|
|
47
47
|
ctx.fill();
|
|
48
48
|
ctx.stroke();
|
|
49
|
-
clickMap
|
|
49
|
+
clickMap?.insert({
|
|
50
50
|
minX: x - radius,
|
|
51
51
|
maxX: x - radius + d,
|
|
52
52
|
minY: y - radius,
|
|
@@ -59,8 +59,7 @@ export function renderNodeBubbles({ ctx, clickMap, offsetY, model, blockSizeYOve
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSizeYOverride, }) {
|
|
62
|
-
|
|
63
|
-
const { rowHeight, showBranchLen, treeMetadata, hierarchy, blockSize, labelsAlignRight, drawTree, structures, treeAreaWidth, margin, noTree, } = model;
|
|
62
|
+
const { rowHeight, showBranchLen, treeMetadata, hierarchy, blockSize, labelsAlignRight, drawTree, structures, treeAreaWidth, noTree, } = model;
|
|
64
63
|
const by = blockSizeYOverride || blockSize;
|
|
65
64
|
if (labelsAlignRight) {
|
|
66
65
|
ctx.textAlign = 'right';
|
|
@@ -77,7 +76,7 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
77
76
|
y: x, data: { name, id },
|
|
78
77
|
// @ts-expect-error
|
|
79
78
|
len, } = node;
|
|
80
|
-
const displayName =
|
|
79
|
+
const displayName = treeMetadata[name]?.genome || name;
|
|
81
80
|
if (y > offsetY - extendBounds && y < offsetY + by + extendBounds) {
|
|
82
81
|
// note: +rowHeight/4 matches with -rowHeight/4 in msa
|
|
83
82
|
const yp = y + rowHeight / 4;
|
|
@@ -88,7 +87,7 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
88
87
|
ctx.fillStyle = hasStructure ? 'blue' : theme.palette.text.primary;
|
|
89
88
|
if (!drawTree && !labelsAlignRight) {
|
|
90
89
|
ctx.fillText(displayName, 0, yp);
|
|
91
|
-
clickMap
|
|
90
|
+
clickMap?.insert({
|
|
92
91
|
minX: 0,
|
|
93
92
|
maxX: width,
|
|
94
93
|
minY: yp - height,
|
|
@@ -99,7 +98,7 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
99
98
|
}
|
|
100
99
|
else if (labelsAlignRight) {
|
|
101
100
|
const smallPadding = 2;
|
|
102
|
-
const offset = treeAreaWidth - smallPadding
|
|
101
|
+
const offset = treeAreaWidth - smallPadding;
|
|
103
102
|
if (drawTree && !noTree) {
|
|
104
103
|
const { width } = ctx.measureText(displayName);
|
|
105
104
|
ctx.moveTo(xp + radius + 2, y);
|
|
@@ -107,9 +106,9 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
107
106
|
ctx.stroke();
|
|
108
107
|
}
|
|
109
108
|
ctx.fillText(displayName, offset, yp);
|
|
110
|
-
clickMap
|
|
111
|
-
minX: treeAreaWidth -
|
|
112
|
-
maxX: treeAreaWidth
|
|
109
|
+
clickMap?.insert({
|
|
110
|
+
minX: treeAreaWidth - width,
|
|
111
|
+
maxX: treeAreaWidth,
|
|
113
112
|
minY: yp - height,
|
|
114
113
|
maxY: yp,
|
|
115
114
|
name,
|
|
@@ -118,7 +117,7 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
118
117
|
}
|
|
119
118
|
else {
|
|
120
119
|
ctx.fillText(displayName, xp + d, yp);
|
|
121
|
-
clickMap
|
|
120
|
+
clickMap?.insert({
|
|
122
121
|
minX: xp + d,
|
|
123
122
|
maxX: xp + d + width,
|
|
124
123
|
minY: yp - height,
|
|
@@ -132,8 +131,8 @@ export function renderTreeLabels({ theme, model, offsetY, ctx, clickMap, blockSi
|
|
|
132
131
|
ctx.setLineDash([]);
|
|
133
132
|
}
|
|
134
133
|
export function renderTreeCanvas({ model, clickMap, ctx, offsetY, theme, highResScaleFactorOverride, blockSizeYOverride, }) {
|
|
135
|
-
clickMap
|
|
136
|
-
const { noTree, drawTree, drawNodeBubbles, treeWidth, highResScaleFactor,
|
|
134
|
+
clickMap?.clear();
|
|
135
|
+
const { noTree, drawTree, drawNodeBubbles, treeWidth, highResScaleFactor, blockSize, fontSize, rowHeight, nref, } = model;
|
|
137
136
|
const by = blockSizeYOverride || blockSize;
|
|
138
137
|
ctx.resetTransform();
|
|
139
138
|
// this is a bogus use of nref, it is never less than 0. we just are using it
|
|
@@ -144,7 +143,7 @@ export function renderTreeCanvas({ model, clickMap, ctx, offsetY, theme, highRes
|
|
|
144
143
|
const k = nref < 0 ? -Infinity : highResScaleFactorOverride || highResScaleFactor;
|
|
145
144
|
ctx.scale(k, k);
|
|
146
145
|
ctx.clearRect(0, 0, treeWidth + padding, by);
|
|
147
|
-
ctx.translate(
|
|
146
|
+
ctx.translate(0, -offsetY);
|
|
148
147
|
const font = ctx.font;
|
|
149
148
|
ctx.font = font.replace(/\d+px/, `${fontSize}px`);
|
|
150
149
|
if (!noTree && drawTree) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderTreeCanvas.js","sourceRoot":"","sources":["../../../src/components/TreePanel/renderTreeCanvas.ts"],"names":[],"mappings":"AAMA,MAAM,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H,OAAO;YACP,KAAK;YACL,QAAQ;YACR,KAAK;YACL,kBAAkB;SACnB,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as MSAView } from './components/
|
|
1
|
+
export { default as MSAView } from './components/Loading';
|
|
2
2
|
export { default as MSAModel, type MsaViewModel } from './model';
|
package/dist/index.js
CHANGED
package/dist/layout.js
CHANGED
package/dist/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,OAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,OAAO,MAAM;IAClB,UAAU,CAUhB;IAEM,gBAAgB,CAAS;IAExB,SAAS,CAAQ;IAEjB,KAAK,CAAuB;IAE5B,YAAY,CAAQ;IAE5B,YAAY,EACV,SAAS,GAAG,KAAK,MAGf,EAAE;QACJ,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAA;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;QAC3B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA,CAAC,uDAAuD;IAC/E,CAAC;IAED;;;OAGG;IACH,OAAO,CACL,EAAU,EACV,IAAY,EACZ,KAAa,EACb,MAAc,EACd,IAAa;QAEb,eAAe;QACf,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAC9C,IAAI,cAAc,EAAE,CAAC;YACnB,OAAO,cAAc,CAAC,IAAI,CAAA;QAC5B,CAAC;QAED,IAAI,UAAU,GAAG,CAAC,CAAA;QAClB,OACE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAClB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,UAAU,GAAG,MAAM;SAC1B,CAAC;YACF,UAAU,IAAI,IAAI,CAAC,SAAS,EAC5B,CAAC;YACD,UAAU,IAAI,CAAC,CAAA;QACjB,CAAC;QAED,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,UAAU,GAAG,MAAM;YACzB,EAAE;YACF,IAAI;SACL,CAAA;QACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA;QAC3D,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAA;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function measureTextCanvas(text: string, fontSize: number): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let canvasHandle;
|
|
2
|
+
export default function measureTextCanvas(text, fontSize) {
|
|
3
|
+
if (!canvasHandle) {
|
|
4
|
+
canvasHandle = document.createElement('canvas');
|
|
5
|
+
}
|
|
6
|
+
const ctx = canvasHandle.getContext('2d');
|
|
7
|
+
if (!ctx) {
|
|
8
|
+
throw new Error('no canvas context');
|
|
9
|
+
}
|
|
10
|
+
ctx.font = ctx.font.replace(/\d+px/, `${fontSize}px`);
|
|
11
|
+
return ctx.measureText(text).width;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=measureTextCanvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measureTextCanvas.js","sourceRoot":"","sources":["../src/measureTextCanvas.ts"],"names":[],"mappings":"AAAA,IAAI,YAA2C,CAAA;AAE/C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,IAAY,EAAE,QAAgB;IACtE,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACjD,CAAC;IAED,MAAM,GAAG,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;IACtC,CAAC;IACD,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,QAAQ,IAAI,CAAC,CAAA;IACrD,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAA;AACpC,CAAC"}
|
package/dist/model.d.ts
CHANGED
|
@@ -81,7 +81,10 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
81
81
|
colorSchemeName: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
82
82
|
treeFilehandle: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISnapshotProcessor<import("mobx-state-tree").ITypeUnion<import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
83
83
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
84
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
84
|
+
uri: import("mobx-state-tree").ISimpleType<string>; /**
|
|
85
|
+
* #property
|
|
86
|
+
* draw clickable node bubbles on the tree
|
|
87
|
+
*/
|
|
85
88
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
86
89
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
87
90
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -98,12 +101,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
98
101
|
}>>, {
|
|
99
102
|
locationType: "UriLocation";
|
|
100
103
|
uri: string;
|
|
101
|
-
internetAccountId: string | undefined;
|
|
102
|
-
* #property
|
|
103
|
-
* focus on particular subtree
|
|
104
|
-
*/
|
|
104
|
+
internetAccountId: string | undefined;
|
|
105
105
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
106
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
106
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
107
|
+
* #property
|
|
108
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
109
|
+
* domains)
|
|
110
|
+
*/
|
|
107
111
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
108
112
|
}> | undefined;
|
|
109
113
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
|
@@ -125,10 +129,7 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
125
129
|
uri: string;
|
|
126
130
|
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
127
131
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
128
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
129
|
-
* #volatile
|
|
130
|
-
* the currently mouse-hovered row
|
|
131
|
-
*/
|
|
132
|
+
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
132
133
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
133
134
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
134
135
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -138,7 +139,10 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
138
139
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject)>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
139
140
|
msaFilehandle: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISnapshotProcessor<import("mobx-state-tree").ITypeUnion<import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
140
141
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
141
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
142
|
+
uri: import("mobx-state-tree").ISimpleType<string>; /**
|
|
143
|
+
* #property
|
|
144
|
+
* draw clickable node bubbles on the tree
|
|
145
|
+
*/
|
|
142
146
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
143
147
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
144
148
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -155,12 +159,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
155
159
|
}>>, {
|
|
156
160
|
locationType: "UriLocation";
|
|
157
161
|
uri: string;
|
|
158
|
-
internetAccountId: string | undefined;
|
|
159
|
-
* #property
|
|
160
|
-
* focus on particular subtree
|
|
161
|
-
*/
|
|
162
|
+
internetAccountId: string | undefined;
|
|
162
163
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
163
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
164
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
165
|
+
* #property
|
|
166
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
167
|
+
* domains)
|
|
168
|
+
*/
|
|
164
169
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
165
170
|
}> | undefined;
|
|
166
171
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
|
@@ -182,10 +187,7 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
182
187
|
uri: string;
|
|
183
188
|
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
184
189
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
185
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
186
|
-
* #volatile
|
|
187
|
-
* the currently mouse-hovered row
|
|
188
|
-
*/
|
|
190
|
+
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
189
191
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
190
192
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
191
193
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -195,7 +197,10 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
195
197
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject)>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
196
198
|
treeMetadataFilehandle: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISnapshotProcessor<import("mobx-state-tree").ITypeUnion<import("mobx-state-tree").ModelCreationType<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
197
199
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
198
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
200
|
+
uri: import("mobx-state-tree").ISimpleType<string>; /**
|
|
201
|
+
* #property
|
|
202
|
+
* draw clickable node bubbles on the tree
|
|
203
|
+
*/
|
|
199
204
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
200
205
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
201
206
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -212,12 +217,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
212
217
|
}>>, {
|
|
213
218
|
locationType: "UriLocation";
|
|
214
219
|
uri: string;
|
|
215
|
-
internetAccountId: string | undefined;
|
|
216
|
-
* #property
|
|
217
|
-
* focus on particular subtree
|
|
218
|
-
*/
|
|
220
|
+
internetAccountId: string | undefined;
|
|
219
221
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
220
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
222
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
223
|
+
* #property
|
|
224
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
225
|
+
* domains)
|
|
226
|
+
*/
|
|
221
227
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
222
228
|
}> | undefined;
|
|
223
229
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
|
@@ -239,10 +245,7 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
239
245
|
uri: string;
|
|
240
246
|
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
241
247
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
242
|
-
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
243
|
-
* #volatile
|
|
244
|
-
* the currently mouse-hovered row
|
|
245
|
-
*/
|
|
248
|
+
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
246
249
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
247
250
|
internetAccountId: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
248
251
|
internetAccountPreAuthorization: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
@@ -342,13 +345,6 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
342
345
|
* #volatile
|
|
343
346
|
*/
|
|
344
347
|
error: unknown;
|
|
345
|
-
/**
|
|
346
|
-
* #volatile
|
|
347
|
-
*/
|
|
348
|
-
margin: {
|
|
349
|
-
left: number;
|
|
350
|
-
top: number;
|
|
351
|
-
};
|
|
352
348
|
/**
|
|
353
349
|
* #volatile
|
|
354
350
|
*/
|
|
@@ -794,12 +790,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
794
790
|
treeFilehandle: {
|
|
795
791
|
locationType: "UriLocation";
|
|
796
792
|
uri: string;
|
|
797
|
-
internetAccountId: string | undefined;
|
|
798
|
-
* #property
|
|
799
|
-
* focus on particular subtree
|
|
800
|
-
*/
|
|
793
|
+
internetAccountId: string | undefined;
|
|
801
794
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
802
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
795
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
796
|
+
* #property
|
|
797
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
798
|
+
* domains)
|
|
799
|
+
*/
|
|
803
800
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
804
801
|
}> | undefined;
|
|
805
802
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
|
@@ -813,12 +810,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
813
810
|
msaFilehandle: {
|
|
814
811
|
locationType: "UriLocation";
|
|
815
812
|
uri: string;
|
|
816
|
-
internetAccountId: string | undefined;
|
|
817
|
-
* #property
|
|
818
|
-
* focus on particular subtree
|
|
819
|
-
*/
|
|
813
|
+
internetAccountId: string | undefined;
|
|
820
814
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
821
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
815
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
816
|
+
* #property
|
|
817
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
818
|
+
* domains)
|
|
819
|
+
*/
|
|
822
820
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
823
821
|
}> | undefined;
|
|
824
822
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
|
@@ -832,12 +830,13 @@ declare const model: import("mobx-state-tree").IModelType<{
|
|
|
832
830
|
treeMetadataFilehandle: {
|
|
833
831
|
locationType: "UriLocation";
|
|
834
832
|
uri: string;
|
|
835
|
-
internetAccountId: string | undefined;
|
|
836
|
-
* #property
|
|
837
|
-
* focus on particular subtree
|
|
838
|
-
*/
|
|
833
|
+
internetAccountId: string | undefined;
|
|
839
834
|
internetAccountPreAuthorization: import("mobx-state-tree").ModelSnapshotType<{
|
|
840
|
-
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
835
|
+
internetAccountType: import("mobx-state-tree").ISimpleType<string>; /**
|
|
836
|
+
* #property
|
|
837
|
+
* a list of "tracks" to display, as box-like glyphs (e.g. protein
|
|
838
|
+
* domains)
|
|
839
|
+
*/
|
|
841
840
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
842
841
|
}> | undefined;
|
|
843
842
|
} | import("mobx-state-tree").ModelSnapshotType<{
|
package/dist/model.js
CHANGED
|
@@ -7,7 +7,7 @@ import { saveAs } from 'file-saver';
|
|
|
7
7
|
// jbrowse
|
|
8
8
|
import { FileLocation, ElementId } from '@jbrowse/core/util/types/mst';
|
|
9
9
|
import { openLocation } from '@jbrowse/core/util/io';
|
|
10
|
-
import {
|
|
10
|
+
import { notEmpty, sum } from '@jbrowse/core/util';
|
|
11
11
|
import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
12
12
|
// locals
|
|
13
13
|
import { clamp, collapse, filterHiddenLeafNodes, generateNodeIds, maxLength, setBrLength, skipBlanks, } from './util';
|
|
@@ -23,6 +23,7 @@ import { StructureModel } from './StructureModel';
|
|
|
23
23
|
import { DialogQueueSessionMixin } from './DialogQueue';
|
|
24
24
|
import { renderToSvg } from './renderToSvg';
|
|
25
25
|
import { blocksX, blocksY } from './calculateBlocks';
|
|
26
|
+
import measureTextCanvas from './measureTextCanvas';
|
|
26
27
|
/**
|
|
27
28
|
* #stateModel MsaView
|
|
28
29
|
* extends
|
|
@@ -230,13 +231,6 @@ const model = types
|
|
|
230
231
|
* #volatile
|
|
231
232
|
*/
|
|
232
233
|
error: undefined,
|
|
233
|
-
/**
|
|
234
|
-
* #volatile
|
|
235
|
-
*/
|
|
236
|
-
margin: {
|
|
237
|
-
left: 20,
|
|
238
|
-
top: 20,
|
|
239
|
-
},
|
|
240
234
|
/**
|
|
241
235
|
* #volatile
|
|
242
236
|
*/
|
|
@@ -471,17 +465,15 @@ const model = types
|
|
|
471
465
|
* #getter
|
|
472
466
|
*/
|
|
473
467
|
get header() {
|
|
474
|
-
|
|
475
|
-
return ((_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getHeader()) || {};
|
|
468
|
+
return this.MSA?.getHeader() || {};
|
|
476
469
|
},
|
|
477
470
|
/**
|
|
478
471
|
* #method
|
|
479
472
|
*/
|
|
480
473
|
getRowData(name) {
|
|
481
|
-
var _a;
|
|
482
474
|
const matches = name.match(/\S+\/(\d+)-(\d+)/);
|
|
483
475
|
return {
|
|
484
|
-
data:
|
|
476
|
+
data: this.MSA?.getRowData(name) || {},
|
|
485
477
|
...(matches && {
|
|
486
478
|
range: {
|
|
487
479
|
start: +matches[1],
|
|
@@ -500,8 +492,7 @@ const model = types
|
|
|
500
492
|
* #getter
|
|
501
493
|
*/
|
|
502
494
|
get alignmentNames() {
|
|
503
|
-
|
|
504
|
-
return ((_a = this.MSA) === null || _a === void 0 ? void 0 : _a.alignmentNames) || [];
|
|
495
|
+
return this.MSA?.alignmentNames || [];
|
|
505
496
|
},
|
|
506
497
|
/**
|
|
507
498
|
* #getter
|
|
@@ -543,17 +534,15 @@ const model = types
|
|
|
543
534
|
* #getter
|
|
544
535
|
*/
|
|
545
536
|
get numColumns() {
|
|
546
|
-
|
|
547
|
-
return (((_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getWidth()) || 0) - this.blanks.length;
|
|
537
|
+
return (this.MSA?.getWidth() || 0) - this.blanks.length;
|
|
548
538
|
},
|
|
549
539
|
/**
|
|
550
540
|
* #getter
|
|
551
541
|
*/
|
|
552
542
|
get _tree() {
|
|
553
|
-
var _a;
|
|
554
543
|
return self.data.tree
|
|
555
544
|
? generateNodeIds(parseNewick(self.data.tree))
|
|
556
|
-
:
|
|
545
|
+
: this.MSA?.getTree() || {
|
|
557
546
|
noTree: true,
|
|
558
547
|
branchset: [],
|
|
559
548
|
id: 'empty',
|
|
@@ -611,8 +600,7 @@ const model = types
|
|
|
611
600
|
* #getter
|
|
612
601
|
*/
|
|
613
602
|
get structures() {
|
|
614
|
-
|
|
615
|
-
return ((_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getStructures()) || {};
|
|
603
|
+
return this.MSA?.getStructures() || {};
|
|
616
604
|
},
|
|
617
605
|
/**
|
|
618
606
|
* #getter
|
|
@@ -631,13 +619,12 @@ const model = types
|
|
|
631
619
|
* #getter
|
|
632
620
|
*/
|
|
633
621
|
get blanks() {
|
|
634
|
-
var _a;
|
|
635
622
|
const blanks = [];
|
|
636
623
|
const strs = this.hierarchy
|
|
637
624
|
.leaves()
|
|
638
|
-
.map(leaf =>
|
|
625
|
+
.map(leaf => this.MSA?.getRow(leaf.data.name))
|
|
639
626
|
.filter((item) => !!item);
|
|
640
|
-
for (let i = 0; i <
|
|
627
|
+
for (let i = 0; i < strs[0]?.length; i++) {
|
|
641
628
|
let counter = 0;
|
|
642
629
|
for (const str of strs) {
|
|
643
630
|
if (str[i] === '-') {
|
|
@@ -657,7 +644,7 @@ const model = types
|
|
|
657
644
|
const MSA = this.MSA;
|
|
658
645
|
return this.hierarchy
|
|
659
646
|
.leaves()
|
|
660
|
-
.map(leaf => [leaf.data.name, MSA
|
|
647
|
+
.map(leaf => [leaf.data.name, MSA?.getRow(leaf.data.name)])
|
|
661
648
|
.filter((f) => !!f[1]);
|
|
662
649
|
},
|
|
663
650
|
/**
|
|
@@ -824,11 +811,10 @@ const model = types
|
|
|
824
811
|
* #action
|
|
825
812
|
*/
|
|
826
813
|
setMouseoveredColumn(n, chain, file) {
|
|
827
|
-
var _a;
|
|
828
814
|
let j = 0;
|
|
829
815
|
let i = 0;
|
|
830
816
|
const { id } = self.inverseStructures[file.slice(0, -4)] || {};
|
|
831
|
-
const row =
|
|
817
|
+
const row = self.MSA?.getRow(id);
|
|
832
818
|
if (row) {
|
|
833
819
|
for (i = 0; i < row.length && j < n; i++) {
|
|
834
820
|
if (row[i] !== '-') {
|
|
@@ -858,12 +844,11 @@ const model = types
|
|
|
858
844
|
* #getter
|
|
859
845
|
*/
|
|
860
846
|
get labelsWidth() {
|
|
861
|
-
var _a;
|
|
862
847
|
let x = 0;
|
|
863
848
|
const { rowHeight, hierarchy, treeMetadata, fontSize } = self;
|
|
864
849
|
if (rowHeight > 5) {
|
|
865
850
|
for (const node of hierarchy.leaves()) {
|
|
866
|
-
x = Math.max(
|
|
851
|
+
x = Math.max(measureTextCanvas(treeMetadata[node.data.name]?.genome || node.data.name, fontSize), x);
|
|
867
852
|
}
|
|
868
853
|
}
|
|
869
854
|
return x;
|
|
@@ -872,15 +857,13 @@ const model = types
|
|
|
872
857
|
* #getter
|
|
873
858
|
*/
|
|
874
859
|
get secondaryStructureConsensus() {
|
|
875
|
-
|
|
876
|
-
return (_a = self.MSA) === null || _a === void 0 ? void 0 : _a.secondaryStructureConsensus;
|
|
860
|
+
return self.MSA?.secondaryStructureConsensus;
|
|
877
861
|
},
|
|
878
862
|
/**
|
|
879
863
|
* #getter
|
|
880
864
|
*/
|
|
881
865
|
get seqConsensus() {
|
|
882
|
-
|
|
883
|
-
return (_a = self.MSA) === null || _a === void 0 ? void 0 : _a.seqConsensus;
|
|
866
|
+
return self.MSA?.seqConsensus;
|
|
884
867
|
},
|
|
885
868
|
/**
|
|
886
869
|
* #getter
|
|
@@ -900,15 +883,14 @@ const model = types
|
|
|
900
883
|
* #getter
|
|
901
884
|
*/
|
|
902
885
|
get adapterTrackModels() {
|
|
903
|
-
|
|
904
|
-
return (((_a = self.MSA) === null || _a === void 0 ? void 0 : _a.tracks.map(t => ({
|
|
886
|
+
return (self.MSA?.tracks.map(t => ({
|
|
905
887
|
model: {
|
|
906
888
|
...t,
|
|
907
889
|
data: t.data ? skipBlanks(self.blanks, t.data) : undefined,
|
|
908
890
|
height: self.rowHeight,
|
|
909
891
|
},
|
|
910
892
|
ReactComponent: TextTrack,
|
|
911
|
-
}))
|
|
893
|
+
})) || []);
|
|
912
894
|
},
|
|
913
895
|
/**
|
|
914
896
|
* #getter
|
|
@@ -944,12 +926,11 @@ const model = types
|
|
|
944
926
|
* #method
|
|
945
927
|
*/
|
|
946
928
|
rowSpecificBpToPx(rowName, position) {
|
|
947
|
-
var _a;
|
|
948
929
|
const { rowNames, rows } = self;
|
|
949
930
|
const index = rowNames.indexOf(rowName);
|
|
950
931
|
const row = rows[index][1];
|
|
951
932
|
const details = self.getRowData(rowName);
|
|
952
|
-
const offset =
|
|
933
|
+
const offset = details.range?.start || 0;
|
|
953
934
|
const current = position - offset;
|
|
954
935
|
const s = new Set(self.blanks);
|
|
955
936
|
if (current < 0) {
|
|
@@ -974,10 +955,9 @@ const model = types
|
|
|
974
955
|
* #method
|
|
975
956
|
*/
|
|
976
957
|
globalBpToPx(position) {
|
|
977
|
-
var _a;
|
|
978
958
|
let count = 0;
|
|
979
959
|
const s = new Set(self.blanks);
|
|
980
|
-
for (let k = 0; k <
|
|
960
|
+
for (let k = 0; k < self.rows[0]?.[1].length; k++) {
|
|
981
961
|
if (s.has(k) && k < position + 1) {
|
|
982
962
|
count++;
|
|
983
963
|
}
|
|
@@ -1109,7 +1089,7 @@ const model = types
|
|
|
1109
1089
|
// autorun synchronizes treeWidth with treeAreaWidth
|
|
1110
1090
|
addDisposer(self, autorun(async () => {
|
|
1111
1091
|
if (self.treeWidthMatchesArea) {
|
|
1112
|
-
self.setTreeWidth(Math.max(50, self.treeAreaWidth - self.labelsWidth -
|
|
1092
|
+
self.setTreeWidth(Math.max(50, self.treeAreaWidth - self.labelsWidth - 10));
|
|
1113
1093
|
}
|
|
1114
1094
|
}));
|
|
1115
1095
|
},
|