@biolibs/bionet-tools 0.1.14 → 0.1.15
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 +32 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +17 -4
- package/dist/plans.js.map +1 -1
- package/dist/route.d.ts +93 -0
- package/dist/route.d.ts.map +1 -0
- package/dist/route.js +150 -0
- package/dist/route.js.map +1 -0
- package/dist/work.d.ts.map +1 -1
- package/dist/work.js +18 -4
- package/dist/work.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -0
- package/src/plans.tsx +21 -3
- package/src/route.ts +167 -0
- package/src/work.tsx +22 -3
package/README.md
CHANGED
|
@@ -184,6 +184,38 @@ close on itself, the same pieces making one product with an insert in and anothe
|
|
|
184
184
|
way round, a blunt join that will mostly not happen, and a piece that came out of a PCR, which has
|
|
185
185
|
no phosphate for ligase to seal. `ratioWorking` is the arithmetic for how much of each to put in.
|
|
186
186
|
|
|
187
|
+
### Whether a route has one answer
|
|
188
|
+
|
|
189
|
+
A design can be right and the route to it still be wrong. `checkRoute` asks the question a sequence
|
|
190
|
+
cannot: cut the finished design with the enzymes the plan names, put the pieces back together every
|
|
191
|
+
way their ends allow, and count the circles. One is a route with one answer.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { checkRoute, routeOf, saysRoute } from "@biolibs/bionet-tools";
|
|
195
|
+
|
|
196
|
+
routeOf(plan); // ["BamHI", "AvrII"], read from settings.cut_with
|
|
197
|
+
const checked = checkRoute(plan.expects[0], routeOf(plan));
|
|
198
|
+
checked.makesIt; // whether the route makes what the plan expects
|
|
199
|
+
checked.instead; // the circles it could make instead — each one
|
|
200
|
+
// the right length, so a gel will not tell them apart
|
|
201
|
+
saysRoute(checked); // the line to show somebody, or null if there is nothing to say
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The case it catches is quiet. An enzyme that cuts the vector twice gives a piece with the same
|
|
205
|
+
overhang at both ends; it goes in either way round, both ways close into a plasmid of exactly the
|
|
206
|
+
right length, and a check digest with those same enzymes shows the same bands for either. The wrong
|
|
207
|
+
plasmid looks right. Cutting with something that cuts once instead makes the ligation directional
|
|
208
|
+
and leaves one product.
|
|
209
|
+
|
|
210
|
+
A plan has no field for its enzymes, so `routeOf` reads the words somebody wrote in `settings`,
|
|
211
|
+
usually `cut_with`. That is a convention rather than a promise: it returns what it could make of the
|
|
212
|
+
words and nothing for words that are not enzymes.
|
|
213
|
+
|
|
214
|
+
This is asked for rather than worked out for you. Putting a plasmid's pieces back together every way
|
|
215
|
+
round takes tens of milliseconds, and a lab's log is merged on every change and every sync, so it
|
|
216
|
+
does not belong there. The panels that show it keep the answer until the plan's product or its
|
|
217
|
+
enzymes change.
|
|
218
|
+
|
|
187
219
|
## Designing primers
|
|
188
220
|
|
|
189
221
|
Primers are designed at a desk and ordered, so this tool has no instrument. It takes a part from the
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* - `fusion-bench.tsx` — that at a desk: the pieces in order, and the frame watched as they are laid out
|
|
30
30
|
* - `assembly-bench.tsx` — building a ring at a desk: the pieces in order, and the primers that make them fit
|
|
31
31
|
* - `ligate.ts` — pieces that have already been cut, joined where their ends fit
|
|
32
|
+
* - `route.ts` — whether the cut and ligation a plan names could make more than one thing
|
|
32
33
|
* - `ligate-working.ts` — a ligation's working: each join in its bases, the length, how much to put in
|
|
33
34
|
* - `ligate-bench.tsx` — a ligation at the heat block: what is shown beside it, and what the scene draws
|
|
34
35
|
* - `digest-working.ts` — a digest looked at closely: each cut in its bases, each piece with its ends, the working
|
|
@@ -72,6 +73,7 @@ export * from "./fusion.js";
|
|
|
72
73
|
export * from "./fusion-bench.js";
|
|
73
74
|
export * from "./assembly-bench.js";
|
|
74
75
|
export * from "./ligate.js";
|
|
76
|
+
export * from "./route.js";
|
|
75
77
|
export * from "./ligate-working.js";
|
|
76
78
|
export * from "./ligate-bench.js";
|
|
77
79
|
export * from "./running.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* - `fusion-bench.tsx` — that at a desk: the pieces in order, and the frame watched as they are laid out
|
|
30
30
|
* - `assembly-bench.tsx` — building a ring at a desk: the pieces in order, and the primers that make them fit
|
|
31
31
|
* - `ligate.ts` — pieces that have already been cut, joined where their ends fit
|
|
32
|
+
* - `route.ts` — whether the cut and ligation a plan names could make more than one thing
|
|
32
33
|
* - `ligate-working.ts` — a ligation's working: each join in its bases, the length, how much to put in
|
|
33
34
|
* - `ligate-bench.tsx` — a ligation at the heat block: what is shown beside it, and what the scene draws
|
|
34
35
|
* - `digest-working.ts` — a digest looked at closely: each cut in its bases, each piece with its ends, the working
|
|
@@ -72,6 +73,7 @@ export * from "./fusion.js";
|
|
|
72
73
|
export * from "./fusion-bench.js";
|
|
73
74
|
export * from "./assembly-bench.js";
|
|
74
75
|
export * from "./ligate.js";
|
|
76
|
+
export * from "./route.js";
|
|
75
77
|
export * from "./ligate-working.js";
|
|
76
78
|
export * from "./ligate-bench.js";
|
|
77
79
|
export * from "./running.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC"}
|
package/dist/plans.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1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names. That is decided from what is set up, not from a button pressed earlier, so a bench that is
|
|
14
14
|
* changed after being set up from a plan stops claiming to be that plan.
|
|
15
15
|
*/
|
|
16
|
-
import { useState } from "react";
|
|
16
|
+
import { useMemo, useState } from "react";
|
|
17
17
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
18
|
+
import { checkRoute, routeOf, saysRoute } from "./route.js";
|
|
18
19
|
/**
|
|
19
20
|
* A run as a tool would record it, turned into the same run proposed.
|
|
20
21
|
*
|
|
@@ -78,9 +79,17 @@ export function Proposed({ kind, now, onSetUp }) {
|
|
|
78
79
|
const [why, setWhy] = useState("");
|
|
79
80
|
const [busy, setBusy] = useState(false);
|
|
80
81
|
const [trouble, setTrouble] = useState(null);
|
|
82
|
+
const open = lab?.plans.filter((one) => one.settled === null && one.kind === kind) ?? [];
|
|
83
|
+
// Putting a plan's pieces back together every way round costs tens of milliseconds, which is
|
|
84
|
+
// nothing to ask for and too much to pay on every render. So it is worked out once per plan and
|
|
85
|
+
// kept until that plan's product or its enzymes change.
|
|
86
|
+
const routes = useMemo(() => new Map(open.flatMap((plan) => {
|
|
87
|
+
const enzymes = routeOf(plan);
|
|
88
|
+
const design = plan.expects[0];
|
|
89
|
+
return enzymes.length === 0 || design === undefined ? [] : [[plan.plan, checkRoute(design, enzymes)]];
|
|
90
|
+
})), [open.map((plan) => `${plan.plan}:${plan.expects[0]?.checksum ?? ""}:${String(plan.settings["cut_with"] ?? "")}`).join("|")]);
|
|
81
91
|
if (lab === null || lab === undefined)
|
|
82
92
|
return null;
|
|
83
|
-
const open = lab.plans.filter((one) => one.settled === null && one.kind === kind);
|
|
84
93
|
const carried = planCarried(lab, now);
|
|
85
94
|
const person = (key) => lab.roster.find((one) => one.key === key)?.person ?? "A device";
|
|
86
95
|
const partName = (checksum) => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
@@ -99,8 +108,12 @@ export function Proposed({ kind, now, onSetUp }) {
|
|
|
99
108
|
if (open.length === 0 && now === null)
|
|
100
109
|
return null;
|
|
101
110
|
return (_jsxs("section", { className: "card proposed", children: [_jsx("h2", { children: "Proposed" }), open.length === 0 && _jsx("p", { className: "dim small", children: "Nothing is proposed here. What is set up now can be proposed, for somebody to carry out: nothing is used and nothing is recorded as done." }), open.map((plan) => {
|
|
102
|
-
|
|
103
|
-
|
|
111
|
+
// Something there is no tube of has to be ordered or made — unless nothing is going to make
|
|
112
|
+
// it any more, which is a different thing to be told and is said on its own line below.
|
|
113
|
+
const missing = plan.inputs.filter((one) => one.item === undefined && !plan.orphaned.includes(one.part));
|
|
114
|
+
const route = routes.get(plan.plan);
|
|
115
|
+
const aboutRoute = route === undefined ? null : saysRoute(route);
|
|
116
|
+
return (_jsxs("article", { className: plan === carried ? "plan now" : "plan", children: [_jsxs("p", { className: "small", children: [_jsx("strong", { children: person(plan.by) }), " proposes using ", plan.inputs.map((one) => `${one.item === undefined ? partName(one.part) : tubeName(one.item)} as ${one.role}`).join(", "), plan.expects.length > 0 && _jsxs(_Fragment, { children: [", expecting ", plan.expects.map((one) => `${one.name} (${one.length.toLocaleString("en-US")} bp${one.circular ? ", circular" : ""})`).join(" and ")] }), "."] }), plan.note !== null && _jsx("p", { className: "small why", children: plan.note }), missing.length > 0 && _jsxs("p", { className: "small attention", children: ["There is no tube yet of ", missing.map((one) => partName(one.part)).join(" or "), ". It has to be ordered or made before this can be done."] }), plan.wanting.length > 0 && _jsxs("p", { className: "small attention", children: ["Since this was proposed, ", plan.wanting.map(tubeName).join(" and "), " ", plan.wanting.length === 1 ? "has" : "have", " been retired or run short of what it would use."] }), plan.orphaned.length > 0 && _jsxs("p", { className: "small attention", children: ["Nothing is going to make ", plan.orphaned.map(partName).join(" or "), " any more: the only plan that would have has been set aside. If it was refiled, this plan is still asking for what the old one would have made."] }), aboutRoute !== null && _jsx("p", { className: "small attention", children: aboutRoute }), plan === carried && _jsx("p", { className: "small good", children: "This is what is set up now. Recording the run will say this proposal was carried out." }), _jsxs("div", { className: "row tight", children: [plan !== carried && _jsx("button", { type: "button", disabled: busy || missing.length > 0, onClick: () => onSetUp(plan), children: "Set it up" }), _jsx("button", { type: "button", className: "quiet", disabled: busy, onClick: () => void ask("settlePlan", { plan: plan.plan }), children: "Set it aside" })] })] }, plan.plan));
|
|
104
117
|
}), now !== null && carried === undefined && (_jsxs("fieldset", { disabled: busy, className: "stack", children: [_jsxs("label", { children: ["Why", _jsx("input", { value: why, onChange: (event) => setWhy(event.target.value), maxLength: 2000, placeholder: "What it is for, for whoever carries it out", "aria-label": "Why this run is proposed" })] }), _jsx("div", { className: "row", children: _jsx("button", { type: "button", className: "quiet", onClick: () => void ask("planRun", toPlan(now, why)), children: "Propose what is set up" }) })] })), trouble !== null && _jsx("p", { className: "trouble small", role: "alert", children: trouble })] }));
|
|
105
118
|
}
|
|
106
119
|
//# sourceMappingURL=plans.js.map
|
package/dist/plans.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../src/plans.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,MAAM,CAAC,GAA4B,EAAE,IAAa;IAChE,MAAM,OAAO,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,G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CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,uCAAiC,GAAM,IAC/I,CACZ,EACA,OAAO,KAAK,IAAI,IAAI,YAAG,SAAS,EAAC,eAAe,EAAC,IAAI,EAAC,OAAO,YAAE,OAAO,GAAK,IACpE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/route.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/** Most pieces a route may be checked over. Putting pieces back together every way round grows fast. */
|
|
2
|
+
export declare const MOST_PIECES = 6;
|
|
3
|
+
/** One circle a route could close into. */
|
|
4
|
+
export interface RouteProduct {
|
|
5
|
+
/** What it would be, as the lab counts identity. */
|
|
6
|
+
checksum: string;
|
|
7
|
+
/** How long it is. */
|
|
8
|
+
length: number;
|
|
9
|
+
/** Whether this is the one the design says it should be. */
|
|
10
|
+
intended: boolean;
|
|
11
|
+
/** The pieces, in the order they go round it, and which of them went in the other way round. */
|
|
12
|
+
pieces: {
|
|
13
|
+
name: string;
|
|
14
|
+
flipped: boolean;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
/** What a route would make, and whether that is one thing. */
|
|
18
|
+
export interface RouteCheck {
|
|
19
|
+
/** The enzymes asked for that are real ones, as they are written. */
|
|
20
|
+
enzymes: string[];
|
|
21
|
+
/** The pieces the cut gives: how long each is, and the unpaired bases at each end. */
|
|
22
|
+
pieces: {
|
|
23
|
+
name: string;
|
|
24
|
+
length: number;
|
|
25
|
+
left: string;
|
|
26
|
+
right: string;
|
|
27
|
+
}[];
|
|
28
|
+
/** Every circle the pieces could close into, the intended one first if it is among them. */
|
|
29
|
+
products: RouteProduct[];
|
|
30
|
+
/** Whether the route makes what the design says. A route that does not is a route for something else. */
|
|
31
|
+
makesIt: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The circles it could make instead of the intended one. Each of these is a plasmid somebody could
|
|
34
|
+
* carry away from the bench believing it was the design.
|
|
35
|
+
*/
|
|
36
|
+
instead: RouteProduct[];
|
|
37
|
+
/** Why there is nothing to say, said for a person, or `null` if there is. */
|
|
38
|
+
problem: string | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The enzymes a plan says to cut with.
|
|
42
|
+
*
|
|
43
|
+
* A plan has no field for its enzymes, so they live in its settings as the words somebody wrote,
|
|
44
|
+
* such as `BamHI and AvrII`. That is a convention rather than a promise, which is why this is a
|
|
45
|
+
* reading and not a lookup: it returns what it could make of the words, and nothing for words that
|
|
46
|
+
* are not enzymes.
|
|
47
|
+
*
|
|
48
|
+
* @param plan - A plan, or anything with settings.
|
|
49
|
+
* @param field - Which setting holds them. `cut_with` by default.
|
|
50
|
+
* @returns The names it found, in the order written.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* routeOf({ settings: { cut_with: "BamHI and AvrII" } }); // ["BamHI", "AvrII"]
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function routeOf(plan: {
|
|
58
|
+
settings?: Record<string, string | number>;
|
|
59
|
+
}, field?: string): string[];
|
|
60
|
+
/**
|
|
61
|
+
* Cut a design with the enzymes a route names, and see how many circles the pieces could close into.
|
|
62
|
+
*
|
|
63
|
+
* @param design - The molecule the route is meant to make, and whether it is a circle.
|
|
64
|
+
* @param enzymes - The enzyme names the route cuts with, as {@link routeOf} reads them.
|
|
65
|
+
* @returns What the route would make. `problem` says why where it could not be worked out.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const checked = checkRoute({ sequence: plasmid, circular: true }, ["BamHI", "AvrII"]);
|
|
70
|
+
* checked.makesIt; // true — the route does make the design
|
|
71
|
+
* checked.instead.length; // 0 — and it cannot make anything else
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function checkRoute(design: {
|
|
75
|
+
sequence: string;
|
|
76
|
+
circular?: boolean;
|
|
77
|
+
}, enzymes: readonly string[]): RouteCheck;
|
|
78
|
+
/**
|
|
79
|
+
* What to tell somebody about a route, in a line.
|
|
80
|
+
*
|
|
81
|
+
* @param checked - A route, checked.
|
|
82
|
+
* @returns The sentence, or `null` where there is nothing worth saying — a route with one answer
|
|
83
|
+
* needs no remark.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* saysRoute(checkRoute(design, ["XhoI", "AvrII"]));
|
|
88
|
+
* // "Those cuts could also make 1 other plasmid of the same length, which a digest with them
|
|
89
|
+
* // would not tell apart. One of the pieces goes in either way round."
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function saysRoute(checked: RouteCheck): string | null;
|
|
93
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AA0BA,wGAAwG;AACxG,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAC;IAClB,gGAAgG;IAChG,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAC9C;AAED,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,sFAAsF;IACtF,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxE,4FAA4F;IAC5F,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,yGAAyG;IACzG,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAAE,EAAE,KAAK,SAAa,GAAG,MAAM,EAAE,CAK1G;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CA0CnH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAQ5D"}
|
package/dist/route.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a route has one answer.
|
|
3
|
+
*
|
|
4
|
+
* A design can be right and the route to it still be wrong. Checking the sequence says the molecule
|
|
5
|
+
* is the molecule; it says nothing about whether the cut and the ligation that are supposed to make
|
|
6
|
+
* it could just as easily make something else. They can, and the way they do it is quiet: a piece
|
|
7
|
+
* with the same overhang at both ends goes in either way round, and both ways close into a plasmid
|
|
8
|
+
* of exactly the right length. A check digest with the enzymes the route used gives the same bands
|
|
9
|
+
* for both, so the wrong one looks right.
|
|
10
|
+
*
|
|
11
|
+
* So this cuts the finished design with the enzymes the route names, puts the pieces back together
|
|
12
|
+
* every way their ends allow, and counts the circles that come out. One is a route with one answer.
|
|
13
|
+
* Two is a coin toss nobody told the bench about.
|
|
14
|
+
*
|
|
15
|
+
* It is here and not in the protocol on purpose. The enumeration takes tens of milliseconds for a
|
|
16
|
+
* plasmid, and a lab's log is merged on every change and every sync; a check that costs a third of a
|
|
17
|
+
* second across a project's plans does not belong in the merge. It is asked for, like a digest.
|
|
18
|
+
*
|
|
19
|
+
* The joining is `planLigation`'s, which is `@biolibs/assembly2`'s underneath. What this adds is the
|
|
20
|
+
* question: not what a ligation makes, but how many different things it could make.
|
|
21
|
+
*/
|
|
22
|
+
import { partChecksum } from "@biolibs/bionet";
|
|
23
|
+
import { lookupEnzymes, parseEnzymeNames } from "@biolibs/cloning";
|
|
24
|
+
import { Dseq, cut } from "@biolibs/dseq";
|
|
25
|
+
import { planLigation } from "./ligate.js";
|
|
26
|
+
/** Most pieces a route may be checked over. Putting pieces back together every way round grows fast. */
|
|
27
|
+
export const MOST_PIECES = 6;
|
|
28
|
+
const clean = (bases) => bases.replace(/\s+/g, "").toUpperCase();
|
|
29
|
+
/**
|
|
30
|
+
* The enzymes a plan says to cut with.
|
|
31
|
+
*
|
|
32
|
+
* A plan has no field for its enzymes, so they live in its settings as the words somebody wrote,
|
|
33
|
+
* such as `BamHI and AvrII`. That is a convention rather than a promise, which is why this is a
|
|
34
|
+
* reading and not a lookup: it returns what it could make of the words, and nothing for words that
|
|
35
|
+
* are not enzymes.
|
|
36
|
+
*
|
|
37
|
+
* @param plan - A plan, or anything with settings.
|
|
38
|
+
* @param field - Which setting holds them. `cut_with` by default.
|
|
39
|
+
* @returns The names it found, in the order written.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* routeOf({ settings: { cut_with: "BamHI and AvrII" } }); // ["BamHI", "AvrII"]
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export function routeOf(plan, field = "cut_with") {
|
|
47
|
+
const said = plan.settings?.[field];
|
|
48
|
+
if (typeof said !== "string")
|
|
49
|
+
return [];
|
|
50
|
+
// "and" is how a person writes it and is not an enzyme; everything else is left for the lookup.
|
|
51
|
+
return parseEnzymeNames(said.replace(/\band\b/gi, " ")).filter((one) => one.length > 0);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Cut a design with the enzymes a route names, and see how many circles the pieces could close into.
|
|
55
|
+
*
|
|
56
|
+
* @param design - The molecule the route is meant to make, and whether it is a circle.
|
|
57
|
+
* @param enzymes - The enzyme names the route cuts with, as {@link routeOf} reads them.
|
|
58
|
+
* @returns What the route would make. `problem` says why where it could not be worked out.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const checked = checkRoute({ sequence: plasmid, circular: true }, ["BamHI", "AvrII"]);
|
|
63
|
+
* checked.makesIt; // true — the route does make the design
|
|
64
|
+
* checked.instead.length; // 0 — and it cannot make anything else
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function checkRoute(design, enzymes) {
|
|
68
|
+
const bases = clean(design.sequence);
|
|
69
|
+
const circular = design.circular === true;
|
|
70
|
+
const { enzymes: found } = lookupEnzymes([...new Set(enzymes)]);
|
|
71
|
+
const names = found.map((one) => one.name);
|
|
72
|
+
const empty = { enzymes: names, pieces: [], products: [], makesIt: false, instead: [] };
|
|
73
|
+
if (enzymes.length === 0)
|
|
74
|
+
return { ...empty, problem: "The plan does not say what to cut with." };
|
|
75
|
+
if (found.length === 0)
|
|
76
|
+
return { ...empty, problem: "None of those is an enzyme this knows." };
|
|
77
|
+
if (bases.length === 0)
|
|
78
|
+
return { ...empty, problem: "There is nothing to cut." };
|
|
79
|
+
let bits;
|
|
80
|
+
try {
|
|
81
|
+
bits = cut(Dseq.quick(bases, circular), found);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return { ...empty, problem: "That could not be cut." };
|
|
85
|
+
}
|
|
86
|
+
if (bits.length < 2)
|
|
87
|
+
return { ...empty, problem: `${names.join(" and ")} ${names.length === 1 ? "does" : "do"} not cut this into pieces.` };
|
|
88
|
+
if (bits.length > MOST_PIECES)
|
|
89
|
+
return { ...empty, problem: `That cuts into ${bits.length} pieces, too many to put back together every way round.` };
|
|
90
|
+
const pieces = bits.map((bit, at) => ({
|
|
91
|
+
id: `piece-${at}`, name: `${bit.length} bp`, sequence: bit.toBluntString().toUpperCase(),
|
|
92
|
+
ends: { left: -(bit.ovhg ?? 0), right: -(bit.watsonOvhg ?? 0) },
|
|
93
|
+
}));
|
|
94
|
+
const shown = pieces.map((piece, at) => ({
|
|
95
|
+
name: piece.name, length: bits[at].length,
|
|
96
|
+
left: piece.sequence.slice(0, Math.abs(piece.ends.left)), right: piece.sequence.slice(piece.sequence.length - Math.abs(piece.ends.right)),
|
|
97
|
+
}));
|
|
98
|
+
const plan = planLigation(pieces);
|
|
99
|
+
if (plan.problem !== null)
|
|
100
|
+
return { ...empty, pieces: shown, problem: plan.problem };
|
|
101
|
+
const wanted = partChecksum({ sequence: bases, circular });
|
|
102
|
+
// Only the circles of the right length are in the running. A route that also makes a shorter
|
|
103
|
+
// circle out of some of the pieces is a separate matter, and a gel tells those apart anyway.
|
|
104
|
+
const seen = new Map();
|
|
105
|
+
for (const made of plan.products) {
|
|
106
|
+
if (!made.circular || made.length !== bases.length)
|
|
107
|
+
continue;
|
|
108
|
+
let checksum;
|
|
109
|
+
try {
|
|
110
|
+
checksum = partChecksum({ sequence: made.sequence, circular: true });
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (seen.has(checksum))
|
|
116
|
+
continue;
|
|
117
|
+
seen.set(checksum, { checksum, length: made.length, intended: checksum === wanted,
|
|
118
|
+
pieces: made.pieces.map((one) => ({ name: one.name, flipped: one.flipped })) });
|
|
119
|
+
}
|
|
120
|
+
const products = [...seen.values()].sort((one, two) => Number(two.intended) - Number(one.intended));
|
|
121
|
+
const instead = products.filter((one) => !one.intended);
|
|
122
|
+
return { enzymes: names, pieces: shown, products, makesIt: products.some((one) => one.intended), instead, problem: null };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* What to tell somebody about a route, in a line.
|
|
126
|
+
*
|
|
127
|
+
* @param checked - A route, checked.
|
|
128
|
+
* @returns The sentence, or `null` where there is nothing worth saying — a route with one answer
|
|
129
|
+
* needs no remark.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* saysRoute(checkRoute(design, ["XhoI", "AvrII"]));
|
|
134
|
+
* // "Those cuts could also make 1 other plasmid of the same length, which a digest with them
|
|
135
|
+
* // would not tell apart. One of the pieces goes in either way round."
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export function saysRoute(checked) {
|
|
139
|
+
if (checked.problem !== null)
|
|
140
|
+
return checked.problem;
|
|
141
|
+
if (!checked.makesIt)
|
|
142
|
+
return "Those cuts do not make what this is expected to make.";
|
|
143
|
+
if (checked.instead.length === 0)
|
|
144
|
+
return null;
|
|
145
|
+
const flips = checked.instead.some((one) => one.pieces.some((piece) => piece.flipped));
|
|
146
|
+
return `Those cuts could also make ${checked.instead.length} other plasmid${checked.instead.length === 1 ? "" : "s"} ` +
|
|
147
|
+
`of the same length, which a digest with them would not tell apart.` +
|
|
148
|
+
(flips ? " One of the pieces goes in either way round." : "");
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAA4C,MAAM,aAAa,CAAC;AAErF,wGAAwG;AACxG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAiC7B,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,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,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACvF,OAAO,8BAA8B,OAAO,CAAC,OAAO,CAAC,MAAM,iBAAiB,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG;QAC/G,oEAAoE;QACpE,CAAC,KAAK,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/work.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../src/work.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA4D,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"work.d.ts","sourceRoot":"","sources":["../src/work.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA4D,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAUpG;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;CAAO,sCAsTlF"}
|
package/dist/work.js
CHANGED
|
@@ -11,11 +11,12 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
11
11
|
* It asserts nothing. Everything here comes from `planOfWork`, which works the order out from what
|
|
12
12
|
* each proposal makes and what each one needs, so what is drawn cannot drift from what is true.
|
|
13
13
|
*/
|
|
14
|
-
import { useState } from "react";
|
|
14
|
+
import { useMemo, useState } from "react";
|
|
15
15
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
16
16
|
import { Glossed } from "@biolibs/glossary-react";
|
|
17
17
|
import { FILED_UNDER, UNFILED, planOfWork, saysWork } from "./ordering.js";
|
|
18
18
|
import { protocolText, protocolsFor } from "./protocol.js";
|
|
19
|
+
import { checkRoute, routeOf, saysRoute } from "./route.js";
|
|
19
20
|
/** What a step is called, by what kind of run it is. */
|
|
20
21
|
const CALLED = {
|
|
21
22
|
pcr: "Copy it", digest: "Cut it", ligation: "Join it", assembly: "Build the ring",
|
|
@@ -48,6 +49,15 @@ export function WorkToDo({ onOpen } = {}) {
|
|
|
48
49
|
const [sheet, setSheet] = useState(null);
|
|
49
50
|
const [taking, setTaking] = useState("");
|
|
50
51
|
const [told, setTold] = useState(null);
|
|
52
|
+
// Whether each step's route has one answer. Putting a plan's pieces back together every way round
|
|
53
|
+
// costs tens of milliseconds, so it is worked out once per plan and kept until that plan's product
|
|
54
|
+
// or its enzymes change.
|
|
55
|
+
const open = lab?.plans.filter((one) => one.settled === null) ?? [];
|
|
56
|
+
const routes = useMemo(() => new Map(open.flatMap((plan) => {
|
|
57
|
+
const enzymes = routeOf(plan);
|
|
58
|
+
const design = plan.expects[0];
|
|
59
|
+
return enzymes.length === 0 || design === undefined ? [] : [[plan.plan, checkRoute(design, enzymes)]];
|
|
60
|
+
})), [open.map((plan) => `${plan.plan}:${plan.expects[0]?.checksum ?? ""}:${String(plan.settings["cut_with"] ?? "")}`).join("|")]);
|
|
51
61
|
if (lab === null || lab === undefined)
|
|
52
62
|
return null;
|
|
53
63
|
const whole = planOfWork(lab);
|
|
@@ -149,9 +159,13 @@ export function WorkToDo({ onOpen } = {}) {
|
|
|
149
159
|
: _jsxs(_Fragment, { children: [unread, " tubes are being held unidentified. One of them may be something on that list \u2014 sequencing them is the only way to know."] }) })), projects.length > 1 && (_jsxs("div", { className: "row tight pick", role: "tablist", "aria-label": "Projects", children: [_jsx("button", { type: "button", role: "tab", "aria-selected": only === null, className: only === null ? "" : "quiet", onClick: () => setOnly(null), children: "Everything" }), projects.map((one) => (_jsxs("button", { type: "button", role: "tab", "aria-selected": only === one.name, className: only === one.name ? "" : "quiet", onClick: () => setOnly(one.name), children: [one.name, one.ready.length > 0 ? ` · ${one.ready.length} ready` : ""] }, one.name)))] })), _jsx("p", { className: "dim small", children: "Nothing here was declared. A proposal says what it expects to make and what it needs, and where one expects what another needs, the first has to happen first. The chain stops at a transformation: what that makes is alive and has no checksum to point at, so what follows is proposed afresh once there is something growing." })] }), work.order.length > 0 && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Taking it to the bench" }), _jsx("p", { className: "small", children: "The same work as a sheet to print or carry: what to fetch, what to set a machine to, what to do, and what to record afterwards." }), _jsx("p", { className: "dim small", children: "Every number on it \u2014 a volume, a temperature, a time \u2014 is one somebody set or one the lab\u2019s own tools worked out. Nothing is filled in to make it look finished: what a plan does not say is listed under each step instead, so the hole is found standing at a bench and not halfway through." }), _jsxs("div", { className: "row tight", children: [_jsxs("button", { type: "button", onClick: asASheet, children: ["Write ", only === null ? "it all" : only, " as a protocol"] }), sheet !== null && _jsx("button", { type: "button", className: "quiet", onClick: () => setSheet(null), children: "Hide it" })] }), sheet !== null && _jsx("textarea", { className: "method sheet", value: sheet, readOnly: true, rows: 18, "aria-label": "The protocol, to print or carry", onFocus: (event) => event.currentTarget.select() })] })), crossing, work.toGet.length > 0 && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "To get first" }), _jsxs("p", { className: "small", children: ["Nothing proposed makes ", work.toGet.length === 1 ? "this" : "these", ", and the lab has no tube of ", work.toGet.length === 1 ? "it" : "them", ". Until ", work.toGet.length === 1 ? "it arrives" : "they arrive", " the steps that need ", work.toGet.length === 1 ? "it" : "them", " cannot start."] }), _jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "What" }), _jsx("th", { children: "For" })] }) }), _jsx("tbody", { children: work.toGet.map((one) => (_jsxs("tr", { children: [_jsxs("td", { children: [partName(one.checksum) === "a part" ? one.name : partName(one.checksum), " ", _jsx("code", { children: one.checksum.slice(0, 12) })] }), _jsx("td", { className: "dim", children: [...new Set(one.forSteps.map((each) => {
|
|
150
160
|
const thread = work.threads.find((who) => who.steps.some((step) => step.plan.plan === each));
|
|
151
161
|
return `step ${at(each)} of ${thread?.name ?? "the work"}`;
|
|
152
|
-
}))].join(", ") })] }, one.checksum))) })] })] })), work.threads.map((thread) => (_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsx("h2", { children: thread.name }), _jsxs("span", { className: "dim small", children: [[...new Set(thread.steps.map((one) => filedAs(one.plan)))].join(", "), " \u00B7 ", thread.steps.length, " ", thread.steps.length === 1 ? "step" : "steps"] })] }), !thread.clear && _jsx("p", { className: "small attention", children: "Something in this one has to be dealt with before it can be finished." }), _jsx("ol", { className: "steps", children: thread.steps.map((step) =>
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
}))].join(", ") })] }, one.checksum))) })] })] })), work.threads.map((thread) => (_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsx("h2", { children: thread.name }), _jsxs("span", { className: "dim small", children: [[...new Set(thread.steps.map((one) => filedAs(one.plan)))].join(", "), " \u00B7 ", thread.steps.length, " ", thread.steps.length === 1 ? "step" : "steps"] })] }), !thread.clear && _jsx("p", { className: "small attention", children: "Something in this one has to be dealt with before it can be finished." }), _jsx("ol", { className: "steps", children: thread.steps.map((step) => {
|
|
163
|
+
const checked = routes.get(step.plan.plan);
|
|
164
|
+
const aboutRoute = checked === undefined ? null : saysRoute(checked);
|
|
165
|
+
return (_jsxs("li", { className: step.held === null ? "ready" : "held", children: [_jsxs("p", { className: "small", children: [_jsxs("strong", { children: [at(step.plan.plan), ". ", stepName(step.plan)] }), _jsxs("span", { className: "dim", children: [" \u00B7 ", step.plan.kind] }), " — ", why(step)] }), _jsxs("p", { className: "dim small", children: ["Uses ", step.plan.inputs.map((one) => `${one.item === undefined ? partName(one.part) : tubeName(one.item)} as ${one.role}`).join(", ") || "nothing the lab holds", step.plan.expects.length > 0 && _jsxs(_Fragment, { children: [", making ", step.plan.expects.map((one) => `${one.name} (${one.length.toLocaleString("en-US")} bp${one.circular ? ", circular" : ""})`).join(" and ")] }), step.plan.expects.length === 0 && (step.plan.kind === "transformation"
|
|
166
|
+
? _jsx(_Fragment, { children: ", making nothing the lab can name: what comes of it is alive" })
|
|
167
|
+
: _jsx(_Fragment, { children: ", making nothing it has declared" })), ". Proposed by ", person(step.plan.by), "."] }), step.plan.note !== null && _jsx("p", { className: "small why", children: step.plan.note }), step.plan.orphaned.length > 0 && _jsxs("p", { className: "small attention", children: ["Nothing is going to make ", step.plan.orphaned.map(partName).join(" or "), " any more: the only plan that would have has been set aside. If it was refiled, this step is still asking for what the old plan would have made."] }), aboutRoute !== null && _jsx("p", { className: "small attention", children: aboutRoute }), _jsxs("div", { className: "row tight", children: [onOpen !== undefined && step.held === null && _jsx("button", { type: "button", onClick: () => onOpen(step.plan), children: "Set it up" }), _jsx("button", { type: "button", className: "quiet", onClick: () => { setFiling(filing === step.plan.plan ? null : step.plan.plan); setInto(filedAs(step.plan) === UNFILED ? "" : filedAs(step.plan)); }, children: filedAs(step.plan) === UNFILED ? "File it under…" : "Move it…" }), _jsx("button", { type: "button", className: "quiet", onClick: () => void act("settlePlan", { plan: step.plan.plan }), children: "Set it aside" })] }), filing === step.plan.plan && (_jsxs("form", { className: "row tight", onSubmit: (event) => { event.preventDefault(); void file(step.plan.plan, into); }, children: [_jsx("input", { value: into, onChange: (event) => setInto(event.target.value), maxLength: 200, list: "bionet-projects", placeholder: "Which project", "aria-label": "Which project to file it under" }), _jsx("datalist", { id: "bionet-projects", children: projects.filter((one) => one.filed).map((one) => _jsx("option", { value: one.name }, one.name)) }), _jsx("button", { type: "submit", children: into.trim() === "" ? "Take it out" : "File it" })] }))] }, step.plan.plan));
|
|
168
|
+
}) }), thread.ends.length > 0 && (_jsxs("p", { className: "dim small", children: ["It ends with ", thread.ends.map((one) => partName(one.checksum) === "a part" ? one.name : partName(one.checksum)).join(" and "), "."] }))] }, thread.name + thread.steps[0].plan.plan))), work.tangled.length > 0 && (_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Cannot be ordered" }), _jsxs("p", { className: "small trouble", children: [work.tangled.length, " ", work.tangled.length === 1 ? "proposal depends" : "proposals depend", " on each other in a circle, so there is no order to carry them out in. Set one aside and propose it again."] }), _jsx("ul", { className: "checks", children: work.tangled.map((one) => {
|
|
155
169
|
const plan = lab.plans.find((each) => each.plan === one);
|
|
156
170
|
return _jsxs("li", { className: "stop", children: [stepName(plan), " \u00B7 ", plan.kind, " \u00B7 proposed by ", person(plan.by)] }, one);
|
|
157
171
|
}) })] }))] }));
|
package/dist/work.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work.js","sourceRoot":"","sources":["../src/work.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAA2B,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3D,wDAAwD;AACxD,MAAM,MAAM,GAAqC;IAC/C,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB;IACjF,cAAc,EAAE,oBAAoB,EAAE,SAAS,EAAE,kCAAkC;CACpF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,QAAQ,CAAC,EAA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
|
11
11
|
"@biolibs/cloning": "^1.0.1",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
],
|
|
66
66
|
"type": "module",
|
|
67
67
|
"types": "dist/index.d.ts",
|
|
68
|
-
"version": "0.1.
|
|
68
|
+
"version": "0.1.15"
|
|
69
69
|
}
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
* - `fusion-bench.tsx` — that at a desk: the pieces in order, and the frame watched as they are laid out
|
|
30
30
|
* - `assembly-bench.tsx` — building a ring at a desk: the pieces in order, and the primers that make them fit
|
|
31
31
|
* - `ligate.ts` — pieces that have already been cut, joined where their ends fit
|
|
32
|
+
* - `route.ts` — whether the cut and ligation a plan names could make more than one thing
|
|
32
33
|
* - `ligate-working.ts` — a ligation's working: each join in its bases, the length, how much to put in
|
|
33
34
|
* - `ligate-bench.tsx` — a ligation at the heat block: what is shown beside it, and what the scene draws
|
|
34
35
|
* - `digest-working.ts` — a digest looked at closely: each cut in its bases, each piece with its ends, the working
|
|
@@ -72,6 +73,7 @@ export * from "./fusion.js";
|
|
|
72
73
|
export * from "./fusion-bench.js";
|
|
73
74
|
export * from "./assembly-bench.js";
|
|
74
75
|
export * from "./ligate.js";
|
|
76
|
+
export * from "./route.js";
|
|
75
77
|
export * from "./ligate-working.js";
|
|
76
78
|
export * from "./ligate-bench.js";
|
|
77
79
|
export * from "./running.js";
|
package/src/plans.tsx
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* names. That is decided from what is set up, not from a button pressed earlier, so a bench that is
|
|
14
14
|
* changed after being set up from a plan stops claiming to be that plan.
|
|
15
15
|
*/
|
|
16
|
-
import { useState, type ReactNode } from "react";
|
|
16
|
+
import { useMemo, useState, type ReactNode } from "react";
|
|
17
17
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
18
|
+
import { checkRoute, routeOf, saysRoute } from "./route.js";
|
|
18
19
|
|
|
19
20
|
/** One proposed run, as the lab holds it. */
|
|
20
21
|
export type Plan = NonNullable<NonNullable<ReturnType<typeof useLab>>["lab"]>["plans"][number];
|
|
@@ -87,8 +88,19 @@ export function Proposed({ kind, now, onSetUp }: { kind: string; now: Record<str
|
|
|
87
88
|
const [why, setWhy] = useState("");
|
|
88
89
|
const [busy, setBusy] = useState(false);
|
|
89
90
|
const [trouble, setTrouble] = useState<string | null>(null);
|
|
91
|
+
const open = lab?.plans.filter((one) => one.settled === null && one.kind === kind) ?? [];
|
|
92
|
+
// Putting a plan's pieces back together every way round costs tens of milliseconds, which is
|
|
93
|
+
// nothing to ask for and too much to pay on every render. So it is worked out once per plan and
|
|
94
|
+
// kept until that plan's product or its enzymes change.
|
|
95
|
+
const routes = useMemo(
|
|
96
|
+
() => new Map(open.flatMap((plan) => {
|
|
97
|
+
const enzymes = routeOf(plan);
|
|
98
|
+
const design = plan.expects[0];
|
|
99
|
+
return enzymes.length === 0 || design === undefined ? [] : [[plan.plan, checkRoute(design, enzymes)] as const];
|
|
100
|
+
})),
|
|
101
|
+
[open.map((plan) => `${plan.plan}:${plan.expects[0]?.checksum ?? ""}:${String(plan.settings["cut_with"] ?? "")}`).join("|")],
|
|
102
|
+
);
|
|
90
103
|
if (lab === null || lab === undefined) return null;
|
|
91
|
-
const open = lab.plans.filter((one) => one.settled === null && one.kind === kind);
|
|
92
104
|
const carried = planCarried(lab, now);
|
|
93
105
|
const person = (key: string): string => lab.roster.find((one) => one.key === key)?.person ?? "A device";
|
|
94
106
|
const partName = (checksum: string | undefined): string => lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
@@ -109,7 +121,11 @@ export function Proposed({ kind, now, onSetUp }: { kind: string; now: Record<str
|
|
|
109
121
|
<h2>Proposed</h2>
|
|
110
122
|
{open.length === 0 && <p className="dim small">Nothing is proposed here. What is set up now can be proposed, for somebody to carry out: nothing is used and nothing is recorded as done.</p>}
|
|
111
123
|
{open.map((plan) => {
|
|
112
|
-
|
|
124
|
+
// Something there is no tube of has to be ordered or made — unless nothing is going to make
|
|
125
|
+
// it any more, which is a different thing to be told and is said on its own line below.
|
|
126
|
+
const missing = plan.inputs.filter((one) => one.item === undefined && !plan.orphaned.includes(one.part!));
|
|
127
|
+
const route = routes.get(plan.plan);
|
|
128
|
+
const aboutRoute = route === undefined ? null : saysRoute(route);
|
|
113
129
|
return (
|
|
114
130
|
<article key={plan.plan} className={plan === carried ? "plan now" : "plan"}>
|
|
115
131
|
<p className="small"><strong>{person(plan.by)}</strong> proposes using {plan.inputs.map((one) => `${one.item === undefined ? partName(one.part) : tubeName(one.item)} as ${one.role}`).join(", ")}
|
|
@@ -117,6 +133,8 @@ export function Proposed({ kind, now, onSetUp }: { kind: string; now: Record<str
|
|
|
117
133
|
{plan.note !== null && <p className="small why">{plan.note}</p>}
|
|
118
134
|
{missing.length > 0 && <p className="small attention">There is no tube yet of {missing.map((one) => partName(one.part)).join(" or ")}. It has to be ordered or made before this can be done.</p>}
|
|
119
135
|
{plan.wanting.length > 0 && <p className="small attention">Since this was proposed, {plan.wanting.map(tubeName).join(" and ")} {plan.wanting.length === 1 ? "has" : "have"} been retired or run short of what it would use.</p>}
|
|
136
|
+
{plan.orphaned.length > 0 && <p className="small attention">Nothing is going to make {plan.orphaned.map(partName).join(" or ")} any more: the only plan that would have has been set aside. If it was refiled, this plan is still asking for what the old one would have made.</p>}
|
|
137
|
+
{aboutRoute !== null && <p className="small attention">{aboutRoute}</p>}
|
|
120
138
|
{plan === carried && <p className="small good">This is what is set up now. Recording the run will say this proposal was carried out.</p>}
|
|
121
139
|
<div className="row tight">
|
|
122
140
|
{plan !== carried && <button type="button" disabled={busy || missing.length > 0} onClick={() => onSetUp(plan)}>Set it up</button>}
|
package/src/route.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a route has one answer.
|
|
3
|
+
*
|
|
4
|
+
* A design can be right and the route to it still be wrong. Checking the sequence says the molecule
|
|
5
|
+
* is the molecule; it says nothing about whether the cut and the ligation that are supposed to make
|
|
6
|
+
* it could just as easily make something else. They can, and the way they do it is quiet: a piece
|
|
7
|
+
* with the same overhang at both ends goes in either way round, and both ways close into a plasmid
|
|
8
|
+
* of exactly the right length. A check digest with the enzymes the route used gives the same bands
|
|
9
|
+
* for both, so the wrong one looks right.
|
|
10
|
+
*
|
|
11
|
+
* So this cuts the finished design with the enzymes the route names, puts the pieces back together
|
|
12
|
+
* every way their ends allow, and counts the circles that come out. One is a route with one answer.
|
|
13
|
+
* Two is a coin toss nobody told the bench about.
|
|
14
|
+
*
|
|
15
|
+
* It is here and not in the protocol on purpose. The enumeration takes tens of milliseconds for a
|
|
16
|
+
* plasmid, and a lab's log is merged on every change and every sync; a check that costs a third of a
|
|
17
|
+
* second across a project's plans does not belong in the merge. It is asked for, like a digest.
|
|
18
|
+
*
|
|
19
|
+
* The joining is `planLigation`'s, which is `@biolibs/assembly2`'s underneath. What this adds is the
|
|
20
|
+
* question: not what a ligation makes, but how many different things it could make.
|
|
21
|
+
*/
|
|
22
|
+
import { partChecksum } from "@biolibs/bionet";
|
|
23
|
+
import { lookupEnzymes, parseEnzymeNames } from "@biolibs/cloning";
|
|
24
|
+
import { Dseq, cut } from "@biolibs/dseq";
|
|
25
|
+
import { planLigation, type LigationPiece, type LigationProduct } from "./ligate.js";
|
|
26
|
+
|
|
27
|
+
/** Most pieces a route may be checked over. Putting pieces back together every way round grows fast. */
|
|
28
|
+
export const MOST_PIECES = 6;
|
|
29
|
+
|
|
30
|
+
/** One circle a route could close into. */
|
|
31
|
+
export interface RouteProduct {
|
|
32
|
+
/** What it would be, as the lab counts identity. */
|
|
33
|
+
checksum: string;
|
|
34
|
+
/** How long it is. */
|
|
35
|
+
length: number;
|
|
36
|
+
/** Whether this is the one the design says it should be. */
|
|
37
|
+
intended: boolean;
|
|
38
|
+
/** The pieces, in the order they go round it, and which of them went in the other way round. */
|
|
39
|
+
pieces: { name: string; flipped: boolean }[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** What a route would make, and whether that is one thing. */
|
|
43
|
+
export interface RouteCheck {
|
|
44
|
+
/** The enzymes asked for that are real ones, as they are written. */
|
|
45
|
+
enzymes: string[];
|
|
46
|
+
/** The pieces the cut gives: how long each is, and the unpaired bases at each end. */
|
|
47
|
+
pieces: { name: string; length: number; left: string; right: string }[];
|
|
48
|
+
/** Every circle the pieces could close into, the intended one first if it is among them. */
|
|
49
|
+
products: RouteProduct[];
|
|
50
|
+
/** Whether the route makes what the design says. A route that does not is a route for something else. */
|
|
51
|
+
makesIt: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The circles it could make instead of the intended one. Each of these is a plasmid somebody could
|
|
54
|
+
* carry away from the bench believing it was the design.
|
|
55
|
+
*/
|
|
56
|
+
instead: RouteProduct[];
|
|
57
|
+
/** Why there is nothing to say, said for a person, or `null` if there is. */
|
|
58
|
+
problem: string | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const clean = (bases: string): string => bases.replace(/\s+/g, "").toUpperCase();
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The enzymes a plan says to cut with.
|
|
65
|
+
*
|
|
66
|
+
* A plan has no field for its enzymes, so they live in its settings as the words somebody wrote,
|
|
67
|
+
* such as `BamHI and AvrII`. That is a convention rather than a promise, which is why this is a
|
|
68
|
+
* reading and not a lookup: it returns what it could make of the words, and nothing for words that
|
|
69
|
+
* are not enzymes.
|
|
70
|
+
*
|
|
71
|
+
* @param plan - A plan, or anything with settings.
|
|
72
|
+
* @param field - Which setting holds them. `cut_with` by default.
|
|
73
|
+
* @returns The names it found, in the order written.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* routeOf({ settings: { cut_with: "BamHI and AvrII" } }); // ["BamHI", "AvrII"]
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export function routeOf(plan: { settings?: Record<string, string | number> }, field = "cut_with"): string[] {
|
|
81
|
+
const said = plan.settings?.[field];
|
|
82
|
+
if (typeof said !== "string") return [];
|
|
83
|
+
// "and" is how a person writes it and is not an enzyme; everything else is left for the lookup.
|
|
84
|
+
return parseEnzymeNames(said.replace(/\band\b/gi, " ")).filter((one) => one.length > 0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Cut a design with the enzymes a route names, and see how many circles the pieces could close into.
|
|
89
|
+
*
|
|
90
|
+
* @param design - The molecule the route is meant to make, and whether it is a circle.
|
|
91
|
+
* @param enzymes - The enzyme names the route cuts with, as {@link routeOf} reads them.
|
|
92
|
+
* @returns What the route would make. `problem` says why where it could not be worked out.
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* const checked = checkRoute({ sequence: plasmid, circular: true }, ["BamHI", "AvrII"]);
|
|
97
|
+
* checked.makesIt; // true — the route does make the design
|
|
98
|
+
* checked.instead.length; // 0 — and it cannot make anything else
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export function checkRoute(design: { sequence: string; circular?: boolean }, enzymes: readonly string[]): RouteCheck {
|
|
102
|
+
const bases = clean(design.sequence);
|
|
103
|
+
const circular = design.circular === true;
|
|
104
|
+
const { enzymes: found } = lookupEnzymes([...new Set(enzymes)]);
|
|
105
|
+
const names = found.map((one) => one.name);
|
|
106
|
+
const empty = { enzymes: names, pieces: [], products: [], makesIt: false, instead: [] };
|
|
107
|
+
if (enzymes.length === 0) return { ...empty, problem: "The plan does not say what to cut with." };
|
|
108
|
+
if (found.length === 0) return { ...empty, problem: "None of those is an enzyme this knows." };
|
|
109
|
+
if (bases.length === 0) return { ...empty, problem: "There is nothing to cut." };
|
|
110
|
+
|
|
111
|
+
let bits;
|
|
112
|
+
try { bits = cut(Dseq.quick(bases, circular), found); } catch { return { ...empty, problem: "That could not be cut." }; }
|
|
113
|
+
if (bits.length < 2) return { ...empty, problem: `${names.join(" and ")} ${names.length === 1 ? "does" : "do"} not cut this into pieces.` };
|
|
114
|
+
if (bits.length > MOST_PIECES) return { ...empty, problem: `That cuts into ${bits.length} pieces, too many to put back together every way round.` };
|
|
115
|
+
|
|
116
|
+
const pieces: LigationPiece[] = bits.map((bit, at) => ({
|
|
117
|
+
id: `piece-${at}`, name: `${bit.length} bp`, sequence: bit.toBluntString().toUpperCase(),
|
|
118
|
+
ends: { left: -(bit.ovhg ?? 0), right: -(bit.watsonOvhg ?? 0) },
|
|
119
|
+
}));
|
|
120
|
+
const shown = pieces.map((piece, at) => ({
|
|
121
|
+
name: piece.name, length: bits[at]!.length,
|
|
122
|
+
left: piece.sequence.slice(0, Math.abs(piece.ends.left)), right: piece.sequence.slice(piece.sequence.length - Math.abs(piece.ends.right)),
|
|
123
|
+
}));
|
|
124
|
+
|
|
125
|
+
const plan = planLigation(pieces);
|
|
126
|
+
if (plan.problem !== null) return { ...empty, pieces: shown, problem: plan.problem };
|
|
127
|
+
|
|
128
|
+
const wanted = partChecksum({ sequence: bases, circular });
|
|
129
|
+
// Only the circles of the right length are in the running. A route that also makes a shorter
|
|
130
|
+
// circle out of some of the pieces is a separate matter, and a gel tells those apart anyway.
|
|
131
|
+
const seen = new Map<string, RouteProduct>();
|
|
132
|
+
for (const made of plan.products as readonly LigationProduct[]) {
|
|
133
|
+
if (!made.circular || made.length !== bases.length) continue;
|
|
134
|
+
let checksum;
|
|
135
|
+
try { checksum = partChecksum({ sequence: made.sequence, circular: true }); } catch { continue; }
|
|
136
|
+
if (seen.has(checksum)) continue;
|
|
137
|
+
seen.set(checksum, { checksum, length: made.length, intended: checksum === wanted,
|
|
138
|
+
pieces: made.pieces.map((one) => ({ name: one.name, flipped: one.flipped })) });
|
|
139
|
+
}
|
|
140
|
+
const products = [...seen.values()].sort((one, two) => Number(two.intended) - Number(one.intended));
|
|
141
|
+
const instead = products.filter((one) => !one.intended);
|
|
142
|
+
return { enzymes: names, pieces: shown, products, makesIt: products.some((one) => one.intended), instead, problem: null };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* What to tell somebody about a route, in a line.
|
|
147
|
+
*
|
|
148
|
+
* @param checked - A route, checked.
|
|
149
|
+
* @returns The sentence, or `null` where there is nothing worth saying — a route with one answer
|
|
150
|
+
* needs no remark.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* saysRoute(checkRoute(design, ["XhoI", "AvrII"]));
|
|
155
|
+
* // "Those cuts could also make 1 other plasmid of the same length, which a digest with them
|
|
156
|
+
* // would not tell apart. One of the pieces goes in either way round."
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
export function saysRoute(checked: RouteCheck): string | null {
|
|
160
|
+
if (checked.problem !== null) return checked.problem;
|
|
161
|
+
if (!checked.makesIt) return "Those cuts do not make what this is expected to make.";
|
|
162
|
+
if (checked.instead.length === 0) return null;
|
|
163
|
+
const flips = checked.instead.some((one) => one.pieces.some((piece) => piece.flipped));
|
|
164
|
+
return `Those cuts could also make ${checked.instead.length} other plasmid${checked.instead.length === 1 ? "" : "s"} ` +
|
|
165
|
+
`of the same length, which a digest with them would not tell apart.` +
|
|
166
|
+
(flips ? " One of the pieces goes in either way round." : "");
|
|
167
|
+
}
|
package/src/work.tsx
CHANGED
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
* It asserts nothing. Everything here comes from `planOfWork`, which works the order out from what
|
|
12
12
|
* each proposal makes and what each one needs, so what is drawn cannot drift from what is true.
|
|
13
13
|
*/
|
|
14
|
-
import { useState, type ReactNode } from "react";
|
|
14
|
+
import { useMemo, useState, type ReactNode } from "react";
|
|
15
15
|
import { useAct, useLab } from "@biolibs/bionet-react";
|
|
16
16
|
import { Glossed } from "@biolibs/glossary-react";
|
|
17
17
|
import { FILED_UNDER, UNFILED, planOfWork, saysWork, type Project, type Step } from "./ordering.js";
|
|
18
18
|
import { protocolText, protocolsFor } from "./protocol.js";
|
|
19
|
+
import { checkRoute, routeOf, saysRoute } from "./route.js";
|
|
19
20
|
|
|
20
21
|
/** What a step is called, by what kind of run it is. */
|
|
21
22
|
const CALLED: Readonly<Record<string, string>> = {
|
|
@@ -50,6 +51,18 @@ export function WorkToDo({ onOpen }: { onOpen?: (plan: Step["plan"]) => void } =
|
|
|
50
51
|
const [sheet, setSheet] = useState<string | null>(null);
|
|
51
52
|
const [taking, setTaking] = useState("");
|
|
52
53
|
const [told, setTold] = useState<string | null>(null);
|
|
54
|
+
// Whether each step's route has one answer. Putting a plan's pieces back together every way round
|
|
55
|
+
// costs tens of milliseconds, so it is worked out once per plan and kept until that plan's product
|
|
56
|
+
// or its enzymes change.
|
|
57
|
+
const open = lab?.plans.filter((one) => one.settled === null) ?? [];
|
|
58
|
+
const routes = useMemo(
|
|
59
|
+
() => new Map(open.flatMap((plan) => {
|
|
60
|
+
const enzymes = routeOf(plan);
|
|
61
|
+
const design = plan.expects[0];
|
|
62
|
+
return enzymes.length === 0 || design === undefined ? [] : [[plan.plan, checkRoute(design, enzymes)] as const];
|
|
63
|
+
})),
|
|
64
|
+
[open.map((plan) => `${plan.plan}:${plan.expects[0]?.checksum ?? ""}:${String(plan.settings["cut_with"] ?? "")}`).join("|")],
|
|
65
|
+
);
|
|
53
66
|
if (lab === null || lab === undefined) return null;
|
|
54
67
|
const whole = planOfWork(lab);
|
|
55
68
|
const shown: Project | undefined = only === null ? undefined : whole.projects.find((one) => one.name === only);
|
|
@@ -274,7 +287,10 @@ export function WorkToDo({ onOpen }: { onOpen?: (plan: Step["plan"]) => void } =
|
|
|
274
287
|
</div>
|
|
275
288
|
{!thread.clear && <p className="small attention">Something in this one has to be dealt with before it can be finished.</p>}
|
|
276
289
|
<ol className="steps">
|
|
277
|
-
{thread.steps.map((step) =>
|
|
290
|
+
{thread.steps.map((step) => {
|
|
291
|
+
const checked = routes.get(step.plan.plan);
|
|
292
|
+
const aboutRoute = checked === undefined ? null : saysRoute(checked);
|
|
293
|
+
return (
|
|
278
294
|
<li key={step.plan.plan} className={step.held === null ? "ready" : "held"}>
|
|
279
295
|
<p className="small">
|
|
280
296
|
<strong>{at(step.plan.plan)}. {stepName(step.plan)}</strong>
|
|
@@ -290,6 +306,8 @@ export function WorkToDo({ onOpen }: { onOpen?: (plan: Step["plan"]) => void } =
|
|
|
290
306
|
. Proposed by {person(step.plan.by)}.
|
|
291
307
|
</p>
|
|
292
308
|
{step.plan.note !== null && <p className="small why">{step.plan.note}</p>}
|
|
309
|
+
{step.plan.orphaned.length > 0 && <p className="small attention">Nothing is going to make {step.plan.orphaned.map(partName).join(" or ")} any more: the only plan that would have has been set aside. If it was refiled, this step is still asking for what the old plan would have made.</p>}
|
|
310
|
+
{aboutRoute !== null && <p className="small attention">{aboutRoute}</p>}
|
|
293
311
|
<div className="row tight">
|
|
294
312
|
{onOpen !== undefined && step.held === null && <button type="button" onClick={() => onOpen(step.plan)}>Set it up</button>}
|
|
295
313
|
<button type="button" className="quiet" onClick={() => { setFiling(filing === step.plan.plan ? null : step.plan.plan); setInto(filedAs(step.plan) === UNFILED ? "" : filedAs(step.plan)); }}>
|
|
@@ -306,7 +324,8 @@ export function WorkToDo({ onOpen }: { onOpen?: (plan: Step["plan"]) => void } =
|
|
|
306
324
|
</form>
|
|
307
325
|
)}
|
|
308
326
|
</li>
|
|
309
|
-
|
|
327
|
+
);
|
|
328
|
+
})}
|
|
310
329
|
</ol>
|
|
311
330
|
{thread.ends.length > 0 && (
|
|
312
331
|
<p className="dim small">It ends with {thread.ends.map((one) => partName(one.checksum) === "a part" ? one.name : partName(one.checksum)).join(" and ")}.</p>
|