# Change Log Source: https://proto.evodesign.org/docs/changelog New tools and recent development across the Proto language and tools layers Proto has two layers. The **language** provides the optimization engine, constraints, generators, and optimizers. The **tools** layer is a standalone collection of bioinformatics models and tools that users can run directly or within the language layer. ## New Tools ![](https://proto-bio.github.io/proto-assets/images/tool/rfam/carousel.png) October 5, 2026 Rfam RNA family records, consensus structures, and genome-wide hit coordinates from the Rfam database. [Open](/docs/tools/database-retrieval/rfam) ![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png) September 30, 2026 Minerva Alignment-free maps of RNA base pairing, protein contacts, and repeats across microbial genomes. [Open](/docs/tools/masked-models/minerva) ![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png) September 30, 2026 gLM2 Masked language model reading protein-coding and intergenic DNA together as one genomic context. [Open](/docs/tools/masked-models/glm2) ![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png) September 2, 2026 Genomic Intelligence Seven DNA language models scoring promoters, splice sites, enhancers, chromatin, and expression. [Open](/docs/tools/sequence-scoring/genomic-intelligence) ![](https://proto-bio.github.io/proto-assets/images/tool/primer3/carousel.png) August 5, 2026 Primer3 Melting temperature, hairpin and dimer stability, and GC content for a DNA oligo. [Open](/docs/tools/sequence-scoring/primer3) ![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png) August 5, 2026 CodonFM Codon-level masked language model for coding-sequence fitness, embeddings, and design. [Open](/docs/tools/masked-models/codonfm) ![](https://proto-bio.github.io/proto-assets/images/tool/vina/carousel.png) August 4, 2026 AutoDock Vina Small-molecule docking into a rigid receptor, returning ranked poses with affinity scores. [Open](/docs/tools/molecular-docking/vina) ![](https://proto-bio.github.io/proto-assets/images/tool/opendde/carousel.png) July 24, 2026 OpenDDE All-atom co-folding for complexes of proteins, DNA, RNA, ligands, and ions. [Open](/docs/tools/structure-prediction/opendde) ![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png) July 23, 2026 PARADE Cell-type-specific UTR activity and 3' UTR mRNA stability prediction. [Open](/docs/tools/sequence-scoring/parade) ## Commit Timeline OpenDDE was added to the structure prediction category. ## Contribute The tool catalog is extended through contributions. To add a tool, fork the repository and open a pull request; we will assist with the integration. > **[Add a tool](https://github.com/evo-design/proto-tools/blob/main/CONTRIBUTING.md)** > > Fork proto-tools and open a pull request. CONTRIBUTING.md documents the layout and conventions. > **[Contact us](https://proto.evodesign.org/feedback)** > > Describe what you would like to see in Proto and how we can assist. # Proto Source: https://proto.evodesign.org/docs/introduction A high-level programming language for designing DNA, RNA, and protein sequences [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/foldmason/carousel.png)](/docs/tools/structure-alignment/foldmason) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/tool/pymol_rmsd/carousel.png)](/docs/tools/structure-alignment/pymol-rmsd) [![](https://proto-bio.github.io/proto-assets/images/tool/alphamissense_db/carousel.png)](/docs/tools/database-retrieval/alphamissense-db) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/tool/evo1/carousel.png)](/docs/tools/causal-models/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/opendde/carousel.png)](/docs/tools/structure-prediction/opendde) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/bindcraft/carousel.png)](/docs/tools/binder-design/bindcraft) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/tool/netmhcpan/carousel.png)](/docs/tools/epitope-prediction/netmhcpan) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/tool/rfam/carousel.png)](/docs/tools/database-retrieval/rfam) [![](https://proto-bio.github.io/proto-assets/images/tool/enformer/carousel.png)](/docs/tools/sequence-scoring/enformer) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/optimizer/gradient/carousel.png)](/docs/language/optimizers/gradient) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/tool/mafft/carousel.png)](/docs/tools/sequence-alignment/mafft) [![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/carousel.png)](/docs/tools/inverse-folding/esm-if1) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/esmc/carousel.png)](/docs/tools/masked-models/esmc) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/evo1/carousel.png)](/docs/tools/causal-models/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/progen3/carousel.png)](/docs/tools/causal-models/progen3) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/progen2/carousel.png)](/docs/tools/causal-models/progen2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/primer3/carousel.png)](/docs/tools/sequence-scoring/primer3) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/carousel.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/vina/carousel.png)](/docs/tools/molecular-docking/vina) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/carousel.png)](/docs/tools/inverse-folding/esm-if1) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/x3dna/carousel.png)](/docs/tools/structure-prediction/x3dna) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/rfdiffusion3/carousel.png)](/docs/tools/structure-design/rfdiffusion3) [![](https://proto-bio.github.io/proto-assets/images/tool/random_protein/carousel.png)](/docs/tools/mutagenesis/random-protein) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/evo2/carousel.png)](/docs/tools/causal-models/evo2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/optimizer/genetic-algorithm/carousel.png)](/docs/language/optimizers/genetic-algorithm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/cycling/carousel.png)](/docs/language/optimizers/cycling) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai/carousel.png)](/docs/tools/rna-splicing/spliceai) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/usalign/carousel.png)](/docs/tools/structure-alignment/usalign) [![](https://proto-bio.github.io/proto-assets/images/tool/na_mpnn_specificity/carousel.png)](/docs/tools/sequence-scoring/na-mpnn-specificity) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/tool/blast/carousel.png)](/docs/tools/sequence-alignment/blast) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/tool/sequence_fetch/carousel.png)](/docs/tools/database-retrieval/sequence-fetch) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/tool/structure_metrics/carousel.png)](/docs/tools/structure-scoring/structure-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/carousel.png)](/docs/tools/sequence-scoring/borzoi) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/carousel.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/puffin/carousel.png)](/docs/tools/sequence-scoring/puffin) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/foldmason/carousel.png)](/docs/tools/structure-alignment/foldmason) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/tool/ipsae/carousel.png)](/docs/tools/structure-scoring/ipsae) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/pubchem/carousel.png)](/docs/tools/database-retrieval/pubchem) [![](https://proto-bio.github.io/proto-assets/images/tool/pdb/carousel.png)](/docs/tools/database-retrieval/pdb) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/tool/pangolin/carousel.png)](/docs/tools/rna-splicing/pangolin) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/optimizer/mcmc/carousel.png)](/docs/language/optimizers/mcmc) [![](https://proto-bio.github.io/proto-assets/images/tool/meme/carousel.png)](/docs/tools/gene-annotation/meme) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/foldmason/carousel.png)](/docs/tools/structure-alignment/foldmason) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/tool/pymol_rmsd/carousel.png)](/docs/tools/structure-alignment/pymol-rmsd) [![](https://proto-bio.github.io/proto-assets/images/tool/alphamissense_db/carousel.png)](/docs/tools/database-retrieval/alphamissense-db) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/tool/evo1/carousel.png)](/docs/tools/causal-models/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/opendde/carousel.png)](/docs/tools/structure-prediction/opendde) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/bindcraft/carousel.png)](/docs/tools/binder-design/bindcraft) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/tool/netmhcpan/carousel.png)](/docs/tools/epitope-prediction/netmhcpan) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/tool/rfam/carousel.png)](/docs/tools/database-retrieval/rfam) [![](https://proto-bio.github.io/proto-assets/images/tool/enformer/carousel.png)](/docs/tools/sequence-scoring/enformer) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/optimizer/gradient/carousel.png)](/docs/language/optimizers/gradient) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/tool/mafft/carousel.png)](/docs/tools/sequence-alignment/mafft) [![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/carousel.png)](/docs/tools/inverse-folding/esm-if1) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/esmc/carousel.png)](/docs/tools/masked-models/esmc) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/evo1/carousel.png)](/docs/tools/causal-models/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/progen3/carousel.png)](/docs/tools/causal-models/progen3) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/progen2/carousel.png)](/docs/tools/causal-models/progen2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/primer3/carousel.png)](/docs/tools/sequence-scoring/primer3) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/carousel.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/vina/carousel.png)](/docs/tools/molecular-docking/vina) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/tool/esm_if1/carousel.png)](/docs/tools/inverse-folding/esm-if1) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/x3dna/carousel.png)](/docs/tools/structure-prediction/x3dna) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/rfdiffusion3/carousel.png)](/docs/tools/structure-design/rfdiffusion3) [![](https://proto-bio.github.io/proto-assets/images/tool/random_protein/carousel.png)](/docs/tools/mutagenesis/random-protein) [![](https://proto-bio.github.io/proto-assets/images/tool/esm3/carousel.png)](/docs/tools/masked-models/esm3) [![](https://proto-bio.github.io/proto-assets/images/tool/evo2/carousel.png)](/docs/tools/causal-models/evo2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/optimizer/genetic-algorithm/carousel.png)](/docs/language/optimizers/genetic-algorithm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/cycling/carousel.png)](/docs/language/optimizers/cycling) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai/carousel.png)](/docs/tools/rna-splicing/spliceai) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/usalign/carousel.png)](/docs/tools/structure-alignment/usalign) [![](https://proto-bio.github.io/proto-assets/images/tool/na_mpnn_specificity/carousel.png)](/docs/tools/sequence-scoring/na-mpnn-specificity) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/tool/blast/carousel.png)](/docs/tools/sequence-alignment/blast) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/tool/sequence_fetch/carousel.png)](/docs/tools/database-retrieval/sequence-fetch) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/tool/structure_metrics/carousel.png)](/docs/tools/structure-scoring/structure-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/carousel.png)](/docs/tools/sequence-scoring/borzoi) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/carousel.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/puffin/carousel.png)](/docs/tools/sequence-scoring/puffin) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/foldmason/carousel.png)](/docs/tools/structure-alignment/foldmason) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/tool/ipsae/carousel.png)](/docs/tools/structure-scoring/ipsae) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/ncbi/carousel.png)](/docs/tools/database-retrieval/ncbi) [![](https://proto-bio.github.io/proto-assets/images/tool/pubchem/carousel.png)](/docs/tools/database-retrieval/pubchem) [![](https://proto-bio.github.io/proto-assets/images/tool/pdb/carousel.png)](/docs/tools/database-retrieval/pdb) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/tool/pangolin/carousel.png)](/docs/tools/rna-splicing/pangolin) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/optimizer/mcmc/carousel.png)](/docs/language/optimizers/mcmc) [![](https://proto-bio.github.io/proto-assets/images/tool/meme/carousel.png)](/docs/tools/gene-annotation/meme) [![](https://proto-bio.github.io/proto-assets/images/tool/germinal/carousel.png)](/docs/tools/binder-design/germinal) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/carousel.png)](/docs/tools/structure-prediction/protenix) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/optimizer/beam-search/carousel.png)](/docs/language/optimizers/beam-search) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/carousel.png)](/docs/tools/structure-prediction/alphafold2) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/carousel.png)](/docs/tools/orf-prediction/orfipy) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/metal3d/carousel.png)](/docs/tools/structure-scoring/metal3d) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/tool/progen3/carousel.png)](/docs/tools/causal-models/progen3) [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/tool/prodigal/carousel.png)](/docs/tools/orf-prediction/prodigal) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai2/carousel.png)](/docs/tools/rna-splicing/spliceai2) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/carousel.png)](/docs/tools/structure-prediction/viennarna) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/ccd_lookup/carousel.png)](/docs/tools/database-retrieval/ccd-lookup) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/malinois/carousel.png)](/docs/tools/sequence-scoring/malinois) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/tool/pdockq2/carousel.png)](/docs/tools/structure-scoring/pdockq2) [![](https://proto-bio.github.io/proto-assets/images/tool/rf3/carousel.png)](/docs/tools/structure-prediction/rf3) [![](https://proto-bio.github.io/proto-assets/images/tool/malinois/carousel.png)](/docs/tools/sequence-scoring/malinois) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/bioemu/carousel.png)](/docs/tools/structure-dynamics/bioemu) [![](https://proto-bio.github.io/proto-assets/images/tool/random_nucleotide/carousel.png)](/docs/tools/mutagenesis/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/tool/pangolin/carousel.png)](/docs/tools/rna-splicing/pangolin) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/pdb/carousel.png)](/docs/tools/database-retrieval/pdb) [![](https://proto-bio.github.io/proto-assets/images/tool/segmasker/carousel.png)](/docs/tools/sequence-scoring/segmasker) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/tool/rfam/carousel.png)](/docs/tools/database-retrieval/rfam) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai/carousel.png)](/docs/tools/rna-splicing/spliceai) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/tool/blast/carousel.png)](/docs/tools/sequence-alignment/blast) [![](https://proto-bio.github.io/proto-assets/images/tool/chai1/carousel.png)](/docs/tools/structure-prediction/chai1) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/tool/progen2/carousel.png)](/docs/tools/causal-models/progen2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/carousel.png)](/docs/tools/structure-prediction/alphafold2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold_db/carousel.png)](/docs/tools/database-retrieval/alphafold-db) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/splice_transformer/carousel.png)](/docs/tools/rna-splicing/splice-transformer) [![](https://proto-bio.github.io/proto-assets/images/tool/dssp/carousel.png)](/docs/tools/structure-scoring/dssp) [![](https://proto-bio.github.io/proto-assets/images/tool/uniprot/carousel.png)](/docs/tools/database-retrieval/uniprot) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/tool/interproscan/carousel.png)](/docs/tools/database-retrieval/interproscan) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/tool/promoter_calculator/carousel.png)](/docs/tools/gene-annotation/promoter-calculator) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) [![](https://proto-bio.github.io/proto-assets/images/tool/esmc/carousel.png)](/docs/tools/masked-models/esmc) [![](https://proto-bio.github.io/proto-assets/images/tool/crispr_tracr_rna/carousel.png)](/docs/tools/gene-annotation/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/puffin/carousel.png)](/docs/tools/sequence-scoring/puffin) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png)](/docs/tools/structure-prediction/esmfold2) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/miranda/carousel.png)](/docs/tools/gene-annotation/miranda) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/tool/netmhcpan/carousel.png)](/docs/tools/epitope-prediction/netmhcpan) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/rejection-sampling/carousel.png)](/docs/language/optimizers/rejection-sampling) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/minced/carousel.png)](/docs/tools/gene-annotation/minced) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/tool/tmalign/carousel.png)](/docs/tools/structure-alignment/tmalign) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/tool/evo2/carousel.png)](/docs/tools/causal-models/evo2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/carousel.png)](/docs/tools/sequence-scoring/borzoi) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/deeppbs_specificity/carousel.png)](/docs/tools/sequence-scoring/deeppbs-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/tool/freebindcraft/carousel.png)](/docs/tools/binder-design/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai2/carousel.png)](/docs/tools/rna-splicing/spliceai2) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/tool/germinal/carousel.png)](/docs/tools/binder-design/germinal) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/carousel.png)](/docs/tools/structure-prediction/protenix) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/optimizer/beam-search/carousel.png)](/docs/language/optimizers/beam-search) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/carousel.png)](/docs/tools/structure-prediction/alphafold2) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/carousel.png)](/docs/tools/orf-prediction/orfipy) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/metal3d/carousel.png)](/docs/tools/structure-scoring/metal3d) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/tool/progen3/carousel.png)](/docs/tools/causal-models/progen3) [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/tool/prodigal/carousel.png)](/docs/tools/orf-prediction/prodigal) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai2/carousel.png)](/docs/tools/rna-splicing/spliceai2) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/carousel.png)](/docs/tools/structure-prediction/viennarna) [![](https://proto-bio.github.io/proto-assets/images/tool/genomic_intelligence/carousel.png)](/docs/tools/sequence-scoring/genomic-intelligence) [![](https://proto-bio.github.io/proto-assets/images/tool/ccd_lookup/carousel.png)](/docs/tools/database-retrieval/ccd-lookup) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/malinois/carousel.png)](/docs/tools/sequence-scoring/malinois) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/caliby/carousel.png)](/docs/tools/inverse-folding/caliby) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/tool/pdockq2/carousel.png)](/docs/tools/structure-scoring/pdockq2) [![](https://proto-bio.github.io/proto-assets/images/tool/rf3/carousel.png)](/docs/tools/structure-prediction/rf3) [![](https://proto-bio.github.io/proto-assets/images/tool/malinois/carousel.png)](/docs/tools/sequence-scoring/malinois) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/bioemu/carousel.png)](/docs/tools/structure-dynamics/bioemu) [![](https://proto-bio.github.io/proto-assets/images/tool/random_nucleotide/carousel.png)](/docs/tools/mutagenesis/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) [![](https://proto-bio.github.io/proto-assets/images/tool/minerva/carousel.png)](/docs/tools/masked-models/minerva) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/tool/pangolin/carousel.png)](/docs/tools/rna-splicing/pangolin) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/tool/foldseek/carousel.png)](/docs/tools/structure-alignment/foldseek) [![](https://proto-bio.github.io/proto-assets/images/tool/pdb/carousel.png)](/docs/tools/database-retrieval/pdb) [![](https://proto-bio.github.io/proto-assets/images/tool/segmasker/carousel.png)](/docs/tools/sequence-scoring/segmasker) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/tool/rfam/carousel.png)](/docs/tools/database-retrieval/rfam) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai/carousel.png)](/docs/tools/rna-splicing/spliceai) [![](https://proto-bio.github.io/proto-assets/images/tool/esm2/carousel.png)](/docs/tools/masked-models/esm2) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/tool/blast/carousel.png)](/docs/tools/sequence-alignment/blast) [![](https://proto-bio.github.io/proto-assets/images/tool/chai1/carousel.png)](/docs/tools/structure-prediction/chai1) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/tool/progen2/carousel.png)](/docs/tools/causal-models/progen2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/carousel.png)](/docs/tools/structure-prediction/alphafold2) [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold_db/carousel.png)](/docs/tools/database-retrieval/alphafold-db) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/splice_transformer/carousel.png)](/docs/tools/rna-splicing/splice-transformer) [![](https://proto-bio.github.io/proto-assets/images/tool/dssp/carousel.png)](/docs/tools/structure-scoring/dssp) [![](https://proto-bio.github.io/proto-assets/images/tool/uniprot/carousel.png)](/docs/tools/database-retrieval/uniprot) [![](https://proto-bio.github.io/proto-assets/images/tool/parade/carousel.png)](/docs/tools/sequence-scoring/parade) [![](https://proto-bio.github.io/proto-assets/images/tool/interproscan/carousel.png)](/docs/tools/database-retrieval/interproscan) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/carousel.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/tool/promoter_calculator/carousel.png)](/docs/tools/gene-annotation/promoter-calculator) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) [![](https://proto-bio.github.io/proto-assets/images/tool/esmc/carousel.png)](/docs/tools/masked-models/esmc) [![](https://proto-bio.github.io/proto-assets/images/tool/crispr_tracr_rna/carousel.png)](/docs/tools/gene-annotation/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) [![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/carousel.png)](/docs/tools/structure-scoring/pyrosetta) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/carousel.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/puffin/carousel.png)](/docs/tools/sequence-scoring/puffin) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png)](/docs/tools/structure-prediction/esmfold2) [![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/carousel.png)](/docs/tools/masked-models/codonfm) [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/carousel.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/miranda/carousel.png)](/docs/tools/gene-annotation/miranda) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/tool/netmhcpan/carousel.png)](/docs/tools/epitope-prediction/netmhcpan) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/rejection-sampling/carousel.png)](/docs/language/optimizers/rejection-sampling) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) [![](https://proto-bio.github.io/proto-assets/images/tool/cherimoya/carousel.png)](/docs/tools/sequence-scoring/cherimoya) [![](https://proto-bio.github.io/proto-assets/images/tool/minced/carousel.png)](/docs/tools/gene-annotation/minced) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/tool/tmalign/carousel.png)](/docs/tools/structure-alignment/tmalign) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/carousel.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/tool/evo2/carousel.png)](/docs/tools/causal-models/evo2) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/carousel.png)](/docs/tools/sequence-scoring/borzoi) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/tool/ensembl/carousel.png)](/docs/tools/database-retrieval/ensembl) [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) [![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/carousel.png)](/docs/tools/sequence-scoring/alphagenome) [![](https://proto-bio.github.io/proto-assets/images/tool/deeppbs_specificity/carousel.png)](/docs/tools/sequence-scoring/deeppbs-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/tool/freebindcraft/carousel.png)](/docs/tools/binder-design/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/tool/glm2/carousel.png)](/docs/tools/masked-models/glm2) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/tool/spliceai2/carousel.png)](/docs/tools/rna-splicing/spliceai2) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/tool/ablang/carousel.png)](/docs/tools/masked-models/ablang) The Open-Source Infrastructure Layer for Biology ![Proto: Programmable Biology](https://mintcdn.com/bio-pro/VLNkgxoxgM46WcoV/assets/images/hero-light.png?fit=max\&auto=format\&n=VLNkgxoxgM46WcoV\&q=85\&s=4d81a83451d488abbdb920f3d82e7281) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/evo-design/proto-tools/blob/main/LICENSE) [![bioRxiv](https://img.shields.io/badge/bioRxiv-2026.06.22.733870-b31b1b.svg)](https://www.biorxiv.org/content/10.64898/2026.06.22.733870) [![Modal](https://img.shields.io/badge/Modal-ready--to--deploy-brightgreen?logo=modal\&logoColor=white)](/docs/tools/modal-integration) [![Arc Institute blog](https://img.shields.io/badge/Blog-0073E6?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAADrElEQVR42u2WX4jUVRTHv%2Bf%2BfjM7iqXWmFZGmWEFWiBR%2BxBBsSY9CFKQGT1ElKhsEuRrEVFPGVu2RpsplWGUCWbURpkSYZtDEj4oKmYvGxHUruui7czvz6eHuTPzm3HsaQSD%2BcIMzJl77znf7zn33CN10UUX%2F39YqwFvMS6xZ%2BySMCCnuGqztDMOXObwQFKfftUxHdVxHsYIOiwKxiz%2BoIrvJVyndQ8kdhJRJiZmSYddYBJFxoCUCBiQCNsyDaviYYTNQhIQ4jBcbU12YyixnjJfAxHwJzObqwkjvDgnrLXyWtbiJE7wObcACRHwZDsOXMdjfMprGDN4hRHeoafGg%2FsYosRJfmCQB5rCI5BYDKyUOAxUgIONKDCMhWzkSyYA2CYxDEDKHEliPnuBw6ynn1EANrcKNMQ40zDWAhEJCUt9%2BYoA40HOATBFxEs8BJSBCeZK3MRvwCf%2BtIVMkgArsgkuMMlmCeNqxjyHLQ2RMInZHCChDLzNUeAcE4xSxPEj8DfXSOQJJY4QU%2BHNevwYq4DbJfISW72Dv7iqoSR5iXeBCinjlFjFAuYwV%2BIJIGF3na9xEoD%2BbIJ%2F4oiEI8DorSd6TYZDiPEBMEXKPnIZgUdIgeex6lqM99jPFgqN4xcAT2PkCMlJHPQcSlg90aHE%2B8A%2FwCaJgg%2FnBqZIgNUXVp2rf69VRZ%2FJWWSxRTh9I8mU6i7dLdp0pQKm2FLJ0CL1KG5unbiq81DClBDoKX1hZySu1Uqt0B0KlShUrFDP2CHa3itq%2FXieJCRloq91Y%2Bc%2Fy1XUCyxmj47rOZ1Sv5Zqp9%2F2CEVL%2FvN9cH7lrW3vMoHEML8zxFk%2Bprf%2B5z31RD%2Fr9c%2Fm4C3%2FO5BY5vN1qFZF2eOdxHwmgRGW1KslIMAo%2BY2%2F4LCLOKjunwJi4H6JHq9%2FIHFbddFG4HV%2FdLZi1vgbDfdiBE0OBmsVg5P4jpQKKae4McPgUU6InMRpfq7dwKbGW2Tcc%2FhQIk%2BekO3ewRsEFDAvUh9QIQZG2cCd3EwfA8C6agdM2dW2AecZJaJMhTGu97YdREwSsb3loRoAUsr%2BPTwPwFeS%2BIgEgBKDLPKEHcZytnKaBs6wgWXsyFi%2BZRNF32cDiZeJyGIvs3ChAm1TLGmGisrXithSrtCVOqBhmZAp0XT1aJrO6tV64DM1XYGfoRKcvchuPa5ezdN5HdMe29W54acxlaj5BZGsqXckjXkOp9bHEXGBLclOgDg5pZZWnVlymc%2BEXXTRxeWDfwGkGF0Pfq%2BibAAAAABJRU5ErkJggg%3D%3D)](https://arcinstitute.org/news/proto) Proto is a high-level programming language for biology. Design DNA, RNA, and protein sequences with constraint-based optimization, composing computational and AI models into a single workflow. ## Components > **[Language](/docs/language/introduction)** > > A constraint-based optimization framework for designing DNA, RNA, and protein sequences. Declare what you want, compose generators and scorers, and chain optimization stages into pipelines. > **[Tools](/docs/tools/introduction)** > > Computational biology and biological AI tools through a single, consistent Python interface. Structure prediction, inverse folding, language models, sequence analysis, and more. > **[MCP](/docs/mcp/introduction)** > > An agent exchanging messages with Proto over MCP > > Connect Claude, ChatGPT, and other AI assistants to the Proto tool catalog over the Model Context Protocol. Run tools on your own compute from a conversation. ## Citation If you use Proto in your research, please cite our preprint: > Merchant AT, Guo D, Viggiano B, Brennan-Almaraz LE, Hur E, Mai T, Yin P, King SH, Ashley E, Hie BL. **A high-level programming language for generative biology with Proto.** *bioRxiv* (2026). doi: [10.64898/2026.06.22.733870](https://doi.org/10.64898/2026.06.22.733870) ```bibtex theme={null} @article{Merchant2026.06.22.733870, author = {Merchant, Aditi T and Guo, Daniel and Viggiano, Ben and Brennan-Almaraz, Lucas Emmanuel and Hur, Evelyn and Mai, Tina and Yin, Peter and King, Samuel H and Ashley, Euan and Hie, Brian L}, title = {A high-level programming language for generative biology with Proto}, elocation-id = {2026.06.22.733870}, year = {2026}, doi = {10.64898/2026.06.22.733870}, publisher = {Cold Spring Harbor Laboratory}, URL = {https://www.biorxiv.org/content/10.64898/2026.06.22.733870}, journal = {bioRxiv} } ``` ## Get Started > **[Language: Installation](/docs/language/installation)** > > Set up the optimization framework > **[Language: Quickstart](/docs/language/quickstart)** > > Design your first sequence > **[Tools: Installation](/docs/tools/installation)** > > Set up the bioinformatics tools library > **[Tools: Quickstart](/docs/tools/guides/quickstart)** > > Run your first tool ## Acknowledgements Thank you to [![](https://github.com/modal-labs.png?size=40) Modal](https://modal.com) for sponsoring the compute used to develop and test the remote execution layer, and for making it straightforward to host the tool catalog. Thank you to [![](https://www.stanford.edu/icon1.png) Stanford University](https://www.stanford.edu) and the [![](https://github.com/arcinstitute.png?size=40) Arc Institute](https://arcinstitute.org) for supporting this work's development. Thank you to everyone who has contributed to Proto. Contributions of every size are welcome; see the contributing guides for [proto-language](https://github.com/evo-design/proto-language/blob/main/CONTRIBUTING.md) and [proto-tools](https://github.com/evo-design/proto-tools/blob/main/CONTRIBUTING.md) to get started. # Constraints Source: https://proto.evodesign.org/docs/language/concepts/constraints Scoring functions that encode design requirements as values the optimizer minimizes [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) # Constraints A constraint encodes a biological requirement, such as a GC-content range, protein folding confidence, structural similarity, or motif presence, as a scoring function that the [optimizer](/docs/language/concepts/optimizers) minimizes. Every constraint answers one question about a proposal sequence: **how far is it from the requirement?** The answer is a score between `0.0` (perfect) and `1.0` (worst). The optimizer combines all constraint scores into a single **energy** value and searches for sequences that minimize it. ## The Scoring Model Proto uses a unified scoring model where all constraints return values on the same `[0.0, 1.0]` scale: ``` Perfect Worst |------------------------------------------| 0.0 0.5 1.0 GC content GC 5% outside GC 20% outside in range target range target range ``` The optimizer combines scores into a single energy: ``` Energy = Sigma(weight_i x score_i) ``` **Lower energy is better.** A sequence with energy `0.0` satisfies all constraints perfectly. ```python python icon="python" theme={null} # Example: Three constraints with different weights # If a proposal scores 0.1 on GC, 0.3 on structure, 0.0 on homopolymer: # # Energy = (1.0 x 0.1) + (2.0 x 0.3) + (1.0 x 0.0) = 0.7 ``` ## Two Modes: Scoring vs Filtering Constraints operate in one of two mutually exclusive modes: ### Scoring Mode (Soft) Uses `weight` to control relative importance. Returns a float score that contributes to the total energy. * Guides optimization toward better solutions * Allows trade-offs between constraints * Default mode (`weight=1.0`) ```python python icon="python" theme={null} # Target: GC content near 50-60% Constraint( inputs=[segment], function=gc_content_constraint, function_config={"min_gc": 50, "max_gc": 60}, weight=2.0, # 2x importance ) ``` ### Filter Mode (Hard) Uses `threshold` to create a binary pass/fail gate: a proposal passes when `score <= threshold`, otherwise it is rejected. * Proposals that fail are immediately rejected * Rejected proposals skip all scoring constraints * Saves compute on expensive evaluations ```python python icon="python" theme={null} # "Homopolymers MUST be <= 4bp" Constraint( inputs=[segment], function=max_homopolymer_constraint, function_config={"max_length": 4}, threshold=0.0, # score must be <= 0.0 ) ``` > [!WARNING] > > `weight` and `threshold` are mutually exclusive. A constraint is either a weighted scorer OR a binary filter, never both. Setting both raises a `ValueError`. ## The Evaluation Pipeline When the optimizer calls `score_energy()`, constraints are evaluated in a specific order designed to reject bad proposals early and save expensive computation: Constraint evaluation pipeline: filters reject early, then weighted scores sum to an energy **Key insight:** Filter constraints run *before* scoring constraints. Rejected proposals skip expensive scoring entirely (like GPU-based structure prediction). Use cheap filters to screen out bad proposals before expensive scoring kicks in. > [!TIP] > > **GPU memory and constraints:** Constraint functions receive all passing proposals in a single batch call (the full `List[Tuple[Sequence, ...]]`), not one at a time. Unlike generators, constraints have no framework-level `batch_size` parameter; GPU memory management is handled internally by each tool. For example, ESMFold splits by total residue count (`max_batch_residues`), while Boltz2 and AlphaFold3 process complexes sequentially. Memory usage can be controlled via tool-specific config fields (e.g., `max_batch_residues` for ESMFold) rather than a constraint-level batch size. ## Creating Constraints ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import gc_content_constraint constraint = Constraint( inputs=[segment], # Segments to evaluate function=gc_content_constraint, # The scoring function function_config={"min_gc": 50, "max_gc": 60}, # Config (dict or Pydantic model) label="gc_content", # Optional label for tracking weight=1.0, # Relative importance (scoring mode) ) ``` ### Key Parameters **inputs** `List[Segment]` *required* The segments this constraint evaluates. Single-segment constraints get one sequence per proposal. Multi-segment constraints get a tuple of sequences (one per segment), enabling cross-segment evaluations like protein-protein interactions. **function** `Callable` *required* The scoring function from the constraint registry. Must accept `(input_sequences: list[tuple[Sequence, ...]], config)` and return `list[ConstraintOutput]`, one per proposal, each with a `score` in `[0.0, 1.0]`. **function\_config** `dict | BaseModel` *required* Configuration for the scoring function. Can be a dictionary (auto-validated against the function's Pydantic config class) or a Pydantic model instance. **label** `str` (default: function.**name**) Label used for metadata tracking and result export. Defaults to the function name. **weight** `float` (default: 1.0) Multiplier for the raw score in energy calculation. Only used in scoring mode. Mutually exclusive with `threshold`. **threshold** `float` (default: None) If set, converts this to a filter constraint. Proposals with `score <= threshold` pass; others are rejected. Mutually exclusive with `weight`. ## Constraint Categories Proto provides built-in constraints organized by what they measure: > **Sequence Composition** > > GC content, k-mer frequency, homopolymer runs, and more > > *DNA/RNA sequence properties* > **Protein Quality** > > Length, complexity, amino acid balance, and more > > *Protein sanity checks* > **Protein Structure** > > Folding confidence, structural similarity, binding strength, and more > > *3D folding and structural similarity* > **Sequence Annotation** > > Motif search, promoter strength, sequence similarity, and more > > *Functional element detection* > **RNA Secondary Structure** > > Structure similarity, property matching, and more > > *RNA folding patterns* > **RNA Splicing** > > Splicing prediction and tissue specificity > > *Splicing prediction* > **Sequence Alignment** > > Alignment quality metrics > > *Alignment scoring* See the [Constraint Reference](/docs/language/constraints/gc-content) for the full list of built-in constraints and their configuration options. ## Common Constraint Patterns **DNA Construct** A typical DNA construct optimization with sequence composition constraints: ```python python icon="python" theme={null} from proto_language.constraint import ( gc_content_constraint, max_homopolymer_constraint, kmer_frequency_constraint, specific_kmer_constraint, ) constraints = [ # Soft: optimize GC content toward 45-55% Constraint( inputs=[segment], function=gc_content_constraint, function_config={"min_gc": 45, "max_gc": 55}, weight=1.0, ), # Hard filter: no homopolymer runs > 4bp Constraint( inputs=[segment], function=max_homopolymer_constraint, function_config={"max_length": 4}, threshold=0.0, ), # Soft: keep any single 6-mer below 5% frequency Constraint( inputs=[segment], function=kmer_frequency_constraint, function_config={"k": 6, "min_value": 0.0, "max_value": 0.05}, weight=0.5, ), # Hard filter: must NOT contain EcoRI site (GAATTC frequency must be 0) Constraint( inputs=[segment], function=specific_kmer_constraint, function_config={"kmer": "GAATTC", "min_value": 0.0, "max_value": 0.0}, threshold=0.0, ), ] ``` **Protein Design** A protein design workflow with structure prediction constraints: ```python python icon="python" theme={null} from proto_language.constraint import ( structure_plddt_constraint, structure_rmsd_constraint, protein_complexity_constraint, protein_repetitiveness_constraint, ) constraints = [ # Hard filter: reject badly folded proteins early. # The pLDDT constraint returns 1 - normalized pLDDT (lower is better), # so threshold=0.3 keeps only high-confidence folds. Constraint( inputs=[protein_segment], function=structure_plddt_constraint, function_config={"structure_tool": "esmfold"}, threshold=0.3, ), # Soft: optimize toward target structure (most important) Constraint( inputs=[protein_segment], function=structure_rmsd_constraint, function_config={ "target_structure": "target.pdb", "structure_tool": "esmfold", }, weight=3.0, # 3x importance ), # Soft: avoid low-complexity sequences Constraint( inputs=[protein_segment], function=protein_complexity_constraint, function_config={}, weight=0.5, ), # Soft: avoid repetitive regions Constraint( inputs=[protein_segment], function=protein_repetitiveness_constraint, function_config={}, weight=0.5, ), ] ``` **Multi-Segment** Constraints that evaluate multiple segments together (e.g., protein-protein interactions): ```python python icon="python" theme={null} from proto_language.constraint import ( boltz_binding_strength_constraint, structure_plddt_constraint, ) binder = Segment(length=80, sequence_type="protein", label="binder") target = Segment(length=150, sequence_type="protein", label="target") constraints = [ # Evaluate binding between two protein segments Constraint( inputs=[binder, target], # Multi-segment input function=boltz_binding_strength_constraint, function_config={}, weight=2.0, ), # Each segment also gets its own folding quality check Constraint( inputs=[binder], function=structure_plddt_constraint, function_config={"structure_tool": "esmfold"}, weight=1.0, ), ] ``` ## Metadata Propagation After evaluation, constraints write detailed results back to each sequence's metadata. This shows *why* a sequence got its score: ```python python icon="python" theme={null} # After running the optimizer... sequence = segment.result_sequences[0] # Access constraint metadata gc_data = sequence.metadata["constraints"]["gc_content_constraint"] # Standard fields gc_data["score"] # 0.12 (raw score before weighting) gc_data["weight"] # 1.0 gc_data["weighted_score"] # 0.12 (score x weight) # Custom data from the scoring function gc_data["data"]["gc_content"] # 52.3 (the actual GC percentage) ``` > **Full Metadata Structure** > > The metadata structure varies by constraint mode and number of input segments: > > **Single-segment scoring constraint:** > > ```python python icon="python" theme={null} > sequence.metadata["constraints"]["gc_content_constraint"] = { > "score": 0.12, > "weight": 1.0, > "weighted_score": 0.12, > "data": { > "gc_content": 52.3 > } > } > ``` > > **Multi-segment constraint** (additional linking info): > > ```python python icon="python" theme={null} > protein_a.metadata["constraints"]["binding_constraint"] = { > "score": 0.05, > "weight": 2.0, > "weighted_score": 0.10, > "input_segments": ["construct_0.binder", "construct_0.target"], > "position_in_inputs": 0, > "data": { > "binding_energy": -8.2 > } > } > ``` > > The `data` field contains constraint-specific metrics that vary by function. It exposes the *actual measured values* (GC percentage, pLDDT score, RMSD in angstroms) rather than just the normalized score. ## Custom Constraints A constraint function can be defined without using the registry decorator: ```python python icon="python" theme={null} def my_custom_constraint(input_sequences, config) -> list[ConstraintOutput]: """Score sequences by how close their length is to a target.""" results = [] for (seq,) in input_sequences: # Single-segment: unpack 1-tuple actual = len(seq.sequence) target = config["target_length"] deviation = abs(actual - target) / target # Scoring functions return one ConstraintOutput per input: score in # [0.0, 1.0] (0 = perfect) plus optional diagnostic metadata. results.append(ConstraintOutput(score=min(deviation, 1.0), metadata={"length": actual})) return results constraint = Constraint( inputs=[segment], function=my_custom_constraint, function_config={"target_length": 200}, ) ``` > [!NOTE] > > Custom constraint functions must return a `list[ConstraintOutput]`, one per input tuple, each with `score` in `[0.0, 1.0]` (0 = perfect) plus optional `metadata`. Add `from proto_language import ConstraintOutput`. Returning bare floats raises a `TypeError` at evaluation, and a non-finite score raises a `ValueError`. ## Next Steps > **[Optimizers](/docs/language/concepts/optimizers)** > > Learn how optimizers use constraints to search for optimal sequences > **[Tools](/docs/language/concepts/tools)** > > The bioinformatics tools that power constraint evaluation > **[Constraint Reference](/docs/language/constraints/gc-content)** > > Full API reference for every built-in constraint > **[Programs](/docs/language/concepts/programs)** > > Compose multi-stage pipelines with progressive constraints ## Constraint Catalog ### Protein Quality [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) ### Protein Structure [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) ### RNA Expression [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) ### RNA Secondary Structure [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) ### RNA Splicing [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) ### Sequence Alignment [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) ### Sequence Annotation [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) ### Sequence Composition [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) ### Sequence Scoring [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) # Constructs Source: https://proto.evodesign.org/docs/language/concepts/constructs Combining segments into complete biological designs # Constructs A **Construct** is an ordered collection of [Segments](/docs/language/concepts/segments) representing a complete biological design. Just as a gene is assembled from regulatory and coding parts (a promoter, ribosome binding site, coding sequence, and terminator), a Construct assembles Segment objects into a coherent whole. Construct assembling ordered segments The Construct handles validation (all segments must share the same type), auto-labeling, and, crucially, **joined sequence concatenation**, which gives the full designed sequence after optimization. *** ## Creating Constructs Pass an ordered list of Segments to create a Construct: ```python python icon="python" theme={null} from proto_language.core import Segment, Construct promoter = Segment(length=100, sequence_type="dna", label="promoter") rbs = Segment(sequence="AGGAGG", sequence_type="dna", label="rbs") cds = Segment(length=900, sequence_type="dna", label="cds") terminator = Segment(length=50, sequence_type="dna", label="terminator") gene_construct = Construct( [promoter, rbs, cds, terminator], label="gene_construct" ) ``` Segment order matters; it defines the physical arrangement of the final biological sequence. *** ## Validation Rules Constructs enforce several rules at creation time to catch design errors early: > [!WARNING] > > **All segments must share the same sequence type.** DNA and protein segments cannot be mixed in one Construct. To represent a gene and its protein product, use separate Constructs. > [!WARNING] > > **All segments must share the same valid character set.** If one segment uses custom `valid_chars`, all segments in the Construct must use the same set. > [!WARNING] > > **Segment labels must be unique** within a Construct. Duplicate labels cause a `ValueError`. ```python python icon="python" theme={null} # Valid: all DNA segments construct = Construct([ Segment(length=50, sequence_type="dna", label="upstream"), Segment(length=100, sequence_type="dna", label="target"), ]) # Invalid: mixed types -> raises ValueError construct = Construct([ Segment(length=50, sequence_type="dna", label="gene"), Segment(length=100, sequence_type="protein", label="protein"), # Error! ]) # Invalid: duplicate labels -> raises ValueError construct = Construct([ Segment(length=50, sequence_type="dna", label="region"), Segment(length=100, sequence_type="dna", label="region"), # Error! ]) ``` *** ## Joined Sequences The most important property of a Construct is `joined_sequences`. After optimization, this gives the full concatenated sequence from all segments, with merged metadata from each segment. Joined sequences concatenated from segment results ```python python icon="python" theme={null} # After optimization, get the full sequences for seq in construct.joined_sequences: print(f"Full sequence ({len(seq)} bp): {seq.sequence[:50]}...") print(f"Segments: {list(seq.metadata.get('segments', {}).keys())}") ``` ### Multiple Results (Top-K) When the optimizer selects multiple results per segment (e.g., top-3), `joined_sequences` pairs them by index: ```python python icon="python" theme={null} # If each segment has 3 result sequences: # segment_1.result_sequences = [Seq("AAA"), Seq("TTT"), Seq("GGG")] # segment_2.result_sequences = [Seq("CCC"), Seq("AAA"), Seq("TTT")] construct.joined_sequences # [Sequence("AAACCC"), # index 0 from each segment # Sequence("TTTAAA"), # index 1 from each segment # Sequence("GGGTTT")] # index 2 from each segment ``` > [!NOTE] > > All segments in a Construct must have the **same number** of result sequences. `joined_sequences` raises a `RuntimeError` if the per-segment result pools have mismatched lengths. *** ## Auto-Labeling Both Constructs and Segments support automatic labeling: ```python python icon="python" theme={null} # Unlabeled segments get position-based labels construct = Construct([ Segment(length=50, sequence_type="dna"), # -> "segment_0" Segment(length=100, sequence_type="dna"), # -> "segment_1" Segment(length=30, sequence_type="dna", label="my_term"), # -> "my_term" ]) construct.segments[0].label # "segment_0" construct.segments[2].label # "my_term" ``` > [!TIP] > > Always provide explicit labels for clarity. They appear in constraint metadata and make optimization results easier to interpret. *** ## Biological Design Patterns **Gene Expression** The classic pattern for designing gene circuits: promoter, RBS, coding sequence, and terminator in series. ```python python icon="python" theme={null} # Bacterial gene promoter = Segment(length=100, sequence_type="dna", label="promoter") rbs = Segment(sequence="AGGAGG", sequence_type="dna", label="rbs") cds = Segment(length=900, sequence_type="dna", label="cds") terminator = Segment( sequence="AACAAAATCGCAATGATTTCGATTTTAAAAGGTCTG", sequence_type="dna", label="terminator" ) gene_construct = Construct( [promoter, rbs, cds, terminator], label="gene_construct" ) ``` Use cross-segment constraints to evaluate predicted expression levels considering all elements together. **Multi-Domain Protein** Design fusion proteins with fixed structural elements and variable functional domains. ```python python icon="python" theme={null} # Antibody-like fusion protein signal = Segment( sequence="MKFLILLFNILCLFPVLAAD", sequence_type="protein", label="signal_peptide" ) vh = Segment(length=120, sequence_type="protein", label="vh_domain") linker = Segment( sequence="GGGGSGGGGSGGGGS", sequence_type="protein", label="linker" ) vl = Segment(length=110, sequence_type="protein", label="vl_domain") scfv = Construct( [signal, vh, linker, vl], label="scfv_construct" ) ``` The linker and signal peptide are fixed; only the VH and VL domains are optimized. **CRISPR System** Design guide RNA components with fixed scaffold and variable spacer. ```python python icon="python" theme={null} # CRISPR-Cas9 guide RNA spacer = Segment(length=20, sequence_type="rna", label="spacer") scaffold = Segment( sequence="GUUUUAGAGCUAGAAAUAGCAAGUUAAAAUAAGGCUAGUCCGUUAUCAACUUGAAAAAGUGGCACCGAGUCGGUGC", sequence_type="rna", label="scaffold" ) guide_rna = Construct( [spacer, scaffold], label="sgrna" ) ``` Only the spacer is optimized; the scaffold stays constant. Constraints can score on-target specificity and off-target avoidance. **Plasmid Insert** Design a multi-gene insert with regulatory elements. ```python python icon="python" theme={null} # Two-gene operon promoter = Segment(length=80, sequence_type="dna", label="promoter") gene1 = Segment(length=600, sequence_type="dna", label="gene1") intergenic = Segment(length=30, sequence_type="dna", label="intergenic") gene2 = Segment(length=450, sequence_type="dna", label="gene2") terminator = Segment(length=40, sequence_type="dna", label="terminator") operon = Construct( [promoter, gene1, intergenic, gene2, terminator], label="operon_insert" ) ``` Cross-segment constraints can evaluate the entire operon for predicted expression balance between the two genes. *** ## Working with Optimizers Optimizers take a list of Constructs to optimize. Multiple optimizers in a [Program](/docs/language/concepts/programs) must share the **same Construct objects by identity** so that results persist between stages. ```python python icon="python" theme={null} # Correct: same construct object passed to both stages construct = Construct([promoter, cds], label="my_design") stage1 = RejectionSamplingOptimizer( constructs=[construct], # same object generators=[broad_gen], constraints=[fast_constraint], config=RejectionSamplingOptimizerConfig(num_samples=5000, num_results=50) ) stage2 = MCMCOptimizer( constructs=[construct], # same object: results flow through generators=[fine_gen], constraints=[expensive_constraint], config=MCMCOptimizerConfig(num_steps=500) ) program = Program(optimizers=[stage1, stage2], num_results=10) program.run() # Results are in the construct's segments for seq in construct.joined_sequences: print(seq.sequence) ``` > [!WARNING] > > Do **not** create separate Construct instances for each optimizer stage. The result sequences from stage 1 would be lost. Always reuse the same Construct object. *** ## Properties | Property | Type | Description | | - | - | - | | `segments` | `tuple[Segment, ...]` | Ordered tuple of Segment objects | | `sequence_type` | `SequenceType` | Shared type across all segments (read-only) | | `valid_chars` | `Optional[Set[str]]` | Shared valid characters (read-only) | | `joined_sequences` | `List[Sequence]` | Concatenated sequences from result pools | | `label` | `Optional[str]` | Identifier for this construct | *** ## Serialization Constructs serialize to dictionaries, including all their segments and both sequence pools: ```python python icon="python" title="Serialize" theme={null} data = construct.to_dict() # { # "segments": [ # { "label": "promoter", "sequence_length": 100, ... }, # { "label": "cds", "sequence_length": 900, ... }, # ], # "sequence_type": "dna", # "valid_chars": ["A", "C", "G", "T"], # "label": "gene_construct" # } ``` ```python python icon="python" title="Deserialize" theme={null} restored = Construct.from_dict(data) restored.label # "gene_construct" len(restored.segments) # 2 restored.segments[0].label # "promoter" ``` *** ## Next Steps > **[Generators](/docs/language/concepts/generators)** > > How generators propose candidate sequences for each segment > **[Constraints](/docs/language/concepts/constraints)** > > Scoring functions for design objectives > **[Programs](/docs/language/concepts/programs)** > > Chain optimizers into multi-stage pipelines > **[Overview](/docs/language/concepts/overview)** > > See how Constructs fit into the full architecture # Generators Source: https://proto.evodesign.org/docs/language/concepts/generators Components that propose candidate sequences during optimization [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) # Generators Generators propose candidate sequences during optimization. Where [constraints](/docs/language/concepts/constraints) define the requirements and [optimizers](/docs/language/concepts/optimizers) orchestrate the search, generators determine where new candidate sequences come from. Every optimization step begins with generators proposing candidates. A generator takes the current sequences in a [Segment](/docs/language/concepts/segments), applies its strategy (random mutation, protein language model, structure-conditioned design), and fills the `proposal_sequences` pool for the optimizer to evaluate. Generator optimization loop ## Generator Categories Proto organizes generators by *how* they produce sequences. The three most common categories are below; a fourth, gradient-based generation (`PositionWeightGenerator`), produces differentiable position weights for the [Gradient optimizer](/docs/language/optimizers/gradient). Each category makes different trade-offs between speed, biological realism, and required prior knowledge. **Mutation** **Refine existing sequences by modifying selected positions.** Mutation generators start from an existing sequence and introduce changes, either uniformly random or guided by a protein language model's uncertainty estimates. Most require a starting sequence (`ESM2Generator`, for example, raises if the segment has none); the random generators (`RandomProteinGenerator`, `RandomNucleotideGenerator`) are the exception and initialize one automatically when none is provided. Mutation generator transforms a sequence **When to use:** A starting sequence is available and the goal is to refine it. This is the most common category for iterative optimization. ```python python icon="python" theme={null} from proto_language.generator import ( RandomNucleotideGenerator, RandomNucleotideGeneratorConfig ) from proto_tools.transforms.masking import MaskingStrategy generator = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=5)) ) ``` See the [Generator Reference](/docs/language/generators/random-nucleotide) for all available mutation generators and their configuration options. **Autoregressive** **Generate sequences from scratch, token by token (left-to-right).** Autoregressive generators use large language models trained on biological sequences to generate entirely new sequences. They don't need a starting sequence; they create one from a prompt or from nothing. Autoregressive generator extends a sequence **When to use:** Novel sequences are needed (especially long DNA), or the goal is to sample from the model's learned distribution over natural sequences. > [!WARNING] > > Autoregressive generators overwrite any existing sequences in the segment. If the segment already has input sequences, they will be replaced. ```python python icon="python" theme={null} from proto_language.generator import ( Evo2Generator, Evo2GeneratorConfig ) generator = Evo2Generator( Evo2GeneratorConfig( prompts=["ACGT"], model_checkpoint="evo2_7b", temperature=1.0, ) ) ``` See the [Generator Reference](/docs/language/generators/evo2) for all available autoregressive generators and their configuration options. **Inverse Folding** **Design sequences that fold into a target 3D structure.** Inverse folding generators solve the inverse protein design problem: given a desired backbone structure (as a PDB file), predict the amino acid sequence most likely to fold into that shape. They don't need a starting sequence; unknown positions are initialized as `X`. Inverse folding generator designs a sequence from a structure **When to use:** A target protein structure (from experiment or computational design) is available, and the goal is to find sequences that fold into it. ```python python icon="python" theme={null} from proto_language.generator import ( ProteinMPNNGenerator, ProteinMPNNGeneratorConfig ) generator = ProteinMPNNGenerator( ProteinMPNNGeneratorConfig( structure_inputs="target.pdb", temperature=0.1, ) ) ``` See the [Generator Reference](/docs/language/generators/proteinmpnn) for all available inverse folding generators and their configuration options. ## Assigning Generators to Segments Before an optimizer can use a generator, it must be assigned to a specific Segment. This tells the generator *which* part of the construct to modify. ```python python icon="python" theme={null} from proto_language.core import Segment from proto_language.generator import ( RandomNucleotideGenerator, RandomNucleotideGeneratorConfig ) from proto_tools.transforms.masking import MaskingStrategy # Create a segment segment = Segment(length=100, sequence_type="dna") # Create and assign the generator generator = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=5)) ) generator.assign(segment) ``` The `assign()` method validates compatibility: * The segment's `sequence_type` must be supported by the generator * Ligand segments cannot have generators assigned (they're fixed) ```python python icon="python" theme={null} # This works: ESM2 supports protein protein_segment = Segment(length=100, sequence_type="protein") esm2_gen = ESM2Generator(ESM2GeneratorConfig()) esm2_gen.assign(protein_segment) # This raises ValueError: ESM2 doesn't support DNA dna_segment = Segment(length=100, sequence_type="dna") esm2_gen.assign(dna_segment) ``` ## Multiple Generators In multi-segment constructs, different generators can be assigned to different segments. Each generator independently proposes candidates for its assigned segment: ```python python icon="python" theme={null} from proto_language.core import Segment, Construct from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig # Two segments with different generation strategies promoter = Segment(length=200, sequence_type="dna", label="promoter") coding_seq = Segment(length=300, sequence_type="dna", label="cds") construct = Construct([promoter, coding_seq]) # Assign different generators to each segment gen_promoter = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=20)) ) gen_cds = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=6)) ) gen_promoter.assign(promoter) gen_cds.assign(coding_seq) optimizer = MCMCOptimizer( constructs=[construct], generators=[gen_promoter, gen_cds], constraints=[...], config=MCMCOptimizerConfig(num_steps=500, num_results=5, proposals_per_result=10), ) ``` > [!TIP] > > Use different mutation counts for different segments. Conserved regions (like coding sequences) benefit from fewer mutations per step, while exploratory regions (like promoters) can tolerate more. ## GPU Memory & Batch Size GPU generators process multiple proposal sequences per forward pass. The `batch_size` config parameter controls how many sequences are sent to the GPU at once. All generators default to `batch_size=1` (sequential processing); increase it to enable batching. The framework splits the full set of proposals into chunks of `batch_size` and processes each chunk on the GPU. For example, if the optimizer requests 50 proposals and `batch_size=16`, the generator runs 4 forward passes (16 + 16 + 16 + 2). > [!TIP] > > If GPU out-of-memory (OOM) errors occur, reduce the generator's `batch_size` in its config. This is especially common with long sequences or large models. See the [Generator Reference](/docs/language/generators/esm2) for per-generator configuration details and available parameters. ## Next Steps > **[Constraints](/docs/language/concepts/constraints)** > > Quality requirements that sequences must satisfy > **[Optimizers](/docs/language/concepts/optimizers)** > > Learn how optimizers coordinate generators and constraints > **[Tools](/docs/language/concepts/tools)** > > Explore the bioinformatics tools that power generators > **[Generator Reference](/docs/language/generators/random-nucleotide)** > > Full API reference for each generator ## Generator Catalog [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) # Optimizers Source: https://proto.evodesign.org/docs/language/concepts/optimizers Search algorithms that find optimal biological sequences through iterative generate-score-select cycles [![](https://proto-bio.github.io/proto-assets/images/optimizer/mcmc/carousel.png)](/docs/language/optimizers/mcmc) [![](https://proto-bio.github.io/proto-assets/images/optimizer/beam-search/carousel.png)](/docs/language/optimizers/beam-search) [![](https://proto-bio.github.io/proto-assets/images/optimizer/cycling/carousel.png)](/docs/language/optimizers/cycling) [![](https://proto-bio.github.io/proto-assets/images/optimizer/rejection-sampling/carousel.png)](/docs/language/optimizers/rejection-sampling) [![](https://proto-bio.github.io/proto-assets/images/optimizer/genetic-algorithm/carousel.png)](/docs/language/optimizers/genetic-algorithm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/gradient/carousel.png)](/docs/language/optimizers/gradient) [![](https://proto-bio.github.io/proto-assets/images/optimizer/mcmc/carousel.png)](/docs/language/optimizers/mcmc) [![](https://proto-bio.github.io/proto-assets/images/optimizer/beam-search/carousel.png)](/docs/language/optimizers/beam-search) [![](https://proto-bio.github.io/proto-assets/images/optimizer/cycling/carousel.png)](/docs/language/optimizers/cycling) [![](https://proto-bio.github.io/proto-assets/images/optimizer/rejection-sampling/carousel.png)](/docs/language/optimizers/rejection-sampling) [![](https://proto-bio.github.io/proto-assets/images/optimizer/genetic-algorithm/carousel.png)](/docs/language/optimizers/genetic-algorithm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/gradient/carousel.png)](/docs/language/optimizers/gradient) # Optimizers Optimizers are the search algorithms of Proto. They coordinate [generators](/docs/language/concepts/generators) and [constraints](/docs/language/concepts/constraints) in an iterative loop: generate proposal sequences, score them, select the best, and repeat. Different optimizers implement different search strategies, from rejection sampling to MCMC with simulated annealing. ## The Optimization Loop Every optimizer follows the same fundamental loop: The optimizer generate, filter, score, select loop **Energy scoring** is where constraints come together. The optimizer calls `score_energy()` which: 1. Evaluates all **filter constraints** first (hard pass/fail) 2. Rejects proposals that fail any filter (`energy = inf`) 3. Evaluates **scoring constraints** only on surviving proposals 4. Combines scores: `energy = Sigma(weight_i x score_i)` ## Optimizer Comparison | | **MCMC** | **Rejection Sampling** | **BeamSearch** | **Cycling** | **Gradient** | | - | - | - | - | - | - | | **Strategy** | Random walk with acceptance criterion | Generate many, keep best | Beam search over token generation | Iterative conditioning cycles | Continuous relaxation with gradient descent | | **Exploration** | High (temperature-controlled) | Broad (many samples) | Moderate (beam width) | Custom (user-defined) | Local (gradient-driven) | | **Exploitation** | Good (annealing) | Low (no refinement) | Good (beam pruning) | Depends on pipeline | Strong (descent) | | **Best for** | General optimization, refinement | Initial screening, exploration | Long DNA generation | Structure-conditioned design | Differentiable constraints | | **Inherits state?** | Yes | Yes | No (starts from prompt) | Yes | Yes | | **Multi-segment?** | Yes | Yes | No (single segment) | No (single segment) | No (single segment) | ## Available Optimizers > **MCMCOptimizer: Metropolis-Hastings Search** > > The general-purpose optimizer. Uses Markov Chain Monte Carlo with Metropolis-Hastings acceptance to explore sequence space. Maintains one or more parallel trajectories, proposing mutations and accepting or rejecting them based on energy improvement and temperature. > > **How it works:** > > 1. For each result sequence, generate `proposals_per_result` proposals > 2. Score all proposals, pick the best one per result > 3. Accept or reject based on Metropolis-Hastings criterion: > * Always accept if energy improves > * Sometimes accept worse moves (controlled by temperature) > 4. Temperature anneals from `max_temperature` to `min_temperature` over the run > > **When to use:** General-purpose optimization, protein refinement, any iterative design task. A reasonable default when the choice is unclear. > > ```python python icon="python" theme={null} > from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig > > config = MCMCOptimizerConfig( > num_results=5, # Maintain 5 parallel trajectories > num_steps=1000, # Run for 1000 steps > proposals_per_result=10, # Generate 10 proposals per result per step > max_temperature=2.0, # Start exploratory > min_temperature=0.001, # End greedy > ) > > optimizer = MCMCOptimizer( > constructs=[construct], > generators=[generator], > constraints=constraints, > config=config, > ) > ``` > > **num\_results** `int | None` (default: None) > > Number of parallel trajectories to maintain. `num_results=1` is standard single-chain MCMC. Higher values explore more of sequence space in parallel. > > **num\_steps** `int` *required* > > Total number of MCMC steps. More steps allow better convergence but increase runtime. > > **proposals\_per\_result** `int` (default: 1) > > Number of proposals to generate per result per step. Total proposals per step = `num_results x proposals_per_result`. > > **max\_temperature** `float` (default: 1.0) > > Starting temperature. Higher = more exploration (accepts worse moves more often). > > **min\_temperature** `float` (default: 0.001) > > Final temperature. Lower = more greedy (only accepts improvements). > **RejectionSamplingOptimizer: Generate Many, Keep Best** > > The simplest optimizer. Generates a large number of proposals, scores them all, and keeps the top `num_results` by lowest energy. No iterative refinement; just sampling with selection. > > **How it works:** > > 1. Generate proposals in batches of `proposal_batch_size` > 2. Score them all > 3. Track the top `num_results` proposals seen so far (maintained in sorted order) > 4. Repeat until `num_samples` reached (or `energy_threshold` met) > > **When to use:** Initial exploration, quick screening, or as the first stage in a multi-stage [Program](/docs/language/concepts/programs) pipeline. > > ```python python icon="python" theme={null} > from proto_language.optimizer import RejectionSamplingOptimizer, RejectionSamplingOptimizerConfig > > # Standard mode: generate exactly num_samples > config = RejectionSamplingOptimizerConfig( > num_samples=1000, # Generate 1000 proposals total > num_results=10, # Keep the top 10 > proposal_batch_size=50, # Evaluate 50 per batch > ) > > # Early stopping mode: stop when threshold is met > config = RejectionSamplingOptimizerConfig( > num_samples=10000, > num_results=10, > energy_threshold=0.1, # Stop early if top results all below 0.1 > ) > > optimizer = RejectionSamplingOptimizer( > constructs=[construct], > generators=[generator], > constraints=constraints, > config=config, > ) > ``` > > **num\_samples** `int` *required* > > Maximum number of proposals to generate. > > **num\_results** `int | None` (default: None) > > Number of top sequences to keep (by lowest energy). Overrides the program-level `num_results` when set. > > **proposal\_batch\_size** `int | None` (default: None) > > Number of proposal sequences to generate and evaluate per batch, capped at `num_samples`. > > **energy\_threshold** `float` (default: None) > > If set, enables early stopping: halts when all top-k proposals have energy below this threshold. > **BeamSearchOptimizer: Autoregressive Beam Search** > > Optimizer for generating long sequences with autoregressive generators such as Evo2. Splits a long segment into chunks of `beam_length` tokens and performs beam search at each boundary, pruning low-quality beams as the sequence grows. > > **How it works:** > > 1. Start from `prompt` sequence > 2. Generate `beam_length` tokens with `proposals_per_result` variations per beam > 3. Score all beams with constraints > 4. Keep top `num_results` beams > 5. Repeat until segment length is reached > > **When to use:** Generating a single long DNA sequence (e.g., 2000+ bp) with quality constraints applied during generation rather than after. > > ```python python icon="python" theme={null} > from proto_language.optimizer import ( > BeamSearchOptimizer, BeamSearchOptimizerConfig > ) > > config = BeamSearchOptimizerConfig( > prompt="ATGCCTGAA", # Starting sequence > beam_length=500, # Generate 500bp per beam step > num_results=5, # Keep top 5 beams > proposals_per_result=10, # Generate 10 variations per beam > score_by="mean", # Average scores across all beams > use_kv_caching=True, # Cache for speed > ) > > optimizer = BeamSearchOptimizer( > target_segment=construct.segments[0], # The single segment to generate over > constructs=[construct], > generators=[evo2_generator], # Must be autoregressive > constraints=constraints, > config=config, > ) > ``` > > > [!WARNING] > > > > BeamSearch requires a single-segment construct and an autoregressive generator. It ignores previous optimizer results in a Program; it always starts fresh from its configured `prompt`. > > **prompt** `str` *required* > > Initial sequence to begin generation from. All beams extend from this prompt. > > **beam\_length** `int` *required* > > Number of tokens to generate per beam step. > > **num\_results** `int` > > Number of top beams to maintain at each step (K in beam search). Optional; defaults to the number of results requested by the program. > > **proposals\_per\_result** `int` *required* > > Number of proposal extensions per beam. Total proposals per step = `num_results x proposals_per_result`. > > **score\_by** `str` (default: mean) > > Aggregation method: `"mean"` (average across beams, rewards consistency) or `"last"` (most recent beam only). > > **use\_kv\_caching** `bool` (default: False) > > Enable KV cache reuse for faster autoregressive generation across beam steps. > **CyclingOptimizer: Iterative Conditioning Cycles** > > A generalized optimizer that alternates between a user-defined conditioning function and a generator. The conditioning function can modify generator config between iterations; for example, predicting a 3D structure from the current sequence, then using that structure to condition inverse folding for the next iteration. > > **How it works:** > > 1. Run the conditioning function on current sequences > 2. The conditioning function updates generator config (e.g., sets new PDB structures) > 3. Generator produces new proposals conditioned on updated config > 4. Optionally evaluate constraints and roll back rejected proposals > 5. Repeat for `num_steps` > > **When to use:** Structure prediction + inverse folding cycles ("protein hallucination"), or any iterative conditioning workflow. > > **Built-in pipeline:** The `protein-hunter` pipeline automates the common pattern of structure prediction followed by inverse folding: > > ```python python icon="python" theme={null} > from proto_language.optimizer import ( > CyclingOptimizer, CyclingOptimizerConfig > ) > > config = CyclingOptimizerConfig( > num_results=10, > num_steps=50, > pipeline="protein-hunter", > protein_hunter={"structure_tool": "boltz2"}, > ) > > optimizer = CyclingOptimizer( > target_segment=construct.segments[0], # The single segment to design > constructs=[construct], > generators=[proteinmpnn_gen], > constraints=constraints, > config=config, > ) > ``` > > **num\_results** `int | None` (default: None) > > Number of proposal trajectories to maintain across cycles. > > **num\_steps** `int` *required* > > Number of conditioning-generation cycles to run. > > **pipeline** `str` (default: None) > > Named pipeline (e.g., `"protein-hunter"`) for common conditioning patterns. > > **conditioning\_fn** `Callable` (default: None) > > Custom conditioning function for advanced use cases. Passed as a constructor argument to `CyclingOptimizer` (not a `CyclingOptimizerConfig` field), and mutually exclusive with `pipeline`. > [!NOTE] > > The **Gradient** optimizer (continuous relaxation with differentiable constraints, paired with `PositionWeightGenerator`) is summarized in the comparison table above; see its full reference at [Gradient optimizer](/docs/language/optimizers/gradient). ## Optimizer Decision Tree Decision tree for choosing an optimizer ## Pool Architecture Understanding the dual-pool system is key to understanding how optimizers work: ### `proposal_sequences` The **working pool**. Generators write proposals here. Constraints evaluate sequences from here. Size = `num_proposals`. It acts as an inbox: new proposals arrive, are evaluated, and the best ones graduate to the result pool. ### `result_sequences` The **results pool**. Contains the best sequences found so far. Size = `num_results`. It acts as a hall of fame: only the best-scoring sequences are retained here. ### Pool Initialization (Cycling) When an optimizer starts, either fresh or after receiving results from a previous optimizer in a [Program](/docs/language/concepts/programs), both pools are initialized by **cycling** through the source sequences: ``` Source sequences: [A, B, C] (3 from previous optimizer) num_results = 5 result_sequences: [A, B, C, A, B] # Cycles to fill 5 slots proposal_sequences: [A, B, C, A, B, C, A, B, C, A] # Cycles to fill num_proposals ``` This cycling preserves diversity when pool sizes differ between optimizers. Some optimizers (like Rejection Sampling) keep their results sorted by energy; others preserve their natural ordering. ## Constraint Evaluation & Performance The `score_energy()` method implements a two-pass evaluation strategy that skips expensive GPU computations on already-rejected proposals: **Pass 1, Filters:** All filter constraints (those with a `threshold`) are evaluated first. Proposals that fail *any* filter are immediately rejected with `energy = inf` and marked with the rejecting constraint's label. This is an AND gate; a proposal must pass every filter to survive. **Pass 2, Scoring:** Scoring constraints (those with a `weight`) are only evaluated on proposals that passed all filters. This means expensive GPU evaluations (structure prediction, binding strength) are never run on proposals that already failed a cheap filter (homopolymer check, GC content range). ``` 50 proposals generated → 12 rejected by homopolymer filter (CPU, <1ms) → 5 rejected by GC content filter (CPU, <1ms) → 33 survive to scoring → ESMFold pLDDT evaluated on 33 (GPU, skipped 17) → Boltz2 binding evaluated on 33 (GPU, skipped 17) ``` **GPU memory for constraint evaluation** is managed at the tool level, not the framework level. Unlike generators (which have a framework-level `batch_size`), constraints receive all passing proposals in a single call. Each tool handles its own memory internally: ESMFold splits by residue count, Boltz2 processes complexes sequentially, and so on. Users control this through tool-specific config fields (e.g., `max_batch_residues` for ESMFold) rather than a constraint-level parameter. > [!TIP] > > Constraints are ordered with cheap filters first (sequence composition checks) and expensive scoring constraints last (structure prediction, binding). The two-pass strategy ensures rejected proposals never trigger GPU evaluations. ## Temperature and Acceptance Temperature controls the exploration-exploitation trade-off in MCMC. It determines how willing the optimizer is to accept a proposal that is *worse* than the current best: ``` Acceptance probability = min(1, exp(-delta_energy / temperature)) ``` Temperature annealing from exploration to refinement MCMC uses exponential annealing: `T(step) = T_max x (T_min / T_max)^((step - 1) / (num_steps - 1))`, so step 1 is exactly `T_max` and the final step is exactly `T_min`. > [!TIP] > > A common pattern is to start with high temperature for exploration, then anneal to low temperature for refinement. For multi-stage optimization, use a [Program](/docs/language/concepts/programs) with explicit temperature stages instead of relying solely on annealing. ## Tool Cache Management Constraints that call expensive [bioinformatics tools](/docs/language/concepts/tools) (structure prediction, sequence alignment) benefit from caching. The optimizer manages a shared tool cache: ```python python icon="python" theme={null} MCMCOptimizer( ..., # Prune cache when it exceeds 100MB (default) clear_tool_cache=100 * 1024 * 1024, # Or: clear every step (aggressive, for memory-constrained runs) clear_tool_cache=True, # Or: only clear specific tools clear_tool_cache=["esmfold", "boltz2"], ) ``` ## History Tracking Optimizers record snapshots of their state at configurable intervals for post-hoc analysis: ```python python icon="python" theme={null} optimizer.run() # Iterate over history snapshots for snapshot in optimizer.history: step = snapshot["time_step"] energies = [r["energy_score"] for r in snapshot["results"] if r["energy_score"] is not None] print(f"Step {step}: best={min(energies):.4f}, mean={sum(energies)/len(energies):.4f}") ``` ## Next Steps > **[Programs](/docs/language/concepts/programs)** > > Chain multiple optimizers into multi-stage pipelines > **[Generators](/docs/language/concepts/generators)** > > The models that propose candidate sequences > **[Constraints](/docs/language/concepts/constraints)** > > The quality checklist optimizers minimize > **[Optimizer Reference](/docs/language/optimizers/mcmc)** > > Full API reference for each optimizer ## Optimizer Catalog [![](https://proto-bio.github.io/proto-assets/images/optimizer/beam-search/carousel.png)](/docs/language/optimizers/beam-search) [![](https://proto-bio.github.io/proto-assets/images/optimizer/cycling/carousel.png)](/docs/language/optimizers/cycling) [![](https://proto-bio.github.io/proto-assets/images/optimizer/genetic-algorithm/carousel.png)](/docs/language/optimizers/genetic-algorithm) [![](https://proto-bio.github.io/proto-assets/images/optimizer/gradient/carousel.png)](/docs/language/optimizers/gradient) [![](https://proto-bio.github.io/proto-assets/images/optimizer/mcmc/carousel.png)](/docs/language/optimizers/mcmc) [![](https://proto-bio.github.io/proto-assets/images/optimizer/rejection-sampling/carousel.png)](/docs/language/optimizers/rejection-sampling) # Architecture Overview Source: https://proto.evodesign.org/docs/language/concepts/overview How Proto turns biological requirements into optimized sequences Proto translates a set of biological requirements into optimized sequences. The requirements are declared as constraints, and the framework searches sequence space for sequences that satisfy them. Without a framework, sequence design is a manual loop: a sequence is designed by hand, prediction tools are run one at a time, the results are evaluated, and the sequence is revised over many iterations. Proto automates this loop. Requirements are expressed once as constraints, an optimizer searches sequence space, and the output is a set of sequences ranked by score. *** ## The Pipeline Every design follows the same five-stage pipeline: Proto five-stage design pipeline *** ## Core Components > **[Sequence](/docs/language/concepts/sequences)** > > The fundamental data unit: a biological string (DNA, RNA, protein, or ligand) with type validation and rich metadata. > **[Segment](/docs/language/concepts/segments)** > > A region to design. Maintains dual pools of proposal and result sequences during optimization. > **[Construct](/docs/language/concepts/constructs)** > > An ordered collection of Segments representing a complete biological design, like a gene expression cassette. > **[Generator](/docs/language/concepts/generators)** > > Proposes new sequences through mutation, autoregressive generation, inverse folding, or gradient-based design. > **[Constraint](/docs/language/concepts/constraints)** > > Scores how well sequences meet requirements. Returns 0.0 (perfect) to 1.0 (worst violation). > **[Optimizer](/docs/language/concepts/optimizers)** > > Orchestrates the generate-evaluate-select loop using search strategies such as MCMC or beam search. > [!TIP] > > A **Program** chains multiple Optimizers together for multi-stage pipelines (e.g., coarse exploration followed by fine-tuning). See [Programs](/docs/language/concepts/programs). *** ## Data Flow **1. Define the design space** **Segments** specify the regions to be designed, for example a 100 bp promoter, a 300-residue enzyme, or an existing sequence to optimize. They are combined into a **Construct** representing the full biological unit. ```python python icon="python" theme={null} promoter = Segment(length=100, sequence_type="dna", label="promoter") cds = Segment(length=900, sequence_type="dna", label="cds") construct = Construct([promoter, cds]) ``` **2. Assign generators to segments** Each **Generator** is assigned to a Segment and proposes candidate sequences. Different generators use different strategies: random mutation, model-guided generation, or inverse folding. ```python python icon="python" theme={null} generator = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) generator.assign(promoter) ``` **3. Define constraints with scoring functions** **Constraints** evaluate sequences and return a score from 0.0 (perfect) to 1.0 (worst). They can operate on individual segments or across multiple segments. ```python python icon="python" theme={null} gc_constraint = Constraint( inputs=[promoter], function=gc_content_constraint, function_config={"min_gc": 45, "max_gc": 55} ) ``` **4. Configure and run the optimizer** The **Optimizer** drives the search loop: generate proposals, score them with constraints, select the best. It repeats until a stopping criterion is reached. ```python python icon="python" theme={null} optimizer = MCMCOptimizer( constructs=[construct], generators=[generator], constraints=[gc_constraint], config=MCMCOptimizerConfig(num_steps=1000) ) ``` **5. Retrieve optimized sequences** After optimization, the best sequences live in each Segment's `result_sequences` pool. The Construct's `joined_sequences` gives the full concatenated results. ```python python icon="python" theme={null} program = Program(optimizers=[optimizer], num_results=1) program.run() for seq in construct.joined_sequences: print(seq.sequence) print(seq.metadata["segments"]) # Per-segment constraint scores ``` *** ## The Dual Pool Architecture A key design decision in Proto is that each Segment maintains **two separate sequence pools**. This separation lets optimizers explore freely without losing the best solutions found so far. Dual-pool optimization loop inside a Segment ### Proposal Pool * **Purpose**: Workspace for the optimizer * **Populated by**: Generators (mutations, new proposals) * **Consumed by**: Constraints (scoring) and Optimizer (selection) * **Lifecycle**: Rebuilt every optimization step ### Result Pool * **Purpose**: Best results found so far * **Populated by**: Optimizer (after ranking proposals) * **Consumed by**: User (final output), next stage in a Program * **Lifecycle**: Persists across optimization steps and stages *** ## Design Patterns **Single Constraint** The simplest pattern: one segment, one constraint, one optimizer, used for a single design objective. **Example**: Design a 100 bp DNA promoter with 50-60% GC content. ```python python icon="python" theme={null} from proto_language.core import Segment, Construct from proto_language import Program, Constraint from proto_language.generator import RandomNucleotideGenerator, RandomNucleotideGeneratorConfig from proto_language.constraint import gc_content_constraint from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig segment = Segment(length=100, sequence_type="dna", label="promoter") construct = Construct([segment]) generator = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) generator.assign(segment) constraint = Constraint( inputs=[segment], function=gc_content_constraint, function_config={"min_gc": 50, "max_gc": 60} ) optimizer = MCMCOptimizer( constructs=[construct], generators=[generator], constraints=[constraint], config=MCMCOptimizerConfig(num_steps=1000) ) program = Program(optimizers=[optimizer], num_results=1) program.run() ``` **Multi-Constraint** Multiple constraints on the same segment. Scores are combined into a weighted energy value that the optimizer minimizes. **Example**: Design a protein with high stability (pLDDT) and minimal low-complexity regions. ```python python icon="python" theme={null} segment = Segment(length=200, sequence_type="protein", label="enzyme") construct = Construct([segment]) generator = ESM2Generator(ESM2GeneratorConfig()) generator.assign(segment) constraints = [ Constraint( inputs=[segment], function=structure_plddt_constraint, function_config={"structure_tool": "esmfold"}, weight=2.0, # Higher weight = more important ), Constraint( inputs=[segment], function=protein_complexity_constraint, function_config={"max_low_complexity": 0.3}, weight=1.0, ), ] optimizer = MCMCOptimizer( constructs=[construct], generators=[generator], constraints=constraints, config=MCMCOptimizerConfig(num_steps=500) ) ``` **Multi-Stage** Optimizers are chained for coarse-to-fine search. The first stage explores broadly with cheap constraints; later stages refine with expensive ones. Stages share the same Construct objects, so results flow through. **Example**: Broad exploration with sequence-level constraints, then structure-guided refinement. ```python python icon="python" theme={null} segment = Segment(length=300, sequence_type="protein", label="target") construct = Construct([segment]) # Stage 1: Broad exploration with a fast sequence-quality constraint random_generator = RandomProteinGenerator(RandomProteinGeneratorConfig()) random_generator.assign(segment) complexity = Constraint( inputs=[segment], function=protein_complexity_constraint, function_config={"max_low_complexity": 0.3}, ) stage1 = RejectionSamplingOptimizer( constructs=[construct], generators=[random_generator], constraints=[complexity], config=RejectionSamplingOptimizerConfig(num_samples=5000, num_results=50), ) # Stage 2: Refinement with expensive structure prediction (same construct object) esm2_generator = ESM2Generator(ESM2GeneratorConfig()) esm2_generator.assign(segment) plddt = Constraint( inputs=[segment], function=structure_plddt_constraint, function_config={"structure_tool": "esmfold"}, ) stage2 = MCMCOptimizer( constructs=[construct], generators=[esm2_generator], constraints=[plddt], config=MCMCOptimizerConfig(num_steps=200), ) program = Program(optimizers=[stage1, stage2], num_results=10) program.run() # Stage 1 results feed into Stage 2 ``` > [!WARNING] > > Multi-stage pipelines must share the **same Construct objects by identity** (not copies). This is how results flow from one stage to the next. **Multi-Segment** Multiple regions are designed together. Constraints can operate on individual segments or across multiple segments for interaction-aware design. **Example**: Design a promoter and coding sequence together, with cross-segment constraints. ```python python icon="python" theme={null} promoter = Segment(length=100, sequence_type="dna", label="promoter") cds = Segment(length=900, sequence_type="dna", label="cds") construct = Construct([promoter, cds]) # Separate generators for each region gen_promoter = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) gen_promoter.assign(promoter) gen_cds = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) gen_cds.assign(cds) constraints = [ # Per-segment constraints Constraint(inputs=[promoter], function=gc_content_constraint, function_config={"min_gc": 45, "max_gc": 55}), Constraint(inputs=[cds], function=gc_content_constraint, function_config={"min_gc": 40, "max_gc": 60}), # Constraints can also span segments, e.g. inputs=[promoter, cds], # for interaction-aware design across regions. ] optimizer = MCMCOptimizer( constructs=[construct], generators=[gen_promoter, gen_cds], constraints=constraints, config=MCMCOptimizerConfig(num_steps=1000) ) ``` *** ## Choosing a Pattern Decision tree for choosing a design pattern *** ## Next Steps > **[Sequences](/docs/language/concepts/sequences)** > > The fundamental data unit > **[Segments](/docs/language/concepts/segments)** > > Design regions and dual pools > **[Constraints](/docs/language/concepts/constraints)** > > Scoring functions for design objectives > **[Quickstart](/docs/language/quickstart)** > > A first design, end to end # Programs Source: https://proto.evodesign.org/docs/language/concepts/programs Chains multiple optimizers into a multi-stage pipeline for biological sequence design # Programs While individual [optimizers](/docs/language/concepts/optimizers) run a single search strategy, a Program chains multiple optimizers into a **multi-stage pipeline**: broad exploration followed by targeted refinement, cheap filters before expensive scoring, temperature annealing across stages. A Program runs its optimizers sequentially, automatically handling the handoff of results between stages. ## Single vs Multi-Stage **Single Stage** For simple designs, wrap one optimizer in a Program: ```python python icon="python" theme={null} from proto_language.core import Segment, Construct, Constraint, Program from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig from proto_language.generator import ( RandomNucleotideGenerator, RandomNucleotideGeneratorConfig ) from proto_language.constraint import gc_content_constraint # Setup segment = Segment(length=100, sequence_type="dna") construct = Construct([segment]) generator = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig() ) generator.assign(segment) constraint = Constraint( inputs=[segment], function=gc_content_constraint, function_config={"min_gc": 45, "max_gc": 55}, ) # Single optimizer optimizer = MCMCOptimizer( constructs=[construct], generators=[generator], constraints=[constraint], config=MCMCOptimizerConfig(num_steps=500, num_results=5, proposals_per_result=10), ) program = Program(optimizers=[optimizer], num_results=5) program.run() ``` Single-stage program from input sequence to MCMC to results **Multi-Stage** Chain optimizers for coarse-to-fine optimization: ```python python icon="python" theme={null} from proto_language.optimizer import ( RejectionSamplingOptimizer, RejectionSamplingOptimizerConfig, MCMCOptimizer, MCMCOptimizerConfig, ) # Stage 1: Broad exploration with cheap constraints gen1 = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=10)) ) gen1.assign(segment) opt1 = RejectionSamplingOptimizer( constructs=[construct], generators=[gen1], constraints=[gc_constraint], config=RejectionSamplingOptimizerConfig(num_samples=5000, num_results=20), ) # Stage 2: Refinement with expensive structure prediction gen2 = ESM2Generator(ESM2GeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=3))) gen2.assign(segment) opt2 = MCMCOptimizer( constructs=[construct], # Same construct object! generators=[gen2], constraints=[gc_constraint_2, structure_constraint], config=MCMCOptimizerConfig(num_steps=200, num_results=5, proposals_per_result=5), ) # num_results=5 sets the default for all optimizers. # opt1 overrides with config.num_results=20; opt2 uses the program default of 5. program = Program(optimizers=[opt1, opt2], num_results=5) program.run() ``` Two-stage program: rejection sampling hands top results to MCMC ## The Handoff When one optimizer finishes and the next begins, the Program performs a carefully orchestrated handoff: Program handoff: results flow from stage one through the handoff to stage two **After each optimizer completes:** Optimizers are responsible for their own ordering. Rejection Sampling keeps `result_sequences` sorted by energy (best first) throughout its run. Other optimizers preserve their natural ordering. **Before the next optimizer runs:** 1. `_initialize_sequence_pools()` reads from the previous optimizer's `result_sequences` 2. Both pools are filled by cycling through source (preserving diversity when sizes differ) 3. Stale constraint metadata is cleared so the new stage starts with a clean slate ### Optimizer-Specific Behavior Not all optimizers use inherited state the same way: | Optimizer | How It Uses Previous Results | | - | - | | **Rejection Sampling** | Uses as starting proposals, then generates more and keeps overall best | | **MCMC** | Uses as parallel trajectories, generates proposals from each | | **Cycling** | Uses as working proposals for conditioning cycles | | **BeamSearch** | **Ignores previous results.** Always starts fresh from its `prompt` parameter | > [!NOTE] > > BeamSearch ignores previous optimizer results by design. It always starts fresh from its configured `prompt` since it is built for autoregressive generation. Place it as the first stage in a pipeline, or use it standalone. ## Pipeline Design Recipes > [!NOTE] > > The snippets below are illustrative patterns. They assume the `segment`, `construct`, generators, and the named constraint objects (for example `gc_constraint`, `structure_constraint`, `expression_constraint`) have already been defined as shown in the earlier examples and the [Constraints](/docs/language/concepts/constraints) guide. > **Exploration then Refinement** > > **Rejection Sampling (broad) then MCMC (focused)** > > Use Rejection Sampling to quickly sample thousands of proposals with cheap constraints, then hand the best ones to MCMC for detailed optimization with expensive constraints. > > *Most common multi-stage pattern.* > **Progressive Constraints** > > **MCMC (basic) then MCMC (+ structure) then MCMC (+ expression)** > > Start with cheap sequence-level constraints, then progressively add expensive constraints. Each stage builds on the previous one's results. > > *Avoids wasting GPU time scoring bad sequences.* > **Temperature Annealing** > > **MCMC (hot) then MCMC (warm) then MCMC (cold)** > > Explicit temperature stages: high temperature for broad exploration, medium for narrowing, low for final polishing. More control than single-optimizer annealing. > > *Better for rugged energy landscapes.* > **Generator Switching** > > **Rejection Sampling + RandomNucleotide then MCMC + ESM2** > > Start with fast random mutations for initial screening, then switch to language-model-guided mutations for biologically informed refinement. > > *Combines fast screening with language-model-guided refinement.* ### Exploration then Refinement ```python python icon="python" theme={null} # Stage 1: Fast exploration with cheap constraints gen1 = RandomNucleotideGenerator( RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=10)) ) gen1.assign(segment) opt1 = RejectionSamplingOptimizer( constructs=[construct], generators=[gen1], constraints=[gc_filter, homopolymer_filter], config=RejectionSamplingOptimizerConfig(num_samples=5000, num_results=20), ) # Stage 2: Structure-based refinement gen2 = ESM2Generator(ESM2GeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=3))) gen2.assign(segment) opt2 = MCMCOptimizer( constructs=[construct], generators=[gen2], constraints=[gc_constraint, plddt_constraint, rmsd_constraint], config=MCMCOptimizerConfig( num_steps=200, num_results=5, proposals_per_result=5, max_temperature=2.0, ), ) Program(optimizers=[opt1, opt2], num_results=5).run() ``` ### Progressive Constraints ```python python icon="python" theme={null} # Stage 1: Sequence composition only gen1 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) gen1.assign(segment) opt1 = MCMCOptimizer( constructs=[construct], generators=[gen1], constraints=[gc_constraint_1], config=MCMCOptimizerConfig(num_steps=300, num_results=10, proposals_per_result=5), ) # Stage 2: Add structure prediction gen2 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=9))) gen2.assign(segment) opt2 = MCMCOptimizer( constructs=[construct], generators=[gen2], constraints=[gc_constraint_2, structure_constraint], config=MCMCOptimizerConfig(num_steps=200, num_results=5, proposals_per_result=5), ) # Stage 3: Add expression constraint gen3 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=6))) gen3.assign(segment) opt3 = MCMCOptimizer( constructs=[construct], generators=[gen3], constraints=[gc_constraint_3, structure_constraint_2, expression_constraint], config=MCMCOptimizerConfig(num_steps=100, num_results=3, proposals_per_result=5), ) Program(optimizers=[opt1, opt2, opt3], num_results=10).run() ``` ### Temperature Annealing ```python python icon="python" theme={null} # High temperature: broad exploration gen1 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=8))) gen1.assign(segment) opt1 = MCMCOptimizer( constructs=[construct], generators=[gen1], constraints=constraints_1, config=MCMCOptimizerConfig( num_steps=500, num_results=10, proposals_per_result=10, max_temperature=5.0 ), ) # Medium temperature: narrowing gen2 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) gen2.assign(segment) opt2 = MCMCOptimizer( constructs=[construct], generators=[gen2], constraints=constraints_2, config=MCMCOptimizerConfig( num_steps=300, num_results=5, proposals_per_result=5, max_temperature=2.0 ), ) # Low temperature: polishing gen3 = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=6))) gen3.assign(segment) opt3 = MCMCOptimizer( constructs=[construct], generators=[gen3], constraints=constraints_3, config=MCMCOptimizerConfig( num_steps=200, num_results=3, proposals_per_result=3, max_temperature=0.5 ), ) Program(optimizers=[opt1, opt2, opt3], num_results=10).run() ``` ## Running Stages Individually Use `run_stage()` for fine-grained control: inspect results between stages, conditionally skip stages, or re-run a stage with different parameters. ```python python icon="python" theme={null} program = Program(optimizers=[opt1, opt2, opt3], num_results=5) # Run first stage program.run_stage(0) results = program.get_stage_results(0) # Inspect before continuing best = results["results"][results["best_result_idx"]] print(f"Stage 1 best energy: {best['energy_score']:.4f}") # Conditionally run next stage if best["energy_score"] < 0.5: program.run_stage(1) else: print("Stage 1 didn't converge, skipping refinement") ``` A previous stage can also be **re-run**, which resets the pipeline to that point and invalidates subsequent stages: ```python python icon="python" theme={null} # Re-run stage 0 (invalidates stages 1 and 2) program.run_stage(0) ``` ## Results and Export ### Accessing Results ```python python icon="python" theme={null} program.run() # Final energy scores (from last optimizer) print(program.energy_scores) # [0.05, 0.08, 0.12, ...] # Final sequences (from shared constructs) for construct in program.constructs: for sequence in construct.joined_sequences: print(sequence.sequence) # Structured results results = program.extract_results(program.energy_scores) for result in results["results"]: print(f"Result {result['result_idx']}: energy={result['energy_score']:.4f}") for construct in result["constructs"]: for seg in construct["segments"]: print(f" {seg['label']}: {seg['sequence'][:50]}...") ``` ### Export Formats ```python python icon="python" title="Bundle Export" theme={null} # Export all 4 tables at once (sequences, constraints, constructs, optimization) program.export(path="./results/", format="csv") # Creates: results/sequences.csv, results/constraints.csv, # results/constructs.csv, results/optimization.csv ``` ```python python icon="python" title="Single Table" theme={null} # A single table is accessed as a DataFrame (sequences, constraints, # constructs, or optimization), which can be written out directly df = program.to_dataframe(table="sequences") df.to_csv("sequences.csv", index=False) program.to_dataframe(table="constraints").to_csv("constraints.csv", index=False) ``` ```python python icon="python" title="Excel" theme={null} # Multi-sheet Excel workbook with all 4 tables. # path is a folder; xlsx is written to /results.xlsx program.export(path="./results/", format="xlsx") # -> ./results/results.xlsx ``` ### Stage-Specific Results Access results from any completed stage: ```python python icon="python" theme={null} # Results from stage 0 stage_0_results = program.get_stage_results(0) # Export a specific stage's results (writes the 4-table folder for that stage) program.export(path="./stage0_results/", format="csv", stage=0) ``` ### Optimizer-Level Export Individual `Optimizer` instances also provide the same export methods (without the `stage` parameter): ```python python icon="python" theme={null} optimizer.export(path="./results/", format="csv") df = optimizer.to_dataframe(table="sequences") fasta = optimizer.to_fasta() ``` ### State Serialization Save and restore program state for long-running optimization or checkpointing: ```python python icon="python" theme={null} # Save state state = program.serialize_state() # Save to file, database, etc. import json with open("checkpoint.json", "w") as f: json.dump(state, f) # Later: restore state and continue with open("checkpoint.json") as f: state = json.load(f) program.restore_state(state, stage_index=1) program.run_stage(1) # Resume from stage 1 ``` ## Important Rules > [!WARNING] > > **All optimizers in a Program must share the same Construct objects (by identity, not just value).** This is how state persists between stages. The construct is created once and the same object is passed to all optimizers. > > ```python python icon="python" theme={null} > # Correct: same construct object > construct = Construct([segment]) > opt1 = MCMCOptimizer(constructs=[construct], ...) > opt2 = MCMCOptimizer(constructs=[construct], ...) # Same object > > # Wrong: different construct objects (raises ValueError) > opt1 = MCMCOptimizer(constructs=[Construct([segment])], ...) > opt2 = MCMCOptimizer(constructs=[Construct([segment])], ...) # Different object! > ``` > [!WARNING] > > **Each generator and constraint instance can only be used in one optimizer.** This prevents shared mutable state bugs. Create new instances for each stage. > > ```python python icon="python" theme={null} > # Correct: separate generator instances per optimizer > gen1 = RandomNucleotideGenerator(config) > gen2 = RandomNucleotideGenerator(config) # New instance, same config is fine > gen1.assign(segment) > gen2.assign(segment) > > # Wrong: reusing the same generator instance (raises ValueError) > gen = RandomNucleotideGenerator(config) > gen.assign(segment) > opt1 = MCMCOptimizer(generators=[gen], ...) > opt2 = MCMCOptimizer(generators=[gen], ...) # Same instance -- error! > ``` ## Properties | Property | Description | | - | - | | `constructs` | List of Construct objects being optimized (shared across all optimizers) | | `optimizers` | List of Optimizer objects in sequence | | `num_results` | Program-level default for the number of output sequences. Each optimizer resolves its result count as: config override > `num_results` > error. | | `energy_scores` | Final energy scores from the last optimizer (after `run()`) | | `current_stage` | Index of current/next stage to run | | `verbose` | If True, forces verbose mode in all optimizers | ## Next Steps > **[Quickstart](/docs/language/quickstart)** > > A complete program, from scratch > **[Optimizers](/docs/language/concepts/optimizers)** > > Deep dive into individual optimizer strategies > **[Constraints](/docs/language/concepts/constraints)** > > Scoring functions for design objectives > **[Tools](/docs/language/concepts/tools)** > > The bioinformatics tools that constraints and generators call # Segments Source: https://proto.evodesign.org/docs/language/concepts/segments Defining sequence regions and managing dual pools during optimization # Segments A **Segment** is a region of biological sequence to be designed or optimized. It is analogous to a gene annotation on a genome map: a bounded region with a specific function (a promoter, a coding sequence, a linker domain) that the framework fills with an optimal sequence. Each Segment maintains **two pools of sequences** that the optimization loop uses: one for exploring proposals, and one for preserving the best results found so far. *** ## Creating Segments **From Length (design from scratch)** Creates an entirely new sequence for a region from scratch. The framework fills it during optimization. ```python python icon="python" theme={null} from proto_language.core import Segment # Design a new 100bp DNA promoter promoter = Segment( length=100, sequence_type="dna", label="promoter" ) # Design a 250-residue protein enzyme enzyme = Segment( length=250, sequence_type="protein", label="enzyme" ) ``` The Segment starts with an empty sequence. The Generator will populate it with proposals at the start of optimization. **From Sequence (optimize existing)** Starts from an existing sequence to be improved. The provided sequence becomes the starting point for the Generator. ```python python icon="python" theme={null} from proto_language.core import Segment # Optimize an existing promoter promoter = Segment( sequence="TTGACATAAATACCACTGGCGGTGATACTGAGCAC", sequence_type="dna", label="lac_promoter" ) # Optimize a known enzyme enzyme = Segment( sequence="MSKGEELFTGVVPILVELDGDVNGHKFSVSG", sequence_type="protein", label="gfp_fragment" ) # Length is inferred from the sequence promoter.sequence_length # 35 enzyme.sequence_length # 31 ``` > [!WARNING] > > Either `length` or `sequence` must be provided, but **not both**. If a sequence is provided, the length is inferred automatically. *** ## Sequence Types | Sequence type | Valid characters | Example | | - | - | - | | **DNA** | `A` `C` `G` `T` | `Segment(length=100, sequence_type="dna")` | | **RNA** | `A` `C` `G` `U` | `Segment(length=50, sequence_type="rna")` | | **Protein** | 20 standard amino acids | `Segment(length=300, sequence_type="protein")` | | **Ligand** | SMILES syntax (RDKit-validated) | `Segment(sequence="CCO", sequence_type="ligand")` | > [!NOTE] > > Ligand segments **must** be initialized with a sequence (SMILES string), not just a length. This is because SMILES syntax cannot be randomly generated; the molecule must be chemically valid. *** ## The Dual Pool Model Each Segment maintains two separate lists of [Sequence](/docs/language/concepts/sequences) objects that serve different purposes during optimization: Dual-pool model inside a Segment ### proposal\_sequences The **working space**. Generators fill this pool with new proposals each step. Constraints score every proposal. The Optimizer ranks them and decides which survive. * Rebuilt every optimization step * Can contain many sequences (e.g., 100 proposals) * Internal to the optimization loop ### result\_sequences The **results space**. The Optimizer promotes the best proposals here. This pool persists across optimization steps, and when using multi-stage [Programs](/docs/language/concepts/programs), carries results from one stage to the next. * Persists across steps and stages * Contains the top-K best sequences * User-facing output after optimization ```python python icon="python" theme={null} # During optimization segment.proposal_sequences # List[Sequence] - current proposals segment.result_sequences # List[Sequence] - best found so far # After optimization, read results from the result pool for seq in segment.result_sequences: print(f"Sequence: {seq.sequence[:30]}...") print(f"Scores: {seq.metadata['constraints']}") ``` *** ## Properties Reference > **Pool properties** > > | Property | Type | Description | > | - | - | - | > | `proposal_sequences` | `List[Sequence]` | Current proposals (working space) | > | `result_sequences` | `List[Sequence]` | Best sequences found (results space) | > | `num_proposals` | `int` | Number of sequences in the proposal pool | > | `num_results` | `int` | Number of sequences in the result pool | > **Sequence properties** > > | Property | Type | Description | > | - | - | - | > | `sequence_type` | `SequenceType` | `"dna"`, `"rna"`, `"protein"`, or `"ligand"` (read-only) | > | `valid_chars` | `Optional[Set[str]]` | Allowed characters for this segment (read-only) | > | `sequence_length` | `int` | Expected length of sequences in this segment | > | `original_sequence` | `Sequence` | The original sequence provided at construction (read-only) | > | `has_original_sequence` | `bool` | `True` if created with a sequence (vs. just a length) | > **State properties** > > | Property | Type | Description | > | - | - | - | > | `populated_sequences` | `bool` | Whether segment has sequences from input or prior optimization | > | `proposals_populated` | `bool` | Whether proposal pool has non-empty sequences | > | `is_ligand` | `bool` | Whether this is a ligand segment (ligands cannot be mutated) | > | `label` | `Optional[str]` | Identifier for this segment (auto-assigned if not provided) | > | `construct_label` | `Optional[str]` | Label of the parent Construct (set by Program) | *** ## Labels Labels identify segments in multi-segment designs and appear in constraint metadata, so per-segment results are attributable to a named region. ```python python icon="python" theme={null} promoter = Segment(length=100, sequence_type="dna", label="promoter") cds = Segment(length=900, sequence_type="dna", label="cds") terminator = Segment(length=50, sequence_type="dna", label="terminator") ``` If a label is not provided, segments are auto-labeled based on their position in the [Construct](/docs/language/concepts/constructs): `segment_0`, `segment_1`, etc. *** ## Custom Valid Characters Restrict the allowed characters for specialized applications: ```python python icon="python" theme={null} # AT-rich region (no G or C allowed) at_rich = Segment( length=50, sequence_type="dna", valid_chars={"A", "T"}, label="at_rich_spacer" ) # Reduced amino acid alphabet for combinatorial libraries combinatorial = Segment( length=100, sequence_type="protein", valid_chars={"A", "G", "S", "T", "N", "D", "E", "K"}, label="library_region" ) ``` The `valid_chars` constraint is enforced during validation and used by Generators to only propose valid characters. *** ## Iteration and Indexing Segments support direct iteration and indexing into the **result pool** (results): ```python python icon="python" theme={null} # Iterate over result sequences for sequence in segment: print(sequence.sequence) # Index directly best = segment[0] print(best.sequence) print(best.metadata["constraints"]) # Count results print(f"{segment.num_results} results, {segment.num_proposals} proposals") ``` *** ## Creation Patterns ```python python icon="python" title="Fixed Flanks + Variable Middle" theme={null} # Optimize the middle region while keeping flanks fixed flank_5 = Segment(sequence="ATGCATGC", sequence_type="dna", label="5_flank") variable = Segment(length=100, sequence_type="dna", label="variable") flank_3 = Segment(sequence="GCATGCAT", sequence_type="dna", label="3_flank") ``` ```python python icon="python" title="Signal Peptide + Domain" theme={null} # Fixed signal peptide with a variable protein domain signal = Segment( sequence="MKFLILLFNILCLFPVLAAD", sequence_type="protein", label="signal_peptide" ) domain = Segment(length=200, sequence_type="protein", label="catalytic_domain") ``` ```python python icon="python" title="CRISPR Guide RNA" theme={null} # Design a guide RNA sequence spacer = Segment(length=20, sequence_type="rna", label="spacer") scaffold = Segment( sequence="GUUUUAGAGCUAGAAAUAGCAAGUUAAAAUAAGGCUAGUCCG", sequence_type="rna", label="scaffold" ) ``` *** ## Serialization Segments serialize to dictionaries, preserving both pools and all metadata: ```python python icon="python" title="Serialize" theme={null} data = segment.to_dict() # { # "original_sequence": { ... }, # "sequence_length": 100, # "proposal_sequences": [{ ... }, { ... }], # "result_sequences": [{ ... }], # "sequence_type": "dna", # "valid_chars": ["A", "C", "G", "T"], # "label": "promoter" # } ``` ```python python icon="python" title="Deserialize" theme={null} restored = Segment.from_dict(data) restored.label # "promoter" restored.sequence_length # 100 restored.num_results # preserved from original ``` *** ## Next Steps > **[Constructs](/docs/language/concepts/constructs)** > > Combine Segments into complete biological designs > **[Generators](/docs/language/concepts/generators)** > > How Generators propose new sequences for Segments > **[Sequences](/docs/language/concepts/sequences)** > > The data model underlying each pool entry > **[Overview](/docs/language/concepts/overview)** > > See how Segments fit into the full architecture # Sequences Source: https://proto.evodesign.org/docs/language/concepts/sequences The fundamental data unit for biological sequence representation # Sequences A **Sequence** is the most fundamental object in Proto. It wraps a biological string (DNA, RNA, protein, or ligand) with type validation, character enforcement, and a metadata system that tracks constraint scores and optimization history. Sequences are rarely created directly; they are created and managed by [Segments](/docs/language/concepts/segments) during optimization. Understanding the Sequence data model is still essential for interpreting results and working with the metadata system. *** ## What is a Sequence? A Sequence bundles three things together: A Sequence bundles a string, a type, and metadata **The string** is the raw biological sequence: nucleotides, amino acids, or a SMILES representation of a small molecule. **The type** determines which characters are valid and how the sequence is validated. **Metadata** tracks constraint scores, system properties, and any custom data attached. *** ## Creating Sequences **Direct Creation** ```python python icon="python" theme={null} from proto_language.core import Sequence # DNA sequence dna = Sequence( sequence="ATGCGATCGATCGATCG", sequence_type="dna" ) # Protein sequence protein = Sequence( sequence="MKFLILLFNILCLFPVLAAD", sequence_type="protein" ) # With custom metadata annotated = Sequence( sequence="AGGAGGTTTTTATG", sequence_type="dna", metadata={"source": "E. coli K-12", "region": "rbs"} ) ``` **Through Segments (typical)** Most Sequences are created implicitly when a [Segment](/docs/language/concepts/segments) is built. The Segment manages dual pools of Sequences during optimization. ```python python icon="python" theme={null} from proto_language.core import Segment # Segment creates internal Sequence objects seg = Segment(sequence="ATGCGATCG", sequence_type="dna") # Access the Sequence objects seg.result_sequences[0].sequence # "ATGCGATCG" seg.result_sequences[0].sequence_type # "dna" seg.result_sequences[0].metadata # {...} ``` *** ## Sequence Types | Type | Valid characters | Typical uses | | - | - | - | | **DNA** | `A` `C` `G` `T` | Promoters, coding sequences, regulatory elements, synthetic gene circuits | | **RNA** | `A` `C` `G` `U` | mRNA, guide RNAs, ribozymes, aptamers, tRNA scaffolds | | **Protein** | The 20 standard amino acids (`A C D E F G H I K L M N P Q R S T V W Y`) | Enzymes, antibodies, structural proteins, peptide therapeutics | | **Ligand** | SMILES syntax (validated by RDKit) | Small molecules, drug proposals, metabolites | > [!NOTE] > > Character validation is **enforced on creation and mutation**. Invalid characters produce a warning but do not terminate the program, allowing flexible handling of edge cases like ambiguity codes. ### Custom Valid Characters The character set can be restricted for specialized applications: ```python python icon="python" theme={null} # Only allow purines purine_only = Sequence( sequence="AAGGAAGG", sequence_type="dna", valid_chars={"A", "G"} ) # Reduced amino acid alphabet (e.g., for directed evolution libraries) reduced = Sequence( sequence="AGSTNDE", sequence_type="protein", valid_chars={"A", "G", "S", "T", "N", "D", "E"} ) ``` *** ## The Metadata System Every Sequence carries a metadata dictionary that tracks system properties, constraint scores, and custom user data. This is how optimization results are communicated. ### Metadata Structure ```python python icon="python" theme={null} seq.metadata # { # "sequence": "ATGCGATCG...", # System: current sequence string # "sequence_length": 100, # System: length of the sequence # "constraints": { # System: constraint results # "GC Content": { # "score": 0.02, # Raw constraint score (0.0 = perfect) # "weight": 1.0, # Constraint weight # "weighted_score": 0.02, # score * weight # "data": { # Constraint-specific data # "gc_content": 52.0 # } # }, # "Structure pLDDT": { # "score": 0.15, # "weight": 2.0, # "weighted_score": 0.30, # "data": { # "plddt": 85.2 # } # } # }, # "generators": {}, # System: per-generator metadata (always present) # "source": "E. coli K-12", # User: custom metadata # } ``` > **System-managed keys (protected)** > > These keys are automatically maintained by the framework. If they are set manually, they are overridden by the computed values, and the framework logs a warning at construction. > > | Key | Type | Description | > | - | - | - | > | `sequence` | `str` | The current sequence string (kept in sync with the `.sequence` property) | > | `sequence_length` | `int` | Length of the current sequence | > | `constraints` | `dict` | Nested dictionary of constraint results, keyed by constraint label | > | `generators` | `dict` | Nested dictionary of per-generator metadata, keyed by generator label | > **Constraint metadata** > > After optimization, each constraint writes its results into `metadata["constraints"][label]`: > > | Field | Type | Description | > | - | - | - | > | `score` | `float` | Raw constraint score: 0.0 (perfect) to 1.0 (worst violation) | > | `weight` | `float` | Weight assigned to this constraint | > | `weighted_score` | `float` | `score * weight`; used for energy calculation | > | `data` | `Any` | Constraint-specific data (e.g., actual GC content, pLDDT value, structure) | > > ```python python icon="python" theme={null} > # Access constraint results after optimization > for seq in segment.result_sequences: > gc_score = seq.metadata["constraints"]["GC Content"]["score"] > gc_actual = seq.metadata["constraints"]["GC Content"]["data"]["gc_content"] > print(f"GC score: {gc_score:.3f}, actual GC: {gc_actual:.1f}%") > ``` > **User-defined metadata** > > Any custom metadata can be attached when creating a Sequence. This metadata persists through optimization. > > ```python python icon="python" theme={null} > seq = Sequence( > sequence="ATGCGATCG", > sequence_type="dna", > metadata={ > "source": "E. coli K-12", > "experiment_id": "EXP-2024-001", > "notes": "Wild-type promoter region" > } > ) > > seq.metadata["source"] # "E. coli K-12" > ``` > > > [!WARNING] > > > > Do not use the reserved keys `sequence`, `sequence_length`, `constraints`, `generators`, `logits`, or `structure` for custom metadata. They are system-managed (the first four are recomputed and override provided values; `logits` and `structure` are first-class `Sequence` fields), and the framework logs a warning at construction if any of the first four are set. *** ## Working with Sequences ### String-Like Operations Sequences support common string operations: ```python python icon="python" theme={null} seq = Sequence(sequence="ATGCGATCGATCG", sequence_type="dna") # Length len(seq) # 13 # String representation str(seq) # "ATGCGATCGATCG" # Indexing and slicing seq[0] # "A" seq[3:6] # "CGA" seq[-3:] # "TCG" ``` ### Mutating Sequences The `.sequence` property is settable. When it is updated, the metadata is automatically kept in sync: ```python python icon="python" theme={null} seq = Sequence(sequence="ATGCGA", sequence_type="dna") seq.sequence = "TTGCGA" # Validated and metadata updated seq.metadata["sequence"] # "TTGCGA" seq.metadata["sequence_length"] # 6 ``` > [!NOTE] > > In practice, Sequences are rarely mutated directly. Generators handle mutation during optimization. *** ## Serialization Sequences serialize to dictionaries for storage or transfer: ```python python icon="python" title="Serialize" theme={null} data = seq.to_dict() # { # "sequence": "ATGCGATCG", # "sequence_type": "dna", # "valid_chars": ["A", "C", "G", "T"], # "metadata": { ... }, # user-provided metadata only # "constraints": { ... }, # per-constraint results (top-level sibling) # "generators": { ... }, # per-generator metadata (top-level sibling) # } # Pass include_logits=True or include_structure=True to add those keys. ``` ```python python icon="python" title="Deserialize" theme={null} restored = Sequence.from_dict(data) restored.sequence # "ATGCGATCG" restored.sequence_type # "dna" ``` *** ## Automatic Type Detection The framework can infer sequence type from the characters present. This is useful when working with sequences of unknown origin: ```python python icon="python" theme={null} from proto_language.core.sequence import detect_sequence_type detect_sequence_type("ATGCGATCG") # "dna" detect_sequence_type("AUGCGAUCG") # "rna" detect_sequence_type("MKFLILLFNILC") # "protein" detect_sequence_type("CCO") # "ligand" (ethanol SMILES) ``` > [!NOTE] > > Detection priority is DNA > RNA > Protein > Ligand. Ambiguous sequences (e.g., "ACGT" could be DNA or protein) default to the more specific type. *** ## Next Steps > **[Segments](/docs/language/concepts/segments)** > > How Segments manage pools of Sequences during optimization > **[Constructs](/docs/language/concepts/constructs)** > > Combining Segments into complete biological designs > **[Constraints](/docs/language/concepts/constraints)** > > How constraints write scores into Sequence metadata > **[Overview](/docs/language/concepts/overview)** > > See the full architecture and design patterns # Tools Source: https://proto.evodesign.org/docs/language/concepts/tools Bioinformatics tools that Proto orchestrates for sequence analysis, structure prediction, and more # Tools > [!NOTE] > > For full tool documentation, API references, and standalone usage guides, see the **[Proto Tools docs](/docs/tools/introduction)**. Tools are standardized Python implementations of 120+ bioinformatics tools: structure predictors, sequence scorers, gene annotators, and alignment engines. When a [constraint](/docs/language/concepts/constraints) needs to predict a protein's 3D structure or search for sequence motifs, it calls a tool. Tools are rarely called directly; constraints call them behind the scenes, and the [optimizer](/docs/language/concepts/optimizers) manages caching and execution. Understanding tools nonetheless helps in configuring constraints effectively. ## The Input / Config / Output Pattern Every tool follows the same three-part pattern using Pydantic models: Tool input and config flowing into the tool function and out as tool output * **Input**: *What* to analyze. The primary data: sequences, structures, files. * **Config**: *How* to analyze it. Parameters and settings. Always optional; sensible defaults are built in. * **Output**: Results plus standardized metadata (execution time, success status, tool ID, warnings). ## Tool Categories > **[Structure Prediction](/docs/tools/structure-prediction/overview)** > > Predict 3D structures from sequences. > > **AlphaFold2**, **AlphaFold3**, **Boltz2**, **Chai1**, **ESMFold**, **Protenix**, **ViennaRNA** > **[Structure Design](/docs/tools/structure-design/overview)** > > Generate novel protein backbone structures. > > **RFDiffusion3** > **[Structure Dynamics](/docs/tools/structure-dynamics/overview)** > > Sample conformational ensembles. > > **BioEmu** > **[Inverse Folding](/docs/tools/inverse-folding/overview)** > > Design sequences for target structures. > > **ProteinMPNN**, **LigandMPNN**, **FAMPNN** > **[Masked Models](/docs/tools/masked-models/overview)** > > Protein language models for scoring and sampling. > > **ESM2**, **ESM3** > **[Causal Models](/docs/tools/causal-models/overview)** > > Autoregressive models for generation and scoring. > > **Evo1**, **Evo2**, **ProGen2** > **[Sequence Scoring](/docs/tools/sequence-scoring/overview)** > > Predict functional effects from genomic sequences. > > **Enformer**, **Borzoi**, **AlphaGenome**, **Segmasker** > **[Gene Annotation](/docs/tools/gene-annotation/overview)** > > Annotate sequences with genes, domains, and motifs. > > **PyHMMER**, **CRISPR-tracr**, **MinCED** > **[Sequence Alignment](/docs/tools/sequence-alignment/overview)** > > Search databases and align sequences. > > **BLAST**, **MMseqs2**, **MAFFT**, **ColabFold Search** > **[ORF Prediction](/docs/tools/orf-prediction/overview)** > > Find open reading frames in DNA. > > **Orfipy**, **Prodigal** > **[RNA Splicing](/docs/tools/rna-splicing/overview)** > > Predict splice sites and specificity. > > **SpliceTransformer** > **[Database Retrieval](/docs/tools/database-retrieval/overview)** > > Fetch sequences and structures from public databases. > > **UniProt**, **PDB**, **NCBI**, **SequenceFetch** > **[Structure Alignment](/docs/tools/structure-alignment/overview)** > > Align and compare 3D protein structures. > > **TMAlign**, **USAlign** ## How Tools Connect to Constraints When a [constraint](/docs/language/concepts/constraints) such as `structure_plddt_constraint` is created, the constraint function internally calls the appropriate tool. Here is the flow: How a constraint calls a tool and returns a normalized score **The tool is configured through the constraint's `function_config`.** For example, the `structure_plddt_constraint` config selects which structure predictor to use: ```python python icon="python" theme={null} from proto_language.constraint import structure_plddt_constraint # The constraint internally calls the specified tool Constraint( inputs=[protein_segment], function=structure_plddt_constraint, function_config={ "structure_tool": "esmfold", # Which tool to use: "esmfold", "boltz2", "alphafold3", ... }, weight=2.0, ) ``` ### Tool Caching When the same sequence is evaluated by multiple constraints that use the same tool, the tool cache prevents redundant computation: ```python python icon="python" theme={null} # Both constraints use ESMFold internally. # The second call hits the cache -- no redundant GPU work. plddt_constraint = Constraint( inputs=[segment], function=structure_plddt_constraint, function_config={"structure_tool": "esmfold"}, ) ptm_constraint = Constraint( inputs=[segment], function=structure_ptm_constraint, function_config={"structure_tool": "esmfold"}, ) ``` The optimizer manages cache lifecycle. See [Optimizers: Tool Cache Management](/docs/language/concepts/optimizers#tool-cache-management) for configuration options. ## GPU vs CPU Tools ### GPU Tools Deep learning models that require NVIDIA GPUs. * **Structure Prediction:** AlphaFold3, Boltz2, Chai1, ESMFold, Protenix * **Inverse Folding:** ProteinMPNN, LigandMPNN * **Language Models:** ESM2, ESM3, Evo2, ProGen2 * **Sequence Scoring:** Enformer, Borzoi, AlphaGenome * **Structure Design:** RFDiffusion3 * **Structure Dynamics:** BioEmu * **RNA Splicing:** SpliceTransformer ### CPU Tools Classical bioinformatics algorithms. Run anywhere. * **Gene Annotation:** PyHMMER, MinCED * **Sequence Alignment:** BLAST, MMseqs2, MAFFT, ColabFold Search * **ORF Prediction:** Orfipy, Prodigal * **Structure Prediction:** ViennaRNA (RNA only) > [!TIP] > > When designing optimization pipelines, put CPU-based filter constraints early to screen out bad proposals before GPU-based scoring constraints run. This minimizes expensive GPU time. ## Next Steps > **[Tools Documentation](/docs/tools/introduction)** > > Full tool API references, standalone usage guides, and detailed documentation > **[Constraints](/docs/language/concepts/constraints)** > > See how tools power constraint evaluation > **[Generators](/docs/language/concepts/generators)** > > Generators that implement language model tools > **[Optimizers](/docs/language/concepts/optimizers)** > > How optimizers manage tool caching # AbLang Perplexity Source: https://proto.evodesign.org/docs/language/constraints/ablang-perplexity Score antibody naturalness by AbLang mean NLL and report perplexity. ![AbLang Perplexity](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/hero.png) > [!NOTE] > > **License:** AbLang is open source and free for academic and commercial use under a BSD-3-Clause license. Please refer to [the license](https://github.com/oxpig/AbLang2/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/ablang/social.png) Go to Tool Page [Open](/docs/tools/masked-models/ablang) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/ablang_perplexity_constraint.py#L234) @articleolsen2022ablang\@articleolsen2024ablang2 ```bibtex theme={null} @article{olsen2022ablang, title={AbLang: an antibody language model for completing antibody sequences}, author={Olsen, Tobias H and Moal, Iain H and Deane, Charlotte M}, journal={Bioinformatics Advances}, volume={2}, number={1}, pages={vbac046}, year={2022}, publisher={Oxford University Press}, doi={10.1093/bioadv/vbac046} } @article{olsen2024ablang2, title={Addressing the antibody germline bias and its effect on language models for improved antibody design}, author={Olsen, Tobias H and Moal, Iain H and Deane, Charlotte M}, journal={Bioinformatics}, volume={40}, number={11}, pages={btae618}, year={2024}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/btae618} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Forward AbLang antibody scoring via masked pseudo-log-likelihood. The returned score is raw AbLang mean negative log-likelihood by default, so lower is better and the forward score matches the loss used by `ablang_perplexity_gradient_backward`. Set `score_mode="ppl"` to return perplexity instead. Metadata always includes `ablang_log_likelihood` (sum of per-residue log-likelihoods), `ablang_avg_log_likelihood` (mean), `ablang_nll`, `ablang_loss`, and `ablang_perplexity`. With no slices, the whole binder is scored as a heavy-only VHH/nanobody. With `heavy_slice` and `light_slice` set, the function extracts VH and VL from a single binder Segment and scores them as a paired scFv. ## API Reference ConfigAbLangPerplexityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/ablang_perplexity_constraint.py#L37) Configuration for AbLang perplexity scoring (forward + gradient). **temperature** `number` *required* Softmax temperature for AbLang (fixed for this constraint, not varied per optimizer step). **use\_ste** `boolean` (default: True) Hard one-hot forward pass with soft-probability gradients. **device** `string` (default: cuda) Device for AbLang execution, e.g. 'cuda' or 'cuda:0'. **heavy\_slice** `array` VH region (start, end) within the binder; set with light\_slice for scFv mode. **light\_slice** `array` VL region (start, end) within the binder; set with heavy\_slice for scFv mode. **score\_mode** `enum` (default: nll) Return raw mean NLL by default, or AbLang perplexity when set to 'ppl'. Options: `nll`, `ppl` **logit\_scale** `number` (default: 1.0) Pre-scale raw logits before AbLang; gradients are scaled back by the same factor. **sequence\_bias** `SequenceLogitBiasConfig` Declarative sequence-symbol bias (canonical 20-AA protein) added before AbLang. ReturnsConstraintOutput Per-proposal AbLang scores with log-likelihood, NLL, loss, and perplexity metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import ablang_perplexity_constraint, AbLangPerplexityConfig constraint = Constraint( inputs=[segment], function=ablang_perplexity_constraint, function_config=AbLangPerplexityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `ablang-perplexity` | | Function | `ablang_perplexity_constraint` | | Category | `sequence_scoring` | | Mode | `dual` | | Uses GPU | `True` | | Supported Types | `protein` | # AF3 Chain-Pair Protein-DNA ipTM Source: https://proto.evodesign.org/docs/language/constraints/af3-chain-pair-prot-dna-iptm Score protein-DNA interface confidence using the chain-pair ipTM matrix, returning the max (or mean) ipTM across all protein-DNA chain pairs. ![AF3 Chain-Pair Protein-DNA ipTM](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/social.png)](/docs/tools/structure-prediction/protenix) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/af3_chain_pair_prot_dna_iptm_constraint.py#L261) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score protein-DNA ipTM from a per-chain-pair ipTM matrix. For each candidate complex: 1. Separate protein and DNA sequences from the input tuple. 2. Build a complex with `num_protein_copies` protein chains and all DNA chains (optionally adding the reverse complement). 3. Run the configured structure predictor and read `chain_pair_iptm`. 4. Pick out the protein-to-DNA entries and aggregate (max or mean). 5. Score: 0.0 (best) when aggregated ipTM >= `desired_iptm`, 1.0 (worst) when ipTM is 0. When the predictor does not expose the per-chain-pair ipTM matrix this raises `RuntimeError`: overall ipTM is not a valid substitute. **Supported tools**: any DNA-capable `StructureBasedConstraintConfig` predictor; AlphaFold3 and Protenix emit the per-chain-pair ipTM matrix under `chain_pair_iptm`, and Boltz-2 emits the same matrix under `pair_chains_iptm`. ## API Reference ConfigAF3ChainPairProtDNAIPTMConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/af3_chain_pair_prot_dna_iptm_constraint.py#L55) Config for the AF3 chain-pair protein-DNA ipTM constraint. Runs a structure prediction for the protein-DNA complex and extracts the pairwise chain ipTM matrix. Only the protein-to-DNA entries are kept; the result is aggregated via `aggregation` (default: max over all protein-DNA chain pairs — both dimer halves, and both DNA strands when `include_reverse_complement` is set), then scored against `desired_iptm`. > [!NOTE] > > The per-chain-pair ipTM matrix (`chain_pair_iptm`) is exposed by both > AlphaFold3 and Protenix. Boltz-2 exposes the same matrix under > `pair_chains_iptm`. A tool that does not surface the matrix raises a > `RuntimeError` — overall ipTM is not a valid substitute. **num\_protein\_copies** `integer` (default: 2) Protein monomer copies in the complex (2=homodimer, 1=monomer); reuses input chains first. **pair\_type** `enum` (default: protein-dna) Interface scored: 'protein-dna' (protein-DNA ipTM) or 'protein-protein' (homodimer ipTM). Options: `protein-dna`, `protein-protein` **desired\_iptm** `number` (default: 0.7) Target protein-DNA chain-pair ipTM. Score is 0 when achieved. **aggregation** `enum` (default: max) Aggregate protein-DNA chain-pair ipTM: 'max' (best pair) or 'mean' (average of pairs). Options: `max`, `mean` **include\_reverse\_complement** `boolean` (default: False) Add the reverse-complement DNA strand when the input has only one DNA sequence. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score in `[0, 1]` (lower is better) with `prot_dna_iptm` / `prot_prot_iptm` / `overall_iptm` metadata and the predicted Structure on slot 0. ## Usage Programming a protein-DNA operator complex with Protenix: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> protomer = Segment(length=120, sequence_type="protein") >>> operator = Segment(length=20, sequence_type="dna") >>> chain_pair_iptm = Constraint( ... inputs=[protomer, operator], ... function=af3_chain_pair_prot_dna_iptm_constraint, ... function_config={"structure_tool": "protenix", "num_protein_copies": 2}, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `af3-chain-pair-prot-dna-iptm` | | Function | `af3_chain_pair_prot_dna_iptm_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # AF3 Off-target ipTM Specificity Source: https://proto.evodesign.org/docs/language/constraints/af3-offtarget-iptm-specificity Prefer high target ipTM and lower off-target ipTM using AF3 ![AF3 Off-target ipTM Specificity](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/social.png)](/docs/tools/structure-prediction/protenix) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/af3_offtarget_iptm_specificity_constraint.py#L227) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score AF3-based off-target specificity margin using ipTM. For each candidate tuple, builds the protein + target-DNA complex and one protein + off-target-DNA complex per off-target motif (motif substituted at `dna_indices`), folds them all in a single `predict_structures` batch, and reads `iptm` from each. The score is the specificity margin `target_iptm - best_off_target_iptm` against `desired_margin`: 0.0 when the margin is met or exceeded, 1.0 when there is no advantage. **Supported tools**: AlphaFold3 (any ipTM-producing structure tool configured via `structure_tool`). ## API Reference ConfigAF3OffTargetIPTMSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/af3_offtarget_iptm_specificity_constraint.py#L99) Configuration for the AF3 off-target ipTM specificity constraint. **target\_dna\_sequence** `string` *required* Full forward DNA scaffold (A/C/G/T) used for target folding. **target\_motif** `string` *required* Target motif in A/C/G/T placed at dna\_indices in the scaffold. **off\_target\_motifs** `List[string]` *required* Off-target motifs substituted at dna\_indices for AF3 specificity. **dna\_indices** `List[integer]` *required* 0-based indices of motif positions in target\_dna\_sequence. **desired\_margin** `number` (default: 0.05) Desired margin target\_iptm - best\_off\_target\_iptm. **include\_reverse\_complement** `boolean` (default: True) Include reverse-complement DNA strand for dsDNA AF3 folding. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-candidate specificity score in `[0, 1]` (lower is better) with `target_iptm` / `best_off_target_iptm` / `iptm_advantage` / `desired_margin` metadata (plus an `iptm_error` flag when the predictor omits `iptm`). The predicted target complex attaches to slot 0. ## Usage Off-target specificity for a designed DNA-binding protein with AF3: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> binder = Segment(length=120, sequence_type="protein") >>> specificity = Constraint( ... inputs=[binder], ... function=af3_offtarget_iptm_specificity_constraint, ... function_config={ ... "structure_tool": "alphafold3", ... "target_dna_sequence": "ACGTACGTACGT", ... "target_motif": "GTAC", ... "off_target_motifs": ["AAAA", "TTTT"], ... "dna_indices": [2, 3, 4, 5], ... }, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `af3-offtarget-iptm-specificity` | | Function | `af3_offtarget_iptm_specificity_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # AlphaGenome Interval Track Source: https://proto.evodesign.org/docs/language/constraints/alphagenome-interval-track Score AlphaGenome track signal over one or more intervals by minimizing or maximizing mean value. ![AlphaGenome Interval Track](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/hero.png) > [!NOTE] > > **License:** AlphaGenome uses Apache-2.0 for code and Custom (AlphaGenome Terms of Use) for model weights and has restrictions around commercial use and may require explicit attribution when utilized. Model weights are gated and require accepting the provider's terms and authenticating with a HuggingFace token. Please refer to the [code license](https://github.com/google-deepmind/alphagenome_research/blob/main/LICENSE) and [model weights license](https://deepmind.google.com/science/alphagenome/model-terms) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/alphagenome) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/alphagenome_interval_track_constraint.py#L375) @articleavsec2026alphagenome ```bibtex theme={null} @article{avsec2026alphagenome, title={Advancing regulatory variant effect prediction with AlphaGenome}, author={Avsec, {\v{Z}}iga and Latysheva, Natasha and Cheng, Jun and Novati, Guido and Taylor, Kyle R and Ward, Tom and Bycroft, Clare and Nicolaisen, Lauren and Arvaniti, Eirini and Pan, Joshua and Thomas, Raina and Dutordoir, Vincent and Perino, Matteo and De, Soham and Karollus, Alexander and Gayoso, Adam and Sargeant, Toby and Mottram, Anne and Wong, Lai Hong and Drot{\'a}r, Pavol and Kosiorek, Adam and Senior, Andrew and Tanburn, Richard and Applebaum, Taylor and Basu, Souradeep and Hassabis, Demis and Kohli, Pushmeet}, journal={Nature}, year={2026}, volume={649}, number={8099}, pages={1206--1218}, doi={10.1038/s41586-025-10014-0} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score mean AlphaGenome track signal over one or more intervals. ## API Reference ConfigAlphaGenomeIntervalTrackConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/alphagenome_interval_track_constraint.py#L24) Configuration for interval track-value scoring with AlphaGenome. **intervals** `List[array]` *required* 0-based half-open intervals scored relative to the target segment. **left\_context** `string` DNA context placed upstream of the target segment before AlphaGenome prediction. **right\_context** `string` DNA context placed downstream of the target segment before AlphaGenome prediction. **context\_length** `integer` (default: 16384) Full sequence length submitted to AlphaGenome after context composition. **ontology\_terms** `List[string]` *required* AlphaGenome ontology term(s) to score. **requested\_output** `enum` (default: RNA\_SEQ) AlphaGenome output type to score. Options: `ATAC`, `CAGE`, `DNASE`, `RNA_SEQ`, `CHIP_HISTONE`, `CHIP_TF`, `SPLICE_SITES`, `SPLICE_SITE_USAGE`, `SPLICE_JUNCTIONS`, `CONTACT_MAPS`, `PROCAP` **track\_name\_keywords** `array` Keywords selecting individual tracks (e.g. \['H3K4me1']) from a bundled output; None = all tracks. **direction** `enum` (default: maximize) Whether to maximize or minimize the interval mean signal. Options: `maximize`, `minimize` **maximize\_inflection\_value** `number` (default: 5.0) Signal value where maximize-mode sigmoid has its inflection. **maximize\_sigmoid\_scale** `number` (default: 1.0) Scale for maximize-mode sigmoid transform. **minimize\_threshold\_value** `number` (default: 1.0) Upper bound for minimize-mode linear score; values above are clipped. **contrastive\_ontology\_terms** `array` Optional off-target cell-type term(s); when set, scores the target-vs-off-target signal margin. **margin\_inflection\_value** `number` (default: 0.0) Signal-difference (target - off-target) where the contrastive sigmoid has its inflection. **margin\_sigmoid\_scale** `number` (default: 1.0) Scale for the contrastive-mode margin sigmoid transform. **model\_version** `string` (default: all\_folds) AlphaGenome model version. **organism** `enum` (default: human) Organism for AlphaGenome prediction. Options: `human`, `mouse` **device** `string` (default: cuda) Device for AlphaGenome prediction. **prediction\_timeout** `integer` (default: 3600) Timeout (seconds) for each AlphaGenome prediction call. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import alphagenome_interval_track_constraint, AlphaGenomeIntervalTrackConfig constraint = Constraint( inputs=[segment], function=alphagenome_interval_track_constraint, function_config=AlphaGenomeIntervalTrackConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `alphagenome-interval-track` | | Function | `alphagenome_interval_track_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # AlphaGenome splice junction score Source: https://proto.evodesign.org/docs/language/constraints/alphagenome-splice-junction Score whether AlphaGenome splice junction predictions align to requested donor/acceptor positions. ![AlphaGenome splice junction score](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/hero.png) > [!NOTE] > > **License:** AlphaGenome uses Apache-2.0 for code and Custom (AlphaGenome Terms of Use) for model weights and has restrictions around commercial use and may require explicit attribution when utilized. Model weights are gated and require accepting the provider's terms and authenticating with a HuggingFace token. Please refer to the [code license](https://github.com/google-deepmind/alphagenome_research/blob/main/LICENSE) and [model weights license](https://deepmind.google.com/science/alphagenome/model-terms) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/alphagenome) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/alphagenome_splice_junction.py#L245) @articleavsec2026alphagenome ```bibtex theme={null} @article{avsec2026alphagenome, title={Advancing regulatory variant effect prediction with AlphaGenome}, author={Avsec, {\v{Z}}iga and Latysheva, Natasha and Cheng, Jun and Novati, Guido and Taylor, Kyle R and Ward, Tom and Bycroft, Clare and Nicolaisen, Lauren and Arvaniti, Eirini and Pan, Joshua and Thomas, Raina and Dutordoir, Vincent and Perino, Matteo and De, Soham and Karollus, Alexander and Gayoso, Adam and Sargeant, Toby and Mottram, Anne and Wong, Lai Hong and Drot{\'a}r, Pavol and Kosiorek, Adam and Senior, Andrew and Tanburn, Richard and Applebaum, Taylor and Basu, Souradeep and Hassabis, Demis and Kohli, Pushmeet}, journal={Nature}, year={2026}, volume={649}, number={8099}, pages={1206--1218}, doi={10.1038/s41586-025-10014-0} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score splice-junction support at configured donor/acceptor positions. ## API Reference ConfigAlphaGenomeSpliceJunctionConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/alphagenome_splice_junction.py#L124) Configuration for AlphaGenome splice-junction scoring. **genomic\_context** `string` *required* Genomic context sequence for cassette integration. **cassette\_left\_context** `string` *required* Left flanking cassette context. **cassette\_right\_context** `string` *required* Right flanking cassette context. **ontology\_terms** `List[string]` *required* AlphaGenome ontology term(s) to score. **donor\_pos** `integer` *required* 0-based donor position in left\_flank + intron\_core + right\_flank. **acceptor\_pos** `integer` *required* 0-based acceptor position in left\_flank + intron\_core + right\_flank. **direction** `enum` (default: max) 'max' rewards junction support; 'min' penalizes it. Options: `max`, `min` **strand** `enum` (default: positive) Track strand subset to aggregate. Options: `positive`, `negative`, `all` **model\_version** `string` (default: all\_folds) AlphaGenome model version. **organism** `enum` (default: human) Organism for AlphaGenome prediction. Options: `human`, `mouse` **device** `string` (default: cuda) Device for AlphaGenome prediction. **prediction\_timeout** `integer` (default: 3600) Timeout in seconds for AlphaGenome prediction. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import alphagenome_splice_junction_constraint, AlphaGenomeSpliceJunctionConfig constraint = Constraint( inputs=[segment], function=alphagenome_splice_junction_constraint, function_config=AlphaGenomeSpliceJunctionConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `alphagenome-splice-junction` | | Function | `alphagenome_splice_junction_constraint` | | Category | `rna_splicing` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # AlphaGenome splice site usage score Source: https://proto.evodesign.org/docs/language/constraints/alphagenome-splice-site-usage Score splice-site usage with AlphaGenome on three segments (left_flank, intron_core, right_flank). ![AlphaGenome splice site usage score](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/hero.png) > [!NOTE] > > **License:** AlphaGenome uses Apache-2.0 for code and Custom (AlphaGenome Terms of Use) for model weights and has restrictions around commercial use and may require explicit attribution when utilized. Model weights are gated and require accepting the provider's terms and authenticating with a HuggingFace token. Please refer to the [code license](https://github.com/google-deepmind/alphagenome_research/blob/main/LICENSE) and [model weights license](https://deepmind.google.com/science/alphagenome/model-terms) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphagenome/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/alphagenome) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/alphagenome_splice_site_usage.py#L249) @articleavsec2026alphagenome ```bibtex theme={null} @article{avsec2026alphagenome, title={Advancing regulatory variant effect prediction with AlphaGenome}, author={Avsec, {\v{Z}}iga and Latysheva, Natasha and Cheng, Jun and Novati, Guido and Taylor, Kyle R and Ward, Tom and Bycroft, Clare and Nicolaisen, Lauren and Arvaniti, Eirini and Pan, Joshua and Thomas, Raina and Dutordoir, Vincent and Perino, Matteo and De, Soham and Karollus, Alexander and Gayoso, Adam and Sargeant, Toby and Mottram, Anne and Wong, Lai Hong and Drot{\'a}r, Pavol and Kosiorek, Adam and Senior, Andrew and Tanburn, Richard and Applebaum, Taylor and Basu, Souradeep and Hassabis, Demis and Kohli, Pushmeet}, journal={Nature}, year={2026}, volume={649}, number={8099}, pages={1206--1218}, doi={10.1038/s41586-025-10014-0} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score AlphaGenome SSU at selected positions in a three-part target. Each input tuple contains three DNA sequences (left\_flank, intron\_core, right\_flank) which are concatenated into a target, wrapped with cassette contexts, and integrated into a genomic context for AlphaGenome prediction. ## API Reference ConfigAlphaGenomeSpliceSiteUsageConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/alphagenome_splice_site_usage.py#L134) Configuration for AlphaGenome splice-site-usage scoring. Takes three segments (left\_flank, intron\_core, right\_flank), concatenates them into a target sequence, wraps with cassette contexts, and integrates into a genomic context for AlphaGenome prediction. Splice positions are specified relative to the concatenated target sequence. **genomic\_context** `string` *required* Genomic context sequence for cassette integration (e.g., AAVS1 safe harbor locus). **cassette\_left\_context** `string` *required* Left flanking context for the cassette (plasmid/gene sequence 5' of the target). **cassette\_right\_context** `string` *required* Right flanking context for the cassette (plasmid/gene sequence 3' of the target). **ontology\_terms** `List[string]` *required* AlphaGenome ontology term(s) to score. **splice\_pos** `List[integer]` *required* 0-indexed position(s) in the concatenated target to evaluate. **direction** `enum` (default: max) 'max' returns 1-mean(SSU); 'min' returns mean(SSU). Options: `max`, `min` **peak\_search\_radius** `integer` (default: 0) Score each splice position as the max usage within +/- this many positions; 0 = exact index. **strand** `enum` (default: positive) Track strand subset to aggregate over. Options: `positive`, `negative`, `all` **model\_version** `string` (default: all\_folds) AlphaGenome model version. **organism** `enum` (default: human) Organism for AlphaGenome prediction. Options: `human`, `mouse` **device** `string` (default: cuda) Device for AlphaGenome prediction. **prediction\_timeout** `integer` (default: 3600) Timeout (seconds) for each AlphaGenome prediction call. ReturnsConstraintOutput One result per input. `score` is in `[0.0, 1.0]` (interpretation depends on direction). `metadata` carries the selected tracks plus `alphagenome_splice_site_usage_raw` and `_score`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import alphagenome_splice_site_usage, AlphaGenomeSpliceSiteUsageConfig constraint = Constraint( inputs=[segment], function=alphagenome_splice_site_usage, function_config=AlphaGenomeSpliceSiteUsageConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `alphagenome-splice-site-usage` | | Function | `alphagenome_splice_site_usage` | | Category | `rna_splicing` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # Balanced Amino Acid Representation Source: https://proto.evodesign.org/docs/language/constraints/balanced-aa Evaluate the presence of underrepresented amino acids in a protein sequence ![Balanced Amino Acid Representation](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/balanced_aa_constraint.py#L67) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate the presence of underrepresented amino acids in protein sequences. This constraint function assesses whether protein sequences have balanced representation of all amino acid types by identifying amino acids that appear below a minimum frequency threshold and penalizing sequences that have too many such underrepresented amino acids. The penalty is scaled based on both the number of excess underrepresented amino acids and the severity of their under-representation. For each input sequence, it calculates amino acid frequencies, identifies underrepresented amino acids, and computes a penalty score if the number of underrepresented amino acids exceeds the configured threshold. ## API Reference ConfigBalancedAaConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/balanced_aa_constraint.py#L12) Configuration for balanced amino acid constraint. This class defines configuration parameters for evaluating whether a protein sequence has balanced representation of all amino acid types. The constraint penalizes sequences that have too many underrepresented amino acids (those appearing below a minimum frequency threshold). The penalty score increases both with the number of underrepresented amino acids beyond the threshold and with the severity of under-representation (how far below min\_aa\_frequency each amino acid falls). **min\_aa\_frequency** `number` (default: 0.02) Minimum acceptable relative frequency for any amino acid type. **max\_underrepresented\_count** `integer` (default: 3) Maximum acceptable number of underrepresented amino acid types. Sequences with more are penalized. ReturnsConstraintOutput One result per sequence. `score` ranges from 0.0 (best, acceptable number of underrepresented amino acids) to 1.0 (worst, many severely underrepresented amino acids), scaled by excess count and severity below the minimum frequency. `metadata` carries: * `underrepresented_aa_score`: Float score indicating overall underrepresentation severity * `amino_acid_counts`: Dictionary mapping amino acids to their counts * `underrepresented_amino_acids`: List of amino acids that are underrepresented * `underrepresented_aa_count`: Integer count of underrepresented amino acid types * `min_aa_frequency_threshold`: The minimum frequency threshold used ## Usage Evaluating amino acid balance in protein: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> config = BalancedAaConfig(min_aa_frequency=0.05, max_underrepresented_count=2) >>> seq = Sequence("AAAAAACCCCCCDDDDDD", sequence_type="protein") >>> results = balanced_aa_constraint([(seq,)], config) >>> # This sequence has only 3 amino acid types, so 17 are underrepresented >>> # This exceeds max_underrepresented_count=2, resulting in a penalty >>> print(results[0].score) # Will be > 0.0 >>> print(results[0].metadata["underrepresented_aa_count"]) # 17 ``` ## Metadata | Property | Value | | - | - | | Key | `balanced-aa` | | Function | `balanced_aa_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # Boltz2 Binding Strength Source: https://proto.evodesign.org/docs/language/constraints/boltz2-binding-strength Evaluate protein-protein, protein-ligand, and protein-nucleic-acid (DNA/RNA) binding (e.g. a repressor on a DNA operator) using Boltz2 structure prediction ![Boltz2 Binding Strength](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/hero.png) > [!NOTE] > > **License:** Boltz-2 is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/jwohlwend/boltz/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/boltz2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/boltz_binding_strength_constraint.py#L216) @articlepassaro2025boltz2\@articlewohlwend2024boltz1 ```bibtex theme={null} @article{passaro2025boltz2, title={Boltz-2: Towards Accurate and Efficient Binding Affinity Prediction}, author={Passaro, Saro and Corso, Gabriele and Wohlwend, Jeremy and Reveiz, Mateo and Thaler, Stephan and Somnath, Vignesh Ram and Getz, Noah and Portnoi, Tally and Roy, Julien and St{\"a}rk, Hannes and Kwabi-Addo, David and Beaini, Dominique and Jaakkola, Tommi and Barzilay, Regina}, journal={bioRxiv}, year={2025}, doi={10.1101/2025.06.14.659707}, publisher={Cold Spring Harbor Laboratory} } @article{wohlwend2024boltz1, title={Boltz-1: Democratizing Biomolecular Interaction Modeling}, author={Wohlwend, Jeremy and Corso, Gabriele and Passaro, Saro and Reveiz, Mateo and Leidal, Ken and Swanson, Wojtek and Turnbull, Robert and Shuaibi, Muhammed and Ahdritz, Gustaf and Getz, Gad and Jaakkola, Tommi and Barzilay, Regina}, journal={bioRxiv}, year={2024}, doi={10.1101/2024.11.19.624167}, publisher={Cold Spring Harbor Laboratory} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate binding strength and quality using Boltz structure prediction. Boltz predicts protein-protein, protein-ligand, protein-DNA, and protein-RNA complex structures and returns confidence metrics (iptm, iplddt, ipde, plddt, ptm, confidence\_score). Each metric is scored as a penalty in `[0.0, 1.0]` against configurable targets/tolerances and combined via weighted averaging; default weights are chosen by complex type. ## API Reference ConfigBoltzBindingStrengthConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/boltz_binding_strength_constraint.py#L49) Configuration for Boltz binding strength constraint. This class defines configuration parameters for evaluating protein-protein, protein-ligand, and protein-nucleic-acid (DNA/RNA) binding using Boltz, a biomolecular structure prediction model. A common use case is scoring a protein occupying a nucleic-acid target (e.g. a repressor bound to a DNA operator) via interface confidence. Boltz predicts complex structures and provides confidence metrics for binding quality, interface accuracy, and overall structure reliability. The constraint evaluates these metrics against target values to assess binding strength and quality. The constraint uses a penalty-based scoring system where each metric is evaluated against its target value and tolerance. Metrics are classified as "higher is better" (e.g., interface confidence scores) or "lower is better" (e.g., predicted distance errors). Penalties are combined using weighted averages, with default weights chosen by complex type (monomer, protein-ligand, or multi-chain — the latter covering both protein-protein and protein-nucleic-acid complexes). > [!NOTE] > > **Metric interpretation:** > > * **iptm/ligand\_iptm/protein\_iptm**: Interface confidence (0-1). Higher = better > binding prediction. Values >0.8 indicate confident binding interfaces. > * **complex\_iplddt**: Interface per-residue confidence (0-1). Higher = more > reliable interface residue predictions. > * **complex\_plddt**: Overall structure confidence (0-1). Similar to ESMFold pLDDT. > * **ptm**: Overall structural accuracy (0-1). Similar to ESMFold pTM. > * **complex\_ipde/complex\_pde**: Predicted distance errors in Ångströms. Lower = > more accurate structure. Values \<3 Å indicate high accuracy. > * **confidence\_score**: Boltz's aggregate confidence combining multiple factors. **desired\_higher** `object` (default: \{'iptm': 0.9, 'ligand\_iptm': 0.8, 'protein\_iptm': 0.85, 'complex\_iplddt': 0.85, 'complex\_plddt': 0.8, 'ptm': 0.7, 'confidence\_score': 0.85}) Target values for 'higher is better' metrics. **desired\_lower** `object` (default: \{'complex\_ipde': 2.0, 'complex\_pde': 2.0}) Target values for 'lower is better' metrics. **tol\_higher** `object` (default: \{'iptm': 0.05, 'ligand\_iptm': 0.1, 'protein\_iptm': 0.07, 'complex\_iplddt': 0.1, 'complex\_plddt': 0.15, 'ptm': 0.15, 'confidence\_score': 0.1}) Tolerances for higher-is-better metrics; once a value falls this far below target, penalty hits 1.0. **tol\_lower** `object` (default: \{'complex\_ipde': 2.0, 'complex\_pde': 3.0}) Tolerances for lower-is-better metrics (Å); once exceeding target by this much, penalty hits 1.0. **weights** `object` Weights for combining penalties **include\_confidence\_score** `boolean` (default: True) Whether to include confidence\_score in penalty calculation (adds weight 0.10) **return\_component** `enum` (default: total\_penalty) Component to return: 'total\_penalty' (weighted combination) or specific metric name Options: `total_penalty`, `iptm`, `ligand_iptm`, `protein_iptm`, `complex_iplddt`, `complex_plddt`, `complex_pde`, `complex_ipde`, `confidence_score`, `ptm` **boltz2\_config** `Boltz2Config` Boltz2 configuration for structure prediction. ReturnsConstraintOutput Per-complex score in `[0.0, 1.0]` (0 = perfect binding). Predicted Boltz structure is attached to the first slot of each complex. `metadata` carries `boltz2_binding` (a list of dictionaries, one per evaluation): * `penalty`: Float overall constraint score (0.0-1.0) * `metrics`: Dictionary of all raw Boltz metrics (iptm, iplddt, etc.) * `penalties`: Dictionary of individual metric penalties before weighting ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import boltz_binding_strength_constraint, BoltzBindingStrengthConfig constraint = Constraint( inputs=[segment], function=boltz_binding_strength_constraint, function_config=BoltzBindingStrengthConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `boltz2-binding-strength` | | Function | `boltz_binding_strength_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna`, `rna`, `protein`, `ligand` | # Borzoi Chromatin Accessibility MORSE Source: https://proto.evodesign.org/docs/language/constraints/borzoi-chromatin-accessibility-morse Score a DNA target for a Morse-code chromatin accessibility pattern using Borzoi. ![Borzoi Chromatin Accessibility MORSE](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/hero.png) > [!NOTE] > > **License:** Borzoi uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/calico/borzoi/blob/main/LICENSE) and [model weights license](https://huggingface.co/johahi/borzoi-replicate-0) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/borzoi) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/borzoi_chromatin_accessibility_morse_constraint.py#L227) @articlelinder2025borzoi ```bibtex theme={null} @article{linder2025borzoi, title={Predicting RNA-seq coverage from DNA sequence as a unifying model of gene regulation}, author={Linder, Johannes and Srivastava, Divyanshi and Yuan, Han and Agarwal, Vikram and Kelley, David R}, journal={Nature Genetics}, volume={57}, number={4}, pages={949--961}, year={2025}, publisher={Nature Publishing Group}, doi={10.1038/s41588-024-02053-6} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score target proposals against a Borzoi chromatin accessibility MORSE objective. ## API Reference ConfigBorzoiChromatinAccessibilityMorseConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/borzoi_chromatin_accessibility_morse_constraint.py#L39) Configuration for Borzoi chromatin accessibility MORSE scoring. **organism** `enum` (default: human) Borzoi species head to use: human or mouse. Options: `human`, `mouse` **pattern** `string` (default: .--. .-. --- - ---) Morse pattern; use '.', '-', and spaces between letters. **dot\_bp** `integer` (default: 25) Length of each dot window. **dash\_bp** `integer` (default: 75) Length of each dash window. **intra\_symbol\_gap\_bp** `integer` (default: 25) Gap between symbols within a letter. **inter\_letter\_gap\_bp** `integer` (default: 75) Gap between letters in the Morse pattern. **pattern\_start\_bp** `integer` (default: 0) Target-relative start coordinate where the Morse pattern begins. **pattern\_normalization** `enum` (default: global\_max) Scale signal by full-output max, target-region max, or not at all. Options: `global_max`, `region_max`, `none` **contrast\_margin** `number` (default: 0.0) Minimum normalized high-minus-low signal margin to reward. **contrast\_weight** `number` (default: 0.0) Penalty weight when the normalized contrast margin is too small. **raw\_amplitude\_weight** `number` (default: 0.0) Reward weight for larger raw target signal range. **high\_window\_reward\_weight** `number` (default: 0.0) Reward weight for larger raw signal in dot and dash windows. **low\_window\_penalty\_weight** `number` (default: 0.0) Penalty weight for larger raw signal in gap windows. **window\_stat\_transform** `enum` (default: log1p) Transform for raw amplitude and window-mean reward terms. Options: `log1p`, `identity` **device** `string` (default: cuda) CUDA device for Borzoi inference. **batch\_size** `integer` (default: 1) Candidate sequences per Borzoi model batch. **trim\_prefix\_bp** `integer` (default: 0) Leading target bases to ignore before accessibility scoring. **borzoi\_output\_tracks** `List[integer]` (default: \[1901]) Borzoi chromatin-accessibility tracks; defaults by organism. **borzoi\_ensemble\_reduce\_method** `enum` (default: mean) How to combine Borzoi replicate signals. Options: `mean`, `min`, `std`, `lcb` ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import borzoi_chromatin_accessibility_morse_constraint, BorzoiChromatinAccessibilityMorseConfig constraint = Constraint( inputs=[segment], function=borzoi_chromatin_accessibility_morse_constraint, function_config=BorzoiChromatinAccessibilityMorseConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `borzoi-chromatin-accessibility-morse` | | Function | `borzoi_chromatin_accessibility_morse_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # Borzoi Track Activity Source: https://proto.evodesign.org/docs/language/constraints/borzoi-track-activity Score DNA target activity on selected Borzoi output tracks. ![Borzoi Track Activity](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/hero.png) > [!NOTE] > > **License:** Borzoi uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/calico/borzoi/blob/main/LICENSE) and [model weights license](https://huggingface.co/johahi/borzoi-replicate-0) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/borzoi/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/borzoi) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/borzoi_track_activity_constraint.py#L185) @articlelinder2025borzoi ```bibtex theme={null} @article{linder2025borzoi, title={Predicting RNA-seq coverage from DNA sequence as a unifying model of gene regulation}, author={Linder, Johannes and Srivastava, Divyanshi and Yuan, Han and Agarwal, Vikram and Kelley, David R}, journal={Nature Genetics}, volume={57}, number={4}, pages={949--961}, year={2025}, publisher={Nature Publishing Group}, doi={10.1038/s41588-024-02053-6} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie) Score target proposals for selected Borzoi output tracks. ## API Reference ConfigBorzoiTrackActivityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/borzoi_track_activity_constraint.py#L54) Configuration for Borzoi track-activity scoring. **organism** `enum` (default: human) Borzoi species head to use: human or mouse. Options: `human`, `mouse` **borzoi\_output\_tracks** `List[integer]` (default: \[0]) Borzoi output track IDs to average before scoring. **score\_intervals** `array` Optional target-relative intervals to score. If omitted, scores the full target segment. **direction** `enum` (default: maximize) Whether high activity or low activity is preferred. Options: `maximize`, `minimize` **activity\_threshold** `number` (default: 200.0) Activity value treated as saturating success for the objective. **borzoi\_ensemble\_reduce\_method** `enum` (default: mean) How to combine Borzoi replicate signals. Options: `mean`, `min`, `std`, `lcb` **device** `string` (default: cuda) CUDA device for Borzoi inference. **batch\_size** `integer` (default: 1) Candidate sequences per Borzoi model batch. **trim\_prefix\_bp** `integer` (default: 0) Leading target bases to ignore before Borzoi scoring. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import borzoi_track_activity_constraint, BorzoiTrackActivityConfig constraint = Constraint( inputs=[segment], function=borzoi_track_activity_constraint, function_config=BorzoiTrackActivityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `borzoi-track-activity` | | Function | `borzoi_track_activity_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # Codon Adaptation Index Source: https://proto.evodesign.org/docs/language/constraints/codon-adaptation-index Drive a coding sequence toward high (or low) codon adaptation index (CAI). ![Codon Adaptation Index](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/codon_adaptation_index_constraint.py#L194) Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Score coding-sequence proposals by Codon Adaptation Index. ## API Reference ConfigCodonAdaptationIndexConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/codon_adaptation_index_constraint.py#L100) Configuration for the Codon Adaptation Index (CAI) constraint. Exactly one reference source must be given: an explicit `reference_weights` table, or a `reference_sequences` set from which relative adaptiveness is derived. **reference\_weights** `object` Codon -> relative adaptiveness in (0,1]; provide this or reference\_sequences. **reference\_sequences** `array` Reference coding sequences to derive relative adaptiveness from. **direction** `enum` (default: max) Whether to maximize ('max') or minimize ('min') the codon adaptation index. Options: `max`, `min` **sigmoid\_center** `number` (default: 0.7) CAI value mapped to energy 0.5 (tunable; CAI is in (0, 1]). **sigmoid\_scale** `number` (default: 0.15) Positive float32-safe width of the sigmoid transform; larger is gentler. ReturnsConstraintOutput One result per sequence. `score` is in `[0.0, 1.0]` (lower is better in the requested direction); `metadata` carries the raw `cai`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import codon_adaptation_index_constraint, CodonAdaptationIndexConfig constraint = Constraint( inputs=[segment], function=codon_adaptation_index_constraint, function_config=CodonAdaptationIndexConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `codon-adaptation-index` | | Function | `codon_adaptation_index_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # CodonFM Fitness Source: https://proto.evodesign.org/docs/language/constraints/codonfm-fitness Optimize the upstream CodonFM/Encodon visible-token fitness proxy in either direction. ![CodonFM Fitness](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/hero.png) > [!NOTE] > > **License:** CodonFM (Encodon) uses Apache-2.0 for code and Custom (NVIDIA Open Model License) for model weights. Please refer to the [code license](https://github.com/NVIDIA-BioNeMo/CodonFM/blob/main/LICENSE) and [model weights license](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/social.png) Go to Tool Page [Open](/docs/tools/masked-models/codonfm) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/codonfm_fitness_constraint.py#L106) @articlecodonfm2025 ```bibtex theme={null} @article{codonfm2025, title={Learning the language of codon translation with CodonFM}, author={Darabi, Sajad and Cao, Fan and Naghipourfar, Mohsen and Rabi, Sara and Sethia, Ankit and Gion, Kyle and Grewal, Jasleen and Cohen, Jonathan and Greenleaf, William and Goodarzi, Hani and Sundaram, Laksshman}, year={2025}, publisher={NVIDIA}, url={https://research.nvidia.com/labs/dbr/assets/data/manuscripts/nv-codonfm-preprint.pdf} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Score proposals by Encodon's upstream non-padding-token mean log-likelihood. This follows `predict_fitness` exactly: the mean includes visible codons and the CLS/SEP special tokens, while excluding padding. ## API Reference ConfigCodonFMFitnessConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/codonfm_fitness_constraint.py#L44) Configuration for the CodonFM coding-sequence fitness constraint. **model\_checkpoint** `enum` (default: encodon\_80m) Encodon checkpoint: encodon\_80m | encodon\_600m | encodon\_1b | encodon\_1b\_cdwt. Options: `encodon_80m`, `encodon_600m`, `encodon_1b`, `encodon_1b_cdwt` **direction** `enum` (default: max) Whether to maximize ('max') or minimize ('min') the coding-sequence fitness. Options: `max`, `min` **sigmoid\_center** `number` (default: -2.0) Upstream non-padding-token mean log-likelihood mapped to energy 0.5 (tunable; negative). **sigmoid\_scale** `number` (default: 1.0) Positive float32-safe width of the sigmoid transform; larger is gentler. **device** `string` (default: cuda) CUDA device used for CodonFM inference; the upstream xFormers path is GPU-only. **batch\_size** `integer` (default: 1) Number of sequences scored per CodonFM GPU batch. ReturnsConstraintOutput One result per proposal. `score` is in `[0.0, 1.0]` (lower is better in the requested direction); `metadata` carries the raw `fitness`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import codonfm_fitness_constraint, CodonFMFitnessConstraintConfig constraint = Constraint( inputs=[segment], function=codonfm_fitness_constraint, function_config=CodonFMFitnessConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `codonfm-fitness` | | Function | `codonfm_fitness_constraint` | | Category | `sequence_scoring` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna`, `rna` | # Consensus Operator Specificity Source: https://proto.evodesign.org/docs/language/constraints/consensus-operator-specificity Consensus DNA-readout specificity (C = z_NA-MPNN + z_DeepPBS) ![Consensus Operator Specificity](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/na_mpnn_specificity/social.png)](/docs/tools/sequence-scoring/na-mpnn-specificity) [![](https://proto-bio.github.io/proto-assets/images/tool/deeppbs_specificity/social.png)](/docs/tools/sequence-scoring/deeppbs-specificity) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/consensus_specificity_constraint.py#L274) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Consensus operator-readout specificity score (C = z\_NA-MPNN + z\_DeepPBS). Predicts (or reuses) a protein-DNA complex for each candidate, runs BOTH NA-MPNN and DeepPBS readout models, computes each model's dyad-aware sliding-window specificity margin (target vs. best off-target), z-normalizes each margin against the shipped reference distribution, and combines them as `C = z_NA-MPNN + z_DeepPBS`. DeepPBS failures degrade to `z_DeepPBS = 0`. ## API Reference ConfigConsensusSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/consensus_specificity_constraint.py#L119) Config for the consensus-operator-specificity constraint. **target\_motif** `string` *required* Target DNA motif in A/C/G/T alphabet. **off\_target\_motifs** `List[string]` *required* Off-target motifs used for the specificity margin. **dna\_indices** `List[integer]` *required* 0-based DNA indices mapped to motif positions. **desired\_margin** `number` (default: 1.0) Sliding-logprob margin scale (kept for parity and metadata). **dna\_chain\_label** `integer` (default: 0) Canonical DNA chain label for motif indexing when multiple DNA chains exist (fwd strand 0). **reference\_path** `string` (default: /Users/bviggiano/Projects/proto-bio/proto-docs/\_proto-language/examples/data/consensus\_specificity\_reference.json) Path to JSON reference margin mean/std for NA-MPNN and DeepPBS. **na\_mpnn\_config** `NAMPNNSpecificityConfig` Tool config for na-mpnn-specificity predictions. **deeppbs\_config** `DeepPBSSpecificityConfig` Tool config for deeppbs-specificity predictions. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput One result per candidate; lower score is better. Score is `0.5 - 0.5 * tanh(C / 2)` so a large positive consensus (strong discrimination) maps toward 0.0. Metadata carries each model's margin, z-score, and the consensus `C`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import consensus_operator_specificity_constraint, ConsensusSpecificityConfig constraint = Constraint( inputs=[segment], function=consensus_operator_specificity_constraint, function_config=ConsensusSpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `consensus-operator-specificity` | | Function | `consensus_operator_specificity_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # CRISPR Array Source: https://proto.evodesign.org/docs/language/constraints/crispr-array Detect CRISPR repeat-spacer arrays in DNA sequences using MinCED. ![CRISPR Array](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/hero.png) > [!NOTE] > > **License:** MinCED has a GPL-3.0 license. Please refer to [the license](https://github.com/ctSkennerton/minced/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/minced/social.png) Go to Tool Page [Open](/docs/tools/gene-annotation/minced) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/crispr_array_constraint.py#L43) @softwareskennerton2019minced ```bibtex theme={null} @software{skennerton2019minced, title={MinCED: Mining CRISPRs in Environmental Datasets}, author={Skennerton, Connor T and Angly, Florent}, year={2019}, url={https://github.com/ctSkennerton/minced}, note={Derived from the CRISPR Recognition Tool (CRT) by Bland et al., 2007} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Require a MinCED-detected CRISPR array in each DNA sequence. ## API Reference ConfigCrisprArrayConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/crispr_array_constraint.py#L16) Configuration for CRISPR array detection. **minced\_config** `MincedConfig` MinCED CRISPR detection configuration. Tune min\_num\_repeats and min\_repeat\_length here. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains array count, first repeat sequence, and a JSON file reference with all MinCED array calls. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import crispr_array_constraint, CrisprArrayConfig constraint = Constraint( inputs=[segment], function=crispr_array_constraint, function_config=CrisprArrayConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `crispr-array` | | Function | `crispr_array_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # CRISPR tracrRNA Source: https://proto.evodesign.org/docs/language/constraints/crispr-tracr-rna Predict tracrRNA candidates for CRISPR loci and optionally require IntaRNA support. ![CRISPR tracrRNA](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/hero.png) > [!NOTE] > > **License:** CRISPRtracrRNA's own code is licensed under MIT, and it federates over bundled data sources and components, each under its own license terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/crispr_tracr_rna/social.png) Go to Tool Page [Open](/docs/tools/gene-annotation/crispr-tracr-rna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/tracr_rna_constraint.py#L47) @articlemitrofanov2022crisprtracrna ```bibtex theme={null} @article{mitrofanov2022crisprtracrna, title={CRISPRtracrRNA: robust approach for CRISPR tracrRNA detection}, author={Mitrofanov, Alexander and Ziemann, Marcus and Alkhnbashi, Omer S and Hess, Wolfgang R and Backofen, Rolf}, journal={Bioinformatics}, volume={38}, number={Supplement\_2}, pages={ii42--ii48}, year={2022}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/btac466} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Require a CRISPRtracrRNA tracrRNA candidate in each DNA sequence. ## API Reference ConfigCrisprTracrRNAConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/tracr_rna_constraint.py#L16) Configuration for tracrRNA prediction in CRISPR loci. **require\_intarna\_interaction** `boolean` (default: True) Require an IntaRNA anti-repeat interaction for the top tracrRNA candidate. **tracr\_config** `CrisprTracrRNAConfig` Advanced CRISPRtracrRNA tool configuration. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains the top tracrRNA sequence, IntaRNA interaction details, interaction energy, and all candidate calls. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import crispr_tracr_rna_constraint, CrisprTracrRNAConstraintConfig constraint = Constraint( inputs=[segment], function=crispr_tracr_rna_constraint, function_config=CrisprTracrRNAConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `crispr-tracr-rna` | | Function | `crispr_tracr_rna_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # DBP Design Metrics Source: https://proto.evodesign.org/docs/language/constraints/dbp-design-metrics Score protein-DNA designs with dbp_design metrics and configurable failure behavior ![DBP Design Metrics](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/social.png)](/docs/tools/structure-prediction/protenix) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dbp_design_metrics_constraint.py#L1202) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate dbp\_design metrics and return normalized penalties in `[0, 1]`. Resolves (reuses or predicts) one protein-operator complex PDB per candidate tuple, scores it with the heavy `dbp_design` PyRosetta metric suite, and converts the extracted metrics into a weighted-composite penalty where `0` is best and `1` is worst. When evaluation fails and `fail_hard` is disabled, returns `failure_score` and records the error in metadata. ## API Reference ConfigDBPDesignMetricsConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dbp_design_metrics_constraint.py#L127) Config for the dbp-design-metrics constraint. Predicts (or reuses) a protein-DNA complex and scores it with the heavy `dbp_design` metric suite (PyRosetta H-bond typing, compactness, interface ddG / CMS / shape complementarity / packstat / buried unsats / RotamerBoltzmann, and notebook-aligned charge ratios). The score is the weight-normalized sum of per-metric penalties clamped to `[0, 1]`, where `0` means every threshold is satisfied and `1` means none are. **dbp\_design\_repo\_path** `string` Path to local dbp\_design repository root; required (no default). **count\_hbond\_script** `string` (default: 2b\_design\_mpnn/count\_hbond\_types.py) Relative path to count\_hbond\_types.py script. **compactness\_script** `string` (default: 2b\_design\_mpnn/compactness\_filter.py) Relative path to compactness\_filter.py script. **pyrosetta\_site\_packages** `string` Optional site-packages path containing pyrosetta when not in the active env. **fail\_hard** `boolean` (default: False) If true, raise on dbp metric tool failures instead of returning failure\_score. **failure\_score** `number` (default: 1.0) Penalty score returned when dbp metric evaluation fails in fail-soft mode. **prefilter\_eq\_path** `string` (default: /Users/bviggiano/Projects/proto-bio/proto-docs/\_proto-language/examples/data/dbp\_prefilter\_eq.txt) Path to calibrated ddG/CMS sigmoid prefilter equation file; None skips the prefilter. **prefilter\_cut\_path** `string` (default: /Users/bviggiano/Projects/proto-bio/proto-docs/\_proto-language/examples/data/dbp\_prefilter\_cut.txt) Path to prefilter log-prob cutoff file; used when prefilter\_cut is None. **prefilter\_cut** `number` Explicit prefilter log-prob cutoff; when None it is loaded from prefilter\_cut\_path. **hbond\_energy\_cutoff** `number` (default: -0.5) HBond energy cutoff passed to count\_hbond\_types. **min\_base\_score** `number` (default: 10.0) Minimum weighted base score required. **min\_phosphate\_score** `number` (default: 0.0) Minimum weighted phosphate score required. **min\_bidentate\_score** `number` (default: 1.0) Minimum weighted bidentate score required. **min\_backbone\_phosphate\_contacts** `integer` (default: 0) Minimum backbone-phosphate H-bond contacts. **min\_compactness\_contacts** `integer` (default: 0) Minimum per-SSE contacts from compactness filter (default makes this penalty component inactive). **max\_loop\_length** `integer` (default: 1000000) Maximum allowed loop length from compactness filter (default makes this penalty component inactive). **require\_motif\_in\_rec\_helix** `boolean` (default: False) Require motif\_in\_rec\_helix metric to be true. **require\_rifres\_in\_rec\_helix** `boolean` (default: False) Require rifres\_in\_rec\_helix metric to be true. **max\_buried\_unsats** `number` (default: 2.0) Maximum allowed buried unsatisfied polar atoms at the interface. **min\_shape\_complementarity** `number` (default: 0.65) Minimum interface shape complementarity score (Sc). **min\_packstat** `number` (default: 0.55) Minimum packstat score for foldability/packing quality. **min\_max\_rboltz\_rkqe** `number` (default: 0.15) Minimum max RotamerBoltzmann-style score over interface RKQE residues. **min\_avg\_top\_two\_rboltz** `number` (default: 0.1) Minimum avg\_top\_two\_rboltz score. **max\_ddg** `number` (default: -15.0) Maximum allowed interface ddG (more negative is better). **min\_contact\_molecular\_surface** `number` (default: 225.0) Minimum required contact molecular surface (CMS). **min\_net\_charge\_over\_sasa** `number` (default: -10.0) Lower bound of the allowed net\_charge\_over\_sasa window. **max\_net\_charge\_over\_sasa** `number` (default: 10.0) Upper bound of the allowed net\_charge\_over\_sasa window. **max\_ddg\_over\_cms** `number` (default: -0.06) Maximum allowed ddg/contact\_molecular\_surface ratio. **substantial\_divergence\_ratio** `number` (default: 0.5) Normalized distance from threshold at which heavy penalties reach full penalty. **base\_weight** `number` (default: 1.0) Weight for base score penalty component. **phosphate\_weight** `number` (default: 1.0) Weight for phosphate score penalty component. **bidentate\_weight** `number` (default: 1.0) Weight for bidentate score penalty component. **backbone\_weight** `number` (default: 1.0) Weight for backbone phosphate contact penalty. **compactness\_weight** `number` (default: 1.0) Weight for compactness contact penalty. **loop\_weight** `number` (default: 1.0) Weight for loop-length penalty component. **motif\_weight** `number` (default: 1.0) Weight for motif-in-recognition-helix check. **rifres\_weight** `number` (default: 1.0) Weight for rifres-in-recognition-helix check. **buried\_unsat\_weight** `number` (default: 1.0) Weight for buried-unsatisfied-polars penalty. **shape\_complementarity\_weight** `number` (default: 1.0) Weight for shape-complementarity penalty. **packstat\_weight** `number` (default: 1.0) Weight for packstat penalty. **rboltz\_weight** `number` (default: 1.0) Weight for max-RKQE RotamerBoltzmann preorganization penalty. **avg\_top\_two\_rboltz\_weight** `number` (default: 1.0) Weight for avg-top-two RotamerBoltzmann preorganization penalty. **ddg\_weight** `number` (default: 2.0) Weight for ddG notebook-alignment penalty. **contact\_molecular\_surface\_weight** `number` (default: 2.0) Weight for CMS notebook-alignment penalty. **net\_charge\_over\_sasa\_weight** `number` (default: 2.0) Weight for net\_charge\_over\_sasa notebook-alignment penalty. **ddg\_over\_cms\_weight** `number` (default: 2.0) Weight for ddg\_over\_cms notebook-alignment penalty. **max\_mpnn\_score** `number` (default: 2.0) Maximum allowed MPNN score when available in candidate metadata. **missing\_mpnn\_score\_penalty** `number` (default: 0.0) Penalty used when MPNN score is unavailable in candidate metadata. **mpnn\_score\_weight** `number` (default: 1.0) Weight for MPNN score threshold penalty. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-candidate score in `[0, 1]` (lower is better) with `dbp_metrics`, `dbp_penalties`, `pdb_path` (and `dbp_metrics_error` on soft failure) metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import dbp_design_metrics_constraint, DBPDesignMetricsConfig constraint = Constraint( inputs=[segment], function=dbp_design_metrics_constraint, function_config=DBPDesignMetricsConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `dbp-design-metrics` | | Function | `dbp_design_metrics_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # DeepPBS Motif Specificity Source: https://proto.evodesign.org/docs/language/constraints/deeppbs-motif-specificity Score DNA motif specificity using DeepPBS predictions ![DeepPBS Motif Specificity](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/deeppbs_specificity/social.png)](/docs/tools/sequence-scoring/deeppbs-specificity) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_specificity_constraint.py#L500) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Specificity score from DeepPBS predicted base-preference matrices. Same scoring as the NA-MPNN constraint, but with DeepPBS predictions. If the DeepPBS tool call fails, every candidate receives the worst score with an explanatory metadata key rather than crashing (structure prediction still raises). ## API Reference ConfigDeepPBSMotifSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_specificity_constraint.py#L201) Config for the deeppbs-motif-specificity constraint. **deeppbs\_config** `DeepPBSSpecificityConfig` Tool config for deeppbs-specificity predictions. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. **target\_motif** `string` *required* Target DNA motif in A/C/G/T alphabet. **off\_target\_motifs** `List[string]` *required* Off-target motifs used for the specificity margin. **dna\_indices** `List[integer]` 0-based DNA indices mapped to motif positions (required only when scoring\_mode='cross\_entropy'). **desired\_margin** `number` (default: 1.0) Specificity advantage satisfying the term; scale follows scoring\_mode (CE or log-prob). **dna\_chain\_label** `integer` (default: 0) Canonical DNA chain label for motif indexing when multiple DNA chains exist (fwd strand 0). **scoring\_mode** `enum` (default: sliding\_logprob) Motif scoring: fixed-index cross\_entropy or sliding-window log-prob. Options: `cross_entropy`, `sliding_logprob` ReturnsConstraintOutput One result per candidate; score 0.0 (best) when the target beats every off-target by `desired_margin`, 1.0 (worst) otherwise. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import deeppbs_motif_specificity_constraint, DeepPBSMotifSpecificityConfig constraint = Constraint( inputs=[segment], function=deeppbs_motif_specificity_constraint, function_config=DeepPBSMotifSpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `deeppbs-motif-specificity` | | Function | `deeppbs_motif_specificity_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # Dinucleotide Composition Source: https://proto.evodesign.org/docs/language/constraints/dinucleotide-composition Match a sequence's dinucleotide-frequency distribution to a reference composition profile. ![Dinucleotide Composition](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/dinucleotide_composition_constraint.py#L137) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score the distance between observed and reference dinucleotide composition. The observed overlapping-dinucleotide frequency distribution of each sequence is compared to `config.reference_frequencies` using the configured distance metric. Lower scores mean the sequence's nucleotide-pair usage is closer to the reference (natural) composition. ## API Reference ConfigDinucleotideCompositionConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/dinucleotide_composition_constraint.py#L37) Configuration for the dinucleotide-composition match constraint. Scores the distance between a sequence's observed dinucleotide-frequency distribution and a reference distribution. The reference is supplied as a mapping of dinucleotide -> frequency (e.g. derived from natural sequences); RNA (`U`) keys are folded onto the DNA alphabet (`T`) and the reference is renormalized to sum to 1. **reference\_frequencies** `object` *required* Target dinucleotide -> frequency mapping (natural composition profile). **distance\_metric** `enum` (default: total\_variation) Distribution distance: 'total\_variation' (0.5\*sum|p-q|) or normalized 'l2'. Options: `total_variation`, `l2` **scale** `number` (default: 1.0) Multiplier applied to the raw distance before clamping to \[0, 1]. ReturnsConstraintOutput One result per sequence. `score` is in `[0, 1]` (0.0 = observed composition matches the reference). `metadata` carries `dinucleotide_distance` (the raw, pre-scale distance) and `dinucleotide_frequencies` (the observed distribution, or `None` when the sequence is too short). ## Usage ```python python icon="python" theme={null} >>> from proto_language.core import Sequence >>> ref = {"AT": 0.6, "TA": 0.4} # matches "ATATAT" exactly -> perfect score >>> cfg = DinucleotideCompositionConfig(reference_frequencies=ref) >>> out = dinucleotide_composition_constraint([(Sequence("ATATAT", "dna"),)], cfg) >>> round(out[0].score, 3) 0.0 ``` ## Metadata | Property | Value | | - | - | | Key | `dinucleotide-composition` | | Function | `dinucleotide_composition_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # DNA Base Contact Quality Source: https://proto.evodesign.org/docs/language/constraints/dna-base-contact-quality Score protein-DNA base contact quality from PDB geometry. Rewards bidentate contacts, diverse readout residues (GLN/ASN/SER/THR/HIS/TYR/TRP over ARG-only), and sufficient base-specific H-bond contacts. Does not require Rosetta relaxation. ![DNA Base Contact Quality](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png)](/docs/tools/structure-prediction/boltz2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_base_contact_quality_constraint.py#L334) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score protein-DNA base contact quality from a predicted complex PDB. Resolves (reuses or predicts) a protein-operator complex PDB per candidate tuple, then scores base-specific contact quality directly from heavy-atom geometry. The score is a weighted combination of bidentate deficit (0.35), base-contact deficit (0.30), unique-residue deficit (0.15), and a diversity deficit weighted by `config.diversity_bonus_weight` (default 0.3), all in `[0, 1]` where 0 is best. ## API Reference ConfigDNABaseContactQualityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_base_contact_quality_constraint.py#L123) Config for geometry-based DNA base contact quality scoring. Scores protein-DNA complexes based on the quality of base-specific contacts, measured directly from heavy-atom distances in a predicted complex PDB without requiring Rosetta relaxation. Inherits the structure-prediction tool selection and per-tool configs from `StructureBasedConstraintConfig`. **contact\_cutoff** `number` (default: 3.5) Heavy-atom distance cutoff for base contacts. **desired\_bidentate** `integer` (default: 2) Target bidentate-contact count (one residue H-bonding 2+ atoms on a base); 0 component when met. **desired\_base\_contacts** `integer` (default: 8) Target number of polar sidechain-to-base contacts. **desired\_unique\_residues** `integer` (default: 4) Target number of unique protein residues contacting bases. **diversity\_bonus\_weight** `number` (default: 0.3) Weight of the diversity term rewarding base-specific readout over nonspecific ARG/LYS charge. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-candidate score in `[0, 1]` (lower is better) with contact-quality metadata (`n_base_contacts`, `n_bidentate`, `n_unique_residues`, `n_specific_residues`, `pct_arg`, `diversity_score`, per-component deficits, and `pdb_path`). Candidates whose structure could not be resolved, or whose PDB is empty/unparseable, receive `MAX_ENERGY`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import dna_base_contact_quality_constraint, DNABaseContactQualityConfig constraint = Constraint( inputs=[segment], function=dna_base_contact_quality_constraint, function_config=DNABaseContactQualityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `dna-base-contact-quality` | | Function | `dna_base_contact_quality_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # DNA Motif Contact Count Source: https://proto.evodesign.org/docs/language/constraints/dna-motif-contact-count Require motif-local protein-DNA contacts in predicted complexes ![DNA Motif Contact Count](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/hero.png) > [!NOTE] > > **License:** AlphaFold3 uses Apache-2.0 for code and Custom (AlphaFold 3 Model Parameters Terms of Use) for model weights and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold3/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold3/blob/main/WEIGHTS_TERMS_OF_USE.md) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold3) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_contact_constraint.py#L423) @articleabramson2024alphafold3 ```bibtex theme={null} @article{abramson2024alphafold3, title={Accurate structure prediction of biomolecular interactions with AlphaFold 3}, author={Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans, Richard and Green, Tim and Pritzel, Alexander and Ronneberger, Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick, Joshua and others}, journal={Nature}, volume={630}, number={8016}, pages={493--500}, year={2024}, publisher={Nature Publishing Group}, doi={10.1038/s41586-024-07487-w} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score motif-local protein-DNA contact deficits in predicted complexes. Predicts (or reuses) one protein-DNA complex per proposal, parses the PDB geometry, and counts heavy-atom contacts between protein residues and the selected DNA motif. The score is the largest of three normalized deficits (contact pairs, unique protein residues, unique DNA positions), so `0` is best (all minimum requirements met) and `1` is worst. ## API Reference ConfigDNAMotifContactCountConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_contact_constraint.py#L119) Configuration for the dna-motif-contact-count constraint. Predicts (or reuses) a protein-DNA complex and counts heavy-atom contacts between protein residues and a selected DNA motif. The score is the largest of three normalized deficits (contact pairs, unique protein residues, unique DNA positions) clamped to `[0, 1]`, where `0` means every minimum requirement is met and `1` means none are. **dna\_indices** `List[integer]` *required* 0-based motif indices on the selected DNA chain. **dna\_chain\_label** `integer` (default: 0) Index of DNA chain in order-of-appearance in the PDB (0-based). **min\_contacts** `integer` (default: 1) Minimum motif-local protein-DNA residue-pair contacts required. **min\_unique\_protein\_residues** `integer` (default: 1) Minimum number of unique contacting protein residues. **min\_unique\_dna\_positions** `integer` (default: 1) Minimum number of motif DNA positions with at least one contact. **contact\_distance\_angstrom** `number` (default: 4.0) Heavy-atom distance cutoff for contact detection. **dna\_atom\_scope** `enum` (default: base) Which DNA atoms are considered for motif contacts. Options: `base`, `any`, `backbone` **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score in `[0, 1]` (lower is better) and metadata describing the motif contacts (counts, the selected DNA chain, motif indices, cutoff, and resolved PDB path). A proposal whose structure shape prevents scoring (no DNA chains, no DNA residues, out-of-range `dna_chain_label` or `dna_indices`) soft-fails to `MAX_ENERGY` with `motif_contact_error` metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import dna_motif_contact_count_constraint, DNAMotifContactCountConfig constraint = Constraint( inputs=[segment], function=dna_motif_contact_count_constraint, function_config=DNAMotifContactCountConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `dna-motif-contact-count` | | Function | `dna_motif_contact_count_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # DNA Phosphate Contact Source: https://proto.evodesign.org/docs/language/constraints/dna-phosphate-contact Score protein-DNA backbone phosphate H-bond contacts from PDB geometry. Mirrors the AlphaFold3 phosphate-contact H-bond term, rewarding protein polar sidechain contacts to DNA phosphate oxygens (optionally weighted by residue type). Does not require Rosetta relaxation. ![DNA Phosphate Contact](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/hero.png) > [!NOTE] > > **License:** AlphaFold3 uses Apache-2.0 for code and Custom (AlphaFold 3 Model Parameters Terms of Use) for model weights and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold3/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold3/blob/main/WEIGHTS_TERMS_OF_USE.md) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold3) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_phosphate_contact_constraint.py#L271) @articleabramson2024alphafold3 ```bibtex theme={null} @article{abramson2024alphafold3, title={Accurate structure prediction of biomolecular interactions with AlphaFold 3}, author={Abramson, Josh and Adler, Jonas and Dunger, Jack and Evans, Richard and Green, Tim and Pritzel, Alexander and Ronneberger, Olaf and Willmore, Lindsay and Ballard, Andrew J and Bambrick, Joshua and others}, journal={Nature}, volume={630}, number={8016}, pages={493--500}, year={2024}, publisher={Nature Publishing Group}, doi={10.1038/s41586-024-07487-w} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score protein-DNA phosphate contacts from a predicted complex PDB. Resolves (reuses or predicts) a protein-operator complex PDB per candidate tuple, then counts protein polar sidechain H-bond contacts to DNA backbone phosphate oxygens directly from heavy-atom geometry. The score is 0 when the integer phosphate-contact count meets the target and rises toward 1 as it falls short, mirroring the base-contact-quality penalty mapping. ## API Reference ConfigDNAPhosphateContactConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_phosphate_contact_constraint.py#L107) Config for geometry-based DNA phosphate contact scoring. Scores protein-DNA complexes based on protein polar side-chain H-bond contacts to DNA backbone phosphate oxygens, measured directly from heavy-atom distances in a predicted complex PDB without requiring Rosetta relaxation. Mirrors the AlphaFold3 phosphate-contact H-bond term (separate from the base-contact H-bond term). Inherits the structure-prediction tool selection and per-tool configs from `StructureBasedConstraintConfig`. **contact\_cutoff** `number` (default: 3.5) Heavy-atom distance cutoff for phosphate contacts. **desired\_phosphate\_contacts** `integer` (default: 2) Target number of unique phosphate H-bond contacts; 0 score when met. **phosphate\_atoms** `List[string]` (default: \['OP1', 'OP2', 'O1P', 'O2P']) DNA backbone phosphate atom names treated as eligible H-bond acceptors (OP1/OP2 + legacy O1P/O2P). **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-candidate score in `[0, 1]` (lower is better) with phosphate-contact metadata (`n_phosphate_contacts`, `weighted_phosphate_score`, `n_unique_residues`, `contacting_types`, and `pdb_path`). Candidates whose structure could not be resolved receive `MAX_ENERGY`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import dna_phosphate_contact_constraint, DNAPhosphateContactConfig constraint = Constraint( inputs=[segment], function=dna_phosphate_contact_constraint, function_config=DNAPhosphateContactConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `dna-phosphate-contact` | | Function | `dna_phosphate_contact_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # Enformer Chromatin Accessibility MORSE Source: https://proto.evodesign.org/docs/language/constraints/enformer-chromatin-accessibility-morse Score a DNA target for a Morse-code chromatin accessibility pattern using Enformer. ![Enformer Chromatin Accessibility MORSE](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/hero.png) > [!NOTE] > > **License:** Enformer uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/deepmind-research/blob/master/LICENSE) and [model weights license](https://github.com/google-deepmind/deepmind-research/blob/master/enformer/README.md) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/enformer/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/enformer) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/enformer_chromatin_accessibility_morse_constraint.py#L227) @articleavsec2021enformer ```bibtex theme={null} @article{avsec2021enformer, title={Effective gene expression prediction from sequence by integrating long-range interactions}, author={Avsec, {\v{Z}}iga and Agarwal, Vikram and Visentin, Daniel and Ledsam, Joseph R and Grabska-Barwinska, Agnieszka and Taylor, Kyle R and Assael, Yannis and Jumper, John and Kohli, Pushmeet and Kelley, David R}, journal={Nature Methods}, volume={18}, number={10}, pages={1196--1203}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41592-021-01252-x} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score target proposals against an Enformer chromatin accessibility MORSE objective. ## API Reference ConfigEnformerChromatinAccessibilityMorseConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/enformer_chromatin_accessibility_morse_constraint.py#L39) Configuration for Enformer chromatin accessibility MORSE scoring. **organism** `enum` (default: human) Enformer species head to use: human or mouse. Options: `human`, `mouse` **pattern** `string` (default: .--. .-. --- - ---) Morse pattern; use '.', '-', and spaces between letters. **dot\_bp** `integer` (default: 25) Length of each dot window. **dash\_bp** `integer` (default: 75) Length of each dash window. **intra\_symbol\_gap\_bp** `integer` (default: 25) Gap between symbols within a letter. **inter\_letter\_gap\_bp** `integer` (default: 75) Gap between letters in the Morse pattern. **pattern\_start\_bp** `integer` (default: 0) Target-relative start coordinate where the Morse pattern begins. **pattern\_normalization** `enum` (default: global\_max) Scale signal by full-output max, target-region max, or not at all. Options: `global_max`, `region_max`, `none` **contrast\_margin** `number` (default: 0.0) Minimum normalized high-minus-low signal margin to reward. **contrast\_weight** `number` (default: 0.0) Penalty weight when the normalized contrast margin is too small. **raw\_amplitude\_weight** `number` (default: 0.0) Reward weight for larger raw target signal range. **high\_window\_reward\_weight** `number` (default: 0.0) Reward weight for larger raw signal in dot and dash windows. **low\_window\_penalty\_weight** `number` (default: 0.0) Penalty weight for larger raw signal in gap windows. **window\_stat\_transform** `enum` (default: log1p) Transform for raw amplitude and window-mean reward terms. Options: `log1p`, `identity` **device** `string` (default: cuda) CUDA device for Enformer inference. **batch\_size** `integer` (default: 1) Candidate sequences per Enformer model batch. **trim\_prefix\_bp** `integer` (default: 0) Leading target bases to ignore before accessibility scoring. **enformer\_output\_tracks** `List[integer]` (default: \[121]) Enformer chromatin-accessibility tracks; defaults by organism. **enformer\_track\_reduce\_method** `enum` (default: mean) How to combine selected Enformer tracks. Options: `mean`, `min`, `std`, `lcb` ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import enformer_chromatin_accessibility_morse_constraint, EnformerChromatinAccessibilityMorseConfig constraint = Constraint( inputs=[segment], function=enformer_chromatin_accessibility_morse_constraint, function_config=EnformerChromatinAccessibilityMorseConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `enformer-chromatin-accessibility-morse` | | Function | `enformer_chromatin_accessibility_morse_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # ESM2 Perplexity Source: https://proto.evodesign.org/docs/language/constraints/esm2-perplexity Score protein naturalness by ESM2 mean NLL and report perplexity. ![ESM2 Perplexity](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/hero.png) > [!NOTE] > > **License:** ESM2 is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/facebookresearch/esm/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/esm2/social.png) Go to Tool Page [Open](/docs/tools/masked-models/esm2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/esm2_perplexity_constraint.py#L176) @articlelin2023esm2 ```bibtex theme={null} @article{lin2023esm2, title={Evolutionary-scale prediction of atomic-level protein structure with a language model}, author={Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Smetanin, Nikita and Verkuil, Robert and Kabeli, Ori and Shmueli, Yaniv and others}, journal={Science}, volume={379}, number={6637}, pages={1123--1130}, year={2023}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.ade2574} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Forward ESM2 protein scoring via masked pseudo-log-likelihood. ## API Reference ConfigESM2PerplexityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/esm2_perplexity_constraint.py#L31) Configuration for ESM2 perplexity scoring (forward + gradient). **model\_checkpoint** `enum` (default: esm2\_t33\_650M\_UR50D) ESM2 model checkpoint to use Options: `esm2_t6_8M_UR50D`, `esm2_t12_35M_UR50D`, `esm2_t30_150M_UR50D`, `esm2_t33_650M_UR50D`, `esm2_t36_3B_UR50D`, `esm2_t48_15B_UR50D` **temperature** `number` *required* Softmax temperature for ESM2 (fixed for this constraint, not varied per optimizer step). **use\_ste** `boolean` (default: True) Hard one-hot forward pass with soft-probability gradients. **device** `string` (default: cuda) Device for ESM2 execution, e.g. 'cuda' or 'cuda:0'. **batch\_size** `integer` AA positions per ESM2 forward pass. Lower if OOM, higher for throughput. **score\_mode** `enum` (default: nll) Return raw mean NLL by default, or ESM2 perplexity when set to 'ppl'. Options: `nll`, `ppl` **logit\_scale** `number` (default: 1.0) Pre-scale raw logits before ESM2; gradients are scaled back by the same factor. **sequence\_bias** `SequenceLogitBiasConfig` Declarative sequence-symbol bias (canonical 20-AA protein) added before ESM2. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import esm2_perplexity_constraint, ESM2PerplexityConfig constraint = Constraint( inputs=[segment], function=esm2_perplexity_constraint, function_config=ESM2PerplexityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `esm2-perplexity` | | Function | `esm2_perplexity_constraint` | | Category | `sequence_scoring` | | Mode | `dual` | | Uses GPU | `True` | | Supported Types | `protein` | # Alignment Gap Gini Source: https://proto.evodesign.org/docs/language/constraints/gap-gini Gap-distribution Gini for pairwise protein alignments (MAFFT); low is even, high is truncated. ![Alignment Gap Gini](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/hero.png) > [!NOTE] > > **License:** MAFFT is open source and free for academic and commercial use under a BSD-3-Clause license. Please refer to [the license](https://mafft.cbrc.jp/alignment/software/license.txt) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/mafft/social.png) Go to Tool Page [Open](/docs/tools/sequence-alignment/mafft) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_alignment/gap_gini_constraint.py#L179) @articlekatoh2013mafft ```bibtex theme={null} @article{katoh2013mafft, title={MAFFT multiple sequence alignment software version 7: improvements in performance and usability}, author={Katoh, Kazutaka and Standley, Daron M}, journal={Molecular Biology and Evolution}, volume={30}, number={4}, pages={772--780}, year={2013}, publisher={Oxford University Press}, doi={10.1093/molbev/mst010} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score pairwise protein alignments by gap-distribution Gini coefficient. For each (query, reference) pair the function: 1. Aligns the two protein sequences with MAFFT. 2. Optionally trims (center-crop 80%, strip end gaps). 3. Computes gap run-length Gini for both sequences; takes the max. 4. Returns 0.0 if gap\_gini \<= max\_gap\_gini, else scales linearly to 1.0. ## API Reference ConfigGapGiniConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_alignment/gap_gini_constraint.py#L133) Configuration for the alignment gap Gini constraint. The Gini coefficient measures inequality in the distribution of gap run-lengths within a pairwise alignment. A value near 0 means gaps are evenly distributed; a value near 1 means they are concentrated in a single run (truncation artifact). **max\_gap\_gini** `number` (default: 0.1) Maximum acceptable gap Gini score (0-1). Alignments above this are penalized. **trim\_alignment** `boolean` (default: True) Center-crop to 80% and strip end gaps before computing the Gini coefficient. ReturnsConstraintOutput One result per pair. `score` is 0.0 if the gap distribution is acceptable, up to 1.0 for the worst violation. The `metadata` carries `gap_gini` (and `gap_gini_error` on failure). ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import gap_gini_constraint, GapGiniConfig constraint = Constraint( inputs=[segment], function=gap_gini_constraint, function_config=GapGiniConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `gap-gini` | | Function | `gap_gini_constraint` | | Category | `sequence_alignment` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # GC Content Source: https://proto.evodesign.org/docs/language/constraints/gc-content Enforce GC content within specified range ![GC Content](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/gc_content_constraint.py#L58) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Enforce GC content within specified range. This constraint function calculates the percentage of guanine (G) and cytosine (C) nucleotides in DNA or RNA sequences and evaluates whether it falls within a specified acceptable range. GC content is a fundamental sequence property that affects DNA stability, melting temperature, gene expression patterns, and technical considerations like PCR amplification efficiency. ## API Reference ConfigGCContentConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/gc_content_constraint.py#L14) Configuration for GC content constraint. This class defines configuration parameters for evaluating the GC content in DNA or RNA sequences. This penalty scales linearly with deviation from the acceptable range. **min\_gc** `number` *required* Minimum acceptable GC content percentage (0-100) **max\_gc** `number` *required* Maximum acceptable GC content percentage (0-100) ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates GC content is within the acceptable range \[min\_gc, max\_gc]. Higher scores indicate greater deviation from the acceptable range, with penalties scaling linearly with the deviation distance. The `metadata` field carries `gc_content`. ## Usage Evaluating GC content constraint: ```python python icon="python" theme={null} >>> seq = Sequence("ATCGATCG", "dna") >>> cfg = GCContentConfig(min_gc=40.0, max_gc=60.0) >>> result = gc_content_constraint([(seq,)], config=cfg) >>> print(result[0].score) # 0.0 (50% GC content is within acceptable range) ``` ## Metadata | Property | Value | | - | - | | Key | `gc-content` | | Function | `gc_content_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # Gyration Radius Source: https://proto.evodesign.org/docs/language/constraints/gyration-radius Filter structures by radius of gyration (compactness) ![Gyration Radius](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/hero.png) > [!NOTE] > > **License:** Structure Metrics is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/evo-design/proto-tools) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/structure_metrics/social.png) Go to Tool Page [Open](/docs/tools/structure-scoring/structure-metrics) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/gyration_radius_constraint.py#L42) @articlekunzmann2023biotite\@articlelabesse1997psea ```bibtex theme={null} @article{kunzmann2023biotite, title={Biotite: new tools for a versatile {Python} bioinformatics library}, author={Kunzmann, Patrick and M{\"u}ller, Tom David and Greil, Maximilian and Krumbach, Jan Hendrik and Anter, Jacob Marcel and Bauer, Daniel and Islam, Faisal and Hamacher, Kay}, journal={BMC Bioinformatics}, volume={24}, number={1}, pages={236}, year={2023}, publisher={BioMed Central}, doi={10.1186/s12859-023-05345-6} } @article{labesse1997psea, title={{P-SEA}: a new efficient assignment of secondary structure from {C}$\alpha$ trace of proteins}, author={Labesse, Gilles and Colloc'h, Nathalie and Pothier, Joel and Mornon, Jean-Paul}, journal={Bioinformatics}, volume={13}, number={3}, pages={291--295}, year={1997}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/13.3.291} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Filter structures by radius of gyration. ## API Reference ConfigGyrationRadiusConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/gyration_radius_constraint.py#L15) Configuration for gyration radius constraint. **max\_gyration\_radius** `number` (default: 45.0) Maximum acceptable radius of gyration in Ångströms (lower values are more compact). ReturnsConstraintOutput Per-proposal score in `[0.0, 1.0]` with `gyration_radius` and `longest_alpha_helix` metadata. Sequences without a structure receive `MAX_ENERGY` and no metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import gyration_radius_constraint, GyrationRadiusConfig constraint = Constraint( inputs=[segment], function=gyration_radius_constraint, function_config=GyrationRadiusConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `gyration-radius` | | Function | `gyration_radius_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein`, `dna` | # K-mer Frequency Source: https://proto.evodesign.org/docs/language/constraints/kmer-frequency Evaluate k-mer frequencies or usage deviations with configurable mer length and scoring mode ![K-mer Frequency](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/kmer_frequency_constraint.py#L122) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate k-mer frequencies or usage deviations with configurable mer length and scoring modes. This constraint function analyzes k-mer (subsequences of length k) composition in DNA, RNA, or protein sequences using two possible scoring modes: 1. **Frequency mode**: Evaluates raw k-mer frequencies (observed\_count / total\_kmers). 2. **Usage deviation mode**: Evaluates observed/expected ratios using a zero-order Markov model where expected = product of individual nucleotide/amino acid frequencies. A ratio of 1.0 indicates observed matches expected composition, > 1.0 indicates overrepresentation, \<1.0 indicates underrepresentation. The penalty is the maximum deviation from the \[min\_value, max\_value] band across observed k-mers; absent k-mers are not penalized. To target a single specific k-mer (including penalizing its absence), use specific\_kmer\_constraint instead. ## API Reference ConfigKmerFrequencyConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/kmer_frequency_constraint.py#L20) Configuration for k-mer frequency constraint. This class defines configuration parameters for evaluating k-mer composition in DNA, RNA, or protein sequences. K-mers are subsequences of length k, and their frequencies can indicate codon bias, tandem repeats, sequence composition biases, CpG islands, etc. The constraint supports two scoring modes: frequency-based (direct k-mer counts) and usage deviation (observed vs expected based on nucleotide/amino acid composition). > [!NOTE] > > **Frequency mode** evaluates raw k-mer proportions (10/100 CG dinucleotides > \= 0.1). Only k-mers that occur in the sequence are scored; absent k-mers > are not penalized. > > **Usage deviation mode** compares observed to expected frequencies under > a zero-order Markov model. Expected frequency = product of individual > nucleotide frequencies. For example, if a sequence is 40% G and 60% C, > the expected CG dinucleotide frequency is 0.4 x 0.6 = 0.24. If observed > is 0.12, usage\_deviation = 0.12/0.24 = 0.5 (underrepresented). > > The penalty is the maximum deviation across observed k-mers. To evaluate a > single specific k-mer (including penalizing its absence), use > specific\_kmer\_constraint instead. **k** `integer` *required* Length of k-mer to analyze (e.g., 2 for dinucleotide, 3 for trinucleotide). **scoring\_mode** `enum` (default: frequency) Scoring metric: 'frequency' uses raw k-mer counts; 'usage\_deviation' uses observed/expected ratios. Options: `frequency`, `usage_deviation` **min\_value** `number` *required* Minimum acceptable frequency/deviation based on scoring\_mode **max\_value** `number` *required* Maximum acceptable frequency/deviation based on scoring\_mode ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates every observed k-mer is within the acceptable range \[min\_value, max\_value]. Higher scores indicate the maximum deviation across observed k-mers. The penalty scales linearly with deviation distance from the acceptable range, capped at 1.0. `metadata` carries (over *observed* k-mers only): **For frequency mode:** * `{k}mer_frequencies`: Dictionary mapping each observed k-mer to its frequency (0.0-1.0). For example, `2mer_frequencies` for dinucleotides. **For usage\_deviation mode:** * `{k}mer_usage_deviations`: Dictionary mapping each observed k-mer to its observed/expected ratio **For sequences too short (\>> coding_seq = Sequence("ATGAAACGTATTGCGTCG", "dna") >>> config = KmerFrequencyConfig( ... k=3, ... scoring_mode="usage_deviation", ... min_value=0.5, # Allow some underrepresentation ... max_value=2.0, # Allow some overrepresentation ... ) >>> results = kmer_frequency_constraint([(coding_seq,)], config) >>> deviations = results[0].metadata["3mer_usage_deviations"] >>> for codon, ratio in sorted(deviations.items(), key=lambda x: x[1], reverse=True): ... print(f"{codon}: {ratio:.2f}x expected") ``` ## Metadata | Property | Value | | - | - | | Key | `kmer-frequency` | | Function | `kmer_frequency_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna`, `protein` | # Longest ORF Length Source: https://proto.evodesign.org/docs/language/constraints/longest-orf-length Require a minimum-length canonical ATG-to-stop ORF on either strand. ![Longest ORF Length](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/hero.png) > [!NOTE] > > **License:** ORFipy is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/urmi-21/orfipy/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png) Go to Tool Page [Open](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/orf_length_constraint.py#L42) @articlesingh2021orfipy ```bibtex theme={null} @article{singh2021orfipy, title={orfipy: a fast and flexible tool for extracting ORFs}, author={Singh, Urminder and Wurtele, Eve Syrkin}, journal={Bioinformatics}, volume={37}, number={18}, pages={3019--3020}, year={2021}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/btab090} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Require the longest canonical ORF in each DNA sequence to meet a length threshold. ## API Reference ConfigLongestOrfLengthConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/orf_length_constraint.py#L15) Configuration for selecting sequences by their longest canonical ORF. **min\_nucleotide\_length** `integer` (default: 3000) Minimum nucleotide length for the longest canonical ATG-to-stop ORF. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains the selected protein sequence, selected ORF length, and ORFipy selection metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import longest_orf_length_constraint, LongestOrfLengthConfig constraint = Constraint( inputs=[segment], function=longest_orf_length_constraint, function_config=LongestOrfLengthConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `longest-orf-length` | | Function | `longest_orf_length_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # Malinois Activity Source: https://proto.evodesign.org/docs/language/constraints/malinois-activity Score regulatory DNA activity using Malinois with max/min cell-type objectives. ![Malinois Activity](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/hero.png) > [!NOTE] > > **License:** Malinois is open source and free for academic and commercial use under an MIT license and may require explicit attribution when utilized. Please refer to [the license](https://github.com/sjgosai/boda2/blob/main/LICENSE.mit) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/malinois/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/malinois) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/malinois_activity_constraint.py#L139) @articlegosai2024machine\@miscgosai2024machine\_zenodo ```bibtex theme={null} @article{gosai2024machine, title={Machine-guided design of cell-type-targeting cis-regulatory elements}, author={Gosai, Sager J. and Castro, Rodrigo I. and Fuentes, Natalia and Butts, John C. and Mouri, Kousuke and Alasoadura, Michael and Kales, Susan and Nguyen, Thanh Thanh L. and Noche, Ramil R. and Rao, Arya S. and Joy, Mary T. and Sabeti, Pardis C. and Reilly, Steven K. and Tewhey, Ryan}, journal={Nature}, volume={634}, pages={1211--1220}, year={2024}, doi={10.1038/s41586-024-08070-z}, url={https://doi.org/10.1038/s41586-024-08070-z} } @misc{gosai2024machine_zenodo, title={Machine-guided design of cell-type-targeting cis-regulatory elements}, author={Gosai, Sager and Castro, Rodrigo and Fuentes, Natalia and Butts, John and Mouri, Kousuke and Alasoadura, Michael and Kales, Susan and Nguyen, Thanh Thanh and Noche, Ramil and Rao, Arya and Joy, Mary Teena and Sabeti, Pardis and Reilly, Steven and Tewhey, Ryan}, year={2024}, publisher={Zenodo}, version={1.0}, doi={10.5281/zenodo.10698014}, url={https://doi.org/10.5281/zenodo.10698014}, note={Supplemental data and resources for the Nature article, including the Malinois model artifact} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score DNA sequences with Malinois as a bounded lower-is-better objective. ## API Reference ConfigMalinoisActivityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/malinois_activity_constraint.py#L24) Configuration for Malinois regulatory DNA activity scoring. Malinois predicts MPRA activity for 200 bp DNA inserts in K562, HepG2, and SK-N-SH contexts. This constraint maps the requested raw cell-type score to a bounded lower-is-better objective: For `direction="max"`: `score = 1 - sigmoid((raw_score - sigmoid_center) / sigmoid_scale)` For `direction="min"`: `score = sigmoid((raw_score - sigmoid_center) / sigmoid_scale)` With the default center of 4.0, raw scores above 4.0 receive penalties below 0.5 in maximization mode and above 0.5 in minimization mode. **cell\_type** `enum` (default: K562) Malinois cell-type output to optimize. Options: `K562`, `HepG2`, `SKNSH` **direction** `enum` (default: max) Use 'max' to encourage activity or 'min' to suppress activity in the selected cell type. Options: `max`, `min` **sigmoid\_center** `number` (default: 4.0) Raw Malinois score where the transformed constraint score is 0.5. **sigmoid\_scale** `number` (default: 1.0) Positive scale for the raw-score sigmoid transform. **seq\_length** `integer` (default: 200) Expected DNA insert length before Malinois MPRA flank padding. **artifact\_path** `string` Optional local artifact tarball path; empty uses the managed cache download. **artifact\_url** `string` (default: [https://zenodo.org/records/10698014/files/MODELS-malinois\_artifacts\_\_20211113\_021200\_\_287348.tar.gz?download=1](https://zenodo.org/records/10698014/files/MODELS-malinois_artifacts__20211113_021200__287348.tar.gz?download=1)) HTTPS URL used to provision the Malinois artifact. **artifact\_md5** `string` (default: 375142a714e7df73c463b46113a65210) Expected MD5 checksum for the downloaded Malinois artifact. **malinois\_dir** `string` Optional local Malinois metadata directory; empty uses the managed cache extraction. **batch\_size** `integer` (default: 1) Number of sequences to score simultaneously on GPU. **device** `string` (default: cuda) Device for Malinois inference. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import malinois_activity_constraint, MalinoisActivityConfig constraint = Constraint( inputs=[segment], function=malinois_activity_constraint, function_config=MalinoisActivityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `malinois-activity` | | Function | `malinois_activity_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # Homopolymer Length Source: https://proto.evodesign.org/docs/language/constraints/max-homopolymer Penalize sequences containing homopolymers longer than specified maximum ![Homopolymer Length](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/max_homopolymer_constraint.py#L54) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Penalize sequences containing homopolymers longer than specified maximum. This constraint function identifies the longest homopolymer (consecutive run of identical nucleotides or amino acids) in each sequence and penalizes sequences where this exceeds a specified maximum length. The penalty uses logarithmic scaling to provide graduated penalties: sequences slightly over the limit receive moderate penalties, while sequences far exceeding the limit receive strong penalties (capped at 1.0). This avoids extreme penalty values while still strongly discouraging very long homopolymers. ## API Reference ConfigMaxHomopolymerConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/max_homopolymer_constraint.py#L17) Configuration for maximum homopolymer constraint. This class defines configuration parameters for limiting homopolymer length in DNA, RNA, or protein sequences. Homopolymers are consecutive runs of the same nucleotide or amino acid (e.g., "AAAAA", "GGGGGG", "SSSSSS"). This constraint uses logarithmic scaling for penalties to avoid extreme values while still penalizing very long homopolymers, providing moderate penalties for slightly exceeding the limit and strong penalties for greatly exceeding the limit. **max\_length** `integer` *required* Maximum allowed run of consecutive identical nucleotides or amino acids; longer runs are penalized. ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates no homopolymers exceed the maximum length (pass). Higher scores indicate longer homopolymers with logarithmic scaling. `metadata` carries: * `max_homopolymer_length`: Integer length of the longest homopolymer found in the sequence. For example, "ATCGAAAAAGTC" would have value 5 (for the "AAAAA" run). ## Usage Avoiding long A/T runs for DNA synthesis: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> seq = Sequence("ATCGATCGTAGC", "dna") >>> config = MaxHomopolymerConfig(max_length=4) >>> results = max_homopolymer_constraint([(seq,)], config) >>> print(results[0].score) # 0.0 (no runs >4) >>> print(results[0].metadata["max_homopolymer_length"]) ``` ## Metadata | Property | Value | | - | - | | Key | `max-homopolymer` | | Function | `max_homopolymer_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna`, `protein` | # Metal3D Probability Source: https://proto.evodesign.org/docs/language/constraints/metal3d-probability Reward protein sequences whose prepared structures contain high-probability Metal3D metal-ion sites. ![Metal3D Probability](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/social.png)](/docs/tools/inverse-folding/fampnn) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/metal3d/social.png)](/docs/tools/structure-scoring/metal3d) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/metal3d_probability_constraint.py#L72) Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie) Score proposals by Metal3D metal-site probability; lower is better. ## API Reference ConfigMetal3DProbabilityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/metal3d_probability_constraint.py#L27) Configuration for the Metal3D probability constraint. **min\_probability** `number` (default: 0.2) Single Metal3D probability floor for detection, annotation, and scoring; overrides tool threshold. **metal3d\_config** `Metal3DPredictionConfig` Metal3D tool configuration; its probability\_threshold is overridden by min\_probability. **structure\_preparation** `StructurePreparationConfig` How to obtain proposal-specific structures before Metal3D scoring. **candidate\_residues** `ResidueSelection` Optional candidate residues to pass to Metal3D. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import metal3d_probability_constraint, Metal3DProbabilityConfig constraint = Constraint( inputs=[segment], function=metal3d_probability_constraint, function_config=Metal3DProbabilityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `metal3d-probability` | | Function | `metal3d_probability_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Minimum Free Energy Source: https://proto.evodesign.org/docs/language/constraints/mfe Drive a sequence toward more-negative (or less-negative) ViennaRNA minimum free energy. ![Minimum Free Energy](https://proto-bio.github.io/proto-assets/images/constraint/mfe/hero.png) > [!NOTE] > > **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/viennarna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/mfe_constraint.py#L73) @articlelorenz2011viennarna ```bibtex theme={null} @article{lorenz2011viennarna, title={ViennaRNA Package 2.0}, author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L}, journal={Algorithms for Molecular Biology}, volume={6}, number={1}, pages={26}, year={2011}, publisher={BioMed Central}, doi={10.1186/1748-7188-6-26} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Score sequences by ViennaRNA minimum free energy. ## API Reference ConfigMFEConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/mfe_constraint.py#L26) Configuration for the minimum-free-energy (MFE) constraint. **direction** `enum` (default: min) 'min' rewards more-negative MFE (more stable); 'max' rewards less structure. Options: `min`, `max` **sigmoid\_center** `number` (default: -30.0) MFE (kcal/mol) mapped to energy 0.5; length-dependent, tune per sequence length. **sigmoid\_scale** `number` (default: 10.0) Positive float32-safe width of the sigmoid transform in kcal/mol; larger is gentler. **temperature** `number` (default: 37.0) ViennaRNA folding temperature in Celsius. ReturnsConstraintOutput One result per sequence. `score` is in `[0.0, 1.0]` (lower is better in the requested direction); `metadata` carries the raw `mfe` (kcal/mol) and the ViennaRNA dot-bracket `structure`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import mfe_constraint, MFEConfig constraint = Constraint( inputs=[segment], function=mfe_constraint, function_config=MFEConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `mfe` | | Function | `mfe_constraint` | | Category | `rna_secondary_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # miRNA Specificity Source: https://proto.evodesign.org/docs/language/constraints/mirna-specificity Score predicted miRNA-mediated repression with miRanda target-site calls. ![miRNA Specificity](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/hero.png) > [!NOTE] > > **License:** miRanda's own code is licensed under GPL-2.0, and it federates over bundled data sources and components, each under its own license terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/miranda/social.png) Go to Tool Page [Open](/docs/tools/gene-annotation/miranda) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/mirna_specificity_constraint.py#L133) @articleenright2003microrna\@articlehofacker1994fast ```bibtex theme={null} @article{enright2003microrna, title={MicroRNA targets in Drosophila}, author={Enright, Anton J and John, Bino and Gaul, Ulrike and Tuschl, Thomas and Sander, Chris and Marks, Debora S}, journal={Genome Biology}, volume={5}, number={1}, pages={R1}, year={2003}, doi={10.1186/gb-2003-5-1-r1} } @article{hofacker1994fast, title={Fast Folding and Comparison of RNA Secondary Structures}, author={Hofacker, Ivo L and Fontana, Walter and Stadler, Peter F and Bonhoeffer, L. S. and Tacker, Manfred and Schuster, Peter}, journal={Monatshefte f{\"u}r Chemie}, volume={125}, number={2}, pages={167--188}, year={1994}, doi={10.1007/BF00818163} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score miRNA target-site burden in target DNA/RNA sequences. ## API Reference ConfigMiRNASpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/mirna_specificity_constraint.py#L18) Configuration for miRNA target-site specificity scoring. **mirna\_queries** `List[string]` *required* miRNA query sequences to scan against each target. **mirna\_ids** `array` Optional identifiers for miRNA queries. **mirna\_weights** `array` Optional nonnegative per-miRNA expression weights matching the miRNA query order. **direction** `enum` (default: maximize) Whether predicted miRNA repression should be high or low. Options: `maximize`, `minimize` **repression\_threshold** `number` (default: 2.0) Aggregated repression score treated as saturating success. **site\_score\_reference** `number` (default: 150.0) Alignment score used to normalize each miRanda hit. **energy\_reference** `number` (default: 20.0) Absolute duplex energy used to normalize each miRanda hit. **miranda\_config** `MirandaConfig` miRanda scan configuration. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import mirna_specificity_constraint, MiRNASpecificityConfig constraint = Constraint( inputs=[segment], function=mirna_specificity_constraint, function_config=MiRNASpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `mirna-specificity` | | Function | `mirna_specificity_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # Gene/Protein Similarity Source: https://proto.evodesign.org/docs/language/constraints/mmseqs-gene-similarity Score percent identity via MMseqs2 (DNA is ORF-predicted first; proteins search directly). ![Gene/Protein Similarity](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/social.png)](/docs/tools/sequence-alignment/mmseqs2)[ ![](https://proto-bio.github.io/proto-assets/images/tool/prodigal/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/carousel.png)ORF Prediction · 2 tools](/docs/tools/orf-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/mmseqs_similarity_constraint.py#L150) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate sequence similarity using MMseqs2 protein database search. This constraint function evaluates whether protein sequences (or proteins predicted from DNA sequences) have percent identity to known proteins within an acceptable range. It uses MMseqs2, an ultra-fast sequence search tool, to search against a reference protein database and calculates similarity scores. For DNA sequences, the function first predicts open reading frames (ORFs) using either Prodigal (for prokaryotes) or ORFipy (viral), then searches the translated proteins. For protein sequences, the search is performed directly. The constraint is satisfied when all database hits have percent identity within the specified \[min\_similarity, max\_similarity] range. ## API Reference ConfigMMseqsSimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/mmseqs_similarity_constraint.py#L29) Configuration for MMseqs gene similarity constraint. This class defines configuration parameters for evaluating sequence similarity (percent identity) to known proteins using MMseqs2, an ultra-fast sequence search tool. For DNA sequences, the constraint first predicts open reading frames (ORFs) using either Prodigal or ORFipy, then searches the translated proteins against a reference database. For protein sequences, the search is performed directly. > [!NOTE] > > For examples with tool configuration, see: > > > > > from proto\_tools import Mmseqs2SearchProteinsConfig > > > > The similarity range \[min\_similarity, max\_similarity] defines acceptable percent > > > > identity. Sequences with hits outside this range are penalized. For example: > > * \[40, 70]: Moderate similarity, useful for inferring functional similarity while > avoiding identical sequences > * \[0, 40]: Low similarity filter, for novelty/uniqueness constraints > * \[80, 100]: High similarity filter, for functional conservation requirements **min\_similarity** `number` *required* Minimum acceptable percent identity (0-100). Lower values are more permissive. **max\_similarity** `number` *required* Maximum acceptable percent identity (0-100). Higher values allow more similar hits. **mmseqs\_db** `string` *required* Path to MMseqs2 protein database for similarity search **mmseqs\_config** `Mmseqs2SearchProteinsConfig` MMseqs configuration (threads, sensitivity, etc.). **orf\_predictor** `enum` (default: prodigal) ORF prediction tool (DNA only): 'orfipy' (viral) or 'prodigal' (prokaryotic). Options: `orfipy`, `prodigal` **orfipy\_config** `OrfipyConfig` ORFipy configuration (DNA only, used if orf\_predictor='orfipy'). **prodigal\_config** `ProdigalConfig` Prodigal configuration (DNA only, used if orf\_predictor='prodigal'). ReturnsConstraintOutput One result per sequence. Score 0.0 means all hits fall within \[min\_similarity, max\_similarity]; higher scores indicate greater deviation. Score 1.0 (MAX\_ENERGY) is returned if no ORFs are found (DNA) or no database hits are found. `metadata` carries: **For DNA sequences (with Prodigal):** * `prodigal_orfs`: List of dictionaries containing predicted ORF information (id, start, end, strand, protein\_sequence, etc.) * `mmseqs_results`: List of dictionaries with MMseqs2 hit information (target\_id, pident, evalue) * `unique_orfs_with_hits`: Integer count of distinct ORFs with at least one database match * `orfs_with_acceptable_similarity`: Integer count of ORFs with hits in acceptable range * `total_orfs_with_hits`: Integer total number of ORF-hit pairs * `similarity_compliance_rate`: Float fraction of hits within acceptable range (0.0-1.0) **For DNA sequences (with ORFipy):** * `orfipy_orfs`: List of dictionaries with ORFipy ORF predictions * Other fields same as Prodigal above **For protein sequences:** * `direct_protein`: Dictionary with protein information (id, sequence, length) * `mmseqs_results`: List of MMseqs2 hit dictionaries * `unique_orfs_with_hits`: Count of distinct ORFs with at least one hit (always 1 or 0 for a single protein, which has exactly one ORF) * `orfs_with_acceptable_similarity`: Count of acceptable hits * `total_orfs_with_hits`: Total hit count * `similarity_compliance_rate`: Fraction of hits in range ## Usage Filtering for sequences with low similarity to existing proteins: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> protein_seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> config = MMseqsSimilarityConfig( ... min_similarity=10.0, max_similarity=30.0, mmseqs_db="/data/databases/uniref90" ... ) >>> results = mmseqs_similarity_constraint([(protein_seq,)], config) >>> print(results[0].score) # 0.0 means no high-similarity hits >>> print(results[0].metadata["similarity_compliance_rate"]) ``` ## Metadata | Property | Value | | - | - | | Key | `mmseqs-gene-similarity` | | Function | `mmseqs_similarity_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # MPNN Perplexity Source: https://proto.evodesign.org/docs/language/constraints/mpnn-perplexity Score protein sequences by ProteinMPNN perplexity against a fixed backbone; differentiable. ![MPNN Perplexity](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/hero.png) > [!NOTE] > > **License:** ProteinMPNN is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/dauparas/ProteinMPNN/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/social.png) Go to Tool Page [Open](/docs/tools/inverse-folding/proteinmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/mpnn_perplexity_constraint.py#L215) @articledauparas2022proteinmpnn ```bibtex theme={null} @article{dauparas2022proteinmpnn, title={Robust deep learning--based protein sequence design using ProteinMPNN}, author={Dauparas, Justas and Anishchenko, Ivan and Bennett, Nathaniel and Bai, Hua and Ragotte, Robert J and Milles, Lukas F and Wicky, Basile IM and Courber, Alexis and de Haas, Rob J and Bethel, Neville and others}, journal={Science}, volume={378}, number={6615}, pages={49--56}, year={2022}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.add2187} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score proposals by ProteinMPNN perplexity against the configured backbone. ## API Reference ConfigMpnnPerplexityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/mpnn_perplexity_constraint.py#L32) Configuration for ProteinMPNN perplexity scoring. **structure\_input** `InverseFoldingStructureInput` *required* Backbone structure, optional chains\_to\_redesign, and fixed positions for direct ProteinMPNN scoring. **model\_choice** `enum` (default: proteinmpnn) Weights: proteinmpnn (=v\_48\_020), v\_48\_\{002,010,030} noise variants, abmpnn, soluble. Options: `proteinmpnn`, `v_48_002`, `v_48_010`, `v_48_030`, `abmpnn`, `soluble` **temperature** `number` (default: 1.0) Softmax temperature for relaxing optimizer logits before ProteinMPNN scoring. **use\_ste** `boolean` (default: True) Hard one-hot forward pass with soft-probability gradients. **device** `string` (default: cuda) Device for ProteinMPNN execution, e.g. 'cuda' or 'cuda:0'. **seed** `integer` Seed for ProteinMPNN decoding-order sampling. None lets proto-tools choose a fresh seed. **score\_mode** `enum` (default: ppl) Return ProteinMPNN perplexity by default, or raw mean NLL when set to 'nll'. Options: `nll`, `ppl` **logit\_scale** `number` (default: 1.0) Pre-scale raw logits before ProteinMPNN; gradients are scaled back by the same factor. **sequence\_bias** `SequenceLogitBiasConfig` Declarative sequence-symbol bias (canonical 20-AA protein) added before ProteinMPNN. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import mpnn_perplexity_constraint, MpnnPerplexityConfig constraint = Constraint( inputs=[segment], function=mpnn_perplexity_constraint, function_config=MpnnPerplexityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `mpnn-perplexity` | | Function | `mpnn_perplexity_constraint` | | Category | `sequence_scoring` | | Mode | `dual` | | Uses GPU | `True` | | Supported Types | `protein` | # MPNN Sequence Probability Source: https://proto.evodesign.org/docs/language/constraints/mpnn-sequence-probability Score sequence compatibility with a structure-conditioned MPNN model. ![MPNN Sequence Probability](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/social.png)](/docs/tools/inverse-folding/proteinmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/mpnn_sequence_probability_constraint.py#L177) Constraint contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Score proposals by MPNN probability; lower is better. ## API Reference ConfigMPNNSequenceProbabilityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_scoring/mpnn_sequence_probability_constraint.py#L34) Configuration for structure-conditioned MPNN sequence-probability scoring. **model** `enum` (default: ligandmpnn) Structure-conditioned model used to score the sequence. Options: `ligandmpnn`, `proteinmpnn` **structure\_source** `enum` (default: configured\_structure\_inputs) Use configured structure\_inputs or each proposal's attached structure for MPNN scoring. Options: `configured_structure_inputs`, `proposal_structure` **structure\_inputs** `array` Structures for MPNN scoring; optional when using proposal structures. **output\_chain\_id** `string` Structure chain corresponding to the scored input sequence. **score\_mode** `enum` (default: probability\_loss) Return 1-exp(avg\_log\_likelihood), mean NLL, or perplexity. Options: `probability_loss`, `nll`, `perplexity` **score\_source** `enum` (default: model) Compute MPNN probability with the model or read pmpnn from proposal generator metadata. Options: `model`, `proposal_metadata` **metadata\_generator\_key** `string` Generator metadata namespace to read for pmpnn when score\_source='proposal\_metadata'. **proteinmpnn\_model\_choice** `enum` (default: proteinmpnn) ProteinMPNN weights used when model='proteinmpnn'. Options: `proteinmpnn`, `v_48_002`, `v_48_010`, `v_48_030`, `abmpnn`, `soluble` **use\_side\_chain\_context** `boolean` (default: False) Whether LigandMPNN scoring conditions on fixed-residue sidechain atoms. **cutoff\_for\_score** `number` (default: 8.0) Ligand-residue distance cutoff (Å) used by LigandMPNN scoring. **ligand\_mpnn\_model\_type** `enum` (default: ligand\_mpnn) LigandMPNN implementation used for scoring: Foundry-backed ligand\_mpnn or original LigandMPNN. Options: `ligand_mpnn`, `original` **ligand\_mpnn\_checkpoint\_path** `string` Optional explicit LigandMPNN checkpoint path. **seed** `integer` Seed for MPNN scoring. None lets proto-tools choose its default seed behavior. **device** `string` (default: cuda) Device for MPNN scoring. **verbose** `boolean` (default: False) Whether to print MPNN scoring progress. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import mpnn_sequence_probability_constraint, MPNNSequenceProbabilityConfig constraint = Constraint( inputs=[segment], function=mpnn_sequence_probability_constraint, function_config=MPNNSequenceProbabilityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `mpnn-sequence-probability` | | Function | `mpnn_sequence_probability_constraint` | | Category | `sequence_scoring` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # NA-MPNN Motif Specificity Source: https://proto.evodesign.org/docs/language/constraints/na-mpnn-motif-specificity Score DNA motif specificity using NA-MPNN predictions ![NA-MPNN Motif Specificity](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/na_mpnn_specificity/social.png)](/docs/tools/sequence-scoring/na-mpnn-specificity) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_specificity_constraint.py#L456) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Specificity score from NA-MPNN predicted base-preference matrices. Predicts (or reuses) a protein-DNA complex for each candidate, predicts a per-position base PPM with NA-MPNN, and scores the specificity advantage of the target motif over the best off-target relative to `desired_margin` (using the configured `scoring_mode`). ## API Reference ConfigNAMPNNMotifSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/dna_motif_specificity_constraint.py#L168) Config for the na-mpnn-motif-specificity constraint. **na\_mpnn\_config** `NAMPNNSpecificityConfig` Tool config for na-mpnn-specificity predictions. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. **target\_motif** `string` *required* Target DNA motif in A/C/G/T alphabet. **off\_target\_motifs** `List[string]` *required* Off-target motifs used for the specificity margin. **dna\_indices** `List[integer]` 0-based DNA indices mapped to motif positions (required only when scoring\_mode='cross\_entropy'). **desired\_margin** `number` (default: 1.0) Specificity advantage satisfying the term; scale follows scoring\_mode (CE or log-prob). **dna\_chain\_label** `integer` (default: 0) Canonical DNA chain label for motif indexing when multiple DNA chains exist (fwd strand 0). **scoring\_mode** `enum` (default: sliding\_logprob) Motif scoring: fixed-index cross\_entropy or sliding-window log-prob. Options: `cross_entropy`, `sliding_logprob` ReturnsConstraintOutput One result per candidate; score 0.0 (best) when the target beats every off-target by `desired_margin`, 1.0 (worst) otherwise. Metadata carries the target/off-target scores and advantage. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import na_mpnn_motif_specificity_constraint, NAMPNNMotifSpecificityConfig constraint = Constraint( inputs=[segment], function=na_mpnn_motif_specificity_constraint, function_config=NAMPNNMotifSpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `na-mpnn-motif-specificity` | | Function | `na_mpnn_motif_specificity_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # Operator Site Occlusion Source: https://proto.evodesign.org/docs/language/constraints/operator-site Score presence of an inverted-repeat operator occluding the -35/-10 box or TSS ![Operator Site Occlusion](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/operator_site_constraint.py#L250) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score whether a promoter carries an occluding inverted-repeat operator. Each sequence is anchored to its best consensus -35/-10 promoter, the -35 box, -10 box, and a downstream TSS window are taken as occlusion targets, and the sequence is scanned for inverted-repeat operators (two half-sites of length > \= `min_half_site` separated by a gap \<= `max_gap` whose first half-site > matches the reverse complement of the second within `max_mismatch` > mismatches). The best operator that overlaps a target by >= `min_overlap` bp > determines the score. ## API Reference ConfigOperatorSiteConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/operator_site_constraint.py#L61) Configuration for the repressor-operator presence constraint. Locates the -35 / -10 boxes by best consensus match, defines a TSS window just downstream of the -10 box, then scans for inverted-repeat operators (two half-sites separated by a short gap whose first half-site matches the reverse complement of the second) and checks whether any occludes a promoter element. Lower score = an occluding operator is present. **min\_half\_site** `integer` (default: 7) Minimum half-site length (bp) for an inverted-repeat operator candidate. **max\_gap** `integer` (default: 1) Maximum gap (bp) between the two operator half-sites. **max\_mismatch** `integer` (default: 1) Max Hamming mismatches between half-site 1 and reverse complement of half-site 2. **min\_overlap** `integer` (default: 3) Minimum overlap (bp) between an operator and a -35/-10/TSS element to occlude it. **consensus\_35** `string` (default: TTGACA) Consensus -35 box (6 bp) used to anchor the promoter. **consensus\_10** `string` (default: TATAAT) Consensus -10 box (6 bp) used to anchor the promoter. **promoter\_min\_spacer** `integer` (default: 14) Minimum -35/-10 spacer (bp) considered when anchoring the promoter. **promoter\_max\_spacer** `integer` (default: 20) Maximum -35/-10 spacer (bp) considered when anchoring the promoter. **tss\_window** `integer` (default: 6) Width (bp) of the TSS window placed just downstream of the -10 box. ReturnsConstraintOutput One result per sequence. `score` is 0.0 when an occluding operator (mismatch \<= `max_mismatch`) is present and rises toward 1.0 as the best occluding candidate drifts away from a valid operator (always >= 0.5 when no valid operator occludes a target, so `threshold=0.5` acts as a presence filter). `metadata` carries an `operator` dict with the located boxes and best-operator details (`None` when no candidate can occlude a target). ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import operator_site_constraint, OperatorSiteConfig constraint = Constraint( inputs=[segment], function=operator_site_constraint, function_config=OperatorSiteConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `operator-site` | | Function | `operator_site_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # Overall Protein Quality Source: https://proto.evodesign.org/docs/language/constraints/overall-protein-quality Evaluate overall protein quality using multiple sub-constraints ![Overall Protein Quality](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/prodigal/social.png)](/docs/tools/orf-prediction/prodigal) [![](https://proto-bio.github.io/proto-assets/images/tool/segmasker/social.png)](/docs/tools/sequence-scoring/segmasker) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/overall_protein_quality_constraint.py#L340) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate overall protein quality using multiple configurable sub-constraints. This constraint function provides a comprehensive assessment of protein quality by evaluating multiple aspects including sequence length, structural complexity, repetitiveness, amino acid diversity, and balanced amino acid representation. For DNA sequences, it first predicts protein-coding regions using Prodigal, then evaluates all predicted proteins. For protein sequences, it evaluates them directly. The function aggregates scores from enabled sub-constraints by averaging them and clipping to \[0.0, 1.0]. Use the native `Constraint(threshold=...)` parameter for pass/fail filtering. ## API Reference ConfigOverallProteinQualityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/overall_protein_quality_constraint.py#L250) Configuration for the overall protein quality constraint. This configuration class orchestrates multiple protein quality sub-constraints that can be enabled or disabled individually. It provides a flexible framework for comprehensive protein quality assessment by combining various metrics including sequence length, structural complexity, repetitiveness, amino acid diversity, and balanced amino acid representation. The configuration uses a nested structure where all sub-constraint parameters are exposed through a single `protein_quality_config` attribute of type `ProteinQualitySubConfig`. This design allows for easy serialization in UI/API schemas while maintaining clear organization of constraint-specific parameters. At least one sub-constraint must be enabled for the configuration to be valid. This is enforced through a model validator that runs after initialization. > [!NOTE] > > The nested `protein_quality_config` provides access to: > > * **Length constraint**: Validates protein length against min/max range > or target value > * **Complexity constraint**: Detects low-complexity regions using segmasker > * **Repetitiveness constraint**: Identifies repeated k-mer patterns > * **Diversity constraint**: Ensures adequate amino acid type diversity > * **Balanced amino acids constraint**: Checks for underrepresented amino > acid types > > Each sub-constraint can be independently enabled/disabled and configured > with specific parameters. See `ProteinQualitySubConfig` documentation > for complete parameter details. > > For more details, see: > > * `ProteinQualitySubConfig`: Detailed documentation of all > sub-constraint parameters and configuration options > * `overall_protein_quality_constraint`: The constraint function > that uses this configuration > * `SequenceLengthConfig`: Configuration for length constraint > * `ProteinComplexityConfig`: Configuration for complexity constraint > * `ProteinRepetitivenessConfig`: Configuration for repetitiveness > constraint > * `ProteinDiversityConfig`: Configuration for diversity constraint > * `BalancedAaConfig`: Configuration for balanced amino acids > constraint **protein\_quality\_config** `ProteinQualitySubConfig` *required* Nested configuration for protein quality checks ReturnsConstraintOutput One result per sequence. Scores range from 0.0 (best) to 1.0 (worst) and represent the average of all enabled sub-constraint scores, clipped to \[0.0, 1.0]. For DNA sequences, the score reflects the average quality across all predicted proteins. `metadata` carries: **For DNA sequences:** * `prodigal_proteins`: List of dicts of predicted proteins from Prodigal, each with protein ID, sequence, length, etc. (or `None` if no ORFs were predicted) * `prodigal_protein_count`: Integer count of predicted ORFs * `predicted_protein_count`: Integer count of proteins (same as prodigal\_protein\_count) * `avg_constraint_score`: Float average quality score across all predicted proteins * `protein_quality_details`: List of dictionaries, one per predicted protein, each containing: * `protein_id`: String identifier from Prodigal * `length`: Integer protein length in amino acids * `avg_constraint_score`: Float average across enabled constraints * `quality_scores`: Dictionary mapping constraint names to scores * `metadata`: Dictionary of additional constraint-specific metadata **For protein sequences:** * `protein_quality_scores`: Dictionary mapping constraint names (e.g., "length", "complexity", "repetitiveness", "diversity", "balanced\_aas") to their individual scores * `avg_constraint_score`: Float average across all enabled constraints ## Usage Using all available constraints with custom thresholds: ```python python icon="python" theme={null} >>> quality_config = ProteinQualitySubConfig( ... enable_length=True, ... length_target_length=300, ... enable_complexity=True, ... complexity_max_low_complexity=0.25, ... enable_repetitiveness=True, ... repetitiveness_max_repetitiveness=0.08, ... repetitiveness_min_repeat_length=3, ... enable_diversity=True, ... diversity_min_diversity=0.75, ... enable_balanced_aas=True, ... balanced_min_aa_frequency=0.03, ... balanced_max_underrepresented_count=2, ... ) >>> overall_cfg = OverallProteinQualityConfig(protein_quality_config=quality_config) >>> protein_seq = Sequence("MKYIVAVAG...", "protein") >>> results = overall_protein_quality_constraint([(protein_seq,)], overall_cfg) ``` ## Metadata | Property | Value | | - | - | | Key | `overall-protein-quality` | | Function | `overall_protein_quality_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # PARADE UTR activity Source: https://proto.evodesign.org/docs/language/constraints/parade-utr-activity Drive a UTR toward high or low activity in one cell line using the PARADE model. ![PARADE UTR activity](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/hero.png) > [!NOTE] > > **License:** PARADE is open source and free for academic and commercial use under an MIT license and may require explicit attribution when utilized. Please refer to [the license](https://github.com/autosome-ru/parade/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/parade/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/parade) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_activity_constraint.py#L262) @articlekhoroshkin2024parade ```bibtex theme={null} @article{khoroshkin2024parade, title={A generative framework for enhanced cell-type specificity in rationally designed mRNAs}, author={Khoroshkin, Matvei and Zinkevich, Arsenii and Aristova, Elizaveta and Yousefi, Hassan and Lee, Sean B. and Mittmann, Tabea and Manegold, Karoline and Penzar, Dmitry and Raleigh, David R. and Kulakovskiy, Ivan V. and Goodarzi, Hani}, journal={bioRxiv}, year={2024}, publisher={Cold Spring Harbor Laboratory}, doi={10.1101/2024.12.31.630783} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/74315203?v=4\&s=64)roknabadi](https://github.com/roknabadi) Score UTR proposals by predicted single-cell activity. ## API Reference ConfigParadeUTRActivityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_activity_constraint.py#L49) Configuration for the single-cell PARADE UTR activity constraint. **construct\_type** `enum` (default: utr5) PARADE UTR model to score with: 'utr5' (5' UTR) or 'utr3' (3' UTR). Options: `utr5`, `utr3` **cell\_type** `enum` (default: c2) PARADE cell code whose predicted activity is scored. Options: `c1`, `c2`, `c4`, `c6`, `c17`, `c13` **direction** `enum` (default: max) Whether to maximize ('max') or minimize ('min') the activity. Options: `max`, `min` **sigmoid\_center** `number` (default: 2.0) Raw PARADE activity mapped to energy 0.5. **sigmoid\_scale** `number` (default: 1.0) Positive float32-safe width of the sigmoid transform; larger is gentler. **temperature** `number` (default: 1.0) Fallback softmax temperature for direct gradient calls; optimizer schedules take precedence. **device** `string` (default: cuda) Device used for PARADE inference. **batch\_size** `integer` (default: 1) Number of sequences scored per PARADE GPU batch. ReturnsConstraintOutput One result per proposal. `score` is in `[0.0, 1.0]` (lower is better in the requested direction); `metadata` carries the raw `activity`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import parade_utr_activity_constraint, ParadeUTRActivityConfig constraint = Constraint( inputs=[segment], function=parade_utr_activity_constraint, function_config=ParadeUTRActivityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `parade-utr-activity` | | Function | `parade_utr_activity_constraint` | | Category | `rna_expression` | | Mode | `dual` | | Uses GPU | `True` | | Supported Types | `dna`, `rna` | # PARADE UTR cell-type specificity Source: https://proto.evodesign.org/docs/language/constraints/parade-utr-specificity Drive a UTR toward high on-target and low off-target activity using the PARADE model. ![PARADE UTR cell-type specificity](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/hero.png) > [!NOTE] > > **License:** PARADE is open source and free for academic and commercial use under an MIT license and may require explicit attribution when utilized. Please refer to [the license](https://github.com/autosome-ru/parade/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/parade/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/parade) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_specificity_constraint.py#L285) @articlekhoroshkin2024parade ```bibtex theme={null} @article{khoroshkin2024parade, title={A generative framework for enhanced cell-type specificity in rationally designed mRNAs}, author={Khoroshkin, Matvei and Zinkevich, Arsenii and Aristova, Elizaveta and Yousefi, Hassan and Lee, Sean B. and Mittmann, Tabea and Manegold, Karoline and Penzar, Dmitry and Raleigh, David R. and Kulakovskiy, Ivan V. and Goodarzi, Hani}, journal={bioRxiv}, year={2024}, publisher={Cold Spring Harbor Laboratory}, doi={10.1101/2024.12.31.630783} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/74315203?v=4\&s=64)roknabadi](https://github.com/roknabadi) Score UTR proposals with matched maximize-on and minimize-off activity terms. ## API Reference ConfigParadeUTRSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_specificity_constraint.py#L50) Configuration for the PARADE UTR cell-type-specificity constraint. **construct\_type** `enum` (default: utr5) PARADE UTR model to score with: 'utr5' (5' UTR) or 'utr3' (3' UTR). Options: `utr5`, `utr3` **on\_target** `enum` (default: c2) PARADE cell code whose predicted activity should be maximized. Options: `c1`, `c2`, `c4`, `c6`, `c17`, `c13` **off\_target** `enum` (default: c6) PARADE cell code whose predicted activity should be minimized. Options: `c1`, `c2`, `c4`, `c6`, `c17`, `c13` **sigmoid\_center** `number` (default: 2.0) Raw PARADE activity at the shared forward/gradient sigmoid midpoint. **sigmoid\_scale** `number` (default: 1.0) Positive float32-safe width of the shared sigmoid transform; larger is gentler. **temperature** `number` (default: 1.0) Fallback softmax temperature for direct gradient calls; optimizer schedules take precedence. **device** `string` (default: cuda) Device used for PARADE inference. **batch\_size** `integer` (default: 1) Number of sequences scored per PARADE GPU batch. ReturnsConstraintOutput One result per proposal. `score` is the mean of the maximize-on-target and minimize-off-target sigmoid energies in `[0.0, 1.0]`; `metadata` carries both raw activities and their difference. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import parade_utr_specificity_constraint, ParadeUTRSpecificityConfig constraint = Constraint( inputs=[segment], function=parade_utr_specificity_constraint, function_config=ParadeUTRSpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `parade-utr-specificity` | | Function | `parade_utr_specificity_constraint` | | Category | `rna_expression` | | Mode | `dual` | | Uses GPU | `True` | | Supported Types | `dna`, `rna` | # PARADE 3' UTR stability Source: https://proto.evodesign.org/docs/language/constraints/parade-utr-stability Drive a 3' UTR toward high or low predicted mRNA stability using the PARADE model. ![PARADE 3' UTR stability](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/hero.png) > [!NOTE] > > **License:** PARADE is open source and free for academic and commercial use under an MIT license and may require explicit attribution when utilized. Please refer to [the license](https://github.com/autosome-ru/parade/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/parade/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/parade) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_stability_constraint.py#L93) @articlekhoroshkin2024parade ```bibtex theme={null} @article{khoroshkin2024parade, title={A generative framework for enhanced cell-type specificity in rationally designed mRNAs}, author={Khoroshkin, Matvei and Zinkevich, Arsenii and Aristova, Elizaveta and Yousefi, Hassan and Lee, Sean B. and Mittmann, Tabea and Manegold, Karoline and Penzar, Dmitry and Raleigh, David R. and Kulakovskiy, Ivan V. and Goodarzi, Hani}, journal={bioRxiv}, year={2024}, publisher={Cold Spring Harbor Laboratory}, doi={10.1101/2024.12.31.630783} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/74315203?v=4\&s=64)roknabadi](https://github.com/roknabadi) Score 3' UTR proposals by predicted mRNA stability. ## API Reference ConfigParadeUTRStabilityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_expression/parade_utr_stability_constraint.py#L40) Configuration for the PARADE 3' UTR mRNA-stability constraint. **direction** `enum` (default: max) Whether to maximize ('max') or minimize ('min') predicted mRNA stability. Options: `max`, `min` **sigmoid\_center** `number` (default: 0.0) Raw PARADE log-ratio mapped to energy 0.5. **sigmoid\_scale** `number` (default: 1.0) Positive float32-safe width of the sigmoid transform; larger is gentler. **device** `string` (default: cuda) Device used for PARADE inference. **batch\_size** `integer` (default: 1) Number of sequences scored per PARADE GPU batch. ReturnsConstraintOutput One result per proposal. `score` is in `[0.0, 1.0]` (lower is better in the requested direction); `metadata` carries the raw `log_ratio`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import parade_utr_stability_constraint, ParadeUTRStabilityConfig constraint = Constraint( inputs=[segment], function=parade_utr_stability_constraint, function_config=ParadeUTRStabilityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `parade-utr-stability` | | Function | `parade_utr_stability_constraint` | | Category | `rna_expression` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna`, `rna` | # Promoter Strength Source: https://proto.evodesign.org/docs/language/constraints/promoter-strength Evaluate promoter strength using Salis Lab Promoter Calculator ![Promoter Strength](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/hero.png) > [!NOTE] > > **License:** Salis Lab Promoter Calculator has a GPL-3.0 license. Please refer to [the license](https://github.com/barricklab/promoter-calculator/blob/master/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/promoter_calculator/social.png) Go to Tool Page [Open](/docs/tools/gene-annotation/promoter-calculator) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/promoter_strength_constraint.py#L126) @articlelafleur2022promoter ```bibtex theme={null} @article{lafleur2022promoter, title={Automated Model-Predictive Design of Synthetic Promoters to Control Transcriptional Profiles in Bacteria}, author={LaFleur, Travis L. and Hossain, Ayaan and Salis, Howard M.}, journal={Nature Communications}, volume={13}, number={1}, pages={5159}, year={2022}, doi={10.1038/s41467-022-32829-5} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate bacterial promoter strength using Salis Lab Promoter Calculator. This constraint function uses the Salis Lab Promoter Calculator to predict E. coli sigma-70 promoter strength. The calculator scans sequences for canonical promoter elements (-10 and -35 boxes) and computes either binding free energy (dG) or predicted transcription initiation rate (tx\_rate). The constraint returns penalty scores where lower values indicate stronger promoters. The penalty mapping differs based on scoring type: * **dG scoring**: Promoters with dG \< -3.0 kcal/mol are strong (penalty 0.0-0.5) * **tx\_rate scoring**: Promoters with tx\_rate > 10000 are strong (penalty 0.0-0.5) The calculator can identify multiple promoters in a single sequence; only the strongest forward-strand candidate contributes to the penalty. ## API Reference ConfigPromoterStrengthConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/promoter_strength_constraint.py#L16) Configuration for promoter strength constraint using Salis Lab Promoter Calculator. This class defines configuration parameters for evaluating bacterial promoter strength using the Salis Lab Promoter Calculator, a biophysical model that predicts RNA polymerase binding affinity and transcription initiation rates for sigma-70 promoters in E. coli. The calculator identifies promoter elements (-10 and -35 boxes, spacer regions) and computes binding free energy (dG) and predicted transcription rates. > [!NOTE] > > The Salis Lab Promoter Calculator specifically models E. coli sigma-70 promoters. > > Penalty scores are mapped from raw predictions: > > * **For dG scoring**: Strong promoters (dG \< -3.0) get low penalties (0.0-0.5), > moderate promoters (-3.0 to -1.5) get medium penalties (0.5-1.0), weak or unlikely > promoters (> -1.5) get maximum penalty (1.0). > * **For tx\_rate scoring**: Strong promoters (>10000) get low penalties (0.0-0.5), > moderate promoters (3000-10000) get medium penalties (0.5-1.0), weak > promoters (\<3000) get maximum penalty (1.0). **add\_context** `boolean` (default: False) If True, adds flanking nucleotides to short sequences to meet calculator length minimums **context\_length** `integer` (default: 10) Number of 'A' nucleotides to add on each end when add\_context=True **threads** `integer` (default: 8) Number of threads for parallel processing of promoter calculations **circular** `boolean` (default: False) If True, treat sequences as circular for promoter detection across ends **scoring\_type** `enum` (default: dG) Score type to use: 'dG' (binding free energy) or 'tx\_rate' (transcription rate). Defaults to 'dG'. Options: `dG`, `tx_rate` ReturnsConstraintOutput One result per sequence. Score ranges from 0.0 (strong promoter) to 1.0 (weak/no promoter). `metadata` carries a single `promoter_strength` dict: **When promoter is found:** * `penalty`: Float penalty score (0.0-1.0) * `tx_rate` OR `dG_rate`: Float best promoter strength value (depending on scoring\_type) * `raw_output`: List of dictionaries with detailed promoter predictions including -10/-35 box positions, sequences, spacer length, and individual energy terms **When no promoter is found:** * `penalty`: Float 1.0 (maximum penalty) * `reason`: String "no\_promoter\_found" * `raw_output`: Empty list \[] ## Usage Evaluating promoter strength using dG scoring: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence >>> # lacUV5 promoter padded with 20 nt of A on each side (calculator >>> # needs ~20 nt of flanking sequence to score the promoter elements) >>> seq = Sequence("A" * 20 + "AAAATTGTGAGCGGATAACAATTTCACACAGGAAACAGCTATGACC" + "A" * 20, "dna") >>> config = PromoterStrengthConfig(scoring_type="dG") >>> results = promoter_strength_constraint([(seq,)], config) >>> print(results[0].score) ``` ## Metadata | Property | Value | | - | - | | Key | `promoter-strength` | | Function | `promoter_strength_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # Protein Complexity Source: https://proto.evodesign.org/docs/language/constraints/protein-complexity Evaluate protein sequence complexity using segmasker to detect low-complexity regions ![Protein Complexity](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/hero.png) > [!NOTE] > > **License:** Segmasker is licensed under Custom (NCBI BLAST+ public domain). Please refer to [the license](https://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/lxr/source/scripts/projects/blast/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/segmasker/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/segmasker) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_complexity_constraint.py#L51) @articlewootton1993seg\@articlecamacho2009blastplus ```bibtex theme={null} @article{wootton1993seg, title={Statistics of local complexity in amino acid sequences and sequence databases}, author={Wootton, John C and Federhen, Scott}, journal={Computers \& Chemistry}, volume={17}, number={2}, pages={149--163}, year={1993}, publisher={Elsevier}, doi={10.1016/0097-8485(93)85006-x} } @article{camacho2009blastplus, title={BLAST+: architecture and applications}, author={Camacho, Christiam and Coulouris, George and Avagyan, Vahram and Ma, Ning and Papadopoulos, Jason and Bealer, Kevin and Madden, Thomas L}, journal={BMC Bioinformatics}, volume={10}, pages={421}, year={2009}, publisher={BioMed Central}, doi={10.1186/1471-2105-10-421} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate protein sequence complexity using segmasker to detect low-complexity regions. This constraint function uses NCBI's segmasker tool to identify low-complexity regions in protein sequences. Low-complexity regions contain repetitive or compositionally biased amino acid sequences that may indicate poor protein quality, tandem repeats, or non-functional segments. The constraint penalizes sequences where the fraction of low-complexity regions exceeds a specified threshold. The function processes multiple sequences simultaneously. Segmasker marks low-complexity regions by replacing them with lowercase characters, and the constraint calculates the fraction of masked positions. ## API Reference ConfigProteinComplexityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_complexity_constraint.py#L15) Configuration for protein complexity constraint. This class defines configuration parameters for evaluating protein sequence complexity using NCBI's segmasker tool. The constraint detects and penalizes low-complexity regions, which contain repetitive or biased amino acid compositions that may indicate poor protein quality or non-functional sequences. **max\_low\_complexity** `number` (default: 0.2) Maximum acceptable fraction of low-complexity regions (repetitive/biased amino acid compositions) ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates acceptable complexity (low-complexity fraction at or below threshold) and higher values indicate excessive low-complexity content. Scores scale linearly with excess low-complexity beyond the threshold, capped at 1.0. `metadata` carries: * `low_complexity_fraction`: Float fraction of sequence identified as low-complexity (0.0-1.0) * `low_complexity_count`: Integer count of positions masked as low-complexity (from segmasker) ## Usage Evaluating protein complexity: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> config = ProteinComplexityConfig(max_low_complexity=0.2) >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> results = protein_complexity_constraint([(seq,)], config) >>> print(results[0].score) # 0.0 if low-complexity <= 20% >>> print(results[0].metadata["low_complexity_fraction"]) # e.g., 0.15 >>> print(results[0].metadata["low_complexity_count"]) # e.g., 5 ``` ## Metadata | Property | Value | | - | - | | Key | `protein-complexity` | | Function | `protein_complexity_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # Protein Diversity Source: https://proto.evodesign.org/docs/language/constraints/protein-diversity Evaluate amino acid diversity in a protein sequence ![Protein Diversity](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_diversity_constraint.py#L54) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate amino acid diversity in protein sequences. This constraint function measures the diversity of amino acid types present in protein sequences. It calculates diversity as the fraction of the 20 standard amino acids that appear in the sequence, and penalizes sequences that fall below a minimum diversity threshold. The penalty scales linearly with the deficit below the minimum diversity threshold. ## API Reference ConfigProteinDiversityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_diversity_constraint.py#L11) Configuration for protein diversity constraint. This class defines configuration parameters for evaluating amino acid diversity in protein sequences. The constraint measures how many different amino acid types are present in the sequence and penalizes sequences with insufficient diversity, which may indicate poor protein quality, repetitive sequences, or non-functional proteins. > [!NOTE] > > A diversity score of 1.0 means all 20 standard amino acids are present. > The minimum for a non-empty sequence is 0.05 (1/20), reached by a > homopolymer (only one amino acid type); a score of 0.0 is unreachable > since empty sequences are rejected. **min\_diversity** `number` (default: 0.7) Minimum acceptable amino acid diversity. Calculated as (unique amino acids) / 20. ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates sufficient diversity (diversity at or above threshold) and higher values indicate insufficient amino acid diversity. Scores scale linearly with the deficit below the threshold (e.g., if min\_diversity is 0.5 and actual diversity is 0.25, the score is 0.5), capped at 1.0. `metadata` carries: * `aa_diversity_score`: Float diversity score (0.0-1.0) calculated as (unique amino acids) / 20 * `unique_amino_acid_count`: Integer count of unique amino acid types present in the sequence (0-20) * `unique_amino_acids`: Sorted list of amino acid characters present in the sequence ## Usage Evaluating protein diversity: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> config = ProteinDiversityConfig(min_diversity=0.5) >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> results = protein_diversity_constraint([(seq,)], config) >>> print(results[0].score) # 0.0 (diversity 0.85 >= 0.5) >>> print(results[0].metadata["aa_diversity_score"]) # 0.85 >>> print(results[0].metadata["unique_amino_acid_count"]) # 17 >>> print(results[0].metadata["unique_amino_acids"]) # ['A', 'D', 'E', 'F', ...] ``` ## Metadata | Property | Value | | - | - | | Key | `protein-diversity` | | Function | `protein_diversity_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # Protein-DNA ipSAE Source: https://proto.evodesign.org/docs/language/constraints/protein-dna-ipsae Score protein-DNA interface confidence with ipSAE (Dunbrack 2025), folding the protein-DNA complex and scoring the binder protein vs. target DNA interface. ![Protein-DNA ipSAE](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/social.png)](/docs/tools/structure-prediction/alphafold3) [![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/social.png)](/docs/tools/structure-prediction/boltz2) [![](https://proto-bio.github.io/proto-assets/images/tool/protenix/social.png)](/docs/tools/structure-prediction/protenix) [![](https://proto-bio.github.io/proto-assets/images/tool/ipsae/social.png)](/docs/tools/structure-scoring/ipsae) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/ipsae_constraint.py#L257) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Score protein-DNA interface confidence with ipSAE. For each candidate complex: 1. Separate protein and DNA sequences from the input tuple. 2. Build a complex with `num_protein_copies` protein chains and all DNA chains (optionally appending the reverse complement of a single strand). 3. Run the configured structure predictor with the PAE matrix enabled and read `structure.metrics['pae']`. 4. Run `ipsae-scoring` with the first protein chain as the binder and the DNA chain(s) as the targets, reading the binder-target ipSAE. 5. Score: 0.0 (best) when ipSAE >= `desired_ipsae`, 1.0 (worst) when 0. When the predictor does not surface the PAE matrix (e.g. `include_pae_matrix` is unsupported), this logs a warning and returns `MAX_ENERGY` with `ipsae_error` metadata for that candidate. **Supported tools**: any DNA-capable `StructureBasedConstraintConfig` predictor that emits the per-residue PAE matrix (AlphaFold3 / Boltz2 / Protenix); `include_pae_matrix` is enabled automatically here. ## API Reference ConfigProteinDNAIpsaeConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/ipsae_constraint.py#L63) Config for the protein-DNA ipSAE interface constraint. Runs a structure prediction for the protein-DNA complex (with the PAE matrix enabled) and scores the binder protein vs. target DNA interface with ipSAE (Dunbrack 2025). ipSAE restricts to residue pairs with predicted aligned error below `pae_cutoff` (and CA-CA distance below `distance_cutoff`), yielding a value in `[0, 1]` (higher = better) that is compared against `desired_ipsae` to produce a cost in `[0, 1]` (lower = better). **num\_protein\_copies** `integer` (default: 2) Protein monomer copies in the complex (2=homodimer, 1=monomer); reuses input chains first. **desired\_ipsae** `number` (default: 0.5) Target binder-target ipSAE in \[0,1]. Score is 0 when achieved. **include\_reverse\_complement** `boolean` (default: True) Add the reverse-complement DNA strand when the input has only one DNA sequence. **pae\_cutoff** `number` (default: 10.0) PAE threshold (Angstrom) for ipSAE interface residue detection. **distance\_cutoff** `number` (default: 10.0) CA-CA distance cutoff (Angstrom) for ipSAE contact detection. **structure\_tool** `enum` (default: alphafold3) Predictor for the protein-DNA complex; must be DNA-capable (alphafold3/boltz2/protenix). Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score in `[0, 1]` (lower is better) with `ipsae` / `desired_ipsae` / `binder_chain` / `target_chains` / `structure_tool` / `pdb_output` metadata and the predicted Structure on slot 0. ## Usage Programming a protein-DNA operator complex with AlphaFold3: ```python python icon="python" theme={null} >>> from proto_language.core import Constraint, Segment >>> protomer = Segment(length=120, sequence_type="protein") >>> operator = Segment(length=20, sequence_type="dna") >>> ipsae = Constraint( ... inputs=[protomer, operator], ... function=protein_dna_ipsae_constraint, ... function_config={"structure_tool": "alphafold3", "num_protein_copies": 2}, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `protein-dna-ipsae` | | Function | `protein_dna_ipsae_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `dna` | # Protein Domain Match Source: https://proto.evodesign.org/docs/language/constraints/protein-domain Evaluate whether sequences contains protein domains matching specified keywords ![Protein Domain Match](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/social.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/prodigal/social.png)](/docs/tools/orf-prediction/prodigal) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_domain_constraint.py#L113) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate whether sequences contain protein domains matching specified keywords. This constraint function searches for functional protein domains using HMMER's hmmscan tool against HMM profile databases. It identifies domains in protein sequences and matches them against user-specified keywords, enabling selection of proteins with desired functional domains. For DNA sequences, the function first runs Prodigal to predict protein-coding regions (ORFs), then searches each predicted protein for matching domains. For protein sequences, the domain search is performed directly. The constraint is satisfied when the specified keyword criteria are met (any or all keywords, depending on configuration). ## API Reference ConfigProteinDomainConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_domain_constraint.py#L21) Configuration for protein domain constraint. This class defines configuration parameters for evaluating whether protein sequences contain specific functional domains identified by keyword searches against HMM (Hidden Markov Model) profile databases. The constraint uses HMMER's hmmscan tool to identify protein domains and matches them against user-specified keywords, enabling targeted selection for proteins with desired functional characteristics. > [!NOTE] > > For DNA sequences, Prodigal is used to predict ORFs first, then each > predicted protein is searched for domains. For protein sequences, the > search is performed directly. **hmm\_db** `string` *required* Path to HMM database file for hmmscan (e.g., Pfam-A.hmm). Must be pressed with hmmpress. **keywords** `List[string]` *required* Keywords to search for in domain descriptions (case-insensitive). **evalue\_threshold** `number` (default: 0.005) Maximum E-value for significant HMM hits; lower is more stringent (typical range 0.0001 to 0.01). **query\_coverage** `number` Min query coverage percentage for significant hits (0-100). **match\_all\_keywords** `boolean` (default: False) If True, require ALL keywords to be found. If False, require ANY keyword (default). **hmmscan\_config** `PyHmmerConfig` Configuration for PyHMMER hmmscan. ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates domain criteria are satisfied (matching domains found) and 1.0 indicates no matching domains found or failure to meet keyword requirements. `metadata` carries: **For DNA sequences:** * `prodigal_proteins`: List of dicts of predicted proteins from Prodigal (or `None` if no ORFs were predicted) * `prodigal_protein_count`: Integer count of predicted ORFs * `domain_search_results`: List of domain search results for each predicted protein * `domain_keywords_found`: List of unique keywords found across all predicted proteins * `domain_matching_proteins`: List of protein IDs that matched keywords **For protein sequences:** * `domain_search_results`: List containing domain search results * `domain_keywords_found`: List of keywords found in domain descriptions * `domain_matching_hits`: DataFrame of domain hits matching keywords * `hmmscan_all_hits`: DataFrame of all significant hmmscan hits ## Usage Evaluating domain presence in protein with single keyword: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> cfg = ProteinDomainConfig(hmm_db="Pfam-A.hmm", keywords=["kinase"], evalue_threshold=0.001) >>> results = protein_domain_constraint([(seq,)], config=cfg) >>> print(results[0].score) # 0.0 if kinase domain found, 1.0 if not >>> print(results[0].metadata["domain_keywords_found"]) # ['kinase'] if found ``` Evaluating DNA sequence (with automatic ORF prediction): ```python python icon="python" theme={null} >>> dna_seq = Sequence("ATGGTACTGAGCCCAGCG...", "dna") >>> cfg = ProteinDomainConfig(hmm_db="Pfam-A.hmm", keywords=["helicase"]) >>> results = protein_domain_constraint([(dna_seq,)], config=cfg) >>> print(results[0].metadata["prodigal_protein_count"]) # Number of predicted ORFs >>> print(results[0].metadata["domain_matching_proteins"]) # IDs of proteins with helicase domain ``` ## Metadata | Property | Value | | - | - | | Key | `protein-domain` | | Function | `protein_domain_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # Protein Globularity Source: https://proto.evodesign.org/docs/language/constraints/protein-globularity Encourage compact, globular protein structures ![Protein Globularity](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/social.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png)](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/protein_globularity_constraint.py#L75) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Encourage compact, globular protein structures using ESMFold. This constraint function uses ESMFold to predict protein 3D structures and evaluates their compactness by analyzing the spatial distribution of backbone atoms. Globularity is measured as the standard deviation of distances from backbone atoms (N, CA, C, O) to the structure's geometric centroid. Lower values indicate more compact, spherical structures characteristic of well-folded globular proteins, while higher values indicate extended, elongated, or poorly folded structures. Each input tuple is folded as one complex with an arbitrary number of protein chains. DNA chains are first resolved with ORFipy by scanning both strands for canonical ATG-to-stop ORFs and selecting the longest ORF as that chain's translated CDS. Structure prediction is GPU-intensive and may take several minutes per protein depending on length and hardware. ## API Reference ConfigProteinGlobularityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/protein_globularity_constraint.py#L23) Configuration for protein globularity constraint. This class defines configuration parameters for evaluating protein structural compactness using ESMFold structure prediction. Globularity measures how compact and spherical a protein structure is, based on the spatial distribution of backbone atoms around the structure's center of mass. More globular proteins have backbone atoms clustered tightly around the centroid, while extended structures show higher dispersion. Globularity is measured as the standard deviation of distances from backbone atoms (N, CA, C, O) to the structure's centroid. Lower values indicate more compact, spherical structures. The score is normalized by dividing by max\_globularity (default 20.0 Ångströms) and capped at 1.0. **max\_globularity** `number` (default: 20.0) Max std (Å) of backbone-atom distances to the structure centroid; above this is treated as unfolded. **esmfold\_config** `ESMFoldConfig` ESMFold configuration for structure prediction. ReturnsConstraintOutput Per-proposal score in `[0.0, 1.0]` (lower = more compact). The predicted complex `Structure` attaches to slot 0. `metadata` carries: * `avg_plddt`: Float average pLDDT score for structure confidence (0.0-1.0) * `ptm`: Float predicted TM-score for structure accuracy (0.0-1.0) * `pdb_output`: String PDB format structure file content * `esmfolded_sequence`: String colon-separated protein-chain representation * `raw_globularity`: Float standard deviation of backbone-to-centroid distances in Ångströms (lower = more compact) * `normalized_globularity`: Float normalized globularity score (0.0-1.0, capped by max\_globularity) * `dna_chain_orfs`: Per-DNA-chain ORFipy metadata when DNA chains are present ## Usage Evaluating protein structural compactness: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> config = ProteinGlobularityConfig() >>> results = protein_globularity_constraint([(seq,)], config) >>> print(results[0].score) # e.g., 0.425 (normalized score, lower = more compact) >>> print(results[0].metadata["raw_globularity"]) # e.g., 8.5 (raw Ångströms) >>> print(results[0].metadata["normalized_globularity"]) # e.g., 0.425 >>> print(results[0].metadata["avg_plddt"]) # e.g., 0.85 (also available) ``` Evaluating DNA sequence (with automatic ORF prediction): ```python python icon="python" theme={null} >>> dna_seq = Sequence("ATGGTACTGAGCCCAGCG...", "dna") >>> config = ProteinGlobularityConfig() >>> results = protein_globularity_constraint([(dna_seq,)], config) >>> print(results[0].score) # Normalized score (0.0-1.0) >>> # Single-DNA-chain proposals also flatten selected-CDS metadata. >>> print(results[0].metadata["orfipy_orf_count"]) # e.g., 2 >>> print(results[0].metadata["selected_cds"]["amino_acid_length"]) # longest ORF length >>> # Multi-chain proposals carry per-chain CDS metadata. >>> print(results[0].metadata["translated_cds_by_chain"][0]["amino_acid_length"]) >>> print(results[0].metadata["raw_globularity"]) # e.g., 7.8 Å ``` ## Metadata | Property | Value | | - | - | | Key | `protein-globularity` | | Function | `protein_globularity_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna`, `protein` | # Protein Length Source: https://proto.evodesign.org/docs/language/constraints/protein-length Evaluate whether protein length falls within acceptable range ![Protein Length](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_length_constraint.py#L63) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate whether protein sequence lengths fall within an acceptable range. This constraint function checks if protein sequences have lengths within a specified range, penalizing sequences that are too short or too long. This is useful for filtering out spurious ORF predictions. Penalties scale linearly with the distance outside the acceptable range. ## API Reference ConfigProteinLengthConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_length_constraint.py#L11) Configuration object for protein length constraint. This class defines configuration parameters for evaluating whether protein sequences fall within an acceptable length range. Length constraints are useful for filtering proteins that are too short or too long. The penalty scales linearly with the distance outside the acceptable range. For example, a protein 10 amino acids below `min_length` receives a proportionally smaller penalty than one 50 amino acids below. **min\_length** `integer` *required* Minimum acceptable protein length below which sequences are penalized **max\_length** `integer` *required* Maximum acceptable protein length above which sequences are penalized ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates length is within the acceptable range \[min\_length, max\_length] and higher values indicate greater deviation from the acceptable range. Penalties scale linearly: a sequence 10 amino acids outside the range receives half the penalty of one 20 amino acids outside. `metadata` carries: * `protein_length`: Integer length of the protein sequence in amino acids ## Usage Evaluating protein length within range: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> config = ProteinLengthConfig(min_length=10, max_length=500) >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> results = protein_length_constraint([(seq,)], config) >>> print(results[0].score) # 0.0 >>> print(results[0].metadata["protein_length"]) # 37 ``` ## Metadata | Property | Value | | - | - | | Key | `protein-length` | | Function | `protein_length_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # Protein Max Identity Source: https://proto.evodesign.org/docs/language/constraints/protein-max-identity Require proteins, or longest ORFs from DNA, to stay below a maximum identity to references. ![Protein Max Identity](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/social.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png)](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_max_identity_constraint.py#L70) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Require top-hit MMseqs2 identity to remain below a maximum threshold. ## API Reference ConfigProteinMaxIdentityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_max_identity_constraint.py#L17) Configuration for maximum identity to a protein reference set. **mmseqs\_db** `string` *required* Path to MMseqs2 target database (FASTA file or MMseqs2 createdb output). **max\_identity** `number` (default: 90.0) Maximum allowed percent identity (0-100, inclusive) to the top reference hit. **pass\_no\_hits** `boolean` (default: True) If True, proposals with no MMseqs2 hit pass as novel sequences. **reference\_fasta** `string` Optional FASTA file for recovering the top hit sequence by target ID. **mmseqs\_config** `Mmseqs2SearchProteinsConfig` Advanced MMseqs2 protein search configuration. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains top-hit identity, target ID, target sequence when available, and selected ORF details for DNA. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import protein_max_identity_constraint, ProteinMaxIdentityConfig constraint = Constraint( inputs=[segment], function=protein_max_identity_constraint, function_config=ProteinMaxIdentityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `protein-max-identity` | | Function | `protein_max_identity_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # Protein Nearest-Neighbor Gap Gini Source: https://proto.evodesign.org/docs/language/constraints/protein-nearest-neighbor-gap-gini Align proteins (or longest ORFs from DNA) to the nearest reference hit and score gap concentration. ![Protein Nearest-Neighbor Gap Gini](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/mmseqs2/social.png)](/docs/tools/sequence-alignment/mmseqs2) [![](https://proto-bio.github.io/proto-assets/images/tool/mafft/social.png)](/docs/tools/sequence-alignment/mafft) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png)](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_nearest_neighbor_gap_gini_constraint.py#L90) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Require low gap Gini against the nearest reference protein. ## API Reference ConfigProteinNearestNeighborGapGiniConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_nearest_neighbor_gap_gini_constraint.py#L25) Configuration for gap Gini against nearest protein neighbors. **mmseqs\_db** `string` *required* Path to MMseqs2 target database (FASTA file or MMseqs2 createdb output). **reference\_fasta** `string` *required* FASTA file used to recover top-hit sequences by target ID. **max\_gap\_gini** `number` (default: 0.1) Maximum acceptable gap Gini (0-1, inclusive) against the nearest reference protein. **pass\_no\_hits** `boolean` (default: True) If True, proposals with no MMseqs2 hit pass as novel sequences. **trim\_alignment** `boolean` (default: True) Center-crop the pairwise alignment and strip end gaps before computing gap Gini. **mmseqs\_config** `Mmseqs2SearchProteinsConfig` Advanced MMseqs2 protein search configuration. **mafft\_config** `MafftConfig` Advanced MAFFT pairwise alignment configuration. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains the nearest target ID, nearest hit sequence, and computed gap Gini. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import protein_nearest_neighbor_gap_gini_constraint, ProteinNearestNeighborGapGiniConfig constraint = Constraint( inputs=[segment], function=protein_nearest_neighbor_gap_gini_constraint, function_config=ProteinNearestNeighborGapGiniConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `protein-nearest-neighbor-gap-gini` | | Function | `protein_nearest_neighbor_gap_gini_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # Protein Profile HMM Source: https://proto.evodesign.org/docs/language/constraints/protein-profile-hmm Search proteins, or longest ORFs from DNA, against a profile-HMM file. ![Protein Profile HMM](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/pyhmmer/social.png)](/docs/tools/gene-annotation/pyhmmer) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png)](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_profile_hmm_constraint.py#L78) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Require profile-HMM support for proteins or translated DNA sequences. ## API Reference ConfigProteinProfileHMMConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_profile_hmm_constraint.py#L19) Configuration for profile-HMM matching. **hmm\_path** `string` *required* Path to a profile-HMM file for hmmsearch. **required\_profiles** `List[string]` Profile names/accessions/descriptions that must be detected. Empty means any HMM hit passes. **match\_all\_required\_profiles** `boolean` (default: True) Require all listed profiles instead of any listed profile. **profile\_match\_field** `enum` (default: query\_name) HMM hit field used to match required profile strings. Options: `query_name`, `query_accession`, `query_description` **hmmsearch\_config** `PyHmmsearchConfig` PyHMMER hmmsearch configuration. Tune evalue\_threshold / domain\_evalue\_threshold here. ReturnsConstraintOutput One output per proposal. A score of 0.0 passes and 1.0 fails. Metadata contains selected ORF details for DNA, sequence/domain HMM hits, and matched required profiles. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import protein_profile_hmm_constraint, ProteinProfileHMMConfig constraint = Constraint( inputs=[segment], function=protein_profile_hmm_constraint, function_config=ProteinProfileHMMConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `protein-profile-hmm` | | Function | `protein_profile_hmm_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `protein` | # Protein Repetitiveness Source: https://proto.evodesign.org/docs/language/constraints/protein-repetitiveness Evaluate protein sequence repetitiveness based on k-mer analysis ![Protein Repetitiveness](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_repetitiveness_constraint.py#L68) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate protein sequence repetitiveness based on k-mer frequency analysis. This constraint function analyzes protein sequences for repetitive content by examining k-mer frequencies. It identifies sequences with excessive repetitive motifs, which may indicate low-complexity regions or non-functional proteins. The analysis scans multiple k-mer lengths to detect both short tandem repeats and larger sequence duplications. The repetitiveness score represents the maximum fraction of the sequence covered by any repeated k-mer. For example, if "SSS" appears 8 times in a 60-amino-acid sequence, the repetitiveness for 3-mers is (8 \* 3) / 60 = 0.4 (40% of sequence). ## API Reference ConfigProteinRepetitivenessConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_quality/protein_repetitiveness_constraint.py#L13) Configuration for protein repetitiveness constraint. This class defines configuration parameters for evaluating repetitive content in protein sequences using k-mer frequency analysis. The constraint detects and penalizes sequences with excessive tandem repeats or repetitive motifs, which may indicate low-complexity regions or non-functional proteins. The repetitiveness score is calculated as the maximum fraction of the sequence covered by any repeated k-mer. For example, if "AAA" appears 10 times in a 100-amino-acid sequence, the repetitiveness for 3-mers is (10 \* 3) / 100 = 0.3 (30% of sequence). **max\_repetitiveness** `number` (default: 0.1) Maximum acceptable repetitiveness fraction (fraction of sequence covered by repeated k-mers) **min\_repeat\_length** `integer` (default: 1) Smallest k-mer length treated as a repeat; the scan continues up to this length plus 6. ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates acceptable repetitiveness (at or below threshold) and higher values indicate excessive repetitive content. Penalties scale linearly with excess repetitiveness: if max is 0.4 and actual is 0.6, the excess (0.2) is normalized by the remaining range (1.0 - 0.4 = 0.6), giving a score of 0.33. `metadata` carries: * `repetitiveness_score`: Float repetitiveness score (0.0-1.0) representing the maximum fraction of sequence covered by repeated k-mers * `max_repetitive_fraction`: Float identical to `repetitiveness_score` ## Usage Evaluating repetitiveness with default settings: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> config = ProteinRepetitivenessConfig(max_repetitiveness=0.4, min_repeat_length=3) >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> results = protein_repetitiveness_constraint([(seq,)], config) >>> print(results[0].score) # 0.0 if repetitiveness < 40% >>> print(results[0].metadata["repetitiveness_score"]) # e.g., 0.15 ``` ## Metadata | Property | Value | | - | - | | Key | `protein-repetitiveness` | | Function | `protein_repetitiveness_constraint` | | Category | `protein_quality` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # Protein Symmetry Ring Structure Source: https://proto.evodesign.org/docs/language/constraints/protein-symmetry-ring Constrain protein to form symmetric ring-like multimeric structure ![Protein Symmetry Ring Structure](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/social.png)](/docs/tools/structure-prediction/esmfold) [![](https://proto-bio.github.io/proto-assets/images/tool/orfipy/social.png)](/docs/tools/orf-prediction/orfipy) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/protein_symmetry_ring_constraint.py#L94) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Constrain proteins to form symmetric ring-like multimeric structures using ESMFold. This constraint function uses ESMFold to predict multimeric protein structures and evaluates whether they form symmetric ring-like arrangements. Ring symmetry is quantified by calculating the centroid (center of mass) of each protomer's backbone and measuring how uniformly the protomers are distributed around the ring. Perfect symmetric rings have all inter-protomer distances equal, resulting in zero standard deviation. Many functional protein complexes naturally form symmetric rings, including chaperonins, proteasomes (heptameric rings), hexameric helicases, and various ring-shaped enzymes. This constraint is useful for designing or selecting proteins that form such symmetric assemblies. Each input tuple is folded as one complex with an arbitrary number of protein chains. DNA chains are first resolved with ORFipy by scanning both strands for canonical ATG-to-stop ORFs and selecting the longest ORF as that chain's translated CDS. Structure prediction is GPU-intensive and may take several minutes per protein depending on length and hardware. ## API Reference ConfigProteinSymmetryRingConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/protein_symmetry_ring_constraint.py#L26) Configuration for protein symmetry ring constraint. This class defines configuration parameters for evaluating whether proteins form symmetric ring-like multimeric structures using ESMFold structure prediction. Ring symmetry is measured by analyzing the spatial arrangement of protomer centroids in predicted oligomeric structures. Symmetric rings have protomers evenly distributed in a circular arrangement with consistent inter-protomer distances, characteristic of many functional protein complexes like chaperonins, proteasomes, and ring-shaped enzymes. Symmetry is calculated by taking the centroids of each protomer (using backbone atom coordinates) and measuring the standard deviation of distances between protomers. Lower standard deviation indicates more symmetric arrangements where all protomers are equally spaced. The score is normalized by dividing by `max_symmetry_std` and capped at 1.0. **max\_symmetry\_std** `number` (default: 10.0) Max std of inter-protomer centroid distances (Å) for normalization; above this gets worst score 1.0. **all\_to\_all\_protomer\_symmetry** `boolean` (default: False) True uses pairwise distances between all protomers. Else, use distances between adjacent protomers **esmfold\_config** `ESMFoldConfig` ESMFold configuration for structure prediction. ReturnsConstraintOutput Per-proposal score in `[0.0, 1.0]` where 0.0 is perfect ring symmetry. Protein results attach the predicted `Structure` to slot 0. `metadata` carries: * `avg_plddt`: Float average pLDDT score for structure confidence (0.0-1.0) * `ptm`: Float predicted TM-score for structure accuracy (0.0-1.0) * `pdb_output`: String PDB format structure file content * `esmfolded_sequence`: String colon-separated protein-chain representation * `symmetry_std_raw`: Float raw standard deviation of inter-protomer distances in Ångströms (lower = more symmetric) * `symmetry_score_normalized`: Float normalized symmetry score (0.0-1.0) * `dna_chain_orfs`: Per-DNA-chain ORFipy metadata when DNA chains are present ## Usage Designing a symmetric hexameric ring: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> seq = Sequence("MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSF", "protein") >>> config = ProteinSymmetryRingConfig( ... max_symmetry_std=10.0, ... ) >>> results = protein_symmetry_ring_constraint([(seq, seq, seq, seq, seq, seq)], config) >>> print(results[0].score) # e.g., 0.35 (3.5 Å std / 10.0 Å max) >>> print(results[0].metadata["symmetry_std_raw"]) # e.g., 3.5 Å >>> print(results[0].metadata["symmetry_score_normalized"]) # 0.35 ``` ## Metadata | Property | Value | | - | - | | Key | `protein-symmetry-ring` | | Function | `protein_symmetry_ring_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna`, `protein` | # Protein Quality Source: https://proto.evodesign.org/docs/language/constraints/protein_quality/overview Constraints grouped under Protein Quality. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Protein Quality. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/balanced-aa/carousel.png)](/docs/language/constraints/balanced-aa) [![](https://proto-bio.github.io/proto-assets/images/constraint/overall-protein-quality/carousel.png)](/docs/language/constraints/overall-protein-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-complexity/carousel.png)](/docs/language/constraints/protein-complexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-diversity/carousel.png)](/docs/language/constraints/protein-diversity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-domain/carousel.png)](/docs/language/constraints/protein-domain) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-length/carousel.png)](/docs/language/constraints/protein-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-max-identity/carousel.png)](/docs/language/constraints/protein-max-identity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-nearest-neighbor-gap-gini/carousel.png)](/docs/language/constraints/protein-nearest-neighbor-gap-gini) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-profile-hmm/carousel.png)](/docs/language/constraints/protein-profile-hmm) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-repetitiveness/carousel.png)](/docs/language/constraints/protein-repetitiveness) # Protein Structure Source: https://proto.evodesign.org/docs/language/constraints/protein_structure/overview Constraints grouped under Protein Structure. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Protein Structure. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-chain-pair-prot-dna-iptm/carousel.png)](/docs/language/constraints/af3-chain-pair-prot-dna-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/af3-offtarget-iptm-specificity/carousel.png)](/docs/language/constraints/af3-offtarget-iptm-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/boltz2-binding-strength/carousel.png)](/docs/language/constraints/boltz2-binding-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/consensus-operator-specificity/carousel.png)](/docs/language/constraints/consensus-operator-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dbp-design-metrics/carousel.png)](/docs/language/constraints/dbp-design-metrics) [![](https://proto-bio.github.io/proto-assets/images/constraint/deeppbs-motif-specificity/carousel.png)](/docs/language/constraints/deeppbs-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-base-contact-quality/carousel.png)](/docs/language/constraints/dna-base-contact-quality) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-motif-contact-count/carousel.png)](/docs/language/constraints/dna-motif-contact-count) [![](https://proto-bio.github.io/proto-assets/images/constraint/dna-phosphate-contact/carousel.png)](/docs/language/constraints/dna-phosphate-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/gyration-radius/carousel.png)](/docs/language/constraints/gyration-radius) [![](https://proto-bio.github.io/proto-assets/images/constraint/metal3d-probability/carousel.png)](/docs/language/constraints/metal3d-probability) [![](https://proto-bio.github.io/proto-assets/images/constraint/na-mpnn-motif-specificity/carousel.png)](/docs/language/constraints/na-mpnn-motif-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-dna-ipsae/carousel.png)](/docs/language/constraints/protein-dna-ipsae) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-globularity/carousel.png)](/docs/language/constraints/protein-globularity) [![](https://proto-bio.github.io/proto-assets/images/constraint/protein-symmetry-ring/carousel.png)](/docs/language/constraints/protein-symmetry-ring) [![](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/carousel.png)](/docs/language/constraints/pyrosetta-interface) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/carousel.png)](/docs/language/constraints/structure-beta-strand) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/carousel.png)](/docs/language/constraints/structure-composite) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/carousel.png)](/docs/language/constraints/structure-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/carousel.png)](/docs/language/constraints/structure-distogram-cce) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/carousel.png)](/docs/language/constraints/structure-ensemble-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/carousel.png)](/docs/language/constraints/structure-helix) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/carousel.png)](/docs/language/constraints/structure-interface-contact) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/carousel.png)](/docs/language/constraints/structure-ipae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/carousel.png)](/docs/language/constraints/structure-iplddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/carousel.png)](/docs/language/constraints/structure-iptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/carousel.png)](/docs/language/constraints/structure-pae) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/carousel.png)](/docs/language/constraints/structure-plddt) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/carousel.png)](/docs/language/constraints/structure-ptm) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/carousel.png)](/docs/language/constraints/structure-radius-gyration) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/carousel.png)](/docs/language/constraints/structure-rmsd) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/carousel.png)](/docs/language/constraints/structure-termini-distance) [![](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/carousel.png)](/docs/language/constraints/structure-tmscore) # Puffin Promoter Activity Source: https://proto.evodesign.org/docs/language/constraints/puffin-promoter-activity Score promoter activity and TSS sharpness from Puffin predictions. ![Puffin Promoter Activity](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/hero.png) > [!NOTE] > > **License:** Puffin is licensed under Custom (UTSW Academic Software License) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://github.com/jzhoulab/puffin/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/puffin/social.png) Go to Tool Page [Open](/docs/tools/sequence-scoring/puffin) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/puffin_promoter_activity_constraint.py#L140) @articledudnyk2024puffin ```bibtex theme={null} @article{dudnyk2024puffin, title={Sequence basis of transcription initiation in the human genome}, author={Dudnyk, Kseniia and Cai, Donghong and Shi, Chenlai and Xu, Jian and Zhou, Jian}, journal={Science}, volume={384}, number={6694}, year={2024}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.adj0116}, url={https://www.science.org/doi/10.1126/science.adj0116} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score Puffin promoter signal for target DNA segments. ## API Reference ConfigPuffinPromoterActivityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/puffin_promoter_activity_constraint.py#L21) Configuration for Puffin promoter activity scoring. **left\_context** `string` (default: NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN) Upstream DNA padding supplied to Puffin. **right\_context** `string` (default: NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN) Downstream DNA padding supplied to Puffin. **track\_names** `List[string]` (default: \['ENCODE\_CAGE+', 'ENCODE\_RAMPAGE+', 'GRO\_CAP+', 'PRO\_CAP+']) Puffin output channels to average. **score\_interval** `array` Optional 0-based half-open interval relative to the target segment. **direction** `enum` (default: maximize) Whether high or low Puffin promoter signal is preferred. Options: `maximize`, `minimize` **activity\_threshold** `number` (default: 2.0) Mean activity treated as saturating success. **sharpness\_threshold** `number` (default: 0.2) Peak fraction treated as saturating success. **activity\_weight** `number` (default: 1.0) Weight for the activity component. **sharpness\_weight** `number` (default: 1.0) Weight for the TSS sharpness component. **puffin\_config** `PuffinPredictionConfig` Runtime settings for Puffin prediction. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import puffin_promoter_activity_constraint, PuffinPromoterActivityConfig constraint = Constraint( inputs=[segment], function=puffin_promoter_activity_constraint, function_config=PuffinPromoterActivityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `puffin-promoter-activity` | | Function | `puffin_promoter_activity_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # PyRosetta Interface Source: https://proto.evodesign.org/docs/language/constraints/pyrosetta-interface Score interface metrics on an attached predicted complex structure. ![PyRosetta Interface](https://proto-bio.github.io/proto-assets/images/constraint/pyrosetta-interface/hero.png) > [!NOTE] > > **License:** PyRosetta is licensed under Custom (PyRosetta Software License) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://www.pyrosetta.org/home/licensing-pyrosetta) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/pyrosetta/social.png) Go to Tool Page [Open](/docs/tools/structure-scoring/pyrosetta) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/pyrosetta_interface_constraint.py#L111) @articlechaudhury2010pyrosetta ```bibtex theme={null} @article{chaudhury2010pyrosetta, title={PyRosetta: a script-based interface for implementing molecular modeling algorithms using Rosetta}, author={Chaudhury, Sidhartha and Lyskov, Sergey and Gray, Jeffrey J}, journal={Bioinformatics}, volume={26}, number={5}, pages={689--691}, year={2010}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/btq007} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score PyRosetta interface metrics from attached complex structures. ## API Reference ConfigPyRosettaInterfaceConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/pyrosetta_interface_constraint.py#L31) Configuration for PyRosetta interface metric scoring. **target\_chains** `List[string]` Target-side chain labels in the attached complex structure. **binder\_chain** `string` (default: B) Binder chain label in the attached complex structure. **metric** `enum` (default: interface\_dG) PyRosetta interface metric to score. Options: `interface_sc`, `interface_hbonds`, `interface_dG`, `interface_dSASA`, `interface_packstat`, `interface_hydrophobicity`, `surface_hydrophobicity`, `delta_unsat_hbonds` **direction** `enum` (default: lower) Whether higher or lower metric values are better. Options: `higher`, `lower` **desired\_value** `number` (default: -10.0) Metric value treated as satisfied. **tolerance** `number` (default: 10.0) Metric distance from desired value at which the score reaches 1. **pyrosetta\_config** `PyRosettaInterfaceAnalyzerConfig` PyRosetta interface analyzer configuration. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import pyrosetta_interface_constraint, PyRosettaInterfaceConfig constraint = Constraint( inputs=[segment], function=pyrosetta_interface_constraint, function_config=PyRosettaInterfaceConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `pyrosetta-interface` | | Function | `pyrosetta_interface_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `protein` | # RNA Base Pair Similarity Source: https://proto.evodesign.org/docs/language/constraints/rna-basepair-similarity Compare RNA base pair sets using Jaccard similarity. ![RNA Base Pair Similarity](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/hero.png) > [!NOTE] > > **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/viennarna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L616) @articlelorenz2011viennarna ```bibtex theme={null} @article{lorenz2011viennarna, title={ViennaRNA Package 2.0}, author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L}, journal={Algorithms for Molecular Biology}, volume={6}, number={1}, pages={26}, year={2011}, publisher={BioMed Central}, doi={10.1186/1748-7188-6-26} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Compare base pair sets between proposals and reference using Jaccard similarity. Returns 1 - similarity (so 0 is perfect match, 1 is worst). ## API Reference ConfigRNABasePairSimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L311) Configuration for base pair similarity constraint. Compares sets of base pairs (i, j) using Jaccard similarity. This is a strict positional comparison requiring identical base pair positions for a match. Inherits from `RNAStructureConstraintBaseConfig`. **max\_length\_ratio\_diff** `number` (default: 0.5) Maximum allowed length ratio difference **reference\_sequence** `string` *required* Reference RNA/DNA sequence to compare against **temperature** `number` (default: 37.0) Folding temperature in Celsius ReturnsConstraintOutput Per-proposal score (`1 - similarity`) with metadata for reference/candidate base pair counts and the predicted structure. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import rna_basepair_similarity_constraint, RNABasePairSimilarityConfig constraint = Constraint( inputs=[segment], function=rna_basepair_similarity_constraint, function_config=RNABasePairSimilarityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `rna-basepair-similarity` | | Function | `rna_basepair_similarity_constraint` | | Category | `rna_secondary_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # RNA Feature Vector Similarity Source: https://proto.evodesign.org/docs/language/constraints/rna-feature-similarity Compare RNA structures using cosine similarity of 10-dim feature vectors. ![RNA Feature Vector Similarity](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/hero.png) > [!NOTE] > > **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/viennarna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L533) @articlelorenz2011viennarna ```bibtex theme={null} @article{lorenz2011viennarna, title={ViennaRNA Package 2.0}, author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L}, journal={Algorithms for Molecular Biology}, volume={6}, number={1}, pages={26}, year={2011}, publisher={BioMed Central}, doi={10.1186/1748-7188-6-26} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Construct 10-dim feature vectors and compare using cosine similarity. Returns (1 - similarity) / 2, scaling cosine similarity from \[-1, 1] to \[0, 1]. ## API Reference ConfigRNAFeatureSimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L293) Configuration for feature vector similarity constraint. Compares 10-dimensional structural feature vectors using cosine similarity. Features include: length, number of pairs, pairing ratio, stem statistics (avg, max, count), loop statistics, MFE, MFE per nucleotide, and hairpin count. Inherits from `RNAStructureConstraintBaseConfig`. **reference\_sequence** `string` *required* Reference RNA/DNA sequence to compare against **temperature** `number` (default: 37.0) Folding temperature in Celsius ReturnsConstraintOutput Per-proposal score (`(1 - cosine) / 2`) with metadata for the reference/candidate feature vectors, predicted structure, and candidate MFE. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import rna_feature_similarity_constraint, RNAFeatureSimilarityConfig constraint = Constraint( inputs=[segment], function=rna_feature_similarity_constraint, function_config=RNAFeatureSimilarityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `rna-feature-similarity` | | Function | `rna_feature_similarity_constraint` | | Category | `rna_secondary_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # RNA Structural Motif Similarity Source: https://proto.evodesign.org/docs/language/constraints/rna-motif-similarity Compare RNA structural motifs (stems, hairpins, bulges) using Jaccard similarity. ![RNA Structural Motif Similarity](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/hero.png) > [!NOTE] > > **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/viennarna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L448) @articlelorenz2011viennarna ```bibtex theme={null} @article{lorenz2011viennarna, title={ViennaRNA Package 2.0}, author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L}, journal={Algorithms for Molecular Biology}, volume={6}, number={1}, pages={26}, year={2011}, publisher={BioMed Central}, doi={10.1186/1748-7188-6-26} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Compare structural motifs (stems, hairpins, bulges) between proposals and. reference using Jaccard similarity. Returns 1 - similarity (so 0 is perfect match, 1 is worst). ## API Reference ConfigRNAMotifSimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L276) Configuration for structural motif similarity constraint. Compares extracted structural motifs (stems, hairpins, bulges, nesting depth, unpaired regions) using Jaccard similarity. Inherits from `RNAStructureConstraintBaseConfig`. **reference\_sequence** `string` *required* Reference RNA/DNA sequence to compare against **temperature** `number` (default: 37.0) Folding temperature in Celsius ReturnsConstraintOutput Per-proposal score (`1 - similarity`) with metadata for reference, candidate, and shared motif sets plus the predicted structure. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import rna_motif_similarity_constraint, RNAMotifSimilarityConfig constraint = Constraint( inputs=[segment], function=rna_motif_similarity_constraint, function_config=RNAMotifSimilarityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `rna-motif-similarity` | | Function | `rna_motif_similarity_constraint` | | Category | `rna_secondary_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # RNA Structural Property Similarity Source: https://proto.evodesign.org/docs/language/constraints/rna-property-similarity Compare RNA structural properties (length, pairing ratio) against a reference. ![RNA Structural Property Similarity](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/hero.png) > [!NOTE] > > **License:** ViennaRNA is licensed under Custom (ViennaRNA Package License) and may require explicit attribution when utilized. Please refer to [the license](https://github.com/ViennaRNA/ViennaRNA/blob/master/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/viennarna/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/viennarna) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L357) @articlelorenz2011viennarna ```bibtex theme={null} @article{lorenz2011viennarna, title={ViennaRNA Package 2.0}, author={Lorenz, Ronny and Bernhart, Stephan H and H{\"o}ner zu Siederdissen, Christian and Tafer, Hakim and Flamm, Christoph and Stadler, Peter F and Hofacker, Ivo L}, journal={Algorithms for Molecular Biology}, volume={6}, number={1}, pages={26}, year={2011}, publisher={BioMed Central}, doi={10.1186/1748-7188-6-26} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Compare basic structural properties (length, pairing ratio) between proposals. and reference. Returns 1 - similarity (so 0 is perfect match, 1 is worst). ## API Reference ConfigRNAPropertySimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_secondary_structure/structure_similarity_constraint.py#L250) Configuration for structural property similarity constraint. Inherits from `RNAStructureConstraintBaseConfig`. **length\_weight** `number` (default: 0.6) Weight for length similarity **reference\_sequence** `string` *required* Reference RNA/DNA sequence to compare against **temperature** `number` (default: 37.0) Folding temperature in Celsius ReturnsConstraintOutput Per-proposal score (`1 - similarity`) with metadata for component similarities and the predicted structure. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import rna_property_similarity_constraint, RNAPropertySimilarityConfig constraint = Constraint( inputs=[segment], function=rna_property_similarity_constraint, function_config=RNAPropertySimilarityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `rna-property-similarity` | | Function | `rna_property_similarity_constraint` | | Category | `rna_secondary_structure` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # RNA Expression Source: https://proto.evodesign.org/docs/language/constraints/rna_expression/overview Constraints grouped under RNA Expression. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under RNA Expression. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-activity/carousel.png)](/docs/language/constraints/parade-utr-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-specificity/carousel.png)](/docs/language/constraints/parade-utr-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/parade-utr-stability/carousel.png)](/docs/language/constraints/parade-utr-stability) # RNA Secondary Structure Source: https://proto.evodesign.org/docs/language/constraints/rna_secondary_structure/overview Constraints grouped under RNA Secondary Structure. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under RNA Secondary Structure. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/mfe/carousel.png)](/docs/language/constraints/mfe) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-basepair-similarity/carousel.png)](/docs/language/constraints/rna-basepair-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-feature-similarity/carousel.png)](/docs/language/constraints/rna-feature-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-motif-similarity/carousel.png)](/docs/language/constraints/rna-motif-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/rna-property-similarity/carousel.png)](/docs/language/constraints/rna-property-similarity) # RNA Splicing Source: https://proto.evodesign.org/docs/language/constraints/rna_splicing/overview Constraints grouped under RNA Splicing. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under RNA Splicing. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-junction/carousel.png)](/docs/language/constraints/alphagenome-splice-junction) [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-splice-site-usage/carousel.png)](/docs/language/constraints/alphagenome-splice-site-usage) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/carousel.png)](/docs/language/constraints/splice-transformer-intron-boundary) [![](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/carousel.png)](/docs/language/constraints/splice-transformer-specificity) # Sequence Motif Match Source: https://proto.evodesign.org/docs/language/constraints/seq-motif Score DNA sequences against motifs using MEME FIMO ![Sequence Motif Match](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/hero.png) > [!NOTE] > > **License:** MEME Suite (FIMO) is licensed under Custom (MEME Suite Academic License) and has restrictions around commercial use and may require explicit attribution when utilized. Please refer to [the license](https://github.com/althonos/pymemesuite/blob/main/vendor/meme/COPYING) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/meme/social.png) Go to Tool Page [Open](/docs/tools/gene-annotation/meme) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/seq_motif_constraint.py#L159) @articlegrant2011fimo ```bibtex theme={null} @article{grant2011fimo, title={FIMO: scanning for occurrences of a given motif}, author={Grant, Charles E. and Bailey, Timothy L. and Noble, William Stafford}, journal={Bioinformatics}, volume={27}, number={7}, pages={1017--1018}, year={2011}, publisher={Oxford University Press}, doi={10.1093/bioinformatics/btr064} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Score DNA sequences against sequence motifs using MEME. This constraint function uses MEME Suite's Find Individual Motif Occurrences tool to search for sequence motifs represented as position weight matrices in DNA sequences. It evaluates whether sequences contain desired motifs (wanted) or unwanted motifs (not\_wanted). The scoring strategy penalizes sequences based on motif presence: * **Unwanted motifs**: Strong matches (low p-values) result in high penalties, encouraging sequences without these binding sites * **Wanted motifs**: Strong matches result in low penalties (rewards), while missing wanted motifs result in high penalties * **No motif specification**: Any motif matches are penalized (novelty constraint) ## API Reference ConfigSeqMotifConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/seq_motif_constraint.py#L14) Configuration for sequence motif constraint using MEME. This class defines configuration parameters for evaluating DNA sequences against known transcription factor binding motifs using MEME Suite's Find Individual Motif Occurrences tool. The constraint searches for position weight matrix motifs in sequences and can either encourage specific motifs (wanted) or discourage them (not\_wanted), enabling design of sequences with controlled sites. > [!NOTE] > > Motif names must match exactly with the names in the MEME file (case-sensitive). > Use the MOTIF lines in the .meme file to identify available motif names. **motifs\_path** `string` *required* Path to MEME format motif file (.meme) containing PWMs. **fimo\_config** `MEMEFimoScanConfig` FIMO scan parameters (p-value threshold, both-strands); defaults match FIMO's nucleotide behavior. **wanted** `array` Motifs that should be present: 'all' (all motifs), 'none' (no requirement), or list of motif names. **not\_wanted** `array` Motifs that should NOT be present: 'all' (reject all), 'none' (allow all), or list of motif names. **scale** `number` (default: 1.0) Scaling factor to adjust penalty magnitude (>1 = stricter, \<1 = more lenient). Example: 1.0 **exclusive** `boolean` (default: True) If True, automatically sets unwanted motifs as complement of wanted motifs **aggregation** `enum` (default: smart) How to aggregate penalties: 'smart' (adaptive), 'average', 'max' (strictest), 'percentile' Options: `smart`, `average`, `max`, `percentile` **percentile\_value** `number` (default: 95.0) Which percentile to use when aggregation='percentile' (0-100) **unwanted\_focus** `boolean` (default: True) When both wanted and unwanted motifs exist, weight unwanted motifs more heavily in final score ReturnsConstraintOutput One result per sequence. Score ranges from 0.0 (all criteria satisfied) to 1.0 (severe violations). `metadata` carries a single `motif_constraint` dict: * `penalty`: Float overall penalty score (0.0-1.0) * `wanted`: Sorted list of wanted motif names * `not_wanted`: Sorted list of unwanted motif names * `found`: Dictionary mapping motif names to their best (lowest) FIMO p-values * `details`: Dictionary with per-motif scoring details including: * `penalty`: Individual motif penalty * `status`: "wanted\_found", "wanted\_missing", "unwanted", or "unwanted\_absent" * `p_value`: FIMO p-value if motif was found * `aggregation_info`: Dictionary with aggregation statistics: * `method`: Aggregation method used * `unwanted_count`: Number of unwanted motif evaluations * `wanted_count`: Number of wanted motif evaluations * `unwanted_matches`: Number of unwanted motifs found * `wanted_matches`: Number of wanted motifs found ## Usage Requiring specific transcription factor binding sites: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> promoter_seq = Sequence("ATCGGCGGGATCGTAATATAGCATGC", "dna") >>> config = SeqMotifConfig( ... motifs_path="/data/jaspar_vertebrates.meme", ... wanted=["SP1", "lacI"], ... aggregation="average", ... ) >>> results = seq_motif_constraint([(promoter_seq,)], config) >>> print(results[0].score) # e.g., 0.15 >>> print(results[0].metadata["motif_constraint"]["found"]) # e.g., {"SP1": 1e-8} ``` ## Metadata | Property | Value | | - | - | | Key | `seq-motif` | | Function | `seq_motif_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # Sequence Length Source: https://proto.evodesign.org/docs/language/constraints/sequence-length Evaluate sequence length against target value or acceptable range ![Sequence Length](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/sequence_length_constraint.py#L97) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate sequence length against target value or acceptable range. This constraint function evaluates whether sequences have appropriate lengths. It supports two modes: range mode (acceptable length window) and target mode (exact length matching). ## API Reference ConfigSequenceLengthConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/sequence_length_constraint.py#L14) Configuration for sequence length constraint. This class defines configuration parameters for evaluating sequence length in DNA, RNA, or protein sequences. The constraint supports two modes: range mode (specify acceptable length range) and target mode (specify exact target length). Supports two mutually exclusive modes: 1. **Range mode**: Specify both min\_length and max\_length to define an acceptable length range. Sequences within this range receive score 0.0, while those outside are penalized based on distance from the range. 2. **Target mode**: Specify target\_length for exact length matching. Sequences exactly matching the target receive score 0.0, while deviations are penalized based on proportional distance from the target. **min\_length** `integer` Minimum acceptable length (use with max\_length for range mode) **max\_length** `integer` Maximum acceptable length (use with min\_length for range mode) **target\_length** `integer` Target length for exact matching (alternative to min/max range) ReturnsConstraintOutput One result per sequence. A score of 0.0 indicates the sequence meets the length requirement (within range or at target). Higher scores indicate greater deviation: * **Range mode**: Linear penalty based on distance outside \[min, max]. Score = 0.0 if within range, else proportional to deviation distance. * **Target mode**: Normalized penalty as |actual - target| / target. For example, 10% deviation from target yields score \~0.1. `metadata` carries: **For range mode:** * `length`: Integer actual sequence length * `length_mode`: String "range" * `length_min`: Integer minimum acceptable length * `length_max`: Integer maximum acceptable length **For target mode:** * `length`: Integer actual sequence length * `length_mode`: String "target" * `length_target`: Integer target length ## Usage Range mode (protein): ```python python icon="python" theme={null} >>> seqs = [(Sequence("MVLSP", "protein"),)] >>> cfg = SequenceLengthConfig(min_length=4, max_length=10) >>> results = sequence_length_constraint(seqs, cfg) ``` Target mode (DNA): ```python python icon="python" theme={null} >>> seqs = [(Sequence("ATCGATCG", "dna"),)] >>> cfg = SequenceLengthConfig(target_length=8) >>> results = sequence_length_constraint(seqs, cfg) ``` ## Metadata | Property | Value | | - | - | | Key | `sequence-length` | | Function | `sequence_length_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna`, `protein` | # Sequence Alignment Source: https://proto.evodesign.org/docs/language/constraints/sequence_alignment/overview Constraints grouped under Sequence Alignment. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Sequence Alignment. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/gap-gini/carousel.png)](/docs/language/constraints/gap-gini) # Sequence Annotation Source: https://proto.evodesign.org/docs/language/constraints/sequence_annotation/overview Constraints grouped under Sequence Annotation. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Sequence Annotation. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/alphagenome-interval-track/carousel.png)](/docs/language/constraints/alphagenome-interval-track) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/borzoi-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/borzoi-track-activity/carousel.png)](/docs/language/constraints/borzoi-track-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-array/carousel.png)](/docs/language/constraints/crispr-array) [![](https://proto-bio.github.io/proto-assets/images/constraint/crispr-tracr-rna/carousel.png)](/docs/language/constraints/crispr-tracr-rna) [![](https://proto-bio.github.io/proto-assets/images/constraint/enformer-chromatin-accessibility-morse/carousel.png)](/docs/language/constraints/enformer-chromatin-accessibility-morse) [![](https://proto-bio.github.io/proto-assets/images/constraint/longest-orf-length/carousel.png)](/docs/language/constraints/longest-orf-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/malinois-activity/carousel.png)](/docs/language/constraints/malinois-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mirna-specificity/carousel.png)](/docs/language/constraints/mirna-specificity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mmseqs-gene-similarity/carousel.png)](/docs/language/constraints/mmseqs-gene-similarity) [![](https://proto-bio.github.io/proto-assets/images/constraint/operator-site/carousel.png)](/docs/language/constraints/operator-site) [![](https://proto-bio.github.io/proto-assets/images/constraint/promoter-strength/carousel.png)](/docs/language/constraints/promoter-strength) [![](https://proto-bio.github.io/proto-assets/images/constraint/puffin-promoter-activity/carousel.png)](/docs/language/constraints/puffin-promoter-activity) [![](https://proto-bio.github.io/proto-assets/images/constraint/seq-motif/carousel.png)](/docs/language/constraints/seq-motif) [![](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/carousel.png)](/docs/language/constraints/sigma70-promoter) [![](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/carousel.png)](/docs/language/constraints/targetscan-site) # Sequence Composition Source: https://proto.evodesign.org/docs/language/constraints/sequence_composition/overview Constraints grouped under Sequence Composition. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Sequence Composition. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/codon-adaptation-index/carousel.png)](/docs/language/constraints/codon-adaptation-index) [![](https://proto-bio.github.io/proto-assets/images/constraint/dinucleotide-composition/carousel.png)](/docs/language/constraints/dinucleotide-composition) [![](https://proto-bio.github.io/proto-assets/images/constraint/gc-content/carousel.png)](/docs/language/constraints/gc-content) [![](https://proto-bio.github.io/proto-assets/images/constraint/kmer-frequency/carousel.png)](/docs/language/constraints/kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/max-homopolymer/carousel.png)](/docs/language/constraints/max-homopolymer) [![](https://proto-bio.github.io/proto-assets/images/constraint/sequence-length/carousel.png)](/docs/language/constraints/sequence-length) [![](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/carousel.png)](/docs/language/constraints/specific-kmer-frequency) [![](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/carousel.png)](/docs/language/constraints/uracil-content) # Sequence Scoring Source: https://proto.evodesign.org/docs/language/constraints/sequence_scoring/overview Constraints grouped under Sequence Scoring. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. Constraints grouped under Sequence Scoring. Each scores a sequence from 0.0 (perfectly satisfied) to 1.0 (maximally violated). Select a constraint below for its full reference and configuration. [![](https://proto-bio.github.io/proto-assets/images/constraint/ablang-perplexity/carousel.png)](/docs/language/constraints/ablang-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/codonfm-fitness/carousel.png)](/docs/language/constraints/codonfm-fitness) [![](https://proto-bio.github.io/proto-assets/images/constraint/esm2-perplexity/carousel.png)](/docs/language/constraints/esm2-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-perplexity/carousel.png)](/docs/language/constraints/mpnn-perplexity) [![](https://proto-bio.github.io/proto-assets/images/constraint/mpnn-sequence-probability/carousel.png)](/docs/language/constraints/mpnn-sequence-probability) # Sigma70 Promoter Strength Source: https://proto.evodesign.org/docs/language/constraints/sigma70-promoter Evaluate sigma-70 promoter similarity for DNA sequences ![Sigma70 Promoter Strength](https://proto-bio.github.io/proto-assets/images/constraint/sigma70-promoter/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/sigma70_promoter_constraint.py#L201) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate E. coli sigma-70 promoter similarity using PWM-based scoring. This constraint function evaluates bacterial promoter similarity by scanning DNA sequences for sigma-70-dependent promoter elements. It identifies putative -35 and -10 boxes, scores them based on similarity to consensus sequences weighted by position-specific conservation probabilities, evaluates the spacer distance between them, and combines these scores into an overall promoter similarity prediction. The scoring model is based on RegulonDB experimental data for E. coli sigma-70 promoters and uses three components: 1. **PWM score**: Position weight matrix score based on conservation probabilities 2. **Match count**: Simple count of consensus matches (out of 12 positions) 3. **Spacer length**: Deviation from optimal 17 bp spacer The function scans sequences to find the best-scoring promoter configuration within the allowed spacer range \[min\_spacer, max\_spacer]. For short sequences (≤32 bp), it treats the entire sequence as a fixed promoter. For longer sequences, it exhaustively scans all positions. ## API Reference ConfigSigma70PromoterConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/sigma70_promoter_constraint.py#L15) Configuration for sigma-70 promoter similarity constraint. This class defines configuration parameters for evaluating bacterial promoter similarity using a position weight matrix (PWM) model of E. coli sigma-70 promoters. The model scores promoter elements based on similarity to consensus sequences for the -35 and -10 boxes, the spacer distance between them, and the total number of matches to consensus. This approach is based on RegulonDB experimental data for E. coli sigma-70-dependent promoters. The scoring combines three components: 1. PWM score: Similarity to consensus sequences weighted by conservation 2. Match count: Number of exact matches to consensus (out of 12 positions) 3. Spacer length: Distance between -35 and -10 boxes > [!NOTE] > > The constraint scans sequences to find the best-scoring promoter within > the allowed spacer range. For sequences ≤32 bp, it treats the entire > sequence as a single promoter (first 6 bp = -35, last 6 bp = -10). For > longer sequences, it scans all possible positions. > > The final penalty combines three components: > > 1. **Box penalty** = (1 - match\_weight) \* PWM\_penalty + match\_weight \* match\_penalty > 2. **Total penalty** = (1 - spacer\_weight) \* box\_penalty + spacer\_weight \* spacer\_penalty **consensus\_35** `string` (default: TTGACA) -35 box consensus sequence (6 bp, typically TTGACA for E. coli sigma-70) **consensus\_10** `string` (default: TATAAT) -10 box consensus sequence (6 bp Pribnow box, typically TATAAT for E. coli sigma-70) **probs\_35** `List[number]` (default: \[0.69, 0.79, 0.61, 0.56, 0.54, 0.54]) Position-specific conservation probabilities for -35 box (6 values). From RegulonDB. **probs\_10** `List[number]` (default: \[0.77, 0.76, 0.6, 0.61, 0.56, 0.82]) Position-specific conservation probabilities for -10 box (6 values). From RegulonDB. **optimal\_spacer** `integer` (default: 17) Optimal spacer length between -35 and -10 boxes in base pairs (typically 17±1 bp) **spacer\_sigma** `number` (default: 1.5) Standard deviation for spacer length penalty. Lower values = stricter spacing requirement. **spacer\_weight** `number` (default: 0.3) Weight (0-1) for spacer penalty in total score. Higher = spacing more important. **gamma** `number` (default: 0.1) PWM score exponent for non-linearity. Lower values = more sensitive to mismatches. **k\_opt** `integer` (default: 8) Optimal number of matches to consensus (out of 12 total positions) **match\_sigma** `number` (default: 2.0) Standard deviation for match count penalty **match\_weight** `number` (default: 0.3) Weight (0-1) for match count penalty in total score **min\_spacer** `integer` (default: 14) Minimum acceptable spacer length in bp **max\_spacer** `integer` (default: 20) Maximum acceptable spacer length in bp ReturnsConstraintOutput One result per sequence. Score ranges from 0.0 (perfect promoter, exact consensus with optimal spacer) to 1.0 (poor/no promoter). `metadata` carries a single `sigma70` dict with the following fields: **For valid promoters found:** * `sigma70_score`: Float overall penalty score (0.0-1.0) * `pos`: Integer start position of the -35 box in the sequence * `box35`: String sequence of the -35 box (6 bp) * `box10`: String sequence of the -10 box (6 bp) * `spacer_len`: Integer spacer length between boxes (bp) * `total_matches`: Integer total matches to consensus (out of 12) * `pwm_penalty`: Float PWM-based penalty component (0.0-1.0) * `match_penalty`: Float match count penalty component (0.0-1.0) * `spacer_penalty`: Float spacer length penalty component (0.0-1.0) **For sequences too short (\<12 bp):** * `sigma70_score`: Float 1.0 (maximum penalty) * `reason`: String "too\_short" **For sequences with invalid spacer (12-32 bp range):** * `sigma70_score`: Float 1.0 (maximum penalty) * `reason`: String "invalid\_spacer" ## Usage Evaluating a canonical sigma-70 promoter: ```python python icon="python" theme={null} >>> from proto_language.core import Sequence, SequenceType >>> promoter_seq = Sequence( ... "TTGACAATGATACTTAGATTCACTTATAATACTAGTAG", # 17 bp spacer ... "dna", ... ) >>> config = Sigma70PromoterConfig() >>> results = sigma70_promoter_constraint([(promoter_seq,)], config) >>> print(results[0].score) # e.g., 0.08 (strong promoter) >>> sigma70 = results[0].metadata["sigma70"] >>> print(f"-35: {sigma70['box35']}, -10: {sigma70['box10']}") # TTGACA, TATAAT ``` ## Metadata | Property | Value | | - | - | | Key | `sigma70-promoter` | | Function | `sigma70_promoter_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna` | # Specific K-mer Frequency Source: https://proto.evodesign.org/docs/language/constraints/specific-kmer-frequency Evaluate frequency or usage deviation of a specific k-mer motif ![Specific K-mer Frequency](https://proto-bio.github.io/proto-assets/images/constraint/specific-kmer-frequency/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/specific_kmer_constraint.py#L96) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate frequency or usage deviation of a specific k-mer. Supports two scoring modes: 1. **Frequency mode**: Raw k-mer frequency (count / total k-mer positions). 2. **Usage deviation mode**: Observed/expected ratio using a zero-order Markov model (product of individual character frequencies). > [!NOTE] > > Metadata varies by mode: > > **Frequency mode:** > > * `{kmer}_frequency`: Float frequency value > > **Usage deviation mode:** > > * `{kmer}_usage_deviation`: Float observed/expected ratio > * `{kmer}_count`: Integer observed count > * `{kmer}_expected`: Float expected count ## API Reference ConfigSpecificKmerConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/specific_kmer_constraint.py#L16) Configuration for evaluating a single specific k-mer. For evaluating all k-mers of a given length, use KmerFrequencyConstraint. **kmer** `string` *required* The specific k-mer to evaluate (e.g., 'CG', 'GATC', 'ATG') **scoring\_mode** `enum` (default: frequency) Scoring mode: 'frequency' for raw counts, 'usage\_deviation' for observed/expected ratio Options: `frequency`, `usage_deviation` **min\_value** `number` *required* Minimum acceptable frequency/deviation based on scoring\_mode **max\_value** `number` *required* Maximum acceptable frequency/deviation based on scoring\_mode ReturnsConstraintOutput One result per input sequence. The `metadata` field carries per-mode k-mer data (see Note). ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import specific_kmer_constraint, SpecificKmerConfig constraint = Constraint( inputs=[segment], function=specific_kmer_constraint, function_config=SpecificKmerConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `specific-kmer-frequency` | | Function | `specific_kmer_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna`, `protein` | # SpliceTransformer intron boundary score Source: https://proto.evodesign.org/docs/language/constraints/splice-transformer-intron-boundary Score intron-boundary prediction with SpliceTransformer on three segments concatenated into one 1-kb target. ![SpliceTransformer intron boundary score](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-intron-boundary/hero.png) > [!NOTE] > > **License:** SpliceTransformer is open source and free for academic and commercial use under an Apache-2.0 license. Please refer to [the license](https://github.com/ShenLab-Genomics/SpliceTransformer/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/splice_transformer/social.png) Go to Tool Page [Open](/docs/tools/rna-splicing/splice-transformer) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/splice_transformer_intron_boundary.py#L151) @articleyou2024splicetransformer ```bibtex theme={null} @article{you2024splicetransformer, title={SpliceTransformer predicts tissue-specific splicing linked to human diseases}, author={You, Ningyuan and Liu, Chang and Gu, Yuxin and Wang, Rong and Jia, Hanying and Zhang, Tianyun and Jiang, Song and Shi, Jinsong and Chen, Ming and Guan, Min-Xin and Sun, Siqi and Pei, Shanshan and Liu, Zhihong and Shen, Ning}, journal={Nature Communications}, volume={15}, number={1}, pages={9129}, year={2024}, doi={10.1038/s41467-024-53088-6} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score donor/acceptor splice sites for three-segment intron boundaries. Accepts three segments (left\_flank, intron\_core, right\_flank), concatenates them into a single 1-kb target sequence, and scores donor/acceptor splice sites. ## API Reference ConfigSpliceTransformerIntronBoundaryConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/splice_transformer_intron_boundary.py#L33) Configuration for SpliceTransformer intron boundary constraint. This class defines configuration parameters for evaluating splice site quality using SpliceTransformer, a deep learning model trained to predict splice sites in pre-mRNA sequences. The constraint assesses whether specified positions in a sequence are likely to function as authentic splice sites, which is critical for proper intron removal and mRNA processing. > [!NOTE] > > SpliceTransformer requires sequences of specific lengths: > > * Concatenated target (left\_flank + intron\_core + right\_flank): scored > over a 1000 bp window. If the concatenation is longer, it is windowed > to 1000 bp centred on the donor/acceptor positions and the positions > are remapped into that window. > * Left context: Must be exactly 4000 bp > * Right context: Must be exactly 4000 bp > * Total sequence analyzed: 9000 bp (4000 + 1000 + 4000) > > The model outputs splice site probabilities for each position. Higher > scores indicate stronger predicted splice sites. Authentic splice sites > typically have scores > 0.5, while non-splice positions have scores near 0. **left\_context** `string` *required* Sequence of the left context for SpliceTransformer **right\_context** `string` *required* Sequence of the right context for SpliceTransformer **donor\_pos** `List[integer]` *required* 0-indexed position(s) into the concatenated target sequence of expected donor **acceptor\_pos** `List[integer]` *required* 0-indexed position(s) into the concatenated target sequence of expected acceptor **reduction** `enum` (default: mean) Combine donor/acceptor probs: 'mean' (average) or 'min' (weaker site must be strong). Options: `mean`, `min` **peak\_search\_radius** `integer` (default: 0) Max donor/acceptor probability within +/- this many positions of the index; 0 = exact index. **splice\_transformer\_config** `SpliceTransformerConfig` Advanced parameter configuration for SpliceTransformer. ReturnsConstraintOutput One result per input. `score` is the combined boundary penalty in `[0.0, 1.0]`. `metadata` carries `donor_pos`, `acceptor_pos`, `donor_score`, `acceptor_score`, and `total_splice_score`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import splice_transformer_intron_boundary, SpliceTransformerIntronBoundaryConfig constraint = Constraint( inputs=[segment], function=splice_transformer_intron_boundary, function_config=SpliceTransformerIntronBoundaryConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `splice-transformer-intron-boundary` | | Function | `splice_transformer_intron_boundary` | | Category | `rna_splicing` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # SpliceTransformer tissue specificity score Source: https://proto.evodesign.org/docs/language/constraints/splice-transformer-specificity Score tissue-specific splicing with SpliceTransformer on three segments concatenated into one 1-kb target. ![SpliceTransformer tissue specificity score](https://proto-bio.github.io/proto-assets/images/constraint/splice-transformer-specificity/hero.png) > [!NOTE] > > **License:** SpliceTransformer is open source and free for academic and commercial use under an Apache-2.0 license. Please refer to [the license](https://github.com/ShenLab-Genomics/SpliceTransformer/blob/main/LICENSE) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/splice_transformer/social.png) Go to Tool Page [Open](/docs/tools/rna-splicing/splice-transformer) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/splice_transformer_specificity.py#L134) @articleyou2024splicetransformer ```bibtex theme={null} @article{you2024splicetransformer, title={SpliceTransformer predicts tissue-specific splicing linked to human diseases}, author={You, Ningyuan and Liu, Chang and Gu, Yuxin and Wang, Rong and Jia, Hanying and Zhang, Tianyun and Jiang, Song and Shi, Jinsong and Chen, Ming and Guan, Min-Xin and Sun, Siqi and Pei, Shanshan and Liu, Zhihong and Shen, Ning}, journal={Nature Communications}, volume={15}, number={1}, pages={9129}, year={2024}, doi={10.1038/s41467-024-53088-6} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score tissue-specific splice site usage for three-segment intron boundaries. Accepts three segments (left\_flank, intron\_core, right\_flank), concatenates them into a single 1-kb target sequence, and scores tissue-specific splice site usage. ## API Reference ConfigSpliceTransformerSpecificityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/rna_splicing/splice_transformer_specificity.py#L34) Configuration for SpliceTransformer tissue-specific splicing constraint. This class defines configuration parameters for evaluating tissue-specific splicing patterns using SpliceTransformer, a deep learning model trained to predict splice site usage across different human tissues. The constraint can be used to either maximize splicing in a specific tissue (tissue-specific activation) or minimize it (tissue-specific repression), enabling design of sequences with controlled tissue-specific alternative splicing. **left\_context** `string` *required* Sequence of the left context for SpliceTransformer **right\_context** `string` *required* Sequence of the right context for SpliceTransformer **splice\_pos** `List[integer]` *required* 0-indexed position(s) into the concatenated target sequence on which to compute the score **tissue** `enum` (default: AVERAGE) Tissue on which to define the score. By default, averages across all tissues. Options: `AVERAGE`, `ADIPOSE_TISSUE`, `BLOOD`, `BLOOD_VESSEL`, `BRAIN`, `COLON`, `HEART`, `KIDNEY`, `LIVER`, `LUNG`, `MUSCLE`, `NERVE`, `SMALL_INTESTINE`, `SKIN`, `SPLEEN`, `STOMACH` **direction** `enum` (default: max) Whether to maximize or minimize the value. Defaults to 'max' Options: `max`, `min` **splice\_transformer\_config** `SpliceTransformerConfig` Advanced parameter configuration for SpliceTransformer. ReturnsConstraintOutput One result per input. `score` is in `[0.0, 1.0]` (interpretation depends on direction). `metadata` carries `specificity_direction_` and `specificity_score_`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import splice_transformer_specificity, SpliceTransformerSpecificityConfig constraint = Constraint( inputs=[segment], function=splice_transformer_specificity, function_config=SpliceTransformerSpecificityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `splice-transformer-specificity` | | Function | `splice_transformer_specificity` | | Category | `rna_splicing` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `dna` | # Structure Beta Strand Source: https://proto.evodesign.org/docs/language/constraints/structure-beta-strand Evaluate AF2 beta-strand-content loss. ![Structure Beta Strand](https://proto-bio.github.io/proto-assets/images/constraint/structure-beta-strand/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L143) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder beta-strand-content loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `beta_strand` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_beta_strand_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_beta_strand_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-beta-strand` | | Function | `structure_beta_strand_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Composite Confidence Source: https://proto.evodesign.org/docs/language/constraints/structure-composite Score structure quality using a composite of plddt/iptm/ptm/pae from a single prediction call ![Structure Composite Confidence](https://proto-bio.github.io/proto-assets/images/constraint/structure-composite/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/chai1/carousel.png)Structure Prediction · 6 tools Go to Category](/docs/tools/structure-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L643) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate structure quality using a composite of all confidence metrics from one prediction call. Runs `predict_structures` once per batch and combines `avg_plddt`, `iptm`, `ptm`, and `avg_pae` into a single scalar in `[0, 1]` where lower is better (more confident). All four raw metrics plus the resulting structure are also exposed via `metadata` / `structures` so callers can threshold on individual metrics post-hoc (e.g., Germinal's final-filter gates in `examples/germinal/configs/vhh_pdl1.yaml`) without re-running the predictor. The composite is the equal-weighted mean of normalized deviations: `(1 - plddt_norm + 1 - iptm + 1 - ptm + pae / PAE_MAXIMUM) / 4`. Versus stacking `structure-plddt` + `structure-iptm` + `structure-ptm` * `structure-pae` as four separate constraints, this is 4x cheaper (one `predict_structures` call instead of four) and exposes all metrics for post-hoc threshold labeling. **Supported tools**: ESMFold2, AlphaFold3, Boltz2, Chai1, Protenix, AlphaFold2 (NOT ESMFold v1 — it does not produce `iptm` and cannot handle multi-chain complexes, whereas ESMFold2 does both; NOT AF2 binder because its interface TM value is exposed as a differentiable objective rather than the same forward confidence metric used here). > [!NOTE] > > Metadata values are **all normalized to `[0, 1]`** so downstream > threshold code is tool-agnostic (unlike sibling single-metric > constraints, which store raw values and require the caller to know > the tool's scale): > > * `composite_avg_plddt`: Normalized pLDDT in `[0, 1]` (divided by > 100 for alphafold3). > * `composite_iptm`: ipTM in `[0, 1]`. > * `composite_ptm`: pTM in `[0, 1]`. > * `composite_avg_pae`: Normalized PAE in `[0, 1]` (raw Angstroms > divided by `PAE_MAXIMUM = 31.75`, clamped at 1). > * `pdb_output`: Stored PDB file handle. > * `structure_tool`: Tool name used for prediction. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal composite score in `[0, 1]` (lower is better). Metadata carries the four normalized components (`composite_avg_plddt`, `composite_iptm`, `composite_ptm`, `composite_avg_pae`) plus `pdb_output` and `structure_tool` for the predicted full input tuple; the predicted Structure attaches to slot 0. ## Usage Ranking binder candidates by composite structure quality with Chai-1: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> binder = Segment(length=80, sequence_type="protein") >>> target = Segment(sequence="MKTL...", sequence_type="protein") >>> chai1_composite = Constraint( ... inputs=[binder, target], ... function=structure_composite_constraint, ... function_config={"structure_tool": "chai1"}, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `structure-composite` | | Function | `structure_composite_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure Contact Loss Source: https://proto.evodesign.org/docs/language/constraints/structure-contact Evaluate AF2 intra-chain contact loss. ![Structure Contact Loss](https://proto-bio.github.io/proto-assets/images/constraint/structure-contact/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L31) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder intra-chain contact loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `con` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_contact_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_contact_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-contact` | | Function | `structure_contact_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Distogram CCE Source: https://proto.evodesign.org/docs/language/constraints/structure-distogram-cce Evaluate AF2 distogram CCE loss. ![Structure Distogram CCE](https://proto-bio.github.io/proto-assets/images/constraint/structure-distogram-cce/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L171) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder distogram cross-entropy loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `dgram_cce` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_distogram_cce_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_distogram_cce_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-distogram-cce` | | Function | `structure_distogram_cce_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Ensemble RMSD Source: https://proto.evodesign.org/docs/language/constraints/structure-ensemble-rmsd Generate a conformational ensemble and compute RMSD against a target structure via PyMOL. ![Structure Ensemble RMSD](https://proto-bio.github.io/proto-assets/images/constraint/structure-ensemble-rmsd/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/bioemu/social.png)](/docs/tools/structure-dynamics/bioemu) [![](https://proto-bio.github.io/proto-assets/images/tool/pymol_rmsd/social.png)](/docs/tools/structure-alignment/pymol-rmsd) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_ensemble_similarity_constraint.py#L412) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Generate conformational ensembles and compute RMSD against an experimental. target structure. This constraint: 1. Prepares the target structure (extracting chain/residue range if specified). 2. For each proposal sequence, generate a conformational ensemble. 3. Computes PyMOL-aligned RMSD between each ensemble frame and the target. 4. Summarizes the RMSDs using the specified aggregation method. 5. Converts the summarized RMSD to a 0-1 score using a sigmoid function. ## API Reference ConfigStructureEnsembleSimilarityConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_ensemble_similarity_constraint.py#L260) Configuration for structure ensemble similarity constraints. This constraint generates a conformational ensemble for a proposal protein sequence and computes the RMSD between ensemble members and an experimental target structure using PyMOL alignment. **target\_structure** `Structure | string` *required* Target structure: a Structure object, file path (.pdb/.cif), or raw PDB/CIF content string. **target\_chain\_id** `string` Chain ID to extract from the target structure (e.g., 'A'). **target\_residue\_range** `array` Residue range (start, end) to extract from target (1-indexed, inclusive). **proposal\_residue\_range** `array` Residue range (start, end) of the proposal sequence to use. **bioemu\_config** `BioEmuConfig` Dictionary of configuration parameters passed to the ensemble prediction tool. **rmsd\_aggregation** `enum` (default: min) How to summarize ensemble RMSD values: min (best match), p10, mean, or median. Options: `min`, `p10`, `mean`, `median` **pymol\_alignment\_method** `enum` (default: align) PyMOL alignment routine for ensemble RMSD calculation. Options: `cealign`, `align` **inflection\_point\_angstroms** `number` (default: 3.0) RMSD in Ångströms where the sigmoid score equals 0.5; values below 3 Å are generally a good match. **sigmoid\_slope** `number` (default: 3.0) Steepness of the penalty curve. **verbose** `boolean` (default: False) Whether to print progress messages. ReturnsConstraintOutput Per-proposal score in `[0, 1]` (0 is a perfect match) with ensemble RMSD summary/distribution metadata. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_ensemble_rmsd_constraint, StructureEnsembleSimilarityConfig constraint = Constraint( inputs=[segment], function=structure_ensemble_rmsd_constraint, function_config=StructureEnsembleSimilarityConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-ensemble-rmsd` | | Function | `structure_ensemble_rmsd_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Helix Loss Source: https://proto.evodesign.org/docs/language/constraints/structure-helix Evaluate AF2 helical-content loss. ![Structure Helix Loss](https://proto-bio.github.io/proto-assets/images/constraint/structure-helix/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L115) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder helical-content loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `helix` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_helix_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_helix_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-helix` | | Function | `structure_helix_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Interface Contact Source: https://proto.evodesign.org/docs/language/constraints/structure-interface-contact Evaluate AF2 interface contact loss. ![Structure Interface Contact](https://proto-bio.github.io/proto-assets/images/constraint/structure-interface-contact/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L59) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder interface contact loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `i_con` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_interface_contact_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_interface_contact_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-interface-contact` | | Function | `structure_interface_contact_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Interface pAE Source: https://proto.evodesign.org/docs/language/constraints/structure-ipae Evaluate AF2 binder interface PAE confidence. ![Structure Interface pAE](https://proto-bio.github.io/proto-assets/images/constraint/structure-ipae/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L583) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate AF2 binder interface PAE confidence. This reads the predictor-style `ipae` metric exposed through the AF2 binder adapter and returns normalized interface PAE, so lower scores indicate better interface-local confidence. The underlying ColabDesign objective is still preserved separately as `loss_ipae` metadata. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal interface PAE confidence scores. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_ipae_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_ipae_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-ipae` | | Function | `structure_ipae_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure Interface pLDDT Source: https://proto.evodesign.org/docs/language/constraints/structure-iplddt Evaluate AF2 binder interface pLDDT confidence. ![Structure Interface pLDDT](https://proto-bio.github.io/proto-assets/images/constraint/structure-iplddt/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L530) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate AF2 binder interface pLDDT confidence. This reads the predictor-style `iplddt` metric exposed through the AF2 binder adapter and returns `1.0 - iplddt` so lower scores indicate better interface-local confidence. The underlying ColabDesign objective is still preserved separately as `loss_iplddt` metadata. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal interface pLDDT confidence scores. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_iplddt_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_iplddt_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-iplddt` | | Function | `structure_iplddt_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structure ipTM Score Source: https://proto.evodesign.org/docs/language/constraints/structure-iptm Evaluate interface quality using predicted interface TM score ![Structure ipTM Score](https://proto-bio.github.io/proto-assets/images/constraint/structure-iptm/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/chai1/carousel.png)Structure Prediction · 6 tools Go to Category](/docs/tools/structure-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L373) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate interface quality using predicted interface TM-score (ipTM). ipTM (interface predicted TM-score) specifically measures the quality of predicted inter-chain interfaces in multimeric complexes. Values range from 0.0 to 1.0, where higher values indicate better interface predictions. This constraint returns `1.0 - iptm`, so lower scores indicate better predicted interface quality. **Supported tools**: ESMFold2, AlphaFold3, Boltz2, Chai1, Protenix, AlphaFold2, AlphaFold2 binder (NOT ESMFold v1) ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score and `iptm` / `pdb_output` / `structure_tool` metadata; predicted Structure attaches to slot 0. ## Usage Programming a protein-protein binder with AF3: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> target = Segment(length=200, sequence_type="protein") >>> binder = Segment(length=80, sequence_type="protein") >>> af3_iptm = Constraint( ... inputs=[target, binder], ... function=structure_iptm_constraint, ... function_config={ ... "structure_tool": "alphafold3", ... "alphafold3_config": {"seeds": [0, 1], "use_msa": True}, ... }, ... ) ``` Programming a protein-DNA binder with Boltz2: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> protein = Segment(length=100, sequence_type="protein") >>> aptamer = Segment(length=20, sequence_type="dna") >>> boltz_iptm = Constraint( ... inputs=[protein, aptamer], ... function=structure_iptm_constraint, ... function_config={ ... "structure_tool": "boltz2", ... "boltz2_config": {"use_msa_server": True}, ... }, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `structure-iptm` | | Function | `structure_iptm_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure pAE Score Source: https://proto.evodesign.org/docs/language/constraints/structure-pae Evaluate structure quality using predicted aligned error ![Structure pAE Score](https://proto-bio.github.io/proto-assets/images/constraint/structure-pae/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)Structure Prediction · 7 tools Go to Category](/docs/tools/structure-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L462) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate structure quality using predicted aligned error (pAE). pAE (predicted Aligned Error) measures the expected positional error between residue pairs. pAE values are from 0 to 31.75 Angstroms. Unlike most confidence metrics, lower pAE values (closer to 0) are better. The average pAE takes the mean of the pairwise matrix. This constraint transforms pAE as the normalized mean PAE, i.e., it: 1. Computes the average of the entire pairwise pAE matrix. 2. Normalizes by 31.75 Angstroms (the AlphaFold maximum value used by all major structure predictors). 3. Returns that value without flipping the sign, as lower is better. **Supported tools**: ESMFold, ESMFold2, AlphaFold3, Boltz2, Chai1, Protenix, AlphaFold2, AlphaFold2 binder ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score and `avg_pae` / `pdb_output` / `structure_tool` metadata; predicted Structure attaches to slot 0. ## Usage Programming a protein-protein binder with AF3: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> target = Segment(length=200, sequence_type="protein") >>> binder = Segment(length=80, sequence_type="protein") >>> af3_pae = Constraint( ... inputs=[target, binder], ... function=structure_pae_constraint, ... function_config={ ... "structure_tool": "alphafold3", ... "alphafold3_config": {"seeds": [0, 1], "use_msa": True}, ... }, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `structure-pae` | | Function | `structure_pae_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure pLDDT Score Source: https://proto.evodesign.org/docs/language/constraints/structure-plddt Evaluate structure quality using predicted LDDT score ![Structure pLDDT Score](https://proto-bio.github.io/proto-assets/images/constraint/structure-plddt/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)Structure Prediction · 7 tools Go to Category](/docs/tools/structure-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L228) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate structure quality using predicted LDDT (pLDDT) score. pLDDT (predicted Local Distance Difference Test) measures per-residue confidence in the predicted structure. Values range from 0.0 to 100.0 (sometimes, these are normalized from 0.0 to 1.0) where higher values indicate more reliable predictions. This constraint returns 1.0 - **normalized** pLDDT, so lower scores indicate better predicted structure quality. Note that for Boltz2, this is based on the `"complex_plddt"` score returned natively by the package. **Supported tools**: ESMFold, ESMFold2, AlphaFold3, Boltz2, Chai1, Protenix, AlphaFold2, AlphaFold2 binder ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score and `avg_plddt` / `pdb_output` / `structure_tool` metadata for the predicted full input tuple; predicted Structure attaches to slot 0. ## Usage Programming a homo-trimer with ESMFold: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> protomer = Segment(length=10, sequence_type="protein") >>> esmfold_plddt = Constraint( ... inputs=[protomer, protomer, protomer], ... function=structure_plddt_constraint, ... function_config={"structure_tool": "esmfold"}, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `structure-plddt` | | Function | `structure_plddt_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure pTM Score Source: https://proto.evodesign.org/docs/language/constraints/structure-ptm Evaluate structure quality using predicted TM score ![Structure pTM Score](https://proto-bio.github.io/proto-assets/images/constraint/structure-ptm/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)Structure Prediction · 7 tools Go to Category](/docs/tools/structure-prediction/overview) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_confidence_constraint.py#L304) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Evaluate structure quality using predicted TM-score (pTM). pTM (predicted Template Modeling score) measures overall structural accuracy of the predicted model. Values range from 0.0 to 1.0, where higher values indicate better global fold quality. This constraint returns `1.0 - ptm`, so lower scores indicate better predicted structure quality. **Supported tools**: ESMFold, ESMFold2, AlphaFold3, Boltz2, Chai1, Protenix, AlphaFold2, AlphaFold2 binder ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Per-proposal score and `ptm` / `pdb_output` / `structure_tool` metadata; predicted Structure attaches to slot 0. ## Usage Programming a homo-dimer with ESMFold: ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> protomer = Segment(length=20, sequence_type="protein") >>> esmfold_plddt = Constraint( ... inputs=[protomer, protomer], ... function=structure_ptm_constraint, ... function_config={"structure_tool": "esmfold"}, ... ) ``` ## Metadata | Property | Value | | - | - | | Key | `structure-ptm` | | Function | `structure_ptm_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure Radius Gyration Source: https://proto.evodesign.org/docs/language/constraints/structure-radius-gyration Evaluate AF2 radius-of-gyration loss. ![Structure Radius Gyration](https://proto-bio.github.io/proto-assets/images/constraint/structure-radius-gyration/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L87) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder radius-of-gyration loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `rg` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_radius_gyration_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_radius_gyration_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-radius-gyration` | | Function | `structure_radius_gyration_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structural RMSD Similarity Source: https://proto.evodesign.org/docs/language/constraints/structure-rmsd Compare structure RMSD against a target (PDB or Sequence) using generic predictors. ![Structural RMSD Similarity](https://proto-bio.github.io/proto-assets/images/constraint/structure-rmsd/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)Structure Prediction · 7 tools](/docs/tools/structure-prediction/overview)[ ![](https://proto-bio.github.io/proto-assets/images/tool/pymol_rmsd/social.png)](/docs/tools/structure-alignment/pymol-rmsd) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_similarity_constraint.py#L309) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Predicts structure of input proposals and compares RMSD against a target. Returns a score 0-1 (0 is perfect match). Metadata describes the predicted full input tuple/complex, not an individual chain. ## API Reference ConfigStructureRMSDConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_similarity_constraint.py#L149) Configuration for RMSD-based structure similarity. This configuration extends `StructureSimilarityConfig` with specific parameters for calculating the Root Mean Square Deviation (RMSD) between the target and proposal structures. The raw RMSD value is transformed into a 0-1 constraint score using a sigmoid function, where 0 represents a perfect match (low RMSD) and 1 represents a poor match (high RMSD). Inherits target specification (`target_chains`, `target_structure`, `min_target_plddt`) from `StructureSimilarityConfig` and tool selection (`structure_tool`, `esmfold_config`, `esmfold2_config`, `alphafold3_config`, `boltz2_config`, `chai1_config`, `protenix_config`, `alphafold2_config`, `alphafold2_binder_config`) from `StructureBasedConstraintConfig`. **inflection\_point\_angstroms** `number` (default: 2.0) RMSD in Ångströms where the sigmoid score equals 0.5; values below 2 Å are generally a good match. **sigmoid\_slope** `number` (default: 3.0) Steepness of the penalty curve. **pymol\_alignment\_method** `enum` (default: cealign) PyMOL alignment routine for RMSD calculation. Options: `cealign`, `align` **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. **target\_chains** `array | Complex` Target chains: a tuple of sequence strings (entity types auto-detected). **target\_structure** `Structure | string` Target structure: a Structure object, file path (.pdb/.cif), or raw PDB/CIF content string. **min\_target\_plddt** `number` (default: 0.6) Min mean pLDDT (0-1 scale) for a target folded from sequence; ignored when target\_structure is set. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_rmsd_constraint, StructureRMSDConfig constraint = Constraint( inputs=[segment], function=structure_rmsd_constraint, function_config=StructureRMSDConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-rmsd` | | Function | `structure_rmsd_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # Structure Termini Distance Source: https://proto.evodesign.org/docs/language/constraints/structure-termini-distance Evaluate AF2 N-to-C termini distance loss. ![Structure Termini Distance](https://proto-bio.github.io/proto-assets/images/constraint/structure-termini-distance/hero.png) > [!NOTE] > > **License:** AlphaFold2 uses Apache-2.0 for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/google-deepmind/alphafold/blob/main/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold2/social.png) Go to Tool Page [Open](/docs/tools/structure-prediction/alphafold2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_geometry_constraint.py#L199) @articlejumper2021alphafold2 ```bibtex theme={null} @article{jumper2021alphafold2, title={Highly accurate protein structure prediction with AlphaFold}, author={Jumper, John and Evans, Richard and Pritzel, Alexander and Green, Tim and Figurnov, Michael and Ronneberger, Olaf and Tunyasuvunakool, Kathryn and Bates, Russ and {\v{Z}}{\'\i}dek, Augustin and Potapenko, Anna and others}, journal={Nature}, volume={596}, number={7873}, pages={583--589}, year={2021}, publisher={Nature Publishing Group}, doi={10.1038/s41586-021-03819-2} } ``` Copy citation Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Evaluate AF2 binder N-to-C termini distance loss. ## API Reference ConfigStructureBasedConstraintConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_constraint_config.py#L320) Base configuration for constraints using structure prediction tools. This base class standardizes how structure prediction tools and their configurations are specified across all structure-based constraints. Each tool has its own dedicated config field. Subclasses can optionally restrict which tools are supported by overriding the structure\_tool field with a narrower Literal type. **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. ReturnsConstraintOutput Raw AF2 `NC` loss outputs. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_termini_distance_constraint, StructureBasedConstraintConfig constraint = Constraint( inputs=[segment], function=structure_termini_distance_constraint, function_config=StructureBasedConstraintConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-termini-distance` | | Function | `structure_termini_distance_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein` | # Structural TM-score Similarity Source: https://proto.evodesign.org/docs/language/constraints/structure-tmscore Compare structure TM-score against a target. Returns 1 - TMscore. ![Structural TM-score Similarity](https://proto-bio.github.io/proto-assets/images/constraint/structure-tmscore/hero.png) > [!NOTE] > > **License:** This constraint can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [ ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/esmfold2/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/alphafold3/carousel.png) ![](https://proto-bio.github.io/proto-assets/images/tool/boltz2/carousel.png)Structure Prediction · 7 tools](/docs/tools/structure-prediction/overview)[ ![](https://proto-bio.github.io/proto-assets/images/tool/tmalign/social.png)](/docs/tools/structure-alignment/tmalign)[ ![](https://proto-bio.github.io/proto-assets/images/tool/usalign/social.png)](/docs/tools/structure-alignment/usalign) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_similarity_constraint.py#L396) Constraint contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Predicts structure and compares TM-score. Returns (1.0 - TMscore). This constraint automatically selects the appropriate alignment tool based on the oligomer state of the inputs: * Monomer vs monomer comparisons use standard `TMalign`. * Comparisons involving multiple chains use `USalign` with `-mm 1` and default values for all other parameters. > [!NOTE] > > The two raw TM-scores are combined per `config.tm_score_normalization` > (default: arithmetic mean of the proposal- and target-normalized scores); > the target is the reference structure. Metadata describes the predicted > full input tuple/complex, not an individual chain. ## API Reference ConfigStructureTMScoreConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/protein_structure/structure_similarity_constraint.py#L198) Configuration for TM-score based structure similarity. This configuration extends `StructureSimilarityConfig` for calculating the Template Modeling score (TM-score) between the target and proposal structures. TM-score is a metric for assessing the topological similarity of protein structures and is less sensitive to local variations than RMSD. The constraint returns a score calculated as (1.0 - TM\_score), where 0.0 indicates a perfect match (TM-score = 1.0) and values closer to 1.0 indicate poor structural similarity. Inherits target specification (`target_chains`, `target_structure`, `min_target_plddt`) from `StructureSimilarityConfig` and tool selection (`structure_tool`, `esmfold_config`, `esmfold2_config`, `alphafold3_config`, `boltz2_config`, `chai1_config`, `protenix_config`, `alphafold2_config`, `alphafold2_binder_config`) from `StructureBasedConstraintConfig`. **plddt\_threshold** `number` Drop residues with pLDDT (0-100 scale, in B-factor) below this before alignment; None keeps all. **tm\_score\_normalization** `enum` (default: mean) How to combine the two TM-scores from TM-align/US-align: structure1, structure2, max, min, or mean. Options: `structure1`, `structure2`, `max`, `min`, `mean` **structure\_tool** `enum` (default: esmfold) Predictor: esmfold/esmfold2/alphafold3/boltz2/chai1/protenix/alphafold2/alphafold2\_binder. Options: `esmfold`, `esmfold2`, `alphafold3`, `boltz2`, `chai1`, `protenix`, `alphafold2`, `alphafold2_binder` **esmfold\_config** `ESMFoldConfig` Configuration for ESMFold structure prediction. **esmfold2\_config** `ESMFold2Config` Configuration for ESMFold2 structure prediction. **alphafold3\_config** `AlphaFold3Config` Configuration for AlphaFold3 structure prediction. **boltz2\_config** `Boltz2Config` Configuration for Boltz2 structure prediction. **chai1\_config** `Chai1Config` Configuration for Chai1 structure prediction. **protenix\_config** `ProtenixConfig` Configuration for Protenix structure prediction. **alphafold2\_config** `AlphaFold2Config` Configuration for the general AlphaFold2 multimer structure predictor. **alphafold2\_binder\_config** `AlphaFold2BinderStructureConfig` Configuration for the AF2 binder-design backend. **target\_chains** `array | Complex` Target chains: a tuple of sequence strings (entity types auto-detected). **target\_structure** `Structure | string` Target structure: a Structure object, file path (.pdb/.cif), or raw PDB/CIF content string. **min\_target\_plddt** `number` (default: 0.6) Min mean pLDDT (0-1 scale) for a target folded from sequence; ignored when target\_structure is set. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import structure_tmscore_constraint, StructureTMScoreConfig constraint = Constraint( inputs=[segment], function=structure_tmscore_constraint, function_config=StructureTMScoreConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `structure-tmscore` | | Function | `structure_tmscore_constraint` | | Category | `protein_structure` | | Mode | `discrete` | | Uses GPU | `True` | | Supported Types | `protein`, `rna`, `dna`, `ligand` | # TargetScan Seed Site Source: https://proto.evodesign.org/docs/language/constraints/targetscan-site Score miRNA target-site burden by TargetScan canonical seed-match site typing (6mer/7mer/8mer). ![TargetScan Seed Site](https://proto-bio.github.io/proto-assets/images/constraint/targetscan-site/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/targetscan_site_constraint.py#L210) Constraint contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm) Score miRNA seed-match site burden using TargetScan's canonical site definitions. For each target sequence and each miRNA, canonical seed-match sites are detected and summed with per-site-type and per-miRNA weights into an aggregate burden, bounded by `repression_threshold`. `direction='maximize'` rewards installing sites (low score when burden is high); `direction='minimize'` rewards escaping them. ## API Reference ConfigTargetScanSiteConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_annotation/targetscan_site_constraint.py#L53) Configuration for TargetScan canonical seed-match site scoring. **mirna\_queries** `List[string]` *required* miRNA query sequences (>= 8 nt) whose seed (positions 2-8) defines target sites. **mirna\_ids** `array` Optional identifiers for miRNA queries. **mirna\_weights** `array` Optional nonnegative per-miRNA expression weights matching the miRNA query order. **direction** `enum` (default: maximize) Whether predicted miRNA site burden should be high or low. Options: `maximize`, `minimize` **repression\_threshold** `number` (default: 2.0) Aggregated site-burden score treated as saturating success. **site\_type\_weights** `object` Per-site-type strengths for 8mer/7mer-m8/7mer-A1/6mer. **include\_6mer** `boolean` (default: True) Whether to count weak 6mer sites (set False to require >= 7mer). ReturnsConstraintOutput One result per sequence. `score` is in `[0, 1]` (0.0 = objective fully satisfied). `metadata` carries the aggregated `targetscan_repression_score`, `targetscan_num_sites`, and a per-site list with miRNA id, site type, weighted strength, and 1-indexed coordinates. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import targetscan_site_constraint, TargetScanSiteConfig constraint = Constraint( inputs=[segment], function=targetscan_site_constraint, function_config=TargetScanSiteConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `targetscan-site` | | Function | `targetscan_site_constraint` | | Category | `sequence_annotation` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # Uracil Content Source: https://proto.evodesign.org/docs/language/constraints/uracil-content Enforce uracil/thymine content within a specified range ![Uracil Content](https://proto-bio.github.io/proto-assets/images/constraint/uracil-content/hero.png) This constraint is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/uracil_content_constraint.py#L57) Constraint contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Enforce uracil (U) content within a specified range. Counts uracil, treating DNA thymine (`T`) as equivalent to RNA uracil (`U`), and penalizes deviation from `[min_u, max_u]`. ## API Reference ConfigUracilContentConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/constraint/sequence_composition/uracil_content_constraint.py#L21) Configuration for the uracil (U) content constraint. The penalty is `0` inside `[min_u, max_u]` and scales linearly with the deviation outside it. **min\_u** `number` (default: 0.0) Minimum acceptable uracil content percentage (0-100) **max\_u** `number` (default: 100.0) Maximum acceptable uracil content percentage (0-100) ReturnsConstraintOutput One result per sequence. `score` is `0.0` when U content is within range and scales linearly with deviation otherwise; `metadata` carries `uracil_content`. ## Usage ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import uracil_content_constraint, UracilContentConfig constraint = Constraint( inputs=[segment], function=uracil_content_constraint, function_config=UracilContentConfig( # Configure parameters here ), ) scores = constraint.evaluate() ``` ## Metadata | Property | Value | | - | - | | Key | `uracil-content` | | Function | `uracil_content_constraint` | | Category | `sequence_composition` | | Mode | `discrete` | | Uses GPU | `False` | | Supported Types | `dna`, `rna` | # Autoregressive Source: https://proto.evodesign.org/docs/language/generators/autoregressive/overview Autoregressive generators produce a sequence token by token from a prompt, suited to de novo generation. Autoregressive generators produce a sequence token by token from a prompt, suited to de novo generation. [![](https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png)](/docs/language/generators/evo1) [![](https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png)](/docs/language/generators/evo2) [![](https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png)](/docs/language/generators/progen2) # CodonFM Codon Language Model Source: https://proto.evodesign.org/docs/language/generators/codonfm CodonFM/Encodon masked codon language model for local coding-sequence mutation/refinement ![CodonFM Codon Language Model](https://proto-bio.github.io/proto-assets/images/generator/codonfm/hero.png) > [!NOTE] > > **License:** CodonFM (Encodon) uses Apache-2.0 for code and Custom (NVIDIA Open Model License) for model weights. Please refer to the [code license](https://github.com/NVIDIA-BioNeMo/CodonFM/blob/main/LICENSE) and [model weights license](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/codonfm/social.png) Go to Tool Page [Open](/docs/tools/masked-models/codonfm) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/codonfm_generator.py#L84) @articlecodonfm2025 ```bibtex theme={null} @article{codonfm2025, title={Learning the language of codon translation with CodonFM}, author={Darabi, Sajad and Cao, Fan and Naghipourfar, Mohsen and Rabi, Sara and Sethia, Ankit and Gion, Kyle and Grewal, Jasleen and Cohen, Jonathan and Greenleaf, William and Goodarzi, Hani and Sundaram, Laksshman}, year={2025}, publisher={NVIDIA}, url={https://research.nvidia.com/labs/dbr/assets/data/manuscripts/nv-codonfm-preprint.pdf} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Coding-sequence mutation generator using the CodonFM (Encodon) codon language model. Refines existing coding sequences by masking a subset of codon positions and resampling them from Encodon's per-codon distribution. Sequence length is preserved. The generator category is `"mutation"`. ## API Reference ConfigCodonFMGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/codonfm_generator.py#L19) Configuration object for CodonFMGenerator. CodonFM (Encodon) is a codon-level masked language model. As a Proto Language generator it refines an existing coding sequence by masking a subset of codons and resampling them from the model — a mutation-category generator, so the segment must already carry a sequence (directly or from a prior optimizer stage). **model\_checkpoint** `enum` (default: encodon\_80m) Encodon checkpoint: encodon\_80m | encodon\_600m | encodon\_1b | encodon\_1b\_cdwt. Options: `encodon_80m`, `encodon_600m`, `encodon_1b`, `encodon_1b_cdwt` **masking\_strategy** `RandomMaskingStrategy` Which codons to resample (counted in codons); fixed\_positions pins codons that must survive. **temperature** `number` (default: 1.0) Sampling temperature. Below 1 sharpens toward the likely codon; above 1 adds diversity. **device** `string` (default: cuda) GPU device to run CodonFM on (e.g. 'cuda' or 'cuda:0'). **batch\_size** `integer` (default: 1) Number of same-length sequences to process simultaneously on GPU. **excluded\_amino\_acids** `array` Single-letter codes no resampled codon may encode (e.g. \['C'] to forbid cysteine). ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import CodonFMGenerator, CodonFMGeneratorConfig >>> from proto_language.core import Segment >>> from proto_tools.transforms.masking import RandomMaskingStrategy >>> gen = CodonFMGenerator(CodonFMGeneratorConfig(masking_strategy=RandomMaskingStrategy(num_mutations=3))) >>> segment = Segment(sequence="ATGGTGAGCAAGGGC", sequence_type="dna") # 5 codons >>> gen.assign(segment) >>> gen.sample() # resamples 3 randomly masked codons ``` ## Metadata | Property | Value | | - | - | | Key | `codonfm` | | Class | `CodonFMGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `dna`, `rna` | | Allows Empty Start | `False` | # ESM2 Protein Language Model Source: https://proto.evodesign.org/docs/language/generators/esm2 ESM-2 masked protein language model for local sequence mutation/refinement ![ESM2 Protein Language Model](https://proto-bio.github.io/proto-assets/images/generator/esm2/hero.png) > [!NOTE] > > **License:** ESM2 is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/facebookresearch/esm/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/esm2/social.png) Go to Tool Page [Open](/docs/tools/masked-models/esm2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/esm2_generator.py#L164) @articlelin2023esm2 ```bibtex theme={null} @article{lin2023esm2, title={Evolutionary-scale prediction of atomic-level protein structure with a language model}, author={Lin, Zeming and Akin, Halil and Rao, Roshan and Hie, Brian and Zhu, Zhongkai and Lu, Wenting and Smetanin, Nikita and Verkuil, Robert and Kabeli, Ori and Shmueli, Yaniv and others}, journal={Science}, volume={379}, number={6637}, pages={1123--1130}, year={2023}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.ade2574} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Protein sequence mutation/refinement generator using ESM2 language model. This generator uses the ESM2 protein language model to refine existing protein sequences through iterative mutation. It masks positions according to the configured masking strategy and samples biologically plausible amino acids at those positions. The generator category is `"mutation"`, indicating it refines proposal sequences through targeted mutations. ## API Reference ConfigESM2GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/esm2_generator.py#L16) Configuration object for ESM2Generator. This class defines configuration parameters for the ESM2 generator, which uses a protein language model to refine existing protein sequences through iterative mutation of masked positions. In Proto Language, ESM2 is registered as a mutation-category generator that edits the supplied starting sequence; the segment must carry a sequence (directly or from a prior optimizer stage). **model\_checkpoint** `enum` (default: esm2\_t33\_650M\_UR50D) ESM-2 model variant to load (e.g. esm2\_t33\_650M\_UR50D). Options: `esm2_t6_8M_UR50D`, `esm2_t12_35M_UR50D`, `esm2_t30_150M_UR50D`, `esm2_t33_650M_UR50D`, `esm2_t36_3B_UR50D`, `esm2_t48_15B_UR50D` **masking\_strategy** `MaskingStrategy` Controls which positions to mask for sampling. Default: random 30%. **sampling\_method** `enum` (default: single\_pass) 'single\_pass' fills all masks in one forward; 'iterative\_refinement' runs a MaskGIT-style loop. Options: `single_pass`, `iterative_refinement` **temperature** `number` (default: 1.0) Sharpness of sampling. Below 1 sharpens toward the likely amino acid; above 1 increases diversity. **top\_p** `number` (default: 1.0) Nucleus sampling cumulative probability cutoff used in iterative refinement. 1.0 disables it. **num\_steps** `integer` (default: 20) Number of iterative-refinement rounds. Returns diminish above 20. **schedule** `enum` (default: cosine) Per-round unmask rate. 'cosine' commits more positions late; 'linear' commits the same each round. Options: `cosine`, `linear` **strategy** `enum` (default: random) How positions are picked each round. 'entropy' takes most-confident first; 'random' is uniform. Options: `random`, `entropy` **temperature\_annealing** `boolean` (default: True) Anneal temperature toward 0 across rounds **device** `string` (default: cuda) GPU device to run ESM2 on (e.g. 'cuda' or 'cuda:0'). **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import ESM2Generator, ESM2GeneratorConfig >>> from proto_language.core import Segment >>> from proto_tools.transforms.masking import MaskingStrategy >>> config = ESM2GeneratorConfig( ... temperature=1.0, ... masking_strategy=MaskingStrategy(num_mutations=5), ... ) >>> gen = ESM2Generator(config) >>> segment = Segment(sequence="M" * 100, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # Re-samples 5 randomly masked positions ``` ## Metadata | Property | Value | | - | - | | Key | `esm2` | | Class | `ESM2Generator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # ESM3 Protein Language Model Source: https://proto.evodesign.org/docs/language/generators/esm3 ESM-3 open masked protein language model for local sequence mutation/refinement ![ESM3 Protein Language Model](https://proto-bio.github.io/proto-assets/images/generator/esm3/hero.png) > [!NOTE] > > **License:** ESM3 is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/Biohub/esm/blob/main/LICENSE.md) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/esm3/social.png) Go to Tool Page [Open](/docs/tools/masked-models/esm3) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/esm3_generator.py#L165) @articlehayes2025esm3\@softwareevolutionaryscale\_2024 ```bibtex theme={null} @article{hayes2025esm3, title={Simulating 500 million years of evolution with a language model}, author={Hayes, Thomas and Rao, Roshan and Akin, Halil and Sofroniew, Nicholas J. and Oktay, Deniz and Lin, Zeming and Verkuil, Robert and Tran, Vincent Q. and Deaton, Jonathan and Wiggert, Marius and Badkundri, Rohil and Shafkat, Irhum and Gong, Jun and Derry, Alexander and Molina, Raul S. and Thomas, Neil and Khan, Yousuf A. and Mishra, Chetan and Kim, Carolyn and Bartie, Liam J. and Nemeth, Matthew and Hsu, Patrick D. and Sercu, Tom and Candido, Salvatore and Rives, Alexander}, journal={Science}, volume={387}, number={6736}, pages={850--858}, year={2025}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.ads0018} } @software{evolutionaryscale_2024, author={{EvolutionaryScale Team}}, title={evolutionaryscale/esm}, year={2024}, publisher={Zenodo}, doi={10.5281/zenodo.14219303}, url={https://doi.org/10.5281/zenodo.14219303} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Protein sequence mutation/refinement generator using ESM3 open language model. This generator uses the open-source ESM3 protein language model to refine existing protein sequences through iterative mutation. It masks positions according to the configured masking strategy and samples biologically plausible amino acids at those positions. The generator category is `"mutation"`, indicating it refines proposal sequences through targeted mutations. ## API Reference ConfigESM3GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/esm3_generator.py#L16) Configuration object for ESM3Generator. This class defines configuration parameters for the ESM3 generator, which uses the open-source ESM3 protein language model to refine existing protein sequences through iterative mutation of masked positions. In Proto Language, ESM3 is registered as a mutation-category generator that edits the supplied starting sequence; the segment must carry a sequence (directly or from a prior optimizer stage). > [!NOTE] > > ESM3 is the open-source version of EvolutionaryScale's protein language model. **model\_checkpoint** `string` (default: esm3\_sm\_open\_v1) ESM-3 model variant to load. **masking\_strategy** `MaskingStrategy` Controls which positions to mask for sampling. Default: random 30%. **sampling\_method** `enum` (default: single\_pass) 'single\_pass' fills all masks in one forward; 'iterative\_refinement' uses ESM-3 batch generation. Options: `single_pass`, `iterative_refinement` **temperature** `number` (default: 1.0) Scales the randomness of sampling by adjusting probability distribution sharpness. **top\_p** `number` (default: 1.0) Nucleus sampling threshold; 1.0 disables **num\_steps** `integer` (default: 20) Iterative-refinement decoding steps; diminishing returns above 20 **schedule** `enum` (default: cosine) Unmask schedule across rounds; 'cosine' fronts more commits late Options: `cosine`, `linear` **strategy** `enum` (default: random) Position-selection per round; 'entropy' commits the most-confident first Options: `random`, `entropy` **temperature\_annealing** `boolean` (default: True) Anneal temperature toward 0 across rounds **device** `string` (default: cuda) GPU device to run ESM3 on (e.g. 'cuda' or 'cuda:0'). **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import ESM3Generator, ESM3GeneratorConfig >>> from proto_language.core import Segment >>> from proto_tools.transforms.masking import MaskingStrategy >>> config = ESM3GeneratorConfig( ... temperature=1.0, ... masking_strategy=MaskingStrategy(num_mutations=5), ... ) >>> gen = ESM3Generator(config) >>> segment = Segment(sequence="M" * 100, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # Re-samples 5 randomly masked positions ``` ## Metadata | Property | Value | | - | - | | Key | `esm3` | | Class | `ESM3Generator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # Evo1 DNA Language Model Source: https://proto.evodesign.org/docs/language/generators/evo1 Evo1 genome language model for DNA sequence generation ![Evo1 DNA Language Model](https://proto-bio.github.io/proto-assets/images/generator/evo1/hero.png) > [!NOTE] > > **License:** Evo1 is open source and free for academic and commercial use under an Apache-2.0 license. Please refer to [the license](https://github.com/evo-design/evo/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/evo1/social.png) Go to Tool Page [Open](/docs/tools/causal-models/evo1) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/evo1_generator.py#L105) @articlenguyen2024evo ```bibtex theme={null} @article{nguyen2024evo, title={Sequence modeling and design from molecular to genome scale with Evo}, author={Nguyen, Eric and Poli, Michael and Durrant, Matthew G and Kang, Brian and Katrekar, Dhruva and Li, David B and Bartie, Liam J and Thomas, Armin W and King, Samuel H and Brixi, Garyk and Sullivan, Jeremy and Ng, Madelena Y and Lewis, Ashley and Lou, Aaron and Ermon, Stefano and Baccus, Stephen A and Hernandez-Boussard, Tina and R{\'e}, Christopher and Hsu, Patrick D and Hie, Brian L}, journal={Science}, volume={386}, number={6723}, pages={eado9336}, year={2024}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.ado9336} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Sequence generator using the Evo1 genomic language model. Supports multiple checkpoints including CRISPR and transposon fine-tuned variants. The number of tokens to generate is automatically calculated based on the assigned segment's sequence\_length. ## API Reference ConfigEvo1GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/evo1_generator.py#L18) Configuration object for Evo1Generator. **prompts** `List[string]` *required* Prompt sequences for DNA generation (single prompt or multiple) **model\_checkpoint** `enum` (default: evo-1-8k-base) Evo1 model variant to load (e.g. evo-1-8k-base). Options: `evo-1.5-8k-base`, `evo-1-8k-base`, `evo-1-131k-base`, `evo-1-8k-crispr`, `evo-1-8k-transposon` **top\_k** `integer` (default: 4) At each step, restrict sampling to the k most probable tokens. **temperature** `number` (default: 1.0) Sharpness of the sampling distribution. Below 1 sharpens; above 1 increases diversity. Must be > 0. **prepend\_prompt** `boolean` (default: False) Whether to prepend prompt to generation **device** `string` (default: cuda) GPU device to run Evo1 on (e.g. 'cuda' or 'cuda:0'). **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU **verbose** `boolean` (default: False) Whether to print verbose output ## Usage ```python python icon="python" theme={null} >>> config = Evo1GeneratorConfig( ... prompts="ATG", ... model_checkpoint="evo-1-8k-crispr", ... temperature=1.0, ... ) >>> gen = Evo1Generator(config) >>> segment = Segment(length=1003, sequence_type="dna") >>> gen.assign(segment) # prepend_prompt defaults to False, so max_new_tokens = 1003 >>> gen.sample() ``` ## Metadata | Property | Value | | - | - | | Key | `evo1` | | Class | `Evo1Generator` | | Category | `autoregressive` | | Input Type | `prompt` | | Uses GPU | `True` | | Supported Sequence Types | `dna` | | Allows Empty Start | `False` | # Evo2 DNA Language Model Source: https://proto.evodesign.org/docs/language/generators/evo2 Evo2 genome language model for DNA sequence generation ![Evo2 DNA Language Model](https://proto-bio.github.io/proto-assets/images/generator/evo2/hero.png) > [!NOTE] > > **License:** Evo2 is open source and free for academic and commercial use under an Apache-2.0 license. Please refer to [the license](https://github.com/arcinstitute/evo2/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/evo2/social.png) Go to Tool Page [Open](/docs/tools/causal-models/evo2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/evo2_generator.py#L212) @articleBrixi2026-jn ```bibtex theme={null} @ARTICLE{Brixi2026-jn, title = "Genome modelling and design across all domains of life with Evo 2", author = "Brixi, Garyk and Durrant, Matthew G and Ku, Jerome and Naghipourfar, Mohsen and Poli, Michael and Sun, Gwanggyu and Brockman, Greg and Chang, Daniel and Fanton, Alison and Gonzalez, Gabriel A and King, Samuel H and Li, David B and Merchant, Aditi T and Nguyen, Eric and Ricci-Tam, Chiara and Romero, David W and Schmok, Jonathan C and Taghibakhshi, Ali and Vorontsov, Anton and Yang, Brandon and Deng, Myra and Gorton, Liv and Nguyen, Nam and Wang, Nicholas K and Pearce, Michael T and Simon, Elana and Adams, Etowah and Amador, Zachary J and Ashley, Euan A and Baccus, Stephen A and Dai, Haoyu and Dillmann, Steven and Ermon, Stefano and Guo, Daniel and Herschl, Michael H and Ilango, Rajesh and Janik, Ken and Lu, Amy X and Mehta, Reshma and Mofrad, Mohammad R K and Ng, Madelena Y and Pannu, Jaspreet and R{\'e}, Christopher and St John, John and Sullivan, Jeremy and Tey, Joseph and Viggiano, Ben and Zhu, Kevin and Zynda, Greg and Balsam, Daniel and Collison, Patrick and Costa, Anthony B and Hernandez-Boussard, Tina and Ho, Eric and Liu, Ming-Yu and McGrath, Thomas and Powell, Kimberly and Pinglay, Sudarshan and Burke, Dave P and Goodarzi, Hani and Hsu, Patrick D and Hie, Brian L", journal = "Nature", publisher = "Springer Science and Business Media LLC", pages = "1--13", doi = "10.1038/s41586-026-10176-5", month = mar, year = 2026, language = "en" } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Sequence generator using Evo2 genomic language model for DNA generation. This generator uses the Evo2 7B parameter model to autoregressively generate DNA sequences from prompt sequences. Supports advanced sampling strategies, KV caching for efficiency, and batch generation. The generator category is `"autoregressive"`, indicating sequences are generated token-by-token from left to right. The number of tokens to generate is automatically calculated based on the assigned segment's sequence\_length, prompt length, and prepend\_prompt setting. ## API Reference ConfigEvo2GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/evo2_generator.py#L20) Configuration object for Evo2Generator. This class defines configuration parameters for the Evo2 generator, which uses a 7B parameter genomic language model to generate DNA sequences autoregressively from prompt sequences. > [!NOTE] > > All prompts must have identical lengths for batched generation. For detailed > information on Evo2 parameters, see: [https://github.com/arcinstitute/evo2](https://github.com/arcinstitute/evo2) **prompts** `List[string]` *required* Prompt sequences for DNA sequence generation (single prompt or multiple) **model\_checkpoint** `enum` (default: evo2\_7b) Evo2 model variant to load (currently only evo2\_7b). Options: `evo2_7b`, `evo2_20b`, `evo2_40b`, `evo2_7b_base`, `evo2_40b_base`, `evo2_1b_base`, `evo2_7b_262k`, `evo2_7b_microviridae` **local\_path** `string` Path to local checkpoint weights for custom or finetuned models **device** `string` (default: cuda) GPU device to run Evo2 on (e.g. 'cuda' or 'cuda:0'). **top\_k** `integer` (default: 4) Limits sampling to the top-k most probable tokens at each generation step. **top\_p** `number` (default: 1) Nucleus sampling cutoff. Restricts to the smallest token set with cumulative prob ≥ top-p. **temperature** `number` (default: 1.0) Sharpness of sampling. Below 1 favors high-probability tokens; above 1 increases diversity. **force\_prompt\_threshold** `integer` Optional number of tokens to prefill in parallel before switching to prompt forcing. **max\_seqlen** `integer` Optional maximum sequence length to generate. Determines the max size of the cache if larger. **stop\_at\_eos** `boolean` (default: True) Whether to stop at end-of-sequence token **batched** `boolean` (default: True) Generate all prompts together in a single batched forward pass. Required for multiple prompts. **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU **cached\_generation** `boolean` (default: True) Whether to reuse KV-cache state across decoding steps to avoid recomputation. **store\_kv\_cache** `boolean` (default: False) Retain and expose the per-sequence KV-cache after generation so downstream callers can continue. **prepend\_prompt** `boolean` (default: False) Whether to prepend prompt to generation **verbose** `boolean` (default: False) Whether to print verbose output ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import Evo2Generator, Evo2GeneratorConfig >>> from proto_language.core import Segment, SequenceType >>> config = Evo2GeneratorConfig(prompts="ATG", temperature=0.8) >>> gen = Evo2Generator(config) >>> # Segment length determines how many tokens to generate >>> segment = Segment(length=1003, sequence_type="dna") >>> gen.assign(segment) # prepend_prompt defaults to False, so max_new_tokens = 1003 >>> gen.sample() # Generates DNA sequences ``` ## Metadata | Property | Value | | - | - | | Key | `evo2` | | Class | `Evo2Generator` | | Category | `autoregressive` | | Input Type | `prompt` | | Uses GPU | `True` | | Supported Sequence Types | `dna` | | Allows Empty Start | `False` | # FAMPNN Inverse Folding Source: https://proto.evodesign.org/docs/language/generators/fampnn FAMPNN structure-conditioned protein sequence design with full-atom sidechain co-generation. ![FAMPNN Inverse Folding](https://proto-bio.github.io/proto-assets/images/generator/fampnn/hero.png) > [!NOTE] > > **License:** FAMPNN is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/richardshuai/fampnn/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/fampnn/social.png) Go to Tool Page [Open](/docs/tools/inverse-folding/fampnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/fampnn_generator.py#L149) @inproceedingswidatalla2025fampnn ```bibtex theme={null} @inproceedings{widatalla2025fampnn, title={Sidechain conditioning and modeling for full-atom protein sequence design with {FAMPNN}}, author={Widatalla, Talal and Shuai, Richard W. and Hie, Brian L. and Huang, Po-Ssu}, booktitle={Proceedings of the 42nd International Conference on Machine Learning}, year={2025}, series={PMLR}, volume={267}, address={Vancouver, Canada} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie) Protein sequence generator using FAMPNN. ## API Reference ConfigFAMPNNGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/fampnn_generator.py#L22) Configuration for FAMPNN inverse-folding generation. FAMPNN jointly designs amino-acid identities and sidechain conformations conditioned on an input backbone. The generator writes the designed protein sequence to the assigned segment and attaches FAMPNN's full-atom output structure to `proposal.structure`. **structure\_inputs** `array` Structure(s) with optional chain, fixed-position, and fixed-sidechain selections. **output\_chain\_id** `string` When sampling a multi-chain structure, write only this chain's sequence to the target segment. **model\_variant** `string` (default: 0.3) FAMPNN checkpoint variant for sequence design. **temperature** `number` (default: 0.1) Sampling temperature; lower is greedier and higher is more diverse. **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU. **num\_steps** `integer` (default: 100) Number of iterative unmasking steps for sequence design. **seq\_only** `boolean` (default: False) If true, skip sidechain generation during sampling. **repack\_last** `boolean` (default: True) Repack sidechains after the final sequence is determined. **psce\_threshold** `number` (default: 0.3) Only condition on sidechains below this predicted-error threshold during design. **scn\_diffusion\_steps** `integer` (default: 50) Number of sidechain diffusion denoising steps. **scn\_step\_scale** `number` (default: 1.5) Step scale for sidechain diffusion. **device** `string` (default: cuda) Device for model inference. **verbose** `boolean` (default: False) Whether to print FAMPNN progress logs. ## Usage ```python python icon="python" theme={null} from proto_language.generator import FAMPNNGenerator, FAMPNNGeneratorConfig from proto_language.core import Segment config = FAMPNNGeneratorConfig( # Configure parameters here ) generator = FAMPNNGenerator(config) segment = Segment(length=100, sequence_type="protein") generator.assign(segment) generator.sample() ``` ## Metadata | Property | Value | | - | - | | Key | `fampnn` | | Class | `FAMPNNGenerator` | | Category | `inverse_folding` | | Input Type | `structure` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # FreeBindCraft Binder Design Source: https://proto.evodesign.org/docs/language/generators/freebindcraft PyRosetta-free de novo protein binder design against a target (FreeBindCraft). ![FreeBindCraft Binder Design](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/hero.png) > [!NOTE] > > **License:** FreeBindCraft uses MIT for code and CC-BY-4.0 for model weights and may require explicit attribution when utilized. Please refer to the [code license](https://github.com/cytokineking/FreeBindCraft/blob/master/LICENSE) and [model weights license](https://github.com/google-deepmind/alphafold#model-parameters-license) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/freebindcraft/social.png) Go to Tool Page [Open](/docs/tools/binder-design/freebindcraft) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/freebindcraft_generator.py#L97) @articlepacesa2025bindcraft\@miscfreebindcraft2025 ```bibtex theme={null} @article{pacesa2025bindcraft, title={One-shot design of functional protein binders with BindCraft}, author={Pacesa, Martin and Nickel, Lennart and Schellhaas, Christian and Schmidt, Joseph and Pyatova, Ekaterina and Kissling, Lucas and Barendse, Patrick and Choudhury, Jagrity and Kapoor, Srajan and Alcaraz-Serna, Ana and Cho, Yehlin and Ghamary, Kourosh H. and Vinu{\'e}, Laura and Yachnin, Brahm J. and Wollacott, Andrew M. and Buckley, Stephen and Westphal, Adrie H. and Lindhoud, Simon and Georgeon, Sandrine and Goverde, Casper A. and Hatzopoulos, Georgios N. and G{\"o}nczy, Pierre and Muller, Yannick D. and Schwank, Gerald and Swarts, Daan C. and Vecchio, Alex J. and Schneider, Bernard L. and Ovchinnikov, Sergey and Correia, Bruno E.}, journal={Nature}, volume={646}, number={8084}, pages={483--492}, year={2025}, month={Aug}, publisher={Springer Science and Business Media LLC}, doi={10.1038/s41586-025-09429-6}, issn={1476-4687} } @misc{freebindcraft2025, title={FreeBindCraft: BindCraft with optional, PyRosetta-free scoring and relaxation}, author={{cytokineking} and {FreeBindCraft contributors}}, year={2025}, howpublished={\url{https://github.com/cytokineking/FreeBindCraft}}, note={MIT-licensed fork of BindCraft replacing PyRosetta with OpenMM, FreeSASA, and sc-rs} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) De novo protein binder generator using the PyRosetta-free FreeBindCraft pipeline. Hallucinates a binder against a frozen target with AlphaFold2, refines it with ProteinMPNN, re-validates with AlphaFold2, and scores the interface with OpenMM/FreeSASA/sc-rs. The assigned segment's length is the binder length, and its proposal count is the number of designs requested. Each accepted design's sequence, predicted complex, and metrics are written onto a proposal; if the pipeline returns fewer designs than requested, the proposal pool is truncated to what it produced, and an empty result raises. ## API Reference ConfigFreeBindCraftGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/freebindcraft_generator.py#L42) Configuration object for FreeBindCraftGenerator. Bundles the target specification with the full FreeBindCraft pipeline settings. The binder length and the number of designs are NOT set here — they are derived from the assigned segment (length = the segment's length; one design per proposal slot) at sample time. **target\_structure** `Structure | string` *required* Target to design a binder against (file path, PDB/CIF content, or Structure). **target\_chain** `string` (default: A) Chain ID(s) of the frozen target (comma-separated for multi-chain). **target\_hotspot\_residues** `string` Comma-separated 1-indexed target residues the binder must contact (e.g. '1-10,56'). **binder\_name** `string` (default: binder) Filename prefix recorded on each accepted design. **design\_config** `FreeBindCraftConfig` FreeBindCraft pipeline settings; the program seed overrides its seed field. ## Usage ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> from proto_language.generator import FreeBindCraftGenerator, FreeBindCraftGeneratorConfig >>> config = FreeBindCraftGeneratorConfig(target_structure="/path/to/target.pdb", target_chain="A") >>> gen = FreeBindCraftGenerator(config) >>> segment = Segment(length=80, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # writes one accepted binder design per proposal ``` ## Metadata | Property | Value | | - | - | | Key | `freebindcraft` | | Class | `FreeBindCraftGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `True` | # Gradient Source: https://proto.evodesign.org/docs/language/generators/gradient/overview Gradient generators optimize a differentiable representation of the sequence and pair with the gradient optimizer. Gradient generators optimize a differentiable representation of the sequence and pair with the gradient optimizer. [![](https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png)](/docs/language/generators/position-weight) # Inverse Folding Source: https://proto.evodesign.org/docs/language/generators/inverse_folding/overview Inverse-folding generators design a sequence for a fixed three-dimensional backbone. Inverse-folding generators design a sequence for a fixed three-dimensional backbone. [![](https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png)](/docs/language/generators/fampnn) [![](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png)](/docs/language/generators/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png)](/docs/language/generators/proteinmpnn) # LigandMPNN Inverse Folding Source: https://proto.evodesign.org/docs/language/generators/ligandmpnn LigandMPNN structure-conditioned protein sequence design with ligand awareness ![LigandMPNN Inverse Folding](https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/hero.png) > [!NOTE] > > **License:** LigandMPNN is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/dauparas/LigandMPNN/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png) Go to Tool Page [Open](/docs/tools/inverse-folding/ligandmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/ligandmpnn_generator.py#L245) @articleDauparas2025-eg ```bibtex theme={null} @ARTICLE{Dauparas2025-eg, title = "Atomic context-conditioned protein sequence design using {LigandMPNN}", author = "Dauparas, Justas and Lee, Gyu Rie and Pecoraro, Robert and An, Linna and Anishchenko, Ivan and Glasscock, Cameron and Baker, David", journal = "Nat. Methods", publisher = "Springer Science and Business Media LLC", volume = 22, number = 4, pages = "717--723", doi = "10.1038/s41592-025-02626-1", month = apr, year = 2025, language = "en" } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Protein sequence generator using LigandMPNN inverse folding model. This generator uses LigandMPNN to design protein sequences that are predicted to fold into a given 3D backbone structure while considering ligand context. Unlike ProteinMPNN, LigandMPNN is aware of non-protein atoms (ligands, cofactors, metal ions) in the structure. LigandMPNN is particularly effective for: * Designing enzymes with specific active site geometries * Optimizing binding pockets around ligands * Creating sequences for cofactor-dependent proteins * Redesigning protein-ligand interfaces ## API Reference ConfigLigandMPNNGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/ligandmpnn_generator.py#L25) Configuration object for LigandMPNNGenerator. This class defines configuration parameters for the LigandMPNN generator, which uses the LigandMPNN inverse folding model to design protein sequences conditioned on a given 3D backbone structure and ligand context. LigandMPNN extends ProteinMPNN to be aware of non-protein atoms (ligands, cofactors, metal ions), making it particularly effective for: * Enzyme active site design * Binding pocket optimization * Cofactor-dependent protein design **structure\_inputs** `array` Structure(s) with optional chains\_to\_redesign and fixed\_positions constraints. **model\_type** `enum` (default: ligand\_mpnn) LigandMPNN implementation: Foundry-backed ligand\_mpnn or original LigandMPNN. Options: `ligand_mpnn`, `original` **temperature** `number` (default: 0.1) Randomness of sampling (0-1). Near 0 is deterministic; near 1 is proportional to model probs. **excluded\_amino\_acids** `array` Single-letter amino-acid codes to forbid in the designed sequence. **use\_side\_chain\_context** `boolean` (default: False) Whether LigandMPNN conditions on fixed-residue sidechain atoms. **cutoff\_for\_score** `number` (default: 8.0) Ligand-residue distance cutoff (Å) used by LigandMPNN. **checkpoint\_path** `string` Optional explicit LigandMPNN checkpoint path. **tool\_seed** `integer` Optional seed passed directly to the LigandMPNN tool; None uses Proto's derived seed stream. **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU **device** `string` (default: cuda) GPU device for inference (e.g. 'cuda' or 'cuda:0'). **verbose** `boolean` (default: False) Whether to print status messages during execution. ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import LigandMPNNGenerator, LigandMPNNGeneratorConfig >>> from proto_language.core import Segment >>> config = LigandMPNNGeneratorConfig( ... structure_inputs="/path/to/enzyme_with_ligand.pdb", ... temperature=0.1, ... ) >>> gen = LigandMPNNGenerator(config) >>> segment = Segment(length=100, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # Generates num_proposals sequences from the backbone ``` ## Metadata | Property | Value | | - | - | | Key | `ligandmpnn` | | Class | `LigandMPNNGenerator` | | Category | `inverse_folding` | | Input Type | `structure` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # MPNN Structure-Conditioned Mutation Source: https://proto.evodesign.org/docs/language/generators/mpnn-mutation LigandMPNN/ProteinMPNN-guided mutation of an existing protein sequence ![MPNN Structure-Conditioned Mutation](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/hero.png) > [!NOTE] > > **License:** This generator can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png)](/docs/tools/inverse-folding/ligandmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/social.png)](/docs/tools/inverse-folding/proteinmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/mpnn_mutation_generator.py#L241) Generator contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Mutate protein sequences using MPNN structure-conditioned probabilities. ## API Reference ConfigMPNNMutationGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/mpnn_mutation_generator.py#L51) Configuration for structure-conditioned MPNN mutation. The generator scores the current sequence against a backbone, chooses mutable positions using the model's probability of the current residue, then replaces each chosen residue from the model's per-position amino-acid distribution. **model** `enum` (default: ligandmpnn) Structure-conditioned model used for mutation probabilities: ligandmpnn or proteinmpnn. Options: `ligandmpnn`, `proteinmpnn` **structure\_source** `enum` (default: configured\_structure\_inputs) Use configured structure\_inputs or each proposal's attached structure for MPNN scoring. Options: `configured_structure_inputs`, `proposal_structure` **structure\_inputs** `array` Structures for MPNN scoring; templates when structure\_source='proposal\_structure'. **output\_chain\_id** `string` Structure chain corresponding to the assigned sequence. Required for ambiguous multi-chain inputs. **num\_mutations** `integer` (default: 1) Number of positions to resample per sequence. **mutable\_positions** `ResidueSelection` Optional per-chain 1-indexed positions eligible for mutation. If unset, the output chain is mutable. **excluded\_amino\_acids** `array` Single-letter amino acids to forbid as replacement residues. **replacement\_strategy** `enum` (default: sample) 'sample' draws from MPNN probabilities; 'argmax' chooses the highest-probability residue. Options: `sample`, `argmax` **replacement\_temperature** `number` (default: 1.0) Temperature applied to MPNN logits before replacement sampling. **proteinmpnn\_model\_choice** `enum` (default: proteinmpnn) ProteinMPNN weights used when model='proteinmpnn'. Options: `proteinmpnn`, `v_48_002`, `v_48_010`, `v_48_030`, `abmpnn`, `soluble` **use\_side\_chain\_context** `boolean` (default: False) Whether LigandMPNN scoring conditions on fixed-residue sidechain atoms. **cutoff\_for\_score** `number` (default: 8.0) Ligand-residue distance cutoff (Å) used by LigandMPNN scoring. **ligand\_mpnn\_model\_type** `enum` (default: ligand\_mpnn) LigandMPNN implementation used for scoring: Foundry-backed ligand\_mpnn or original LigandMPNN. Options: `ligand_mpnn`, `original` **ligand\_mpnn\_checkpoint\_path** `string` Optional explicit LigandMPNN checkpoint path. **ligand\_mpnn\_tool\_seed** `integer` Optional seed passed directly to LigandMPNN scoring; None uses Proto's derived seed stream. **rng\_mode** `enum` (default: derived\_seed) Use Proto's per-proposal derived seed or NumPy's global RNG stream for mutation sampling. Options: `derived_seed`, `global` **rng\_seed** `integer` Optional seed applied once when rng\_mode='global'. **post\_mutation\_score\_mode** `enum` (default: disabled) Optional MPNN scoring mode used to refresh pmpnn after applying mutations. Options: `disabled`, `single_aa`, `autoregressive` **post\_mutation\_structure\_preparation** `StructurePreparationConfig` Optional structure preparation used to attach sequence-consistent structures after mutation. **device** `string` (default: cuda) Device for MPNN scoring. **verbose** `boolean` (default: False) Whether to print status messages during MPNN scoring. ## Usage ```python python icon="python" theme={null} from proto_language.generator import MPNNMutationGenerator, MPNNMutationGeneratorConfig from proto_language.core import Segment config = MPNNMutationGeneratorConfig( # Configure parameters here ) generator = MPNNMutationGenerator(config) segment = Segment(length=100, sequence_type="protein") generator.assign(segment) generator.sample() ``` ## Metadata | Property | Value | | - | - | | Key | `mpnn-mutation` | | Class | `MPNNMutationGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # MSA Generator Source: https://proto.evodesign.org/docs/language/generators/msa Sample mutations from MSA position-specific distributions ![MSA Generator](https://proto-bio.github.io/proto-assets/images/generator/msa/hero.png) This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/msa_generator.py#L80) Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Generator that samples mutations from MSA position-specific distributions. This generator computes empirical probability distributions for each position in a multiple sequence alignment, then mutates proposal sequences by sampling from these distributions. ## API Reference ConfigMSAGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/msa_generator.py#L15) Configuration object for MSAGenerator. This class defines configuration parameters for the MSA generator, which samples mutations from position-specific probability distributions derived from a multiple sequence alignment. **msa** `MSA` *required* Multiple sequence alignment (list of aligned sequences). **num\_mutations** `integer` (default: 1) Number of positions to mutate per sample **include\_gaps** `boolean` (default: False) Whether to include gaps when calculating position probabilities ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import MSAGenerator, MSAGeneratorConfig >>> from proto_language.core import Segment >>> from proto_tools.entities.msa import MSA >>> config = MSAGeneratorConfig( ... msa=MSA(aligned_sequences=["MVLS", "AVLS", "MVLS"]), ... num_mutations=1, ... ) >>> gen = MSAGenerator(config) >>> segment = Segment(sequence="MVLS", sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # Position 0 has 2/3 chance of M, 1/3 chance of A ``` ## Metadata | Property | Value | | - | - | | Key | `msa` | | Class | `MSAGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `False` | | Supported Sequence Types | All | | Allows Empty Start | `False` | # Mutation Source: https://proto.evodesign.org/docs/language/generators/mutation/overview Mutation generators introduce point changes to an existing sequence, suited to local search around a starting point. Mutation generators introduce point changes to an existing sequence, suited to local search around a starting point. [![](https://proto-bio.github.io/proto-assets/images/generator/codonfm/carousel.png)](/docs/language/generators/codonfm) [![](https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png)](/docs/language/generators/esm2) [![](https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png)](/docs/language/generators/esm3) [![](https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png)](/docs/language/generators/freebindcraft) [![](https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png)](/docs/language/generators/mpnn-mutation) [![](https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png)](/docs/language/generators/msa) [![](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png)](/docs/language/generators/random-nucleotide) [![](https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png)](/docs/language/generators/random-protein) [![](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png)](/docs/language/generators/rfdiffusion-mpnn-binder) [![](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png)](/docs/language/generators/semigreedy-mutation) # Position Weight Generator Source: https://proto.evodesign.org/docs/language/generators/position-weight Sample sequences from position-specific logit distributions ![Position Weight Generator](https://proto-bio.github.io/proto-assets/images/generator/position-weight/hero.png) This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/position_weight_generator.py#L89) Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Convert logit distributions into discrete proposal sequences. Reads `seq.logits` from each proposal sequence, applies softmax, and writes the decoded string back to `seq.sequence`. Supports deterministic argmax decoding or stochastic categorical sampling. Designed for gradient-based optimizers that update `seq.logits` directly and need discrete sequences for handoff or tracking. ## API Reference ConfigPositionWeightGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/position_weight_generator.py#L16) Configuration for position-specific sequence sampling. This generator is intended for optimizers that own position-specific sequence distributions and need to materialize discrete proposal sequences for the rest of the framework. **sampling\_mode** `enum` (default: argmax) How to convert position-specific distributions into discrete proposals. Options: `argmax`, `categorical` **temperature** `number` (default: 1.0) Softmax temperature on logits before decoding. Below 1 sharpens; above 1 flattens. Must be > 0. **sequence\_bias** `SequenceLogitBiasConfig` Optional declarative sequence-symbol bias applied before decoding. **logit\_scale** `number` (default: 1.0) Optional scale factor applied to logits before adding sequence\_bias and decoding. **peak\_probability\_positions** `array` Position indices used in the mean per-position peak-probability metric; None averages over all. ## Usage ```python python icon="python" theme={null} >>> segment = Segment(sequence="ACGT", sequence_type="dna") >>> gen = PositionWeightGenerator(PositionWeightGeneratorConfig(sampling_mode="argmax")) >>> gen.assign(segment) >>> segment.proposal_sequences[0].logits = np.array([[5, 0, 0, 0], [0, 4, 0, 0], [0, 0, 3, 0], [0, 0, 0, 2]]) >>> gen.sample() >>> segment.proposal_sequences[0].sequence 'ACGT' ``` ## Metadata | Property | Value | | - | - | | Key | `position-weight` | | Class | `PositionWeightGenerator` | | Category | `gradient` | | Input Type | `logits` | | Uses GPU | `False` | | Supported Sequence Types | `dna`, `rna`, `protein` | | Allows Empty Start | `False` | # ProGen2 Protein Language Model Source: https://proto.evodesign.org/docs/language/generators/progen2 ProGen2 autoregressive protein language model for protein sequence generation ![ProGen2 Protein Language Model](https://proto-bio.github.io/proto-assets/images/generator/progen2/hero.png) > [!NOTE] > > **License:** ProGen2 is open source and free for academic and commercial use under a BSD-3-Clause license. Please refer to [the license](https://github.com/enijkamp/progen2/blob/main/LICENSE.txt) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/progen2/social.png) Go to Tool Page [Open](/docs/tools/causal-models/progen2) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/progen2_generator.py#L190) @articlenijkamp2023progen2 ```bibtex theme={null} @article{nijkamp2023progen2, title={ProGen2: Exploring the boundaries of protein language models}, author={Nijkamp, Erik and Ruffolo, Jeffrey A and Weinstein, Eli N and Naik, Nikhil and Madani, Ali}, journal={Cell Systems}, volume={14}, number={11}, pages={968--978}, year={2023}, publisher={Elsevier}, doi={10.1016/j.cels.2023.10.002} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Protein sequence generator using ProGen2 autoregressive language model. ## API Reference ConfigProGen2GeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/progen2_generator.py#L20) Configuration object for ProGen2Generator. This class defines configuration parameters for the ProGen2 generator, which uses the ProGen2 protein language model to autoregressively generate protein sequences from prompt sequences. Models are loaded from HuggingFace: [https://huggingface.co/hugohrban/](https://huggingface.co/hugohrban/) > [!NOTE] > > For detailed information on ProGen2, see: > > * HuggingFace: [https://huggingface.co/hugohrban/](https://huggingface.co/hugohrban/) > * GitHub: [https://github.com/hugohrban/ProGen2-finetuning](https://github.com/hugohrban/ProGen2-finetuning) > * Original GitHub: [https://github.com/enijkamp/progen2](https://github.com/enijkamp/progen2) > * Original paper: [https://www.cell.com/cell-systems/fulltext/S2405-4712(23)00272-7](https://www.cell.com/cell-systems/fulltext/S2405-4712\(23\)00272-7) **prompts** `List[string]` *required* Prompt sequences for protein sequence generation **model\_checkpoint** `enum` (default: progen2-large) ProGen2 model variant to load (e.g. progen2-large). Options: `progen2-small`, `progen2-medium`, `progen2-base`, `progen2-oas`, `progen2-large`, `progen2-BFD90`, `progen2-xlarge` **local\_path** `string` Path to local model weights **device** `string` (default: cuda) GPU device to run ProGen2 on (e.g. 'cuda' or 'cuda:0'). **temperature** `number` (default: 0.2) Sharpness of sampling. Below 1 favors high-probability tokens; above 1 increases diversity. **top\_p** `number` (default: 0.95) Nucleus sampling cumulative probability cutoff. 1.0 disables nucleus sampling. **top\_k** `integer` (default: 0) At each step, restrict sampling to the k most probable tokens. Set to 0 to disable top-k truncation. **truncate\_at\_stop** `boolean` (default: True) Whether to truncate sequences at stop tokens **strip\_special\_tokens** `boolean` (default: True) Whether to strip start and stop tokens from final output **prepend\_prompt** `boolean` (default: True) Whether to prepend prompt to generation **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU **verbose** `boolean` (default: False) Whether to print verbose output ## Usage ```python python icon="python" theme={null} from proto_language.generator import ProGen2Generator, ProGen2GeneratorConfig from proto_language.core import Segment config = ProGen2GeneratorConfig( # Configure parameters here ) generator = ProGen2Generator(config) segment = Segment(length=100, sequence_type="protein") generator.assign(segment) generator.sample() ``` ## Metadata | Property | Value | | - | - | | Key | `progen2` | | Class | `ProGen2Generator` | | Category | `autoregressive` | | Input Type | `prompt` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # ProteinMPNN Inverse Folding Source: https://proto.evodesign.org/docs/language/generators/proteinmpnn ProteinMPNN structure-conditioned protein sequence design ![ProteinMPNN Inverse Folding](https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/hero.png) > [!NOTE] > > **License:** ProteinMPNN is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/dauparas/ProteinMPNN/blob/main/LICENSE) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source Cite Cite ![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/social.png) Go to Tool Page [Open](/docs/tools/inverse-folding/proteinmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/proteinmpnn_generator.py#L217) @articledauparas2022proteinmpnn ```bibtex theme={null} @article{dauparas2022proteinmpnn, title={Robust deep learning--based protein sequence design using ProteinMPNN}, author={Dauparas, Justas and Anishchenko, Ivan and Bennett, Nathaniel and Bai, Hua and Ragotte, Robert J and Milles, Lukas F and Wicky, Basile IM and Courber, Alexis and de Haas, Rob J and Bethel, Neville and others}, journal={Science}, volume={378}, number={6615}, pages={49--56}, year={2022}, publisher={American Association for the Advancement of Science}, doi={10.1126/science.add2187} } ``` Copy citation Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano) Protein sequence generator using ProteinMPNN inverse folding model. This generator uses ProteinMPNN to design protein sequences that are predicted to fold into a given 3D backbone structure. Unlike mutation-based generators that refine existing sequences, ProteinMPNN generates sequences directly from structural information. ProteinMPNN is particularly effective for: * Redesigning existing proteins while maintaining fold * Designing sequences for computationally generated backbones * Creating sequence diversity for experimental screening * Stabilizing protein structures through sequence optimization ## API Reference ConfigProteinMPNNGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/proteinmpnn_generator.py#L20) Configuration object for ProteinMPNNGenerator. This class defines configuration parameters for the ProteinMPNN generator, which uses the ProteinMPNN inverse folding model to design protein sequences conditioned on a given 3D backbone structure. ProteinMPNN is a message-passing neural network that predicts amino acid sequences likely to fold into a specified protein backbone structure. It excels at redesigning existing proteins while maintaining structural compatibility. **model\_choice** `enum` (default: proteinmpnn) ProteinMPNN weights: 'proteinmpnn' (general), 'abmpnn' (antibody), or 'soluble' (soluble proteins). Options: `proteinmpnn`, `abmpnn`, `soluble` **structure\_inputs** `array` Structure(s) with optional chains\_to\_redesign and fixed\_positions constraints. **output\_chain\_id** `string` When sampling a multi-chain structure, write only this chain's sequence to the target segment. **temperature** `number` (default: 0.1) Randomness of sampling (0-1). Near 0 is deterministic; near 1 is proportional to model probs. **excluded\_amino\_acids** `array` Single-letter amino-acid codes to forbid in the designed sequence (e.g. 'C' to avoid disulfides). **batch\_size** `integer` (default: 1) Number of sequences to process simultaneously on GPU **device** `string` (default: cuda) GPU device for inference (e.g. 'cuda' or 'cuda:0'). **verbose** `boolean` (default: False) Whether to print status messages during execution. ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import ProteinMPNNGenerator, ProteinMPNNGeneratorConfig >>> from proto_language.core import Segment >>> config = ProteinMPNNGeneratorConfig( ... structure_inputs="/path/to/backbone.pdb", ... temperature=0.1, ... ) >>> gen = ProteinMPNNGenerator(config) >>> segment = Segment(length=100, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # Generates num_proposals sequences from the backbone ``` ## Metadata | Property | Value | | - | - | | Key | `proteinmpnn` | | Class | `ProteinMPNNGenerator` | | Category | `inverse_folding` | | Input Type | `structure` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # Random Nucleotide Mutation Source: https://proto.evodesign.org/docs/language/generators/random-nucleotide Random nucleotide mutations using IUPAC substitution schemes ![Random Nucleotide Mutation](https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/hero.png) > [!NOTE] > > **License:** Random Nucleotide Sampling is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/evo-design/proto-tools) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source ![](https://proto-bio.github.io/proto-assets/images/tool/random_nucleotide/social.png) Go to Tool Page [Open](/docs/tools/mutagenesis/random-nucleotide) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/random_nucleotide_generator.py#L76) Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Nucleotide sequence generator that introduces random mutations. This generator creates sequence diversity by randomly mutating masked positions in DNA or RNA sequences. Nucleotide selection is controlled by the IUPAC substitution scheme, allowing targeted mutation strategies (e.g., transitions only with `"R"`/`"Y"`, or any base with `"N"`). The generator category is `"mutation"`. When the assigned segment has a starting sequence (or an upstream optimizer stage has populated proposals), `masking_strategy` controls which positions are mutated on each call. When the segment has no starting sequence, the first `sample()` call fills each proposal with a fully random sequence of the segment's length using the configured `substitution_scheme`; subsequent calls then apply `masking_strategy` normally. ## API Reference ConfigRandomNucleotideGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/random_nucleotide_generator.py#L23) Configuration object for RandomNucleotideGenerator. This class defines configuration parameters for the random nucleotide generator, which introduces random nucleotide mutations at masked positions using IUPAC ambiguity code-based sampling. **masking\_strategy** `MaskingStrategy` Controls which positions to mask for sampling. Default: random 30%. **substitution\_scheme** `enum` (default: N) IUPAC code defining the nucleotide substitution pool. Options: `N`, `R`, `Y`, `S`, `W`, `K`, `M`, `B`, `D`, `H`, `V` ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import RandomNucleotideGenerator, RandomNucleotideGeneratorConfig >>> from proto_language.core import Segment >>> config = RandomNucleotideGeneratorConfig( ... masking_strategy=MaskingStrategy(num_mutations=2), ... ) >>> gen = RandomNucleotideGenerator(config) >>> segment = Segment(length=100, sequence_type="dna") >>> gen.assign(segment) >>> gen.sample() # First call: random init (no starting sequence) >>> gen.sample() # Second call onward: 2 random nucleotide mutations ``` ## Metadata | Property | Value | | - | - | | Key | `random-nucleotide` | | Class | `RandomNucleotideGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `False` | | Supported Sequence Types | `dna`, `rna` | | Allows Empty Start | `True` | # Random Protein Mutation Source: https://proto.evodesign.org/docs/language/generators/random-protein Random amino acid mutations using codon scheme-biased sampling ![Random Protein Mutation](https://proto-bio.github.io/proto-assets/images/generator/random-protein/hero.png) > [!NOTE] > > **License:** Random Protein Sampling is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/evo-design/proto-tools) for full terms. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source ![](https://proto-bio.github.io/proto-assets/images/tool/random_protein/social.png) Go to Tool Page [Open](/docs/tools/mutagenesis/random-protein) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/random_protein_generator.py#L108) Generator contributors[![](https://avatars.githubusercontent.com/u/6365340?v=4\&s=64)brianhie](https://github.com/brianhie)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Protein sequence generator that introduces random amino acid mutations. This generator creates sequence diversity by randomly mutating masked positions in protein sequences. Amino acid selection is biased by the configured codon scheme, allowing simulation of library diversity achievable through degenerate codon synthesis. Optional amino-acid exclusions remove unwanted residues from the sampled mutation alphabet. The generator category is `"mutation"`. When the assigned segment has a starting sequence (or an upstream optimizer stage has populated proposals), `masking_strategy` controls which positions are mutated on each call. When the segment has no starting sequence, the first `sample()` call fills each proposal with a fully random sequence of the segment's length using the configured `codon_scheme`; subsequent calls then apply `masking_strategy` normally. ## API Reference ConfigRandomProteinGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/random_protein_generator.py#L25) Configuration object for RandomProteinGenerator. This class defines configuration parameters for the random protein generator, which introduces random amino acid mutations at masked positions using codon scheme-biased sampling. **masking\_strategy** `MaskingStrategy` Controls which positions to mask for sampling. Default: random 30%. **codon\_scheme** `enum` (default: UNIFORM) Codon scheme for amino acid sampling probabilities. Options: `UNIFORM`, `NNN`, `NNK`, `NNS`, `NDT`, `DBK`, `NRT` **excluded\_amino\_acids** `array` Residues to remove after codon-scheme handling (e.g. \['C'] to forbid cysteine). ## Usage ```python python icon="python" theme={null} >>> from proto_language.generator import RandomProteinGenerator, RandomProteinGeneratorConfig >>> from proto_language.core import Segment >>> from proto_tools.transforms.masking import MaskingStrategy >>> config = RandomProteinGeneratorConfig( ... masking_strategy=MaskingStrategy(num_mutations=2), ... excluded_amino_acids=["C"], ... ) >>> gen = RandomProteinGenerator(config) >>> segment = Segment(length=100, sequence_type="protein") >>> gen.assign(segment) >>> gen.sample() # First call: random init (no starting sequence) >>> gen.sample() # Second call onward: 2 non-cysteine mutations ``` ## Metadata | Property | Value | | - | - | | Key | `random-protein` | | Class | `RandomProteinGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `False` | | Supported Sequence Types | `protein` | | Allows Empty Start | `True` | # RFdiffusion3 + MPNN Binder Design Source: https://proto.evodesign.org/docs/language/generators/rfdiffusion-mpnn-binder De novo binder design: RFdiffusion3 backbones + ProteinMPNN/LigandMPNN sequences ![RFdiffusion3 + MPNN Binder Design](https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/hero.png) > [!NOTE] > > **License:** This generator can use multiple tools, each under its own license. See the **Tools Used** tab and each tool's page for license details. This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Tools Used Tools Used Source Source [![](https://proto-bio.github.io/proto-assets/images/tool/rfdiffusion3/social.png)](/docs/tools/structure-design/rfdiffusion3) [![](https://proto-bio.github.io/proto-assets/images/tool/proteinmpnn/social.png)](/docs/tools/inverse-folding/proteinmpnn) [![](https://proto-bio.github.io/proto-assets/images/tool/ligandmpnn/social.png)](/docs/tools/inverse-folding/ligandmpnn) ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/rfdiffusion_mpnn_binder_generator.py#L185) Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) De-novo protein binder generator chaining RFdiffusion3 and an inverse-folding model. For each `sample()` call the generator diffuses binder backbones docked to a fixed target (RFdiffusion3), then designs each backbone's binder-chain sequence with the selected inverse-folding model (`proteinmpnn` or `ligandmpnn`) while keeping the target chains fixed as structural context. With `ligandmpnn` the binder conditions on the target's ligand/nucleotide/metal atoms, so the target may be a protein, DNA, or RNA chain (with ligand/metal cofactors as context). The designed binder sequence is written to `proposal.sequence` and the RFdiffusion3 target+binder complex to `proposal.structure` (its binder chain carries RFdiffusion3's co-designed sequence, so downstream structure-prediction constraints should re-fold `proposal.sequence`). The binder length is the assigned segment's length. The generator fills a length-only segment, so its category is `"mutation"` despite being a de-novo designer (same convention as `RandomProteinGenerator`). ## API Reference ConfigRFdiffusionMPNNBinderGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/rfdiffusion_mpnn_binder_generator.py#L68) Configuration object for RFdiffusionMPNNBinderGenerator. Top-level fields describe *what* binder to design (the target, its chains, the epitope hotspots, and which inverse-folding model designs the sequence); the per-tool knobs live in nested `rfdiffusion3_config` and an inverse-folding config (`proteinmpnn_config` or `ligandmpnn_config`), matching how constraints nest tool configs (e.g. `esmfold_config`). Only the config matching `inverse_folding` is used; it defaults to its tool default when omitted. The binder length is taken from the assigned segment's length, not from this config. The generator injects the fields it owns at sample time and respects everything else: on `rfdiffusion3_config` it sets `n_batches` (to produce enough backbones for the proposal count) and `seed`; on the inverse-folding config it sets `seed` and reads `num_sequences_per_structure` as the number of sequences designed per backbone. **target\_structure** `Structure | string` *required* Target to bind (file path, PDB/CIF content, or Structure); may include DNA/RNA/ligand chains. **target\_chains** `List[string]` Target chain IDs kept fixed; the binder is emitted after these chains. **hotspots** `array` Target hotspot residues as '\\' (e.g. \['A37', 'A39']). **inverse\_folding** `enum` (default: proteinmpnn) Sequence-design model: 'proteinmpnn' (protein only) or 'ligandmpnn' (ligand/DNA/RNA/metal-aware). Options: `proteinmpnn`, `ligandmpnn` **rfdiffusion3\_config** `RFdiffusion3Config` Advanced RFdiffusion3 backbone-generation configuration. **proteinmpnn\_config** `ProteinMPNNSampleConfig` Advanced ProteinMPNN settings; used when inverse\_folding='proteinmpnn'. **ligandmpnn\_config** `LigandMPNNSampleConfig` Advanced LigandMPNN settings; used when inverse\_folding='ligandmpnn'. ## Usage Build a two-segment binder program: a length-only `binder` (designed) plus a fixed `target` segment derived from the same structure, so a scoring constraint can fold the complex via `inputs=[binder, target]`. The generator is assigned only to the binder; the target reaches it through config. See `examples/scripts/binder_design_rfdiffusion_mpnn.py` for the full program. ```python python icon="python" theme={null} >>> from proto_tools import Structure >>> from proto_language.core import Construct, Segment >>> from proto_language.generator import ( ... RFdiffusionMPNNBinderGenerator, ... RFdiffusionMPNNBinderGeneratorConfig, ... ) >>> target_structure = Structure.from_file("target.pdb") >>> target_seq = target_structure.get_chain_sequence("A", remove_non_standard=True) >>> binder = Segment(length=80, sequence_type="protein", label="binder") >>> target = Segment(sequence=target_seq, sequence_type="protein", label="target") >>> construct = Construct([binder, target]) # target is fixed: no generator >>> gen = RFdiffusionMPNNBinderGenerator( ... RFdiffusionMPNNBinderGeneratorConfig( ... target_structure=target_structure, target_chains=["A"], hotspots=["A37"] ... ) ... ) >>> gen.assign(binder) # generator touches only the binder >>> gen.sample() # fills num_proposals binders; a constraint scores [binder, target] ``` ## Metadata | Property | Value | | - | - | | Key | `rfdiffusion-mpnn-binder` | | Class | `RFdiffusionMPNNBinderGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `True` | | Supported Sequence Types | `protein` | | Allows Empty Start | `True` | # Semigreedy Mutation Generator Source: https://proto.evodesign.org/docs/language/generators/semigreedy-mutation Logit-guided single-point mutations for semigreedy discrete refinement ![Semigreedy Mutation Generator](https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/hero.png) This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them. *** Source ![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678) evo-design/proto-language View source [Open](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/semigreedy_mutation_generator.py#L119) Generator contributors[![](https://avatars.githubusercontent.com/u/46211285?v=4\&s=64)dguo8412](https://github.com/dguo8412) Introduce single-point mutations guided by a PSSM derived from `seq.logits`. Each call to `sample()` selects one position per proposal sequence and replaces the amino acid there by sampling from the softmax distribution over logits (with the current residue optionally excluded). Position selection is controlled by `position_weighting`: * `"uniform"`: every position is equally likely. * `"entropy"`: positions with higher Shannon entropy in the PSSM are more likely, targeting the most uncertain residues. * `"plddt"`: positions are weighted by `(1 - pLDDT)` read from the canonical `proposal.structure.per_residue_plddt` property when a `Structure` with pLDDT B-factors is present, so structurally uncertain residues are mutated more frequently; otherwise it falls back to uniform. `frozen_positions` hard-excludes listed indices from selection (deterministic counterpart to `sequence_bias`); whatever residue is there stays. Implements Germinal's `design_semigreedy` phase (`MCMCOptimizer` at near-zero temperature, `proposals_per_result > 1`). > [!NOTE] > > `clear_logits=False` (default) requires upstream `GradientOptimizer` logits at > runtime; `clear_logits=True` runs as pure sequence-only mutation. ## API Reference ConfigSemigreedyMutationGeneratorConfig[ Source](https://github.com/evo-design/proto-language/blob/0824a53b9c4ed4c3ed45d82d06d250a40b1c9e7a/proto_language/generator/semigreedy_mutation_generator.py#L22) Configuration for semigreedy single-point mutation sampling. Converts `seq.logits` (from a preceding gradient-based optimizer) to a PSSM via softmax and samples single-point mutations from it. Stage 2 of the Germinal pipeline: paired with `MCMCOptimizer` at near-zero temperature for greedy/semigreedy discrete refinement. **position\_weighting** `enum` (default: uniform) 'uniform' picks at random; 'entropy' picks high-entropy positions; 'plddt' picks low-pLDDT. Options: `uniform`, `entropy`, `plddt` **temperature** `number` (default: 1.0) Softmax temperature on logits when building the PSSM. Below 1 sharpens; above 1 flattens (> 0). **exclude\_current** `boolean` (default: True) Zero out the current amino acid before sampling to guarantee a mutation. **sequence\_bias** `SequenceLogitBiasConfig` Optional declarative sequence-symbol bias applied before AA sampling. **clear\_logits** `boolean` (default: False) When True, ignore proposal logits and sample replacement from sequence\_bias (or uniform if unset). **frozen\_positions** `array` Position indices to keep untouched during mutation (Python-style zero-based). ## Usage ```python python icon="python" theme={null} >>> from proto_language.core import Segment >>> segment = Segment(sequence="ACDEF", sequence_type="protein") >>> gen = SemigreedyMutationGenerator(SemigreedyMutationGeneratorConfig(position_weighting="entropy")) >>> gen.assign(segment) >>> # Normally logits come from a GradientOptimizer; here we set them manually: >>> import numpy as np >>> segment.proposal_sequences[0].logits = np.random.randn(5, 20) >>> gen.sample() >>> # Exactly one position differs from "ACDEF" ``` ## Metadata | Property | Value | | - | - | | Key | `semigreedy-mutation` | | Class | `SemigreedyMutationGenerator` | | Category | `mutation` | | Input Type | `starting_sequence` | | Uses GPU | `False` | | Supported Sequence Types | `protein` | | Allows Empty Start | `False` | # Binder Design Source: https://proto.evodesign.org/docs/language/guides/examples/binder-design Design a protein binder against a fixed target with the RFdiffusion3 + ProteinMPNN generator and an ipTM interface constraint This program designs a protein binder against a fixed target. It uses the idiomatic two-segment pattern: a length-only `binder` segment that is designed, and a fixed `target` segment whose sequence is taken from the target structure. The `rfdiffusion-mpnn-binder` generator docks and designs a binder against the target coordinates, and a structure-confidence constraint folds the full target+binder complex to score the interface. A `RejectionSamplingOptimizer` keeps the best binders. The full script designs an 80-residue binder against PD-L1 and generates many candidates. This walkthrough uses a short binder, a small target, and two candidates. It requires a GPU and the RFdiffusion3, ProteinMPNN, and Boltz2 weights. [Open as a runnable notebook](https://github.com/evo-design/proto-language/blob/main/examples/notebooks/binder-design.ipynb) [View as a Python script](https://github.com/evo-design/proto-language/blob/main/examples/scripts/binder_design_rfdiffusion_mpnn.py) > [!NOTE] > > **Runtime:** this walkthrough runs real models on a GPU and takes several minutes to complete. The first run is slower because it builds the tool environment and downloads model weights. ## The target One source, the target `Structure`, yields two artifacts: coordinates for the generator to dock against, and a chain sequence for the fixed target segment. `get_chain_sequence(TARGET_CHAIN, remove_non_standard=True)` reads chain A's amino-acid sequence out of the PDB, dropping non-standard residues. The construct then holds two segments: `binder` is length-only (`length=BINDER_LENGTH`, `sequence_type="protein"`), so its positions are open for design, while `target` is fixed by passing its `sequence` directly. Giving `target` no generator is what keeps it constant while the binder is optimized. ```python python icon="python" theme={null} from pathlib import Path from proto_tools.entities.structures import Structure from proto_language.core import Segment, Construct TARGET_PDB = Path.cwd().parent / "germinal" / "pdbs" / "insulin.pdb" TARGET_CHAIN = "A" BINDER_LENGTH = 40 target_structure = Structure(structure=TARGET_PDB.read_text()) target_sequence = target_structure.get_chain_sequence(TARGET_CHAIN, remove_non_standard=True) binder = Segment(length=BINDER_LENGTH, sequence_type="protein", label="binder") target = Segment(sequence=target_sequence, sequence_type="protein", label="target") construct = Construct([binder, target]) ``` ## The binder generator The `rfdiffusion-mpnn-binder` generator is assigned only to the binder segment; the target reaches it as coordinates through the config. On each `sample()` call it diffuses binder backbones docked to the target with RFdiffusion3, then designs each backbone's binder-chain sequence with ProteinMPNN while holding the target chains fixed as context; the binder length is taken from the assigned segment. `target_structure` and `target_chains=[TARGET_CHAIN]` tell RFdiffusion3 which coordinates to keep fixed and dock against. The per-tool settings live in nested configs: `RFdiffusion3Config(device="cuda")` and `ProteinMPNNSampleConfig(num_sequences_per_structure=1, device="cuda")`, where `num_sequences_per_structure` is the number of sequences designed per backbone. ```python python icon="python" theme={null} from proto_tools import ProteinMPNNSampleConfig, RFdiffusion3Config from proto_language.generator import ( RFdiffusionMPNNBinderGenerator, RFdiffusionMPNNBinderGeneratorConfig, ) generator = RFdiffusionMPNNBinderGenerator( RFdiffusionMPNNBinderGeneratorConfig( target_structure=target_structure, target_chains=[TARGET_CHAIN], rfdiffusion3_config=RFdiffusion3Config(device="cuda"), proteinmpnn_config=ProteinMPNNSampleConfig(num_sequences_per_structure=1, device="cuda"), ) ) generator.assign(binder) ``` ## The interface constraint and search A structure-confidence constraint folds the full target+binder complex with Boltz2 and scores the interface. `structure_iptm_constraint` reads the predicted interface TM-score (ipTM), which measures the quality of the inter-chain interface in a multimeric complex, and returns `1.0 - iptm` so lower scores indicate a better predicted interface. It lists both segments in `inputs=[binder, target]`, which is why the target is a sibling segment, and `weight=1.0` multiplies its raw score. The `RejectionSamplingOptimizer` draws independent batches of binders and keeps the best: `num_samples=2` candidates are generated and scored, and `num_results=1` retains the single lowest-energy result. `Program(..., seed=0)` makes the run reproducible: the same seed and inputs produce the same output. ```python python icon="python" theme={null} from proto_language import StructureBasedConstraintConfig, structure_iptm_constraint from proto_language.core import Constraint, Program from proto_language.optimizer import RejectionSamplingOptimizer, RejectionSamplingOptimizerConfig iptm = Constraint( inputs=[binder, target], function=structure_iptm_constraint, function_config=StructureBasedConstraintConfig(structure_tool="boltz2"), label="iptm", weight=1.0, ) optimizer = RejectionSamplingOptimizer( constructs=[construct], generators=[generator], constraints=[iptm], config=RejectionSamplingOptimizerConfig(num_samples=2, num_results=1), ) program = Program(optimizers=[optimizer], num_results=1, seed=0) program.run() ``` ## Inspect the result The kept binders are read back from `binder.result_sequences`, ordered best first by lowest energy. The generator writes each designed binder sequence onto its proposal, so `best.sequence` is the amino-acid sequence of the top-ranked binder; the folded target+binder complex is also stored on the result for downstream use. ```python python icon="python" theme={null} best = binder.result_sequences[0] print(f"designed binder: {best.sequence}") ``` ```text theme={null} designed binder: AIDPAQAAAAAAEAEATRAALPTAADPAAAQAHIAYVEAN ``` ## Next Steps > **[Protein Hunter](/docs/language/guides/examples/protein-hunter)** > > Structure-based design by cycling. > **[Using Generators](/docs/language/guides/using-generators)** > > The inverse-folding and binder generators. # Cas9 Generation Source: https://proto.evodesign.org/docs/language/guides/examples/cas9-rejection-sampling Cas9 generation pipeline using a single Rejection Sampling optimizer with filter constraints. This program searches for novel Cas9-like CRISPR loci. An autoregressive genome model (Evo1, trained on CRISPR loci) proposes candidate DNA, and a `RejectionSamplingOptimizer` runs each candidate through an ordered cascade of eight filters arranged cheap-to-expensive: 1. `orf_filter`: the locus must contain a long open reading frame 2. `cas9_phmm_filter`: the translated protein matches a Cas9 profile HMM (PyHMMER) 3. `crispr_array_filter`: a CRISPR repeat array is present (MinCED) 4. `identity_filter`: the protein is not too close to known Cas9s (MMseqs2) 5. `gap_gini_filter`: the alignment gap pattern is well distributed (MMseqs2) 6. `domain_filter`: the RuvC and HNH catalytic domains are present (PyHMMER) 7. `tracr_filter`: a compatible tracrRNA can be folded (CRISPR-tracrRNA) 8. `structure_filter`: the protein folds to a confident, compact structure (AlphaFold3) Because every constraint carries a threshold, the optimizer treats them as ordered filters: a candidate that fails one filter is never evaluated by the later, more expensive ones. The costly AlphaFold3 fold therefore runs only on candidates that already look like complete Cas9 loci. The full script draws thousands of samples to find the rare survivors that reach the structure filter. This walkthrough imports the program builder and draws a small batch, so it runs on a single GPU in a few minutes; most candidates are rejected by the early filters, which is exactly the behavior the cascade is designed for. [Open as a runnable notebook](https://github.com/evo-design/proto-language/blob/main/examples/notebooks/cas9-rejection-sampling.ipynb) [View as a Python script](https://github.com/evo-design/proto-language/blob/main/examples/scripts/evocas9_rejection_sampling.py) > [!NOTE] > > **Runtime:** this walkthrough runs real models on a GPU and takes several minutes to complete. The first run is slower because it builds the tool environment and downloads model weights. ## Building the program `build_program` assembles the Evo1 generator and the eight filter constraints into a single `RejectionSamplingOptimizer`. The generator is `Evo1Generator` running the `evo-1-8k-crispr` checkpoint; the arguments passed here scale the search down. `n_samples` is the number of candidate sequences drawn, `temperature` 0.5 controls the sharpness of the sampling distribution (below 1 sharpens it toward the most likely tokens), and `top_k_val=4` restricts sampling at each step to the four most probable tokens. `batch_size` sets how many sequences the generator produces per GPU batch, and `af3_output_dir` names the directory where the structure filter writes its AlphaFold3 outputs. Each of the eight constraints is given `threshold=0.5`: a constraint returns 0.0 for a candidate that passes and 1.0 for one that fails, so scores at or below the threshold are accepted and scores above it are rejected, which is what turns the constraints into ordered filters. ```python python icon="python" theme={null} import sys from pathlib import Path # The eight-filter cascade and its data paths are assembled by the example script's builder. sys.path.insert(0, str(Path.cwd().parents[1])) from examples.scripts.evocas9_rejection_sampling import build_program, collect_results N_SAMPLES = 8 program, locus = build_program( n_samples=N_SAMPLES, temperature=0.5, top_k_val=4, batch_size=N_SAMPLES, af3_output_dir="cas9_af3_pdbs", ) ``` ## Running the cascade `program.run()` draws the proposals and scores each one through the constraints. The `RejectionSamplingOptimizer` generates the candidates in independent batches, keeping no state between batches, and retains the best `num_results` by lowest energy. Because every constraint carries a threshold, scoring short-circuits: a candidate that fails one filter is not evaluated by the later, more expensive ones, so the AlphaFold3 fold runs only on candidates that already passed the seven cheaper checks. Wrapping the call in `ToolInstance.persist()` keeps the tool environments and loaded model weights alive for the whole run instead of tearing them down between constraint calls. ```python python icon="python" theme={null} from proto_tools.utils.tool_instance import ToolInstance with ToolInstance.persist(): program.run() ``` ## Collecting survivors `collect_results` reads each retained candidate back from the segment along with the metadata each filter recorded, and `survivors` keeps only the entries that carry a DNA sequence, the candidates that passed all eight filters including the AlphaFold3 structure check. The printout reports how many of the `N_SAMPLES` candidates survived and, for each survivor, its `pLDDT`, the catalytic domains found, and the predicted protein length. On a small batch this prints `0 passed all eight filters`: most candidates are rejected by the early filters, which is the behavior the cheap-to- expensive cascade is designed for. Surfacing Cas9-scale survivors that reach the fold is what raising `N_SAMPLES` toward the thousands used by the full script does. ```python python icon="python" theme={null} results = collect_results(locus, 0.5, 4) survivors = [r for r in results if r["dna_sequence"]] print(f"sampled {N_SAMPLES} candidates; {len(survivors)} passed all eight filters") for r in survivors: print(f" pLDDT={r['plddt']} domains={r['domains_found']} protein_len={len(r['protein_sequence'] or '')}") ``` ```text theme={null} sampled 8 candidates; 0 passed all eight filters ``` ## Next Steps > **[Protein Hunter](/docs/language/guides/examples/protein-hunter)** > > Structure-based protein design by cycling. > **[Using Optimizers](/docs/language/guides/using-optimizers)** > > Rejection sampling and the other optimization strategies. # DNA Sequence Optimization Source: https://proto.evodesign.org/docs/language/guides/examples/dna-optimization The smallest complete proto-language program: drive a 100 bp DNA insert to balanced GC with MCMC This is the smallest complete proto-language program. It drives a 100 bp synthetic DNA insert toward a balanced 40-60% GC content with no long single-base runs, using Markov chain Monte Carlo. Every program is assembled from the same six pieces, introduced in turn below: a `Segment`, a `Construct`, a `Generator`, one or more `Constraint` objects, an `Optimizer`, and a `Program`. [Open as a runnable notebook](https://github.com/evo-design/proto-language/blob/main/examples/notebooks/dna-optimization.ipynb) [View as a Python script](https://github.com/evo-design/proto-language/blob/main/examples/scripts/toy.py) ## Define the construct A `Segment` is the stretch of sequence being designed; a `Construct` groups the segments that make up one molecule. Here there is a single segment: passing `length=100` with no starting `sequence` leaves all 100 positions open for the optimizer to fill, `sequence_type="dna"` restricts them to A, C, G, and T, and `label="insert"` is the name its results are filed under. The `Construct` wraps that one segment. ```python python icon="python" theme={null} from proto_language.core import Segment, Construct # One variable 100 bp DNA segment. insert = Segment(length=100, sequence_type="dna", label="insert") construct = Construct([insert]) ``` ## Assign a generator The generator proposes new sequences for the optimizer to score. `RandomNucleotideGenerator` substitutes random bases at masked positions, and because the segment starts empty it also fills in the initial random sequence. `generator.assign(insert)` binds the generator to the segment it will mutate. ```python python icon="python" theme={null} from proto_language.generator import RandomNucleotideGenerator, RandomNucleotideGeneratorConfig generator = RandomNucleotideGenerator(RandomNucleotideGeneratorConfig()) generator.assign(insert) ``` ## Add constraints Constraints score how well a sequence meets the design objective; the optimizer searches for sequences that raise these scores. Two built-ins suffice here. `gc_content_constraint` with `min_gc=40` and `max_gc=60` rewards sequences whose GC content falls in that range, and `max_homopolymer_constraint` with `max_length=5` penalizes any single-base run longer than five bases. Each `Constraint` lists the segment it reads in `inputs` and carries a `label`, which is the key its scores appear under in the result metadata. ```python python icon="python" theme={null} from proto_language.core import Constraint from proto_language.constraint import gc_content_constraint, max_homopolymer_constraint gc = Constraint( inputs=[insert], function=gc_content_constraint, function_config={"min_gc": 40, "max_gc": 60}, label="gc_content", ) no_homopolymers = Constraint( inputs=[insert], function=max_homopolymer_constraint, function_config={"max_length": 5}, label="no_homopolymers", ) ``` ## Configure and run the optimizer The `MCMCOptimizer` ties the construct, generator, and constraints together and runs Metropolis-Hastings: at each step it generates proposals, scores them, and accepts or rejects, always keeping improvements and accepting worse proposals with a probability that falls as the temperature anneals. The config sets `num_steps=100` steps along a single trajectory (`num_results=1`, `proposals_per_result=1`) with `max_temperature=1.0` as the starting temperature. The optional `custom_logging` callable receives the step number and current outputs; here it prints the GC content every 20 steps. The `Program` runs the optimizer and collects the result. ```python python icon="python" theme={null} from proto_language.core import Program from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig def log_progress(step: int, outputs) -> None: seq = outputs[0].proposal_sequences[0] data = seq.metadata.get("constraints", {}).get("gc_content", {}).get("data", {}) gc_pct = data.get("gc_content") tail = f"GC {gc_pct:5.1f}%" if gc_pct is not None else "" if step % 20 == 0: print(f"step {step:3d} | {tail} | {seq.sequence}") optimizer = MCMCOptimizer( constructs=[construct], generators=[generator], constraints=[gc, no_homopolymers], config=MCMCOptimizerConfig( num_results=1, proposals_per_result=1, num_steps=100, max_temperature=1.0, ), custom_logging=log_progress, ) program = Program(optimizers=[optimizer], num_results=1) program.run() ``` ```text theme={null} step 20 | GC 54.0% | TCAGATTTAGATTGGGAGCTACCTTCTGCGCTGAGATCTGGGCGGACGTACTATGGTGGGCGTGCAGCGCGGGACTGGGAGGTTAGAAACTTATGAAGGA step 40 | GC 50.0% | TGCATAGTGATGCGACCGTACGTGTGTATCCAATTGGTAAGCTCCAGAAGACGCTGCGAGTCGAGAGGCGCTCTACGTTTCTAAAAGTACACACACTACC step 60 | GC 53.0% | CAGAAGATGGAGACCTATTCTTTGGAGCCAGGGTCGGCATATGCACGGGTCGGGCATTAGAGGTAAAGTGGGAATTTGGCCAGCTGTACTCGTCACAGCA step 80 | GC 50.0% | ATCTGAGAGCGGTCACCCAGAAATCTATGATGATGTCTCTTTGCGAATTACTACCTCCTAGACGCTCCCGCCCTATGCCCTCATGGCGTTTTCATCACTC step 100 | GC 51.0% | GCTTGTAGGCCGAAACTCAGAGGGTTTTCTCGCTATAGTCCCTGGACGCTGTAGGTTAATAGCGATAGGAAAGGGGGCAGCTGGGCTAATGCGAATGAAA ``` ## Inspect the result The final design is the construct's joined sequence. Per-segment results live under `metadata["segments"][