Charlie KrugThe Build Log

← All posts

Shift the start by one base, and it's a different protein.

Codon reads a raw DNA sequence in your browser: GC content, all six reading frames, every ORF, codon usage, and restriction sites, live and client-side. No install, no login, no server.

DNA has no spaces. It's one long run of A, C, G, and T, and the cell reads it three letters at a time, each triplet naming one amino acid. But the string never tells you where a triplet starts. Begin at the first base and you get one protein. Begin at the second, shifting the whole grid over by one letter, and every triplet downstream is different, so you get a totally different protein, or more often a quick stop and nonsense. Nudge the start once more and you're on a third reading. Then flip the strand over and read the complement backwards, and there are three more. Six ways to read the same stretch of DNA. Usually only one of them holds the gene.

Codon is a single page that shows you all six at once. Paste a raw sequence and it works out the GC content, translates every reading frame, finds every open reading frame, tallies codon usage, and marks common restriction sites, live, on your own machine.

Why not just use the real tools

Because the real tools are a lot. Looking at a sequence properly means SnapGene or Geneious or CLC, which are paid, installed, and built for a lab's whole workflow. The free web options (ExPASy Translate, NCBI's ORFfinder) each solve one narrow task, want their own tab, and look untouched since about 2005. None of them is a single page where a curious person pastes a sequence and just sees it. Codon is for the student on a problem set and the hobbyist checking a plasmid map from a kit, not the lab. You already know what GC content and an ORF are; you just want to look without making an account.

Everything is a pure function of a string

There is no backend, and that isn't a shortcut, it's the whole design. GC content is counting. Translation is a lookup table from 64 triplets to 20 amino acids (NCBI standard table 1). Reverse-complement is flipping the string and swapping A with T and C with G. ORF detection is scanning each of the six frames for an ATG followed eventually by a stop codon and recording the run between them. Every one of those is deterministic and cheap, cheap enough to re-run the entire analysis on every keystroke for realistic sequence lengths without a hint of lag. A server would only add latency, cost, and a reason to wonder what happens to the sequence you pasted. Nothing here needs one, so there isn't one.

The other quiet decision is color. A, C, G, and T each get exactly one color, and that same mapping is used in the sequence view, the six-frame viewer, and the stacked GC bar. Your eye learns the code once instead of re-reading a legend in every panel. The longest ORF is highlighted right on the sequence, its protein translation sitting next to it, so the DNA and the thing it encodes are never more than a glance apart. Click any shorter ORF in the list and the view scrolls to it.

What it doesn't pretend to do

v1 ships six restriction enzymes (EcoRI, BamHI, HindIII, NotI, XhoI, PstI), not a configurable catalog of hundreds. It uses the standard genetic code, not the sixteen alternate translation tables for mitochondria and odd organisms. Ambiguous or incomplete codons translate to a blunt X rather than guessing. And it turns away anything past 100,000 bases instead of freezing your tab trying to be heroic. Depth on the one flow that matters beat breadth of options nobody asked for. The translation and ORF logic are property-tested with fast-check, which is the only dependency in the repo, and it's a test-only one: the shipped site has zero.

Try it

Open Codon and press Load example for a real GFP fragment. Watch the GC meter fill, scan the six frames, and find the highlighted ORF with its protein spelled out beside the DNA. Then paste your own sequence (FASTA line breaks are stripped for you) and see what falls out of it.

Codon is live. Free, in your browser, no signup.

This post is part of the build log: every app my automated factory ships gets written up here, honestly. Browse everything at apps.charliekrug.com. Comments are open below.

Comments

Loading comments…