@biolibs/bionet-tools 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +183 -5
  2. package/dist/digest-bench.d.ts +76 -0
  3. package/dist/digest-bench.d.ts.map +1 -0
  4. package/dist/digest-bench.js +127 -0
  5. package/dist/digest-bench.js.map +1 -0
  6. package/dist/digest-tool.d.ts.map +1 -1
  7. package/dist/digest-tool.js +2 -1
  8. package/dist/digest-tool.js.map +1 -1
  9. package/dist/digest-working.d.ts +155 -0
  10. package/dist/digest-working.d.ts.map +1 -0
  11. package/dist/digest-working.js +216 -0
  12. package/dist/digest-working.js.map +1 -0
  13. package/dist/index.d.ts +24 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +24 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/ligate-bench.d.ts +92 -0
  18. package/dist/ligate-bench.d.ts.map +1 -0
  19. package/dist/ligate-bench.js +139 -0
  20. package/dist/ligate-bench.js.map +1 -0
  21. package/dist/ligate-working.d.ts +96 -0
  22. package/dist/ligate-working.d.ts.map +1 -0
  23. package/dist/ligate-working.js +145 -0
  24. package/dist/ligate-working.js.map +1 -0
  25. package/dist/ligate.d.ts +152 -0
  26. package/dist/ligate.d.ts.map +1 -0
  27. package/dist/ligate.js +161 -0
  28. package/dist/ligate.js.map +1 -0
  29. package/dist/map.d.ts +69 -0
  30. package/dist/map.d.ts.map +1 -0
  31. package/dist/map.js +80 -0
  32. package/dist/map.js.map +1 -0
  33. package/dist/pcr-bench.d.ts +103 -0
  34. package/dist/pcr-bench.d.ts.map +1 -0
  35. package/dist/pcr-bench.js +211 -0
  36. package/dist/pcr-bench.js.map +1 -0
  37. package/dist/pcr-scene.d.ts +249 -0
  38. package/dist/pcr-scene.d.ts.map +1 -0
  39. package/dist/pcr-scene.js +287 -0
  40. package/dist/pcr-scene.js.map +1 -0
  41. package/dist/pcr-tool.d.ts.map +1 -1
  42. package/dist/pcr-tool.js +2 -1
  43. package/dist/pcr-tool.js.map +1 -1
  44. package/dist/pcr-working.d.ts +126 -0
  45. package/dist/pcr-working.d.ts.map +1 -0
  46. package/dist/pcr-working.js +175 -0
  47. package/dist/pcr-working.js.map +1 -0
  48. package/dist/run.d.ts +103 -5
  49. package/dist/run.d.ts.map +1 -1
  50. package/dist/run.js +132 -12
  51. package/dist/run.js.map +1 -1
  52. package/dist/sequence-file.d.ts +108 -0
  53. package/dist/sequence-file.d.ts.map +1 -0
  54. package/dist/sequence-file.js +145 -0
  55. package/dist/sequence-file.js.map +1 -0
  56. package/dist/sequences-tool.d.ts +13 -0
  57. package/dist/sequences-tool.d.ts.map +1 -0
  58. package/dist/sequences-tool.js +61 -0
  59. package/dist/sequences-tool.js.map +1 -0
  60. package/dist/tools.d.ts +7 -3
  61. package/dist/tools.d.ts.map +1 -1
  62. package/dist/tools.js +11 -5
  63. package/dist/tools.js.map +1 -1
  64. package/dist/working.d.ts +58 -0
  65. package/dist/working.d.ts.map +1 -0
  66. package/dist/working.js +55 -0
  67. package/dist/working.js.map +1 -0
  68. package/package.json +6 -2
  69. package/src/digest-bench.tsx +307 -0
  70. package/src/digest-tool.tsx +2 -1
  71. package/src/digest-working.ts +288 -0
  72. package/src/index.ts +24 -0
  73. package/src/ligate-bench.tsx +293 -0
  74. package/src/ligate-working.ts +182 -0
  75. package/src/ligate.ts +243 -0
  76. package/src/map.tsx +170 -0
  77. package/src/pcr-bench.tsx +403 -0
  78. package/src/pcr-scene.ts +410 -0
  79. package/src/pcr-tool.tsx +2 -1
  80. package/src/pcr-working.ts +228 -0
  81. package/src/run.ts +186 -14
  82. package/src/sequence-file.ts +172 -0
  83. package/src/sequences-tool.tsx +109 -0
  84. package/src/tools.tsx +15 -9
  85. package/src/working.tsx +96 -0
  86. package/tools.css +82 -0
@@ -0,0 +1,155 @@
1
+ /**
2
+ * A digest looked at closely: each cut in its real bases, each piece with its ends, and the working.
3
+ *
4
+ * `digest.ts` says where enzymes cut and how long the pieces are. This says what somebody at the
5
+ * bench pictures and what somebody checking would ask: which bases the enzyme recognised, where it
6
+ * cut each strand and what end that leaves, which cut made each end of each piece, and what is
7
+ * marked on each piece. Like the PCR's working, each figure says whether it is exact or an estimate.
8
+ */
9
+ import type { PartFeature } from "@biolibs/bionet";
10
+ import { type GelType } from "@biolibs/gel";
11
+ import type { Cutter, DigestPlan } from "./digest.js";
12
+ import type { Working } from "./pcr-working.js";
13
+ /** One place an enzyme cuts, in the molecule's own bases. */
14
+ export interface CutSite {
15
+ /** The enzyme. */
16
+ enzyme: string;
17
+ /** The sequence it recognises, as it is written for the enzyme. */
18
+ recognises: string;
19
+ /** Where the top strand is cut: the number of bases before the cut. */
20
+ at: number;
21
+ /** Where the bottom strand is cut, counted along the top strand in the same way. */
22
+ bottom: number;
23
+ /** How far the bottom strand's cut is to the right of the top strand's: positive for a 5′ overhang, negative for a 3′ one, 0 for blunt. */
24
+ stagger: number;
25
+ /** Where the recognised bases are, from the first to one past the last. On a circle the end may be past the origin. */
26
+ site: {
27
+ start: number;
28
+ end: number;
29
+ };
30
+ /** Whether the site reads along the bottom strand. Only an enzyme whose site is not its own mirror can. */
31
+ backwards: boolean;
32
+ /** What kind of end the cut leaves. */
33
+ overhang: "5′" | "3′" | "blunt";
34
+ /** The single-stranded bases of that end, as the top strand has them. Empty for a blunt cut. */
35
+ bases: string;
36
+ /**
37
+ * The stretch around the cut, for drawing: both strands, the bottom written under the top, and
38
+ * within them where the recognised bases are and how many bases precede each strand's cut.
39
+ */
40
+ around: {
41
+ from: number;
42
+ top: string;
43
+ bottom: string;
44
+ site: [number, number];
45
+ cutTop: number;
46
+ cutBottom: number;
47
+ };
48
+ }
49
+ /**
50
+ * Every place one enzyme cuts, with the bases it recognised there.
51
+ *
52
+ * The cut positions come from the restriction engine. This finds the site behind each one by
53
+ * looking for the enzyme's sequence itself, on both strands, and keeps only sites whose cut the
54
+ * engine also found, so each position is explained and none is invented.
55
+ *
56
+ * @param part - The molecule.
57
+ * @param cutter - The enzyme and where it cuts, from `cutsOf`.
58
+ * @returns The sites, in order along the molecule. A cut whose site cannot be found is left out.
59
+ */
60
+ export declare function cutSites(part: {
61
+ sequence: string;
62
+ circular: boolean;
63
+ }, cutter: Cutter): CutSite[];
64
+ /** One end of a piece: what made it. */
65
+ export interface PieceEnd {
66
+ /** The enzyme that cut here, or `null` if this is the molecule's own end. */
67
+ enzyme: string | null;
68
+ /** What kind of end it is. */
69
+ overhang: "5′" | "3′" | "blunt" | "end";
70
+ /** Its single-stranded bases, as the top strand has them. */
71
+ bases: string;
72
+ }
73
+ /** One piece of a digest. */
74
+ export interface DigestPiece {
75
+ /** Where it starts and stops on the molecule. On a circle a piece may run through the origin, so `to` can be the smaller. */
76
+ from: number;
77
+ to: number;
78
+ /** How long it is. */
79
+ length: number;
80
+ /** Its two ends. */
81
+ left: PieceEnd;
82
+ right: PieceEnd;
83
+ /** What is marked on it, placed on the piece's own sequence. Something cut through is kept as far as it is on the piece. */
84
+ features: PartFeature[];
85
+ /** Every base either of its strands has, read along the top strand: the piece as a molecule of its own. */
86
+ sequence: string;
87
+ /** How many of those bases at each end are on one strand only: positive for a 5′ overhang, negative for a 3′ one. */
88
+ ends: {
89
+ left: number;
90
+ right: number;
91
+ };
92
+ }
93
+ /**
94
+ * The pieces a digest gives, each with what made its ends and what it carries.
95
+ *
96
+ * @param part - The molecule, with what is marked on it.
97
+ * @param sites - Every cut, from `cutSites` for each enzyme.
98
+ * @returns The pieces, longest first. Nothing if there are no cuts.
99
+ */
100
+ export declare function digestPieces(part: {
101
+ sequence: string;
102
+ circular: boolean;
103
+ features?: readonly PartFeature[];
104
+ }, sites: readonly CutSite[]): DigestPiece[];
105
+ /**
106
+ * One cut, said as steps that can be checked against the bases.
107
+ *
108
+ * @param site - The cut, from `cutSites`.
109
+ * @returns The working.
110
+ */
111
+ export declare function siteWorking(site: CutSite): Working;
112
+ /**
113
+ * How long the pieces are, as differences between the cuts, with the check that they add up.
114
+ *
115
+ * @param part - How long the molecule is, and whether it is a circle.
116
+ * @param sites - Every cut.
117
+ * @param plan - The digest as the gel engine worked it out, to compare with.
118
+ * @returns The working.
119
+ */
120
+ export declare function piecesWorking(part: {
121
+ length: number;
122
+ circular: boolean;
123
+ }, sites: readonly CutSite[], plan?: Pick<DigestPlan, "fragments">): Working;
124
+ /**
125
+ * Where a piece runs to on a gel, with the rule behind it.
126
+ *
127
+ * @param size - How long the piece is.
128
+ * @param gel - The gel.
129
+ * @returns The working. It is an estimate: the rule is a straight line that real gels only roughly follow.
130
+ */
131
+ export declare function migrationWorking(size: number, gel: GelType): Working;
132
+ /** Something a careful operator would stop and ask about a digest before running the gel. */
133
+ export interface DigestCheck {
134
+ /** `stop` if the gel is unlikely to show what is hoped, `look` if it is only worth a second glance. */
135
+ weight: "stop" | "look";
136
+ /** What to ask, said for a person. */
137
+ says: string;
138
+ /** The comparison that raised it, so it can be checked. */
139
+ because: string;
140
+ }
141
+ /**
142
+ * What a careful operator would ask of a digest, given the gel it is to be run on.
143
+ *
144
+ * Each may be wrong for a particular bench, and none stops a run.
145
+ *
146
+ * @param part - The molecule.
147
+ * @param plan - The digest, from `planDigest`.
148
+ * @param gel - The gel.
149
+ * @returns The checks that apply, the ones most likely to matter first.
150
+ */
151
+ export declare function digestChecks(part: {
152
+ length: number;
153
+ circular: boolean;
154
+ }, plan: Pick<DigestPlan, "cutters" | "fragments" | "bands">, gel: GelType): DigestCheck[];
155
+ //# sourceMappingURL=digest-working.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-working.d.ts","sourceRoot":"","sources":["../src/digest-working.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;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AAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,WAAW,EAAE,CAmBhK"}
@@ -0,0 +1,216 @@
1
+ import { bandPosition } from "@biolibs/gel";
2
+ import { enzymes } from "@biolibs/restriction";
3
+ import { carryFeatures } from "./sequence-file.js";
4
+ const count = (value) => value.toLocaleString("en-US");
5
+ const clean = (bases) => bases.replace(/\s+/g, "").toUpperCase();
6
+ const PAIR = { A: "T", T: "A", G: "C", C: "G", N: "N", R: "Y", Y: "R", K: "M", M: "K", S: "S", W: "W", B: "V", V: "B", D: "H", H: "D" };
7
+ const IUPAC = { A: "A", C: "C", G: "G", T: "T", N: "[ACGT]", R: "[AG]", Y: "[CT]", K: "[GT]", M: "[AC]", S: "[CG]", W: "[AT]", B: "[CGT]", D: "[AGT]", H: "[ACT]", V: "[ACG]" };
8
+ const across = (bases) => [...bases].map((base) => PAIR[base] ?? "N").join("");
9
+ const flipped = (bases) => [...bases].reverse().map((base) => PAIR[base] ?? "N").join("");
10
+ /**
11
+ * Every place one enzyme cuts, with the bases it recognised there.
12
+ *
13
+ * The cut positions come from the restriction engine. This finds the site behind each one by
14
+ * looking for the enzyme's sequence itself, on both strands, and keeps only sites whose cut the
15
+ * engine also found, so each position is explained and none is invented.
16
+ *
17
+ * @param part - The molecule.
18
+ * @param cutter - The enzyme and where it cuts, from `cutsOf`.
19
+ * @returns The sites, in order along the molecule. A cut whose site cannot be found is left out.
20
+ */
21
+ export function cutSites(part, cutter) {
22
+ const enzyme = Object.hasOwn(enzymes, cutter.name) ? enzymes[cutter.name] : undefined;
23
+ const bases = clean(part.sequence);
24
+ const length = bases.length;
25
+ if (enzyme === undefined || enzyme.fst5 === null || enzyme.ovhg === null || length === 0)
26
+ return [];
27
+ const [size, fst5, ovhg] = [enzyme.size, enzyme.fst5, enzyme.ovhg];
28
+ const site = clean(String(enzyme.site));
29
+ // A circle is searched once round and a little further, so a site across the origin is found.
30
+ const searched = part.circular ? bases + bases.slice(0, size - 1) : bases;
31
+ const wrap = (value) => ((value % length) + length) % length;
32
+ const base = (place) => (part.circular ? bases[wrap(place)] : bases[place] ?? "");
33
+ const found = [];
34
+ const look = (pattern, backwards) => {
35
+ const matcher = new RegExp(`(?=(${[...pattern].map((one) => IUPAC[one] ?? one).join("")}))`, "g");
36
+ for (const match of searched.matchAll(matcher)) {
37
+ const start = match.index;
38
+ // Forwards, the top strand is cut `fst5` into the site. Backwards the enzyme sits the other way
39
+ // up, so that is where it cuts the bottom strand, and the top is cut across from its other cut.
40
+ const [top, under] = backwards ? [start + size - fst5 + ovhg, start + size - fst5] : [start + fst5, start + fst5 - ovhg];
41
+ const at = part.circular ? wrap(top) : top;
42
+ if (!cutter.positions.includes(at) || found.some((one) => one.at === at))
43
+ continue;
44
+ const [low, high] = [Math.min(top, under), Math.max(top, under)];
45
+ const from = Math.min(start, low) - 4;
46
+ const to = Math.max(start + size, high) + 4;
47
+ const shown = Array.from({ length: to - from }, (_, index) => base(from + index)).join("");
48
+ found.push({
49
+ enzyme: cutter.name, recognises: site, at, bottom: part.circular ? wrap(under) : under, stagger: under - top, site: { start, end: start + size }, backwards,
50
+ overhang: ovhg === 0 ? "blunt" : top < under ? "5′" : "3′",
51
+ bases: Array.from({ length: high - low }, (_, index) => base(low + index)).join(""),
52
+ around: { from, top: shown, bottom: across(shown), site: [start - from, start + size - from], cutTop: top - from, cutBottom: under - from },
53
+ });
54
+ }
55
+ };
56
+ look(site, false);
57
+ if (flipped(site) !== site)
58
+ look(flipped(site), true);
59
+ return found.sort((a, b) => a.at - b.at);
60
+ }
61
+ /**
62
+ * The pieces a digest gives, each with what made its ends and what it carries.
63
+ *
64
+ * @param part - The molecule, with what is marked on it.
65
+ * @param sites - Every cut, from `cutSites` for each enzyme.
66
+ * @returns The pieces, longest first. Nothing if there are no cuts.
67
+ */
68
+ export function digestPieces(part, sites) {
69
+ const length = clean(part.sequence).length;
70
+ const cuts = [...new Map(sites.map((one) => [one.at, one])).values()].sort((a, b) => a.at - b.at);
71
+ if (cuts.length === 0)
72
+ return [];
73
+ const end = (site) => (site === undefined ? { enzyme: null, overhang: "end", bases: "" } : { enzyme: site.enzyme, overhang: site.overhang, bases: site.bases });
74
+ const features = part.features ?? [];
75
+ const bases = clean(part.sequence);
76
+ const piece = (from, to, left, right) => {
77
+ const span = to > from ? to - from : length - from + to;
78
+ // A strand cut further out than the other gives the piece bases beyond the top strand's cut.
79
+ const [before, after] = [Math.max(0, -(left?.stagger ?? 0)), Math.max(0, right?.stagger ?? 0)];
80
+ const read = (start, many) => Array.from({ length: many }, (_, index) => bases[(((start + index) % length) + length) % length]).join("");
81
+ return {
82
+ from, to, left: end(left), right: end(right), length: span,
83
+ sequence: read(from - before, before + span + after), ends: { left: left?.stagger ?? 0, right: right?.stagger ?? 0 },
84
+ // Through the origin, what is carried is what lies before it and then what lies after.
85
+ features: to > from ? carryFeatures(features, from, to, before) : [...carryFeatures(features, from, length, before), ...carryFeatures(features, 0, to, length - from + before)],
86
+ };
87
+ };
88
+ const pieces = [];
89
+ if (part.circular) {
90
+ cuts.forEach((cut, index) => { const next = cuts[(index + 1) % cuts.length]; pieces.push(piece(cut.at, next.at, cut, next)); });
91
+ // One cut opens a circle into a single piece: it runs from the cut right round to the cut again.
92
+ }
93
+ else {
94
+ const edges = [0, ...cuts.map((one) => one.at), length];
95
+ for (let index = 0; index + 1 < edges.length; index++) {
96
+ if (edges[index + 1] > edges[index])
97
+ pieces.push(piece(edges[index], edges[index + 1], cuts[index - 1], cuts[index]));
98
+ }
99
+ }
100
+ return pieces.sort((a, b) => b.length - a.length);
101
+ }
102
+ /**
103
+ * One cut, said as steps that can be checked against the bases.
104
+ *
105
+ * @param site - The cut, from `cutSites`.
106
+ * @returns The working.
107
+ */
108
+ export function siteWorking(site) {
109
+ const wide = Math.abs(site.at - site.bottom);
110
+ return {
111
+ of: `${site.enzyme} at base ${count(site.at)}`, kind: "exact",
112
+ comes: site.overhang === "blunt" ? "a blunt end" : `a ${wide}-base ${site.overhang} overhang, ${site.bases}`,
113
+ steps: [
114
+ `${site.enzyme} recognises ${site.recognises}. Those bases are at ${count(site.site.start + 1)} to ${count(site.site.end)}${site.backwards ? ", reading along the bottom strand" : ""}.`,
115
+ `It cuts the top strand after base ${count(site.at)} and the bottom strand after base ${count(site.bottom)}.`,
116
+ site.overhang === "blunt" ? "Both strands are cut at the same place, so the ends are blunt."
117
+ : `The cuts are ${wide} bases apart, so each piece is left with ${wide} unpaired bases at its ${site.overhang} end: ${site.bases} on one piece and its partner on the other.`,
118
+ ],
119
+ };
120
+ }
121
+ /**
122
+ * How long the pieces are, as differences between the cuts, with the check that they add up.
123
+ *
124
+ * @param part - How long the molecule is, and whether it is a circle.
125
+ * @param sites - Every cut.
126
+ * @param plan - The digest as the gel engine worked it out, to compare with.
127
+ * @returns The working.
128
+ */
129
+ export function piecesWorking(part, sites, plan) {
130
+ const cuts = [...new Set(sites.map((one) => one.at))].sort((a, b) => a - b);
131
+ const sizes = [];
132
+ const steps = [`The cuts, in order along the molecule: after base ${cuts.map(count).join(", ")}.`];
133
+ if (part.circular) {
134
+ cuts.forEach((cut, index) => {
135
+ const next = cuts[(index + 1) % cuts.length];
136
+ const size = cuts.length === 1 ? part.length : next > cut ? next - cut : part.length - cut + next;
137
+ sizes.push(size);
138
+ steps.push(cuts.length === 1 ? `One cut opens the circle into one piece, the whole ${count(part.length)}.`
139
+ : next > cut ? `From ${count(cut)} to ${count(next)}: ${count(next)} − ${count(cut)} = ${count(size)}.`
140
+ : `From ${count(cut)} through the origin to ${count(next)}: ${count(part.length)} − ${count(cut)} + ${count(next)} = ${count(size)}.`);
141
+ });
142
+ }
143
+ else {
144
+ const edges = [0, ...cuts, part.length];
145
+ for (let index = 0; index + 1 < edges.length; index++) {
146
+ const size = edges[index + 1] - edges[index];
147
+ if (size <= 0)
148
+ continue;
149
+ sizes.push(size);
150
+ steps.push(`From ${index === 0 ? "the start" : count(edges[index])} to ${index + 2 === edges.length ? "the end" : count(edges[index + 1])}: ${count(edges[index + 1])} − ${count(edges[index])} = ${count(size)}.`);
151
+ }
152
+ }
153
+ const total = sizes.reduce((sum, size) => sum + size, 0);
154
+ steps.push(`They add up to the whole molecule: ${sizes.map(count).join(" + ")} = ${count(total)}${total === part.length ? "." : `, which is not its ${count(part.length)}. Something is wrong.`}`);
155
+ if (plan !== undefined) {
156
+ const same = [...sizes].sort((a, b) => b - a).join(",") === [...plan.fragments].sort((a, b) => b - a).join(",");
157
+ steps.push(same ? "The gel engine, working the pieces out its own way, gives the same lengths." : `The gel engine gives ${plan.fragments.map(count).join(", ")}, which does not agree. Trust neither until that is understood.`);
158
+ }
159
+ return { of: "the pieces", comes: `${[...sizes].sort((a, b) => b - a).map(count).join(", ")} bp`, kind: "exact", steps };
160
+ }
161
+ /**
162
+ * Where a piece runs to on a gel, with the rule behind it.
163
+ *
164
+ * @param size - How long the piece is.
165
+ * @param gel - The gel.
166
+ * @returns The working. It is an estimate: the rule is a straight line that real gels only roughly follow.
167
+ */
168
+ export function migrationWorking(size, gel) {
169
+ const [high, low, own] = [Math.log10(gel.largest), Math.log10(gel.smallest), Math.log10(size)];
170
+ const round = (value) => String(Math.round(value * 100) / 100);
171
+ const position = bandPosition(size, gel);
172
+ const inside = size <= gel.largest && size >= gel.smallest;
173
+ return {
174
+ of: `how far ${count(size)} bp runs on ${gel.percent}% agarose`, comes: `${Math.round(position * 100)}% of the way down`, kind: "estimate",
175
+ steps: [
176
+ `This gel separates pieces from ${count(gel.largest)} bp, which barely leave the wells, down to ${count(gel.smallest)} bp, which reach the front.`,
177
+ `Distance goes with the logarithm of length: log₁₀ ${count(gel.largest)} = ${round(high)}, log₁₀ ${count(gel.smallest)} = ${round(low)}, log₁₀ ${count(size)} = ${round(own)}.`,
178
+ inside ? `(${round(high)} − ${round(own)}) ÷ (${round(high)} − ${round(low)}) = ${round(position)} of the way from the wells to the front.`
179
+ : `${count(size)} bp is ${size > gel.largest ? "longer" : "shorter"} than this gel separates, so it is drawn at the ${size > gel.largest ? "wells" : "front"}, with anything else of that kind.`,
180
+ ],
181
+ rests: "Small pieces thread through agarose faster than large ones, and over a gel's working range the distance is close to a straight line against the logarithm of length. Real distance also depends on voltage, time, buffer and the shape of the DNA, so read a piece's size against the ladder beside it, never off the distance alone.",
182
+ };
183
+ }
184
+ /**
185
+ * What a careful operator would ask of a digest, given the gel it is to be run on.
186
+ *
187
+ * Each may be wrong for a particular bench, and none stops a run.
188
+ *
189
+ * @param part - The molecule.
190
+ * @param plan - The digest, from `planDigest`.
191
+ * @param gel - The gel.
192
+ * @returns The checks that apply, the ones most likely to matter first.
193
+ */
194
+ export function digestChecks(part, plan, gel) {
195
+ const checks = [];
196
+ for (const one of plan.cutters.filter((cutter) => cutter.positions.length === 0)) {
197
+ checks.push({ weight: "look", says: `${one.name} does not cut this. It is in the tube and does nothing.`, because: `${one.site} is not in the sequence` });
198
+ }
199
+ for (const band of plan.bands.filter((one) => one.sizes.length > 1 && !one.unresolved)) {
200
+ checks.push({ weight: "stop", says: `${band.sizes.map(count).join(" and ")} bp are too close in size to tell apart. They will look like one band.`, because: `${count(band.sizes[0] - band.sizes.at(-1))} bp apart, under 3% of ${count(band.sizes[0])}` });
201
+ }
202
+ const small = plan.fragments.filter((size) => size < gel.smallest);
203
+ if (small.length > 0)
204
+ checks.push({ weight: "stop", says: `${small.map(count).join(", ")} bp ${small.length === 1 ? "is" : "are"} smaller than ${gel.percent}% agarose separates. ${small.length === 1 ? "It" : "They"} may run off the gel or be too faint to see. A higher percentage would hold ${small.length === 1 ? "it" : "them"}.`, because: `${count(Math.max(...small))} < ${count(gel.smallest)} bp` });
205
+ const large = plan.fragments.filter((size) => size > gel.largest);
206
+ if (large.length > 0)
207
+ checks.push({ weight: "look", says: `${large.map(count).join(", ")} bp ${large.length === 1 ? "is" : "are"} larger than ${gel.percent}% agarose separates, and will stay near the wells. A lower percentage would spread ${large.length === 1 ? "it" : "them"}.`, because: `${count(Math.min(...large))} > ${count(gel.largest)} bp` });
208
+ if (part.circular && plan.fragments.length === 1) {
209
+ checks.push({ weight: "look", says: "One cut opens the circle into one piece of its full length. The gel shows that it cut and how long the plasmid is, and nothing about what is where on it. Two cuts say more.", because: "1 cut, 1 piece" });
210
+ }
211
+ if (plan.cutters.some((one) => one.name === "DpnI" && one.positions.length > 0)) {
212
+ checks.push({ weight: "look", says: "DpnI only cuts DNA that is methylated, as it is when grown in most lab strains of E. coli. It will not cut a PCR product.", because: "DpnI needs methylated GATC" });
213
+ }
214
+ return checks.sort((a, b) => Number(b.weight === "stop") - Number(a.weight === "stop"));
215
+ }
216
+ //# sourceMappingURL=digest-working.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-working.js","sourceRoot":"","sources":["../src/digest-working.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAgB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AACvE,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACjF,MAAM,IAAI,GAAqC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GA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,18 +8,42 @@
8
8
  * which run made it.
9
9
  *
10
10
  * - `pcr.ts` — what a PCR would make, worked out from sequences alone
11
+ * - `sequence-file.ts` — a sequence read from a SnapGene, GenBank, EMBL or FASTA file, and features carried onto a product
12
+ * - `pcr-scene.ts` — a PCR as met at the machine: the programme it shows, the checks, and what is in the tube
11
13
  * - `digest.ts` — where enzymes cut, the pieces, and the gel they would give
12
14
  * - `run.ts` — a PCR as a lab does one: which tubes, and what to record
13
15
  * - `pcr-tool.tsx`, `digest-tool.tsx` — the tools
16
+ * - `pcr-bench.tsx` — a PCR at the machine: what is beside the scene, and what the scene is told to show
17
+ * - `pcr-working.ts` — the working behind what the PCR tool says: each figure with the steps that give it
18
+ * - `ligate.ts` — pieces that have already been cut, joined where their ends fit
19
+ * - `ligate-working.ts` — a ligation's working: each join in its bases, the length, how much to put in
20
+ * - `ligate-bench.tsx` — a ligation at the heat block: what is shown beside it, and what the scene draws
21
+ * - `digest-working.ts` — a digest looked at closely: each cut in its bases, each piece with its ends, the working
22
+ * - `digest-bench.tsx` — a digest at the gel station: what is shown beside it, and what the scene is told to draw
23
+ * - `working.tsx` — the working drawn: a figure that opens to show its steps
24
+ * - `map.tsx` — a sequence's map: a circle or a line, with what is marked on it
25
+ * - `sequences-tool.tsx` — bringing sequences in from files, and reading a part as a map
14
26
  * - `tools.tsx` — getting to one: from an instrument, or from a list of them all
15
27
  *
16
28
  * The tools are drawn with the styles of `@biolibs/bionet-panels` and belong inside its `LabWindow`.
17
29
  * Import `@biolibs/bionet-tools/tools.css` once.
18
30
  */
19
31
  export * from "./pcr.js";
32
+ export * from "./sequence-file.js";
33
+ export * from "./pcr-scene.js";
20
34
  export * from "./digest.js";
21
35
  export * from "./run.js";
22
36
  export * from "./pcr-tool.js";
23
37
  export * from "./digest-tool.js";
38
+ export * from "./pcr-working.js";
39
+ export * from "./digest-working.js";
40
+ export * from "./ligate.js";
41
+ export * from "./ligate-working.js";
42
+ export * from "./ligate-bench.js";
43
+ export * from "./digest-bench.js";
44
+ export * from "./working.js";
45
+ export * from "./map.js";
46
+ export * from "./sequences-tool.js";
24
47
  export * from "./tools.js";
48
+ export * from "./pcr-bench.js";
25
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -8,18 +8,42 @@
8
8
  * which run made it.
9
9
  *
10
10
  * - `pcr.ts` — what a PCR would make, worked out from sequences alone
11
+ * - `sequence-file.ts` — a sequence read from a SnapGene, GenBank, EMBL or FASTA file, and features carried onto a product
12
+ * - `pcr-scene.ts` — a PCR as met at the machine: the programme it shows, the checks, and what is in the tube
11
13
  * - `digest.ts` — where enzymes cut, the pieces, and the gel they would give
12
14
  * - `run.ts` — a PCR as a lab does one: which tubes, and what to record
13
15
  * - `pcr-tool.tsx`, `digest-tool.tsx` — the tools
16
+ * - `pcr-bench.tsx` — a PCR at the machine: what is beside the scene, and what the scene is told to show
17
+ * - `pcr-working.ts` — the working behind what the PCR tool says: each figure with the steps that give it
18
+ * - `ligate.ts` — pieces that have already been cut, joined where their ends fit
19
+ * - `ligate-working.ts` — a ligation's working: each join in its bases, the length, how much to put in
20
+ * - `ligate-bench.tsx` — a ligation at the heat block: what is shown beside it, and what the scene draws
21
+ * - `digest-working.ts` — a digest looked at closely: each cut in its bases, each piece with its ends, the working
22
+ * - `digest-bench.tsx` — a digest at the gel station: what is shown beside it, and what the scene is told to draw
23
+ * - `working.tsx` — the working drawn: a figure that opens to show its steps
24
+ * - `map.tsx` — a sequence's map: a circle or a line, with what is marked on it
25
+ * - `sequences-tool.tsx` — bringing sequences in from files, and reading a part as a map
14
26
  * - `tools.tsx` — getting to one: from an instrument, or from a list of them all
15
27
  *
16
28
  * The tools are drawn with the styles of `@biolibs/bionet-panels` and belong inside its `LabWindow`.
17
29
  * Import `@biolibs/bionet-tools/tools.css` once.
18
30
  */
19
31
  export * from "./pcr.js";
32
+ export * from "./sequence-file.js";
33
+ export * from "./pcr-scene.js";
20
34
  export * from "./digest.js";
21
35
  export * from "./run.js";
22
36
  export * from "./pcr-tool.js";
23
37
  export * from "./digest-tool.js";
38
+ export * from "./pcr-working.js";
39
+ export * from "./digest-working.js";
40
+ export * from "./ligate.js";
41
+ export * from "./ligate-working.js";
42
+ export * from "./ligate-bench.js";
43
+ export * from "./digest-bench.js";
44
+ export * from "./working.js";
45
+ export * from "./map.js";
46
+ export * from "./sequences-tool.js";
24
47
  export * from "./tools.js";
48
+ export * from "./pcr-bench.js";
25
49
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * A ligation at the heat block: what is shown beside it, and what the scene is told to draw.
3
+ *
4
+ * A heat block shows one number, the temperature, and nothing else. Everything that matters is in
5
+ * the tube and invisible: which ends found each other, which way round a piece went in, and whether
6
+ * anything closed into a circle. So the machine's views are short and the pictured ones carry it.
7
+ */
8
+ import { type ReactNode } from "react";
9
+ import { type DrawnMolecule } from "./sequence-file.js";
10
+ /** The views of the heat block, by the names every instrument's stage uses. */
11
+ export type LigationView = "machine" | "block" | "screen" | "tube" | "result";
12
+ /** How each piece is coloured, in the theme's terms. The first is the one being cloned into. */
13
+ declare const TONES: readonly ["yours", "theirs", "held", "good", "found"];
14
+ /** What the scene is told to show. It is shaped to be spread onto `InstrumentStage`. */
15
+ export interface LigationStage {
16
+ model: "heat-block";
17
+ name: string;
18
+ view: LigationView;
19
+ onView: (view: LigationView) => void;
20
+ /** What the block's display says. */
21
+ screen: {
22
+ text: string;
23
+ lit?: boolean;
24
+ }[];
25
+ /** The well the tube is in. */
26
+ well?: {
27
+ row: number;
28
+ column: number;
29
+ };
30
+ /** The pieces being joined, for the view into the tube. */
31
+ joining?: {
32
+ pieces: {
33
+ name: string;
34
+ length: number;
35
+ flipped: boolean;
36
+ tone: (typeof TONES)[number];
37
+ }[];
38
+ joins: {
39
+ label: string;
40
+ }[];
41
+ circular: boolean;
42
+ joined: number;
43
+ };
44
+ /** What it makes, for the last view. */
45
+ molecule?: DrawnMolecule & {
46
+ marks: {
47
+ at: number;
48
+ label: string;
49
+ }[];
50
+ };
51
+ }
52
+ /**
53
+ * A ligation, at the heat block it is left in.
54
+ *
55
+ * @param options - `instrument` is the block it is set up at, if the lab has one; `onDone` adds a way to leave.
56
+ * @returns `stage`, to spread onto `InstrumentStage` from `@biolibs/bionet-scene`, and `panel`, to put inside it.
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * import { useLigationBench } from "@biolibs/bionet-tools";
61
+ *
62
+ * // `InstrumentStage` is the scene package's: it is handed what this gives and draws it.
63
+ * const bench = useLigationBench({ instrument });
64
+ * <InstrumentStage {...bench.stage}>{bench.panel}</InstrumentStage>
65
+ * ```
66
+ */
67
+ export declare function useLigationBench({ instrument, onDone }?: {
68
+ instrument?: {
69
+ id: string;
70
+ name: string;
71
+ } | null;
72
+ onDone?: () => void;
73
+ }): {
74
+ stage: LigationStage;
75
+ panel: ReactNode;
76
+ };
77
+ /**
78
+ * A ligation on its own, for a lab that has not drawn its room.
79
+ *
80
+ * It is the same thing without the scene, so it carries its own way of moving between the views.
81
+ *
82
+ * @param props - `instrument` is the block it is set up at, if the lab has one; `onDone` adds a way to leave.
83
+ */
84
+ export declare function LigationTool({ instrument, onDone }: {
85
+ instrument?: {
86
+ id: string;
87
+ name: string;
88
+ } | null;
89
+ onDone?: () => void;
90
+ }): import("react").JSX.Element;
91
+ export {};
92
+ //# sourceMappingURL=ligate-bench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ligate-bench.d.ts","sourceRoot":"","sources":["../src/ligate-bench.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ1D,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGpE,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9E,gGAAgG;AAChG,QAAA,MAAM,KAAK,uDAAwD,CAAC;AAEpE,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACrC,qCAAqC;IACrC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC1C,+BAA+B;IAC/B,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,2DAA2D;IAC3D,OAAO,CAAC,EAAE;QAAE,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,OAAO,CAAC;YAAC,IAAI,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;SAAE,EAAE,CAAC;QAAC,KAAK,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,MAAM,E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