@platforma-sdk/ui-vue 1.42.53 → 1.43.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/.turbo/turbo-build.log +213 -207
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/AgGridVue/useAgGridOptions.js +2 -3
- package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
- package/dist/assets/multi-sequence-alignment.worker-Cm0gZp19.js +6 -0
- package/dist/assets/multi-sequence-alignment.worker-Cm0gZp19.js.map +1 -0
- package/dist/assets/phylogenetic-tree.worker-4CrExYEo.js +5 -0
- package/dist/assets/phylogenetic-tree.worker-4CrExYEo.js.map +1 -0
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +2 -3
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +11 -12
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
- package/dist/components/PlAgRowNumHeader.vue.js +8 -9
- package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Consensus.vue.d.ts +1 -0
- package/dist/components/PlMultiSequenceAlignment/Consensus.vue2.js +48 -46
- package/dist/components/PlMultiSequenceAlignment/Consensus.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Consensus.vue3.js +5 -7
- package/dist/components/PlMultiSequenceAlignment/Consensus.vue3.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Legend.vue2.js +14 -13
- package/dist/components/PlMultiSequenceAlignment/Legend.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Legend.vue3.js +9 -8
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue.d.ts +16 -9
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js +117 -85
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js +25 -18
- package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.d.ts +8 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.js +10 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.js.map +1 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue2.js +77 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue2.js.map +1 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue3.js +9 -0
- package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue3.js.map +1 -0
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts +26 -18
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js +119 -120
- package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue.js +7 -124
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue2.js +124 -2
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue3.js +9 -0
- package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue3.js.map +1 -0
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js +90 -90
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/Toolbar.vue3.js +9 -7
- package/dist/components/PlMultiSequenceAlignment/cell-size.d.ts +4 -0
- package/dist/components/PlMultiSequenceAlignment/cell-size.js +8 -0
- package/dist/components/PlMultiSequenceAlignment/cell-size.js.map +1 -0
- package/dist/components/PlMultiSequenceAlignment/data.d.ts +15 -10
- package/dist/components/PlMultiSequenceAlignment/data.js +309 -202
- package/dist/components/PlMultiSequenceAlignment/data.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/markup.js +9 -7
- package/dist/components/PlMultiSequenceAlignment/markup.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/migrations.js +15 -13
- package/dist/components/PlMultiSequenceAlignment/migrations.js.map +1 -1
- package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.worker.d.ts +6 -0
- package/dist/components/PlMultiSequenceAlignment/phylogenetic-tree.worker.d.ts +7 -0
- package/dist/components/PlMultiSequenceAlignment/settings.js +3 -4
- package/dist/components/PlMultiSequenceAlignment/settings.js.map +1 -1
- package/dist/index.js +25 -27
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +1 -2
- package/package.json +6 -6
- package/src/components/PlMultiSequenceAlignment/Consensus.vue +38 -39
- package/src/components/PlMultiSequenceAlignment/Legend.vue +9 -9
- package/src/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue +222 -126
- package/src/components/PlMultiSequenceAlignment/PhylogeneticTree.vue +110 -0
- package/src/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue +28 -22
- package/src/components/PlMultiSequenceAlignment/SeqLogo.vue +77 -69
- package/src/components/PlMultiSequenceAlignment/Toolbar.vue +47 -39
- package/src/components/PlMultiSequenceAlignment/cell-size.ts +4 -0
- package/src/components/PlMultiSequenceAlignment/data.ts +361 -149
- package/src/components/PlMultiSequenceAlignment/markup.ts +10 -8
- package/src/components/PlMultiSequenceAlignment/migrations.ts +6 -1
- package/src/components/PlMultiSequenceAlignment/multi-sequence-alignment.worker.ts +54 -0
- package/src/components/PlMultiSequenceAlignment/phylogenetic-tree.worker.ts +89 -0
- package/src/components/PlMultiSequenceAlignment/settings.ts +1 -2
- package/src/lib.ts +1 -3
- package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.d.ts +0 -7
- package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.js +0 -51
- package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.js.map +0 -1
- package/src/components/PlMultiSequenceAlignment/multi-sequence-alignment.ts +0 -101
|
@@ -1,264 +1,371 @@
|
|
|
1
|
-
import { isJsonEqual as
|
|
1
|
+
import { isJsonEqual as O } from "../../lib/util/helpers/dist/objects.js";
|
|
2
2
|
import "../../lib/util/helpers/dist/test_timeouts.js";
|
|
3
|
-
import { ensureError as
|
|
4
|
-
import { ref as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { getResidueCounts as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
),
|
|
12
|
-
|
|
13
|
-
),
|
|
14
|
-
|
|
15
|
-
),
|
|
16
|
-
|
|
3
|
+
import { ensureError as T, getRawPlatformaInstance as $, readAnnotation as C, Annotation as h, canonicalizeJson as v, getAxisId as S, parseJson as A, isLabelColumn as j, matchAxisId as B, readAnnotationJson as J, isLinkerColumn as N, createRowSelectionColumn as W, pTableValue as R } from "@platforma-sdk/model";
|
|
4
|
+
import { ref as M, watch as F, onWatcherCleanup as H } from "vue";
|
|
5
|
+
import { objectHash as I } from "../../objectHash.js";
|
|
6
|
+
import { highlightByChemicalProperties as V } from "./chemical-properties.js";
|
|
7
|
+
import { parseMarkup as z, highlightByMarkup as Q, markupAlignedSequence as Y } from "./markup.js";
|
|
8
|
+
import { getResidueCounts as Z } from "./residue-counts.js";
|
|
9
|
+
const x = () => $().pFrameDriver, D = 1e3, ge = E(
|
|
10
|
+
_
|
|
11
|
+
), he = E(
|
|
12
|
+
G
|
|
13
|
+
), be = E(
|
|
14
|
+
K
|
|
15
|
+
), ve = E(
|
|
16
|
+
X
|
|
17
17
|
);
|
|
18
|
-
async function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
value: f
|
|
26
|
-
})).toArray(), i = n.map(({ value: a }) => a);
|
|
27
|
-
return { options: n, defaults: i };
|
|
18
|
+
async function _({ pFrame: n, sequenceColumnPredicate: r }) {
|
|
19
|
+
if (!n) return;
|
|
20
|
+
const o = (await x().listColumns(n)).values().filter((i) => r(i)).map(({ spec: i, columnId: c }) => ({
|
|
21
|
+
label: C(i, h.Label) ?? "Unlabeled column",
|
|
22
|
+
value: c
|
|
23
|
+
})).toArray(), t = o.map(({ value: i }) => i);
|
|
24
|
+
return { options: o, defaults: t };
|
|
28
25
|
}
|
|
29
|
-
async function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!s)
|
|
38
|
-
throw new Error(`Couldn't find sequence column (ID: \`${e}\`).`);
|
|
39
|
-
return s.spec.axesSpec.values().map((c) => [v(O(c)), c]);
|
|
26
|
+
async function G({ pFrame: n, sequenceColumnIds: r }) {
|
|
27
|
+
if (!n || !r) return;
|
|
28
|
+
const a = x(), e = await a.listColumns(n), o = new Map(
|
|
29
|
+
r.values().flatMap((s) => {
|
|
30
|
+
const u = e.find(({ columnId: m }) => m === s);
|
|
31
|
+
if (!u)
|
|
32
|
+
throw new Error(`Couldn't find sequence column (ID: \`${s}\`).`);
|
|
33
|
+
return u.spec.axesSpec.values().map((m) => [v(S(m)), m]);
|
|
40
34
|
})
|
|
41
|
-
);
|
|
42
|
-
for (const [
|
|
43
|
-
const
|
|
44
|
-
({ spec:
|
|
35
|
+
), t = /* @__PURE__ */ new Map();
|
|
36
|
+
for (const [s, u] of o.entries()) {
|
|
37
|
+
const m = A(s), d = e.find(
|
|
38
|
+
({ spec: p }) => j(p) && B(m, S(p.axesSpec[0]))
|
|
45
39
|
);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
t.set(
|
|
41
|
+
d ? v({ type: "column", id: d.columnId }) : v({ type: "axis", id: m }),
|
|
42
|
+
C(d == null ? void 0 : d.spec, h.Label) ?? C(u, h.Label) ?? "Unlabeled axis"
|
|
49
43
|
);
|
|
50
44
|
}
|
|
51
|
-
const { hits:
|
|
45
|
+
const { hits: i } = await a.findColumns(n, {
|
|
52
46
|
columnFilter: {},
|
|
53
|
-
compatibleWith:
|
|
47
|
+
compatibleWith: o.keys().map((s) => A(s)).toArray(),
|
|
54
48
|
strictlyCompatible: !1
|
|
55
49
|
});
|
|
56
|
-
for (const { columnId:
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
for (const { columnId: s, spec: u } of i) {
|
|
51
|
+
const m = v({
|
|
52
|
+
type: "column",
|
|
53
|
+
id: s
|
|
54
|
+
});
|
|
55
|
+
t.has(m) || t.set(
|
|
56
|
+
m,
|
|
57
|
+
C(u, h.Label) ?? "Unlabeled column"
|
|
61
58
|
);
|
|
62
59
|
}
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
}).map(({ value:
|
|
68
|
-
return { options:
|
|
60
|
+
const c = t.entries().map(([s, u]) => ({ label: u, value: A(s) })).toArray(), l = c.values().filter(({ value: s }) => {
|
|
61
|
+
if (s.type === "axis") return !0;
|
|
62
|
+
const u = e.find(({ columnId: m }) => m === s.id);
|
|
63
|
+
return u && j(u.spec);
|
|
64
|
+
}).map(({ value: s }) => s).toArray();
|
|
65
|
+
return { options: c, defaults: l };
|
|
69
66
|
}
|
|
70
|
-
async function
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
async function K({ pFrame: n, sequenceColumnIds: r }) {
|
|
68
|
+
if (!n || !r) return;
|
|
69
|
+
const e = await x().listColumns(n), t = r.map((c) => {
|
|
70
|
+
const l = e.find((s) => s.columnId === c);
|
|
71
|
+
if (!l)
|
|
72
|
+
throw new Error(
|
|
73
|
+
`Couldn't find sequence column (ID: \`${r[0]}\`).`
|
|
74
|
+
);
|
|
75
|
+
return l;
|
|
76
|
+
}).flatMap(
|
|
77
|
+
(c) => e.filter(
|
|
78
|
+
(l) => J(l.spec, h.Sequence.IsAnnotation) && O(c.spec.axesSpec, l.spec.axesSpec) && Object.entries(c.spec.domain ?? {}).every(([s, u]) => {
|
|
79
|
+
var m;
|
|
80
|
+
return ((m = l.spec.domain) == null ? void 0 : m[s]) === u;
|
|
81
|
+
})
|
|
82
|
+
).map((l) => ({ markupColumn: l, sequenceColumn: c }))
|
|
77
83
|
);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
return Map.groupBy(
|
|
85
|
+
t,
|
|
86
|
+
({ markupColumn: c, sequenceColumn: l }) => {
|
|
87
|
+
const s = Object.fromEntries(
|
|
88
|
+
Object.entries(c.spec.domain ?? {}).filter(([u]) => {
|
|
89
|
+
var m;
|
|
90
|
+
return ((m = l.spec.domain) == null ? void 0 : m[u]) == null;
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
return v(s);
|
|
94
|
+
}
|
|
95
|
+
).entries().map(([c, l]) => ({
|
|
96
|
+
label: Object.values(A(c)).join(", "),
|
|
97
|
+
value: l.map(({ markupColumn: s }) => s.columnId)
|
|
90
98
|
})).toArray();
|
|
91
99
|
}
|
|
92
|
-
async function
|
|
93
|
-
pFrame:
|
|
100
|
+
async function X({
|
|
101
|
+
pFrame: n,
|
|
94
102
|
sequenceColumnIds: r,
|
|
95
|
-
labelColumnIds:
|
|
96
|
-
selection:
|
|
97
|
-
colorScheme:
|
|
98
|
-
alignmentParams:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
labelColumnIds: a,
|
|
104
|
+
selection: e,
|
|
105
|
+
colorScheme: o,
|
|
106
|
+
alignmentParams: t,
|
|
107
|
+
shouldBuildPhylogeneticTree: i
|
|
108
|
+
}, c) {
|
|
109
|
+
var q;
|
|
110
|
+
if (!n || !(r != null && r.length) || !a) return;
|
|
111
|
+
const l = await ee({
|
|
112
|
+
pFrame: n,
|
|
113
|
+
sequenceColumnIds: r,
|
|
114
|
+
labelColumnIds: a,
|
|
115
|
+
selection: e,
|
|
116
|
+
colorScheme: o
|
|
117
|
+
}), s = ((q = l.at(0)) == null ? void 0 : q.data.data.length) ?? 0;
|
|
118
|
+
if (s < 2) return;
|
|
119
|
+
const u = s > D, m = te(r, l), d = ne(a, l), p = o.type === "markup" ? re(o.columnIds, l) : void 0, b = {}, y = await Promise.all(
|
|
120
|
+
m.map(async ({ name: w, rows: f }) => ({
|
|
121
|
+
name: w,
|
|
122
|
+
rows: await ae(
|
|
123
|
+
f,
|
|
124
|
+
JSON.parse(JSON.stringify(t)),
|
|
125
|
+
c
|
|
126
|
+
)
|
|
127
|
+
}))
|
|
128
|
+
);
|
|
129
|
+
let L;
|
|
130
|
+
if (i) {
|
|
131
|
+
L = await ie(
|
|
132
|
+
y,
|
|
133
|
+
c
|
|
134
|
+
);
|
|
135
|
+
const w = L.values().filter(({ id: f }) => f >= 0).map(({ id: f }) => f).toArray();
|
|
136
|
+
for (const f of y)
|
|
137
|
+
f.rows = w.map((g) => f.rows[g]);
|
|
138
|
+
for (const f of d)
|
|
139
|
+
f.rows = w.map((g) => f.rows[g]);
|
|
140
|
+
for (const f of p ?? [])
|
|
141
|
+
f.rows = w.map((g) => f.rows[g]);
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
sequences: await Promise.all(
|
|
145
|
+
y.map(async ({ name: w, rows: f }, g) => {
|
|
146
|
+
const U = Z(f), k = oe({
|
|
147
|
+
colorScheme: o,
|
|
148
|
+
sequences: f,
|
|
149
|
+
residueCounts: U,
|
|
150
|
+
markup: p == null ? void 0 : p.at(g)
|
|
151
|
+
});
|
|
152
|
+
return k && Object.assign(b, k.legend), {
|
|
153
|
+
name: w,
|
|
154
|
+
rows: f,
|
|
155
|
+
residueCounts: U,
|
|
156
|
+
...k && {
|
|
157
|
+
highlightImageUrl: await se(k.blob)
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
})
|
|
161
|
+
),
|
|
162
|
+
labels: d,
|
|
163
|
+
...Object.keys(b).length && {
|
|
164
|
+
highlightLegend: b
|
|
165
|
+
},
|
|
166
|
+
...L && {
|
|
167
|
+
phylogeneticTree: L
|
|
168
|
+
},
|
|
169
|
+
exceedsLimit: u
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
async function ee({ pFrame: n, sequenceColumnIds: r, labelColumnIds: a, selection: e, colorScheme: o }) {
|
|
173
|
+
const t = x(), i = await t.listColumns(n), c = i.filter((p) => N(p.spec)), l = W({ selection: e });
|
|
103
174
|
let s = {
|
|
104
175
|
type: "inner",
|
|
105
|
-
entries: r.map((
|
|
176
|
+
entries: r.map((p) => ({
|
|
106
177
|
type: "column",
|
|
107
|
-
column:
|
|
178
|
+
column: p
|
|
108
179
|
}))
|
|
109
180
|
};
|
|
110
|
-
|
|
181
|
+
c.length > 0 && (s = {
|
|
111
182
|
type: "outer",
|
|
112
183
|
primary: s,
|
|
113
|
-
secondary:
|
|
184
|
+
secondary: c.map(({ columnId: p }) => ({
|
|
114
185
|
type: "column",
|
|
115
|
-
column:
|
|
186
|
+
column: p
|
|
116
187
|
}))
|
|
117
|
-
}),
|
|
188
|
+
}), l && (s = {
|
|
118
189
|
type: "inner",
|
|
119
190
|
entries: [
|
|
120
191
|
s,
|
|
121
192
|
{
|
|
122
193
|
type: "inlineColumn",
|
|
123
|
-
column:
|
|
194
|
+
column: l
|
|
124
195
|
}
|
|
125
196
|
]
|
|
126
197
|
});
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
|
|
198
|
+
const u = a.flatMap((p) => p.type !== "column" ? [] : { type: "column", column: p.id });
|
|
199
|
+
if (o.type === "markup")
|
|
200
|
+
for (const p of o.columnIds)
|
|
201
|
+
u.push({ type: "column", column: p });
|
|
202
|
+
const m = Array.from(
|
|
130
203
|
new Set(
|
|
131
|
-
r.values().flatMap((
|
|
132
|
-
const
|
|
133
|
-
if (!
|
|
134
|
-
throw new Error(`Couldn't find sequence column (ID: ${
|
|
135
|
-
return
|
|
204
|
+
r.values().flatMap((p) => {
|
|
205
|
+
const b = i.find(({ columnId: y }) => y === p);
|
|
206
|
+
if (!b)
|
|
207
|
+
throw new Error(`Couldn't find sequence column (ID: ${p})`);
|
|
208
|
+
return b.spec.axesSpec.map((y) => v(S(y)));
|
|
136
209
|
})
|
|
137
210
|
)
|
|
138
|
-
).sort().map((
|
|
139
|
-
column: { type: "axis", id:
|
|
211
|
+
).sort().map((p) => ({
|
|
212
|
+
column: { type: "axis", id: A(p) },
|
|
140
213
|
ascending: !0,
|
|
141
214
|
naAndAbsentAreLeastValues: !0
|
|
142
|
-
})),
|
|
215
|
+
})), d = {
|
|
143
216
|
src: {
|
|
144
217
|
type: "outer",
|
|
145
218
|
primary: s,
|
|
146
|
-
secondary:
|
|
219
|
+
secondary: u
|
|
147
220
|
},
|
|
148
221
|
filters: [],
|
|
149
|
-
sorting:
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
222
|
+
sorting: m
|
|
223
|
+
};
|
|
224
|
+
return t.calculateTableData(
|
|
225
|
+
n,
|
|
226
|
+
JSON.parse(JSON.stringify(d)),
|
|
153
227
|
{
|
|
154
228
|
offset: 0,
|
|
155
229
|
// +1 is a hack to check whether the selection is over the limit
|
|
156
|
-
length:
|
|
230
|
+
length: D + 1
|
|
157
231
|
}
|
|
158
232
|
);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
233
|
+
}
|
|
234
|
+
const te = (n, r) => n.map((a) => {
|
|
235
|
+
const e = r.find(({ spec: i }) => i.id === a);
|
|
236
|
+
if (!e)
|
|
237
|
+
throw new Error(`Couldn't find sequence column (ID: \`${a}\`).`);
|
|
238
|
+
const o = C(e.spec.spec, h.Label) ?? "Unlabeled column", t = e.data.data.keys().take(D).map(
|
|
239
|
+
(i) => {
|
|
240
|
+
var c;
|
|
241
|
+
return ((c = R(e.data, i, { absent: "", na: "" })) == null ? void 0 : c.toString()) ?? "";
|
|
242
|
+
}
|
|
243
|
+
).toArray();
|
|
244
|
+
return { name: o, rows: t };
|
|
245
|
+
}), ne = (n, r) => n.map((a) => {
|
|
246
|
+
const e = r.find(({ spec: t }) => {
|
|
247
|
+
if (a.type === "axis" && t.type === "axis")
|
|
248
|
+
return O(a.id, t.id);
|
|
249
|
+
if (a.type === "column" && t.type === "column")
|
|
250
|
+
return a.id === t.id;
|
|
251
|
+
});
|
|
252
|
+
if (!e)
|
|
253
|
+
throw new Error(`Couldn't find label column (ID: \`${a}\`).`);
|
|
254
|
+
return { rows: e.data.data.keys().take(D).map(
|
|
255
|
+
(t) => {
|
|
256
|
+
var i;
|
|
257
|
+
return ((i = R(e.data, t, { absent: "", na: "" })) == null ? void 0 : i.toString()) ?? "";
|
|
258
|
+
}
|
|
259
|
+
).toArray() };
|
|
260
|
+
}), re = (n, r) => n.map((a) => {
|
|
261
|
+
const e = r.find(({ spec: i }) => i.id === a);
|
|
262
|
+
if (!e)
|
|
263
|
+
throw new Error(`Couldn't find markup column (ID: \`${a}\`).`);
|
|
264
|
+
const o = J(
|
|
265
|
+
e.spec.spec,
|
|
266
|
+
h.Sequence.Annotation.Mapping
|
|
267
|
+
) ?? {}, t = e.data.data.keys().take(D).map(
|
|
268
|
+
(i) => {
|
|
269
|
+
var c;
|
|
270
|
+
return z(
|
|
271
|
+
((c = R(e.data, i, { absent: "", na: "" })) == null ? void 0 : c.toString()) ?? ""
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
).toArray();
|
|
275
|
+
return { labels: o, rows: t };
|
|
276
|
+
}), ae = /* @__PURE__ */ (() => {
|
|
277
|
+
const n = /* @__PURE__ */ new Map();
|
|
278
|
+
return async (r, a, e) => {
|
|
279
|
+
const o = await I([r, a]);
|
|
280
|
+
let t = n.get(o);
|
|
281
|
+
return t || (t = await P(
|
|
282
|
+
new Worker(
|
|
283
|
+
new URL(
|
|
284
|
+
/* @vite-ignore */
|
|
285
|
+
"" + new URL("../../assets/multi-sequence-alignment.worker-Cm0gZp19.js", import.meta.url).href,
|
|
286
|
+
import.meta.url
|
|
185
287
|
),
|
|
186
|
-
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
(t, u) => T.map((o) => o[u])
|
|
192
|
-
), V = R.map(
|
|
193
|
-
(t) => A(t.spec.spec, g.Label) ?? "Unlabeled column"
|
|
194
|
-
), z = Array.from(
|
|
195
|
-
{ length: b },
|
|
196
|
-
(t, u) => B.map(
|
|
197
|
-
(o) => {
|
|
198
|
-
var y;
|
|
199
|
-
return ((y = M(o.data, u, { na: "", absent: "" })) == null ? void 0 : y.toString()) ?? "";
|
|
200
|
-
}
|
|
201
|
-
)
|
|
202
|
-
), D = $.map((t) => t.join(" ")), U = ot(D), L = {
|
|
203
|
-
sequences: D,
|
|
204
|
-
sequenceNames: V,
|
|
205
|
-
labelRows: z,
|
|
206
|
-
exceedsLimit: I,
|
|
207
|
-
residueCounts: U
|
|
288
|
+
{ type: "module" }
|
|
289
|
+
),
|
|
290
|
+
{ sequences: r, params: a },
|
|
291
|
+
e
|
|
292
|
+
), n.set(o, t), t);
|
|
208
293
|
};
|
|
294
|
+
})();
|
|
295
|
+
function oe({ colorScheme: n, sequences: r, residueCounts: a, markup: e }) {
|
|
296
|
+
var o;
|
|
209
297
|
if (n.type === "chemical-properties")
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const u = Array.from(
|
|
223
|
-
{ length: b },
|
|
224
|
-
(y, _) => {
|
|
225
|
-
var F;
|
|
226
|
-
const W = tt(
|
|
227
|
-
((F = M(t.data, _, { na: "", absent: "" })) == null ? void 0 : F.toString()) ?? ""
|
|
228
|
-
);
|
|
229
|
-
return nt($[_][0], W);
|
|
230
|
-
}
|
|
231
|
-
), o = j(t.spec.spec, g.Sequence.Annotation.Mapping) ?? {};
|
|
232
|
-
L.highlightImage = et({
|
|
233
|
-
markupRows: u,
|
|
234
|
-
columnCount: ((P = D.at(0)) == null ? void 0 : P.length) ?? 0,
|
|
235
|
-
labels: o
|
|
298
|
+
return V({ sequences: r, residueCounts: a });
|
|
299
|
+
if (n.type === "markup") {
|
|
300
|
+
if (!e)
|
|
301
|
+
throw new Error("Missing markup data.");
|
|
302
|
+
return Q({
|
|
303
|
+
markupRows: r.map((t, i) => {
|
|
304
|
+
const c = e.rows.at(i);
|
|
305
|
+
if (!c) throw new Error(`Missing markup for row ${i}.`);
|
|
306
|
+
return Y(t, c);
|
|
307
|
+
}),
|
|
308
|
+
columnCount: ((o = r.at(0)) == null ? void 0 : o.length) ?? 0,
|
|
309
|
+
labels: e.labels
|
|
236
310
|
});
|
|
237
311
|
}
|
|
238
|
-
return L;
|
|
239
312
|
}
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
313
|
+
const se = (n) => new Promise((r, a) => {
|
|
314
|
+
const e = new FileReader();
|
|
315
|
+
e.addEventListener("load", () => r(e.result)), e.addEventListener("error", () => a(e.error)), e.readAsDataURL(n);
|
|
316
|
+
}), ie = /* @__PURE__ */ (() => {
|
|
317
|
+
const n = /* @__PURE__ */ new Map();
|
|
318
|
+
return async (r, a) => {
|
|
319
|
+
var i;
|
|
320
|
+
const e = ((i = r.at(0)) == null ? void 0 : i.rows.keys().map((c) => r.map((l) => l.rows.at(c) ?? "").join("")).toArray()) ?? [], o = await I(e);
|
|
321
|
+
let t = n.get(o);
|
|
322
|
+
return t || (t = await P(
|
|
323
|
+
new Worker(
|
|
324
|
+
new URL(
|
|
325
|
+
/* @vite-ignore */
|
|
326
|
+
"" + new URL("../../assets/phylogenetic-tree.worker-4CrExYEo.js", import.meta.url).href,
|
|
327
|
+
import.meta.url
|
|
328
|
+
),
|
|
329
|
+
{ type: "module" }
|
|
330
|
+
),
|
|
331
|
+
e,
|
|
332
|
+
a
|
|
333
|
+
), n.set(o, t), t);
|
|
334
|
+
};
|
|
335
|
+
})(), P = (n, r, a) => new Promise((e, o) => {
|
|
336
|
+
n.addEventListener("message", ({ data: t }) => {
|
|
337
|
+
e(t), n.terminate();
|
|
338
|
+
}), n.addEventListener("error", ({ error: t, message: i }) => {
|
|
339
|
+
o(t ?? i), n.terminate();
|
|
340
|
+
}), a.addEventListener("abort", () => {
|
|
341
|
+
o(a.reason), n.terminate();
|
|
342
|
+
}), n.postMessage(r);
|
|
343
|
+
});
|
|
344
|
+
function E(n) {
|
|
345
|
+
const r = M(), a = M(!0), e = M();
|
|
346
|
+
let o;
|
|
347
|
+
return (t) => (F(t, async (i, c) => {
|
|
348
|
+
if (O(i, c)) return;
|
|
349
|
+
const l = new AbortController(), s = o = Symbol();
|
|
350
|
+
H(() => {
|
|
351
|
+
l.abort();
|
|
352
|
+
});
|
|
246
353
|
try {
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
} catch (
|
|
251
|
-
console.error(
|
|
354
|
+
e.value = void 0, a.value = !0;
|
|
355
|
+
const u = await n(i, l.signal);
|
|
356
|
+
s === o && (r.value = u);
|
|
357
|
+
} catch (u) {
|
|
358
|
+
console.error(u), s === o && (e.value = T(u));
|
|
252
359
|
} finally {
|
|
253
|
-
|
|
360
|
+
s === o && (a.value = !1);
|
|
254
361
|
}
|
|
255
|
-
}, { immediate: !0 }), { data: r, isLoading:
|
|
362
|
+
}, { immediate: !0 }), { data: r, isLoading: a, error: e });
|
|
256
363
|
}
|
|
257
364
|
export {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
365
|
+
D as SEQUENCE_LIMIT,
|
|
366
|
+
he as useLabelColumnsOptions,
|
|
367
|
+
be as useMarkupColumnsOptions,
|
|
368
|
+
ve as useMultipleAlignmentData,
|
|
369
|
+
ge as useSequenceColumnsOptions
|
|
263
370
|
};
|
|
264
371
|
//# sourceMappingURL=data.js.map
|