Split codons
Separate a coding sequence into codon positions 1, 2 and 3, or space it as triplets.
Separate a coding sequence into codon positions 1, 2 and 3, or space it as triplets.
A coding sequence is read three bases at a time. This tool cuts it into those triplets and shows them in the two ways people need. Codon positions writes three sequences: all the first bases of the codons, all the second bases, and all the third bases. Spaced tripletswrites the same sequence with a space between codons so the frame can be read by eye and pasted into a figure or an alignment note.
Worked example. "Try an example" loads the 720 nt coding sequence of EGFP, which is240 codons with nothing left over. The split gives GC1 56.7 %,GC2 31.3 % and GC3 96.7 %, averaging the 61.5 % GC of the whole gene. A GC3 of almost 97 % is the signature of a synthetic, codon-optimised gene: EGFP was rebuilt with the codons preferred by human cells, nearly all of which end in G or C. A natural gene of the same GC content would show a GC3 in the sixties. Set the frame offset to 2 and the values become 31.4 %, 97.1 % and 56.9 %, the same three numbers shifted round, which is what an out-of-frame split looks like.
The tool assumes the first base you give it is the first base of a codon. If the sequence begins one or two bases into a codon, set the offset to 2 or 3; the leading bases are dropped and everything is read from there. Bases at the far end that do not fill a codon are left out and counted in the warning under the result. To find the frame in the first place, use theORF finder orsix-frame translation.
Ambiguity codes are kept in place so the frame cannot shift, which is the one thing that matters here. To see the protein, useDNA to protein translation; for codon-by-codon frequencies in a host, rare codon analysis; and for the genetic code itself, the codon table.
Every codon is three bases: the first, second and third position. Splitting a coding sequence by position gives three sequences, one holding every first base, one every second and one every third, each a third of the length of the original.
GC3 is the GC content of the third codon positions. Because most third-position changes do not change the amino acid, GC3 drifts with mutation and selection pressure and is the main signal of codon bias. It is high in codon-optimised genes and in grass and mammalian GC-rich isochores, and it is used to spot horizontally transferred genes.
Third positions change fastest, so over long divergences they saturate: the same site mutates repeatedly and the apparent distance stops growing. Removing them, or analysing them as a separate partition, reduces long-branch artefacts. Splitting by codon position is the first step.
The leftover one or two bases at the end are not a complete codon, so they are left out and reported under the result. If the leftovers look wrong, the sequence probably starts in another frame; change the frame offset.
IUPAC ambiguity codes such as N are kept where they are, so the frame does not shift. Gap characters are removed before splitting, so run an alignment through a gap cleaner first if the columns have to stay aligned.