@lipme/vue-blast-viewer 1.0.2 → 1.0.3

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.
Files changed (39) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/index.html +13 -0
  3. package/lipme-vue-blast-viewer-1.0.0.tgz +0 -0
  4. package/lipme-vue-blast-viewer-1.0.1.tgz +0 -0
  5. package/lipme-vue-blast-viewer-1.0.2.tgz +0 -0
  6. package/lipme-vue-blast-viewer-1.0.3.tgz +0 -0
  7. package/package.json +5 -5
  8. package/src/App.vue +548 -0
  9. package/src/assets/hero.png +0 -0
  10. package/src/assets/vite.svg +1 -0
  11. package/src/assets/vue.svg +1 -0
  12. package/src/components/BlastAlignmentDetails.vue +581 -0
  13. package/src/components/BlastGraphicViewer.vue +477 -0
  14. package/src/components/BlastHeader.vue +259 -0
  15. package/src/components/BlastHitTable.vue +669 -0
  16. package/src/components/BlastViewer.vue +232 -0
  17. package/src/main.ts +5 -0
  18. package/src/mockData.ts +457 -0
  19. package/src/style.css +258 -0
  20. package/src/types.ts +59 -0
  21. package/tsconfig.app.json +14 -0
  22. package/tsconfig.json +28 -0
  23. package/vite.config.ts +24 -0
  24. package/vue-blast-viewer-1.0.0.tgz +0 -0
  25. package/dist/src/App.vue.d.ts +0 -3
  26. package/dist/src/components/BlastAlignmentDetails.vue.d.ts +0 -10
  27. package/dist/src/components/BlastGraphicViewer.vue.d.ts +0 -12
  28. package/dist/src/components/BlastHeader.vue.d.ts +0 -11
  29. package/dist/src/components/BlastHitTable.vue.d.ts +0 -13
  30. package/dist/src/components/BlastViewer.vue.d.ts +0 -10
  31. package/dist/src/main.d.ts +0 -0
  32. package/dist/src/mockData.d.ts +0 -3
  33. package/dist/src/types.d.ts +0 -53
  34. package/dist/vue-blast-viewer.css +0 -2
  35. package/dist/vue-blast-viewer.js +0 -670
  36. package/dist/vue-blast-viewer.umd.cjs +0 -2
  37. /package/{dist → public}/favicon.svg +0 -0
  38. /package/{dist → public}/icons.svg +0 -0
  39. /package/{dist/src/index.d.ts → src/index.ts} +0 -0
@@ -1,670 +0,0 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, nextTick as l, normalizeClass as u, normalizeStyle as d, onMounted as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, vModelText as _, vShow as v, watch as y, withDirectives as b, withModifiers as x } from "vue";
2
- //#region src/components/BlastHeader.vue?vue&type=script&setup=true&lang.ts
3
- var S = { class: "blast-header fade-in" }, C = { class: "header-main glass-panel" }, w = { class: "title-section" }, T = { class: "query-meta" }, E = ["href"], D = { class: "version-section" }, O = { class: "version-text" }, k = { class: "stats-grid" }, A = { class: "stat-card glass-panel" }, j = { class: "stat-info" }, M = { class: "stat-value" }, N = { class: "stat-unit" }, P = { class: "stat-card glass-panel" }, F = { class: "stat-info" }, I = { class: "stat-value" }, ee = { class: "stat-card glass-panel" }, te = { class: "stat-info" }, ne = { class: "stat-value" }, re = { class: "stat-card glass-panel" }, L = { class: "stat-info" }, R = { class: "stat-value" }, z = /*@__PURE__*/ c({
4
- __name: "BlastHeader",
5
- props: {
6
- searchData: {},
7
- program: {},
8
- version: {},
9
- db: {},
10
- queryLink: {}
11
- },
12
- setup(e) {
13
- let n = e, a = t(() => {
14
- let e = n.program.toLowerCase();
15
- return e.includes("p") || e.includes("x") || e.includes("tblast");
16
- }), s = t(() => a.value ? "aa" : "bp"), c = t(() => {
17
- let e = 0;
18
- return n.searchData.hits.forEach((t) => {
19
- t.hsps.forEach((t) => {
20
- t.bit_score > e && (e = t.bit_score);
21
- });
22
- }), e.toFixed(1);
23
- }), l = t(() => {
24
- let e = Infinity;
25
- return n.searchData.hits.forEach((t) => {
26
- t.hsps.forEach((t) => {
27
- t.evalue < e && (e = t.evalue);
28
- });
29
- }), e === Infinity ? "N/A" : e === 0 ? "0.0" : e.toExponential(2);
30
- }), d = (e) => n.queryLink ? n.queryLink.replace("{accession}", e) : `https://www.ncbi.nlm.nih.gov/${a.value ? "protein" : "nucleotide"}/${e}`;
31
- return (t, n) => (p(), r("div", S, [i("div", C, [i("div", w, [
32
- i("span", { class: u(["program-badge", e.program.toLowerCase()]) }, g(e.program), 3),
33
- i("h1", null, g(e.searchData.query_title), 1),
34
- i("p", T, [
35
- n[0] ||= i("strong", null, "Query ID:", -1),
36
- i("a", {
37
- href: d(e.searchData.query_id),
38
- target: "_blank",
39
- class: "query-link sequence-font"
40
- }, g(e.searchData.query_id), 9, E),
41
- n[1] ||= o(" | ", -1),
42
- n[2] ||= i("strong", null, "Database:", -1),
43
- o(" " + g(e.db), 1)
44
- ])
45
- ]), i("div", D, [i("span", O, g(e.version), 1)])]), i("div", k, [
46
- i("div", A, [n[4] ||= i("div", { class: "stat-icon" }, "🧬", -1), i("div", j, [n[3] ||= i("span", { class: "stat-label" }, "Query Length", -1), i("span", M, [o(g(e.searchData.query_len) + " ", 1), i("span", N, g(s.value), 1)])])]),
47
- i("div", P, [n[6] ||= i("div", { class: "stat-icon" }, "🎯", -1), i("div", F, [n[5] ||= i("span", { class: "stat-label" }, "Number of Hits", -1), i("span", I, g(e.searchData.hits.length), 1)])]),
48
- i("div", ee, [n[8] ||= i("div", { class: "stat-icon" }, "⚡", -1), i("div", te, [n[7] ||= i("span", { class: "stat-label" }, "Max Bit Score", -1), i("span", ne, g(c.value), 1)])]),
49
- i("div", re, [n[10] ||= i("div", { class: "stat-icon" }, "📉", -1), i("div", L, [n[9] ||= i("span", { class: "stat-label" }, "Lowest E-Value", -1), i("span", R, g(l.value), 1)])])
50
- ])]));
51
- }
52
- }), B = (e, t) => {
53
- let n = e.__vccOpts || e;
54
- for (let [e, r] of t) n[e] = r;
55
- return n;
56
- }, V = /*#__PURE__*/ B(z, [["__scopeId", "data-v-71c69c51"]]), H = { class: "blast-graphics glass-panel fade-in" }, U = { class: "svg-container" }, W = ["viewBox"], G = { class: "grid-lines" }, K = [
57
- "x1",
58
- "y1",
59
- "x2",
60
- "y2"
61
- ], q = { class: "query-ruler" }, J = ["x", "y"], Y = ["x", "y"], X = [
62
- "x1",
63
- "y1",
64
- "x2",
65
- "y2"
66
- ], ie = ["x", "y"], ae = {
67
- class: "hits-group",
68
- transform: "translate(0, 30)"
69
- }, oe = ["onClick"], se = [
70
- "x",
71
- "y",
72
- "width",
73
- "height"
74
- ], ce = [
75
- "x1",
76
- "y1",
77
- "x2",
78
- "y2"
79
- ], le = [
80
- "x",
81
- "y",
82
- "width",
83
- "fill",
84
- "onMouseenter"
85
- ], ue = ["x", "y"], de = { class: "tooltip-title" }, fe = { class: "tooltip-acc" }, pe = { class: "val" }, me = { class: "val" }, he = { class: "val" }, ge = { class: "val" }, _e = { class: "val" }, ve = { class: "val" }, Z = 1e3, Q = 10, ye = /*#__PURE__*/ B(/* @__PURE__ */ c({
86
- __name: "BlastGraphicViewer",
87
- props: {
88
- searchData: {},
89
- isProtein: { type: Boolean }
90
- },
91
- emits: ["select-hit"],
92
- setup(o, { emit: s }) {
93
- let c = o, l = s, f = {
94
- top: 50,
95
- right: 40,
96
- bottom: 25,
97
- left: 40
98
- }, _ = Z - f.left - f.right, v = m(!1), y = m(0), b = m(0), x = m(null), S = m(null), C = t(() => {
99
- let e = c.searchData.hits.length;
100
- return e === 0 ? f.top + f.bottom + 40 : f.top + 30 + e * 22 + f.bottom;
101
- }), w = (e) => e < 40 ? "var(--blast-score-low)" : e >= 40 && e < 50 ? "var(--blast-score-mid-low)" : e >= 50 && e < 80 ? "var(--blast-score-mid)" : e >= 80 && e < 200 ? "var(--blast-score-mid-high)" : "var(--blast-score-high)", T = t(() => {
102
- let e = c.searchData.query_len, t = 50;
103
- e > 100 && e <= 500 ? t = 100 : e > 500 && e <= 2e3 ? t = 200 : e > 2e3 && e <= 1e4 ? t = 1e3 : e > 1e4 && (t = 5e3);
104
- let n = [];
105
- for (let r = 0; r <= e; r += t) n.push(r);
106
- return n[n.length - 1] !== e && (e - n[n.length - 1] < t / 3 ? n[n.length - 1] = e : n.push(e)), n.map((t) => ({
107
- value: t,
108
- x: f.left + t / e * _
109
- }));
110
- }), E = (e) => f.left + (e - 1) / c.searchData.query_len * _, D = (e, t, n) => {
111
- v.value = !0, O(e);
112
- let r = t.description[0], i = c.searchData.query_len, a = Math.round(n.align_len / i * 100), o = Math.round(n.identity / n.align_len * 100);
113
- x.value = {
114
- title: r.title,
115
- accession: r.accession,
116
- bitScore: n.bit_score,
117
- evalue: n.evalue,
118
- identity: o,
119
- coverage: a,
120
- qFrom: n.query_from,
121
- qTo: n.query_to,
122
- hFrom: n.hit_from,
123
- hTo: n.hit_to
124
- };
125
- }, O = (e) => {
126
- let t = e.currentTarget.ownerSVGElement;
127
- if (!t) return;
128
- let n = t.getBoundingClientRect();
129
- y.value = e.clientX - n.left + 15, b.value = e.clientY - n.top + 15;
130
- }, k = () => {
131
- v.value = !1, x.value = null, S.value = null;
132
- }, A = (e) => {
133
- l("select-hit", e);
134
- };
135
- return (t, s) => (p(), r("div", H, [s[7] ||= a("<div class=\"graphics-header\" data-v-95ffff3a><h2 data-v-95ffff3a>Graphical Alignment Overview</h2><p data-v-95ffff3a>Hover over alignment bars for details. Click to view full text alignments.</p></div><div class=\"color-legend\" data-v-95ffff3a><div class=\"legend-title\" data-v-95ffff3a>Color Key for Alignment Scores:</div><div class=\"legend-items\" data-v-95ffff3a><div class=\"legend-item\" data-v-95ffff3a><span class=\"legend-color\" style=\"background-color:var(--blast-score-low);\" data-v-95ffff3a></span><span class=\"legend-label\" data-v-95ffff3a>&lt; 40</span></div><div class=\"legend-item\" data-v-95ffff3a><span class=\"legend-color\" style=\"background-color:var(--blast-score-mid-low);\" data-v-95ffff3a></span><span class=\"legend-label\" data-v-95ffff3a>40-50</span></div><div class=\"legend-item\" data-v-95ffff3a><span class=\"legend-color\" style=\"background-color:var(--blast-score-mid);\" data-v-95ffff3a></span><span class=\"legend-label\" data-v-95ffff3a>50-80</span></div><div class=\"legend-item\" data-v-95ffff3a><span class=\"legend-color\" style=\"background-color:var(--blast-score-mid-high);\" data-v-95ffff3a></span><span class=\"legend-label\" data-v-95ffff3a>80-200</span></div><div class=\"legend-item\" data-v-95ffff3a><span class=\"legend-color\" style=\"background-color:var(--blast-score-high);\" data-v-95ffff3a></span><span class=\"legend-label\" data-v-95ffff3a>≥ 200</span></div></div></div>", 2), i("div", U, [(p(), r("svg", {
136
- viewBox: `0 0 ${Z} ${C.value}`,
137
- width: "100%",
138
- class: "alignment-svg"
139
- }, [
140
- i("g", G, [(p(!0), r(e, null, h(T.value, (e) => (p(), r("line", {
141
- key: "grid-" + e.value,
142
- x1: e.x,
143
- y1: f.top - 10,
144
- x2: e.x,
145
- y2: C.value - f.bottom,
146
- stroke: "var(--bg-overlay-hover)",
147
- "stroke-dasharray": "4,4"
148
- }, null, 8, K))), 128))]),
149
- i("g", q, [
150
- i("rect", {
151
- x: f.left,
152
- y: f.top - 20,
153
- width: _,
154
- height: "10",
155
- rx: "5",
156
- fill: "var(--color-primary-glow)",
157
- stroke: "var(--color-primary)",
158
- "stroke-width": "1.5"
159
- }, null, 8, J),
160
- i("text", {
161
- x: f.left,
162
- y: f.top - 28,
163
- fill: "var(--color-primary)",
164
- "font-size": "11",
165
- "font-weight": "600"
166
- }, " QUERY (" + g(o.searchData.query_len) + " " + g(o.isProtein ? "aa" : "bp") + ") ", 9, Y),
167
- (p(!0), r(e, null, h(T.value, (e) => (p(), r("g", { key: "tick-" + e.value }, [i("line", {
168
- x1: e.x,
169
- y1: f.top - 10,
170
- x2: e.x,
171
- y2: f.top - 4,
172
- stroke: "var(--text-secondary)",
173
- "stroke-width": "1.5"
174
- }, null, 8, X), i("text", {
175
- x: e.x,
176
- y: f.top + 8,
177
- "text-anchor": "middle",
178
- fill: "var(--text-secondary)",
179
- "font-family": "var(--font-mono)",
180
- "font-size": "10"
181
- }, g(e.value), 9, ie)]))), 128))
182
- ]),
183
- i("g", ae, [(p(!0), r(e, null, h(o.searchData.hits, (t, a) => (p(), r("g", {
184
- key: t.num,
185
- class: u(["hit-row", { "is-hovered": S.value === a }]),
186
- onClick: (e) => A(t.num)
187
- }, [
188
- i("rect", {
189
- x: f.left - 5,
190
- y: f.top + a * 22 - 4,
191
- width: _ + 10,
192
- height: 18,
193
- fill: "var(--bg-overlay-hover)",
194
- class: "row-hover-bg",
195
- rx: "4"
196
- }, null, 8, se),
197
- t.hsps.length > 1 ? (p(), r("line", {
198
- key: 0,
199
- x1: E(Math.min(...t.hsps.map((e) => e.query_from))),
200
- y1: f.top + a * 22 + Q / 2,
201
- x2: E(Math.max(...t.hsps.map((e) => e.query_to))),
202
- y2: f.top + a * 22 + Q / 2,
203
- stroke: "var(--text-muted)",
204
- "stroke-width": "1",
205
- "stroke-dasharray": "3,3"
206
- }, null, 8, ce)) : n("", !0),
207
- (p(!0), r(e, null, h(t.hsps, (e) => (p(), r("rect", {
208
- key: e.num,
209
- x: E(e.query_from),
210
- y: f.top + a * 22,
211
- width: Math.max(2, E(e.query_to) - E(e.query_from)),
212
- height: Q,
213
- fill: w(e.bit_score),
214
- class: "hsp-bar",
215
- rx: "2",
216
- onMouseenter: (n) => {
217
- S.value = a, D(n, t, e);
218
- },
219
- onMousemove: O,
220
- onMouseleave: k
221
- }, null, 40, le))), 128)),
222
- i("text", {
223
- x: f.left - 8,
224
- y: f.top + a * 22 + 8,
225
- "text-anchor": "end",
226
- fill: "var(--text-muted)",
227
- "font-family": "var(--font-mono)",
228
- "font-size": "9",
229
- class: "hit-index-label"
230
- }, g(a + 1), 9, ue)
231
- ], 10, oe))), 128))])
232
- ], 8, W)), v.value && x.value ? (p(), r("div", {
233
- key: 0,
234
- class: "blast-tooltip",
235
- style: d({
236
- left: y.value + "px",
237
- top: b.value + "px"
238
- })
239
- }, [
240
- i("div", de, g(x.value.title), 1),
241
- i("div", fe, "Accession: " + g(x.value.accession), 1),
242
- s[6] ||= i("hr", { class: "tooltip-divider" }, null, -1),
243
- i("table", null, [
244
- i("tr", null, [s[0] ||= i("td", { class: "label" }, "Bit Score:", -1), i("td", pe, g(x.value.bitScore.toFixed(1)), 1)]),
245
- i("tr", null, [s[1] ||= i("td", { class: "label" }, "E-value:", -1), i("td", me, g(x.value.evalue === 0 ? "0.0" : x.value.evalue), 1)]),
246
- i("tr", null, [s[2] ||= i("td", { class: "label" }, "Identities:", -1), i("td", he, g(x.value.identity) + "%", 1)]),
247
- i("tr", null, [s[3] ||= i("td", { class: "label" }, "Query Cover:", -1), i("td", ge, g(x.value.coverage) + "%", 1)]),
248
- i("tr", null, [s[4] ||= i("td", { class: "label" }, "Query:", -1), i("td", _e, g(x.value.qFrom) + " .. " + g(x.value.qTo), 1)]),
249
- i("tr", null, [s[5] ||= i("td", { class: "label" }, "Subject:", -1), i("td", ve, g(x.value.hFrom) + " .. " + g(x.value.hTo), 1)])
250
- ])
251
- ], 4)) : n("", !0)])]));
252
- }
253
- }), [["__scopeId", "data-v-95ffff3a"]]), be = { class: "blast-hit-table glass-panel fade-in" }, xe = { class: "table-controls" }, Se = { class: "title-group" }, Ce = { class: "results-count" }, we = { class: "controls-right" }, Te = { class: "search-box" }, Ee = { class: "table-container" }, De = ["onClick"], Oe = ["onClick"], ke = ["title"], Ae = {
254
- key: 0,
255
- class: "desc-meta"
256
- }, je = { class: "acc-cell sequence-font" }, Me = ["href"], Ne = { class: "numeric-cell sequence-font" }, Pe = { class: "numeric-cell sequence-font" }, Fe = { class: "numeric-cell sequence-font" }, Ie = { class: "numeric-cell sequence-font" }, Le = { class: "numeric-cell sequence-font" }, Re = { class: "action-cell" }, ze = ["onClick"], Be = {
257
- key: 0,
258
- class: "expand-row"
259
- }, Ve = {
260
- colspan: "9",
261
- class: "expanded-container"
262
- }, He = { class: "hsp-summary-box" }, Ue = { class: "hsp-grid" }, We = { class: "hsp-card-header" }, Ge = { class: "hsp-badge" }, Ke = ["onClick"], qe = { class: "hsp-card-body" }, Je = { class: "hsp-detail-row" }, Ye = { class: "hsp-det-val sequence-font" }, Xe = { class: "hsp-detail-row" }, Ze = { class: "hsp-det-val sequence-font" }, Qe = { class: "hsp-detail-row" }, $e = { class: "hsp-det-val sequence-font" }, et = {
263
- key: 0,
264
- class: "hsp-detail-row"
265
- }, tt = { class: "hsp-det-val sequence-font" }, nt = { class: "hsp-detail-row" }, rt = { class: "hsp-det-val sequence-font" }, it = { class: "hsp-detail-row" }, at = { class: "hsp-det-val sequence-font" }, ot = { key: 0 }, st = {
266
- colspan: "9",
267
- class: "empty-cell"
268
- }, ct = {
269
- key: 0,
270
- class: "pagination"
271
- }, lt = ["disabled"], ut = { class: "page-indicator" }, dt = ["disabled"], ft = /*#__PURE__*/ B(/* @__PURE__ */ c({
272
- __name: "BlastHitTable",
273
- props: {
274
- searchData: {},
275
- isProtein: { type: Boolean },
276
- subjectLink: {}
277
- },
278
- emits: ["select-hit"],
279
- setup(a, { emit: s }) {
280
- let c = a, l = s, d = m(""), f = m("totalScore"), v = m("desc"), y = m(1), x = m(10), S = m({}), C = (e, t) => {
281
- let n = e.hsps.map((e) => [Math.min(e.query_from, e.query_to), Math.max(e.query_from, e.query_to)]).sort((e, t) => e[0] - t[0]);
282
- if (n.length === 0) return 0;
283
- let r = [n[0]];
284
- for (let e = 1; e < n.length; e++) {
285
- let t = r[r.length - 1], i = n[e];
286
- i[0] <= t[1] ? t[1] = Math.max(t[1], i[1]) : r.push(i);
287
- }
288
- let i = r.reduce((e, t) => e + (t[1] - t[0] + 1), 0);
289
- return Math.round(i / t * 100);
290
- }, w = (e) => {
291
- let t = 0, n = 0, r = Infinity, i = 0;
292
- return e.hsps.forEach((e) => {
293
- t += e.bit_score, e.bit_score > n && (n = e.bit_score), e.evalue < r && (r = e.evalue);
294
- let a = e.identity / e.align_len * 100;
295
- a > i && (i = a);
296
- }), {
297
- totalScore: t,
298
- maxScore: n,
299
- evalue: r,
300
- identity: Math.round(i * 10) / 10,
301
- coverage: C(e, c.searchData.query_len)
302
- };
303
- }, T = t(() => c.searchData.hits.map((e) => {
304
- let t = w(e), n = e.description[0];
305
- return {
306
- raw: e,
307
- num: e.num,
308
- title: n.title,
309
- accession: n.accession,
310
- id: n.id,
311
- taxid: n.taxid,
312
- len: e.len,
313
- ...t
314
- };
315
- })), E = t(() => {
316
- let e = d.value.toLowerCase().trim();
317
- return e ? T.value.filter((t) => t.title.toLowerCase().includes(e) || t.accession.toLowerCase().includes(e)) : T.value;
318
- }), D = t(() => [...E.value].sort((e, t) => {
319
- let n = e[f.value], r = t[f.value];
320
- if (f.value === "evalue") {
321
- if (n === r) return 0;
322
- let e = v.value === "asc" ? 1 : -1;
323
- return (n - r) * e;
324
- }
325
- return n < r ? v.value === "asc" ? -1 : 1 : n > r ? v.value === "asc" ? 1 : -1 : 0;
326
- })), O = t(() => {
327
- let e = (y.value - 1) * x.value, t = e + x.value;
328
- return D.value.slice(e, t);
329
- }), k = t(() => Math.ceil(D.value.length / x.value) || 1), A = (e) => {
330
- f.value === e ? v.value = v.value === "asc" ? "desc" : "asc" : (f.value = e, v.value = e === "evalue" ? "asc" : "desc"), y.value = 1;
331
- }, j = (e) => {
332
- S.value[e] = !S.value[e];
333
- }, M = (e) => {
334
- l("select-hit", e);
335
- }, N = (e) => e === 0 ? "0.0" : e < .001 ? e.toExponential(2) : e.toFixed(4), P = (e) => c.subjectLink ? c.subjectLink.replace("{accession}", e) : `https://www.ncbi.nlm.nih.gov/${c.isProtein ? "protein" : "nucleotide"}/${e}`, F = () => {
336
- let e = [
337
- "Description",
338
- "Accession",
339
- "Max Score",
340
- "Total Score",
341
- "Query Cover (%)",
342
- "E-value",
343
- "Identity (%)",
344
- "Length"
345
- ], t = E.value.map((e) => [
346
- e.title.replace(/\t/g, " "),
347
- e.accession,
348
- e.maxScore.toFixed(1),
349
- e.totalScore.toFixed(1),
350
- `${e.coverage}%`,
351
- e.evalue === 0 ? "0.0" : e.evalue.toString(),
352
- `${e.identity}%`,
353
- e.len.toString()
354
- ]), n = [e.join(" "), ...t.map((e) => e.join(" "))].join("\n"), r = new Blob([n], { type: "text/tab-separated-values;charset=utf-8;" }), i = URL.createObjectURL(r), a = document.createElement("a");
355
- a.setAttribute("href", i);
356
- let o = c.searchData.query_id || "blast_results";
357
- a.setAttribute("download", `${o}_hits.tsv`), a.style.visibility = "hidden", document.body.appendChild(a), a.click(), document.body.removeChild(a);
358
- };
359
- return (t, s) => (p(), r("div", be, [
360
- i("div", xe, [i("div", Se, [s[10] ||= i("h2", null, "Sequences Producing Significant Alignments", -1), i("span", Ce, g(E.value.length) + " / " + g(a.searchData.hits.length) + " hits", 1)]), i("div", we, [i("button", {
361
- class: "btn btn-secondary btn-sm export-btn",
362
- onClick: F,
363
- title: "Export current filtered hits to TSV"
364
- }, " 📥 Export TSV "), i("div", Te, [b(i("input", {
365
- "onUpdate:modelValue": s[0] ||= (e) => d.value = e,
366
- type: "text",
367
- placeholder: "Filter by description or accession...",
368
- class: "input-text filter-input",
369
- onInput: s[1] ||= (e) => y.value = 1
370
- }, null, 544), [[_, d.value]]), d.value ? (p(), r("span", {
371
- key: 0,
372
- class: "clear-search",
373
- onClick: s[2] ||= (e) => {
374
- d.value = "", y.value = 1;
375
- }
376
- }, "✕")) : n("", !0)])])]),
377
- i("div", Ee, [i("table", null, [i("thead", null, [i("tr", null, [
378
- s[11] ||= i("th", { class: "expand-col" }, null, -1),
379
- s[12] ||= i("th", { class: "desc-col" }, "Description", -1),
380
- s[13] ||= i("th", { class: "acc-col" }, "Accession", -1),
381
- i("th", {
382
- class: u(["sortable", {
383
- "active-sort": f.value === "maxScore",
384
- [v.value]: f.value === "maxScore"
385
- }]),
386
- onClick: s[3] ||= (e) => A("maxScore")
387
- }, "Max Score", 2),
388
- i("th", {
389
- class: u(["sortable", {
390
- "active-sort": f.value === "totalScore",
391
- [v.value]: f.value === "totalScore"
392
- }]),
393
- onClick: s[4] ||= (e) => A("totalScore")
394
- }, "Total Score", 2),
395
- i("th", {
396
- class: u(["sortable", {
397
- "active-sort": f.value === "coverage",
398
- [v.value]: f.value === "coverage"
399
- }]),
400
- onClick: s[5] ||= (e) => A("coverage")
401
- }, "Query Cover", 2),
402
- i("th", {
403
- class: u(["sortable", {
404
- "active-sort": f.value === "evalue",
405
- [v.value]: f.value === "evalue"
406
- }]),
407
- onClick: s[6] ||= (e) => A("evalue")
408
- }, "E-value", 2),
409
- i("th", {
410
- class: u(["sortable", {
411
- "active-sort": f.value === "identity",
412
- [v.value]: f.value === "identity"
413
- }]),
414
- onClick: s[7] ||= (e) => A("identity")
415
- }, "Ident (%)", 2),
416
- s[14] ||= i("th", { class: "action-col" }, "Alignment", -1)
417
- ])]), i("tbody", null, [(p(!0), r(e, null, h(O.value, (t) => (p(), r(e, { key: t.num }, [i("tr", { class: u(["main-row", { expanded: S.value[t.num] }]) }, [
418
- i("td", {
419
- class: "expand-cell",
420
- onClick: (e) => j(t.num)
421
- }, [i("span", { class: u(["chevron", { open: S.value[t.num] }]) }, "▶", 2)], 8, De),
422
- i("td", {
423
- class: "desc-cell",
424
- onClick: (e) => j(t.num)
425
- }, [i("div", {
426
- class: "desc-title",
427
- title: t.title
428
- }, g(t.title), 9, ke), t.taxid ? (p(), r("div", Ae, "Tax ID: " + g(t.taxid) + " | Length: " + g(t.len), 1)) : n("", !0)], 8, Oe),
429
- i("td", je, [i("a", {
430
- href: P(t.accession),
431
- target: "_blank",
432
- class: "acc-link"
433
- }, g(t.accession), 9, Me)]),
434
- i("td", Ne, g(t.maxScore.toFixed(1)), 1),
435
- i("td", Pe, g(t.totalScore.toFixed(1)), 1),
436
- i("td", Fe, g(t.coverage) + "%", 1),
437
- i("td", Ie, g(N(t.evalue)), 1),
438
- i("td", Le, g(t.identity) + "%", 1),
439
- i("td", Re, [i("button", {
440
- class: "btn btn-secondary btn-sm",
441
- onClick: (e) => M(t.num)
442
- }, " View ", 8, ze)])
443
- ], 2), S.value[t.num] ? (p(), r("tr", Be, [i("td", Ve, [i("div", He, [s[21] ||= i("div", { class: "hsp-summary-title" }, "High-scoring Segment Pairs (HSPs) details for this hit:", -1), i("div", Ue, [(p(!0), r(e, null, h(t.raw.hsps, (e) => (p(), r("div", {
444
- key: e.num,
445
- class: "hsp-item-card"
446
- }, [i("div", We, [i("span", Ge, "HSP " + g(e.num), 1), i("button", {
447
- class: "btn btn-primary btn-xs",
448
- onClick: (e) => M(t.num)
449
- }, " Alignments Detail ", 8, Ke)]), i("div", qe, [
450
- i("div", Je, [s[15] ||= i("span", { class: "hsp-det-lbl" }, "Bit Score:", -1), i("span", Ye, g(e.bit_score.toFixed(1)), 1)]),
451
- i("div", Xe, [s[16] ||= i("span", { class: "hsp-det-lbl" }, "E-value:", -1), i("span", Ze, g(N(e.evalue)), 1)]),
452
- i("div", Qe, [s[17] ||= i("span", { class: "hsp-det-lbl" }, "Identities:", -1), i("span", $e, g(e.identity) + " / " + g(e.align_len) + " (" + g(Math.round(e.identity / e.align_len * 100)) + "%) ", 1)]),
453
- e.gaps > 0 ? (p(), r("div", et, [s[18] ||= i("span", { class: "hsp-det-lbl" }, "Gaps:", -1), i("span", tt, g(e.gaps), 1)])) : n("", !0),
454
- i("div", nt, [s[19] ||= i("span", { class: "hsp-det-lbl" }, "Query Coordinates:", -1), i("span", rt, g(e.query_from) + " to " + g(e.query_to), 1)]),
455
- i("div", it, [s[20] ||= i("span", { class: "hsp-det-lbl" }, "Subject Coordinates:", -1), i("span", at, g(e.hit_from) + " to " + g(e.hit_to), 1)])
456
- ])]))), 128))])])])])) : n("", !0)], 64))), 128)), E.value.length === 0 ? (p(), r("tr", ot, [i("td", st, " No matching hits found for \"" + g(d.value) + "\" ", 1)])) : n("", !0)])])]),
457
- k.value > 1 ? (p(), r("div", ct, [
458
- i("button", {
459
- class: "btn btn-secondary btn-pagination",
460
- disabled: y.value === 1,
461
- onClick: s[8] ||= (e) => y.value--
462
- }, " ◀ Prev ", 8, lt),
463
- i("span", ut, [
464
- s[22] ||= o(" Page ", -1),
465
- i("strong", null, g(y.value), 1),
466
- s[23] ||= o(" of ", -1),
467
- i("strong", null, g(k.value), 1)
468
- ]),
469
- i("button", {
470
- class: "btn btn-secondary btn-pagination",
471
- disabled: y.value === k.value,
472
- onClick: s[9] ||= (e) => y.value++
473
- }, " Next ▶ ", 8, dt)
474
- ])) : n("", !0)
475
- ]));
476
- }
477
- }), [["__scopeId", "data-v-a7f92dcb"]]), pt = { class: "blast-alignments fade-in" }, mt = { class: "hit-alignments-list" }, ht = ["onClick"], gt = { class: "header-desc" }, _t = { class: "hit-title-box" }, vt = { class: "hit-index-badge" }, yt = { class: "hit-main-title" }, bt = { class: "header-meta" }, xt = ["href"], St = { class: "length-badge" }, Ct = {
478
- key: 0,
479
- class: "alignment-card-content"
480
- }, wt = { class: "hsp-stats-banner" }, Tt = { class: "hsp-banner-title" }, Et = { class: "hsp-stats-grid" }, Dt = { class: "hsp-stat-item" }, Ot = { class: "val sequence-font" }, kt = { class: "hsp-stat-item" }, At = { class: "val sequence-font" }, jt = { class: "hsp-stat-item" }, Mt = { class: "val sequence-font" }, Nt = {
481
- key: 0,
482
- class: "hsp-stat-item"
483
- }, Pt = { class: "val sequence-font" }, Ft = {
484
- key: 1,
485
- class: "hsp-stat-item"
486
- }, It = { class: "val sequence-font" }, Lt = { class: "sequence-alignment-area" }, Rt = { class: "alignment-line query-line" }, zt = { class: "line-coord start-coord sequence-font" }, Bt = { class: "line-chars sequence-font" }, $ = { class: "line-coord end-coord sequence-font" }, Vt = { class: "alignment-line midline" }, Ht = { class: "line-chars sequence-font" }, Ut = { class: "alignment-line sbjct-line" }, Wt = { class: "line-coord start-coord sequence-font" }, Gt = { class: "line-chars sequence-font" }, Kt = { class: "line-coord end-coord sequence-font" }, qt = /*#__PURE__*/ B(/* @__PURE__ */ c({
487
- __name: "BlastAlignmentDetails",
488
- props: {
489
- searchData: {},
490
- isProtein: { type: Boolean },
491
- selectedHitNum: {},
492
- subjectLink: {}
493
- },
494
- setup(t) {
495
- let a = t, o = m({}), s = m({}), c = m(null);
496
- f(() => {
497
- a.searchData.hits.length > 0 && (o.value[a.searchData.hits[0].num] = !0);
498
- }), y(() => a.selectedHitNum, async (e) => {
499
- if (e !== null) {
500
- o.value[e] = !0, c.value = e, await l();
501
- let t = s.value[e];
502
- t && (t.scrollIntoView({
503
- behavior: "smooth",
504
- block: "center"
505
- }), setTimeout(() => {
506
- c.value === e && (c.value = null);
507
- }, 2500));
508
- }
509
- });
510
- let d = (e, t) => {
511
- t && (s.value[e] = t);
512
- }, _ = (e) => {
513
- o.value[e] = !o.value[e];
514
- }, v = (e) => {
515
- let t = e.qseq, n = e.hseq, r = e.midline, i = t.length, a = [], o = e.query_from, s = e.hit_from, c = e.hit_strand === "minus" || e.hit_to < e.hit_from;
516
- for (let e = 0; e < i; e += 60) {
517
- let l = Math.min(e + 60, i), u = [], d = o, f = s, p = 0, m = 0;
518
- for (let i = e; i < l; i++) {
519
- let e = t[i], a = n[i], l = r[i] || " ", d = "mismatch";
520
- e === "-" || a === "-" ? d = "gap" : l === "|" ? d = "match" : l === "+" ? d = "positive" : e === a && (l = "|", d = "match"), u.push({
521
- q: e,
522
- h: a,
523
- m: l,
524
- type: d
525
- }), e !== "-" && (o++, p++), a !== "-" && (c ? s-- : s++, m++);
526
- }
527
- let h = d + (p > 0 ? p - 1 : 0), g = c ? f - (m > 0 ? m - 1 : 0) : f + (m > 0 ? m - 1 : 0);
528
- a.push({
529
- queryStart: d,
530
- queryEnd: h,
531
- sbjctStart: f,
532
- sbjctEnd: g,
533
- columns: u
534
- });
535
- }
536
- return a;
537
- }, b = (e) => e === 0 ? "0.0" : e < .001 ? e.toExponential(2) : e.toFixed(4), S = (e) => a.subjectLink ? a.subjectLink.replace("{accession}", e) : `https://www.ncbi.nlm.nih.gov/${a.isProtein ? "protein" : "nucleotide"}/${e}`;
538
- return (a, s) => (p(), r("div", pt, [s[11] ||= i("div", { class: "alignments-title" }, [i("h2", null, "Detailed Pairwise Alignments"), i("p", null, "Click headers to collapse/expand. Matching bases/residues are color-highlighted.")], -1), i("div", mt, [(p(!0), r(e, null, h(t.searchData.hits, (t, a) => (p(), r("div", {
539
- key: t.num,
540
- ref_for: !0,
541
- ref: (e) => d(t.num, e),
542
- class: u(["hit-alignment-card glass-panel", {
543
- expanded: o.value[t.num],
544
- "highlighted-flash": c.value === t.num
545
- }])
546
- }, [i("div", {
547
- class: "alignment-card-header",
548
- onClick: (e) => _(t.num)
549
- }, [i("div", gt, [i("span", { class: u(["chevron-icon", { open: o.value[t.num] }]) }, "▶", 2), i("div", _t, [i("span", vt, "Hit " + g(a + 1), 1), i("span", yt, g(t.description[0].title), 1)])]), i("div", bt, [i("a", {
550
- href: S(t.description[0].accession),
551
- target: "_blank",
552
- class: "accession-badge sequence-font",
553
- onClick: s[0] ||= x(() => {}, ["stop"])
554
- }, g(t.description[0].accession), 9, xt), i("span", St, "Length: " + g(t.len), 1)])], 8, ht), o.value[t.num] ? (p(), r("div", Ct, [(p(!0), r(e, null, h(t.hsps, (t) => (p(), r("div", {
555
- key: t.num,
556
- class: "hsp-alignment-box"
557
- }, [i("div", wt, [i("div", Tt, "HSP " + g(t.num), 1), i("div", Et, [
558
- i("div", Dt, [s[1] ||= i("span", { class: "lbl" }, "Score:", -1), i("span", Ot, g(t.bit_score.toFixed(1)) + " bits (" + g(t.score) + ")", 1)]),
559
- i("div", kt, [s[2] ||= i("span", { class: "lbl" }, "Expect:", -1), i("span", At, g(b(t.evalue)), 1)]),
560
- i("div", jt, [s[3] ||= i("span", { class: "lbl" }, "Identities:", -1), i("span", Mt, g(t.identity) + "/" + g(t.align_len) + " (" + g(Math.round(t.identity / t.align_len * 100)) + "%) ", 1)]),
561
- t.gaps > 0 ? (p(), r("div", Nt, [s[4] ||= i("span", { class: "lbl" }, "Gaps:", -1), i("span", Pt, g(t.gaps) + "/" + g(t.align_len) + " (" + g(Math.round(t.gaps / t.align_len * 100)) + "%)", 1)])) : n("", !0),
562
- t.query_strand || t.hit_strand ? (p(), r("div", Ft, [s[5] ||= i("span", { class: "lbl" }, "Strand:", -1), i("span", It, g(t.query_strand) + " / " + g(t.hit_strand), 1)])) : n("", !0)
563
- ])]), i("div", Lt, [(p(!0), r(e, null, h(v(t), (t, n) => (p(), r("div", {
564
- key: n,
565
- class: "alignment-block"
566
- }, [
567
- i("div", Rt, [
568
- s[6] ||= i("span", { class: "line-label" }, "Query", -1),
569
- i("span", zt, g(t.queryStart), 1),
570
- i("span", Bt, [(p(!0), r(e, null, h(t.columns, (e, t) => (p(), r("span", {
571
- key: t,
572
- class: u(["char-cell", e.type])
573
- }, g(e.q), 3))), 128))]),
574
- i("span", $, g(t.queryEnd), 1)
575
- ]),
576
- i("div", Vt, [
577
- s[7] ||= i("span", { class: "line-label" }, null, -1),
578
- s[8] ||= i("span", { class: "line-coord start-coord" }, null, -1),
579
- i("span", Ht, [(p(!0), r(e, null, h(t.columns, (e, t) => (p(), r("span", {
580
- key: t,
581
- class: u(["char-cell", e.type])
582
- }, g(e.m === "|" ? "│" : e.m === "+" ? "┿" : " "), 3))), 128))]),
583
- s[9] ||= i("span", { class: "line-coord end-coord" }, null, -1)
584
- ]),
585
- i("div", Ut, [
586
- s[10] ||= i("span", { class: "line-label" }, "Sbjct", -1),
587
- i("span", Wt, g(t.sbjctStart), 1),
588
- i("span", Gt, [(p(!0), r(e, null, h(t.columns, (e, t) => (p(), r("span", {
589
- key: t,
590
- class: u(["char-cell", e.type])
591
- }, g(e.h), 3))), 128))]),
592
- i("span", Kt, g(t.sbjctEnd), 1)
593
- ])
594
- ]))), 128))])]))), 128))])) : n("", !0)], 2))), 128))])]));
595
- }
596
- }), [["__scopeId", "data-v-5d4bf631"]]), Jt = ["data-theme"], Yt = {
597
- key: 0,
598
- class: "error-panel glass-panel fade-in"
599
- }, Xt = { class: "tabs-container glass-panel fade-in" }, Zt = { class: "tabs-header" }, Qt = { class: "tabs-content" }, $t = { class: "tab-panel" }, en = { class: "tab-panel" }, tn = /*#__PURE__*/ B(/* @__PURE__ */ c({
600
- __name: "BlastViewer",
601
- props: {
602
- blastData: {},
603
- queryLink: {},
604
- subjectLink: {},
605
- theme: {}
606
- },
607
- setup(n) {
608
- let a = n, o = m("table"), c = m(null), l = t(() => a.blastData?.BlastOutput2?.[0]?.report ? a.blastData.BlastOutput2[0].report : null), d = t(() => l.value?.results?.search || null), f = t(() => l.value?.program || ""), h = t(() => l.value?.version || ""), g = t(() => l.value?.search_target?.db || ""), _ = t(() => {
609
- let e = f.value.toLowerCase();
610
- return e.includes("p") || e.includes("x") || e.includes("tblast");
611
- }), y = (e) => {
612
- c.value = e, o.value = "alignments";
613
- };
614
- return (t, a) => (p(), r("div", {
615
- class: "blast-viewer",
616
- "data-theme": n.theme
617
- }, [!l.value || !d.value ? (p(), r("div", Yt, [...a[2] ||= [
618
- i("div", { class: "error-icon" }, "⚠️", -1),
619
- i("h3", null, "Invalid BLAST JSON Format", -1),
620
- i("p", null, " The provided data structure does not match standard BLAST JSON format (BlastOutput2 structure). Please upload or paste a valid BLAST output file in JSON format. ", -1)
621
- ]])) : (p(), r(e, { key: 1 }, [
622
- s(V, {
623
- "search-data": d.value,
624
- program: f.value,
625
- version: h.value,
626
- db: g.value,
627
- "query-link": n.queryLink
628
- }, null, 8, [
629
- "search-data",
630
- "program",
631
- "version",
632
- "db",
633
- "query-link"
634
- ]),
635
- s(ye, {
636
- "search-data": d.value,
637
- "is-protein": _.value,
638
- onSelectHit: y
639
- }, null, 8, ["search-data", "is-protein"]),
640
- i("div", Xt, [i("div", Zt, [i("button", {
641
- class: u(["tab-btn", { active: o.value === "table" }]),
642
- onClick: a[0] ||= (e) => o.value = "table"
643
- }, " 📋 Descriptions Table ", 2), i("button", {
644
- class: u(["tab-btn", { active: o.value === "alignments" }]),
645
- onClick: a[1] ||= (e) => o.value = "alignments"
646
- }, " 🔍 Pairwise Alignments ", 2)]), i("div", Qt, [b(i("div", $t, [s(ft, {
647
- "search-data": d.value,
648
- "is-protein": _.value,
649
- "subject-link": n.subjectLink,
650
- onSelectHit: y
651
- }, null, 8, [
652
- "search-data",
653
- "is-protein",
654
- "subject-link"
655
- ])], 512), [[v, o.value === "table"]]), b(i("div", en, [s(qt, {
656
- "search-data": d.value,
657
- "is-protein": _.value,
658
- "selected-hit-num": c.value,
659
- "subject-link": n.subjectLink
660
- }, null, 8, [
661
- "search-data",
662
- "is-protein",
663
- "selected-hit-num",
664
- "subject-link"
665
- ])], 512), [[v, o.value === "alignments"]])])])
666
- ], 64))], 8, Jt));
667
- }
668
- }), [["__scopeId", "data-v-e1f420c8"]]);
669
- //#endregion
670
- export { tn as BlastViewer };