@biolibs/bionet-tools 0.1.1 → 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 (78) hide show
  1. package/README.md +146 -4
  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-working.d.ts +155 -0
  7. package/dist/digest-working.d.ts.map +1 -0
  8. package/dist/digest-working.js +216 -0
  9. package/dist/digest-working.js.map +1 -0
  10. package/dist/index.d.ts +20 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +20 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/ligate-bench.d.ts +92 -0
  15. package/dist/ligate-bench.d.ts.map +1 -0
  16. package/dist/ligate-bench.js +139 -0
  17. package/dist/ligate-bench.js.map +1 -0
  18. package/dist/ligate-working.d.ts +96 -0
  19. package/dist/ligate-working.d.ts.map +1 -0
  20. package/dist/ligate-working.js +145 -0
  21. package/dist/ligate-working.js.map +1 -0
  22. package/dist/ligate.d.ts +152 -0
  23. package/dist/ligate.d.ts.map +1 -0
  24. package/dist/ligate.js +161 -0
  25. package/dist/ligate.js.map +1 -0
  26. package/dist/map.d.ts +69 -0
  27. package/dist/map.d.ts.map +1 -0
  28. package/dist/map.js +80 -0
  29. package/dist/map.js.map +1 -0
  30. package/dist/pcr-bench.d.ts +9 -0
  31. package/dist/pcr-bench.d.ts.map +1 -1
  32. package/dist/pcr-bench.js +26 -2
  33. package/dist/pcr-bench.js.map +1 -1
  34. package/dist/pcr-scene.d.ts +2 -0
  35. package/dist/pcr-scene.d.ts.map +1 -1
  36. package/dist/pcr-scene.js +8 -8
  37. package/dist/pcr-scene.js.map +1 -1
  38. package/dist/pcr-working.d.ts +126 -0
  39. package/dist/pcr-working.d.ts.map +1 -0
  40. package/dist/pcr-working.js +175 -0
  41. package/dist/pcr-working.js.map +1 -0
  42. package/dist/run.d.ts +101 -6
  43. package/dist/run.d.ts.map +1 -1
  44. package/dist/run.js +127 -11
  45. package/dist/run.js.map +1 -1
  46. package/dist/sequence-file.d.ts +108 -0
  47. package/dist/sequence-file.d.ts.map +1 -0
  48. package/dist/sequence-file.js +145 -0
  49. package/dist/sequence-file.js.map +1 -0
  50. package/dist/sequences-tool.d.ts +13 -0
  51. package/dist/sequences-tool.d.ts.map +1 -0
  52. package/dist/sequences-tool.js +61 -0
  53. package/dist/sequences-tool.js.map +1 -0
  54. package/dist/tools.d.ts +2 -2
  55. package/dist/tools.d.ts.map +1 -1
  56. package/dist/tools.js +9 -4
  57. package/dist/tools.js.map +1 -1
  58. package/dist/working.d.ts +58 -0
  59. package/dist/working.d.ts.map +1 -0
  60. package/dist/working.js +55 -0
  61. package/dist/working.js.map +1 -0
  62. package/package.json +5 -2
  63. package/src/digest-bench.tsx +307 -0
  64. package/src/digest-working.ts +288 -0
  65. package/src/index.ts +20 -0
  66. package/src/ligate-bench.tsx +293 -0
  67. package/src/ligate-working.ts +182 -0
  68. package/src/ligate.ts +243 -0
  69. package/src/map.tsx +170 -0
  70. package/src/pcr-bench.tsx +54 -1
  71. package/src/pcr-scene.ts +10 -8
  72. package/src/pcr-working.ts +228 -0
  73. package/src/run.ts +179 -14
  74. package/src/sequence-file.ts +172 -0
  75. package/src/sequences-tool.tsx +109 -0
  76. package/src/tools.tsx +13 -8
  77. package/src/working.tsx +96 -0
  78. package/tools.css +54 -0
package/dist/run.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { amountOf, whereWords } from "@biolibs/bionet-panels";
2
2
  import { planDigest } from "./digest.js";
3
+ import { cutSites, digestPieces } from "./digest-working.js";
4
+ import { planLigation } from "./ligate.js";
3
5
  import { ANNEAL_AT_LEAST, looksLikePrimer, planPcr } from "./pcr.js";
6
+ import { primerBinding } from "./pcr-scene.js";
7
+ import { carryFeatures } from "./sequence-file.js";
4
8
  /**
5
9
  * The tubes a PCR could be run from.
6
10
  *
@@ -23,6 +27,36 @@ export function pcrTubes(lab) {
23
27
  const long = all.filter((one) => !looksLikePrimer(one.part));
24
28
  return { templates: long.length > 0 ? [...long, ...short] : all, primers: short.length > 0 ? short : all };
25
29
  }
30
+ /**
31
+ * What is marked on a PCR's product.
32
+ *
33
+ * A feature of the template that lies on the stretch copied is carried over, moved to where it now
34
+ * is; one that is only partly copied is carried as the part that was, and named as a part. Each
35
+ * primer is marked at the end it became. If the template is a circle and the stretch copied runs
36
+ * through its origin, only the primers are marked.
37
+ *
38
+ * @param template - The template, with what is marked on it.
39
+ * @param forward - One primer, by name and bases.
40
+ * @param reverse - The other.
41
+ * @param least - How many bases at each primer's 3′ end must bind.
42
+ * @returns The features, placed on the product. Empty if either primer does not bind in one place.
43
+ */
44
+ export function pcrFeatures(template, forward, reverse, least = ANNEAL_AT_LEAST) {
45
+ const found = [forward, reverse].map((primer) => ({ primer, binding: primerBinding(template.sequence, primer.sequence, least) }));
46
+ const top = found.find((one) => one.binding?.reads === "top");
47
+ const bottom = found.find((one) => one.binding?.reads === "bottom");
48
+ if (top?.binding == null || bottom?.binding == null)
49
+ return [];
50
+ const [from, to] = [top.binding.start, bottom.binding.end];
51
+ const straight = to > from;
52
+ const copied = straight ? to - from : template.sequence.replace(/\s+/g, "").length - from + to;
53
+ const length = top.binding.tail + copied + bottom.binding.tail;
54
+ const primers = [
55
+ { type: "primer_bind", label: top.primer.name, strand: 1, parts: [{ start: 0, end: Math.min(length, top.primer.sequence.length) }] },
56
+ { type: "primer_bind", label: bottom.primer.name, strand: -1, parts: [{ start: Math.max(0, length - bottom.primer.sequence.length), end: length }] },
57
+ ];
58
+ return [...(straight ? carryFeatures(template.features, from, to, top.binding.tail) : []), ...primers];
59
+ }
26
60
  /**
27
61
  * Work a choice of tubes out into a run.
28
62
  *
@@ -47,7 +81,7 @@ export function pcrRun(lab, choice) {
47
81
  const [template, forward, reverse] = [partOf(choice.template), partOf(choice.forward), partOf(choice.reverse)];
48
82
  const typed = choice.name?.trim() ?? "";
49
83
  if (template === undefined || forward === undefined || reverse === undefined)
50
- return { plan: null, name: typed, worked: null, failed: null };
84
+ return { plan: null, name: typed, features: [], worked: null, failed: null };
51
85
  const least = choice.annealAtLeast ?? ANNEAL_AT_LEAST;
52
86
  const plan = planPcr(template, forward.sequence, reverse.sequence, { annealAtLeast: least });
53
87
  const name = typed !== "" ? typed : `${template.name} × ${forward.name} + ${reverse.name}`.slice(0, 200);
@@ -67,11 +101,14 @@ export function pcrRun(lab, choice) {
67
101
  note: choice.note ?? null,
68
102
  };
69
103
  const product = plan.problem === null ? plan.products[0] : null;
104
+ // Only marked if they land on the product the engine made: the two are worked out separately.
105
+ const marked = product === null ? [] : pcrFeatures(template, forward, reverse, least);
106
+ const features = marked.every((one) => one.parts.every((piece) => piece.end <= product.length)) ? marked : [];
70
107
  return {
71
- plan, name,
108
+ plan, name, features,
72
109
  worked: product === null ? null : {
73
110
  ...record, outcome: "worked",
74
- outputs: [{ sequence: product.sequence, circular: false, name, amount: whole(choice.amount, 50), unit: choice.unit === undefined ? "µL" : choice.unit }],
111
+ outputs: [{ sequence: product.sequence, circular: false, name, features, amount: whole(choice.amount, 50), unit: choice.unit === undefined ? "µL" : choice.unit }],
75
112
  },
76
113
  failed: { ...record, outcome: "failed", outputs: [] },
77
114
  };
@@ -89,9 +126,9 @@ export function digestTubes(lab) {
89
126
  /**
90
127
  * Work a choice of tube and enzymes out into a run.
91
128
  *
92
- * A digest here is a check: it uses some of a tube and makes nothing. What is recorded is which
93
- * enzymes, what pieces were expected, and whether the gel showed them. Keeping a piece as a tube is
94
- * not offered, because a part cannot yet say what ends it has, and a cut piece is defined by its ends.
129
+ * A digest is first a check: it uses some of a tube, and what is recorded is which enzymes, what
130
+ * pieces were expected, and whether the gel showed them. Pieces may also be kept. Each kept piece
131
+ * becomes a tube of a part with the ends the enzymes left, since a cut piece is defined by its ends.
95
132
  *
96
133
  * @param lab - The lab.
97
134
  * @param choice - The tube, the enzymes, and how much was used.
@@ -101,23 +138,102 @@ export function digestRun(lab, choice) {
101
138
  const item = lab.items.find((one) => one.item === choice.tube);
102
139
  const part = item === undefined ? undefined : lab.parts.find((one) => one.checksum === item.part);
103
140
  if (part === undefined)
104
- return { plan: null, matched: null, differed: null };
141
+ return { plan: null, pieces: [], matched: null, differed: null };
105
142
  const plan = planDigest(part, choice.enzymes, { ...(choice.gel === undefined ? {} : { gel: choice.gel }), ...(choice.ladder === undefined ? {} : { ladder: choice.ladder }) });
106
143
  if (plan.problem !== null)
107
- return { plan, matched: null, differed: null };
144
+ return { plan, pieces: [], matched: null, differed: null };
145
+ const pieces = digestPieces(part, plan.cutters.flatMap((one) => cutSites(part, one)));
146
+ const enzymesUsed = plan.cutters.filter((one) => one.positions.length > 0).map((one) => one.name).join("+");
147
+ const kept = (choice.keep ?? []).flatMap((wanted) => {
148
+ const piece = pieces.find((one) => one.from === wanted.from);
149
+ if (piece === undefined)
150
+ return [];
151
+ const amount = wanted.amount === undefined || !Number.isSafeInteger(wanted.amount) || wanted.amount < 0 ? 20 : wanted.amount;
152
+ const typed = wanted.name?.trim() ?? "";
153
+ return [{ sequence: piece.sequence, circular: false, ends: piece.ends, features: piece.features, amount, unit: wanted.unit === undefined ? "µL" : wanted.unit,
154
+ name: (typed !== "" ? typed : `${part.name} ${enzymesUsed} ${piece.length} bp`).slice(0, 200) }];
155
+ });
108
156
  const used = choice.used === undefined || !Number.isSafeInteger(choice.used) || choice.used < 0 ? 1 : choice.used;
109
157
  const record = {
110
158
  kind: "digest", instrument: choice.instrument ?? null,
111
159
  inputs: [{ item: choice.tube, amount: used, role: "cut" }],
112
160
  outputs: [],
113
161
  // Settings are short text, so a digest into very many pieces records as many as fit.
114
- settings: { enzymes: plan.cutters.map((one) => one.name).join("+").slice(0, 200), expected: plan.fragments.join(",").slice(0, 200), gel: plan.gel },
162
+ settings: { enzymes: plan.cutters.map((one) => one.name).join("+").slice(0, 200), expected: plan.fragments.join(",").slice(0, 200), gel: plan.gel,
163
+ ...(Number.isSafeInteger(choice.volts) ? { volts: choice.volts } : {}), ...(Number.isSafeInteger(choice.minutes) ? { minutes: choice.minutes } : {}) },
164
+ note: choice.note ?? null,
165
+ };
166
+ // Pieces can only be kept from a gel that showed them.
167
+ return { plan, pieces, matched: { ...record, outputs: kept, outcome: "worked", ...(kept.length === 0 ? {} : { settings: { ...record.settings, kept: kept.length } }) },
168
+ differed: { ...record, outcome: "failed" } };
169
+ }
170
+ /**
171
+ * The tubes a ligation could be set up from: every tube of a linear molecule with something in it.
172
+ *
173
+ * A circle has no ends to join, so it is left out until somebody cuts it.
174
+ *
175
+ * @param lab - The lab.
176
+ * @returns The tubes to offer, the ones with sticky ends first, since those are the ones that were cut.
177
+ */
178
+ export function ligationTubes(lab) {
179
+ return pcrTubes(lab).templates.filter((one) => !one.part.circular)
180
+ .sort((a, b) => Number(sticky(b.part)) - Number(sticky(a.part)) || b.part.length - a.part.length);
181
+ }
182
+ /** Whether a part has an end with unpaired bases. */
183
+ const sticky = (part) => (part.ends?.left ?? 0) !== 0 || (part.ends?.right ?? 0) !== 0;
184
+ /**
185
+ * Work a choice of tubes out into a ligation.
186
+ *
187
+ * What comes out is one molecule, and it is a part like any other: a circle if the pieces closed,
188
+ * and otherwise a line with the outer ends the pieces brought. It carries what the pieces carried.
189
+ *
190
+ * @param lab - The lab.
191
+ * @param choice - The tubes, how much of each, and what to call what comes out.
192
+ * @returns What it would make, and what to record either way.
193
+ */
194
+ export function ligationRun(lab, choice) {
195
+ const pieces = [];
196
+ for (const item of choice.tubes) {
197
+ const held = lab.items.find((one) => one.item === item);
198
+ const part = held === undefined ? undefined : lab.parts.find((one) => one.checksum === held.part);
199
+ if (part === undefined || part.circular)
200
+ return { plan: null, pieces: [], product: null, name: "", worked: null, failed: null };
201
+ pieces.push({ id: item, name: part.name, sequence: part.sequence, ends: part.ends ?? { left: 0, right: 0 }, features: part.features });
202
+ }
203
+ const plan = planLigation(pieces, { blunt: choice.blunt === true, linear: choice.linear === true });
204
+ const product = plan.products[Math.max(0, Math.min(choice.chosen ?? 0, plan.products.length - 1))] ?? null;
205
+ const typed = choice.name?.trim() ?? "";
206
+ const name = (typed !== "" ? typed : pieces.map((piece) => piece.name).join(" + ")).slice(0, 200);
207
+ const whole = (value, usual) => (value === undefined || !Number.isSafeInteger(value) || value < 0 ? usual : value);
208
+ const record = {
209
+ kind: "ligation", instrument: choice.instrument ?? null,
210
+ inputs: pieces.map((piece) => ({ item: piece.id, amount: whole(choice.used?.[piece.id], 1), role: "piece" })),
211
+ settings: { pieces: pieces.length, ...(product === null ? {} : { joins: product.joins.length, made: product.circular ? "circle" : "line" }),
212
+ ...(choice.blunt === true ? { blunt: "allowed" } : {}) },
115
213
  note: choice.note ?? null,
116
214
  };
117
- return { plan, matched: { ...record, outcome: "worked" }, differed: { ...record, outcome: "failed" } };
215
+ if (product === null)
216
+ return { plan, pieces, product, name, worked: null, failed: { ...record, outcome: "failed", outputs: [] } };
217
+ // A circle has no ends. A line keeps the outer ends of the pieces at each of its own ends.
218
+ const first = product.pieces[0];
219
+ const last = product.pieces.at(-1);
220
+ const endsOf = (placed, which) => {
221
+ const piece = pieces.find((one) => one.id === placed.id);
222
+ const own = placed.flipped ? { left: -piece.ends.right, right: -piece.ends.left } : piece.ends;
223
+ return own[which];
224
+ };
225
+ const ends = product.circular ? undefined : { left: endsOf(first, "left"), right: endsOf(last, "right") };
226
+ return {
227
+ plan, pieces, product, name,
228
+ worked: { ...record, outcome: "worked",
229
+ outputs: [{ sequence: product.sequence, circular: product.circular, name, features: product.features,
230
+ amount: whole(choice.amount, 20), unit: choice.unit === undefined ? "µL" : choice.unit,
231
+ ...(ends === undefined || (ends.left === 0 && ends.right === 0) ? {} : { ends }) }] },
232
+ failed: { ...record, outcome: "failed", outputs: [] },
233
+ };
118
234
  }
119
235
  /** The model of instrument each tool is used at. */
120
- export const TOOL_AT = { pcr: "thermocycler", digest: "gel-station" };
236
+ export const TOOL_AT = { pcr: "thermocycler", digest: "gel-station", ligation: "heat-block" };
121
237
  /**
122
238
  * Which tool an instrument opens.
123
239
  *
package/dist/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAmB,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAgB,MAAM,UAAU,CAAC;AAoBnF;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;YAAE,SAAS;QACrE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACnH,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,C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E,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC;AAC9G,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,GAA4B,EAAE,IAAc;IACxE,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;IACpF,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AAC5E,CAAC"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Bringing a sequence in from the file a lab already has.
3
+ *
4
+ * Most labs keep their sequences as SnapGene or GenBank files, with the genes, promoters and origins
5
+ * already marked. This reads one into what a lab's freezer keeps of a part: a name, the bases,
6
+ * whether it is a circle, and what is marked on it. SnapGene's own format, GenBank, EMBL and FASTA
7
+ * are read, by `@biolibs/seqio`.
8
+ */
9
+ import type { PartFeature } from "@biolibs/bionet";
10
+ /** A sequence read from a file. */
11
+ export interface SequenceFile {
12
+ /** The file it came from. */
13
+ fileName: string;
14
+ /** What kind of file it was read as: `snapgene`, `genbank`, `embl` or `fasta`. */
15
+ format: string;
16
+ /** What the file calls the sequence. */
17
+ name: string;
18
+ /** What the file says about it. */
19
+ description: string;
20
+ /** The bases, in capitals. */
21
+ sequence: string;
22
+ /** Whether it is a circle. */
23
+ circular: boolean;
24
+ /** What is marked on it. */
25
+ features: PartFeature[];
26
+ }
27
+ /**
28
+ * What kind of sequence file something is, from its name or failing that from how it begins.
29
+ *
30
+ * @param name - The file's name.
31
+ * @param bytes - What is in it.
32
+ * @returns The format's name, or `null` if it is none this reads.
33
+ */
34
+ export declare function sequenceFormat(name: string, bytes: Uint8Array): string | null;
35
+ /**
36
+ * Read the first sequence in a file.
37
+ *
38
+ * @param name - The file's name.
39
+ * @param bytes - What is in it.
40
+ * @returns The sequence and what is marked on it.
41
+ * @throws If it is not a kind of file this reads, or holds no sequence.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * import { readSequenceFile } from "@biolibs/bionet-tools";
46
+ *
47
+ * const read = readSequenceFile("pUC19.fa", new TextEncoder().encode(">pUC19\nGGATCACAGTCTACACTG\n"));
48
+ * read.name; // "pUC19"
49
+ * read.sequence; // "GGATCACAGTCTACACTG"
50
+ * ```
51
+ */
52
+ export declare function readSequenceFile(name: string, bytes: Uint8Array): SequenceFile;
53
+ /**
54
+ * What is marked on a stretch of a sequence, as it would be marked on that stretch alone.
55
+ *
56
+ * A PCR's product is a stretch of its template, so whatever was marked there is marked on the
57
+ * product, moved to where it now is. Something only partly inside is kept as far as it is inside,
58
+ * and its name says so, since half a gene is not the gene.
59
+ *
60
+ * @param features - What is marked on the whole sequence.
61
+ * @param from - Where the stretch starts.
62
+ * @param to - Where it stops.
63
+ * @param shift - How many bases the stretch is preceded by where it is going, such as a primer's tail.
64
+ * @returns What is marked on the stretch.
65
+ */
66
+ export declare function carryFeatures(features: readonly PartFeature[], from: number, to: number, shift?: number): PartFeature[];
67
+ /**
68
+ * What a kind of feature's colour means, in the theme's terms.
69
+ *
70
+ * @param type - The feature's type, as sequence files say it.
71
+ * @returns One of the theme's meanings.
72
+ */
73
+ export declare function featureTone(type: string): "yours" | "theirs" | "held" | "found" | "good" | "attention" | "dim";
74
+ /** A molecule as a scene draws one. It is the shape `@biolibs/bionet-scene` takes, so it can be handed straight over. */
75
+ export interface DrawnMolecule {
76
+ name: string;
77
+ length: number;
78
+ circular: boolean;
79
+ /** Each piece of each feature, with the theme's meaning for its colour. */
80
+ features: {
81
+ start: number;
82
+ end: number;
83
+ strand: -1 | 0 | 1;
84
+ tone: ReturnType<typeof featureTone>;
85
+ label: string;
86
+ }[];
87
+ }
88
+ /**
89
+ * A part as a molecule to draw in a scene.
90
+ *
91
+ * @param part - Its name, length, shape and what is marked on it.
92
+ * @returns The molecule, with each feature's pieces as stretches and its colour as a meaning.
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * import { moleculeOf } from "@biolibs/bionet-tools";
97
+ *
98
+ * const drawn = moleculeOf({ name: "pUC19", length: 2686, circular: true, features: [{ type: "CDS", label: "bla", strand: -1, parts: [{ start: 1626, end: 2487 }] }] });
99
+ * drawn.features[0].tone; // "yours"
100
+ * ```
101
+ */
102
+ export declare function moleculeOf(part: {
103
+ name: string;
104
+ length: number;
105
+ circular: boolean;
106
+ features: readonly PartFeature[];
107
+ }): DrawnMolecule;
108
+ //# sourceMappingURL=sequence-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence-file.d.ts","sourceRoot":"","sources":["../src/sequence-file.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,4BAA4B;IAC5B,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAID;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAU7E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,CA+B9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,WAAW,EAAE,CAUlH;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,CAU9G;AAED,yHAAyH;AACzH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACrH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAA;CAAE,GAAG,aAAa,CAKrI"}
@@ -0,0 +1,145 @@
1
+ import { parse } from "@biolibs/seqio";
2
+ const TEXT_FORMATS = { gb: "genbank", gbk: "genbank", gbff: "genbank", genbank: "genbank", embl: "embl", fa: "fasta", fasta: "fasta", fna: "fasta" };
3
+ /**
4
+ * What kind of sequence file something is, from its name or failing that from how it begins.
5
+ *
6
+ * @param name - The file's name.
7
+ * @param bytes - What is in it.
8
+ * @returns The format's name, or `null` if it is none this reads.
9
+ */
10
+ export function sequenceFormat(name, bytes) {
11
+ const extension = name.split(".").pop()?.toLowerCase() ?? "";
12
+ if (extension === "dna")
13
+ return "snapgene";
14
+ if (Object.hasOwn(TEXT_FORMATS, extension))
15
+ return TEXT_FORMATS[extension];
16
+ if (bytes[0] === 0x09)
17
+ return "snapgene"; // every SnapGene file opens with a packet of type 9
18
+ const start = new TextDecoder().decode(bytes.slice(0, 16));
19
+ if (start.startsWith("LOCUS"))
20
+ return "genbank";
21
+ if (start.startsWith(">"))
22
+ return "fasta";
23
+ if (start.startsWith("ID "))
24
+ return "embl";
25
+ return null;
26
+ }
27
+ /**
28
+ * Read the first sequence in a file.
29
+ *
30
+ * @param name - The file's name.
31
+ * @param bytes - What is in it.
32
+ * @returns The sequence and what is marked on it.
33
+ * @throws If it is not a kind of file this reads, or holds no sequence.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * import { readSequenceFile } from "@biolibs/bionet-tools";
38
+ *
39
+ * const read = readSequenceFile("pUC19.fa", new TextEncoder().encode(">pUC19\nGGATCACAGTCTACACTG\n"));
40
+ * read.name; // "pUC19"
41
+ * read.sequence; // "GGATCACAGTCTACACTG"
42
+ * ```
43
+ */
44
+ export function readSequenceFile(name, bytes) {
45
+ const format = sequenceFormat(name, bytes);
46
+ if (format === null)
47
+ throw new Error("Could not tell what kind of file that is. SnapGene (.dna), GenBank (.gb), EMBL and FASTA are read.");
48
+ let record;
49
+ try {
50
+ // Binary formats take bytes and text formats take a string.
51
+ record = parse(format === "snapgene" ? bytes : new TextDecoder().decode(bytes), format)[Symbol.iterator]().next().value;
52
+ }
53
+ catch (cause) {
54
+ throw new Error(`That ${format} file could not be read: ${cause instanceof Error ? cause.message : String(cause)}`);
55
+ }
56
+ if (record === undefined || record === null || !record.seq)
57
+ throw new Error("That file holds no sequence.");
58
+ const sequence = String(record.seq).toUpperCase();
59
+ const whole = (position) => Number(position.position ?? position);
60
+ const first = (values) => (Array.isArray(values) && values.length > 0 ? String(values[0]) : undefined);
61
+ const features = [];
62
+ for (const feature of record.features) {
63
+ if (!feature.location || feature.type === "source")
64
+ continue;
65
+ const said = (key) => first(feature.qualifiers.get(key));
66
+ const parts = feature.location.parts.map((part) => ({ start: whole(part.start), end: whole(part.end) }))
67
+ .filter((part) => Number.isSafeInteger(part.start) && Number.isSafeInteger(part.end) && part.start >= 0 && part.end > part.start && part.end <= sequence.length);
68
+ if (parts.length === 0)
69
+ continue;
70
+ const strand = feature.location.strand === 1 ? 1 : feature.location.strand === -1 ? -1 : 0;
71
+ features.push({ type: String(feature.type).slice(0, 40), label: (said("label") ?? said("gene") ?? said("product") ?? said("note") ?? String(feature.type)).slice(0, 200), strand, parts });
72
+ }
73
+ const stem = name.replace(/\.[^.]+$/, "");
74
+ const called = record.name && record.name !== "<unknown name>" ? record.name : record.id && record.id !== "<unknown id>" ? record.id : stem;
75
+ return {
76
+ fileName: name, format, name: String(called || stem).slice(0, 200),
77
+ description: record.description === "<unknown description>" ? "" : String(record.description ?? ""),
78
+ sequence, circular: record.annotations.get("topology") === "circular", features,
79
+ };
80
+ }
81
+ /**
82
+ * What is marked on a stretch of a sequence, as it would be marked on that stretch alone.
83
+ *
84
+ * A PCR's product is a stretch of its template, so whatever was marked there is marked on the
85
+ * product, moved to where it now is. Something only partly inside is kept as far as it is inside,
86
+ * and its name says so, since half a gene is not the gene.
87
+ *
88
+ * @param features - What is marked on the whole sequence.
89
+ * @param from - Where the stretch starts.
90
+ * @param to - Where it stops.
91
+ * @param shift - How many bases the stretch is preceded by where it is going, such as a primer's tail.
92
+ * @returns What is marked on the stretch.
93
+ */
94
+ export function carryFeatures(features, from, to, shift = 0) {
95
+ const carried = [];
96
+ for (const feature of features) {
97
+ const inside = feature.parts.map((part) => ({ start: Math.max(part.start, from), end: Math.min(part.end, to) })).filter((part) => part.end > part.start);
98
+ if (inside.length === 0)
99
+ continue;
100
+ const whole = inside.length === feature.parts.length && inside.every((part, at) => part.start === feature.parts[at].start && part.end === feature.parts[at].end);
101
+ carried.push({ type: feature.type, strand: feature.strand, label: whole ? feature.label : `${feature.label} (part)`.slice(0, 200),
102
+ parts: inside.map((part) => ({ start: part.start - from + shift, end: part.end - from + shift })) });
103
+ }
104
+ return carried;
105
+ }
106
+ /**
107
+ * What a kind of feature's colour means, in the theme's terms.
108
+ *
109
+ * @param type - The feature's type, as sequence files say it.
110
+ * @returns One of the theme's meanings.
111
+ */
112
+ export function featureTone(type) {
113
+ switch (type) {
114
+ case "CDS":
115
+ case "gene": return "yours";
116
+ case "promoter": return "held";
117
+ case "terminator": return "attention";
118
+ case "rep_origin": return "theirs";
119
+ case "primer_bind": return "found";
120
+ case "misc_feature":
121
+ case "regulatory": return "good";
122
+ default: return "dim";
123
+ }
124
+ }
125
+ /**
126
+ * A part as a molecule to draw in a scene.
127
+ *
128
+ * @param part - Its name, length, shape and what is marked on it.
129
+ * @returns The molecule, with each feature's pieces as stretches and its colour as a meaning.
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * import { moleculeOf } from "@biolibs/bionet-tools";
134
+ *
135
+ * const drawn = moleculeOf({ name: "pUC19", length: 2686, circular: true, features: [{ type: "CDS", label: "bla", strand: -1, parts: [{ start: 1626, end: 2487 }] }] });
136
+ * drawn.features[0].tone; // "yours"
137
+ * ```
138
+ */
139
+ export function moleculeOf(part) {
140
+ return {
141
+ name: part.name, length: part.length, circular: part.circular,
142
+ features: part.features.flatMap((feature) => feature.parts.map((piece) => ({ start: piece.start, end: piece.end, strand: feature.strand, tone: featureTone(feature.type), label: feature.label }))),
143
+ };
144
+ }
145
+ //# sourceMappingURL=sequence-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequence-file.js","sourceRoot":"","sources":["../src/sequence-file.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAoBvC,MAAM,YAAY,GAAqC,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,O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AC,CAAC,OAAO,MAAM,CAAC;QAC/B,KAAK,YAAY,CAAC,CAAC,OAAO,WAAW,CAAC;QACtC,KAAK,YAAY,CAAC,CAAC,OAAO,QAAQ,CAAC;QACnC,KAAK,aAAa,CAAC,CAAC,OAAO,OAAO,CAAC;QACnC,KAAK,cAAc,CAAC;QAAC,KAAK,YAAY,CAAC,CAAC,OAAO,MAAM,CAAC;QACtD,OAAO,CAAC,CAAC,OAAO,KAAK,CAAC;IACxB,CAAC;AACH,CAAC;AAWD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,UAAU,CAAC,IAA2F;IACpH,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ;QAC7D,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACpM,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Bring sequences in from files, and look at any part the lab has as a map.
3
+ *
4
+ * Choosing files adds each as a part, with the name, the shape and the features the file gives it.
5
+ * SnapGene's own files, GenBank, EMBL and FASTA are read. A part is known by its sequence, so
6
+ * bringing in one the lab already has adds nothing but what is marked on it.
7
+ *
8
+ * @param props - `part` is the checksum of the part to open on.
9
+ */
10
+ export declare function SequencesTool({ part: first }: {
11
+ part?: string;
12
+ }): import("react").JSX.Element | null;
13
+ //# sourceMappingURL=sequences-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequences-tool.d.ts","sourceRoot":"","sources":["../src/sequences-tool.tsx"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,sCAiF/D"}
@@ -0,0 +1,61 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * A lab's sequences: bringing them in from the files it already has, and reading one as a map.
5
+ *
6
+ * This is the part of a sequence editor most people use most: open a construct, see what is on it,
7
+ * see where the enzymes cut. Here the construct is a part in the lab's freezer, so what is being
8
+ * looked at is something the lab holds, and what is brought in is added to what it holds.
9
+ */
10
+ import { useMemo, useState } from "react";
11
+ import { useAct, useLab } from "@biolibs/bionet-react";
12
+ import { endsWords } from "@biolibs/bionet-panels";
13
+ import { cutters } from "./digest.js";
14
+ import { SequenceMap } from "./map.js";
15
+ import { featureTone, readSequenceFile } from "./sequence-file.js";
16
+ const count = (value) => value.toLocaleString("en-US");
17
+ /**
18
+ * Bring sequences in from files, and look at any part the lab has as a map.
19
+ *
20
+ * Choosing files adds each as a part, with the name, the shape and the features the file gives it.
21
+ * SnapGene's own files, GenBank, EMBL and FASTA are read. A part is known by its sequence, so
22
+ * bringing in one the lab already has adds nothing but what is marked on it.
23
+ *
24
+ * @param props - `part` is the checksum of the part to open on.
25
+ */
26
+ export function SequencesTool({ part: first }) {
27
+ const lab = useLab()?.lab;
28
+ const act = useAct();
29
+ const [chosen, setChosen] = useState(first ?? null);
30
+ const [said, setSaid] = useState([]);
31
+ const [busy, setBusy] = useState(false);
32
+ const [once, setOnce] = useState(true);
33
+ const part = lab?.parts.find((one) => one.checksum === chosen) ?? lab?.parts[0];
34
+ const cuts = useMemo(() => (part === undefined ? [] : cutters(part)), [part]);
35
+ if (lab === null || lab === undefined)
36
+ return null;
37
+ // On a map, the enzymes worth naming are the ones that cut once or twice: those are the ones to cut with.
38
+ const shown = cuts.filter((one) => one.positions.length <= (once ? 1 : 2));
39
+ const tubes = part === undefined ? 0 : lab.items.filter((item) => item.part === part.checksum && !item.retired).length;
40
+ const bring = async (files) => {
41
+ if (files === null || files.length === 0)
42
+ return;
43
+ setBusy(true);
44
+ const lines = [];
45
+ for (const file of Array.from(files)) {
46
+ try {
47
+ const read = readSequenceFile(file.name, new Uint8Array(await file.arrayBuffer()));
48
+ const answer = await act("addPart", { name: read.name, sequence: read.sequence, circular: read.circular, features: read.features });
49
+ lines.push(answer.ok ? `${read.name}: ${count(read.sequence.length)} bp, ${read.circular ? "circular" : "linear"}, ${read.features.length} ${read.features.length === 1 ? "feature" : "features"}, from ${read.format}`
50
+ : `${file.name}: ${answer.error}`);
51
+ }
52
+ catch (cause) {
53
+ lines.push(`${file.name}: ${cause instanceof Error ? cause.message : String(cause)}`);
54
+ }
55
+ }
56
+ setSaid(lines);
57
+ setBusy(false);
58
+ };
59
+ return (_jsxs("div", { className: "pcr sequences", children: [_jsxs("section", { className: "card", children: [_jsx("h2", { children: "Bring sequences in" }), _jsx("p", { className: "dim small", children: "Choose SnapGene (.dna), GenBank (.gb), EMBL or FASTA files. Each becomes a part in the freezer, with what the file marks on it. Add a tube of it on the Freezer tab when there is one." }), _jsx("input", { type: "file", multiple: true, disabled: busy, accept: ".dna,.gb,.gbk,.gbff,.genbank,.embl,.fa,.fasta,.fna", "aria-label": "Sequence files", onChange: (event) => { void bring(event.target.files); event.target.value = ""; } }), said.length > 0 && _jsx("ul", { className: "plainlist small", role: "status", children: said.map((line) => _jsx("li", { children: line }, line)) })] }), part === undefined ? _jsx("p", { className: "empty", children: "The lab has no parts yet." }) : (_jsxs("section", { className: "card", children: [_jsxs("div", { className: "toolhead", children: [_jsxs("label", { children: ["Part", _jsx("select", { value: part.checksum, onChange: (event) => setChosen(event.target.value), "aria-label": "Part", children: lab.parts.map((one) => _jsxs("option", { value: one.checksum, children: [one.name, " \u00B7 ", count(one.length), " bp", one.circular ? " · circular" : ""] }, one.checksum)) })] }), endsWords(part) !== null && _jsxs("span", { className: "small", children: ["ends ", _jsx("code", { children: endsWords(part) })] }), _jsx("span", { className: "dim small", children: tubes === 0 ? "no tubes of it" : `${tubes} ${tubes === 1 ? "tube" : "tubes"} of it` })] }), _jsxs("div", { className: "mapped", children: [_jsx(SequenceMap, { name: part.name, length: part.length, circular: part.circular, features: part.features, marks: shown.flatMap((one) => one.positions.map((at) => ({ at, label: one.name }))) }), _jsxs("div", { children: [_jsxs("table", { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Feature" }), _jsx("th", { children: "Type" }), _jsx("th", { children: "Where" }), _jsx("th", { children: "Strand" })] }) }), _jsxs("tbody", { children: [part.features.map((feature, at) => (_jsxs("tr", { children: [_jsxs("td", { children: [_jsx("span", { className: `swatch tone-${featureTone(feature.type)}` }), feature.label] }), _jsx("td", { className: "dim", children: feature.type }), _jsx("td", { children: _jsx("code", { children: feature.parts.map((piece) => `${count(piece.start + 1)}..${count(piece.end)}`).join(", ") }) }), _jsx("td", { className: "dim", children: feature.strand === 1 ? "forward" : feature.strand === -1 ? "reverse" : "—" })] }, at))), part.features.length === 0 && _jsx("tr", { children: _jsx("td", { colSpan: 4, className: "dim", children: "Nothing is marked on this part. A part brought in from a SnapGene or GenBank file keeps what the file marks." }) })] })] }), _jsxs("p", { className: "small", children: [_jsx("strong", { children: "Cuts once:" }), " ", cuts.filter((one) => one.positions.length === 1).map((one) => one.name).join(", ") || "none of the usual enzymes", cuts.some((one) => one.positions.length === 2) && _jsxs(_Fragment, { children: [" \u00B7 ", _jsx("strong", { children: "twice:" }), " ", cuts.filter((one) => one.positions.length === 2).map((one) => one.name).join(", ")] })] }), _jsxs("label", { className: "check small", children: [_jsx("input", { type: "checkbox", checked: !once, onChange: (event) => setOnce(!event.target.checked) }), " Mark the ones that cut twice as well"] })] })] })] }))] }));
60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
18
18
  * A run is still recorded as done at the instrument for that tool, if the lab has placed one.
19
19
  *
20
- * @param props - `tool` is which to open on; `views` lets a host show a tool its own way, such as
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
21
  * at its instrument in a scene, in place of the plain form.
22
22
  */
23
23
  export declare function Tools({ tool: first, views }: {
24
- tool?: ToolName;
24
+ tool?: ToolName | "sequences";
25
25
  views?: Partial<Record<ToolName, ReactNode>>;
26
26
  }): import("react").JSX.Element | null;
27
27
  //# sourceMappingURL=tools.d.ts.map