@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.
- package/README.md +104 -2
- package/dist/digest-tool.d.ts +30 -0
- package/dist/digest-tool.d.ts.map +1 -0
- package/dist/digest-tool.js +84 -0
- package/dist/digest-tool.js.map +1 -0
- package/dist/digest.d.ts +94 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +115 -0
- package/dist/digest.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/pcr-bench.d.ts +94 -0
- package/dist/pcr-bench.d.ts.map +1 -0
- package/dist/pcr-bench.js +187 -0
- package/dist/pcr-bench.js.map +1 -0
- package/dist/pcr-scene.d.ts +247 -0
- package/dist/pcr-scene.d.ts.map +1 -0
- package/dist/pcr-scene.js +287 -0
- package/dist/pcr-scene.js.map +1 -0
- package/dist/pcr-tool.d.ts +18 -0
- package/dist/pcr-tool.d.ts.map +1 -0
- package/dist/pcr-tool.js +73 -0
- package/dist/pcr-tool.js.map +1 -0
- package/dist/pcr.d.ts +59 -0
- package/dist/pcr.d.ts.map +1 -0
- package/dist/pcr.js +79 -0
- package/dist/pcr.js.map +1 -0
- package/dist/run.d.ts +161 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +143 -0
- package/dist/run.js.map +1 -0
- package/dist/tools.d.ts +27 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +45 -0
- package/dist/tools.js.map +1 -0
- package/package.json +61 -4
- package/src/digest-tool.tsx +199 -0
- package/src/digest.ts +136 -0
- package/src/index.ts +28 -0
- package/src/pcr-bench.tsx +350 -0
- package/src/pcr-scene.ts +408 -0
- package/src/pcr-tool.tsx +160 -0
- package/src/pcr.ts +87 -0
- package/src/run.ts +234 -0
- package/src/tools.tsx +64 -0
- package/tools.css +50 -0
|
@@ -0,0 +1,287 @@
|
|
|
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
|
+
const clamp = (value, least, most) => Math.min(Math.max(value, least), most);
|
|
15
|
+
/** How long a polymerase is usually given: a minute for every thousand bases. */
|
|
16
|
+
export const SECONDS_PER_KB = 60;
|
|
17
|
+
/**
|
|
18
|
+
* A programme that suits a reaction, to start from.
|
|
19
|
+
*
|
|
20
|
+
* The annealing step is five degrees under the cooler primer, and the extension allows a minute for
|
|
21
|
+
* every thousand bases. Both are conventions, and the operator may know better.
|
|
22
|
+
*
|
|
23
|
+
* @param reaction - The product's length and the primers' melting temperatures.
|
|
24
|
+
* @returns The programme.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { suggestProgramme } from "@biolibs/bionet-tools";
|
|
29
|
+
*
|
|
30
|
+
* const programme = suggestProgramme({ length: 1500, primers: [{ name: "fwd", tm: 60 }, { name: "rev", tm: 58 }] });
|
|
31
|
+
* programme.steps[1]; // { name: "anneal", celsius: 53, seconds: 30 }
|
|
32
|
+
* programme.steps[2]; // { name: "extend", celsius: 72, seconds: 90 }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function suggestProgramme(reaction) {
|
|
36
|
+
const coolest = reaction.primers.length === 0 ? 60 : Math.min(...reaction.primers.map((one) => one.tm));
|
|
37
|
+
const extend = Math.max(15, Math.ceil(((reaction.length / 1000) * SECONDS_PER_KB) / 5) * 5);
|
|
38
|
+
return {
|
|
39
|
+
initial: { celsius: 95, seconds: 120 },
|
|
40
|
+
steps: [
|
|
41
|
+
{ name: "denature", celsius: 95, seconds: 30 },
|
|
42
|
+
{ name: "anneal", celsius: clamp(Math.round(coolest) - 5, 45, 72), seconds: 30 },
|
|
43
|
+
{ name: "extend", celsius: 72, seconds: extend },
|
|
44
|
+
],
|
|
45
|
+
cycles: 30,
|
|
46
|
+
final: { celsius: 72, seconds: 300 },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** A length of time as a machine writes it: minutes and seconds. */
|
|
50
|
+
const clock = (seconds) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
|
|
51
|
+
/**
|
|
52
|
+
* A programme as a thermocycler's screen shows it.
|
|
53
|
+
*
|
|
54
|
+
* @param programme - The programme.
|
|
55
|
+
* @returns The lines, top to bottom.
|
|
56
|
+
*/
|
|
57
|
+
export function screenOf(programme) {
|
|
58
|
+
const row = (label, at) => `${label.padEnd(9)}${String(at.celsius).padStart(3)} °C ${clock(at.seconds).padStart(5)}`;
|
|
59
|
+
return [
|
|
60
|
+
{ text: row("Start", programme.initial) },
|
|
61
|
+
{ text: `${programme.cycles} cycles of` },
|
|
62
|
+
...programme.steps.map((step) => ({ text: row(` ${step.name[0].toUpperCase()}${step.name.slice(1)}`, step), step: step.name })),
|
|
63
|
+
{ text: row("Finish", programme.final) },
|
|
64
|
+
{ text: `About ${clock(runSeconds(programme))} in all` },
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* How long a programme takes, not counting the time the block spends changing temperature.
|
|
69
|
+
*
|
|
70
|
+
* @param programme - The programme.
|
|
71
|
+
* @returns Seconds.
|
|
72
|
+
*/
|
|
73
|
+
export function runSeconds(programme) {
|
|
74
|
+
return programme.initial.seconds + programme.cycles * programme.steps.reduce((sum, step) => sum + step.seconds, 0) + programme.final.seconds;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* What a careful operator would ask of a programme, given the reaction it is for.
|
|
78
|
+
*
|
|
79
|
+
* Each is about this run and may be wrong: an operator who knows their polymerase extends at fifteen
|
|
80
|
+
* seconds a thousand bases can ignore what is said about extension. None of them stops a run.
|
|
81
|
+
*
|
|
82
|
+
* @param programme - The programme as set.
|
|
83
|
+
* @param reaction - The product's length and the primers' melting temperatures.
|
|
84
|
+
* @returns The checks that apply, the ones most likely to matter first.
|
|
85
|
+
*/
|
|
86
|
+
export function programmeChecks(programme, reaction) {
|
|
87
|
+
const checks = [];
|
|
88
|
+
const [denature, anneal, extend] = programme.steps;
|
|
89
|
+
const sorted = [...reaction.primers].sort((a, b) => a.tm - b.tm);
|
|
90
|
+
const coolest = sorted[0];
|
|
91
|
+
const warmest = sorted.at(-1);
|
|
92
|
+
if (coolest !== undefined && anneal.celsius > coolest.tm) {
|
|
93
|
+
checks.push({ about: "anneal", weight: "stop", says: `Annealing at ${anneal.celsius} °C is above ${coolest.name}'s melting temperature, about ${Math.round(coolest.tm)} °C. It may not bind.` });
|
|
94
|
+
}
|
|
95
|
+
else if (coolest !== undefined && anneal.celsius < coolest.tm - 10) {
|
|
96
|
+
checks.push({ about: "anneal", weight: "look", says: `Annealing at ${anneal.celsius} °C is more than ten degrees under the primers' melting temperatures. They may bind in places they should not.` });
|
|
97
|
+
}
|
|
98
|
+
if (coolest !== undefined && warmest !== undefined && warmest.tm - coolest.tm > 5) {
|
|
99
|
+
checks.push({ about: "anneal", weight: "look", says: `${warmest.name} melts about ${Math.round(warmest.tm - coolest.tm)} degrees above ${coolest.name}. No one annealing temperature suits both well.` });
|
|
100
|
+
}
|
|
101
|
+
const wanted = (reaction.length / 1000) * SECONDS_PER_KB;
|
|
102
|
+
if (extend.seconds < wanted / 2) {
|
|
103
|
+
checks.push({ about: "extend", weight: "stop", says: `${extend.seconds} seconds is short for a ${reaction.length.toLocaleString("en-US")} base product. Allow about a minute for every thousand bases unless the polymerase is a fast one.` });
|
|
104
|
+
}
|
|
105
|
+
else if (extend.seconds < wanted) {
|
|
106
|
+
checks.push({ about: "extend", weight: "look", says: `${extend.seconds} seconds is under a minute per thousand bases for a ${reaction.length.toLocaleString("en-US")} base product. Fine for a fast polymerase.` });
|
|
107
|
+
}
|
|
108
|
+
if (denature.celsius < 90)
|
|
109
|
+
checks.push({ about: "denature", weight: "stop", says: `${denature.celsius} °C may not separate the strands. It is usually 94 to 98 °C.` });
|
|
110
|
+
if (programme.cycles > 40)
|
|
111
|
+
checks.push({ about: "cycles", weight: "look", says: `${programme.cycles} cycles is a lot. Past about 35, wrong products build up faster than the right one.` });
|
|
112
|
+
if (programme.cycles < 15)
|
|
113
|
+
checks.push({ about: "cycles", weight: "look", says: `${programme.cycles} cycles may not make enough to see on a gel.` });
|
|
114
|
+
return checks.sort((a, b) => Number(b.weight === "stop") - Number(a.weight === "stop"));
|
|
115
|
+
}
|
|
116
|
+
const PAIR = { A: "T", T: "A", G: "C", C: "G", U: "A", N: "N" };
|
|
117
|
+
const reversed = (bases) => [...bases].reverse().map((base) => PAIR[base] ?? "N").join("");
|
|
118
|
+
/**
|
|
119
|
+
* Where one primer binds a template, if it does.
|
|
120
|
+
*
|
|
121
|
+
* It is looked for by the bases at its 3′ end, which are the ones that have to match, on either
|
|
122
|
+
* strand. Its match is then followed back towards its 5′ end for as long as it holds.
|
|
123
|
+
*
|
|
124
|
+
* @param template - The template's top strand.
|
|
125
|
+
* @param primer - The primer, 5′ to 3′.
|
|
126
|
+
* @param least - How many bases at its 3′ end must match.
|
|
127
|
+
* @returns Where it binds, or `null` if it does not or binds in more than one place.
|
|
128
|
+
*/
|
|
129
|
+
export function primerBinding(template, primer, least = 18) {
|
|
130
|
+
const top = template.replace(/\s+/g, "").toUpperCase();
|
|
131
|
+
const bases = primer.replace(/\s+/g, "").toUpperCase();
|
|
132
|
+
if (bases.length < least || least < 1)
|
|
133
|
+
return null;
|
|
134
|
+
const found = [];
|
|
135
|
+
// Reading as the top strand: its 3′ end is its right-hand end.
|
|
136
|
+
const end3 = bases.slice(-least);
|
|
137
|
+
for (let at = top.indexOf(end3); at !== -1; at = top.indexOf(end3, at + 1)) {
|
|
138
|
+
let matched = least;
|
|
139
|
+
while (matched < bases.length && at - (matched - least) - 1 >= 0 && top[at - (matched - least) - 1] === bases[bases.length - matched - 1])
|
|
140
|
+
matched++;
|
|
141
|
+
found.push({ start: at - (matched - least), end: at + least, reads: "top", tail: bases.length - matched });
|
|
142
|
+
}
|
|
143
|
+
// Reading as the bottom strand: reversed, its 3′ end is its left-hand end.
|
|
144
|
+
const flipped = reversed(bases);
|
|
145
|
+
const start3 = flipped.slice(0, least);
|
|
146
|
+
for (let at = top.indexOf(start3); at !== -1; at = top.indexOf(start3, at + 1)) {
|
|
147
|
+
let matched = least;
|
|
148
|
+
while (matched < flipped.length && at + matched < top.length && top[at + matched] === flipped[matched])
|
|
149
|
+
matched++;
|
|
150
|
+
found.push({ start: at, end: at + matched, reads: "bottom", tail: bases.length - matched });
|
|
151
|
+
}
|
|
152
|
+
return found.length === 1 ? found[0] : null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* How many strands of each kind a tube holds after some cycles, from one double-stranded template.
|
|
156
|
+
*
|
|
157
|
+
* The template's two strands are never made more of. Each cycle copies them once more into strands
|
|
158
|
+
* that start at a primer and run on past the other one: there are two more of those every cycle.
|
|
159
|
+
* Everything else is the product, cut to length at both ends, and it doubles.
|
|
160
|
+
*
|
|
161
|
+
* @param cycles - How many cycles have finished.
|
|
162
|
+
* @returns The counts. They add up to twice two to the power of the cycles.
|
|
163
|
+
*/
|
|
164
|
+
export function strandCounts(cycles) {
|
|
165
|
+
const done = Math.max(0, Math.floor(cycles));
|
|
166
|
+
return { template: 2, long: 2 * done, product: Math.max(0, 2 ** (done + 1) - 2 * done - 2) };
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* What is in the tube at one step of one cycle.
|
|
170
|
+
*
|
|
171
|
+
* It draws the one thing each early cycle adds, since that is what is hard to picture: the first
|
|
172
|
+
* cycle makes strands that run on past the far primer, the second makes the first strands of exactly
|
|
173
|
+
* the product's length, and from the third the product is double-stranded and takes over.
|
|
174
|
+
*
|
|
175
|
+
* @param length - How long the template is, in bases.
|
|
176
|
+
* @param forward - Where the primer that reads as the top strand binds.
|
|
177
|
+
* @param reverse - Where the primer that reads as the bottom strand binds.
|
|
178
|
+
* @param step - Which step of the cycle.
|
|
179
|
+
* @param cycle - Which cycle, counting from 1.
|
|
180
|
+
* @returns What to draw, how many strands of each kind there are once the cycle ends, and a sentence.
|
|
181
|
+
*/
|
|
182
|
+
export function tubeView(length, forward, reverse, step, cycle) {
|
|
183
|
+
const at = Math.max(1, Math.floor(cycle));
|
|
184
|
+
const template = [
|
|
185
|
+
{ from: 0, to: length, row: 0, kind: "template", points: "right" },
|
|
186
|
+
{ from: 0, to: length, row: 3, kind: "template", points: "left" },
|
|
187
|
+
];
|
|
188
|
+
const primers = [
|
|
189
|
+
{ from: reverse.start, to: reverse.end, row: 1, kind: "primer", points: "left" },
|
|
190
|
+
{ from: forward.start, to: forward.end, row: 2, kind: "primer", points: "right" },
|
|
191
|
+
];
|
|
192
|
+
// What each strand is copied into depends on what it is copied from, which changes over the first cycles.
|
|
193
|
+
const made = (kind) => (at === 1
|
|
194
|
+
? [{ from: 0, to: reverse.end, row: 1, kind, points: "left" }, { from: forward.start, to: length, row: 2, kind, points: "right" }]
|
|
195
|
+
: [{ from: forward.start, to: reverse.end, row: 1, kind, points: "left" }, { from: forward.start, to: reverse.end, row: 2, kind, points: "right" }]);
|
|
196
|
+
const templates = at === 1 ? template
|
|
197
|
+
: at === 2 ? [{ from: forward.start, to: length, row: 0, kind: "long", points: "right" }, { from: 0, to: reverse.end, row: 3, kind: "long", points: "left" }]
|
|
198
|
+
: [{ from: forward.start, to: reverse.end, row: 0, kind: "product", points: "right" }, { from: forward.start, to: reverse.end, row: 3, kind: "product", points: "left" }];
|
|
199
|
+
const counts = strandCounts(step === "extend" ? at : at - 1);
|
|
200
|
+
if (step === "denature") {
|
|
201
|
+
return { strands: templates.map((one) => ({ ...one, moves: "parts" })), counts, says: at === 1
|
|
202
|
+
? "Heat pulls the template's two strands apart. Nothing can be copied until they are single."
|
|
203
|
+
: at === 2 ? "The strands made in the first cycle part from the template. Each starts at a primer and runs on past the other."
|
|
204
|
+
: "Every double strand parts, including the product made so far." };
|
|
205
|
+
}
|
|
206
|
+
if (step === "anneal") {
|
|
207
|
+
return { strands: [...templates, ...primers.map((one) => ({ ...one, moves: "lands" }))], counts, says: "Cooler, the primers find the one place each matches and bind. A primer always points along the strand towards the other primer." };
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
strands: [...templates, ...made(at === 1 ? "long" : "product").map((one) => ({ ...one, moves: "grows" }))], counts,
|
|
211
|
+
says: at === 1 ? "The polymerase copies from each primer to the end of the template. These first copies start in the right place and run on too far."
|
|
212
|
+
: at === 2 ? "Copied from a strand that already starts at a primer, the new strand stops where that one began. These are the first strands of exactly the product's length."
|
|
213
|
+
: "From the third cycle the product is copied from the product. It doubles each cycle, and the over-long strands are left behind.",
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* The real bases at a primer's site, at one moment of one step.
|
|
218
|
+
*
|
|
219
|
+
* The strands in the tube are thousands of bases long and are drawn as lines. This is the same
|
|
220
|
+
* moment magnified at the one place worth reading: where a primer binds. Heat unzips the template
|
|
221
|
+
* there base by base; the primer lands and pairs, A with T and G with C, leaving any tail it carries
|
|
222
|
+
* unpaired; and the polymerase adds the next bases one at a time, each the partner of the base
|
|
223
|
+
* opposite. Every letter is from the lab's own sequences.
|
|
224
|
+
*
|
|
225
|
+
* @param template - The template's top strand.
|
|
226
|
+
* @param primer - The primer, 5′ to 3′.
|
|
227
|
+
* @param binding - Where it binds, from `primerBinding`.
|
|
228
|
+
* @param step - Which step of the cycle.
|
|
229
|
+
* @param through - How far through the step it is, from 0 to 1.
|
|
230
|
+
* @param names - What to call the primer and the template.
|
|
231
|
+
* @returns The two rows of bases, which are paired, and where the polymerase is.
|
|
232
|
+
*/
|
|
233
|
+
export function tubeLens(template, primer, binding, step, through, names = {}) {
|
|
234
|
+
const top = template.replace(/\s+/g, "").toUpperCase();
|
|
235
|
+
const bases = primer.replace(/\s+/g, "").toUpperCase();
|
|
236
|
+
const at = Math.min(Math.max(through, 0), 1);
|
|
237
|
+
const rightward = binding.reads === "top";
|
|
238
|
+
const [ahead, behind] = [22, 3];
|
|
239
|
+
// Room for the primer and its tail, a little behind it, and the first bases copied ahead of it.
|
|
240
|
+
const from = Math.max(0, rightward ? binding.start - binding.tail - behind : binding.start - ahead);
|
|
241
|
+
const to = Math.min(top.length, rightward ? binding.end + ahead : binding.end + binding.tail + behind);
|
|
242
|
+
const places = Array.from({ length: to - from }, (_, index) => from + index);
|
|
243
|
+
const templateName = names.template ?? "template";
|
|
244
|
+
const primerName = names.primer ?? "primer";
|
|
245
|
+
if (step === "denature") {
|
|
246
|
+
// The two strands come apart from one end of the view to the other.
|
|
247
|
+
const joined = places.map((_, index) => (index + 0.5) / places.length > at * 1.2);
|
|
248
|
+
const cell = (base, index) => ({ base, state: joined[index] ? "paired" : "single" });
|
|
249
|
+
return {
|
|
250
|
+
from, to, joined, polymerase: null, beyond: 0,
|
|
251
|
+
upper: { label: `${templateName}, top strand`, cells: places.map((place, index) => cell(top[place], index)) },
|
|
252
|
+
lower: { label: `${templateName}, bottom strand`, cells: places.map((place, index) => cell(PAIR[top[place]] ?? "N", index)) },
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
// The primer, laid where it binds: left to right 5′→3′ if it reads as the top strand, 3′→5′ if not.
|
|
256
|
+
const laid = rightward ? bases : [...bases].reverse().join("");
|
|
257
|
+
const first = rightward ? binding.start - binding.tail : binding.start;
|
|
258
|
+
const primerBase = (place) => (place >= first && place < first + laid.length ? laid[place - first] : "");
|
|
259
|
+
const binds = (place) => place >= binding.start && place < binding.end;
|
|
260
|
+
const width = binding.end - binding.start;
|
|
261
|
+
// Pairs form along the primer from its 5′ end to its 3′ end, in the second half of the step.
|
|
262
|
+
const zipped = (place) => {
|
|
263
|
+
const along = rightward ? place - binding.start : binding.end - 1 - place;
|
|
264
|
+
return step === "extend" || (along + 0.5) / width < (at - 0.45) / 0.5;
|
|
265
|
+
};
|
|
266
|
+
// How many bases the polymerase has added, of those the view has room for.
|
|
267
|
+
const room = rightward ? to - binding.end : binding.start - from;
|
|
268
|
+
const added = step === "extend" ? Math.min(room, Math.floor(at * (room + 1))) : 0;
|
|
269
|
+
const copied = (place) => (rightward ? place >= binding.end && place < binding.end + added : place < binding.start && place >= binding.start - added);
|
|
270
|
+
const joined = places.map((place) => (binds(place) && zipped(place)) || copied(place));
|
|
271
|
+
const strand = places.map((place, index) => {
|
|
272
|
+
if (copied(place))
|
|
273
|
+
return { base: rightward ? top[place] : PAIR[top[place]] ?? "N", state: "fresh" };
|
|
274
|
+
const base = primerBase(place);
|
|
275
|
+
return { base, state: base !== "" && joined[index] ? "paired" : "single" };
|
|
276
|
+
});
|
|
277
|
+
const other = places.map((place, index) => ({ base: rightward ? PAIR[top[place]] ?? "N" : top[place], state: joined[index] ? "paired" : "single" }));
|
|
278
|
+
const length = rightward ? top.length - binding.end : binding.start;
|
|
279
|
+
return {
|
|
280
|
+
from, to, joined,
|
|
281
|
+
polymerase: step === "extend" && added < room ? (rightward ? binding.end + added : binding.start - added - 1) - from : null,
|
|
282
|
+
beyond: step === "extend" ? Math.max(0, length - added) : 0,
|
|
283
|
+
upper: rightward ? { label: step === "extend" ? `${primerName}, and the copy` : primerName, cells: strand } : { label: `${templateName}, top strand`, cells: other },
|
|
284
|
+
lower: rightward ? { label: `${templateName}, bottom strand`, cells: other } : { label: step === "extend" ? `${primerName}, and the copy` : primerName, cells: strand },
|
|
285
|
+
};
|
|
286
|
+
}
|
|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K,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,UAAU,gBAAgB,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE;KACxK,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run a PCR in silico from tubes the lab holds, and record it.
|
|
3
|
+
*
|
|
4
|
+
* Choose a template and two primers. If they make one product it is shown, and the run can be
|
|
5
|
+
* recorded: each tube drops by what was used and the product becomes a new tube. A run that gave
|
|
6
|
+
* nothing at the bench can be recorded too, since the tubes were used all the same.
|
|
7
|
+
*
|
|
8
|
+
* @param props - `instrument` is the thermocycler it is run on, if the lab has one; `onDone` adds a
|
|
9
|
+
* way to leave.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PcrTool({ instrument, onDone }: {
|
|
12
|
+
instrument?: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
} | null;
|
|
16
|
+
onDone?: () => void;
|
|
17
|
+
}): import("react").JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=pcr-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcr-tool.d.ts","sourceRoot":"","sources":["../src/pcr-tool.tsx"],"names":[],"mappings":"AAsCA;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,EAAE,UAAiB,EAAE,MAAM,EAAE,EAAE;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;CAAE,sCA+G/H"}
|
package/dist/pcr-tool.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Running a PCR from the freezer.
|
|
5
|
+
*
|
|
6
|
+
* It holds only what has been chosen. The tubes come from the lab, what the PCR would make comes
|
|
7
|
+
* from `planPcr`, and recording it is one thing asked of the lab. It is drawn with the panels'
|
|
8
|
+
* styles, so it belongs inside a `LabWindow`.
|
|
9
|
+
*/
|
|
10
|
+
import { useMemo, useState } from "react";
|
|
11
|
+
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
12
|
+
import { Glossed } from "@biolibs/glossary-react";
|
|
13
|
+
import { primerTm } from "./pcr.js";
|
|
14
|
+
import { pcrRun, pcrTubes } from "./run.js";
|
|
15
|
+
const whole = (text) => (text.trim() === "" ? undefined : Number(text));
|
|
16
|
+
function Tube({ label, name, choices, value, onChange, used, onUsed }) {
|
|
17
|
+
const chosen = choices.find((one) => one.item === value);
|
|
18
|
+
const tm = chosen !== undefined && name !== "template" ? primerTm(chosen.part.sequence) : null;
|
|
19
|
+
return (_jsxs("div", { className: "tube", children: [_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))] })] }), _jsxs("label", { className: "used", children: ["used", _jsx("input", { type: "number", min: 0, step: 1, value: used, onChange: (event) => onUsed(event.target.value), "aria-label": `${label}, amount used` })] }), chosen !== undefined && (_jsxs("p", { className: "dim small", children: [chosen.part.length, " ", chosen.part.length === 1 ? "base" : "bases", chosen.part.circular ? " · circular" : "", tm === null ? "" : ` · about ${Math.round(tm)} °C`] }))] }));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Run a PCR in silico from tubes the lab holds, and record it.
|
|
23
|
+
*
|
|
24
|
+
* Choose a template and two primers. If they make one product it is shown, and the run can be
|
|
25
|
+
* recorded: each tube drops by what was used and the product becomes a new tube. A run that gave
|
|
26
|
+
* nothing at the bench can be recorded too, since the tubes were used all the same.
|
|
27
|
+
*
|
|
28
|
+
* @param props - `instrument` is the thermocycler it is run on, if the lab has one; `onDone` adds a
|
|
29
|
+
* way to leave.
|
|
30
|
+
*/
|
|
31
|
+
export function PcrTool({ instrument = null, onDone }) {
|
|
32
|
+
const lab = useLab()?.lab;
|
|
33
|
+
const act = useAct();
|
|
34
|
+
const [template, setTemplate] = useState("");
|
|
35
|
+
const [forward, setForward] = useState("");
|
|
36
|
+
const [reverse, setReverse] = useState("");
|
|
37
|
+
const [used, setUsed] = useState({ template: "1", forward: "1", reverse: "1" });
|
|
38
|
+
const [least, setLeast] = useState("18");
|
|
39
|
+
const [name, setName] = useState("");
|
|
40
|
+
const [amount, setAmount] = useState("50");
|
|
41
|
+
const [unit, setUnit] = useState("µL");
|
|
42
|
+
const [note, setNote] = useState("");
|
|
43
|
+
const [busy, setBusy] = useState(false);
|
|
44
|
+
const [said, setSaid] = useState(null);
|
|
45
|
+
const tubes = useMemo(() => (lab === null || lab === undefined ? { templates: [], primers: [] } : pcrTubes(lab)), [lab]);
|
|
46
|
+
const run = useMemo(() => (lab === null || lab === undefined ? null : pcrRun(lab, {
|
|
47
|
+
template, forward, reverse, instrument: instrument?.id ?? null, name, note,
|
|
48
|
+
used: { template: whole(used.template), forward: whole(used.forward), reverse: whole(used.reverse) },
|
|
49
|
+
annealAtLeast: whole(least), amount: whole(amount), unit: unit.trim() === "" ? null : unit.trim(),
|
|
50
|
+
})), [lab, template, forward, reverse, instrument, name, note, used, least, amount, unit]);
|
|
51
|
+
if (lab === null || lab === undefined || run === null)
|
|
52
|
+
return null;
|
|
53
|
+
const record = async (what, done) => {
|
|
54
|
+
if (what === null)
|
|
55
|
+
return;
|
|
56
|
+
setBusy(true);
|
|
57
|
+
const answer = await act("recordRun", what);
|
|
58
|
+
setBusy(false);
|
|
59
|
+
if (!answer.ok)
|
|
60
|
+
return;
|
|
61
|
+
setSaid(done);
|
|
62
|
+
setName("");
|
|
63
|
+
setNote("");
|
|
64
|
+
};
|
|
65
|
+
const product = run.plan !== null && run.plan.problem === null ? run.plan.products[0] : null;
|
|
66
|
+
const here = lab.runs.filter((one) => one.kind === "pcr" && (instrument === null || one.instrument === instrument.id)).slice(-5).reverse();
|
|
67
|
+
const partName = (checksum) => lab.parts.find((part) => part.checksum === checksum)?.name ?? "a part";
|
|
68
|
+
return (_jsxs("div", { className: "pcr", children: [_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsxs("div", { children: [_jsxs("h2", { children: ["PCR", instrument === null ? "" : ` · ${instrument.name}`] }), _jsx("p", { className: "dim small", children: _jsx(Glossed, { text: "PCR copies the stretch of a template that lies between two primers. Choose tubes from the freezer. The product is worked out from their sequences, and recording the run takes what was used from each." }) })] }), 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: "choose", children: [_jsx(Tube, { label: "Template", name: "template", choices: tubes.templates, value: template, onChange: (item) => { setTemplate(item); setSaid(null); }, used: used.template, onUsed: (value) => setUsed({ ...used, template: value }) }), _jsx(Tube, { label: "Forward primer", name: "forward", choices: tubes.primers, value: forward, onChange: (item) => { setForward(item); setSaid(null); }, used: used.forward, onUsed: (value) => setUsed({ ...used, forward: value }) }), _jsx(Tube, { label: "Reverse primer", name: "reverse", choices: tubes.primers, value: reverse, onChange: (item) => { setReverse(item); setSaid(null); }, used: used.reverse, onUsed: (value) => setUsed({ ...used, reverse: value }) }), _jsxs("label", { className: "least", children: ["Bases at each primer's 3\u2032 end that must bind", _jsx("input", { type: "number", min: 8, max: 60, step: 1, value: least, onChange: (event) => setLeast(event.target.value) })] })] }))] }), run.plan !== null && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "What it makes" }), product === null ? _jsx("p", { className: "trouble", role: "status", children: run.plan.problem }) : (_jsxs(_Fragment, { children: [_jsxs("p", { children: [_jsxs("strong", { children: [product.length, " bp"] }), " ", _jsx("span", { className: "dim", children: "linear" })] }), _jsx("code", { className: "wrap", children: product.length <= 120 ? product.sequence : `${product.sequence.slice(0, 60)} … ${product.sequence.slice(-60)}` })] })), _jsxs("fieldset", { disabled: busy, className: "stack", children: [product !== null && (_jsxs("div", { className: "row tight", 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", _jsx("input", { type: "number", min: 0, step: 1, value: amount, onChange: (event) => setAmount(event.target.value), className: "num" })] }), _jsxs("label", { children: ["Unit", _jsx("input", { value: unit, onChange: (event) => setUnit(event.target.value), maxLength: 20, className: "num" })] })] })), _jsxs("label", { children: ["Note", _jsx("input", { value: note, onChange: (event) => setNote(event.target.value), placeholder: "Anything worth remembering about this run", maxLength: 2000 })] }), _jsxs("div", { className: "row", children: [product !== null && _jsx("button", { type: "button", onClick: () => void record(run.worked, `Recorded. There is a new tube of ${run.name}, not yet put anywhere.`), children: "Record the run" }), _jsx("button", { type: "button", className: "quiet", onClick: () => void record(run.failed, "Recorded as a run that gave nothing. The tubes were used all the same."), children: "It was run and gave nothing" })] })] }), said !== null && _jsx("p", { className: "small", role: "status", children: said })] })), here.length > 0 && (_jsxs("section", { className: "card", children: [_jsxs("h2", { children: ["Recent runs", instrument === null ? "" : " here"] }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Template" }), _jsx("th", { children: "Made" }), _jsx("th", { children: "Note" })] }) }), _jsx("tbody", { children: here.map((one) => {
|
|
69
|
+
const from = lab.items.find((item) => item.item === one.inputs.find((input) => input.role === "template")?.item);
|
|
70
|
+
return (_jsxs("tr", { children: [_jsx("td", { children: from === undefined ? "a tube" : partName(from.part) }), _jsx("td", { children: one.outcome === "worked" ? one.outputs.map((made) => partName(made.part)).join(", ") : _jsx("span", { className: "badge", children: "gave nothing" }) }), _jsx("td", { className: "dim", children: one.note ?? "" })] }, one.run));
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somebody says otherwise. */
|
|
2
|
+
export declare const ANNEAL_AT_LEAST = 18;
|
|
3
|
+
/** The longest a part can be and still be offered first as a primer. */
|
|
4
|
+
export declare const LONGEST_PRIMER = 60;
|
|
5
|
+
/** What a PCR would make. */
|
|
6
|
+
export interface PcrPlan {
|
|
7
|
+
/** Every product the primers would make from the template, shortest first. */
|
|
8
|
+
products: {
|
|
9
|
+
sequence: string;
|
|
10
|
+
length: number;
|
|
11
|
+
}[];
|
|
12
|
+
/** Why there is not exactly one product, said for a person, or `null` if there is. */
|
|
13
|
+
problem: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Whether a part is short enough to be a primer.
|
|
17
|
+
*
|
|
18
|
+
* @param part - Its length and whether it is a circle.
|
|
19
|
+
* @returns Whether to offer it as a primer first. Anything may still be chosen.
|
|
20
|
+
*/
|
|
21
|
+
export declare function looksLikePrimer(part: {
|
|
22
|
+
length: number;
|
|
23
|
+
circular: boolean;
|
|
24
|
+
}): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* A primer's melting temperature by the Wallace rule: 2 °C for each A or T, 4 °C for each G or C.
|
|
27
|
+
*
|
|
28
|
+
* It is the rough figure written on a tube, good for seeing that two primers are near each other.
|
|
29
|
+
*
|
|
30
|
+
* @param sequence - The primer.
|
|
31
|
+
* @returns Degrees Celsius, or `null` if that is not a sequence.
|
|
32
|
+
*/
|
|
33
|
+
export declare function primerTm(sequence: string): number | null;
|
|
34
|
+
/**
|
|
35
|
+
* Work out what a PCR would make.
|
|
36
|
+
*
|
|
37
|
+
* @param template - What is being copied.
|
|
38
|
+
* @param forward - One primer.
|
|
39
|
+
* @param reverse - The other.
|
|
40
|
+
* @param options - `annealAtLeast` is how many bases at each primer's 3′ end must bind.
|
|
41
|
+
* @returns The products, and what is wrong if there is not exactly one.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* import { planPcr } from "@biolibs/bionet-tools";
|
|
46
|
+
*
|
|
47
|
+
* const template = "GGATCACAGTCTACACTGCTCACTCCAACCCCGGCCCCTGAGTCCGAGGAGAGGGTGCTTCAGAGTATGTATACC";
|
|
48
|
+
* const plan = planPcr({ sequence: template, circular: false }, "GGATCACAGTCTACACTG", "GGTATACATACTCTGAAG");
|
|
49
|
+
* plan.problem; // null
|
|
50
|
+
* plan.products[0].length; // 75
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare function planPcr(template: {
|
|
54
|
+
sequence: string;
|
|
55
|
+
circular: boolean;
|
|
56
|
+
}, forward: string, reverse: string, options?: {
|
|
57
|
+
annealAtLeast?: number;
|
|
58
|
+
}): PcrPlan;
|
|
59
|
+
//# sourceMappingURL=pcr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcr.d.ts","sourceRoot":"","sources":["../src/pcr.ts"],"names":[],"mappings":"AAYA,wFAAwF;AACxF,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wEAAwE;AACxE,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,6BAA6B;AAC7B,MAAM,WAAW,OAAO;IACtB,8EAA8E;IAC9E,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,sFAAsF;IACtF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEpF;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAExD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EACnF,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAkBzE"}
|
package/dist/pcr.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A PCR, worked out before it is run.
|
|
3
|
+
*
|
|
4
|
+
* Given a template and two primers this says what would come out, using the same engine the cloning
|
|
5
|
+
* plans use. It decides nothing about the lab: it takes sequences and returns sequences, so the same
|
|
6
|
+
* answer can be shown in a window, checked in a test, or worked out again by somebody who was sent
|
|
7
|
+
* the run.
|
|
8
|
+
*/
|
|
9
|
+
import { Primer, pcrAssembly } from "@biolibs/assembly2";
|
|
10
|
+
import { Dseqrecord } from "@biolibs/dseqrecord";
|
|
11
|
+
import { tmWallace } from "@biolibs/seqtools";
|
|
12
|
+
/** How many bases at a primer's 3′ end have to bind, unless somebody says otherwise. */
|
|
13
|
+
export const ANNEAL_AT_LEAST = 18;
|
|
14
|
+
/** The longest a part can be and still be offered first as a primer. */
|
|
15
|
+
export const LONGEST_PRIMER = 60;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a part is short enough to be a primer.
|
|
18
|
+
*
|
|
19
|
+
* @param part - Its length and whether it is a circle.
|
|
20
|
+
* @returns Whether to offer it as a primer first. Anything may still be chosen.
|
|
21
|
+
*/
|
|
22
|
+
export function looksLikePrimer(part) {
|
|
23
|
+
return !part.circular && part.length <= LONGEST_PRIMER;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A primer's melting temperature by the Wallace rule: 2 °C for each A or T, 4 °C for each G or C.
|
|
27
|
+
*
|
|
28
|
+
* It is the rough figure written on a tube, good for seeing that two primers are near each other.
|
|
29
|
+
*
|
|
30
|
+
* @param sequence - The primer.
|
|
31
|
+
* @returns Degrees Celsius, or `null` if that is not a sequence.
|
|
32
|
+
*/
|
|
33
|
+
export function primerTm(sequence) {
|
|
34
|
+
try {
|
|
35
|
+
return tmWallace(sequence.replace(/\s+/g, ""));
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Work out what a PCR would make.
|
|
43
|
+
*
|
|
44
|
+
* @param template - What is being copied.
|
|
45
|
+
* @param forward - One primer.
|
|
46
|
+
* @param reverse - The other.
|
|
47
|
+
* @param options - `annealAtLeast` is how many bases at each primer's 3′ end must bind.
|
|
48
|
+
* @returns The products, and what is wrong if there is not exactly one.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import { planPcr } from "@biolibs/bionet-tools";
|
|
53
|
+
*
|
|
54
|
+
* const template = "GGATCACAGTCTACACTGCTCACTCCAACCCCGGCCCCTGAGTCCGAGGAGAGGGTGCTTCAGAGTATGTATACC";
|
|
55
|
+
* const plan = planPcr({ sequence: template, circular: false }, "GGATCACAGTCTACACTG", "GGTATACATACTCTGAAG");
|
|
56
|
+
* plan.problem; // null
|
|
57
|
+
* plan.products[0].length; // 75
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export function planPcr(template, forward, reverse, options = {}) {
|
|
61
|
+
const least = options.annealAtLeast ?? ANNEAL_AT_LEAST;
|
|
62
|
+
const clean = (text) => text.replace(/\s+/g, "");
|
|
63
|
+
// The engine finds the primers whichever of them binds the upper strand, so the order they are
|
|
64
|
+
// given in does not matter.
|
|
65
|
+
let products = [];
|
|
66
|
+
try {
|
|
67
|
+
products = pcrAssembly(new Dseqrecord(clean(template.sequence), template.circular, undefined, "1", "template"), new Primer(clean(forward), "2", "forward"), new Primer(clean(reverse), "3", "reverse"), false, least)
|
|
68
|
+
.map((product) => ({ sequence: String(product.seq), length: product.length }));
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
products = [];
|
|
72
|
+
}
|
|
73
|
+
products.sort((a, b) => a.length - b.length);
|
|
74
|
+
const problem = products.length === 1 ? null
|
|
75
|
+
: products.length === 0 ? `These primers do not both bind this template with ${least} bases at their 3′ ends.`
|
|
76
|
+
: `These primers make ${products.length} different products from this template. A run records one.`;
|
|
77
|
+
return { products, problem };
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=pcr.js.map
|
package/dist/pcr.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcr.js","sourceRoot":"","sources":["../src/pcr.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,wEAAwE;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAUjC;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAA2C;IACzE,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,cAAc,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,IAAI,CAAC;QAAC,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,OAAO,CAAC,QAAiD,EAAE,OAAe,EAAE,OAAe,EACnF,UAAsC,EAAE;IAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,aAAa,IAAI,eAAe,CAAC;IACvD,MAAM,KAAK,GAAG,CAAC,IAAY,EAAU,EAAE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