@biolibs/bionet-tools 0.1.0 → 0.1.2
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 +183 -5
- package/dist/digest-bench.d.ts +76 -0
- package/dist/digest-bench.d.ts.map +1 -0
- package/dist/digest-bench.js +127 -0
- package/dist/digest-bench.js.map +1 -0
- package/dist/digest-tool.d.ts.map +1 -1
- package/dist/digest-tool.js +2 -1
- package/dist/digest-tool.js.map +1 -1
- package/dist/digest-working.d.ts +155 -0
- package/dist/digest-working.d.ts.map +1 -0
- package/dist/digest-working.js +216 -0
- package/dist/digest-working.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/ligate-bench.d.ts +92 -0
- package/dist/ligate-bench.d.ts.map +1 -0
- package/dist/ligate-bench.js +139 -0
- package/dist/ligate-bench.js.map +1 -0
- package/dist/ligate-working.d.ts +96 -0
- package/dist/ligate-working.d.ts.map +1 -0
- package/dist/ligate-working.js +145 -0
- package/dist/ligate-working.js.map +1 -0
- package/dist/ligate.d.ts +152 -0
- package/dist/ligate.d.ts.map +1 -0
- package/dist/ligate.js +161 -0
- package/dist/ligate.js.map +1 -0
- package/dist/map.d.ts +69 -0
- package/dist/map.d.ts.map +1 -0
- package/dist/map.js +80 -0
- package/dist/map.js.map +1 -0
- package/dist/pcr-bench.d.ts +103 -0
- package/dist/pcr-bench.d.ts.map +1 -0
- package/dist/pcr-bench.js +211 -0
- package/dist/pcr-bench.js.map +1 -0
- package/dist/pcr-scene.d.ts +249 -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.map +1 -1
- package/dist/pcr-tool.js +2 -1
- package/dist/pcr-tool.js.map +1 -1
- package/dist/pcr-working.d.ts +126 -0
- package/dist/pcr-working.d.ts.map +1 -0
- package/dist/pcr-working.js +175 -0
- package/dist/pcr-working.js.map +1 -0
- package/dist/run.d.ts +103 -5
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +132 -12
- package/dist/run.js.map +1 -1
- package/dist/sequence-file.d.ts +108 -0
- package/dist/sequence-file.d.ts.map +1 -0
- package/dist/sequence-file.js +145 -0
- package/dist/sequence-file.js.map +1 -0
- package/dist/sequences-tool.d.ts +13 -0
- package/dist/sequences-tool.d.ts.map +1 -0
- package/dist/sequences-tool.js +61 -0
- package/dist/sequences-tool.js.map +1 -0
- package/dist/tools.d.ts +7 -3
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +11 -5
- package/dist/tools.js.map +1 -1
- package/dist/working.d.ts +58 -0
- package/dist/working.d.ts.map +1 -0
- package/dist/working.js +55 -0
- package/dist/working.js.map +1 -0
- package/package.json +6 -2
- package/src/digest-bench.tsx +307 -0
- package/src/digest-tool.tsx +2 -1
- package/src/digest-working.ts +288 -0
- package/src/index.ts +24 -0
- package/src/ligate-bench.tsx +293 -0
- package/src/ligate-working.ts +182 -0
- package/src/ligate.ts +243 -0
- package/src/map.tsx +170 -0
- package/src/pcr-bench.tsx +403 -0
- package/src/pcr-scene.ts +410 -0
- package/src/pcr-tool.tsx +2 -1
- package/src/pcr-working.ts +228 -0
- package/src/run.ts +186 -14
- package/src/sequence-file.ts +172 -0
- package/src/sequences-tool.tsx +109 -0
- package/src/tools.tsx +15 -9
- package/src/working.tsx +96 -0
- package/tools.css +82 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { primerTm } from "./pcr.js";
|
|
2
|
+
import { SECONDS_PER_KB, strandCounts } from "./pcr-scene.js";
|
|
3
|
+
const count = (value) => value.toLocaleString("en-US");
|
|
4
|
+
const clean = (bases) => bases.replace(/\s+/g, "").toUpperCase();
|
|
5
|
+
const PAIR = { A: "T", T: "A", G: "C", C: "G", N: "N" };
|
|
6
|
+
/**
|
|
7
|
+
* A primer's melting temperature, with the count behind it.
|
|
8
|
+
*
|
|
9
|
+
* @param name - What the primer is called.
|
|
10
|
+
* @param sequence - Its bases.
|
|
11
|
+
* @returns The working, or `null` if that is not a sequence the rule can be applied to.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { tmWorking } from "@biolibs/bionet-tools";
|
|
16
|
+
*
|
|
17
|
+
* tmWorking("fwd", "GGATCACAGTCTACACTG")?.steps;
|
|
18
|
+
* // ["9 of its 18 bases are A or T, and 9 are G or C.", "2 × 9 + 4 × 9 = 54 °C."]
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export function tmWorking(name, sequence) {
|
|
22
|
+
const bases = clean(sequence);
|
|
23
|
+
const tm = primerTm(bases);
|
|
24
|
+
if (tm === null)
|
|
25
|
+
return null;
|
|
26
|
+
const weak = [...bases].filter((base) => base === "A" || base === "T" || base === "W").length;
|
|
27
|
+
const strong = [...bases].filter((base) => base === "G" || base === "C" || base === "S").length;
|
|
28
|
+
return {
|
|
29
|
+
of: `${name}'s melting temperature`, comes: `about ${Math.round(tm)} °C`, kind: "estimate",
|
|
30
|
+
steps: [
|
|
31
|
+
`${count(weak)} of its ${count(bases.length)} bases are A or T, and ${count(strong)} are G or C.`,
|
|
32
|
+
`2 × ${weak} + 4 × ${strong} = ${2 * weak + 4 * strong} °C.`,
|
|
33
|
+
],
|
|
34
|
+
rests: "The Wallace rule: an A·T pair holds with two bonds and a G·C pair with three, so each is given 2 °C or 4 °C. It ignores salt, how much primer there is and which bases are neighbours, and is rough past about 20 bases. It is good for seeing that two primers are near each other.",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A primer laid against the strand it binds, to show that it does.
|
|
39
|
+
*
|
|
40
|
+
* @param template - The template's top strand.
|
|
41
|
+
* @param primer - What the primer is called, and its bases 5′ to 3′.
|
|
42
|
+
* @param binding - Where it binds, from `primerBinding`.
|
|
43
|
+
* @param least - How many bases at its 3′ end must pair.
|
|
44
|
+
* @returns Each of the primer's bases with the base it faces, and what that shows.
|
|
45
|
+
*/
|
|
46
|
+
export function bindingWorking(template, primer, binding, least) {
|
|
47
|
+
const top = clean(template);
|
|
48
|
+
const bases = clean(primer.sequence);
|
|
49
|
+
const bound = bases.length - binding.tail;
|
|
50
|
+
// A primer that reads as the top strand binds the bottom one, and the other way about. Walking the
|
|
51
|
+
// primer 5′ to 3′ walks the template rightwards for the first and leftwards for the second.
|
|
52
|
+
const faced = [...bases].map((base, at) => {
|
|
53
|
+
const along = at - binding.tail;
|
|
54
|
+
const place = binding.reads === "top" ? binding.start + along : binding.end - 1 - along;
|
|
55
|
+
const there = along < 0 || place < 0 || place >= top.length ? "" : top[place];
|
|
56
|
+
const faces = there === "" ? "" : binding.reads === "top" ? PAIR[there] ?? "N" : there;
|
|
57
|
+
return { primer: base, faces, pairs: faces !== "" && PAIR[base] === faces, needed: at >= bases.length - least };
|
|
58
|
+
});
|
|
59
|
+
const paired = faced.filter((one) => one.pairs).length;
|
|
60
|
+
const end = faced.slice(-least);
|
|
61
|
+
// Every place the 3′ end could sit, on either strand: binding in one place only is part of what is claimed.
|
|
62
|
+
const flipped = [...bases].reverse().map((base) => PAIR[base] ?? "N").join("");
|
|
63
|
+
const sites = (needle) => { let found = 0; for (let at = top.indexOf(needle); at !== -1; at = top.indexOf(needle, at + 1))
|
|
64
|
+
found++; return found; };
|
|
65
|
+
const places = sites(bases.slice(-least)) + sites(flipped.slice(0, least));
|
|
66
|
+
return {
|
|
67
|
+
of: `where ${primer.name} binds`, kind: "exact", faced, strand: binding.reads === "top" ? "bottom" : "top",
|
|
68
|
+
from: binding.start + 1, to: binding.end,
|
|
69
|
+
comes: `bases ${count(binding.start + 1)} to ${count(binding.end)}, on the ${binding.reads === "top" ? "bottom" : "top"} strand`,
|
|
70
|
+
steps: [
|
|
71
|
+
`The last ${least} bases at its 3′ end ${end.every((one) => one.pairs) ? "each pair with the base they face" : "do not all pair"}. That is what the polymerase needs to start from.`,
|
|
72
|
+
`${count(paired)} of its ${count(bases.length)} bases pair in all${binding.tail === 0 ? "." : `. The first ${binding.tail} at its 5′ end do not: they are a tail, and are carried onto the product.`}`,
|
|
73
|
+
`Those ${least} bases are found in ${places === 1 ? "one place only" : `${places} places`} on the template, counting both strands.`,
|
|
74
|
+
`It has the ${binding.reads} strand's sequence, so it binds the ${binding.reads === "top" ? "bottom" : "top"} strand and is copied ${binding.reads === "top" ? "rightwards" : "leftwards"}.`,
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* How long the product is, as arithmetic on where the primers bind.
|
|
80
|
+
*
|
|
81
|
+
* This is worked out separately from the engine that makes the product, so the two can be compared.
|
|
82
|
+
*
|
|
83
|
+
* @param top - Where the primer that reads as the top strand binds.
|
|
84
|
+
* @param bottom - Where the other binds.
|
|
85
|
+
* @param template - How long the template is, and whether it is a circle.
|
|
86
|
+
* @param made - How long the engine's product is, to compare with.
|
|
87
|
+
* @returns The working.
|
|
88
|
+
*/
|
|
89
|
+
export function lengthWorking(top, bottom, template, made) {
|
|
90
|
+
const straight = bottom.end > top.start;
|
|
91
|
+
const copied = straight ? bottom.end - top.start : template.length - top.start + bottom.end;
|
|
92
|
+
const total = top.tail + copied + bottom.tail;
|
|
93
|
+
const steps = [
|
|
94
|
+
straight
|
|
95
|
+
? `The copy runs from base ${count(top.start + 1)}, where one primer starts, to base ${count(bottom.end)}, where the other ends: ${count(bottom.end)} − ${count(top.start + 1)} + 1 = ${count(copied)}.`
|
|
96
|
+
: `The template is a circle and the copy runs through its origin: from base ${count(top.start + 1)} to the end is ${count(template.length - top.start)}, and from the start to base ${count(bottom.end)} is ${count(bottom.end)}, so ${count(copied)}.`,
|
|
97
|
+
...(top.tail + bottom.tail === 0 ? [] : [`The primers' tails are added at the ends: ${count(copied)} + ${top.tail} + ${bottom.tail} = ${count(total)}.`]),
|
|
98
|
+
...(made === undefined ? [] : [made === total ? `The engine that builds the product, working it out its own way, also gives ${count(made)}.` : `The engine that builds the product gives ${count(made)}, which does not agree. Trust neither until that is understood.`]),
|
|
99
|
+
];
|
|
100
|
+
return { of: "the product's length", comes: `${count(total)} bp`, kind: "exact", steps };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Where the suggested programme's two figures come from.
|
|
104
|
+
*
|
|
105
|
+
* @param reaction - The product's length and the primers' melting temperatures.
|
|
106
|
+
* @param programme - The programme suggested for it.
|
|
107
|
+
* @returns The working for the annealing temperature and for the extension time.
|
|
108
|
+
*/
|
|
109
|
+
export function programmeWorking(reaction, programme) {
|
|
110
|
+
const sorted = [...reaction.primers].sort((a, b) => a.tm - b.tm);
|
|
111
|
+
const coolest = sorted[0];
|
|
112
|
+
const [, anneal, extend] = programme.steps;
|
|
113
|
+
const wanted = (reaction.length / 1000) * SECONDS_PER_KB;
|
|
114
|
+
const under = coolest === undefined ? null : Math.round(coolest.tm) - 5;
|
|
115
|
+
return [
|
|
116
|
+
...(coolest === undefined || under === null ? [] : [{
|
|
117
|
+
of: "the annealing temperature suggested", comes: `${anneal.celsius} °C`, kind: "estimate",
|
|
118
|
+
steps: [
|
|
119
|
+
`The cooler primer is ${coolest.name}, at about ${Math.round(coolest.tm)} °C.`,
|
|
120
|
+
`Five degrees under it: ${Math.round(coolest.tm)} − 5 = ${under} °C${under === anneal.celsius ? "." : `, kept between 45 and 72, so ${anneal.celsius} °C.`}`,
|
|
121
|
+
],
|
|
122
|
+
rests: "Five under the cooler primer is a convention. It rests on the melting temperatures, which are estimates themselves, so it is where to start and not where to stop.",
|
|
123
|
+
}]),
|
|
124
|
+
{
|
|
125
|
+
of: "the extension time suggested", comes: `${extend.seconds} s`, kind: "estimate",
|
|
126
|
+
steps: [
|
|
127
|
+
`${count(reaction.length)} bases at a minute for every thousand: ${count(reaction.length)} ÷ 1,000 × ${SECONDS_PER_KB} = ${Math.round(wanted * 10) / 10} s.`,
|
|
128
|
+
`Rounded up to the next 5 s, and never under 15: ${extend.seconds} s.`,
|
|
129
|
+
],
|
|
130
|
+
rests: "A minute for every thousand bases suits an ordinary polymerase. A fast one needs a quarter of that, and its maker says so.",
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* How many strands a tube holds after each cycle, as a table that can be followed down.
|
|
136
|
+
*
|
|
137
|
+
* @param cycles - How many cycles the programme runs.
|
|
138
|
+
* @returns The working, and a row for each of the first cycles and for the last.
|
|
139
|
+
*/
|
|
140
|
+
export function countsWorking(cycles) {
|
|
141
|
+
const last = Math.max(0, Math.floor(cycles));
|
|
142
|
+
const shown = [...new Set([0, 1, 2, 3, 4, 5, last].filter((one) => one <= last))];
|
|
143
|
+
const rows = shown.map((cycle) => { const at = strandCounts(cycle); return { cycle, ...at, total: at.template + at.long + at.product }; });
|
|
144
|
+
const end = strandCounts(last);
|
|
145
|
+
return {
|
|
146
|
+
of: `how many strands there are after ${last} cycles`, comes: `${count(end.product)} of the product`, kind: "estimate", rows,
|
|
147
|
+
steps: [
|
|
148
|
+
"Every cycle copies every strand once, so the number of strands doubles: 2, 4, 8, and after n cycles 2 × 2ⁿ.",
|
|
149
|
+
"The template's two strands are only ever copied, never made: 2.",
|
|
150
|
+
"Each cycle copies those two into two strands that start at a primer and run on too far: 2 × n.",
|
|
151
|
+
`Everything else is the product: 2 × 2ⁿ − 2n − 2. After ${last} cycles, ${count(2 * 2 ** last)} − ${count(2 * last)} − 2 = ${count(end.product)}.`,
|
|
152
|
+
],
|
|
153
|
+
rests: "The counting is exact for a tube in which every strand is copied every cycle. A real one falls behind as primers and nucleotides run low, usually after 25 to 30 cycles, so the real figure is lower.",
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* How each feature on the product was carried from the template, one line for each.
|
|
158
|
+
*
|
|
159
|
+
* @param features - What is marked on the template.
|
|
160
|
+
* @param from - Where the stretch copied starts.
|
|
161
|
+
* @param to - Where it stops.
|
|
162
|
+
* @param shift - How many bases precede it on the product: the forward primer's tail.
|
|
163
|
+
* @returns A line for each feature that touches the stretch, with the subtraction that moved it.
|
|
164
|
+
*/
|
|
165
|
+
export function carriedWorking(features, from, to, shift = 0) {
|
|
166
|
+
return features.flatMap((feature) => feature.parts.flatMap((piece) => {
|
|
167
|
+
const [start, end] = [Math.max(piece.start, from), Math.min(piece.end, to)];
|
|
168
|
+
if (end <= start)
|
|
169
|
+
return [];
|
|
170
|
+
const cut = start !== piece.start || end !== piece.end;
|
|
171
|
+
return [`${feature.label}: ${count(piece.start + 1)}..${count(piece.end)} on the template${cut ? `, of which ${count(start + 1)}..${count(end)} is copied` : ""}. `
|
|
172
|
+
+ `Less the ${count(from)} bases before the copy${shift === 0 ? "" : ` and plus the tail's ${shift}`}: ${count(start - from + shift + 1)}..${count(end - from + shift)} on the product.`];
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=pcr-working.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pcr-working.js","sourceRoot":"","sources":["../src/pcr-working.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAqD,MAAM,gBAAgB,CAAC;AAgBjH,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACvE,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACjF,MAAM,IAAI,GAAqC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AAE1F;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,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AAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAC9L,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/dist/run.d.ts
CHANGED
|
@@ -5,9 +5,12 @@
|
|
|
5
5
|
* primers, and what to ask the lab to record once somebody has chosen. It is plain data in and plain
|
|
6
6
|
* data out, so the window that uses it decides nothing.
|
|
7
7
|
*/
|
|
8
|
-
import type { ItemState, PartState, PlaceState } from "@biolibs/bionet";
|
|
8
|
+
import type { ItemState, PartFeature, PartState, PlaceState } from "@biolibs/bionet";
|
|
9
9
|
import { type DigestPlan } from "./digest.js";
|
|
10
|
+
import { type DigestPiece } from "./digest-working.js";
|
|
11
|
+
import { type LigationPiece, type LigationPlan, type LigationProduct } from "./ligate.js";
|
|
10
12
|
import { type PcrPlan } from "./pcr.js";
|
|
13
|
+
import { type PcrProgramme } from "./pcr-scene.js";
|
|
11
14
|
/** As much of a lab as a tool reads. */
|
|
12
15
|
export interface ToolLab {
|
|
13
16
|
parts: readonly PartState[];
|
|
@@ -59,11 +62,15 @@ export interface PcrChoice {
|
|
|
59
62
|
unit?: string | null;
|
|
60
63
|
/** Anything worth saying about the run. */
|
|
61
64
|
note?: string | null;
|
|
65
|
+
/** The programme the machine was set to, to be kept with the run. */
|
|
66
|
+
programme?: PcrProgramme;
|
|
62
67
|
}
|
|
63
68
|
/** A PCR as chosen: what it would make, and what to ask the lab to record. */
|
|
64
69
|
export interface PcrRun {
|
|
65
70
|
/** What the PCR would make, or `null` if a tube that was chosen is not one the lab has. */
|
|
66
71
|
plan: PcrPlan | null;
|
|
72
|
+
/** What is marked on the product: what the template had on the stretch copied, and the primers at its ends. */
|
|
73
|
+
features: PartFeature[];
|
|
67
74
|
/** What the product would be called. */
|
|
68
75
|
name: string;
|
|
69
76
|
/** What to hand to the lab's `recordRun` if it worked. `null` while there is not exactly one product. */
|
|
@@ -71,6 +78,27 @@ export interface PcrRun {
|
|
|
71
78
|
/** What to hand to the lab's `recordRun` if it was run and gave nothing. `null` if a tube is missing. */
|
|
72
79
|
failed: Record<string, unknown> | null;
|
|
73
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* What is marked on a PCR's product.
|
|
83
|
+
*
|
|
84
|
+
* A feature of the template that lies on the stretch copied is carried over, moved to where it now
|
|
85
|
+
* is; one that is only partly copied is carried as the part that was, and named as a part. Each
|
|
86
|
+
* primer is marked at the end it became. If the template is a circle and the stretch copied runs
|
|
87
|
+
* through its origin, only the primers are marked.
|
|
88
|
+
*
|
|
89
|
+
* @param template - The template, with what is marked on it.
|
|
90
|
+
* @param forward - One primer, by name and bases.
|
|
91
|
+
* @param reverse - The other.
|
|
92
|
+
* @param least - How many bases at each primer's 3′ end must bind.
|
|
93
|
+
* @returns The features, placed on the product. Empty if either primer does not bind in one place.
|
|
94
|
+
*/
|
|
95
|
+
export declare function pcrFeatures(template: Pick<PartState, "sequence" | "features">, forward: {
|
|
96
|
+
name: string;
|
|
97
|
+
sequence: string;
|
|
98
|
+
}, reverse: {
|
|
99
|
+
name: string;
|
|
100
|
+
sequence: string;
|
|
101
|
+
}, least?: number): PartFeature[];
|
|
74
102
|
/**
|
|
75
103
|
* Work a choice of tubes out into a run.
|
|
76
104
|
*
|
|
@@ -107,6 +135,19 @@ export interface DigestChoice {
|
|
|
107
135
|
/** The gel's agarose concentration and the ladder beside it, by their IDs in `@biolibs/gel`. */
|
|
108
136
|
gel?: string;
|
|
109
137
|
ladder?: string;
|
|
138
|
+
/**
|
|
139
|
+
* The pieces to keep as tubes, each by where it starts on the molecule. Cutting a band out of a
|
|
140
|
+
* gel and cleaning it up gives a tube of that piece, with the ends the enzymes left.
|
|
141
|
+
*/
|
|
142
|
+
keep?: readonly {
|
|
143
|
+
from: number;
|
|
144
|
+
name?: string;
|
|
145
|
+
amount?: number;
|
|
146
|
+
unit?: string | null;
|
|
147
|
+
}[];
|
|
148
|
+
/** What the power supply was set to: volts, and minutes run. Whole numbers. */
|
|
149
|
+
volts?: number;
|
|
150
|
+
minutes?: number;
|
|
110
151
|
/** The gel station it was run at, if the lab has one. */
|
|
111
152
|
instrument?: string | null;
|
|
112
153
|
/** Anything worth saying about it. */
|
|
@@ -116,6 +157,8 @@ export interface DigestChoice {
|
|
|
116
157
|
export interface DigestRun {
|
|
117
158
|
/** What the digest would give, or `null` if the tube is not one the lab has. */
|
|
118
159
|
plan: DigestPlan | null;
|
|
160
|
+
/** The pieces, each with its ends and what it carries. */
|
|
161
|
+
pieces: DigestPiece[];
|
|
119
162
|
/** What to hand to the lab's `recordRun` if the gel matched. `null` while there is nothing to match. */
|
|
120
163
|
matched: Record<string, unknown> | null;
|
|
121
164
|
/** What to hand to it if the gel was run and did not match. `null` likewise. */
|
|
@@ -124,17 +167,72 @@ export interface DigestRun {
|
|
|
124
167
|
/**
|
|
125
168
|
* Work a choice of tube and enzymes out into a run.
|
|
126
169
|
*
|
|
127
|
-
* A digest
|
|
128
|
-
*
|
|
129
|
-
*
|
|
170
|
+
* A digest is first a check: it uses some of a tube, and what is recorded is which enzymes, what
|
|
171
|
+
* pieces were expected, and whether the gel showed them. Pieces may also be kept. Each kept piece
|
|
172
|
+
* becomes a tube of a part with the ends the enzymes left, since a cut piece is defined by its ends.
|
|
130
173
|
*
|
|
131
174
|
* @param lab - The lab.
|
|
132
175
|
* @param choice - The tube, the enzymes, and how much was used.
|
|
133
176
|
* @returns What it would give, and what to record either way.
|
|
134
177
|
*/
|
|
135
178
|
export declare function digestRun(lab: ToolLab, choice: DigestChoice): DigestRun;
|
|
179
|
+
/**
|
|
180
|
+
* The tubes a ligation could be set up from: every tube of a linear molecule with something in it.
|
|
181
|
+
*
|
|
182
|
+
* A circle has no ends to join, so it is left out until somebody cuts it.
|
|
183
|
+
*
|
|
184
|
+
* @param lab - The lab.
|
|
185
|
+
* @returns The tubes to offer, the ones with sticky ends first, since those are the ones that were cut.
|
|
186
|
+
*/
|
|
187
|
+
export declare function ligationTubes(lab: ToolLab): TubeChoice[];
|
|
188
|
+
/** What somebody has chosen for a ligation. */
|
|
189
|
+
export interface LigationChoice {
|
|
190
|
+
/** The tubes to join, by item ID. */
|
|
191
|
+
tubes: readonly string[];
|
|
192
|
+
/** How much of each was used, in its own unit. Whole numbers, by item ID. */
|
|
193
|
+
used?: Readonly<Record<string, number>>;
|
|
194
|
+
/** Whether two blunt ends may be joined, and whether to keep the products that do not close. */
|
|
195
|
+
blunt?: boolean;
|
|
196
|
+
linear?: boolean;
|
|
197
|
+
/** Which product is being made, by its place in the plan. The first by default. */
|
|
198
|
+
chosen?: number;
|
|
199
|
+
/** The heat block or water bath it was set up at, if the lab has one. */
|
|
200
|
+
instrument?: string | null;
|
|
201
|
+
/** What to call the product, how much of it there is, and in what unit. */
|
|
202
|
+
name?: string;
|
|
203
|
+
amount?: number;
|
|
204
|
+
unit?: string | null;
|
|
205
|
+
/** Anything worth saying about it. */
|
|
206
|
+
note?: string | null;
|
|
207
|
+
}
|
|
208
|
+
/** A ligation as chosen: what it would make, and what to ask the lab to record. */
|
|
209
|
+
export interface LigationRun {
|
|
210
|
+
/** What it would make, or `null` if a tube that was chosen is not one the lab has. */
|
|
211
|
+
plan: LigationPlan | null;
|
|
212
|
+
/** The pieces, as the sequence layer needs them. */
|
|
213
|
+
pieces: LigationPiece[];
|
|
214
|
+
/** The product being made, or `null` if there is nothing to make. */
|
|
215
|
+
product: LigationProduct | null;
|
|
216
|
+
/** What it would be called. */
|
|
217
|
+
name: string;
|
|
218
|
+
/** What to hand to the lab's `recordRun` if it worked. `null` while there is nothing to make. */
|
|
219
|
+
worked: Record<string, unknown> | null;
|
|
220
|
+
/** What to hand to it if it was set up and gave nothing. `null` if a tube is missing. */
|
|
221
|
+
failed: Record<string, unknown> | null;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Work a choice of tubes out into a ligation.
|
|
225
|
+
*
|
|
226
|
+
* What comes out is one molecule, and it is a part like any other: a circle if the pieces closed,
|
|
227
|
+
* and otherwise a line with the outer ends the pieces brought. It carries what the pieces carried.
|
|
228
|
+
*
|
|
229
|
+
* @param lab - The lab.
|
|
230
|
+
* @param choice - The tubes, how much of each, and what to call what comes out.
|
|
231
|
+
* @returns What it would make, and what to record either way.
|
|
232
|
+
*/
|
|
233
|
+
export declare function ligationRun(lab: ToolLab, choice: LigationChoice): LigationRun;
|
|
136
234
|
/** The tools there are. */
|
|
137
|
-
export type ToolName = "pcr" | "digest";
|
|
235
|
+
export type ToolName = "pcr" | "digest" | "ligation";
|
|
138
236
|
/** The model of instrument each tool is used at. */
|
|
139
237
|
export declare const TOOL_AT: Readonly<Record<ToolName, string>>;
|
|
140
238
|
/**
|
package/dist/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAErF,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAA0B,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAA0B,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAClH,OAAO,EAA6C,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGlE,wCAAwC;AACxC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,MAAM,EAAE,S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ords } from "@biolibs/bionet-panels";
|
|
2
2
|
import { planDigest } from "./digest.js";
|
|
3
|
+
import { cutSites, digestPieces } from "./digest-working.js";
|
|
4
|
+
import { planLigation } from "./ligate.js";
|
|
3
5
|
import { ANNEAL_AT_LEAST, looksLikePrimer, planPcr } from "./pcr.js";
|
|
6
|
+
import { primerBinding } from "./pcr-scene.js";
|
|
7
|
+
import { carryFeatures } from "./sequence-file.js";
|
|
4
8
|
/**
|
|
5
9
|
* The tubes a PCR could be run from.
|
|
6
10
|
*
|
|
@@ -23,6 +27,36 @@ export function pcrTubes(lab) {
|
|
|
23
27
|
const long = all.filter((one) => !looksLikePrimer(one.part));
|
|
24
28
|
return { templates: long.length > 0 ? [...long, ...short] : all, primers: short.length > 0 ? short : all };
|
|
25
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* What is marked on a PCR's product.
|
|
32
|
+
*
|
|
33
|
+
* A feature of the template that lies on the stretch copied is carried over, moved to where it now
|
|
34
|
+
* is; one that is only partly copied is carried as the part that was, and named as a part. Each
|
|
35
|
+
* primer is marked at the end it became. If the template is a circle and the stretch copied runs
|
|
36
|
+
* through its origin, only the primers are marked.
|
|
37
|
+
*
|
|
38
|
+
* @param template - The template, with what is marked on it.
|
|
39
|
+
* @param forward - One primer, by name and bases.
|
|
40
|
+
* @param reverse - The other.
|
|
41
|
+
* @param least - How many bases at each primer's 3′ end must bind.
|
|
42
|
+
* @returns The features, placed on the product. Empty if either primer does not bind in one place.
|
|
43
|
+
*/
|
|
44
|
+
export function pcrFeatures(template, forward, reverse, least = ANNEAL_AT_LEAST) {
|
|
45
|
+
const found = [forward, reverse].map((primer) => ({ primer, binding: primerBinding(template.sequence, primer.sequence, least) }));
|
|
46
|
+
const top = found.find((one) => one.binding?.reads === "top");
|
|
47
|
+
const bottom = found.find((one) => one.binding?.reads === "bottom");
|
|
48
|
+
if (top?.binding == null || bottom?.binding == null)
|
|
49
|
+
return [];
|
|
50
|
+
const [from, to] = [top.binding.start, bottom.binding.end];
|
|
51
|
+
const straight = to > from;
|
|
52
|
+
const copied = straight ? to - from : template.sequence.replace(/\s+/g, "").length - from + to;
|
|
53
|
+
const length = top.binding.tail + copied + bottom.binding.tail;
|
|
54
|
+
const primers = [
|
|
55
|
+
{ type: "primer_bind", label: top.primer.name, strand: 1, parts: [{ start: 0, end: Math.min(length, top.primer.sequence.length) }] },
|
|
56
|
+
{ type: "primer_bind", label: bottom.primer.name, strand: -1, parts: [{ start: Math.max(0, length - bottom.primer.sequence.length), end: length }] },
|
|
57
|
+
];
|
|
58
|
+
return [...(straight ? carryFeatures(template.features, from, to, top.binding.tail) : []), ...primers];
|
|
59
|
+
}
|
|
26
60
|
/**
|
|
27
61
|
* Work a choice of tubes out into a run.
|
|
28
62
|
*
|
|
@@ -47,7 +81,7 @@ export function pcrRun(lab, choice) {
|
|
|
47
81
|
const [template, forward, reverse] = [partOf(choice.template), partOf(choice.forward), partOf(choice.reverse)];
|
|
48
82
|
const typed = choice.name?.trim() ?? "";
|
|
49
83
|
if (template === undefined || forward === undefined || reverse === undefined)
|
|
50
|
-
return { plan: null, name: typed, worked: null, failed: null };
|
|
84
|
+
return { plan: null, name: typed, features: [], worked: null, failed: null };
|
|
51
85
|
const least = choice.annealAtLeast ?? ANNEAL_AT_LEAST;
|
|
52
86
|
const plan = planPcr(template, forward.sequence, reverse.sequence, { annealAtLeast: least });
|
|
53
87
|
const name = typed !== "" ? typed : `${template.name} × ${forward.name} + ${reverse.name}`.slice(0, 200);
|
|
@@ -59,15 +93,22 @@ export function pcrRun(lab, choice) {
|
|
|
59
93
|
{ item: choice.forward, amount: whole(choice.used?.forward, 1), role: "forward primer" },
|
|
60
94
|
{ item: choice.reverse, amount: whole(choice.used?.reverse, 1), role: "reverse primer" },
|
|
61
95
|
],
|
|
62
|
-
|
|
96
|
+
// What the operator set is part of what was done, and is what somebody repeating the run needs.
|
|
97
|
+
settings: { anneal_at_least: least, ...(choice.programme === undefined ? {} : {
|
|
98
|
+
denature_c: choice.programme.steps[0].celsius, anneal_c: choice.programme.steps[1].celsius, anneal_s: choice.programme.steps[1].seconds,
|
|
99
|
+
extend_c: choice.programme.steps[2].celsius, extend_s: choice.programme.steps[2].seconds, cycles: choice.programme.cycles,
|
|
100
|
+
}) },
|
|
63
101
|
note: choice.note ?? null,
|
|
64
102
|
};
|
|
65
103
|
const product = plan.problem === null ? plan.products[0] : null;
|
|
104
|
+
// Only marked if they land on the product the engine made: the two are worked out separately.
|
|
105
|
+
const marked = product === null ? [] : pcrFeatures(template, forward, reverse, least);
|
|
106
|
+
const features = marked.every((one) => one.parts.every((piece) => piece.end <= product.length)) ? marked : [];
|
|
66
107
|
return {
|
|
67
|
-
plan, name,
|
|
108
|
+
plan, name, features,
|
|
68
109
|
worked: product === null ? null : {
|
|
69
110
|
...record, outcome: "worked",
|
|
70
|
-
outputs: [{ sequence: product.sequence, circular: false, name, amount: whole(choice.amount, 50), unit: choice.unit === undefined ? "µL" : choice.unit }],
|
|
111
|
+
outputs: [{ sequence: product.sequence, circular: false, name, features, amount: whole(choice.amount, 50), unit: choice.unit === undefined ? "µL" : choice.unit }],
|
|
71
112
|
},
|
|
72
113
|
failed: { ...record, outcome: "failed", outputs: [] },
|
|
73
114
|
};
|
|
@@ -85,9 +126,9 @@ export function digestTubes(lab) {
|
|
|
85
126
|
/**
|
|
86
127
|
* Work a choice of tube and enzymes out into a run.
|
|
87
128
|
*
|
|
88
|
-
* A digest
|
|
89
|
-
*
|
|
90
|
-
*
|
|
129
|
+
* A digest is first a check: it uses some of a tube, and what is recorded is which enzymes, what
|
|
130
|
+
* pieces were expected, and whether the gel showed them. Pieces may also be kept. Each kept piece
|
|
131
|
+
* becomes a tube of a part with the ends the enzymes left, since a cut piece is defined by its ends.
|
|
91
132
|
*
|
|
92
133
|
* @param lab - The lab.
|
|
93
134
|
* @param choice - The tube, the enzymes, and how much was used.
|
|
@@ -97,23 +138,102 @@ export function digestRun(lab, choice) {
|
|
|
97
138
|
const item = lab.items.find((one) => one.item === choice.tube);
|
|
98
139
|
const part = item === undefined ? undefined : lab.parts.find((one) => one.checksum === item.part);
|
|
99
140
|
if (part === undefined)
|
|
100
|
-
return { plan: null, matched: null, differed: null };
|
|
141
|
+
return { plan: null, pieces: [], matched: null, differed: null };
|
|
101
142
|
const plan = planDigest(part, choice.enzymes, { ...(choice.gel === undefined ? {} : { gel: choice.gel }), ...(choice.ladder === undefined ? {} : { ladder: choice.ladder }) });
|
|
102
143
|
if (plan.problem !== null)
|
|
103
|
-
return { plan, matched: null, differed: null };
|
|
144
|
+
return { plan, pieces: [], matched: null, differed: null };
|
|
145
|
+
const pieces = digestPieces(part, plan.cutters.flatMap((one) => cutSites(part, one)));
|
|
146
|
+
const enzymesUsed = plan.cutters.filter((one) => one.positions.length > 0).map((one) => one.name).join("+");
|
|
147
|
+
const kept = (choice.keep ?? []).flatMap((wanted) => {
|
|
148
|
+
const piece = pieces.find((one) => one.from === wanted.from);
|
|
149
|
+
if (piece === undefined)
|
|
150
|
+
return [];
|
|
151
|
+
const amount = wanted.amount === undefined || !Number.isSafeInteger(wanted.amount) || wanted.amount < 0 ? 20 : wanted.amount;
|
|
152
|
+
const typed = wanted.name?.trim() ?? "";
|
|
153
|
+
return [{ sequence: piece.sequence, circular: false, ends: piece.ends, features: piece.features, amount, unit: wanted.unit === undefined ? "µL" : wanted.unit,
|
|
154
|
+
name: (typed !== "" ? typed : `${part.name} ${enzymesUsed} ${piece.length} bp`).slice(0, 200) }];
|
|
155
|
+
});
|
|
104
156
|
const used = choice.used === undefined || !Number.isSafeInteger(choice.used) || choice.used < 0 ? 1 : choice.used;
|
|
105
157
|
const record = {
|
|
106
158
|
kind: "digest", instrument: choice.instrument ?? null,
|
|
107
159
|
inputs: [{ item: choice.tube, amount: used, role: "cut" }],
|
|
108
160
|
outputs: [],
|
|
109
161
|
// Settings are short text, so a digest into very many pieces records as many as fit.
|
|
110
|
-
settings: { enzymes: plan.cutters.map((one) => one.name).join("+").slice(0, 200), expected: plan.fragments.join(",").slice(0, 200), gel: plan.gel
|
|
162
|
+
settings: { enzymes: plan.cutters.map((one) => one.name).join("+").slice(0, 200), expected: plan.fragments.join(",").slice(0, 200), gel: plan.gel,
|
|
163
|
+
...(Number.isSafeInteger(choice.volts) ? { volts: choice.volts } : {}), ...(Number.isSafeInteger(choice.minutes) ? { minutes: choice.minutes } : {}) },
|
|
164
|
+
note: choice.note ?? null,
|
|
165
|
+
};
|
|
166
|
+
// Pieces can only be kept from a gel that showed them.
|
|
167
|
+
return { plan, pieces, matched: { ...record, outputs: kept, outcome: "worked", ...(kept.length === 0 ? {} : { settings: { ...record.settings, kept: kept.length } }) },
|
|
168
|
+
differed: { ...record, outcome: "failed" } };
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The tubes a ligation could be set up from: every tube of a linear molecule with something in it.
|
|
172
|
+
*
|
|
173
|
+
* A circle has no ends to join, so it is left out until somebody cuts it.
|
|
174
|
+
*
|
|
175
|
+
* @param lab - The lab.
|
|
176
|
+
* @returns The tubes to offer, the ones with sticky ends first, since those are the ones that were cut.
|
|
177
|
+
*/
|
|
178
|
+
export function ligationTubes(lab) {
|
|
179
|
+
return pcrTubes(lab).templates.filter((one) => !one.part.circular)
|
|
180
|
+
.sort((a, b) => Number(sticky(b.part)) - Number(sticky(a.part)) || b.part.length - a.part.length);
|
|
181
|
+
}
|
|
182
|
+
/** Whether a part has an end with unpaired bases. */
|
|
183
|
+
const sticky = (part) => (part.ends?.left ?? 0) !== 0 || (part.ends?.right ?? 0) !== 0;
|
|
184
|
+
/**
|
|
185
|
+
* Work a choice of tubes out into a ligation.
|
|
186
|
+
*
|
|
187
|
+
* What comes out is one molecule, and it is a part like any other: a circle if the pieces closed,
|
|
188
|
+
* and otherwise a line with the outer ends the pieces brought. It carries what the pieces carried.
|
|
189
|
+
*
|
|
190
|
+
* @param lab - The lab.
|
|
191
|
+
* @param choice - The tubes, how much of each, and what to call what comes out.
|
|
192
|
+
* @returns What it would make, and what to record either way.
|
|
193
|
+
*/
|
|
194
|
+
export function ligationRun(lab, choice) {
|
|
195
|
+
const pieces = [];
|
|
196
|
+
for (const item of choice.tubes) {
|
|
197
|
+
const held = lab.items.find((one) => one.item === item);
|
|
198
|
+
const part = held === undefined ? undefined : lab.parts.find((one) => one.checksum === held.part);
|
|
199
|
+
if (part === undefined || part.circular)
|
|
200
|
+
return { plan: null, pieces: [], product: null, name: "", worked: null, failed: null };
|
|
201
|
+
pieces.push({ id: item, name: part.name, sequence: part.sequence, ends: part.ends ?? { left: 0, right: 0 }, features: part.features });
|
|
202
|
+
}
|
|
203
|
+
const plan = planLigation(pieces, { blunt: choice.blunt === true, linear: choice.linear === true });
|
|
204
|
+
const product = plan.products[Math.max(0, Math.min(choice.chosen ?? 0, plan.products.length - 1))] ?? null;
|
|
205
|
+
const typed = choice.name?.trim() ?? "";
|
|
206
|
+
const name = (typed !== "" ? typed : pieces.map((piece) => piece.name).join(" + ")).slice(0, 200);
|
|
207
|
+
const whole = (value, usual) => (value === undefined || !Number.isSafeInteger(value) || value < 0 ? usual : value);
|
|
208
|
+
const record = {
|
|
209
|
+
kind: "ligation", instrument: choice.instrument ?? null,
|
|
210
|
+
inputs: pieces.map((piece) => ({ item: piece.id, amount: whole(choice.used?.[piece.id], 1), role: "piece" })),
|
|
211
|
+
settings: { pieces: pieces.length, ...(product === null ? {} : { joins: product.joins.length, made: product.circular ? "circle" : "line" }),
|
|
212
|
+
...(choice.blunt === true ? { blunt: "allowed" } : {}) },
|
|
111
213
|
note: choice.note ?? null,
|
|
112
214
|
};
|
|
113
|
-
|
|
215
|
+
if (product === null)
|
|
216
|
+
return { plan, pieces, product, name, worked: null, failed: { ...record, outcome: "failed", outputs: [] } };
|
|
217
|
+
// A circle has no ends. A line keeps the outer ends of the pieces at each of its own ends.
|
|
218
|
+
const first = product.pieces[0];
|
|
219
|
+
const last = product.pieces.at(-1);
|
|
220
|
+
const endsOf = (placed, which) => {
|
|
221
|
+
const piece = pieces.find((one) => one.id === placed.id);
|
|
222
|
+
const own = placed.flipped ? { left: -piece.ends.right, right: -piece.ends.left } : piece.ends;
|
|
223
|
+
return own[which];
|
|
224
|
+
};
|
|
225
|
+
const ends = product.circular ? undefined : { left: endsOf(first, "left"), right: endsOf(last, "right") };
|
|
226
|
+
return {
|
|
227
|
+
plan, pieces, product, name,
|
|
228
|
+
worked: { ...record, outcome: "worked",
|
|
229
|
+
outputs: [{ sequence: product.sequence, circular: product.circular, name, features: product.features,
|
|
230
|
+
amount: whole(choice.amount, 20), unit: choice.unit === undefined ? "µL" : choice.unit,
|
|
231
|
+
...(ends === undefined || (ends.left === 0 && ends.right === 0) ? {} : { ends }) }] },
|
|
232
|
+
failed: { ...record, outcome: "failed", outputs: [] },
|
|
233
|
+
};
|
|
114
234
|
}
|
|
115
235
|
/** The model of instrument each tool is used at. */
|
|
116
|
-
export const TOOL_AT = { pcr: "thermocycler", digest: "gel-station" };
|
|
236
|
+
export const TOOL_AT = { pcr: "thermocycler", digest: "gel-station", ligation: "heat-block" };
|
|
117
237
|
/**
|
|
118
238
|
* Which tool an instrument opens.
|
|
119
239
|
*
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAgB,MAAM,UAAU,CAAC;AAmBnF;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CA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