@biolibs/bionet-tools 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +146 -4
  2. package/dist/digest-bench.d.ts +84 -0
  3. package/dist/digest-bench.d.ts.map +1 -0
  4. package/dist/digest-bench.js +127 -0
  5. package/dist/digest-bench.js.map +1 -0
  6. package/dist/digest-working.d.ts +155 -0
  7. package/dist/digest-working.d.ts.map +1 -0
  8. package/dist/digest-working.js +216 -0
  9. package/dist/digest-working.js.map +1 -0
  10. package/dist/index.d.ts +20 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +20 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/ligate-bench.d.ts +98 -0
  15. package/dist/ligate-bench.d.ts.map +1 -0
  16. package/dist/ligate-bench.js +139 -0
  17. package/dist/ligate-bench.js.map +1 -0
  18. package/dist/ligate-working.d.ts +96 -0
  19. package/dist/ligate-working.d.ts.map +1 -0
  20. package/dist/ligate-working.js +145 -0
  21. package/dist/ligate-working.js.map +1 -0
  22. package/dist/ligate.d.ts +152 -0
  23. package/dist/ligate.d.ts.map +1 -0
  24. package/dist/ligate.js +161 -0
  25. package/dist/ligate.js.map +1 -0
  26. package/dist/map.d.ts +69 -0
  27. package/dist/map.d.ts.map +1 -0
  28. package/dist/map.js +80 -0
  29. package/dist/map.js.map +1 -0
  30. package/dist/pcr-bench.d.ts +20 -2
  31. package/dist/pcr-bench.d.ts.map +1 -1
  32. package/dist/pcr-bench.js +34 -10
  33. package/dist/pcr-bench.js.map +1 -1
  34. package/dist/pcr-scene.d.ts +2 -0
  35. package/dist/pcr-scene.d.ts.map +1 -1
  36. package/dist/pcr-scene.js +8 -8
  37. package/dist/pcr-scene.js.map +1 -1
  38. package/dist/pcr-working.d.ts +126 -0
  39. package/dist/pcr-working.d.ts.map +1 -0
  40. package/dist/pcr-working.js +175 -0
  41. package/dist/pcr-working.js.map +1 -0
  42. package/dist/run.d.ts +101 -6
  43. package/dist/run.d.ts.map +1 -1
  44. package/dist/run.js +127 -11
  45. package/dist/run.js.map +1 -1
  46. package/dist/sequence-file.d.ts +108 -0
  47. package/dist/sequence-file.d.ts.map +1 -0
  48. package/dist/sequence-file.js +145 -0
  49. package/dist/sequence-file.js.map +1 -0
  50. package/dist/sequences-tool.d.ts +13 -0
  51. package/dist/sequences-tool.d.ts.map +1 -0
  52. package/dist/sequences-tool.js +61 -0
  53. package/dist/sequences-tool.js.map +1 -0
  54. package/dist/tools.d.ts +2 -2
  55. package/dist/tools.d.ts.map +1 -1
  56. package/dist/tools.js +9 -4
  57. package/dist/tools.js.map +1 -1
  58. package/dist/working.d.ts +58 -0
  59. package/dist/working.d.ts.map +1 -0
  60. package/dist/working.js +55 -0
  61. package/dist/working.js.map +1 -0
  62. package/package.json +5 -2
  63. package/src/digest-bench.tsx +311 -0
  64. package/src/digest-working.ts +288 -0
  65. package/src/index.ts +20 -0
  66. package/src/ligate-bench.tsx +297 -0
  67. package/src/ligate-working.ts +182 -0
  68. package/src/ligate.ts +243 -0
  69. package/src/map.tsx +170 -0
  70. package/src/pcr-bench.tsx +66 -9
  71. package/src/pcr-scene.ts +10 -8
  72. package/src/pcr-working.ts +228 -0
  73. package/src/run.ts +179 -14
  74. package/src/sequence-file.ts +172 -0
  75. package/src/sequences-tool.tsx +109 -0
  76. package/src/tools.tsx +13 -8
  77. package/src/working.tsx +96 -0
  78. package/tools.css +54 -0
package/README.md CHANGED
@@ -1,11 +1,43 @@
1
1
  # @biolibs/bionet-tools
2
2
 
3
- The tools a lab uses at the bench, tied to its freezer: PCR, and a check digest with its gel. For PCR, choose a template and two primers from the tubes the lab holds, see what they would make, and record the run. The template and primers drop by what was used, and the product becomes a new tube that knows which run made it.
3
+ The tools a lab uses at the bench, tied to its freezer: its sequences and their maps, PCR, a check digest with its gel, and a ligation that joins the pieces back up. Sequences come in from the SnapGene, GenBank, EMBL and FASTA files a lab already has, with their features. For PCR, choose a template and two primers from the tubes the lab holds, see what they would make, and record the run. The template and primers drop by what was used, and the product becomes a new tube that knows which run made it.
4
4
 
5
5
  ```
6
6
  npm install @biolibs/bionet-tools @biolibs/bionet-panels @biolibs/bionet-react @biolibs/bionet-theme react
7
7
  ```
8
8
 
9
+ ## Bringing sequences in
10
+
11
+ ```ts
12
+ import { readSequenceFile } from "@biolibs/bionet-tools";
13
+
14
+ const read = readSequenceFile(file.name, new Uint8Array(await file.arrayBuffer()));
15
+ read.format; // "snapgene", "genbank", "embl" or "fasta"
16
+ read.circular; // as the file says
17
+ read.features; // [{ type: "CDS", label: "AmpR", strand: -1, parts: [{ start: 999, end: 1860 }] }, …]
18
+ await act("addPart", { name: read.name, sequence: read.sequence, circular: read.circular, features: read.features });
19
+ ```
20
+
21
+ SnapGene's own `.dna` files are read as they are, so a lab's constructs come across with their
22
+ names, their shape and everything marked on them. The features are kept in the lab's signed log
23
+ with the part, so every member sees the same map. A part is known by its sequence: bringing in one
24
+ the lab already has adds only what is marked on it.
25
+
26
+ ## A sequence's map
27
+
28
+ ```tsx
29
+ import { SequenceMap } from "@biolibs/bionet-tools";
30
+
31
+ <SequenceMap name={part.name} length={part.length} circular={part.circular} features={part.features}
32
+ marks={[{ at: 396, label: "EcoRI" }]} spans={[{ start: 1950, end: 1972, label: "fwd", strand: 1 }]} />
33
+ ```
34
+
35
+ A circle for a plasmid and a line for anything else. Features are arrows in lanes, so ones that
36
+ overlap can both be seen; `marks` are places to name, such as where an enzyme cuts; `spans` are
37
+ stretches to point at, such as where a primer binds. `SequencesTool` is the whole thing for a lab:
38
+ choose files to bring in, pick any part, and read its map, its features and which enzymes cut it
39
+ once or twice.
40
+
9
41
  ## What a PCR would make
10
42
 
11
43
  ```ts
@@ -33,6 +65,20 @@ if (run.worked !== null) await act("recordRun", run.worked);
33
65
 
34
66
  `pcrTubes` offers short linear parts as primers and the rest as templates. `pcrRun` works a choice out into what to hand the lab's `recordRun`: `worked` when there is exactly one product, and `failed` for a run that was done and gave nothing, which still used the tubes.
35
67
 
68
+ ## What the product carries
69
+
70
+ ```ts
71
+ import { pcrFeatures } from "@biolibs/bionet-tools";
72
+
73
+ pcrFeatures(template, { name: "fwd", sequence: fwd }, { name: "rvs", sequence: rvs });
74
+ // what the template had on the stretch copied, moved to where it now is, and each primer at its end
75
+ ```
76
+
77
+ A feature that is only partly copied is carried as the part that was, and its name says `(part)`,
78
+ since half a gene is not the gene. `pcrRun` puts these on the product it asks the lab to record, so
79
+ a product made here has its map from the start. `moleculeOf(part)` gives a part in the shape
80
+ `@biolibs/bionet-scene` draws: a ring or a bar with its features, above the machine or over a tube.
81
+
36
82
  ## A PCR at the machine
37
83
 
38
84
  ```tsx
@@ -66,6 +112,102 @@ hardest to picture: the first cycle's copies run on too far, the second makes th
66
112
  exactly the product's length, and from the third the product takes over. The programme a run was
67
113
  set to is kept with the run.
68
114
 
115
+ ## A digest at the gel station
116
+
117
+ ```tsx
118
+ import { InstrumentStage } from "@biolibs/bionet-scene";
119
+ import { useDigestBench } from "@biolibs/bionet-tools";
120
+
121
+ const bench = useDigestBench({ instrument });
122
+ <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
123
+ ```
124
+
125
+ The same five views as a PCR, named for this machine: the gel box, the gel in it, the power supply,
126
+ what is in the tube, and the gel once run. In the tube the molecule is drawn as its map with every
127
+ cut marked, in the scene and on the page, and the pieces are listed with what made each end and what
128
+ each carries. The run gel is drawn in the scene and on the page, and can be dragged back to watch
129
+ the pieces start in the well and draw apart.
130
+
131
+ ```ts
132
+ import { cutSites, cutsOf, digestPieces } from "@biolibs/bionet-tools";
133
+
134
+ const sites = cutSites(part, cutsOf(part, "EcoRI"));
135
+ sites[0]; // { at: 11, bottom: 15, overhang: "5′", bases: "AATT", site: { start: 10, end: 16 }, … }
136
+ digestPieces(part, sites); // each piece: from, to, length, left and right ends, features carried
137
+ ```
138
+
139
+ `cutSites` finds the enzyme's own bases behind each cut the restriction engine reports, on either
140
+ strand and across a circle's origin, and says where each strand is cut and what end that leaves.
141
+ Each piece is also a molecule of its own: `sequence` is every base either of its strands has and
142
+ `ends` how many at each end are unpaired. `digestRun` takes `keep`, the pieces to keep by where they
143
+ start, and the run it asks the lab to record then makes a tube of each: a part with those ends and
144
+ whatever the piece carries. That is cutting a band out of the gel and cleaning it up.
145
+
146
+ `digestChecks` is what a careful operator would ask before running the gel: pieces too close to tell
147
+ apart, a piece the gel will not hold, one cut of a circle, an enzyme that does nothing.
148
+
149
+ ## A ligation at the heat block
150
+
151
+ ```tsx
152
+ import { useLigationBench } from "@biolibs/bionet-tools";
153
+
154
+ const bench = useLigationBench({ instrument });
155
+ <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
156
+ ```
157
+
158
+ The step after a digest. Tick the cut pieces in the tube and what they would make is worked out from
159
+ their ends: which fit, in what order, which way round, and whether anything closes into a circle.
160
+ In the tube view the pieces are drawn as arcs with a gap at each join, and dragging closes them,
161
+ which is the ring closing and not decoration. What it makes is drawn as a map with each join marked,
162
+ carrying what each piece carried, turned round with it where a piece went in backwards.
163
+
164
+ ```ts
165
+ import { endBases, endsFit, planLigation } from "@biolibs/bionet-tools";
166
+
167
+ endBases(piece).right; // { kind: "5′", bases: "GATC" }
168
+ endsFit(endBases(a).right, endBases(b).left); // { kind: "5′", bases: "GATC" }, or null
169
+ planLigation([vector, insert]).products[0]; // its length, its pieces in order, its joins, its features
170
+ ```
171
+
172
+ The joining itself is `@biolibs/assembly2`'s. What this adds is what a bench has to read: where each
173
+ piece sits in the product, which way round it went, and what each join is made of.
174
+
175
+ `ligationChecks` is what a careful person would ask: a piece whose two ends fit each other and will
176
+ close on itself, the same pieces making one product with an insert in and another with it the other
177
+ way round, a blunt join that will mostly not happen, and a piece that came out of a PCR, which has
178
+ no phosphate for ligase to seal. `ratioWorking` is the arithmetic for how much of each to put in.
179
+
180
+ ## The working
181
+
182
+ ```tsx
183
+ import { ShowWorking, tmWorking, lengthWorking } from "@biolibs/bionet-tools";
184
+
185
+ tmWorking("fwd", "GGATCACAGTCTACACTG")?.steps;
186
+ // ["9 of its 18 bases are A or T, and 9 are G or C.", "2 × 9 + 4 × 9 = 54 °C."]
187
+
188
+ <ShowWorking working={lengthWorking(top, bottom, template, product.length)} />
189
+ ```
190
+
191
+ Everything the tool says is worked out in the window from the lab's own sequences, so it can all be
192
+ shown. Each figure opens to the steps that give it, and says on the outside whether it is `exact`
193
+ (it follows from the sequences alone) or an `estimate` (it rests on a rule of thumb, which is named).
194
+
195
+ - `tmWorking`: the count behind a melting temperature.
196
+ - `bindingWorking`: a primer laid against the strand it binds, base by base, drawn by `FacedBases`.
197
+ - `lengthWorking`: the product's length as a subtraction, compared with what the engine built.
198
+ - `programmeWorking`: where the suggested annealing temperature and extension time come from.
199
+ - `countsWorking`: how many strands there are after each cycle, as a table.
200
+ - `carriedWorking`: how each feature was moved from the template onto the product.
201
+ - `siteWorking`: one cut in its bases, drawn by `CutBases`.
202
+ - `piecesWorking`: the pieces as differences between cuts that add up to the whole, compared with the gel engine's.
203
+ - `migrationWorking`: how far a piece runs, by the rule the gel is drawn by.
204
+ - `joinWorking`: one join with its two overhangs written one over the other, drawn by `JoinBases`.
205
+ - `ligationLengthWorking`: the pieces' lengths, less the overhangs they share.
206
+ - `ratioWorking`: how much insert to put in for a given number of molecules to each of vector.
207
+
208
+ Every check from `programmeChecks` carries `because`: the comparison that raised it. At the machine,
209
+ the copied stretch is also marked off under the strands in the scene, with its subtraction.
210
+
69
211
  ## A digest and its gel
70
212
 
71
213
  ```ts
@@ -81,8 +223,8 @@ const run = digestRun(lab, { tube, enzymes: ["EcoRI"] }); // what to record, if
81
223
 
82
224
  `planDigest` gives the cuts, the pieces, and the bands they and a ladder would show on a gel, from
83
225
  `@biolibs/restriction` and `@biolibs/gel`. A digest here is a check: recording it uses some of the
84
- tube, makes nothing, and notes which enzymes, what was expected and whether the gel showed it.
85
- Keeping a cut piece as a tube is not offered, because a part cannot yet say what ends it has.
226
+ tube and notes which enzymes, what was expected and whether the gel showed it. Pieces can be kept
227
+ as tubes, each a part with the ends the enzymes left.
86
228
 
87
229
  ## The tool
88
230
 
@@ -91,7 +233,7 @@ import "@biolibs/bionet-tools/tools.css";
91
233
  import { InstrumentTool, PcrTool } from "@biolibs/bionet-tools";
92
234
 
93
235
  <InstrumentTool place={thermocyclerId} onDone={close} /> // the tool for whichever instrument that is
94
- <Tools /> // every tool, for a lab that has not drawn its room
236
+ <Tools /> // every tool, and the lab's sequences
95
237
  <PcrTool /> // or one tool on its own; DigestTool likewise
96
238
  ```
97
239
 
@@ -0,0 +1,84 @@
1
+ /**
2
+ * A digest and its gel at the gel station: what is shown beside the instrument, and what the scene
3
+ * is told to draw.
4
+ *
5
+ * A gel box and its power supply show a voltage, a current and a time. They show nothing of the
6
+ * DNA: where it was cut, how many pieces there are, how far each has run. That is pictured, and
7
+ * then read off the gel against a ladder. So the views run the same way as a PCR's: the rig, the
8
+ * gel in it, what the power supply says, then what is in the tube, and the gel once it has run.
9
+ */
10
+ import { type ReactNode } from "react";
11
+ import { type DrawnMolecule } from "./sequence-file.js";
12
+ /** The views of the gel station, by the same names every instrument's stage uses. */
13
+ export type DigestView = "machine" | "block" | "screen" | "tube" | "result";
14
+ /** What the scene is told to show. It is shaped to be spread onto `InstrumentStage`. */
15
+ export interface DigestStage {
16
+ model: "gel-station";
17
+ name: string;
18
+ view: DigestView;
19
+ onView: (view: DigestView) => void;
20
+ /** What the power supply's display says. */
21
+ screen: {
22
+ text: string;
23
+ lit?: boolean;
24
+ }[];
25
+ /** The lane the digest is loaded in. */
26
+ well?: {
27
+ row: number;
28
+ column: number;
29
+ };
30
+ /** The molecule being cut, with the cuts marked, for the view into the tube. */
31
+ molecule?: DrawnMolecule & {
32
+ marks: {
33
+ at: number;
34
+ label: string;
35
+ }[];
36
+ };
37
+ /** The gel once run: the ladder and the digest, for the last view. */
38
+ gel?: {
39
+ lanes: {
40
+ name: string;
41
+ tone: "dim" | "held";
42
+ bands: {
43
+ position: number;
44
+ intensity: number;
45
+ label: string;
46
+ }[];
47
+ }[];
48
+ ran: number;
49
+ };
50
+ }
51
+ /**
52
+ * A digest and its gel, at the gel station.
53
+ *
54
+ * @param options - `start` says what to open on, for a tour or a link; `instrument` is the gel station it is run at, if the lab has one; `onDone` adds a way to leave.
55
+ * @returns `stage`, to spread onto `InstrumentStage` from `@biolibs/bionet-scene`, and `panel`, to put inside it.
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * import { useDigestBench } from "@biolibs/bionet-tools";
60
+ *
61
+ * // `InstrumentStage` is the scene package's: it is handed what this gives and draws it.
62
+ * const bench = useDigestBench({ instrument });
63
+ * <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
64
+ * ```
65
+ */
66
+ export declare function useDigestBench({ instrument, onDone, start }?: {
67
+ instrument?: {
68
+ id: string;
69
+ name: string;
70
+ } | null;
71
+ onDone?: () => void;
72
+ /** What to open on: the view, the tube and enzymes already chosen, the pieces to keep. Read once. */
73
+ start?: {
74
+ view?: DigestView;
75
+ tube?: string;
76
+ enzymes?: readonly string[];
77
+ keep?: readonly number[];
78
+ ran?: number;
79
+ };
80
+ }): {
81
+ stage: DigestStage;
82
+ panel: ReactNode;
83
+ };
84
+ //# sourceMappingURL=digest-bench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-bench.d.ts","sourceRoot":"","sources":["../src/digest-bench.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS1D,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGpE,qFAAqF;AACrF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5E,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,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AE,SAAS,MAAM,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9G,GAAG;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAoPhD"}
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * A digest and its gel at the gel station: what is shown beside the instrument, and what the scene
5
+ * is told to draw.
6
+ *
7
+ * A gel box and its power supply show a voltage, a current and a time. They show nothing of the
8
+ * DNA: where it was cut, how many pieces there are, how far each has run. That is pictured, and
9
+ * then read off the gel against a ladder. So the views run the same way as a PCR's: the rig, the
10
+ * gel in it, what the power supply says, then what is in the tube, and the gel once it has run.
11
+ */
12
+ import { useMemo, useState } from "react";
13
+ import { GELS, LADDERS, gelById } from "@biolibs/gel";
14
+ import { useAct, useLab } from "@biolibs/bionet-react";
15
+ import { Glossed } from "@biolibs/glossary-react";
16
+ import { cutters, enzymeNamed } from "./digest.js";
17
+ import { Gel } from "./digest-tool.js";
18
+ import { cutSites, digestChecks, digestPieces, migrationWorking, piecesWorking, siteWorking } from "./digest-working.js";
19
+ import { SequenceMap } from "./map.js";
20
+ import { digestRun, digestTubes } from "./run.js";
21
+ import { moleculeOf } from "./sequence-file.js";
22
+ import { CutBases, ShowWorking } from "./working.js";
23
+ const count = (value) => value.toLocaleString("en-US");
24
+ const whole = (text) => (/^\d+$/.test(text.trim()) ? Number(text) : undefined);
25
+ const endWords = (end) => (end.enzyme === null ? _jsx("span", { className: "dim", children: "the molecule's end" })
26
+ : _jsxs(_Fragment, { children: [end.enzyme, " ", _jsx("span", { className: "dim", children: end.overhang === "blunt" ? "blunt" : `${end.overhang} ` }), end.overhang !== "blunt" && _jsx("code", { children: end.bases })] }));
27
+ /**
28
+ * A digest and its gel, at the gel station.
29
+ *
30
+ * @param options - `start` says what to open on, for a tour or a link; `instrument` is the gel station it is run at, if the lab has one; `onDone` adds a way to leave.
31
+ * @returns `stage`, to spread onto `InstrumentStage` from `@biolibs/bionet-scene`, and `panel`, to put inside it.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * import { useDigestBench } from "@biolibs/bionet-tools";
36
+ *
37
+ * // `InstrumentStage` is the scene package's: it is handed what this gives and draws it.
38
+ * const bench = useDigestBench({ instrument });
39
+ * <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
40
+ * ```
41
+ */
42
+ export function useDigestBench({ instrument = null, onDone, start } = {}) {
43
+ const lab = useLab()?.lab;
44
+ const act = useAct();
45
+ const [view, setView] = useState(start?.view ?? "machine");
46
+ const [tube, setTube] = useState(start?.tube ?? "");
47
+ const [chosen, setChosen] = useState([...(start?.enzymes ?? [])]);
48
+ const [other, setOther] = useState("");
49
+ const [unknown, setUnknown] = useState(null);
50
+ const [used, setUsed] = useState("1");
51
+ const [gel, setGel] = useState("1.0");
52
+ const [ladder, setLadder] = useState("1kb");
53
+ const [volts, setVolts] = useState("100");
54
+ const [minutes, setMinutes] = useState("45");
55
+ const [ran, setRan] = useState(start?.ran ?? 100);
56
+ const [note, setNote] = useState("");
57
+ const [busy, setBusy] = useState(false);
58
+ const [said, setSaid] = useState(null);
59
+ const [keep, setKeep] = useState([...(start?.keep ?? [])]);
60
+ const [amount, setAmount] = useState("20");
61
+ const tubes = useMemo(() => (lab === null || lab === undefined ? [] : digestTubes(lab)), [lab]);
62
+ const part = tubes.find((one) => one.item === tube)?.part;
63
+ const offered = useMemo(() => (part === undefined ? [] : cutters(part)), [part]);
64
+ const run = useMemo(() => (lab === null || lab === undefined ? null : digestRun(lab, {
65
+ tube, enzymes: chosen, gel, ladder, instrument: instrument?.id ?? null, note, ...(whole(used) === undefined ? {} : { used: whole(used) }),
66
+ ...(whole(volts) === undefined ? {} : { volts: whole(volts) }), ...(whole(minutes) === undefined ? {} : { minutes: whole(minutes) }),
67
+ keep: keep.map((from) => ({ from, ...(whole(amount) === undefined ? {} : { amount: whole(amount) }) })),
68
+ })), [lab, tube, chosen, gel, ladder, instrument, note, used, volts, minutes, keep, amount]);
69
+ const plan = run?.plan ?? null;
70
+ const good = plan !== null && plan.problem === null ? plan : null;
71
+ const sites = useMemo(() => (part === undefined || plan === null ? [] : plan.cutters.flatMap((one) => cutSites(part, one)).sort((a, b) => a.at - b.at)), [part, plan]);
72
+ const pieces = useMemo(() => (part === undefined ? [] : digestPieces(part, sites)), [part, sites]);
73
+ // A piece is known by where it starts, so a change of enzymes lets go of pieces that are no longer there.
74
+ const kept = pieces.filter((piece) => keep.includes(piece.from));
75
+ const gelType = useMemo(() => { try {
76
+ return gelById(gel);
77
+ }
78
+ catch {
79
+ return gelById("1.0");
80
+ } }, [gel]);
81
+ const checks = part === undefined || good === null ? [] : digestChecks(part, good, gelType);
82
+ const stage = {
83
+ model: "gel-station", name: instrument?.name ?? "Gel station", view, onView: setView,
84
+ screen: [{ text: `${whole(volts) ?? "—"} V`, lit: true }, { text: `${whole(minutes) ?? "—"}:00 min` }],
85
+ ...(part === undefined ? {} : { well: { row: 0, column: 1 } }),
86
+ ...(part === undefined || view !== "tube" ? {} : { molecule: (() => {
87
+ const drawn = moleculeOf(part);
88
+ // A piece being kept is drawn on the molecule, so what is taken can be seen against what is left.
89
+ const taken = kept.flatMap((piece) => (piece.to > piece.from ? [[piece.from, piece.to]] : [[piece.from, part.length], [0, piece.to]]).filter(([start, end]) => end > start)
90
+ .map(([start, end]) => ({ start: start, end: end, strand: 0, tone: "found", label: `kept · ${count(piece.length)} bp` })));
91
+ return { ...drawn, features: [...taken, ...drawn.features], marks: sites.map((one) => ({ at: one.at, label: one.enzyme })) };
92
+ })() }),
93
+ ...(good === null ? {} : { gel: { ran: ran / 100, lanes: [
94
+ { name: "ladder", tone: "dim", bands: good.ladder.map((band) => ({ position: band.position, intensity: 0.6, label: count(band.size) })) },
95
+ { name: part?.name ?? "digest", tone: "held", bands: good.bands.map((band) => ({ position: band.position, intensity: band.intensity,
96
+ label: `${band.sizes.map(count).join(" + ")}${kept.some((piece) => band.sizes.includes(piece.length)) ? " · kept" : ""}` })) },
97
+ ] } }),
98
+ };
99
+ const toggle = (name) => { setChosen(chosen.includes(name) ? chosen.filter((one) => one !== name) : [...chosen, name]); setSaid(null); setKeep([]); };
100
+ const record = async (what, done) => {
101
+ if (what === null)
102
+ return;
103
+ setBusy(true);
104
+ const answer = await act("recordRun", what);
105
+ setBusy(false);
106
+ if (answer.ok) {
107
+ setSaid(done);
108
+ setNote("");
109
+ setKeep([]);
110
+ }
111
+ };
112
+ const here = lab === null || lab === undefined ? [] : lab.runs.filter((one) => one.kind === "digest" && (instrument === null || one.instrument === instrument.id)).slice(-5).reverse();
113
+ const partName = (item) => lab?.parts.find((one) => one.checksum === lab.items.find((each) => each.item === item)?.part)?.name ?? "a tube";
114
+ const checked = checks.length === 0 ? _jsx("p", { className: "small good", children: "Nothing about this digest looks wrong for this gel." })
115
+ : _jsx("ul", { className: "checks", children: checks.map((check) => _jsxs("li", { className: check.weight, children: [check.says, " ", _jsx("code", { className: "because", children: check.because })] }, check.says)) });
116
+ 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: "Digest and gel" }), onDone !== undefined && _jsx("button", { type: "button", className: "quiet", onClick: onDone, children: "Back to the lab" })] }), tubes.length === 0 ? _jsx("p", { className: "empty", children: "There are no tubes to digest. Add a part and a tube of it on the Freezer tab." }) : (_jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsxs("label", { children: ["Tube", _jsxs("select", { value: tube, onChange: (event) => { setTube(event.target.value); setChosen([]); setSaid(null); setKeep([]); }, "aria-label": "Tube", children: [_jsx("option", { value: "", children: "Choose a tube\u2026" }), tubes.map((one) => _jsx("option", { value: one.item, children: one.label }, one.item))] })] }), part !== undefined && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "label", children: ["Enzymes", offered.length === 0 ? " · none of the usual ones cut this" : ""] }), _jsxs("div", { className: "enzymes", children: [offered.map((one) => (_jsxs("label", { className: "check", title: `${one.site} · cuts ${one.positions.length === 1 ? "once" : `${one.positions.length} times`}`, children: [_jsx("input", { type: "checkbox", checked: chosen.includes(one.name), onChange: () => toggle(one.name) }), " ", one.name, " ", _jsxs("span", { className: "dim small", children: ["\u00D7", one.positions.length] })] }, one.name))), chosen.filter((name) => !offered.some((one) => one.name === name)).map((name) => (_jsxs("label", { className: "check", children: [_jsx("input", { type: "checkbox", checked: true, onChange: () => toggle(name) }), " ", name] }, name)))] }), _jsxs("form", { className: "row tight", onSubmit: (event) => {
117
+ event.preventDefault();
118
+ const name = enzymeNamed(other);
119
+ setUnknown(name === null && other.trim() !== "" ? other.trim() : null);
120
+ if (name !== null && !chosen.includes(name))
121
+ setChosen([...chosen, name]);
122
+ if (name !== null)
123
+ setOther("");
124
+ }, children: [_jsx("input", { value: other, onChange: (event) => setOther(event.target.value), placeholder: "Another enzyme, by name", "aria-label": "Another enzyme", maxLength: 40, spellCheck: false }), _jsx("button", { type: "submit", className: "quiet", children: "Add" })] }), unknown !== null && _jsxs("p", { className: "trouble small", role: "status", children: ["There is no enzyme called ", unknown, " here."] })] }))] })), plan !== null && chosen.length > 0 && plan.problem !== null && _jsx("p", { className: "trouble", role: "status", children: plan.problem })] }), view === "machine" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "At the gel box" }), _jsx("p", { className: "small", children: _jsx(Glossed, { text: "A restriction enzyme cuts DNA wherever its site occurs, and gel electrophoresis sorts the pieces by size. A check digest cuts a plasmid with enzymes whose sites are known, to see that the pieces come out the lengths they should." }) }), _jsx("p", { className: "dim small", children: "A gel box and its power supply show volts, current and time. They show nothing of the DNA. The first three views are what is there to see; the last two are what you picture, and then read off the gel." })] })), view === "block" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The gel" }), _jsx("p", { className: "voice", children: "The machine" }), _jsxs("fieldset", { disabled: busy, className: "programme", children: [_jsxs("label", { children: ["Gel", _jsx("select", { value: gel, onChange: (event) => setGel(event.target.value), children: GELS.map((one) => _jsxs("option", { value: one.id, children: [one.percent, "% agarose"] }, one.id)) })] }), _jsxs("label", { children: ["Ladder", _jsx("select", { value: ladder, onChange: (event) => setLadder(event.target.value), children: LADDERS.map((one) => _jsx("option", { value: one.id, children: one.name }, one.id)) })] })] }), _jsx("p", { className: "small", children: _jsx(Glossed, { text: "A slab of agarose in buffer, with a row of wells at one end. The wells go at the negative end, since DNA runs towards the positive one." }) }), _jsx("p", { className: "voice", children: "This run" }), _jsxs("p", { className: "small", children: [part === undefined ? "Nothing is loaded yet. Choose a tube above." : `The ladder is in the first lane and ${part.name} in the second.`, " This gel separates pieces from ", count(gelType.largest), " down to ", count(gelType.smallest), " bp."] }), good !== null && _jsxs(_Fragment, { children: [_jsx("p", { className: "voice", children: "Checks" }), checked] })] })), view === "screen" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The power supply" }), _jsx("p", { className: "voice", children: "The machine" }), _jsxs("fieldset", { disabled: busy, className: "programme", children: [_jsxs("label", { children: ["Run at", _jsx("input", { type: "number", min: 10, max: 300, step: 5, value: volts, onChange: (event) => setVolts(event.target.value) }), " V"] }), _jsxs("label", { children: ["for", _jsx("input", { type: "number", min: 1, max: 600, step: 5, value: minutes, onChange: (event) => setMinutes(event.target.value) }), " min"] })] }), _jsx("p", { className: "voice", children: "What is going on" }), _jsx("p", { className: "small", children: "DNA carries a negative charge all along its backbone, so in a field every piece is pulled towards the positive electrode. The agarose holds long pieces back more than short ones, and that is what sorts them." }), _jsx("p", { className: "dim small", children: "Nothing here works out how far a given voltage and time move the bands: that depends on the box, the buffer and the gel. What is set is kept with the run, and the gel is drawn as run until the smallest pieces it separates near the far end." })] })), view === "tube" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "In the tube" }), part === undefined || good === null ? _jsx("p", { className: "dim small", children: part === undefined ? "Choose a tube and its enzymes to see where it is cut." : "Choose enzymes that cut this to see the pieces." }) : (_jsxs(_Fragment, { children: [_jsx(SequenceMap, { name: part.name, length: part.length, circular: part.circular, features: part.features, marks: sites.map((one) => ({ at: one.at, label: one.enzyme })) }), _jsx("p", { className: "voice", children: "This run" }), _jsxs("p", { children: [_jsxs("strong", { children: [pieces.length, " ", pieces.length === 1 ? "piece" : "pieces"] }), " ", _jsxs("span", { className: "dim", children: ["from ", sites.length, " ", sites.length === 1 ? "cut" : "cuts"] })] }), _jsxs("table", { className: "pieces", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Keep" }), _jsx("th", { children: "Length" }), _jsx("th", { children: "From" }), _jsx("th", { children: "One end" }), _jsx("th", { children: "Other end" }), _jsx("th", { children: "Carries" })] }) }), _jsx("tbody", { children: pieces.map((piece) => (_jsxs("tr", { children: [_jsx("td", { children: _jsx("input", { type: "checkbox", checked: keep.includes(piece.from), "aria-label": `Keep the ${count(piece.length)} bp piece`, onChange: () => setKeep(keep.includes(piece.from) ? keep.filter((one) => one !== piece.from) : [...keep, piece.from]) }) }), _jsx("td", { children: _jsx("strong", { children: count(piece.length) }) }), _jsx("td", { children: _jsxs("code", { children: [count(piece.from + 1), "..", count(piece.to)] }) }), _jsx("td", { children: endWords(piece.left) }), _jsx("td", { children: endWords(piece.right) }), _jsx("td", { className: "dim", children: piece.features.map((one) => one.label).join(", ") || "—" })] }, `${piece.from} ${piece.to}`))) })] }), _jsx("p", { className: "small", children: _jsx(Glossed, { text: "An end with unpaired bases is a sticky end, and will only join to an end whose unpaired bases pair with it. A blunt end has none." }) }), _jsx("p", { className: "dim small", children: "Tick a piece to keep it. Cutting its band out of the gel and cleaning it up gives a tube of that piece, with these ends, once the gel has matched." }), _jsx("p", { className: "voice", children: "The working" }), sites.map((site) => _jsx(ShowWorking, { working: siteWorking(site), children: _jsx(CutBases, { site: site }) }, `${site.enzyme} ${site.at}`)), _jsx(ShowWorking, { working: piecesWorking(part, sites, good) })] }))] })), view === "result" && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "The gel, run" }), part === undefined || good === null ? _jsx("p", { className: "dim small", children: "Choose a tube and enzymes that cut it to see the gel it should give." }) : (_jsxs(_Fragment, { children: [_jsx("p", { className: "voice", children: "This run" }), _jsx(Gel, { ladder: good.ladder, bands: good.bands, name: part.name }), _jsxs("label", { className: "small", children: ["How far it has run", _jsx("input", { type: "range", min: 0, max: 100, step: 1, value: ran, onChange: (event) => setRan(Number(event.target.value)), "aria-label": "How far the gel has run" })] }), _jsx("p", { className: "dim small", children: "Drag it back to see the pieces start together in the well and draw apart as they run. The scene follows." }), good.bands.some((band) => band.unresolved) && _jsx("p", { className: "dim small", children: "* outside what this gel separates." }), _jsx("p", { className: "voice", children: "Checks" }), checked, _jsx("p", { className: "voice", children: "The working" }), [...new Set(good.fragments)].map((size) => _jsx(ShowWorking, { working: migrationWorking(size, gelType) }, size)), _jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsxs("label", { children: ["Used, from the tube", _jsx("input", { type: "number", min: 0, step: 1, value: used, onChange: (event) => setUsed(event.target.value), "aria-label": "Amount used" })] }), _jsxs("label", { children: ["Note", _jsx("input", { value: note, onChange: (event) => setNote(event.target.value), placeholder: "Anything worth remembering about this gel", maxLength: 2000 })] }), kept.length > 0 && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "small", children: ["Keeping ", kept.map((piece) => `${count(piece.length)} bp`).join(" and "), ": ", kept.length === 1 ? "a new tube" : `${kept.length} new tubes`, ", each a part with the ends the enzymes left."] }), _jsxs("label", { children: ["Amount of each, in \u00B5L", _jsx("input", { type: "number", min: 0, step: 1, value: amount, onChange: (event) => setAmount(event.target.value), "aria-label": "Amount of each kept piece" })] })] })), _jsxs("div", { className: "row", children: [_jsx("button", { type: "button", onClick: () => void record(run?.matched ?? null, kept.length === 0 ? "Recorded: the gel showed what was expected." : `Recorded: the gel matched, and ${kept.length === 1 ? "the piece is" : `${kept.length} pieces are`} in the freezer.`), children: kept.length === 0 ? "The gel matched" : `The gel matched · keep ${kept.length === 1 ? "the piece" : `${kept.length} pieces`}` }), _jsx("button", { type: "button", className: "quiet", onClick: () => void record(run?.differed ?? null, "Recorded: the gel did not show what was expected."), children: "The gel did not match" })] })] }), said !== null && _jsx("p", { className: "small", role: "status", children: said })] }))] })), here.length > 0 && view === "result" && (_jsxs("section", { className: "card", children: [_jsxs("h2", { children: ["Recent digests", instrument === null ? "" : " here"] }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Tube" }), _jsx("th", { children: "Enzymes" }), _jsx("th", { children: "Expected" }), _jsx("th", { children: "Gel" })] }) }), _jsx("tbody", { children: here.map((one) => (_jsxs("tr", { children: [_jsx("td", { children: partName(one.inputs[0]?.item) }), _jsx("td", { children: String(one.settings["enzymes"] ?? "").replace(/\+/g, " + ") }), _jsx("td", { className: "dim", children: String(one.settings["expected"] ?? "") }), _jsx("td", { children: one.outcome === "worked" ? "matched" : _jsx("span", { className: "badge", children: "did not match" }) })] }, one.run))) })] })] }))] }));
125
+ return { stage, panel };
126
+ }
127
+ //# sourceMappingURL=digest-bench.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-bench.js","sourceRoot":"","sources":["../src/digest-bench.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EA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CAAC,CAAC,EAAE,IAAI,CAAC,GAAM,EACxC,uBAAK,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAM,EACtE,aAAI,SAAS,EAAC,KAAK,YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,GAAM,EACjE,uBAAK,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,OAAO,8BAAqB,GAAM,KAJvF,GAAG,CAAC,GAAG,CAKX,CACN,CAAC,GACI,IACF,IACA,CACX,IACG,CACP,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * A digest looked at closely: each cut in its real bases, each piece with its ends, and the working.
3
+ *
4
+ * `digest.ts` says where enzymes cut and how long the pieces are. This says what somebody at the
5
+ * bench pictures and what somebody checking would ask: which bases the enzyme recognised, where it
6
+ * cut each strand and what end that leaves, which cut made each end of each piece, and what is
7
+ * marked on each piece. Like the PCR's working, each figure says whether it is exact or an estimate.
8
+ */
9
+ import type { PartFeature } from "@biolibs/bionet";
10
+ import { type GelType } from "@biolibs/gel";
11
+ import type { Cutter, DigestPlan } from "./digest.js";
12
+ import type { Working } from "./pcr-working.js";
13
+ /** One place an enzyme cuts, in the molecule's own bases. */
14
+ export interface CutSite {
15
+ /** The enzyme. */
16
+ enzyme: string;
17
+ /** The sequence it recognises, as it is written for the enzyme. */
18
+ recognises: string;
19
+ /** Where the top strand is cut: the number of bases before the cut. */
20
+ at: number;
21
+ /** Where the bottom strand is cut, counted along the top strand in the same way. */
22
+ bottom: number;
23
+ /** How far the bottom strand's cut is to the right of the top strand's: positive for a 5′ overhang, negative for a 3′ one, 0 for blunt. */
24
+ stagger: number;
25
+ /** Where the recognised bases are, from the first to one past the last. On a circle the end may be past the origin. */
26
+ site: {
27
+ start: number;
28
+ end: number;
29
+ };
30
+ /** Whether the site reads along the bottom strand. Only an enzyme whose site is not its own mirror can. */
31
+ backwards: boolean;
32
+ /** What kind of end the cut leaves. */
33
+ overhang: "5′" | "3′" | "blunt";
34
+ /** The single-stranded bases of that end, as the top strand has them. Empty for a blunt cut. */
35
+ bases: string;
36
+ /**
37
+ * The stretch around the cut, for drawing: both strands, the bottom written under the top, and
38
+ * within them where the recognised bases are and how many bases precede each strand's cut.
39
+ */
40
+ around: {
41
+ from: number;
42
+ top: string;
43
+ bottom: string;
44
+ site: [number, number];
45
+ cutTop: number;
46
+ cutBottom: number;
47
+ };
48
+ }
49
+ /**
50
+ * Every place one enzyme cuts, with the bases it recognised there.
51
+ *
52
+ * The cut positions come from the restriction engine. This finds the site behind each one by
53
+ * looking for the enzyme's sequence itself, on both strands, and keeps only sites whose cut the
54
+ * engine also found, so each position is explained and none is invented.
55
+ *
56
+ * @param part - The molecule.
57
+ * @param cutter - The enzyme and where it cuts, from `cutsOf`.
58
+ * @returns The sites, in order along the molecule. A cut whose site cannot be found is left out.
59
+ */
60
+ export declare function cutSites(part: {
61
+ sequence: string;
62
+ circular: boolean;
63
+ }, cutter: Cutter): CutSite[];
64
+ /** One end of a piece: what made it. */
65
+ export interface PieceEnd {
66
+ /** The enzyme that cut here, or `null` if this is the molecule's own end. */
67
+ enzyme: string | null;
68
+ /** What kind of end it is. */
69
+ overhang: "5′" | "3′" | "blunt" | "end";
70
+ /** Its single-stranded bases, as the top strand has them. */
71
+ bases: string;
72
+ }
73
+ /** One piece of a digest. */
74
+ export interface DigestPiece {
75
+ /** Where it starts and stops on the molecule. On a circle a piece may run through the origin, so `to` can be the smaller. */
76
+ from: number;
77
+ to: number;
78
+ /** How long it is. */
79
+ length: number;
80
+ /** Its two ends. */
81
+ left: PieceEnd;
82
+ right: PieceEnd;
83
+ /** What is marked on it, placed on the piece's own sequence. Something cut through is kept as far as it is on the piece. */
84
+ features: PartFeature[];
85
+ /** Every base either of its strands has, read along the top strand: the piece as a molecule of its own. */
86
+ sequence: string;
87
+ /** How many of those bases at each end are on one strand only: positive for a 5′ overhang, negative for a 3′ one. */
88
+ ends: {
89
+ left: number;
90
+ right: number;
91
+ };
92
+ }
93
+ /**
94
+ * The pieces a digest gives, each with what made its ends and what it carries.
95
+ *
96
+ * @param part - The molecule, with what is marked on it.
97
+ * @param sites - Every cut, from `cutSites` for each enzyme.
98
+ * @returns The pieces, longest first. Nothing if there are no cuts.
99
+ */
100
+ export declare function digestPieces(part: {
101
+ sequence: string;
102
+ circular: boolean;
103
+ features?: readonly PartFeature[];
104
+ }, sites: readonly CutSite[]): DigestPiece[];
105
+ /**
106
+ * One cut, said as steps that can be checked against the bases.
107
+ *
108
+ * @param site - The cut, from `cutSites`.
109
+ * @returns The working.
110
+ */
111
+ export declare function siteWorking(site: CutSite): Working;
112
+ /**
113
+ * How long the pieces are, as differences between the cuts, with the check that they add up.
114
+ *
115
+ * @param part - How long the molecule is, and whether it is a circle.
116
+ * @param sites - Every cut.
117
+ * @param plan - The digest as the gel engine worked it out, to compare with.
118
+ * @returns The working.
119
+ */
120
+ export declare function piecesWorking(part: {
121
+ length: number;
122
+ circular: boolean;
123
+ }, sites: readonly CutSite[], plan?: Pick<DigestPlan, "fragments">): Working;
124
+ /**
125
+ * Where a piece runs to on a gel, with the rule behind it.
126
+ *
127
+ * @param size - How long the piece is.
128
+ * @param gel - The gel.
129
+ * @returns The working. It is an estimate: the rule is a straight line that real gels only roughly follow.
130
+ */
131
+ export declare function migrationWorking(size: number, gel: GelType): Working;
132
+ /** Something a careful operator would stop and ask about a digest before running the gel. */
133
+ export interface DigestCheck {
134
+ /** `stop` if the gel is unlikely to show what is hoped, `look` if it is only worth a second glance. */
135
+ weight: "stop" | "look";
136
+ /** What to ask, said for a person. */
137
+ says: string;
138
+ /** The comparison that raised it, so it can be checked. */
139
+ because: string;
140
+ }
141
+ /**
142
+ * What a careful operator would ask of a digest, given the gel it is to be run on.
143
+ *
144
+ * Each may be wrong for a particular bench, and none stops a run.
145
+ *
146
+ * @param part - The molecule.
147
+ * @param plan - The digest, from `planDigest`.
148
+ * @param gel - The gel.
149
+ * @returns The checks that apply, the ones most likely to matter first.
150
+ */
151
+ export declare function digestChecks(part: {
152
+ length: number;
153
+ circular: boolean;
154
+ }, plan: Pick<DigestPlan, "cutters" | "fragments" | "bands">, gel: GelType): DigestCheck[];
155
+ //# sourceMappingURL=digest-working.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-working.d.ts","sourceRoot":"","sources":["../src/digest-working.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAUhD,6DAA6D;AAC7D,MAAM,WAAW,OAAO;IACtB,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,2IAA2I;IAC3I,OAAO,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,2GAA2G;IAC3G,SAAS,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC;IAChC,gGAAgG;IAChG,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,EAAE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