UNPKG

taxonium-component

Version:

React component for exploring large phylogenetic trees in the browser

145 lines (144 loc) 6.59 kB
import { jsxs as l, jsx as n, Fragment as d } from "react/jsx-runtime"; import { useState as c, lazy as m } from "react"; import { F as f } from "./FeatureDetails-8c1_Dsqv.js"; import { bQ as p, m as h, F as g, b0 as b, u as y, o as u, P as C } from "./JBrowsePanel-uJIA-L6s.js"; import { B as S } from "./BaseCard-CrWzwjYv.js"; import { g as v } from "./index-dFotuATn.js"; import { F as q } from "./FormControlLabel-CwjOxa71.js"; import { C as w } from "./Checkbox-BG4jcGUl.js"; import { L as F } from "./Link-CZ78-213.js"; var k = p(); const R = /* @__PURE__ */ v(k), P = h()({ compact: { paddingRight: 0, paddingTop: 0, paddingBottom: 0 } }), O = [ "read paired", "read mapped in proper pair", "read unmapped", "mate unmapped", "read reverse strand", "mate reverse strand", "first in pair", "second in pair", "not primary alignment", "read fails platform/vendor quality checks", "read is PCR or optical duplicate", "supplementary alignment" ]; function T(t) { const { classes: a } = P(), { flags: e } = t; return l(S, { ...t, title: "Flags", children: [n(R, { name: "Flag", value: e }), n(g, { children: O.map((i, o) => { const r = e & 1 << o, s = `${i}_${r}`; return n(q, { control: n(w, { className: a.compact, checked: !!r, name: i, readOnly: !0 }), label: i }, s); }) })] }); } function x({ value: t }) { const [a, e] = c(!1), [i, o] = c(!1), r = String(t); return r.length > 100 ? l(d, { children: [n("button", { type: "button", onClick: () => { b(r), o(!0), setTimeout(() => { o(!1); }, 700); }, children: i ? "Copied to clipboard" : "Copy" }), n("button", { type: "button", onClick: () => { e((s) => !s); }, children: a ? "Show less" : "Show more" }), n("div", { children: a ? r : `${r.slice(0, 100)}...` })] }) : n("div", { children: r }); } function A(t, a) { var e; return ((e = a.tags) === null || e === void 0 ? void 0 : e[t]) || a[t]; } async function M(t, a) { const e = y.getSession(a), { view: i } = a; try { if (i) await i.navToLocString(t); else throw new Error("No view associated with this view anymore"); } catch (o) { console.error(o), e.notify(`${o}`); } } function Q({ locString: t, model: a }) { return n(F, { onClick: (e) => { e.preventDefault(), M(t, a); }, href: "#", children: t }); } const B = { AM: "The smallest template-independent mapping quality in the template", AS: "Alignment score generated by aligner", BC: "Barcode sequence identifying the sample", BQ: "Offset to base alignment quality (BAQ)", BZ: "Phred quality of the unique molecular barcode bases in the {OX} tag", CB: "Cell identifier", CC: "Reference name of the next hit", CM: "Edit distance between the color sequence and the color reference (see also {NM})", CO: "Free-text comments", CP: "Leftmost coordinate of the next hit", CQ: "Color read base qualities", CR: "Cellular barcode sequence bases (uncorrected)", CS: "Color read sequence", CT: "Complete read annotation tag, used for consensus annotation dummy features", CY: "Phred quality of the cellular barcode sequence in the {CR} tag", E2: "The 2nd most likely base calls", FI: "The index of segment in the template", FS: "Segment suffix", FZ: "Flow stopToken intensities", GC: "Reserved for backwards compatibility reasons", GQ: "Reserved for backwards compatibility reasons", GS: "Reserved for backwards compatibility reasons", H0: "Number of perfect hits", H1: "Number of 1-difference hits (see also {NM})", H2: "Number of 2-difference hits", HI: "Query hit index", IH: "Query hit total count", LB: "Library", MC: "CIGAR string for mate/next segment", MD: "String encoding mismatched and deleted reference bases", MF: "Reserved for backwards compatibility reasons", MI: "Molecular identifier; a string that uniquely identifies the molecule from which the record was derived", ML: "Base modification probabilities", MM: "Base modifications / methylation ", MQ: "Mapping quality of the mate/next segment", NH: "Number of reported alignments that contain the query in the current record", NM: "Edit distance to the reference", OA: "Original alignment", OC: "Original CIGAR (deprecated; use {OA} instead)", OP: "Original mapping position (deprecated; use {OA} instead)", OQ: "Original base quality", OX: "Original unique molecular barcode bases", PG: "Program", PQ: "Phred likelihood of the template", PT: "Read annotations for parts of the padded read sequence", PU: "Platform unit", Q2: "Phred quality of the mate/next segment sequence in the {R2} tag", QT: "Phred quality of the sample barcode sequence in the {BC} tag", QX: "Quality score of the unique molecular identifier in the {RX} tag", R2: "Sequence of the mate/next segment in the template", RG: "Read group", RT: "Reserved for backwards compatibility reasons", RX: "Sequence bases of the (possibly corrected) unique molecular identifier", S2: "Reserved for backwards compatibility reasons", SA: "Other canonical alignments in a chimeric alignment", SM: "Template-independent mapping quality", SQ: "Reserved for backwards compatibility reasons", TC: "The number of segments in the template", TS: "Transcript strand", U2: "Phred probability of the 2nd call being wrong conditional on the best being wrong", UQ: "Phred likelihood of the segment, conditional on the mapping being correct" }, N = m(() => import("./SupplementaryAlignments-BrM2eOAz.js")), L = m(() => import("./LinkedPairedAlignments-ndwsoOzz.js")), D = u(function(t) { const { model: a, feat: e } = t, i = e.flags, o = A("SA", e); return l(C, { "data-testid": "alignment-side-drawer", children: [n(f, { ...t, descriptions: { tags: B }, feature: e, formatter: (r, s) => s === "next_segment_position" ? n(Q, { model: a, locString: r }) : n(x, { value: r }) }), o !== void 0 ? n(N, { model: a, tag: o, feature: e }) : null, i != null ? l(d, { children: [i & 1 ? n(L, { model: a, feature: e }) : null, n(T, { flags: i, ...t })] }) : null] }); }), G = u(function(t) { const { model: a } = t, { featureData: e } = a, i = structuredClone(e); return i ? n(D, { feat: i, ...t }) : n("div", { children: "No feature loaded, may not be available after page refresh because it was too large for localStorage" }); }), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: G }, Symbol.toStringTag, { value: "Module" })); export { Z as A, M as n }; //# sourceMappingURL=AlignmentsFeatureDetail-C3anQ2Ub.js.map