Translation and six frames
seq_translate
Translates a DNA or RNA sequence in one reading frame or all six, with an NCBI genetic code table.
- Runs
- On the server
- Level
- Checked against a reference: Biopython 1.88 exactly
What it is
Required: frame (1, 2, 3, -1, -2, -3, all). Translates a DNA or RNA sequence with an NCBI genetic code table. Frames 1, 2, 3 read the strand as given; -1, -2, -3 read its reverse complement; all gives six. Stops are written as '*'. Codons with ambiguity codes translate to the amino acid every reading agrees on, else 'X'.
Field: Sequences. It is the same calculation as Drybench Sequence, called by an AI assistant through the server.
What it does
You give
sequence(required): The DNA or RNA sequence: plain letters, FASTA (first record) or GenBank. Spaces, line breaks and position numbers are ignored. At most 1,000,000 letters.frame(required): Reading frame: '1', '2', '3', '-1', '-2', '-3', or 'all' for all six frames.alphabet: How to read the sequence. Omit to take it from the record (FASTA or GenBank fields) or, failing that, from the letters. 'dna-circular' reads DNA as a circle.geneticCode: NCBI translation table id. Default 1 (the standard code).stopAtFirstStop: Stop at the first in-frame stop codon (one frame only). Refused for tables with context-dependent termination.firstCodonAsMet: Read the first codon as M when it is one of the table's initiation codons (one frame only).
Asked with
- alphabet
- dna
- frame
- 1
- geneticCode
- 1
- stopAtFirstStop
- yes
- firstCodonAsMet
- no
It answered (computed)
- protein
- MTSRIPAAVQTCTNTLTAAALKPESKYLLVALCSSRRGWTKSPLQPRRPGFRAIVITSDND
- residues
- 61
- stops
- 0
- frame
- 1
- frameLabel
- +1
Computed by this tool when the page was built. The steps between are not recorded, so this is not a worked example. The reply carries more values than are shown here.
Limits
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
- No other limit is recorded for this tool.
It will not answer when
- frame is omitted (required in 1.0.0; no default).
- geneticCode does not name an NCBI translation table.
- stopAtFirstStop or firstCodonAsMet is set when frame is 'all'.
- stopAtFirstStop is true for a genetic code with context-dependent termination (refused with nextStep).
Every input, with its units6 inputs
sequence(required): The DNA or RNA sequence: plain letters, FASTA (first record) or GenBank. Spaces, line breaks and position numbers are ignored. At most 1,000,000 letters.frame(required): Reading frame: '1', '2', '3', '-1', '-2', '-3', or 'all' for all six frames.alphabet: How to read the sequence. Omit to take it from the record (FASTA or GenBank fields) or, failing that, from the letters. 'dna-circular' reads DNA as a circle.geneticCode: NCBI translation table id. Default 1 (the standard code).stopAtFirstStop: Stop at the first in-frame stop codon (one frame only). Refused for tables with context-dependent termination.firstCodonAsMet: Read the first codon as M when it is one of the table's initiation codons (one frame only).
Every refusal, with its code4 refusals
| Code | When |
|---|---|
MODE_REQUIRED | frame is omitted (required in 1.0.0; no default). |
UNKNOWN_GENETIC_CODE | geneticCode does not name an NCBI translation table. |
ONE_FRAME_OPTION | stopAtFirstStop or firstCodonAsMet is set when frame is 'all'. |
CONTEXT_DEPENDENT_TERMINATION | stopAtFirstStop is true for a genetic code with context-dependent termination (refused with nextStep). |
The calculation
The method's equations, constants and worked example.
Read the sequence in the chosen frame three bases at a time and look each codon up in the chosen NCBI table (ncbieaa: 64 residues in NCBI's codon order, "*" a stop). A codon with IUPAC ambiguity codes is expanded to every codon it can stand for: if all give one residue (a stop included) it reads that residue, otherwise X. Reverse frames read the reverse complement. With firstCodonAsMet, a first codon that the table marks as an initiation codon (sncbieaa "M"
for an ambiguous codon, only when every expansion is one) reads M. With stopAtFirstStop, translation ends at the first in-frame stop
refused for tables with context-dependent termination.
Source 1.
| Constant | Value | From |
|---|---|---|
NCBI's 27 genetic code tables (residues and initiation marks) codes | a table of values, part of the method | Source 1 |
Conventions
- Convention chosen by this project: a codon with IUPAC ambiguity codes reads a residue only when every codon it can stand for gives that residue, and otherwise reads X, including when it may or may not be a stop. Some programs print B, Z or J where the choices are Asp/Asn, Glu/Gln or Leu/Ile, and others refuse ambiguous bases; they would show those letters, or no translation, where this shows X.
Kind of method: not recorded.
Worked example
Worked example: one case of translation-ncbi-genetic-codes@1.1.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.
Inputs
- sequence = ATGGCNTTRTAA
- alphabet = dna
Steps
- codon1: table 1 look-up = ATG → M → M, from codon = ATG, stands for = ATG.
- codon2: table 1 look-up = GCN → A, A, A, A → A, from codon = GCN, stands for = GCA, GCC, GCG, GCT.
- codon3: table 1 look-up = TTR → L, L → L, from codon = TTR, stands for = TTA, TTG.
- codon4: table 1 look-up = TAA → * → *, from codon = TAA, stands for = TAA.
- protein: concatenate = MAL*, gives result.protein.
The working, as the case writes it:
Look up each codon in table 1
an ambiguous codon is expanded and reads the common residue, else X.
Answer
result.protein = MAL*
Where these values came from: a published dataset, Python decimal (50 significant digits) 3.13.18; NCBI. The Genetic Codes, gc.prt version 4.6, table 1 (Standard), ncbieaa and sncbieaa lines; IUPAC ambiguity codes (NC-IUB 1985): N = A, C, G or T; R = A or G.
The build has not run this example through the tool.
Sources
NCBI. The Genetic Codes, gc.prt, version 4.6 (last modified 10 June 2020). Public domain.
Used for: Translation with NCBI's genetic code tables. At: table all 27 Genetic-code-table entries (ncbieaa and sncbieaa lines).
Read in full, 11 November 2026
How it is checked
- Level
Checked against a reference.
- Checked against
Biopython 1.88 exactly on 108 frame translations of three sequences in genetic codes 1, 2 and 11, full length and to the first stop, and on 5 annotated coding sequences (6 October 2026).
- Cases
No case set is linked to this version.
- Hostile inputs
Sent 19 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason.
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Same answer
Called twice and with its arguments in another order, it gave the same result.
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Not checked
The engine's 27 tables were compared with gc.prt 4.6 fetched on 11 November 2026 (byte-identical to the 6 October fetch; every residue and initiation line agrees). The IUPAC 1985 recommendation itself was not re-read.
What was not checked, in fullfrom the method records
- The engine's 27 tables were compared with gc.prt 4.6 fetched on 11 November 2026 (byte-identical to the 6 October fetch; every residue and initiation line agrees).
- The IUPAC 1985 recommendation itself was not re-read.
- No published case set names translation-ncbi-genetic-codes@1.1.0 by exact key.
What this project's records still lack2 things
- A run of the worked example through the tool for translation-ncbi-genetic-codes@1.1.0.
- A case set linked to this version for translation-ncbi-genetic-codes@1.1.0.
Cite a number from this toolthe cite line
Every reply carries a cite line naming the tool, the server version, each method with its version and level, and the receipt. Quote it with any number taken from the reply.
seq_translate, server 1.0.0; translation-ncbi-genetic-codes@1.1.0 (Checked against a reference); receipt 48b1efc2756b/49709887da70; methods https://www.drybench.com/methods/sequence; page https://www.drybench.com/methods/tools/seq-translate. Quote this line with any number taken from this reply.Changes to its methods0 changes
No change is logged for these method versions.