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.
- 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.
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-cliThe tool can be executed as python main.py (or chmod +x main.py && ./main.py).
# 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| Flag | Description |
|---|---|
-s, --sequence | Protein sequence (single‑letter codes, required) |
-H, --host | Target organism: ecoli, yeast, human, cho (default ecoli) |
-a, --avoid | Comma‑separated list of restriction site patterns to avoid |
-o, --output | Write DNA to file instead of stdout |
Codon usage tables are stored in codon_tables.json. You can extend the file with additional hosts (see format inside).
MIT – see LICENSE for details.
Collins Amatu Gorgerat