@biolibs/bionet-tools 0.1.11 → 0.1.12
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 +151 -0
- package/dist/codons.d.ts +35 -0
- package/dist/codons.d.ts.map +1 -1
- package/dist/codons.js +55 -0
- package/dist/codons.js.map +1 -1
- package/dist/fusion-bench.d.ts +62 -0
- package/dist/fusion-bench.d.ts.map +1 -0
- package/dist/fusion-bench.js +114 -0
- package/dist/fusion-bench.js.map +1 -0
- package/dist/fusion.d.ts +120 -0
- package/dist/fusion.d.ts.map +1 -0
- package/dist/fusion.js +176 -0
- package/dist/fusion.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/modify.js +4 -4
- package/dist/modify.js.map +1 -1
- package/dist/protocol.d.ts +91 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +278 -0
- package/dist/protocol.js.map +1 -0
- package/dist/remedy.d.ts +137 -0
- package/dist/remedy.d.ts.map +1 -0
- package/dist/remedy.js +234 -0
- package/dist/remedy.js.map +1 -0
- package/dist/tools.d.ts +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +3 -2
- package/dist/tools.js.map +1 -1
- package/dist/work.d.ts.map +1 -1
- package/dist/work.js +13 -3
- package/dist/work.js.map +1 -1
- package/package.json +2 -2
- package/src/codons.ts +53 -0
- package/src/fusion-bench.tsx +209 -0
- package/src/fusion.ts +270 -0
- package/src/index.ts +8 -0
- package/src/modify.ts +4 -4
- package/src/protocol.ts +332 -0
- package/src/remedy.ts +277 -0
- package/src/tools.tsx +4 -3
- package/src/work.tsx +44 -2
- package/tools.css +7 -0
package/src/protocol.ts
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The work written out as something a person can carry to a bench.
|
|
3
|
+
*
|
|
4
|
+
* Everything else here is for a screen: a panel that knows the lab, with the tubes in dropdowns and
|
|
5
|
+
* the working folded away. None of it is any use at a bench with gloves on, and a plan nobody can
|
|
6
|
+
* follow standing up is not finished.
|
|
7
|
+
*
|
|
8
|
+
* The whole difficulty is honesty. A plan records what the operator set — the cycling programme, the
|
|
9
|
+
* enzymes, the inducer and how long for — and a protocol wants rather more than that: a polymerase,
|
|
10
|
+
* a buffer, a final volume, a way of making cells competent. Those are not in the plan, and a tool
|
|
11
|
+
* that wrote in plausible ones would be making things up on a page somebody carries to a bench and
|
|
12
|
+
* trusts. So each step carries two lists and they are kept apart: what the plan says to do, which is
|
|
13
|
+
* exact, and what the plan does not say, which is named so the lab fills it in with its own usual
|
|
14
|
+
* way rather than discovering the hole halfway through.
|
|
15
|
+
*
|
|
16
|
+
* Nothing here invents a number. If a volume is in it, somebody set that volume.
|
|
17
|
+
*/
|
|
18
|
+
import type { PlanState } from "@biolibs/bionet";
|
|
19
|
+
import { planOfWork, type OrderingLab, type Step } from "./ordering.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* As much of a lab as a protocol reads: the work, plus the names of things, since a sheet carried to
|
|
23
|
+
* a bench says "1 µL of pGene, in Box 1" and not a checksum.
|
|
24
|
+
*/
|
|
25
|
+
export interface ProtocolLab extends OrderingLab {
|
|
26
|
+
parts: readonly { checksum: string; name: string; length: number; circular: boolean }[];
|
|
27
|
+
strains?: readonly { strain: string; name: string; host: string }[];
|
|
28
|
+
places?: readonly { place: string; name: string }[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One step, as somebody at a bench reads it. */
|
|
32
|
+
export interface ProtocolStep {
|
|
33
|
+
/** Its number within its piece of work. */
|
|
34
|
+
number: number;
|
|
35
|
+
/** What the step is, in a line. */
|
|
36
|
+
title: string;
|
|
37
|
+
/** What to get out before starting, with how much of each and where it is. */
|
|
38
|
+
takeOut: string[];
|
|
39
|
+
/** What to set a machine to, from what the plan recorded. */
|
|
40
|
+
set: { what: string; to: string }[];
|
|
41
|
+
/** What to do, in order. */
|
|
42
|
+
doThis: string[];
|
|
43
|
+
/** What to record afterwards, which is what keeps the lab's history true. */
|
|
44
|
+
thenRecord: string;
|
|
45
|
+
/**
|
|
46
|
+
* What this plan does not say, and the lab has to supply.
|
|
47
|
+
*
|
|
48
|
+
* The most important list on the page. A protocol that quietly left these out would read as
|
|
49
|
+
* complete and send somebody to the bench without a polymerase.
|
|
50
|
+
*/
|
|
51
|
+
notSaid: string[];
|
|
52
|
+
/** Whatever the person who proposed it wanted to say. */
|
|
53
|
+
note: string | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** One piece of work, written out. */
|
|
57
|
+
export interface Protocol {
|
|
58
|
+
/** What it is called. */
|
|
59
|
+
title: string;
|
|
60
|
+
/** A line or two about what it is and what it leaves you with. */
|
|
61
|
+
about: string[];
|
|
62
|
+
/** What the lab has to have before the first step. */
|
|
63
|
+
haveReady: string[];
|
|
64
|
+
/** The steps, in the order to carry them out. */
|
|
65
|
+
steps: ProtocolStep[];
|
|
66
|
+
/** What you have at the end of it. */
|
|
67
|
+
atTheEnd: string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** What a kind of run is called on the page, and what a plan of that kind never says. */
|
|
71
|
+
const KINDS: Readonly<Record<string, { title: string; records: string; notSaid: readonly string[] }>> = {
|
|
72
|
+
pcr: {
|
|
73
|
+
title: "Copy it by PCR",
|
|
74
|
+
records: "at the PCR tool, which takes what it used from each tube and puts the product in the freezer.",
|
|
75
|
+
notSaid: ["which polymerase and which buffer", "the final volume of the reaction, and how much water",
|
|
76
|
+
"how much of each primer, by concentration", "the first denaturation and the last extension"],
|
|
77
|
+
},
|
|
78
|
+
digest: {
|
|
79
|
+
records: "at the digest and gel tool, which takes what it used and notes whether the gel showed what was expected.", title: "Cut it, and run a gel",
|
|
80
|
+
notSaid: ["which buffer, and how much enzyme", "what temperature to cut at and for how long",
|
|
81
|
+
"how the gel is stained and how it is looked at"],
|
|
82
|
+
},
|
|
83
|
+
ligation: {
|
|
84
|
+
records: "at the ligation tool, which takes what it used and puts what came out in the freezer.", title: "Join the pieces",
|
|
85
|
+
notSaid: ["which ligase and which buffer", "the ratio of insert to vector", "what temperature to leave it at, and for how long"],
|
|
86
|
+
},
|
|
87
|
+
assembly: {
|
|
88
|
+
records: "at the assembly tool, which takes what it used and puts the ring in the freezer.", title: "Build the ring",
|
|
89
|
+
notSaid: ["which assembly mix", "what temperature to hold it at, and for how long", "how much of each piece, by concentration"],
|
|
90
|
+
},
|
|
91
|
+
transformation: {
|
|
92
|
+
records: "on the Strains page. Whether it worked is whether colonies grew, which only you can say, and either way it used what it used.", title: "Put it into a host",
|
|
93
|
+
notSaid: ["how the cells are made competent", "heat shock or electroporation, and the settings for it",
|
|
94
|
+
"how long to let them recover, and in what", "what to select on"],
|
|
95
|
+
},
|
|
96
|
+
induction: {
|
|
97
|
+
records: "at the induction tool, which takes what it used and, if the band is there, puts the protein in the freezer.", title: "Grow it and look for the protein",
|
|
98
|
+
notSaid: ["which medium, and what volume", "what density to induce at", "how the cells are broken open, if they are",
|
|
99
|
+
"how the gel is stained"],
|
|
100
|
+
},
|
|
101
|
+
sequencing: { records: "at the checking tool, which compares the read against the design and records what it found.", title: "Have it sequenced", notSaid: ["which facility, and how they want it sent", "how much to send, and at what concentration"] },
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const count = (value: number): string => value.toLocaleString("en-US");
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The work of one piece, written out as a protocol.
|
|
108
|
+
*
|
|
109
|
+
* @param lab - The lab, for the names of what its tubes hold and where they are.
|
|
110
|
+
* @param options - `project` picks one project's work; `title` names the sheet.
|
|
111
|
+
* @returns One protocol for each piece of work, in the order the pieces come.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* import { protocolsFor, protocolText } from "@biolibs/bionet-tools";
|
|
116
|
+
*
|
|
117
|
+
* for (const sheet of protocolsFor(lab, { project: "Real Vegan Cheese" })) console.log(protocolText(sheet));
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export function protocolsFor(lab: ProtocolLab, options: { project?: string; title?: string } = {}): Protocol[] {
|
|
121
|
+
const work = planOfWork(lab);
|
|
122
|
+
const threads = options.project === undefined ? work.threads
|
|
123
|
+
: work.projects.find((one) => one.name === options.project)?.threads ?? [];
|
|
124
|
+
|
|
125
|
+
const partName = (checksum: string | null | undefined): string =>
|
|
126
|
+
lab.parts.find((one) => one.checksum === checksum)?.name ?? "a part";
|
|
127
|
+
const placeName = (place: string | null | undefined): string | null =>
|
|
128
|
+
(lab.places ?? []).find((one) => one.place === place)?.name ?? null;
|
|
129
|
+
/** What is in a tube, by the lab's name for it. */
|
|
130
|
+
const whatIsIn = (item: string): string => {
|
|
131
|
+
const held = lab.items.find((one) => one.item === item);
|
|
132
|
+
if (held === undefined) return "something the lab no longer has";
|
|
133
|
+
return held.part === null
|
|
134
|
+
? (lab.strains ?? []).find((one) => one.strain === held.strain)?.name ?? "a culture"
|
|
135
|
+
: partName(held.part);
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* How much of what, for an instruction: short, because the instruction is read while doing it.
|
|
139
|
+
*/
|
|
140
|
+
const tubeWords = (item: string, amount: number): string => {
|
|
141
|
+
const held = lab.items.find((one) => one.item === item);
|
|
142
|
+
const unit = held?.unit ?? "";
|
|
143
|
+
return `${count(amount)}${unit === "" ? "" : ` ${unit}`} of ${whatIsIn(item)}`;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The same, with where it is and how much the tube holds: for the list of what to fetch before
|
|
147
|
+
* starting, which is read standing in front of a freezer and wants rather more.
|
|
148
|
+
*/
|
|
149
|
+
const fetchWords = (item: string, amount: number): string => {
|
|
150
|
+
const held = lab.items.find((one) => one.item === item);
|
|
151
|
+
if (held === undefined) return "a tube the lab no longer has";
|
|
152
|
+
const unit = held.unit ?? "";
|
|
153
|
+
const where = placeName(held.where?.place);
|
|
154
|
+
return `${tubeWords(item, amount)}${where === null ? "" : ` — in ${where}`}`
|
|
155
|
+
+ ` (the tube holds ${count(held.amount)}${unit === "" ? "" : ` ${unit}`})`;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const says = (plan: PlanState, key: string): string | null => {
|
|
159
|
+
const value = plan.settings[key];
|
|
160
|
+
return value === undefined ? null : String(value);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** What to do, for a kind of run, from what the plan actually recorded. */
|
|
164
|
+
const doingOf = (step: Step): { doThis: string[]; set: { what: string; to: string }[] } => {
|
|
165
|
+
const plan = step.plan;
|
|
166
|
+
const used = plan.inputs.map((one) => ({
|
|
167
|
+
// A part the lab has no tube of has an amount but no unit, since the unit belongs to the tube.
|
|
168
|
+
// A bare "1 of the insert" reads as a mistake, so it is simply named.
|
|
169
|
+
...one, words: one.item === undefined ? partName(one.part) : tubeWords(one.item, one.amount),
|
|
170
|
+
}));
|
|
171
|
+
const byRole = (role: string) => used.filter((one) => one.role === role);
|
|
172
|
+
const makes = plan.expects.map((one) => `${one.name} (${count(one.length)} bp${one.circular ? ", a circle" : ""})`);
|
|
173
|
+
const set: { what: string; to: string }[] = [];
|
|
174
|
+
const doThis: string[] = [];
|
|
175
|
+
|
|
176
|
+
if (plan.kind === "pcr") {
|
|
177
|
+
const template = byRole("template")[0] ?? used[0];
|
|
178
|
+
const primers = used.filter((one) => /primer/.test(one.role));
|
|
179
|
+
doThis.push(`Set up the reaction with ${template?.words ?? "the template"} as the template`
|
|
180
|
+
+ (primers.length === 0 ? "." : `, and ${primers.map((one) => one.words).join(" and ")}.`));
|
|
181
|
+
const programme = ["denature_c", "anneal_c", "anneal_s", "extend_c", "extend_s", "cycles"].map((key) => says(plan, key));
|
|
182
|
+
if (programme.every((one) => one !== null)) {
|
|
183
|
+
set.push({ what: "Denature", to: `${programme[0]} °C` });
|
|
184
|
+
set.push({ what: "Anneal", to: `${programme[1]} °C for ${programme[2]} s` });
|
|
185
|
+
set.push({ what: "Extend", to: `${programme[3]} °C for ${programme[4]} s` });
|
|
186
|
+
set.push({ what: "Cycles", to: String(programme[5]) });
|
|
187
|
+
doThis.push("Run the programme above.");
|
|
188
|
+
} else {
|
|
189
|
+
doThis.push("Run it on the thermocycler. This plan does not record the programme, so set it as the lab usually does for these primers.");
|
|
190
|
+
}
|
|
191
|
+
doThis.push(`Expect ${makes.join(" and ") || "one product"}.`);
|
|
192
|
+
} else if (plan.kind === "digest") {
|
|
193
|
+
const enzymes = (says(plan, "enzymes") ?? "").split("+").filter((one) => one !== "");
|
|
194
|
+
doThis.push(`Cut ${used.map((one) => one.words).join(" and ")}`
|
|
195
|
+
+ (enzymes.length === 0 ? "." : ` with ${enzymes.join(" and ")}.`));
|
|
196
|
+
const gel = says(plan, "gel");
|
|
197
|
+
if (gel !== null) set.push({ what: "Gel", to: `${gel}% agarose` });
|
|
198
|
+
for (const [key, what] of [["volts", "Run at"], ["minutes", "For"]] as const) {
|
|
199
|
+
const value = says(plan, key);
|
|
200
|
+
if (value !== null) set.push({ what, to: key === "volts" ? `${value} V` : `${value} min` });
|
|
201
|
+
}
|
|
202
|
+
const expected = says(plan, "expected");
|
|
203
|
+
doThis.push("Run it on the gel beside a ladder.");
|
|
204
|
+
if (expected !== null) doThis.push(`Expect bands at ${expected.split(",").map((one) => `${count(Number(one))} bp`).join(", ")}.`);
|
|
205
|
+
} else if (plan.kind === "ligation" || plan.kind === "assembly") {
|
|
206
|
+
doThis.push(`Put ${used.map((one) => one.words).join(" and ")} together.`);
|
|
207
|
+
const overlap = says(plan, "overlap");
|
|
208
|
+
if (overlap !== null) set.push({ what: "Overlap at each join", to: `${overlap} bp` });
|
|
209
|
+
const joins = says(plan, "joins");
|
|
210
|
+
if (joins !== null) set.push({ what: "Joins", to: String(joins) });
|
|
211
|
+
doThis.push(`Expect ${makes.join(" and ") || "one product"}.`);
|
|
212
|
+
} else if (plan.kind === "transformation") {
|
|
213
|
+
const construct = byRole("construct")[0];
|
|
214
|
+
const host = byRole("host")[0];
|
|
215
|
+
doThis.push(`Put ${construct?.words ?? "the construct"} into ${host?.words ?? "the host"}.`);
|
|
216
|
+
doThis.push("Plate them out and leave them to grow.");
|
|
217
|
+
doThis.push("Whether it worked is whether colonies grew, which only you can say. Either way it used what it used.");
|
|
218
|
+
} else if (plan.kind === "induction") {
|
|
219
|
+
const culture = used[0];
|
|
220
|
+
doThis.push(`Grow ${culture?.words ?? "the culture"}.`);
|
|
221
|
+
const inducer = says(plan, "inducer");
|
|
222
|
+
const at = says(plan, "at");
|
|
223
|
+
if (inducer !== null) doThis.push(`Add ${inducer}${at === null ? "" : ` to ${at}`}.`);
|
|
224
|
+
for (const [key, what, unit] of [["celsius", "Grow at", "°C"], ["rpm", "Shaking at", "rpm"], ["hours", "For", "h"]] as const) {
|
|
225
|
+
const value = says(plan, key);
|
|
226
|
+
if (value !== null) set.push({ what, to: `${value} ${unit}` });
|
|
227
|
+
}
|
|
228
|
+
const kda = says(plan, "expected_kda");
|
|
229
|
+
doThis.push("Run a sample on a protein gel, beside a lane of the same culture before it was induced.");
|
|
230
|
+
if (kda !== null) doThis.push(`Look for a band at ${kda} kDa that is in the induced lane and not the other.`);
|
|
231
|
+
} else {
|
|
232
|
+
doThis.push(`Carry out the ${plan.kind} with ${used.map((one) => one.words).join(" and ") || "what it names"}.`);
|
|
233
|
+
if (makes.length > 0) doThis.push(`Expect ${makes.join(" and ")}.`);
|
|
234
|
+
}
|
|
235
|
+
return { doThis, set };
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return threads.map((thread) => {
|
|
239
|
+
const steps: ProtocolStep[] = thread.steps.map((step, at) => {
|
|
240
|
+
const known = KINDS[step.plan.kind];
|
|
241
|
+
const number = at + 1;
|
|
242
|
+
const { doThis, set } = doingOf(step);
|
|
243
|
+
// Something with no tube may be made by a step before this one, which the chain already
|
|
244
|
+
// knows. Saying "order it" when step 1 makes it would send somebody shopping for nothing.
|
|
245
|
+
const madeAt = (checksum: string | undefined): number | null => {
|
|
246
|
+
const at = thread.steps.findIndex((each) => each.makes.includes(checksum ?? ""));
|
|
247
|
+
return at < 0 || at >= number ? null : at + 1;
|
|
248
|
+
};
|
|
249
|
+
const takeOut = step.plan.inputs.map((one) => {
|
|
250
|
+
if (one.item !== undefined) return fetchWords(one.item, one.amount);
|
|
251
|
+
const from = madeAt(one.part);
|
|
252
|
+
return from === null
|
|
253
|
+
? `${partName(one.part)} — the lab has no tube of it, and nothing here makes it: order or make it first`
|
|
254
|
+
: `${partName(one.part)} — what step ${from} makes`;
|
|
255
|
+
});
|
|
256
|
+
return {
|
|
257
|
+
number,
|
|
258
|
+
title: known?.title ?? `Carry out the ${step.plan.kind}`,
|
|
259
|
+
takeOut, set, doThis,
|
|
260
|
+
// Recording is what keeps the lab's history true, and where it is done differs by kind:
|
|
261
|
+
// a transformation is not run at a machine and is said on the Strains page.
|
|
262
|
+
thenRecord: `Record it ${known?.records ?? `at the ${step.plan.kind} tool.`}`,
|
|
263
|
+
notSaid: [...(known?.notSaid ?? ["what this plan does not record, the lab supplies as usual"])],
|
|
264
|
+
note: step.plan.note,
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
const needed = work.toGet.filter((one) => one.forSteps.some((each) => thread.steps.some((step) => step.plan.plan === each)));
|
|
268
|
+
// A chain that makes nothing — a digest, a check — has no product to be named by, so it is
|
|
269
|
+
// named by what it is done to, which is what somebody looking for the sheet would call it.
|
|
270
|
+
const actsOn = thread.steps[0]?.plan.inputs.flatMap((one) => (one.item === undefined ? [partName(one.part)] : [whatIsIn(one.item)])) ?? [];
|
|
271
|
+
return {
|
|
272
|
+
title: options.title ?? (thread.ends.length > 0 ? thread.name
|
|
273
|
+
: actsOn.length > 0 ? `${KINDS[thread.steps[0]!.plan.kind]?.title ?? thread.steps[0]!.plan.kind}: ${actsOn[0]}` : thread.name),
|
|
274
|
+
about: [
|
|
275
|
+
`${steps.length} ${steps.length === 1 ? "step" : "steps"}.`,
|
|
276
|
+
...(thread.ends.length === 0 ? [] : [`It ends with ${thread.ends.map((one) => partName(one.checksum) === "a part" ? one.name : partName(one.checksum)).join(" and ")}.`]),
|
|
277
|
+
"Every step is proposed, not done: nothing is used and nothing is recorded until somebody carries it out and says so.",
|
|
278
|
+
],
|
|
279
|
+
haveReady: [
|
|
280
|
+
...needed.map((one) => `${partName(one.checksum) === "a part" ? one.name : partName(one.checksum)} — nothing here makes it and the lab has no tube: order or make it first.`),
|
|
281
|
+
...[...new Set(thread.steps.flatMap((step) => step.plan.inputs.flatMap((one) => (one.item === undefined ? [] : [fetchWords(one.item, one.amount)]))))],
|
|
282
|
+
],
|
|
283
|
+
steps,
|
|
284
|
+
atTheEnd: thread.ends.map((one) => partName(one.checksum) === "a part" ? one.name : partName(one.checksum)),
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* A protocol as text, to print or to paste.
|
|
291
|
+
*
|
|
292
|
+
* Markdown, because it reads as well unrendered as rendered, and somebody at a bench is as likely to
|
|
293
|
+
* have it in a terminal or a text file as on a page.
|
|
294
|
+
*
|
|
295
|
+
* @param protocol - What `protocolsFor` gave.
|
|
296
|
+
* @returns The sheet.
|
|
297
|
+
*/
|
|
298
|
+
export function protocolText(protocol: Protocol): string {
|
|
299
|
+
const out: string[] = [`# ${protocol.title}`, ""];
|
|
300
|
+
for (const line of protocol.about) out.push(line, "");
|
|
301
|
+
if (protocol.haveReady.length > 0) {
|
|
302
|
+
out.push("## Have ready", "");
|
|
303
|
+
for (const one of protocol.haveReady) out.push(`- ${one}`);
|
|
304
|
+
out.push("");
|
|
305
|
+
}
|
|
306
|
+
for (const step of protocol.steps) {
|
|
307
|
+
out.push(`## ${step.number}. ${step.title}`, "");
|
|
308
|
+
if (step.note !== null) out.push(`*${step.note}*`, "");
|
|
309
|
+
if (step.takeOut.length > 0) {
|
|
310
|
+
out.push("**Take out**", "");
|
|
311
|
+
for (const one of step.takeOut) out.push(`- ${one}`);
|
|
312
|
+
out.push("");
|
|
313
|
+
}
|
|
314
|
+
if (step.set.length > 0) {
|
|
315
|
+
out.push("**Set**", "");
|
|
316
|
+
for (const one of step.set) out.push(`- ${one.what}: ${one.to}`);
|
|
317
|
+
out.push("");
|
|
318
|
+
}
|
|
319
|
+
out.push("**Do**", "");
|
|
320
|
+
for (const [at, one] of step.doThis.entries()) out.push(`${at + 1}. ${one}`);
|
|
321
|
+
out.push("", `**Then** ${step.thenRecord}`, "");
|
|
322
|
+
out.push("**This plan does not say**", "");
|
|
323
|
+
for (const one of step.notSaid) out.push(`- ${one}`);
|
|
324
|
+
out.push("");
|
|
325
|
+
}
|
|
326
|
+
if (protocol.atTheEnd.length > 0) out.push(`At the end you have ${protocol.atTheEnd.join(" and ")}.`, "");
|
|
327
|
+
out.push("---", "",
|
|
328
|
+
"Everything above that is a number — a volume, a temperature, a time, a length — is what somebody",
|
|
329
|
+
"set or what the lab's own tools worked out. Nothing here was filled in to make the page look finished:",
|
|
330
|
+
"what the plan does not say is listed under each step instead.");
|
|
331
|
+
return out.join("\n");
|
|
332
|
+
}
|
package/src/remedy.ts
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What to do about a host that will not phosphorylate what you asked it to make.
|
|
3
|
+
*
|
|
4
|
+
* `modify.ts` answers the question. This one is about what follows from the answer, and it is a
|
|
5
|
+
* different kind of thing to be careful about. Diagnosing is cheap to be honest about: either the
|
|
6
|
+
* motif is there or it is not, either the host is held to have the enzyme or it is not. Proposing a
|
|
7
|
+
* way round is where a tool can do real damage, because the ways round are not equivalent, the most
|
|
8
|
+
* computable of them is the least likely to work, and a lab that spends a month on the wrong one
|
|
9
|
+
* has spent a month.
|
|
10
|
+
*
|
|
11
|
+
* So two things are kept apart here, and neither pretends to be the other.
|
|
12
|
+
*
|
|
13
|
+
* **The routes** are laid out with what each costs and how firmly it is held, and none of them is
|
|
14
|
+
* recommended. Which one a lab takes depends on what it has — a tissue culture room, a second
|
|
15
|
+
* selection marker, a purified kinase, patience — and nothing here knows that.
|
|
16
|
+
*
|
|
17
|
+
* **The one that can be computed** is the phosphomimetic: replacing each phosphoserine with a
|
|
18
|
+
* glutamate or an aspartate, which carries a negative charge without needing any enzyme at all.
|
|
19
|
+
* That is arithmetic and {@link phosphomimetic} does it exactly. What it is not is a substitute for
|
|
20
|
+
* phosphorylation, and the honest framing is the whole value of the tool: a phosphoserine carries
|
|
21
|
+
* about two negative charges at neutral pH and a glutamate carries one, in a smaller group of a
|
|
22
|
+
* different shape, and for casein the clusters that bind calcium do so in a way that depends on
|
|
23
|
+
* that shape. It is a way of asking whether charge alone is enough. It is not a way of making
|
|
24
|
+
* phosphorylated casein, and a tool that let somebody believe otherwise would be worse than none.
|
|
25
|
+
*/
|
|
26
|
+
import { ProteinAnalysis } from "@biolibs/seqtools";
|
|
27
|
+
import { CODON } from "./codons.js";
|
|
28
|
+
import { DA_PER_KDA } from "./induce.js";
|
|
29
|
+
import type { HostKinases } from "./modify.js";
|
|
30
|
+
import type { Working } from "./pcr-working.js";
|
|
31
|
+
|
|
32
|
+
/** One way round a host that will not do it. */
|
|
33
|
+
export interface Remedy {
|
|
34
|
+
/** Short name, to pick it by. */
|
|
35
|
+
name: string;
|
|
36
|
+
/** What it is, in a sentence or two. */
|
|
37
|
+
what: string;
|
|
38
|
+
/** What it costs the lab: what it needs and what it gives up. */
|
|
39
|
+
costs: string;
|
|
40
|
+
/** How firmly the route is held to work at all. */
|
|
41
|
+
standing: "well established" | "reported" | "worth trying";
|
|
42
|
+
/** Whether anything here can work it out, or it is only described. */
|
|
43
|
+
computable: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The ways round a host that will not phosphorylate what it makes, in no order of preference.
|
|
48
|
+
*
|
|
49
|
+
* None is recommended, because which one suits depends on what a lab has — a tissue culture room, a
|
|
50
|
+
* second selection marker, a purified kinase, time — and nothing here knows that. What is said of
|
|
51
|
+
* each is what it costs and how firmly it is held.
|
|
52
|
+
*/
|
|
53
|
+
export const REMEDIES: readonly Remedy[] = [
|
|
54
|
+
{
|
|
55
|
+
name: "co-express the kinase",
|
|
56
|
+
what: "Put a kinase into the host alongside the protein, so that the cell does the phosphorylating itself. For a secreted protein the kinase has to reach the same compartment the protein passes through, which is the part that usually decides whether it works.",
|
|
57
|
+
costs: "A second construct, a second selection marker, and a second thing that can go wrong. The kinase's own expression has to be got right before anything can be said about the protein's.",
|
|
58
|
+
standing: "reported", computable: false,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "a host that already has it",
|
|
62
|
+
what: "Express it in something that phosphorylates secreted proteins as a matter of course — a mammalian cell line does, which is what makes milk in the first place.",
|
|
63
|
+
costs: "Slow, expensive, and a different set of skills and equipment. It is why almost nobody makes a food protein this way.",
|
|
64
|
+
standing: "well established", computable: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "phosphorylate it afterwards",
|
|
68
|
+
what: "Make the protein unphosphorylated, purify it, and treat it with a purified kinase and ATP in a tube.",
|
|
69
|
+
costs: "The kinase has to be bought or made, and the reaction has to be driven to something like completion on a purified protein, which is not the same as a cell doing it as the protein is made.",
|
|
70
|
+
standing: "reported", computable: false,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "a phosphomimetic",
|
|
74
|
+
what: "Change each serine that would have been phosphorylated to a glutamate or an aspartate, which carries a negative charge with no enzyme needed. The gene is rewritten; nothing is added to the cell.",
|
|
75
|
+
costs: "It is not the same molecule. A phosphoserine carries about two negative charges at neutral pH and a glutamate carries one, in a smaller group of a different shape. It asks whether charge alone is enough; it does not make phosphorylated protein.",
|
|
76
|
+
standing: "worth trying", computable: true,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "measure what you actually get",
|
|
80
|
+
what: "Express it, run the gel, and test the thing you care about — whether micelles form, whether calcium is bound — rather than assuming the answer from whether the host has an enzyme.",
|
|
81
|
+
costs: "Nothing beyond the experiment, and it is the only one of these that tells you where you really are rather than where the literature says you probably are.",
|
|
82
|
+
standing: "well established", computable: false,
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
/** One residue swapped for something that carries a charge. */
|
|
87
|
+
export interface Swapped {
|
|
88
|
+
/** Where it is, counting from 1 on the protein given. */
|
|
89
|
+
at: number;
|
|
90
|
+
/** What was there, and what it became. */
|
|
91
|
+
was: string;
|
|
92
|
+
now: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** A protein with its phosphosites swapped for something charged. */
|
|
96
|
+
export interface Phosphomimetic {
|
|
97
|
+
/** The protein, changed. */
|
|
98
|
+
protein: string;
|
|
99
|
+
/** Each residue that changed. */
|
|
100
|
+
swapped: Swapped[];
|
|
101
|
+
/** What was asked for but could not be changed, because that residue is not one that is phosphorylated. */
|
|
102
|
+
notSwapped: { at: number; was: string; why: string }[];
|
|
103
|
+
/** What it weighs before and after, in daltons, and what that is on a gel. */
|
|
104
|
+
weight: { before: number; after: number } | null;
|
|
105
|
+
kilodaltons: { before: number; after: number } | null;
|
|
106
|
+
/** The pH it carries no net charge at, before and after: the figure this changes most. */
|
|
107
|
+
isoelectric: { before: number; after: number } | null;
|
|
108
|
+
/** What a careful person would know before leaning on it. */
|
|
109
|
+
warnings: string[];
|
|
110
|
+
/** Why nothing could be done, or `null`. */
|
|
111
|
+
problem: string | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** What may stand in for a phosphoserine, and how far it gets. */
|
|
115
|
+
const INSTEAD: Readonly<Record<string, { charge: number; says: string }>> = {
|
|
116
|
+
E: { charge: 1, says: "glutamate: one negative charge, and the longer of the two side chains" },
|
|
117
|
+
D: { charge: 1, says: "aspartate: one negative charge, and the shorter side chain" },
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** Which residues are phosphorylated at all. */
|
|
121
|
+
const PHOSPHORYLATED = new Set(["S", "T", "Y"]);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Swap each named residue for something that carries a negative charge.
|
|
125
|
+
*
|
|
126
|
+
* @param protein - The amino acids.
|
|
127
|
+
* @param sites - Where the phosphosites are, counting from 1 on that sequence.
|
|
128
|
+
* @param options - `instead` is what to put there, `E` unless said.
|
|
129
|
+
* @returns The changed protein, what it changed, and what it does and does not reproduce.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```ts
|
|
133
|
+
* import { phosphomimetic } from "@biolibs/bionet-tools";
|
|
134
|
+
*
|
|
135
|
+
* const asked = phosphomimetic(casein, [15, 17, 18, 19, 35]);
|
|
136
|
+
* asked.isoelectric; // what the change really does: the charge, not the shape
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export function phosphomimetic(protein: string, sites: readonly number[], options: { instead?: "E" | "D" } = {}): Phosphomimetic {
|
|
140
|
+
const chain = protein.replace(/\s+/g, "").toUpperCase();
|
|
141
|
+
const nothing = (problem: string): Phosphomimetic =>
|
|
142
|
+
({ protein: chain, swapped: [], notSwapped: [], weight: null, kilodaltons: null, isoelectric: null, warnings: [], problem });
|
|
143
|
+
if (chain === "") return nothing("There is no protein here to change.");
|
|
144
|
+
if (!/^[ACDEFGHIKLMNPQRSTVWY]+$/.test(chain)) return nothing("That is written in letters that are not the twenty standard amino acids.");
|
|
145
|
+
const instead = options.instead ?? "E";
|
|
146
|
+
if (!Object.hasOwn(INSTEAD, instead)) return nothing("A phosphomimetic is a glutamate or an aspartate.");
|
|
147
|
+
if (sites.length === 0) return nothing("No sites were given, so there is nothing to change.");
|
|
148
|
+
|
|
149
|
+
const letters = [...chain];
|
|
150
|
+
const swapped: Swapped[] = [];
|
|
151
|
+
const notSwapped: Phosphomimetic["notSwapped"] = [];
|
|
152
|
+
for (const at of [...new Set(sites)].sort((a, b) => a - b)) {
|
|
153
|
+
const was = letters[at - 1];
|
|
154
|
+
if (was === undefined) { notSwapped.push({ at, was: "", why: `This protein has ${chain.length} residues, so there is nothing at ${at}.` }); continue; }
|
|
155
|
+
if (!PHOSPHORYLATED.has(was)) { notSwapped.push({ at, was, why: `${was}${at} is not a serine, a threonine or a tyrosine, so it was never phosphorylated.` }); continue; }
|
|
156
|
+
letters[at - 1] = instead;
|
|
157
|
+
swapped.push({ at, was, now: instead });
|
|
158
|
+
}
|
|
159
|
+
const changed = letters.join("");
|
|
160
|
+
|
|
161
|
+
const figures = (one: string): { weight: number; isoelectric: number } | null => {
|
|
162
|
+
try { const analysis = new ProteinAnalysis(one); return { weight: analysis.molecularWeight(), isoelectric: analysis.isoelectricPoint() }; }
|
|
163
|
+
catch { return null; }
|
|
164
|
+
};
|
|
165
|
+
const before = figures(chain);
|
|
166
|
+
const after = figures(changed);
|
|
167
|
+
|
|
168
|
+
const warnings: string[] = [];
|
|
169
|
+
if (swapped.length > 0) {
|
|
170
|
+
warnings.push(`A phosphoserine carries about two negative charges at the pH of a cell; ${INSTEAD[instead]!.says}. So this reproduces something like half the charge, and none of the shape.`);
|
|
171
|
+
warnings.push("Where phosphoserines sit in a cluster and bind calcium between them — which is what makes casein build a micelle — the geometry matters as much as the charge, and a glutamate does not have it.");
|
|
172
|
+
warnings.push("Treat this as a way of asking whether charge alone is enough, and as something to compare against the real thing rather than to stand in for it.");
|
|
173
|
+
}
|
|
174
|
+
if (swapped.length > 0 && notSwapped.length > 0) warnings.push(`${notSwapped.length} of the sites given could not be changed; they are listed.`);
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
protein: changed, swapped, notSwapped,
|
|
178
|
+
weight: before === null || after === null ? null : { before: before.weight, after: after.weight },
|
|
179
|
+
kilodaltons: before === null || after === null ? null : { before: before.weight / DA_PER_KDA, after: after.weight / DA_PER_KDA },
|
|
180
|
+
isoelectric: before === null || after === null ? null : { before: before.isoelectric, after: after.isoelectric },
|
|
181
|
+
warnings,
|
|
182
|
+
problem: swapped.length === 0 && notSwapped.length > 0 ? "None of the sites given is a residue that is phosphorylated." : null,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** A gene rewritten so that it encodes a phosphomimetic. */
|
|
187
|
+
export interface MimeticGene {
|
|
188
|
+
/** The bases, changed. */
|
|
189
|
+
sequence: string;
|
|
190
|
+
/** Each codon that changed, by the amino acid it is, counting codons from 1. */
|
|
191
|
+
changed: { codon: number; was: string; now: string; aminoAcid: string }[];
|
|
192
|
+
/** Why nothing could be done, or `null`. */
|
|
193
|
+
problem: string | null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Rewrite a coding sequence so that it encodes a phosphomimetic.
|
|
198
|
+
*
|
|
199
|
+
* The protein is what matters; this is how you get a lab something it can order. Each named codon is
|
|
200
|
+
* replaced with one for the substitute, and which codon that is can be the host's commonest, so that
|
|
201
|
+
* what comes out is as readable to the host as what went in.
|
|
202
|
+
*
|
|
203
|
+
* @param cds - The coding sequence, a whole number of codons.
|
|
204
|
+
* @param sites - Where the phosphosites are, counting amino acids from 1.
|
|
205
|
+
* @param options - `instead` is what to encode, `E` unless said; `codon` picks the codon to use for
|
|
206
|
+
* it, which `optimiseCodons` can choose from a host's own usage.
|
|
207
|
+
* @returns The gene, and what changed.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* import { mimeticGene } from "@biolibs/bionet-tools";
|
|
212
|
+
*
|
|
213
|
+
* mimeticGene(casein, [15, 17, 18, 19, 35], { codon: "GAA" }).sequence;
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
export function mimeticGene(cds: string, sites: readonly number[], options: { instead?: "E" | "D"; codon?: string } = {}): MimeticGene {
|
|
217
|
+
const bases = cds.replace(/\s+/g, "").toUpperCase();
|
|
218
|
+
if (!/^[ACGT]+$/.test(bases)) return { sequence: bases, changed: [], problem: "A gene to rewrite is written in A, C, G and T, with no uncertain bases." };
|
|
219
|
+
if (bases.length % CODON !== 0) return { sequence: bases, changed: [], problem: `That is ${bases.length} bases, which is not a whole number of codons.` };
|
|
220
|
+
const instead = options.instead ?? "E";
|
|
221
|
+
// The commonest codon for each, where the caller does not pick one from a host's own usage.
|
|
222
|
+
const usual: Readonly<Record<string, string>> = { E: "GAA", D: "GAT" };
|
|
223
|
+
const codon = (options.codon ?? usual[instead] ?? "GAA").toUpperCase();
|
|
224
|
+
if (!/^[ACGT]{3}$/.test(codon)) return { sequence: bases, changed: [], problem: "A codon is three bases of A, C, G and T." };
|
|
225
|
+
|
|
226
|
+
const codons = bases.match(/.{3}/g) ?? [];
|
|
227
|
+
const changed: MimeticGene["changed"] = [];
|
|
228
|
+
for (const at of [...new Set(sites)].sort((a, b) => a - b)) {
|
|
229
|
+
const was = codons[at - 1];
|
|
230
|
+
if (was === undefined || was === codon) continue;
|
|
231
|
+
codons[at - 1] = codon;
|
|
232
|
+
changed.push({ codon: at, was, now: codon, aminoAcid: instead });
|
|
233
|
+
}
|
|
234
|
+
return { sequence: codons.join(""), changed, problem: null };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The routes open to a lab whose host will not do it, with what each costs.
|
|
239
|
+
*
|
|
240
|
+
* @param host - What is held about the host, from `hostPhosphorylation`, or `null` if it is not known.
|
|
241
|
+
* @returns The routes, and a line about where they came from.
|
|
242
|
+
*/
|
|
243
|
+
export function remediesFor(host: HostKinases | null): { routes: Remedy[]; says: string[] } {
|
|
244
|
+
const says: string[] = [];
|
|
245
|
+
if (host === null) {
|
|
246
|
+
says.push("Nothing here says what this host does, which is not the same as its doing nothing. Find out before choosing a way round something that may not be a problem.");
|
|
247
|
+
} else if (host.secretoryKinase === "yes") {
|
|
248
|
+
says.push(`${host.host} is held to have the kinase, so there may be nothing to work round. Measure what you get before changing anything.`);
|
|
249
|
+
} else {
|
|
250
|
+
says.push(`${host.host}: ${host.says}`);
|
|
251
|
+
says.push("None of these is recommended over another. Which suits depends on what the lab has, which nothing here knows.");
|
|
252
|
+
}
|
|
253
|
+
return { routes: [...REMEDIES], says };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The working behind a phosphomimetic: what changed, and what it does and does not reproduce.
|
|
258
|
+
*
|
|
259
|
+
* @param made - What `phosphomimetic` gave.
|
|
260
|
+
* @returns The workings. Empty if nothing could be changed.
|
|
261
|
+
*/
|
|
262
|
+
export function phosphomimeticWorking(made: Phosphomimetic): Working[] {
|
|
263
|
+
if (made.problem !== null || made.swapped.length === 0) return [];
|
|
264
|
+
const round = (value: number): string => value.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
265
|
+
const out: Working[] = [{
|
|
266
|
+
of: "what the swap changes",
|
|
267
|
+
comes: made.isoelectric === null ? `${made.swapped.length} residues` : `pH ${made.isoelectric.before.toFixed(2)} → ${made.isoelectric.after.toFixed(2)}`,
|
|
268
|
+
kind: "exact",
|
|
269
|
+
steps: [
|
|
270
|
+
`${made.swapped.length} ${made.swapped.length === 1 ? "residue" : "residues"} changed: ${made.swapped.map((one) => `${one.was}${one.at}${one.now}`).join(", ")}.`,
|
|
271
|
+
...(made.weight === null ? [] : [`The weight goes from ${round(made.weight.before)} to ${round(made.weight.after)} Da, which is ${round(Math.abs(made.weight.after - made.weight.before))} Da and not something a gel will show.`]),
|
|
272
|
+
...(made.isoelectric === null ? [] : [`The pH it carries no net charge at goes from ${made.isoelectric.before.toFixed(2)} to ${made.isoelectric.after.toFixed(2)}. That is the figure this really changes, and it is why a mimetic is worth trying at all.`]),
|
|
273
|
+
],
|
|
274
|
+
rests: "What is computed here is the sequence and what the sequence comes to. Whether a glutamate does the job a phosphoserine did is not a question a sequence can answer: it carries about half the charge, in a smaller group of a different shape, and where a cluster of phosphoserines binds calcium the shape is part of the work. This is a way of asking whether charge alone is enough.",
|
|
275
|
+
}];
|
|
276
|
+
return out;
|
|
277
|
+
}
|
package/src/tools.tsx
CHANGED
|
@@ -9,13 +9,14 @@ import { PcrTool } from "./pcr-tool.js";
|
|
|
9
9
|
import { instrumentFor, toolFor, type ToolName } from "./run.js";
|
|
10
10
|
import { LigationTool } from "./ligate-bench.js";
|
|
11
11
|
import { AssemblyTool } from "./assembly-bench.js";
|
|
12
|
+
import { FusionTool } from "./fusion-bench.js";
|
|
12
13
|
import { CodonTool } from "./codon-bench.js";
|
|
13
14
|
import { VerifyTool } from "./verify-bench.js";
|
|
14
15
|
import { PrimerTool } from "./primer-bench.js";
|
|
15
16
|
import { SequencesTool } from "./sequences-tool.js";
|
|
16
17
|
|
|
17
18
|
/** The tools used at a desk and not at an instrument: the lab's sequences, and designing primers. */
|
|
18
|
-
export type DeskTool = "sequences" | "primers" | "codons" | "assembly" | "verify";
|
|
19
|
+
export type DeskTool = "sequences" | "primers" | "codons" | "construct" | "assembly" | "verify";
|
|
19
20
|
|
|
20
21
|
/** What each tool is called. */
|
|
21
22
|
export const TOOL_NAMES: Readonly<Record<ToolName, string>> = { pcr: "PCR", digest: "Digest and gel", ligation: "Ligation", induction: "Induction" };
|
|
@@ -70,7 +71,7 @@ export function Tools({ tool: first = "pcr", views = {} }: { tool?: ToolName | D
|
|
|
70
71
|
useEffect(() => { setTool(first); }, [first]);
|
|
71
72
|
if (lab === null || lab === undefined) return null;
|
|
72
73
|
const shown = views[tool];
|
|
73
|
-
const names: [ToolName | DeskTool, string][] = [["sequences", "Sequences"], ["primers", "Primers"], ["codons", "Codons"], ["assembly", "Assembly"], ["verify", "Check"], ...(Object.keys(TOOL_NAMES) as ToolName[]).map((one): [ToolName, string] => [one, TOOL_NAMES[one]])];
|
|
74
|
+
const names: [ToolName | DeskTool, string][] = [["sequences", "Sequences"], ["primers", "Primers"], ["codons", "Codons"], ["construct", "Construct"], ["assembly", "Assembly"], ["verify", "Check"], ...(Object.keys(TOOL_NAMES) as ToolName[]).map((one): [ToolName, string] => [one, TOOL_NAMES[one]])];
|
|
74
75
|
return (
|
|
75
76
|
<div className="tools">
|
|
76
77
|
<div className="row tight pick" role="tablist" aria-label="Tools">
|
|
@@ -78,7 +79,7 @@ export function Tools({ tool: first = "pcr", views = {} }: { tool?: ToolName | D
|
|
|
78
79
|
<button key={one} type="button" role="tab" aria-selected={one === tool} className={one === tool ? "" : "quiet"} onClick={() => setTool(one)}>{name}</button>
|
|
79
80
|
))}
|
|
80
81
|
</div>
|
|
81
|
-
{(typeof shown === "function" ? shown(setTool) : shown) ?? (tool === "sequences" ? <SequencesTool /> : tool === "assembly" ? <AssemblyTool /> : tool === "codons" ? <CodonTool /> : tool === "verify" ? <VerifyTool />
|
|
82
|
+
{(typeof shown === "function" ? shown(setTool) : shown) ?? (tool === "sequences" ? <SequencesTool /> : tool === "construct" ? <FusionTool /> : tool === "assembly" ? <AssemblyTool /> : tool === "codons" ? <CodonTool /> : tool === "verify" ? <VerifyTool />
|
|
82
83
|
: tool === "primers" ? <PrimerTool onPcr={() => setTool("pcr")} />
|
|
83
84
|
: <Tool key={tool} tool={tool} instrument={instrumentFor(lab, tool)} />)}
|
|
84
85
|
</div>
|