@biolibs/bionet-tools 0.1.4 → 0.1.6

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 (48) hide show
  1. package/README.md +50 -0
  2. package/dist/digest-bench.d.ts +1 -1
  3. package/dist/digest-bench.d.ts.map +1 -1
  4. package/dist/digest-bench.js +16 -1
  5. package/dist/digest-bench.js.map +1 -1
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +6 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/ligate-bench.d.ts +1 -1
  11. package/dist/ligate-bench.d.ts.map +1 -1
  12. package/dist/ligate-bench.js +12 -1
  13. package/dist/ligate-bench.js.map +1 -1
  14. package/dist/pcr-bench.d.ts +1 -1
  15. package/dist/pcr-bench.d.ts.map +1 -1
  16. package/dist/pcr-bench.js +19 -0
  17. package/dist/pcr-bench.js.map +1 -1
  18. package/dist/primer-bench.d.ts +120 -0
  19. package/dist/primer-bench.d.ts.map +1 -0
  20. package/dist/primer-bench.js +285 -0
  21. package/dist/primer-bench.js.map +1 -0
  22. package/dist/primer-design.d.ts +273 -0
  23. package/dist/primer-design.d.ts.map +1 -0
  24. package/dist/primer-design.js +273 -0
  25. package/dist/primer-design.js.map +1 -0
  26. package/dist/primer-working.d.ts +154 -0
  27. package/dist/primer-working.d.ts.map +1 -0
  28. package/dist/primer-working.js +245 -0
  29. package/dist/primer-working.js.map +1 -0
  30. package/dist/tools.d.ts +8 -4
  31. package/dist/tools.d.ts.map +1 -1
  32. package/dist/tools.js +9 -4
  33. package/dist/tools.js.map +1 -1
  34. package/dist/working.d.ts +16 -0
  35. package/dist/working.d.ts.map +1 -1
  36. package/dist/working.js +21 -0
  37. package/dist/working.js.map +1 -1
  38. package/package.json +3 -2
  39. package/src/digest-bench.tsx +13 -2
  40. package/src/index.ts +6 -0
  41. package/src/ligate-bench.tsx +11 -2
  42. package/src/pcr-bench.tsx +14 -1
  43. package/src/primer-bench.tsx +500 -0
  44. package/src/primer-design.ts +406 -0
  45. package/src/primer-working.ts +289 -0
  46. package/src/tools.tsx +14 -6
  47. package/src/working.tsx +29 -0
  48. package/tools.css +49 -2
@@ -0,0 +1,154 @@
1
+ /**
2
+ * The working behind what the primer design tool says: each figure, with the steps that give it.
3
+ *
4
+ * A design is a handful of numbers — a melting temperature, a GC content, a length, a count of bases
5
+ * that pair — and a choice made on them. All of it is worked out in the window from the lab's own
6
+ * sequence, so all of it can be followed. The melting temperature here is the careful one, from
7
+ * nearest-neighbour thermodynamics, and its working is the real sum: every neighbouring pair of
8
+ * bases with what the table gives for it, the ends, the salt, and the one formula they go into.
9
+ *
10
+ * The sums are done again here, apart from the engine that chose the primers, and a working is only
11
+ * given if it reaches the engine's figure. A step that did not would be worse than no step.
12
+ */
13
+ import { type PrimerLimits } from "@biolibs/pcr";
14
+ import type { Working } from "./pcr-working.js";
15
+ import { type DesignedPrimer, type PairedStrands, type PrimerDesign, type ScoredCandidate } from "./primer-design.js";
16
+ /** The gas constant the nearest-neighbour formula uses, in cal/(mol·K). */
17
+ export declare const GAS_CONSTANT = 1.987;
18
+ /** One kind of neighbouring pair in a primer, and what the table gives for it. */
19
+ export interface NeighbourTerm {
20
+ /** The two bases, read 5′ to 3′, and the two they face. `GA/CT` is GA over CT. */
21
+ pair: string;
22
+ /** How many times it occurs in the primer. */
23
+ times: number;
24
+ /** For one of them: the heat given off on pairing, in kcal/mol, and the order lost, in cal/(mol·K). */
25
+ dH: number;
26
+ dS: number;
27
+ }
28
+ /** Every term of a nearest-neighbour melting temperature. */
29
+ export interface TmTerms {
30
+ /** Each kind of neighbouring pair, in the order first met. */
31
+ pairs: NeighbourTerm[];
32
+ /** How many of the primer's two end bases are A or T, and how many G or C, with what each adds. */
33
+ ends: {
34
+ at: number;
35
+ gc: number;
36
+ dH: number;
37
+ dS: number;
38
+ };
39
+ /** What the salt adds to the order lost: 0.368 × (bases − 1) × ln[Na⁺]. */
40
+ salt: number;
41
+ /** The sodium, in mol/L, and the primer, in mol/L, that the sum is for. */
42
+ sodium: number;
43
+ primer: number;
44
+ /** The sums: heat in kcal/mol, and order in cal/(mol·K) with the salt included. */
45
+ dH: number;
46
+ dS: number;
47
+ /** R × ln of the strand concentration: the last term under the line. */
48
+ strands: number;
49
+ /** What it comes to, in °C. */
50
+ tm: number;
51
+ }
52
+ /**
53
+ * A primer's melting temperature by nearest-neighbour thermodynamics, with every term kept.
54
+ *
55
+ * This is SantaLucia's 1998 table with his salt correction, which is what `@biolibs/pcr` uses
56
+ * through Biopython's `Tm_NN`. It is summed again here so that the terms can be shown.
57
+ *
58
+ * @param sequence - The primer, 5′ to 3′: A, C, G and T only.
59
+ * @param conditions - Sodium in mM and primer in nM. 50 and 250 unless said.
60
+ * @returns The terms and the temperature, or `null` if that is not a sequence the table covers.
61
+ */
62
+ export declare function nearestNeighbourTm(sequence: string, conditions?: {
63
+ sodium?: number;
64
+ primer?: number;
65
+ }): TmTerms | null;
66
+ /** A melting temperature's working, with its terms for a table. */
67
+ export interface TmWorking extends Working {
68
+ terms: TmTerms;
69
+ }
70
+ /**
71
+ * A primer's melting temperature, with the sum behind it.
72
+ *
73
+ * @param name - What the primer is called.
74
+ * @param sequence - Its bases.
75
+ * @returns The working, or `null` if the sum done here does not reach the engine's figure.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * import { primerTmWorking } from "@biolibs/bionet-tools";
80
+ *
81
+ * primerTmWorking("fwd", "GGATCACAGTCTACACTGCT")?.comes; // "55.6 °C"
82
+ * ```
83
+ */
84
+ export declare function primerTmWorking(name: string, sequence: string): TmWorking | null;
85
+ /**
86
+ * A primer's GC content, as the count over the length.
87
+ *
88
+ * @param name - What the primer is called.
89
+ * @param sequence - Its bases.
90
+ * @returns The working.
91
+ */
92
+ export declare function gcWorking(name: string, sequence: string): Working;
93
+ /**
94
+ * How long the product is, as the subtraction of its two ends.
95
+ *
96
+ * @param design - The design.
97
+ * @param template - How long the template is.
98
+ * @param made - How long the PCR engine's product is from these primers, to compare with.
99
+ * @returns The working.
100
+ */
101
+ export declare function productWorking(design: PrimerDesign, template: {
102
+ length: number;
103
+ }, made?: number): Working;
104
+ /** Bases that pair with each other, with the two strands laid out so that it can be drawn. */
105
+ export interface PairedWorking extends Working {
106
+ /** The strands as they pair. */
107
+ paired: PairedStrands;
108
+ /** How many pair in the longest run, and in the longest run that reaches a 3′ end. */
109
+ longest: number;
110
+ atEnd: number;
111
+ }
112
+ /**
113
+ * How much of a primer pairs with itself, with the bases written out.
114
+ *
115
+ * @param name - What the primer is called.
116
+ * @param sequence - Its bases.
117
+ * @param limits - How many in a row draw a warning.
118
+ * @returns The working, and the two copies laid out as they pair.
119
+ */
120
+ export declare function selfWorking(name: string, sequence: string, limits?: PrimerLimits): PairedWorking;
121
+ /**
122
+ * How much of the two primers pair with each other, with the bases written out.
123
+ *
124
+ * @param design - The design.
125
+ * @param names - What the two primers are called.
126
+ * @param limits - How many in a row draw a warning.
127
+ * @returns The working, and the two primers laid out as they pair.
128
+ */
129
+ export declare function crossWorking(design: PrimerDesign, names: {
130
+ forward: string;
131
+ reverse: string;
132
+ }, limits?: PrimerLimits): PairedWorking;
133
+ /**
134
+ * How far apart the two primers' melting temperatures are.
135
+ *
136
+ * @param design - The design.
137
+ * @param names - What the two primers are called.
138
+ * @returns The working.
139
+ */
140
+ export declare function tmApartWorking(design: PrimerDesign, names: {
141
+ forward: string;
142
+ reverse: string;
143
+ }): Working;
144
+ /**
145
+ * The score that ranked one candidate, term by term.
146
+ *
147
+ * @param end - Which primer it is a candidate for.
148
+ * @param candidate - The candidate.
149
+ * @param targetTm - The melting temperature aimed for.
150
+ * @param limits - The band GC content should be in.
151
+ * @returns The working.
152
+ */
153
+ export declare function scoreWorking(end: Pick<DesignedPrimer, "which">, candidate: ScoredCandidate, targetTm: number, limits?: PrimerLimits): Working;
154
+ //# sourceMappingURL=primer-working.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primer-working.d.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wBAAgB,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,YAA4B,GAAG,OAAO,CAa5J"}
@@ -0,0 +1,245 @@
1
+ /**
2
+ * The working behind what the primer design tool says: each figure, with the steps that give it.
3
+ *
4
+ * A design is a handful of numbers — a melting temperature, a GC content, a length, a count of bases
5
+ * that pair — and a choice made on them. All of it is worked out in the window from the lab's own
6
+ * sequence, so all of it can be followed. The melting temperature here is the careful one, from
7
+ * nearest-neighbour thermodynamics, and its working is the real sum: every neighbouring pair of
8
+ * bases with what the table gives for it, the ends, the salt, and the one formula they go into.
9
+ *
10
+ * The sums are done again here, apart from the engine that chose the primers, and a working is only
11
+ * given if it reaches the engine's figure. A step that did not would be worse than no step.
12
+ */
13
+ import { DEFAULT_CONDITIONS, PRIMER_LIMITS, primerTm as engineTm } from "@biolibs/pcr";
14
+ import { MeltingTempData } from "@biolibs/seqtools";
15
+ import { primerTm as wallaceTm } from "./pcr.js";
16
+ import { pairedStrands } from "./primer-design.js";
17
+ const count = (value) => value.toLocaleString("en-US");
18
+ const upper = (bases) => bases.replace(/\s+/g, "").toUpperCase();
19
+ const PAIR = { A: "T", T: "A", G: "C", C: "G" };
20
+ /** A number with its sign written as a true minus, as arithmetic is written. */
21
+ const signed = (value, places) => `${value < 0 ? "−" : ""}${Math.abs(value).toFixed(places)}`;
22
+ /** The gas constant the nearest-neighbour formula uses, in cal/(mol·K). */
23
+ export const GAS_CONSTANT = 1.987;
24
+ /**
25
+ * A primer's melting temperature by nearest-neighbour thermodynamics, with every term kept.
26
+ *
27
+ * This is SantaLucia's 1998 table with his salt correction, which is what `@biolibs/pcr` uses
28
+ * through Biopython's `Tm_NN`. It is summed again here so that the terms can be shown.
29
+ *
30
+ * @param sequence - The primer, 5′ to 3′: A, C, G and T only.
31
+ * @param conditions - Sodium in mM and primer in nM. 50 and 250 unless said.
32
+ * @returns The terms and the temperature, or `null` if that is not a sequence the table covers.
33
+ */
34
+ export function nearestNeighbourTm(sequence, conditions = {}) {
35
+ const bases = upper(sequence);
36
+ if (bases.length < 2 || !/^[ACGT]+$/.test(bases))
37
+ return null;
38
+ const table = MeltingTempData.dnaNn3;
39
+ const sodium = (conditions.sodium ?? DEFAULT_CONDITIONS.sodium) / 1000;
40
+ // Both strands are taken to be the primer's concentration, as the engine does: c − c/2.
41
+ const nanomolar = conditions.primer ?? DEFAULT_CONDITIONS.primer;
42
+ const primer = (nanomolar - nanomolar / 2) * 1e-9;
43
+ const pairs = [];
44
+ for (let at = 0; at < bases.length - 1; at++) {
45
+ const two = bases.slice(at, at + 2);
46
+ const pair = `${two}/${PAIR[two[0]]}${PAIR[two[1]]}`;
47
+ // The table lists each pair once; the same pair read from the other strand is written backwards.
48
+ const listed = table[pair] !== undefined ? pair : [...pair].reverse().join("");
49
+ const found = table[listed];
50
+ if (found === undefined)
51
+ return null;
52
+ const had = pairs.find((one) => one.pair === listed);
53
+ if (had === undefined)
54
+ pairs.push({ pair: listed, times: 1, dH: found[0], dS: found[1] });
55
+ else
56
+ had.times++;
57
+ }
58
+ const endBases = bases[0] + bases.at(-1);
59
+ const at = [...endBases].filter((base) => base === "A" || base === "T").length;
60
+ const gc = 2 - at;
61
+ const [endAT, endGC] = [table["init_A/T"], table["init_G/C"]];
62
+ const ends = { at, gc, dH: at * endAT[0] + gc * endGC[0], dS: at * endAT[1] + gc * endGC[1] };
63
+ const salt = 0.368 * (bases.length - 1) * Math.log(sodium);
64
+ const dH = pairs.reduce((sum, one) => sum + one.times * one.dH, 0) + ends.dH;
65
+ const dS = pairs.reduce((sum, one) => sum + one.times * one.dS, 0) + ends.dS + salt;
66
+ const strands = GAS_CONSTANT * Math.log(primer);
67
+ return { pairs, ends, salt, sodium, primer, dH, dS, strands, tm: (1000 * dH) / (dS + strands) - 273.15 };
68
+ }
69
+ /**
70
+ * A primer's melting temperature, with the sum behind it.
71
+ *
72
+ * @param name - What the primer is called.
73
+ * @param sequence - Its bases.
74
+ * @returns The working, or `null` if the sum done here does not reach the engine's figure.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { primerTmWorking } from "@biolibs/bionet-tools";
79
+ *
80
+ * primerTmWorking("fwd", "GGATCACAGTCTACACTGCT")?.comes; // "55.6 °C"
81
+ * ```
82
+ */
83
+ export function primerTmWorking(name, sequence) {
84
+ const bases = upper(sequence);
85
+ const terms = nearestNeighbourTm(bases);
86
+ if (terms === null)
87
+ return null;
88
+ let engine;
89
+ try {
90
+ engine = engineTm(bases);
91
+ }
92
+ catch {
93
+ return null;
94
+ }
95
+ if (Math.abs(engine - terms.tm) > 0.005)
96
+ return null;
97
+ const pairsH = terms.pairs.reduce((sum, one) => sum + one.times * one.dH, 0);
98
+ const pairsS = terms.pairs.reduce((sum, one) => sum + one.times * one.dS, 0);
99
+ const wallace = wallaceTm(bases);
100
+ const endWords = [terms.ends.at > 0 ? `${terms.ends.at} A or T` : "", terms.ends.gc > 0 ? `${terms.ends.gc} G or C` : ""].filter(Boolean).join(" and ");
101
+ return {
102
+ of: `${name}'s melting temperature`, comes: `${terms.tm.toFixed(1)} °C`, kind: "estimate", terms,
103
+ steps: [
104
+ `Its ${count(bases.length)} bases make ${count(bases.length - 1)} neighbouring pairs. Each kind gives off a known heat on pairing (ΔH) and loses a known amount of order (ΔS). Added up, as in the table below: ΔH = ${signed(pairsH, 1)} kcal/mol and ΔS = ${signed(pairsS, 1)} cal/(mol·K).`,
105
+ `Its two end bases are ${endWords}, which add ${signed(terms.ends.dH, 1)} and ${signed(terms.ends.dS, 1)}: ΔH = ${signed(terms.dH, 1)}, ΔS = ${signed(pairsS + terms.ends.dS, 1)}.`,
106
+ `Salt steadies the pairing. With ${terms.sodium * 1000} mM sodium, 0.368 × ${bases.length - 1} × ln(${terms.sodium}) = ${signed(terms.salt, 2)} is added to ΔS, making ${signed(terms.dS, 2)}.`,
107
+ `Half the primer is paired at the melting temperature. With ${(terms.primer * 1e9).toFixed(0)} nM of strands free to pair, ${GAS_CONSTANT} × ln(${(terms.primer * 1e9).toFixed(0)} × 10⁻⁹) = ${signed(terms.strands, 2)}.`,
108
+ `1,000 × ${signed(terms.dH, 1)} ÷ (${signed(terms.dS, 2)} + ${signed(terms.strands, 2)}) − 273.15 = ${terms.tm.toFixed(1)} °C.`,
109
+ ],
110
+ rests: "Nearest-neighbour thermodynamics, with SantaLucia's 1998 table and salt correction, at 50 mM sodium and 250 nM primer. It is the careful estimate, good to a degree or two; magnesium and the polymerase's own buffer move it."
111
+ + (wallace === null ? "" : ` The quick rule the PCR tool writes beside a tube, 2 °C for each A or T and 4 °C for each G or C, gives ${Math.round(wallace)} °C for this primer. The two are different rules and are not expected to agree.`),
112
+ };
113
+ }
114
+ /**
115
+ * A primer's GC content, as the count over the length.
116
+ *
117
+ * @param name - What the primer is called.
118
+ * @param sequence - Its bases.
119
+ * @returns The working.
120
+ */
121
+ export function gcWorking(name, sequence) {
122
+ const bases = upper(sequence);
123
+ const g = [...bases].filter((base) => base === "G").length;
124
+ const c = [...bases].filter((base) => base === "C").length;
125
+ const fraction = bases.length === 0 ? 0 : (g + c) / bases.length;
126
+ return {
127
+ of: `${name}'s GC content`, comes: `${(fraction * 100).toFixed(0)}%`, kind: "exact",
128
+ steps: [
129
+ `Of its ${count(bases.length)} bases, ${g} are G and ${c} are C: ${g} + ${c} = ${g + c}.`,
130
+ `${g + c} ÷ ${bases.length} = ${fraction.toFixed(3)}, which is ${(fraction * 100).toFixed(0)}%.`,
131
+ ],
132
+ };
133
+ }
134
+ /**
135
+ * How long the product is, as the subtraction of its two ends.
136
+ *
137
+ * @param design - The design.
138
+ * @param template - How long the template is.
139
+ * @param made - How long the PCR engine's product is from these primers, to compare with.
140
+ * @returns The working.
141
+ */
142
+ export function productWorking(design, template, made) {
143
+ const { start, end } = design.stretch;
144
+ const steps = [
145
+ design.wraps
146
+ ? `The template is a circle and the stretch runs through its origin: from base ${count(start + 1)} to the end is ${count(template.length)} − ${count(start)} = ${count(template.length - start)}, and from the start to base ${count(end)} is ${count(end)}, so ${count(template.length - start)} + ${count(end)} = ${count(design.length)}.`
147
+ : `The forward primer's first base is base ${count(start + 1)} and the reverse primer's first base pairs with base ${count(end)}: ${count(end)} − ${count(start + 1)} + 1 = ${count(design.length)}.`,
148
+ "Both primers lie inside the stretch and neither carries a tail, so nothing is added at either end.",
149
+ ...(made === undefined ? [] : [made === design.length ? `The PCR engine, given this template and these two primers and working it out its own way, also makes ${count(made)} bp.` : `The PCR engine, given this template and these two primers, makes ${count(made)} bp, which does not agree. Trust neither until that is understood.`]),
150
+ ];
151
+ return { of: "the product's length", comes: `${count(design.length)} bp`, kind: "exact", steps };
152
+ }
153
+ /** The bases of a run on each strand, as written: the upper 5′ to 3′ and the lower 3′ to 5′. */
154
+ function runBases(paired, shift, from, length) {
155
+ return [paired.upper.slice(from, from + length), paired.lower.slice(from - shift, from - shift + length)];
156
+ }
157
+ /**
158
+ * How much of a primer pairs with itself, with the bases written out.
159
+ *
160
+ * @param name - What the primer is called.
161
+ * @param sequence - Its bases.
162
+ * @param limits - How many in a row draw a warning.
163
+ * @returns The working, and the two copies laid out as they pair.
164
+ */
165
+ export function selfWorking(name, sequence, limits = PRIMER_LIMITS) {
166
+ const paired = pairedStrands(sequence, sequence);
167
+ const [over, under] = runBases(paired, paired.shift, paired.from, paired.length);
168
+ const [endOver, endUnder] = runBases(paired, paired.endShift, paired.endFrom, paired.endLength);
169
+ return {
170
+ of: `how much of ${name} pairs with itself`, comes: `${paired.length} in a row, ${paired.endLength} at its 3′ end`, kind: "exact", paired,
171
+ longest: paired.length, atEnd: paired.endLength,
172
+ steps: [
173
+ "Write the primer 5′ to 3′, and under it a second copy running the other way. Slide one along the other, and at each place count the bases that pair in a row: A with T, G with C.",
174
+ paired.length === 0 ? "Nowhere do any pair." : `The longest run is ${paired.length}: ${over} over ${under}. ${paired.length > limits.maxSelfComplement ? `More than ${limits.maxSelfComplement} is enough to hold two copies together, or to fold one back on itself.` : `Up to ${limits.maxSelfComplement} is not held to matter.`}`,
175
+ paired.endLength === 0 ? "No run takes in the 3′ end." : `The longest run that takes in the 3′ end is ${paired.endLength}: ${endOver} over ${endUnder}. ${paired.endLength > limits.maxEndSelfComplement ? `More than ${limits.maxEndSelfComplement} there gives the polymerase a paired end to extend, which uses the primer up.` : `Up to ${limits.maxEndSelfComplement} there is not held to matter.`}`,
176
+ ],
177
+ rests: "This counts bases that could pair. It is not a folding energy, so it says a hairpin or a dimer is possible, not that it will form.",
178
+ };
179
+ }
180
+ /**
181
+ * How much of the two primers pair with each other, with the bases written out.
182
+ *
183
+ * @param design - The design.
184
+ * @param names - What the two primers are called.
185
+ * @param limits - How many in a row draw a warning.
186
+ * @returns The working, and the two primers laid out as they pair.
187
+ */
188
+ export function crossWorking(design, names, limits = PRIMER_LIMITS) {
189
+ const paired = pairedStrands(design.forward.chosen.report.sequence, design.reverse.chosen.report.sequence);
190
+ const [over, under] = runBases(paired, paired.shift, paired.from, paired.length);
191
+ const [endOver, endUnder] = runBases(paired, paired.endShift, paired.endFrom, paired.endLength);
192
+ return {
193
+ of: "how much the two primers pair with each other", comes: `${paired.length} in a row, ${paired.endLength} at a 3′ end`, kind: "exact", paired,
194
+ longest: paired.length, atEnd: paired.endLength,
195
+ steps: [
196
+ `Write ${names.forward} 5′ to 3′ and ${names.reverse} under it running the other way. Slide one along the other, and at each place count the bases that pair in a row.`,
197
+ paired.length === 0 ? "Nowhere do any pair." : `The longest run is ${paired.length}: ${over} over ${under}. ${paired.length > limits.maxSelfComplement ? `More than ${limits.maxSelfComplement} ties some of each primer up.` : `Up to ${limits.maxSelfComplement} is not held to matter.`}`,
198
+ paired.endLength === 0 ? "No run takes in either 3′ end." : `The longest run that takes in a 3′ end is ${paired.endLength}: ${endOver} over ${endUnder}. ${paired.endLength > limits.maxEndSelfComplement ? `More than ${limits.maxEndSelfComplement} there can be extended into a primer dimer.` : `Up to ${limits.maxEndSelfComplement} there is not held to matter.`}`,
199
+ ],
200
+ rests: "This counts bases that could pair. It is not a folding energy, so it says a primer dimer is possible, not that it will form.",
201
+ };
202
+ }
203
+ /**
204
+ * How far apart the two primers' melting temperatures are.
205
+ *
206
+ * @param design - The design.
207
+ * @param names - What the two primers are called.
208
+ * @returns The working.
209
+ */
210
+ export function tmApartWorking(design, names) {
211
+ const [f, r] = [design.forward.chosen.report.tm, design.reverse.chosen.report.tm];
212
+ const [high, low] = f >= r ? [f, r] : [r, f];
213
+ return {
214
+ of: "how far apart the two melting temperatures are", comes: `${design.tmApart.toFixed(1)} °C`, kind: "estimate",
215
+ steps: [
216
+ `${names.forward} melts at ${f.toFixed(1)} °C and ${names.reverse} at ${r.toFixed(1)} °C.`,
217
+ `${high.toFixed(1)} − ${low.toFixed(1)} = ${design.tmApart.toFixed(1)} °C.`,
218
+ ],
219
+ rests: "Both primers have to bind at one annealing temperature. Within about 3 °C is comfortable and past 5 °C one of them binds poorly or the other binds where it should not. The figure is the difference of two estimates.",
220
+ };
221
+ }
222
+ /**
223
+ * The score that ranked one candidate, term by term.
224
+ *
225
+ * @param end - Which primer it is a candidate for.
226
+ * @param candidate - The candidate.
227
+ * @param targetTm - The melting temperature aimed for.
228
+ * @param limits - The band GC content should be in.
229
+ * @returns The working.
230
+ */
231
+ export function scoreWorking(end, candidate, targetTm, limits = PRIMER_LIMITS) {
232
+ const { report } = candidate;
233
+ const middle = (limits.minGc + limits.maxGc) / 2;
234
+ return {
235
+ of: `the score of the ${end.which} primer at ${report.length} bases`, comes: candidate.score.toFixed(2), kind: "estimate",
236
+ steps: [
237
+ `How far its melting temperature is from the ${targetTm} °C aimed for: |${report.tm.toFixed(2)} − ${targetTm}| = ${candidate.offTarget.toFixed(2)}.`,
238
+ report.gcClamp ? `Its 3′ end is ${report.sequence.at(-1)}, a G or C: nothing added.` : `Its 3′ end is ${report.sequence.at(-1)}, not a G or C: 2 added.`,
239
+ `How far its GC content is from the middle of ${(limits.minGc * 100).toFixed(0)} to ${(limits.maxGc * 100).toFixed(0)}%, doubled: 2 × |${report.gc.toFixed(3)} − ${middle.toFixed(1)}| = ${candidate.gc.toFixed(2)}.`,
240
+ `${candidate.offTarget.toFixed(2)} + ${candidate.clamp} + ${candidate.gc.toFixed(2)} = ${candidate.score.toFixed(2)}. The lowest score is chosen, and of two the same, the shorter.`,
241
+ ],
242
+ rests: "The score is a convention: melting temperature first, since a pair that does not anneal together does not work at all, then the 3′ end, then GC content. Another designer would weigh them differently, which is why every candidate is shown.",
243
+ };
244
+ }
245
+ //# sourceMappingURL=primer-working.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primer-working.js","sourceRoot":"","sources":["../src/primer-working.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,QAAQ,IAAI,QAAQ,EAAqB,MAAM,cAAc,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,aAAa,EAAoF,MAAM,oBAAoB,CAAC;AAErI,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;AAClF,gFAAgF;AAChF,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE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MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;YACrN,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,MAAM,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,iEAAiE;SACrL;QACD,KAAK,EAAE,gPAAgP;KACxP,CAAC;AACJ,CAAC"}
package/dist/tools.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /** Getting to a tool: from the instrument it is used at, or from a list of them all. */
2
2
  import { type ReactNode } from "react";
3
3
  import { type ToolName } from "./run.js";
4
+ /** The tools used at a desk and not at an instrument: the lab's sequences, and designing primers. */
5
+ export type DeskTool = "sequences" | "primers";
4
6
  /** What each tool is called. */
5
7
  export declare const TOOL_NAMES: Readonly<Record<ToolName, string>>;
6
8
  /**
@@ -17,11 +19,13 @@ export declare function InstrumentTool({ place, onDone }: {
17
19
  *
18
20
  * A run is still recorded as done at the instrument for that tool, if the lab has placed one.
19
21
  *
20
- * @param props - `tool` is which to open on, `sequences` being the lab's sequences and their maps; `views` lets a host show a tool its own way, such as
21
- * at its instrument in a scene, in place of the plain form.
22
+ * @param props - `tool` is which to open on, `sequences` being the lab's sequences and their maps and `primers` designing a pair; `views` lets a host show a tool its own way, such as
23
+ * at its instrument in a scene, in place of the plain form. A host that gives every tool the same kind of view keeps that
24
+ * view across a change of tool, which is what lets one scene carry on and its camera travel from one machine to the next.
25
+ * A view may be a function, which is handed a way to go to another tool: designing primers leads on to the PCR.
22
26
  */
23
27
  export declare function Tools({ tool: first, views }: {
24
- tool?: ToolName | "sequences";
25
- views?: Partial<Record<ToolName, ReactNode>>;
28
+ tool?: ToolName | DeskTool;
29
+ views?: Partial<Record<ToolName | DeskTool, ReactNode | ((go: (tool: ToolName | DeskTool) => void) => ReactNode)>>;
26
30
  }): import("react").JSX.Element | null;
27
31
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.tsx"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIjE,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAkE,CAAC;AAS7H;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,sCAiBvF;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,KAAa,EAAE,KAAU,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAA;CAAE,sCAezI"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.tsx"],"names":[],"mappings":"AAEA,wFAAwF;AACxF,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,EAA0B,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAKjE,qGAAqG;AACrG,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/C,gCAAgC;AAChC,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAkE,CAAC;AAS7H;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,sCAiBvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,KAAa,EAAE,KAAU,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,KAAK,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CAAA;CAAE,sCAiB5M"}
package/dist/tools.js CHANGED
@@ -7,6 +7,7 @@ import { DigestTool } from "./digest-tool.js";
7
7
  import { PcrTool } from "./pcr-tool.js";
8
8
  import { instrumentFor, toolFor } from "./run.js";
9
9
  import { LigationTool } from "./ligate-bench.js";
10
+ import { PrimerTool } from "./primer-bench.js";
10
11
  import { SequencesTool } from "./sequences-tool.js";
11
12
  /** What each tool is called. */
12
13
  export const TOOL_NAMES = { pcr: "PCR", digest: "Digest and gel", ligation: "Ligation" };
@@ -36,15 +37,19 @@ export function InstrumentTool({ place, onDone }) {
36
37
  *
37
38
  * A run is still recorded as done at the instrument for that tool, if the lab has placed one.
38
39
  *
39
- * @param props - `tool` is which to open on, `sequences` being the lab's sequences and their maps; `views` lets a host show a tool its own way, such as
40
- * at its instrument in a scene, in place of the plain form.
40
+ * @param props - `tool` is which to open on, `sequences` being the lab's sequences and their maps and `primers` designing a pair; `views` lets a host show a tool its own way, such as
41
+ * at its instrument in a scene, in place of the plain form. A host that gives every tool the same kind of view keeps that
42
+ * view across a change of tool, which is what lets one scene carry on and its camera travel from one machine to the next.
43
+ * A view may be a function, which is handed a way to go to another tool: designing primers leads on to the PCR.
41
44
  */
42
45
  export function Tools({ tool: first = "pcr", views = {} }) {
43
46
  const lab = useLab()?.lab;
44
47
  const [tool, setTool] = useState(first);
45
48
  if (lab === null || lab === undefined)
46
49
  return null;
47
- const names = [["sequences", "Sequences"], ...Object.keys(TOOL_NAMES).map((one) => [one, TOOL_NAMES[one]])];
48
- return (_jsxs("div", { className: "tools", children: [_jsx("div", { className: "row tight pick", role: "tablist", "aria-label": "Tools", children: names.map(([one, name]) => (_jsx("button", { type: "button", role: "tab", "aria-selected": one === tool, className: one === tool ? "" : "quiet", onClick: () => setTool(one), children: name }, one))) }), tool === "sequences" ? _jsx(SequencesTool, {}) : views[tool] ?? _jsx(Tool, { tool: tool, instrument: instrumentFor(lab, tool) }, tool)] }));
50
+ const shown = views[tool];
51
+ const names = [["sequences", "Sequences"], ["primers", "Primers"], ...Object.keys(TOOL_NAMES).map((one) => [one, TOOL_NAMES[one]])];
52
+ return (_jsxs("div", { className: "tools", children: [_jsx("div", { className: "row tight pick", role: "tablist", "aria-label": "Tools", children: names.map(([one, name]) => (_jsx("button", { type: "button", role: "tab", "aria-selected": one === tool, className: one === tool ? "" : "quiet", onClick: () => setTool(one), children: name }, one))) }), (typeof shown === "function" ? shown(setTool) : shown) ?? (tool === "sequences" ? _jsx(SequencesTool, {}) : tool === "primers" ? _jsx(PrimerTool, { onPcr: () => setTool("pcr") })
53
+ : _jsx(Tool, { tool: tool, instrument: instrumentFor(lab, tool) }, tool))] }));
49
54
  }
50
55
  //# sourceMappingURL=tools.js.map
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,wFAAwF;AACxF,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,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,IAArI,GAAG,CAA4I,CAC7J,CAAC,GACE,EACL,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI;gBACrK,CAAC,CAAC,KAAC,IAAI,IAAY,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,IAAtD,IAAI,CAAsD,CAAC,IACtE,CACP,CAAC;AACJ,CAAC"}
package/dist/working.d.ts CHANGED
@@ -9,6 +9,7 @@ import type { ReactNode } from "react";
9
9
  import type { CutSite } from "./digest-working.js";
10
10
  import type { JoinOverhangs } from "./ligate-working.js";
11
11
  import type { BindingWorking, Working } from "./pcr-working.js";
12
+ import type { PairedStrands } from "./primer-design.js";
12
13
  /**
13
14
  * One figure and its working.
14
15
  *
@@ -55,4 +56,19 @@ export declare function CutBases({ site }: {
55
56
  export declare function JoinBases({ bases }: {
56
57
  bases: JoinOverhangs;
57
58
  }): import("react").JSX.Element;
59
+ /**
60
+ * Two primers, or two copies of one, written one over the other as they would pair.
61
+ *
62
+ * The upper is written 5′ to 3′ and the lower 3′ to 5′, slid to where the run being shown pairs. A
63
+ * line joins every pair at that place, and the bases of the run itself are underlined.
64
+ *
65
+ * @param props - `paired` is from `pairedStrands`; `upper` and `lower` are what to call the two
66
+ * strands; `run` is which run to show: the longest anywhere, or the longest that reaches a 3′ end.
67
+ */
68
+ export declare function PairedBases({ paired, upper, lower, run }: {
69
+ paired: PairedStrands;
70
+ upper: string;
71
+ lower: string;
72
+ run?: "longest" | "end";
73
+ }): import("react").JSX.Element;
58
74
  //# sourceMappingURL=working.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"working.d.ts","sourceRoot":"","sources":["../src/working.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3E;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAY5F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,+BAUtF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,+BAYnD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,+BAW5D"}
1
+ {"version":3,"file":"working.d.ts","sourceRoot":"","sources":["../src/working.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAY5F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,+BAUtF;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,+BAYnD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAA;CAAE,+BAW5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAe,EAAE,EAAE;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;CAAE,+BAiBtJ"}
package/dist/working.js CHANGED
@@ -52,4 +52,25 @@ export function JoinBases({ bases }) {
52
52
  const row = (text) => [...text].map((base, at) => _jsx("span", { className: `base base-${base.toLowerCase()}`, children: base }, at));
53
53
  return (_jsxs("div", { className: "faced", role: "img", "aria-label": says, children: [_jsxs("div", { className: "row", children: [_jsx("span", { className: "end", children: bases.from }), row(bases.left), _jsx("span", { className: "end" })] }), _jsxs("div", { className: "row", children: [_jsx("span", { className: "end" }), [...bases.left].map((base, at) => _jsx("span", { className: "bond", children: "|" }, at)), _jsx("span", { className: "end" })] }), _jsxs("div", { className: "row", children: [_jsx("span", { className: "end", children: bases.to }), row(bases.right), _jsx("span", { className: "end" })] })] }));
54
54
  }
55
+ /**
56
+ * Two primers, or two copies of one, written one over the other as they would pair.
57
+ *
58
+ * The upper is written 5′ to 3′ and the lower 3′ to 5′, slid to where the run being shown pairs. A
59
+ * line joins every pair at that place, and the bases of the run itself are underlined.
60
+ *
61
+ * @param props - `paired` is from `pairedStrands`; `upper` and `lower` are what to call the two
62
+ * strands; `run` is which run to show: the longest anywhere, or the longest that reaches a 3′ end.
63
+ */
64
+ export function PairedBases({ paired, upper, lower, run = "longest" }) {
65
+ const [shift, from, length] = run === "end" ? [paired.endShift, paired.endFrom, paired.endLength] : [paired.shift, paired.from, paired.length];
66
+ const PAIR = { A: "T", T: "A", G: "C", C: "G" };
67
+ const [first, last] = [Math.min(0, shift), Math.max(paired.upper.length, shift + paired.lower.length)];
68
+ const columns = Array.from({ length: last - first }, (_, at) => first + at);
69
+ const over = (column) => paired.upper[column] ?? "";
70
+ const under = (column) => paired.lower[column - shift] ?? "";
71
+ const inRun = (column) => column >= from && column < from + length;
72
+ const says = `${upper}, 5′ to 3′, over ${lower}, 3′ to 5′: ${length} ${length === 1 ? "base pairs" : "bases in a row pair"}${length === 0 ? "" : `, ${paired.upper.slice(from, from + length)} with ${paired.lower.slice(from - shift, from - shift + length)}`}.`;
73
+ const cell = (base, marked) => _jsx("span", { className: `base base-${base.toLowerCase() || "none"}${marked ? " needed" : ""}`, children: base || " " });
74
+ return (_jsxs("div", { className: "faced paired", role: "img", "aria-label": says, children: [_jsxs("div", { className: "row", children: [_jsx("span", { className: "end", children: "5\u2032" }), columns.map((column) => _jsx("span", { children: cell(over(column), inRun(column)) }, column)), _jsxs("span", { className: "end", children: ["3\u2032 ", upper] })] }), _jsxs("div", { className: "row", children: [_jsx("span", { className: "end" }), columns.map((column) => { const pairs = over(column) !== "" && PAIR[over(column)] === under(column); return _jsx("span", { className: pairs ? "bond" : "bond none", children: pairs ? "|" : " " }, column); }), _jsx("span", { className: "end" })] }), _jsxs("div", { className: "row", children: [_jsx("span", { className: "end", children: "3\u2032" }), columns.map((column) => _jsx("span", { children: cell(under(column), inRun(column)) }, column)), _jsxs("span", { className: "end", children: ["5\u2032 ", lower] })] })] }));
75
+ }
55
76
  //# sourceMappingURL=working.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"working.js","sourceRoot":"","sources":["../src/working.tsx"],"names":[],"mappings":";AAYA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAA8C;IAC3F,OAAO,CACL,mBAAS,SAAS,EAAC,SAAS,aAC1B,8BACE,eAAM,SAAS,EAAC,IAAI,YAAE,OAAO,CAAC,EAAE,GAAQ,OAAC,2BAAS,OAAO,CAAC,KAAK,GAAU,EACzE,eAAM,SAAS,EAAE,QAAQ,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,gFAAgF,YAAG,OAAO,CAAC,IAAI,GAAQ,IACrN,EACV,uBAAK,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAAC,GAAM,EACjE,QAAQ,EACR,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,YAAG,SAAS,EAAC,OAAO,YAAE,OAAO,CAAC,KAAK,GAAK,IAChE,CACX,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAA6C;IACrF,MAAM,IAAI,GAAG,GAAG,IAAI,2BAA2B,OAAO,CAAC,MAAM,YAAY,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,cAAc,CAAC;IAClK,MAAM,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