Skip to content

Repository files navigation

Codon Optimizer CLI

Optimize a protein amino acid sequence into a DNA coding sequence using host-specific codon frequency tables. Designed for synthetic biology and pharmaceutical recombinant protein production, it maximizes expression by selecting the most frequent codon for each amino acid and optionally excludes restriction enzyme sites.

Features

  • Back‑translates protein sequences (single‑letter amino acid codes) to DNA.
  • Uses built‑in codon usage tables for E. coli, S. cerevisiae, human (HEK), and CHO cells.
  • Selects the most frequent codon per amino acid.
  • Optional avoidance of user‑supplied restriction enzyme recognition sites through synonymous codon substitution.
  • Reports GC content of the final DNA sequence.
  • Simple command‑line interface with plain‑text output.

Installation

Clone the repository and run directly – no dependencies beyond Python 3.8+.

git clone https://github.com/yourusername/codon-optimizer-cli.git
cd codon-optimizer-cli

The tool can be executed as python main.py (or chmod +x main.py && ./main.py).

Usage

# Optimize a sequence for E. coli and print the DNA
python main.py -s "MALWMRLLPLLALLALWGPDPAAA" -H ecoli
# Use a different host and avoid certain restriction sites
python main.py -s "MVSKGEELFTGVVPILVELDGDVNGHKFSVSGEGEGDATYGKLTLKFICTTGKLPVPWPTLVTTLTYGVQCFSRYPDHMKQHDFFKSAMPEGYVQERTIFFKDDGNYKTRAEVKFEGDTLVNRIELKGIDFKEDGNILGHKLEYNYNSHNVYIMADKQKNGIKVNFKIRHNIEDGSVQLADHYQQNTPIGDGPVLLPDNHYLSTQSALSKDPNEKRDHMVLLEFVTAAGITHGMDELYK" -H human --avoid "EcoRI,BamHI"# Save to file
python main.py -s "MALWMR" -o optimized_gene.txt

Options

FlagDescription
-s, --sequenceProtein sequence (single‑letter codes, required)
-H, --hostTarget organism: ecoli, yeast, human, cho (default ecoli)
-a, --avoidComma‑separated list of restriction site patterns to avoid
-o, --outputWrite DNA to file instead of stdout

Codon Tables

Codon usage tables are stored in codon_tables.json. You can extend the file with additional hosts (see format inside).

License

MIT – see LICENSE for details.

Author

Collins Amatu Gorgerat

About

A command-line tool to optimize DNA sequences for heterologous expression using host-specific codon usage tables.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages