
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.
API Reference
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.
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
Metadata
| Property | Value |
|---|---|
| Key | max-homopolymer |
| Function | max_homopolymer_constraint |
| Category | sequence_composition |
| Mode | discrete |
| Uses GPU | False |
| Supported Types | dna, rna, protein |