ForHosting KIT · Developer Utilities

Codon Usage Fraction Calculator for Gene Codon Counts

The codon usage fraction calculator measures how much one codon contributes to all observed codons that encode the same amino acid within a gene.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Supply codon counts and choose a target codon; the result shows its normalized fraction, percentage, amino acid, and the complete synonymous group used as the denominator. DNA and RNA notation are accepted, duplicate rows are combined, and missing synonymous codons count as zero. This makes a focused codon-bias summary easy to reproduce without a spreadsheet or a hand-maintained genetic-code table.

What the codon usage fraction means

Amino acids are often encoded by more than one codon. The usage fraction asks a narrow, useful question: among the codons observed for one amino acid in this gene, what share uses the selected codon? If a gene contains 18 TTT observations and 12 TTC observations, both encoding phenylalanine, the TTT fraction is 18 divided by 30, or 0.6. The calculation is local to the amino acid rather than to every codon in the gene. That distinction makes the value suitable for describing synonymous preference, because unrelated amino-acid composition does not change the denominator. A fraction near one indicates that the selected codon dominates its synonymous group in the supplied gene, while a fraction near zero indicates rare or absent use. This value summarizes observed composition; it does not by itself establish selection, expression efficiency, or statistical significance. Those interpretations require an appropriate reference set and biological context. Use counts derived from a consistent reading frame and the same gene definition so that the comparison remains meaningful.

How to prepare and interpret the input

Enter each observed codon with its non-negative integer count, then identify the target codon. Both DNA letters such as TTT and RNA letters such as UUU are accepted; RNA U is normalized to DNA T in the output. Letter case and surrounding whitespace do not matter. When the same normalized codon appears more than once, its counts are added, which is helpful when data came from separate regions or batches. You do not need to list every synonymous codon. Any synonymous codon omitted from the input is shown with a zero count and still appears in the result, making the denominator transparent. Counts for codons encoding other amino acids are valid input but do not affect the selected fraction. The calculator uses the standard genetic code and rejects a stop codon as the target because a stop signal is not an amino acid. It also rejects a synonymous group whose supplied total is zero, since division by zero would not describe usage. Review the returned synonymous list before comparing genes to confirm that the intended codon family was used.

Using the result in codon-bias workflows

The returned usage_fraction is between zero and one, and percentage expresses the same value on a zero-to-one-hundred scale. The target count and synonymous total are returned alongside the fraction so downstream analyses can preserve the evidence behind the ratio. This matters because identical fractions can have very different support: one out of two observations and five hundred out of one thousand observations both equal 0.5, but they should not automatically receive the same confidence. For exploratory work, calculate the fraction for each synonymous codon and compare patterns across genes, conditions, organisms, or designed sequences. Keep genetic-code assumptions, annotation versions, and counting rules consistent across the comparison. The output can also support quality checks: fractions for all codons in a synonymous family should sum to one when computed from the same counts. The API price is $0.002 per request, while the browser version can perform the same deterministic calculation locally. No network lookup, random sampling, background database, or changing reference frequency is involved, so the same valid input always produces the same result.

Summarize one gene

Measure whether a selected synonymous codon dominates or is rarely used within a gene.

Compare gene designs

Calculate matching codon fractions for native and redesigned coding sequences using the same counting rules.

Audit a codon-count table

Expose the synonymous denominator and zero-filled family members before a broader codon-bias analysis.

What is the formula?

The selected codon's count is divided by the sum of counts for every codon that encodes the same amino acid under the standard genetic code.

Can I enter RNA codons?

Yes. U is normalized to T, so UUU and TTT are treated as the same codon.

What happens when a synonymous codon is missing?

It is assigned a count of zero. The output lists the complete synonymous family used for the calculation.

Are duplicate codon rows allowed?

Yes. Duplicate codons are normalized and their non-negative integer counts are combined.

Can the target be a stop codon?

No. The metric is defined for a codon and its amino acid, so stop codons are rejected as targets.

Does a high fraction prove optimal expression?

No. It describes usage in the supplied counts only; expression and adaptation claims require reference data and biological context.

What does the API request cost?

The API price is $0.002 per request. The page can also run the deterministic calculation locally in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/bio/codon-usage-fraction

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/bio/codon-usage-fraction \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"codon_counts":[{"codon":"TTT","count":18},{"codon":"TTC","count":12},{"codon":"ATG","count":7}],"target_codon":"TTT"}'
{
  "codon_counts": [
    {
      "codon": "TTT",
      "count": 18
    },
    {
      "codon": "TTC",
      "count": 12
    },
    {
      "codon": "ATG",
      "count": 7
    }
  ],
  "target_codon": "TTT"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "bio.codon_usage_fraction",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_items64
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →