Skip to content

OptimiseDNACodons

apiblocks.OptimiseDNACodons

Optimises the coding sequence for expression in a target organism or according to the supplied codon table. If both are given, the supplied codon table will be used.

Use best codon (use_best_codon)

This method will substitute codons for the most used one in the target table or organism.

Match codon usage (match_codon_usage)

This method will substitute codons probabilistically, emulating the usage of the codons in the taget table or organism.

Parameters:
Name Type Description Example Default
method Optional[Literal['use_best_codon', 'match_codon_usage']]

Custom codon table for the optimisation

"match_codon_usage"
"match_codon_usage"
dna DNA

Target DNA sequence to optimise

{
  "seq": "ATGTTAGAG"
}
organism Optional[Organism]

Target organism for the optimisation

{
  "name": "e_coli",
  "tax_id": 316407
}
codon_table Optional[CodonTable]

Custom codon table for the optimisation

null

Returns:

Type Description
DNA

Codon optimised DNA.

Raises:

Type Description
Codon table not found

If a codon table for the given organism is not found.

Available tables
Organism name Tax id
b_subtilis 1423
d_melanogaster 7227
m_musculus_domesticus 10092
m_musculus 10090
e_coli 316407
g_gallus 9031
c_elegans 6239
s_cerevisiae 4932
h_sapiens 9606
References

DNA Chisel - a versatile sequence optimizer

codon-usage-tables

Examples:
$ curl 'https://api.apiblocks.dev/rpc' \
-H 'X-API-KEY: $APIBLOCKS_TOKEN' \
-H 'Content-Type: application/json' \
--data '{
    "id": "c233218b-46c8-471d-b65f-2cd16ab47ebe",
    "method": "apiblocks.OptimiseDNACodons",
    "params": {
      "method": "match_codon_usage",
      "dna": {
        "seq": "ATGTTAGAG"
      },
      "organism": {
        "name": "e_coli",
        "tax_id": 316407
      }
    }
  }'