@biolibs/bionet-tools 0.0.0-stage → 0.1.1

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 (48) hide show
  1. package/README.md +104 -2
  2. package/dist/digest-tool.d.ts +30 -0
  3. package/dist/digest-tool.d.ts.map +1 -0
  4. package/dist/digest-tool.js +84 -0
  5. package/dist/digest-tool.js.map +1 -0
  6. package/dist/digest.d.ts +94 -0
  7. package/dist/digest.d.ts.map +1 -0
  8. package/dist/digest.js +115 -0
  9. package/dist/digest.js.map +1 -0
  10. package/dist/index.d.ts +29 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +29 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/pcr-bench.d.ts +94 -0
  15. package/dist/pcr-bench.d.ts.map +1 -0
  16. package/dist/pcr-bench.js +187 -0
  17. package/dist/pcr-bench.js.map +1 -0
  18. package/dist/pcr-scene.d.ts +247 -0
  19. package/dist/pcr-scene.d.ts.map +1 -0
  20. package/dist/pcr-scene.js +287 -0
  21. package/dist/pcr-scene.js.map +1 -0
  22. package/dist/pcr-tool.d.ts +18 -0
  23. package/dist/pcr-tool.d.ts.map +1 -0
  24. package/dist/pcr-tool.js +73 -0
  25. package/dist/pcr-tool.js.map +1 -0
  26. package/dist/pcr.d.ts +59 -0
  27. package/dist/pcr.d.ts.map +1 -0
  28. package/dist/pcr.js +79 -0
  29. package/dist/pcr.js.map +1 -0
  30. package/dist/run.d.ts +161 -0
  31. package/dist/run.d.ts.map +1 -0
  32. package/dist/run.js +143 -0
  33. package/dist/run.js.map +1 -0
  34. package/dist/tools.d.ts +27 -0
  35. package/dist/tools.d.ts.map +1 -0
  36. package/dist/tools.js +45 -0
  37. package/dist/tools.js.map +1 -0
  38. package/package.json +61 -4
  39. package/src/digest-tool.tsx +199 -0
  40. package/src/digest.ts +136 -0
  41. package/src/index.ts +28 -0
  42. package/src/pcr-bench.tsx +350 -0
  43. package/src/pcr-scene.ts +408 -0
  44. package/src/pcr-tool.tsx +160 -0
  45. package/src/pcr.ts +87 -0
  46. package/src/run.ts +234 -0
  47. package/src/tools.tsx +64 -0
  48. package/tools.css +50 -0
@@ -0,0 +1,94 @@
1
+ /**
2
+ * A PCR at the machine: everything beside the scene, and what the scene is told to show.
3
+ *
4
+ * It knows nothing of three dimensions. It holds what has been chosen and which view is showing,
5
+ * works out what the machine would show and what is in the tube, and hands those to whatever draws
6
+ * the instrument as plain data. The scene package's `InstrumentStage` takes them as they are.
7
+ *
8
+ * What is beside the scene keeps four things apart: what the **machine** shows, what is true of this
9
+ * **run**, the **checks** a careful operator would make, and, for somebody new, what is going on.
10
+ */
11
+ import { type ReactNode } from "react";
12
+ import { type PcrProgramme, type PcrStepName, type TubeLens, type TubeStrand } from "./pcr-scene.js";
13
+ /** The views of the machine, in the order a person meets them. */
14
+ export type BenchView = "machine" | "block" | "screen" | "tube" | "result";
15
+ /** What the scene is told to show. It is shaped to be spread onto `InstrumentStage`. */
16
+ export interface BenchStage {
17
+ model: "thermocycler";
18
+ name: string;
19
+ view: BenchView;
20
+ onView: (view: BenchView) => void;
21
+ screen: {
22
+ text: string;
23
+ lit?: boolean;
24
+ }[];
25
+ well?: {
26
+ row: number;
27
+ column: number;
28
+ };
29
+ tube?: {
30
+ length: number;
31
+ strands: TubeStrand[];
32
+ };
33
+ /** The real bases at the primer being looked at, for any moment of the step showing. */
34
+ lens?: (through: number) => (TubeLens & {
35
+ rows: [number, number];
36
+ }) | null;
37
+ legend: Partial<Record<TubeStrand["kind"], string>>;
38
+ /** How long the step showing should take to play, when the bench is setting the pace. */
39
+ seconds?: number;
40
+ /** Called when the step showing has finished playing. */
41
+ onPlayed: () => void;
42
+ }
43
+ /**
44
+ * A cycle's temperatures as a line, with a mark on the step it is at.
45
+ *
46
+ * @param props - `programme` is the programme; `step` is the step it is on.
47
+ */
48
+ export declare function TemperatureTrace({ programme, step }: {
49
+ programme: PcrProgramme;
50
+ step: PcrStepName;
51
+ }): import("react").JSX.Element;
52
+ /**
53
+ * How many strands of each kind there are, as bars.
54
+ *
55
+ * The bars are on a doubling scale, since the product doubles: each step along is twice as many.
56
+ *
57
+ * @param props - `counts` is how many there are; `cycles` is how many cycles the programme runs,
58
+ * which sets how long a full bar is.
59
+ */
60
+ export declare function StrandBars({ counts, cycles }: {
61
+ counts: {
62
+ template: number;
63
+ long: number;
64
+ product: number;
65
+ };
66
+ cycles: number;
67
+ }): import("react").JSX.Element;
68
+ /**
69
+ * A PCR at the machine.
70
+ *
71
+ * @param options - `instrument` is the thermocycler it is run on, if the lab has placed one;
72
+ * `onDone` adds a way to leave.
73
+ * @returns `stage`, to spread onto whatever draws the instrument, and `panel`, to put beside it.
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * import { usePcrBench } from "@biolibs/bionet-tools";
78
+ *
79
+ * const bench = usePcrBench({ instrument });
80
+ * // InstrumentStage is the scene package's; anything that draws an instrument from this data will do.
81
+ * <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
82
+ * ```
83
+ */
84
+ export declare function usePcrBench({ instrument, onDone }?: {
85
+ instrument?: {
86
+ id: string;
87
+ name: string;
88
+ } | null;
89
+ onDone?: () => void;
90
+ }): {
91
+ stage: BenchStage;
92
+ panel: ReactNode;
93
+ };
94
+ //# sourceMappingURL=pcr-bench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pcr-bench.d.ts","sourceRoot":"","sources":["../src/pcr-bench.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMrE,OAAO,EACE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGrG,kEAAkE;AAClE,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3E,wF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AM,CAAA;CAAE,+BAa7H;AAgBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,EAAE,UAAiB,EAAE,MAAM,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAO,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAuOlL"}
@@ -0,0 +1,187 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * A PCR at the machine: everything beside the scene, and what the scene is told to show.
5
+ *
6
+ * It knows nothing of three dimensions. It holds what has been chosen and which view is showing,
7
+ * works out what the machine would show and what is in the tube, and hands those to whatever draws
8
+ * the instrument as plain data. The scene package's `InstrumentStage` takes them as they are.
9
+ *
10
+ * What is beside the scene keeps four things apart: what the **machine** shows, what is true of this
11
+ * **run**, the **checks** a careful operator would make, and, for somebody new, what is going on.
12
+ */
13
+ import { useEffect, useMemo, useState } from "react";
14
+ import { bandsOf, gelById, ladderBands, ladderById } from "@biolibs/gel";
15
+ import { useAct, useLab } from "@biolibs/bionet-react";
16
+ import { Glossed } from "@biolibs/glossary-react";
17
+ import { Gel } from "./digest-tool.js";
18
+ import { primerTm } from "./pcr.js";
19
+ import { primerBinding, programmeChecks, screenOf, strandCounts, suggestProgramme, tubeLens, tubeView } from "./pcr-scene.js";
20
+ import { pcrRun, pcrTubes } from "./run.js";
21
+ /**
22
+ * A cycle's temperatures as a line, with a mark on the step it is at.
23
+ *
24
+ * @param props - `programme` is the programme; `step` is the step it is on.
25
+ */
26
+ export function TemperatureTrace({ programme, step }) {
27
+ const total = programme.steps.reduce((sum, one) => sum + one.seconds, 0);
28
+ const y = (celsius) => 58 - ((celsius - 40) / 60) * 50;
29
+ let x = 8;
30
+ const spans = programme.steps.map((one) => { const from = x; x += (one.seconds / total) * 204; return { one, from, to: x }; });
31
+ const line = spans.flatMap(({ one, from, to }) => [`${from},${y(one.celsius)}`, `${to},${y(one.celsius)}`]).join(" ");
32
+ const now = spans.find(({ one }) => one.name === step);
33
+ return (_jsxs("svg", { className: "trace", viewBox: "0 0 220 70", role: "img", "aria-label": `One cycle: ${programme.steps.map((one) => `${one.name} at ${one.celsius} degrees for ${one.seconds} seconds`).join(", ")}. It is on ${step}.`, children: [_jsx("polyline", { points: line, fill: "none", className: "line" }), _jsx("rect", { x: now.from, y: 4, width: now.to - now.from, height: 60, className: "now" }), spans.map(({ one, from, to }) => _jsxs("text", { x: (from + to) / 2, y: y(one.celsius) - 5, textAnchor: "middle", className: one.name === step ? "on" : undefined, children: [one.celsius, "\u00B0"] }, one.name))] }));
34
+ }
35
+ /**
36
+ * How many strands of each kind there are, as bars.
37
+ *
38
+ * The bars are on a doubling scale, since the product doubles: each step along is twice as many.
39
+ *
40
+ * @param props - `counts` is how many there are; `cycles` is how many cycles the programme runs,
41
+ * which sets how long a full bar is.
42
+ */
43
+ export function StrandBars({ counts, cycles }) {
44
+ const rows = [["Template", counts.template, "template"], ["Too long", counts.long, "long"], ["Product", counts.product, "product"]];
45
+ return (_jsx("div", { className: "bars", role: "img", "aria-label": rows.map(([label, count]) => `${label}: ${count.toLocaleString("en-US")} strands`).join(". "), children: rows.map(([label, count, kind]) => (_jsxs("div", { className: "bar", children: [_jsx("span", { children: label }), _jsx("span", { className: "track", children: _jsx("span", { className: `fill ${kind}`, style: { width: `${Math.min(100, (Math.log2(count + 1) / (cycles + 1)) * 100)}%` } }) }), _jsx("span", { className: "count", children: count.toLocaleString("en-US") })] }, kind))) }));
46
+ }
47
+ const STEPS = ["denature", "anneal", "extend"];
48
+ const whole = (text) => (text.trim() === "" || !Number.isFinite(Number(text)) ? undefined : Math.round(Number(text)));
49
+ function Pick({ label, choices, value, onChange }) {
50
+ return (_jsxs("label", { children: [label, _jsxs("select", { value: value, onChange: (event) => onChange(event.target.value), "aria-label": label, children: [_jsx("option", { value: "", children: "Choose a tube\u2026" }), choices.map((one) => _jsx("option", { value: one.item, children: one.label }, one.item))] })] }));
51
+ }
52
+ /**
53
+ * A PCR at the machine.
54
+ *
55
+ * @param options - `instrument` is the thermocycler it is run on, if the lab has placed one;
56
+ * `onDone` adds a way to leave.
57
+ * @returns `stage`, to spread onto whatever draws the instrument, and `panel`, to put beside it.
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * import { usePcrBench } from "@biolibs/bionet-tools";
62
+ *
63
+ * const bench = usePcrBench({ instrument });
64
+ * // InstrumentStage is the scene package's; anything that draws an instrument from this data will do.
65
+ * <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
66
+ * ```
67
+ */
68
+ export function usePcrBench({ instrument = null, onDone } = {}) {
69
+ const lab = useLab()?.lab;
70
+ const act = useAct();
71
+ const [view, setView] = useState("machine");
72
+ const [template, setTemplate] = useState("");
73
+ const [forward, setForward] = useState("");
74
+ const [reverse, setReverse] = useState("");
75
+ const [least, setLeast] = useState("18");
76
+ const [set, setSet] = useState(null);
77
+ const [step, setStep] = useState("denature");
78
+ const [cycle, setCycle] = useState(1);
79
+ const [name, setName] = useState("");
80
+ const [amount, setAmount] = useState("50");
81
+ const [note, setNote] = useState("");
82
+ const [busy, setBusy] = useState(false);
83
+ const [said, setSaid] = useState(null);
84
+ const [running, setRunning] = useState(false);
85
+ const [site, setSite] = useState("top");
86
+ const tubes = useMemo(() => (lab === null || lab === undefined ? { templates: [], primers: [] } : pcrTubes(lab)), [lab]);
87
+ const partOf = (item) => [...tubes.templates, ...tubes.primers].find((one) => one.item === item)?.part;
88
+ const [templatePart, forwardPart, reversePart] = [partOf(template), partOf(forward), partOf(reverse)];
89
+ const annealAtLeast = whole(least) ?? 18;
90
+ // What is true of this run: what the engine says the primers make, and where each binds.
91
+ const drafted = useMemo(() => (lab === null || lab === undefined ? null : pcrRun(lab, { template, forward, reverse, annealAtLeast })), [lab, template, forward, reverse, annealAtLeast]);
92
+ const product = drafted?.plan?.problem === null ? drafted.plan.products[0] : null;
93
+ const bindings = useMemo(() => {
94
+ if (templatePart === undefined || forwardPart === undefined || reversePart === undefined)
95
+ return null;
96
+ const found = [primerBinding(templatePart.sequence, forwardPart.sequence, annealAtLeast), primerBinding(templatePart.sequence, reversePart.sequence, annealAtLeast)];
97
+ const top = found.find((one) => one?.reads === "top");
98
+ const bottom = found.find((one) => one?.reads === "bottom");
99
+ return top === undefined || top === null || bottom === undefined || bottom === null ? null : { top, bottom };
100
+ }, [templatePart, forwardPart, reversePart, annealAtLeast]);
101
+ const reaction = useMemo(() => ({
102
+ length: product?.length ?? 0,
103
+ primers: [forwardPart, reversePart].flatMap((part) => (part === undefined ? [] : [{ name: part.name, tm: primerTm(part.sequence) ?? 60 }])),
104
+ }), [product, forwardPart, reversePart]);
105
+ const suggested = useMemo(() => suggestProgramme(reaction), [reaction]);
106
+ // A new choice of tubes is a new reaction, so what was set for the last one is let go.
107
+ useEffect(() => { setSet(null); setSaid(null); }, [template, forward, reverse]);
108
+ const programme = set ?? suggested;
109
+ const checks = product === null ? [] : programmeChecks(programme, reaction);
110
+ const run = useMemo(() => (lab === null || lab === undefined ? null : pcrRun(lab, {
111
+ template, forward, reverse, annealAtLeast, instrument: instrument?.id ?? null, name, note, programme, ...(whole(amount) === undefined ? {} : { amount: whole(amount) }),
112
+ })), [lab, template, forward, reverse, annealAtLeast, instrument, name, note, programme, amount]);
113
+ // The real bases, at whichever primer is being looked at.
114
+ const lens = useMemo(() => {
115
+ if (bindings === null || templatePart === undefined || forwardPart === undefined || reversePart === undefined)
116
+ return undefined;
117
+ const binding = bindings[site];
118
+ const primer = [forwardPart, reversePart].find((part) => primerBinding(templatePart.sequence, part.sequence, annealAtLeast)?.reads === site);
119
+ // Heating parts the template's own two strands; after that a primer is with the strand beside it.
120
+ const rows = step === "denature" ? [0, 3] : site === "top" ? [2, 3] : [0, 1];
121
+ return (through) => ({ ...tubeLens(templatePart.sequence, primer.sequence, binding, step, through, { primer: primer.name, template: templatePart.name }), rows });
122
+ }, [bindings, templatePart, forwardPart, reversePart, annealAtLeast, site, step]);
123
+ const inTube = bindings === null || templatePart === undefined ? undefined : tubeView(templatePart.length, bindings.top, bindings.bottom, step, cycle);
124
+ // Running the programme: each step plays into the next, and each cycle into the next, as the
125
+ // machine would. The first three cycles are played at the pace chosen, since each shows something
126
+ // new. After that every cycle looks alike, so they go by quickly and the counts are what to watch.
127
+ const onward = () => {
128
+ const next = STEPS[STEPS.indexOf(step) + 1];
129
+ if (next !== undefined) {
130
+ setStep(next);
131
+ return;
132
+ }
133
+ if (cycle >= programme.cycles) {
134
+ setRunning(false);
135
+ return;
136
+ }
137
+ setCycle(cycle + 1);
138
+ setStep("denature");
139
+ };
140
+ const played = () => { if (running)
141
+ onward(); };
142
+ const onMachine = (line, at) => (at === 1 ? { text: `Cycle ${Math.min(cycle, programme.cycles)} of ${programme.cycles}`, ...(running ? { lit: true } : {}) }
143
+ : { text: line.text, ...(line.step === step ? { lit: true } : {}) });
144
+ const stage = {
145
+ model: "thermocycler", name: instrument?.name ?? "Thermocycler", view, onView: (to) => { setView(to); if (to !== "tube")
146
+ setRunning(false); },
147
+ onPlayed: played, ...(running && cycle > 3 ? { seconds: 0.22 } : {}),
148
+ screen: product === null ? [{ text: "No programme" }] : screenOf(programme).map(onMachine),
149
+ ...(templatePart === undefined ? {} : { well: { row: 0, column: 0 } }),
150
+ ...(inTube === undefined || templatePart === undefined ? {} : { tube: { length: templatePart.length, strands: inTube.strands } }),
151
+ ...(lens === undefined || cycle > 3 ? {} : { lens }),
152
+ legend: { template: "the template's two strands", primer: "a primer", long: "a copy that runs on too far", product: "the product, at its exact length" },
153
+ };
154
+ const change = (edit) => { const next = structuredClone(programme); edit(next); setSet(next); };
155
+ const record = async (what, done) => {
156
+ if (what === null)
157
+ return;
158
+ setBusy(true);
159
+ const answer = await act("recordRun", what);
160
+ setBusy(false);
161
+ if (answer.ok) {
162
+ setSaid(done);
163
+ setName("");
164
+ setNote("");
165
+ }
166
+ };
167
+ const chosen = templatePart !== undefined && forwardPart !== undefined && reversePart !== undefined;
168
+ const panel = lab === null || lab === undefined ? null : (_jsxs("div", { className: "bionet benchpanel", children: [_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsx("h2", { children: "PCR" }), onDone !== undefined && _jsx("button", { type: "button", className: "quiet", onClick: onDone, children: "Back to the lab" })] }), tubes.templates.length === 0 ? _jsx("p", { className: "empty", children: "There are no tubes to run a PCR from. Add a part and a tube of it on the Freezer tab." }) : (_jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsx(Pick, { label: "Template", choices: tubes.templates, value: template, onChange: setTemplate }), _jsx(Pick, { label: "Forward primer", choices: tubes.primers, value: forward, onChange: setForward }), _jsx(Pick, { label: "Reverse primer", choices: tubes.primers, value: reverse, onChange: setReverse })] })), chosen && drafted?.plan?.problem !== null && drafted?.plan !== null && _jsx("p", { className: "trouble", role: "status", children: drafted?.plan?.problem })] }), view === "machine" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "At the machine" }), _jsx("p", { className: "small", children: _jsx(Glossed, { text: "PCR copies the stretch of a template that lies between two primers, over and over, by heating and cooling it." }) }), _jsx("p", { className: "dim small", children: "A thermocycler shows its programme, the block's temperature and which cycle it is on. It shows nothing of the DNA. The first three views are what it shows; the last two are what you have to picture." })] })), view === "block" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The block" }), _jsx("p", { className: "voice", children: "The machine" }), _jsx("p", { className: "small", children: "96 wells under a heated lid, which presses on the tubes so nothing condenses on their caps." }), _jsx("p", { className: "voice", children: "This run" }), _jsx("p", { className: "small", children: templatePart === undefined ? "No tube is in the block yet. Choose a template above." : "Your reaction is in well A1, at the back left." })] })), view === "screen" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The programme" }), product === null ? _jsx("p", { className: "dim small", children: "Choose tubes that make one product and a programme is suggested for it." }) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "voice", children: "The machine" }), _jsxs("fieldset", { disabled: busy, className: "programme", children: [_jsxs("label", { children: ["Anneal at", _jsx("input", { type: "number", min: 30, max: 80, step: 1, value: programme.steps[1].celsius, onChange: (event) => change((p) => { p.steps[1].celsius = whole(event.target.value) ?? p.steps[1].celsius; }) }), " \u00B0C"] }), _jsxs("label", { children: ["Extend for", _jsx("input", { type: "number", min: 5, max: 1800, step: 5, value: programme.steps[2].seconds, onChange: (event) => change((p) => { p.steps[2].seconds = whole(event.target.value) ?? p.steps[2].seconds; }) }), " s"] }), _jsxs("label", { children: ["Cycles", _jsx("input", { type: "number", min: 1, max: 60, step: 1, value: programme.cycles, onChange: (event) => change((p) => { p.cycles = whole(event.target.value) ?? p.cycles; }) })] }), set !== null && _jsx("button", { type: "button", className: "plain", onClick: () => setSet(null), children: "back to what was suggested" })] }), _jsx("p", { className: "voice", children: "This run" }), _jsxs("p", { className: "small", children: [reaction.primers.map((one) => `${one.name} melts near ${Math.round(one.tm)} °C`).join("; "), ". The product is ", product.length.toLocaleString("en-US"), " bases."] }), _jsx("p", { className: "voice", children: "Checks" }), checks.length === 0 ? _jsx("p", { className: "small good", children: "Nothing in this programme looks wrong for this reaction." }) : (_jsx("ul", { className: "checks", children: checks.map((check) => _jsx("li", { className: check.weight, children: check.says }, check.says)) }))] }))] })), view === "tube" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "In the tube" }), inTube === undefined ? _jsx("p", { className: "dim small", children: chosen ? "These primers do not each bind this template in one place, so there is nothing to draw." : "Choose a template and two primers to see what happens to them." }) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "row tight pick", role: "group", "aria-label": "Step of the cycle", children: STEPS.map((one) => _jsxs("button", { type: "button", "aria-pressed": one === step, className: one === step ? "" : "quiet", onClick: () => setStep(one), children: [one[0].toUpperCase(), one.slice(1)] }, one)) }), _jsxs("div", { className: "row tight pick", role: "group", "aria-label": "Cycle", children: [_jsx("span", { className: "dim small", children: "Cycle" }), [1, 2, 3].map((one) => _jsx("button", { type: "button", "aria-pressed": one === cycle, className: one === cycle ? "" : "quiet", onClick: () => { setRunning(false); setCycle(one); }, children: one }, one)), cycle > 3 && _jsxs("span", { className: "small", children: [cycle, " of ", programme.cycles] })] }), _jsxs("div", { className: "row tight pick", role: "group", "aria-label": "Which primer to read the bases at", children: [_jsx("span", { className: "dim small", children: "Read the bases at" }), ["top", "bottom"].map((one) => {
169
+ const part = [forwardPart, reversePart].find((each) => each !== undefined && templatePart !== undefined && primerBinding(templatePart.sequence, each.sequence, annealAtLeast)?.reads === one);
170
+ return _jsx("button", { type: "button", "aria-pressed": one === site, className: one === site ? "" : "quiet", onClick: () => setSite(one), children: part?.name ?? one }, one);
171
+ })] }), _jsxs("div", { className: "row tight pick", children: [_jsx("button", { type: "button", onClick: () => {
172
+ if (running) {
173
+ setRunning(false);
174
+ return;
175
+ }
176
+ setRunning(true);
177
+ // The step showing has usually finished playing, so a run starts by moving on from it.
178
+ if (cycle >= programme.cycles && step === "extend") {
179
+ setCycle(1);
180
+ setStep("denature");
181
+ }
182
+ else
183
+ onward();
184
+ }, children: running ? "Stop" : cycle >= programme.cycles && step === "extend" ? "Run it again" : "Run the programme" }), _jsx("span", { className: "dim small", children: running ? "Each step plays into the next." : "Or press a step to see it alone." })] }), _jsx("p", { className: "voice", children: "The machine" }), _jsxs("p", { className: "small", children: [_jsx("code", { children: screenOf(programme).find((line) => line.step === step)?.text.trim() }), " \u00B7 cycle ", Math.min(cycle, programme.cycles), " of ", programme.cycles] }), _jsx(TemperatureTrace, { programme: programme, step: step }), _jsx("p", { className: "voice", children: "What is going on" }), _jsx("p", { className: "small", children: _jsx(Glossed, { text: inTube.says }) }), _jsx("p", { className: "voice", children: "This run" }), _jsx(StrandBars, { counts: inTube.counts, cycles: programme.cycles }), _jsxs("p", { className: "dim small", children: ["Strands in the tube now, from one double-stranded template. Each step along a bar is twice as many. The copies that run on too far grow by two a cycle; the product doubles, and after ", programme.cycles, " cycles there are ", strandCounts(programme.cycles).product.toLocaleString("en-US"), "."] })] }))] })), view === "result" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The result" }), product === null ? _jsx("p", { className: "dim small", children: "Choose tubes that make one product." }) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "voice", children: "This run" }), _jsxs("p", { children: [_jsxs("strong", { children: [product.length.toLocaleString("en-US"), " bp"] }), " ", _jsx("span", { className: "dim", children: "linear" })] }), _jsx("code", { className: "wrap", children: product.length <= 96 ? product.sequence : `${product.sequence.slice(0, 44)} … ${product.sequence.slice(-44)}` }), _jsx(Gel, { ladder: ladderBands(ladderById(product.length < 1500 ? "100bp" : "1kb").sizes, gelById(product.length < 1500 ? "1.5" : "1.0")), bands: bandsOf([product.length], gelById(product.length < 1500 ? "1.5" : "1.0")), name: run?.name ?? "product" }), checks.length > 0 && (_jsxs(_Fragment, { children: [_jsx("p", { className: "voice", children: "Checks" }), _jsx("ul", { className: "checks", children: checks.map((check) => _jsx("li", { className: check.weight, children: check.says }, check.says)) })] })), _jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsxs("label", { children: ["Call the product", _jsx("input", { value: name, onChange: (event) => setName(event.target.value), placeholder: run?.name ?? "", maxLength: 200 })] }), _jsxs("label", { children: ["Amount, in \u00B5L", _jsx("input", { type: "number", min: 0, step: 1, value: amount, onChange: (event) => setAmount(event.target.value) })] }), _jsxs("label", { children: ["Note", _jsx("input", { value: note, onChange: (event) => setNote(event.target.value), maxLength: 2000 })] }), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", onClick: () => void record(run?.worked ?? null, `Recorded. There is a new tube of ${run?.name ?? "the product"}, not yet put anywhere.`), children: "Record the run" }), _jsx("button", { type: "button", className: "quiet", onClick: () => void record(run?.failed ?? null, "Recorded as a run that gave nothing. The tubes were used all the same."), children: "It gave nothing" })] })] })] })), said !== null && _jsx("p", { className: "small", role: "status", children: said })] }))] }));
185
+ return { stage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AE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,247 @@
1
+ /**
2
+ * A PCR as a person at the machine meets it: what the machine shows, and what they have to picture.
3
+ *
4
+ * A thermocycler shows a programme, a temperature and a cycle count. It says nothing about DNA. What
5
+ * is happening in the tube — strands parting, primers finding their places, copies being made, and
6
+ * which of those copies are the product — the operator has to picture. This works both out as plain
7
+ * data, so a scene can draw them and a test can check them:
8
+ *
9
+ * - the **programme**, as the machine shows it, suggested from the reaction;
10
+ * - the **checks** a careful operator would make of it, each about this run and each able to be wrong;
11
+ * - where each **primer binds**, on which strand;
12
+ * - what is **in the tube** at each step of each cycle.
13
+ */
14
+ /** The three things a cycle does. */
15
+ export type PcrStepName = "denature" | "anneal" | "extend";
16
+ /** One step of a programme: how hot, and for how long. */
17
+ export interface PcrStep {
18
+ /** Which step it is. */
19
+ name: PcrStepName;
20
+ /** The block's temperature, in whole degrees Celsius. */
21
+ celsius: number;
22
+ /** How long it is held, in whole seconds. */
23
+ seconds: number;
24
+ }
25
+ /** A thermocycler's programme. */
26
+ export interface PcrProgramme {
27
+ /** The first, longer melt before cycling starts. */
28
+ initial: {
29
+ celsius: number;
30
+ seconds: number;
31
+ };
32
+ /** The three steps of a cycle, in order. */
33
+ steps: [PcrStep, PcrStep, PcrStep];
34
+ /** How many times the cycle is run. */
35
+ cycles: number;
36
+ /** The last, longer extension after cycling ends. */
37
+ final: {
38
+ celsius: number;
39
+ seconds: number;
40
+ };
41
+ }
42
+ /** What the tool knows of a reaction when it suggests or checks a programme. */
43
+ export interface PcrReaction {
44
+ /** How long the product is, in bases. */
45
+ length: number;
46
+ /** Each primer's name and rough melting temperature, in degrees Celsius. */
47
+ primers: {
48
+ name: string;
49
+ tm: number;
50
+ }[];
51
+ }
52
+ /** How long a polymerase is usually given: a minute for every thousand bases. */
53
+ export declare const SECONDS_PER_KB = 60;
54
+ /**
55
+ * A programme that suits a reaction, to start from.
56
+ *
57
+ * The annealing step is five degrees under the cooler primer, and the extension allows a minute for
58
+ * every thousand bases. Both are conventions, and the operator may know better.
59
+ *
60
+ * @param reaction - The product's length and the primers' melting temperatures.
61
+ * @returns The programme.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * import { suggestProgramme } from "@biolibs/bionet-tools";
66
+ *
67
+ * const programme = suggestProgramme({ length: 1500, primers: [{ name: "fwd", tm: 60 }, { name: "rev", tm: 58 }] });
68
+ * programme.steps[1]; // { name: "anneal", celsius: 53, seconds: 30 }
69
+ * programme.steps[2]; // { name: "extend", celsius: 72, seconds: 90 }
70
+ * ```
71
+ */
72
+ export declare function suggestProgramme(reaction: PcrReaction): PcrProgramme;
73
+ /** One line of a thermocycler's screen. */
74
+ export interface ScreenLine {
75
+ /** What it says. */
76
+ text: string;
77
+ /** The step of the cycle it is, if it is one. */
78
+ step?: PcrStepName;
79
+ }
80
+ /**
81
+ * A programme as a thermocycler's screen shows it.
82
+ *
83
+ * @param programme - The programme.
84
+ * @returns The lines, top to bottom.
85
+ */
86
+ export declare function screenOf(programme: PcrProgramme): ScreenLine[];
87
+ /**
88
+ * How long a programme takes, not counting the time the block spends changing temperature.
89
+ *
90
+ * @param programme - The programme.
91
+ * @returns Seconds.
92
+ */
93
+ export declare function runSeconds(programme: PcrProgramme): number;
94
+ /** Something a careful operator would stop and ask about a programme. */
95
+ export interface PcrCheck {
96
+ /** The part of the programme it is about. */
97
+ about: PcrStepName | "cycles";
98
+ /** `stop` if the run is unlikely to work as set, `look` if it is only worth a second glance. */
99
+ weight: "stop" | "look";
100
+ /** What to ask, said for a person. */
101
+ says: string;
102
+ }
103
+ /**
104
+ * What a careful operator would ask of a programme, given the reaction it is for.
105
+ *
106
+ * Each is about this run and may be wrong: an operator who knows their polymerase extends at fifteen
107
+ * seconds a thousand bases can ignore what is said about extension. None of them stops a run.
108
+ *
109
+ * @param programme - The programme as set.
110
+ * @param reaction - The product's length and the primers' melting temperatures.
111
+ * @returns The checks that apply, the ones most likely to matter first.
112
+ */
113
+ export declare function programmeChecks(programme: PcrProgramme, reaction: PcrReaction): PcrCheck[];
114
+ /** Where a primer binds a template. Positions count bases from the start of the template's top strand. */
115
+ export interface Binding {
116
+ /** The first base it covers. */
117
+ start: number;
118
+ /** One past the last base it covers. */
119
+ end: number;
120
+ /** `top` if it has the top strand's sequence, and so binds the bottom strand and is copied rightwards; `bottom` the other way. */
121
+ reads: "top" | "bottom";
122
+ /** How many bases at its 5′ end do not bind: a tail it carries onto the product. */
123
+ tail: number;
124
+ }
125
+ /**
126
+ * Where one primer binds a template, if it does.
127
+ *
128
+ * It is looked for by the bases at its 3′ end, which are the ones that have to match, on either
129
+ * strand. Its match is then followed back towards its 5′ end for as long as it holds.
130
+ *
131
+ * @param template - The template's top strand.
132
+ * @param primer - The primer, 5′ to 3′.
133
+ * @param least - How many bases at its 3′ end must match.
134
+ * @returns Where it binds, or `null` if it does not or binds in more than one place.
135
+ */
136
+ export declare function primerBinding(template: string, primer: string, least?: number): Binding | null;
137
+ /** One line drawn in the tube: a strand, or a primer on one. */
138
+ export interface TubeStrand {
139
+ /** Where it starts and ends, in bases along the template. */
140
+ from: number;
141
+ to: number;
142
+ /** Which of the four rows it is drawn on, from the top: 0 and 3 are the template's strands, 1 and 2 what lies between them. */
143
+ row: 0 | 1 | 2 | 3;
144
+ /** What it is. */
145
+ kind: "template" | "primer" | "growing" | "long" | "product";
146
+ /** Whether its 3′ end is at `to` (it points right) or at `from`. */
147
+ points: "right" | "left";
148
+ /**
149
+ * What it does during the step, if it does anything: `parts` from the strand it was paired with,
150
+ * `lands` on the strand it matches, or `grows` from its primer towards its 3′ end.
151
+ */
152
+ moves?: "parts" | "lands" | "grows";
153
+ }
154
+ /** What is in the tube at one step of one cycle. */
155
+ export interface TubeView {
156
+ /** What to draw. */
157
+ strands: TubeStrand[];
158
+ /** How many strands of each kind there are after this cycle, starting from one double-stranded template. */
159
+ counts: {
160
+ template: number;
161
+ long: number;
162
+ product: number;
163
+ };
164
+ /** What is happening, in a sentence. */
165
+ says: string;
166
+ }
167
+ /**
168
+ * How many strands of each kind a tube holds after some cycles, from one double-stranded template.
169
+ *
170
+ * The template's two strands are never made more of. Each cycle copies them once more into strands
171
+ * that start at a primer and run on past the other one: there are two more of those every cycle.
172
+ * Everything else is the product, cut to length at both ends, and it doubles.
173
+ *
174
+ * @param cycles - How many cycles have finished.
175
+ * @returns The counts. They add up to twice two to the power of the cycles.
176
+ */
177
+ export declare function strandCounts(cycles: number): {
178
+ template: number;
179
+ long: number;
180
+ product: number;
181
+ };
182
+ /**
183
+ * What is in the tube at one step of one cycle.
184
+ *
185
+ * It draws the one thing each early cycle adds, since that is what is hard to picture: the first
186
+ * cycle makes strands that run on past the far primer, the second makes the first strands of exactly
187
+ * the product's length, and from the third the product is double-stranded and takes over.
188
+ *
189
+ * @param length - How long the template is, in bases.
190
+ * @param forward - Where the primer that reads as the top strand binds.
191
+ * @param reverse - Where the primer that reads as the bottom strand binds.
192
+ * @param step - Which step of the cycle.
193
+ * @param cycle - Which cycle, counting from 1.
194
+ * @returns What to draw, how many strands of each kind there are once the cycle ends, and a sentence.
195
+ */
196
+ export declare function tubeView(length: number, forward: Binding, reverse: Binding, step: PcrStepName, cycle: number): TubeView;
197
+ /** One base in the magnified view, and what it is doing. */
198
+ export interface LensCell {
199
+ /** The base, or `""` where the strand has none at this place. */
200
+ base: string;
201
+ /** `paired` with the base opposite, `single`, or `fresh`: just added by the polymerase, and paired. */
202
+ state: "paired" | "single" | "fresh";
203
+ }
204
+ /** The real bases around one primer's site, at one moment of one step. */
205
+ export interface TubeLens {
206
+ /** The stretch of the template it shows, in bases from the start of the top strand. */
207
+ from: number;
208
+ to: number;
209
+ /** The upper strand, written 5′ to 3′ from the left, one cell for each place on the template. */
210
+ upper: {
211
+ label: string;
212
+ cells: LensCell[];
213
+ };
214
+ /** The lower strand, written 3′ to 5′ from the left, so that each base is under the one it pairs with. */
215
+ lower: {
216
+ label: string;
217
+ cells: LensCell[];
218
+ };
219
+ /** For each place, whether the base above is paired with the base below. */
220
+ joined: boolean[];
221
+ /** The place the polymerase is at, counted from the left of the view, if it is copying. */
222
+ polymerase: number | null;
223
+ /** How many more bases the copy has to go beyond what is shown, when it is being made. */
224
+ beyond: number;
225
+ }
226
+ /**
227
+ * The real bases at a primer's site, at one moment of one step.
228
+ *
229
+ * The strands in the tube are thousands of bases long and are drawn as lines. This is the same
230
+ * moment magnified at the one place worth reading: where a primer binds. Heat unzips the template
231
+ * there base by base; the primer lands and pairs, A with T and G with C, leaving any tail it carries
232
+ * unpaired; and the polymerase adds the next bases one at a time, each the partner of the base
233
+ * opposite. Every letter is from the lab's own sequences.
234
+ *
235
+ * @param template - The template's top strand.
236
+ * @param primer - The primer, 5′ to 3′.
237
+ * @param binding - Where it binds, from `primerBinding`.
238
+ * @param step - Which step of the cycle.
239
+ * @param through - How far through the step it is, from 0 to 1.
240
+ * @param names - What to call the primer and the template.
241
+ * @returns The two rows of bases, which are paired, and where the polymerase is.
242
+ */
243
+ export declare function tubeLens(template: string, primer: string, binding: Binding, step: PcrStepName, through: number, names?: {
244
+ primer?: string;
245
+ template?: string;
246
+ }): TubeLens;
247
+ //# sourceMappingURL=pcr-scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pcr-scene.d.ts","sourceRoot":"","sources":["../src/pcr-scene.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,qCAAqC;AACrC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,0DAA0D;AAC1D,MAAM,WAAW,OAAO;IACtB,wBAAwB;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,M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