Translation
DNA with its protein underneath: each amino acid a tile as wide as its codon, so a base, its codon and the residue it makes read together. One frame, three, or all six.
Install
npx shadcn@latest add @nelumbo/translationA coding sequence
The first 90 bases of TP53's coding sequence and the 30 residues they make: MEEPQSDPSV, as p53 begins. Lines wrap in whole codons; residues in a frame join into one shape, as a sequence's tiles do.
Six frames
frames={6} reads both strands: the forward frames under the top strand, the reverse frames under the bottom strand, right to left. orfs fades everything outside an open reading frame, so the real one stands out: TP53 starts at the ATG of base 143, in frame +1 here. Stops are solid.
Notation and size
notation="three" spells residues out where a codon has room; the small size suits panels and tables.
Selection
selectable makes the bases one keyboard stop: arrows move a base, up and down a line, Shift extends, Escape clears. Drag across bases, or click a residue to take its codon. Copying gives the bases.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
sequence | string | DNA or RNA; spaces and numbers are ignored. | |
frames | 1 | 3 | 6 | 1 | The coding frame, the three forward frames, or all six. |
codonStart | 1 | 2 | 3 | 1 | With one frame: which base the first codon starts on. |
complement | boolean | frames is 6 | The bottom strand under the top. |
start | number | 1 | The number of the first base. |
scheme / aminoScheme | NucleotideScheme, AminoAcidScheme | "nelumbo" | Base and residue colors. |
notation | "one" | "three" | "one" | Residues as W or Trp. |
orfs | boolean | { minLength } | false | Fade residues outside open reading frames of at least minLength codons (30). |
lineLength | "auto" | number | "auto" | Bases a line; auto fits the width in fives of codons. |
size | "sm" | "default" | "default" | 13 or 17 px a base. |
selectable / selection | boolean, { start, end } | null | false | Base selection by keyboard, drag or codon. Controlled or not (defaultSelection). |
onActiveChange | ({ position, codon? } | null) => void | The base, or the codon, in focus. | |
Helpers | frameCodons, findOrfs | Every codon of a frame; open reading frames, longest first. |