
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.
Constraint contributors
dguo8412
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
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).
number
default:"0.02"
Minimum acceptable relative frequency for any amino acid type.
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 severityamino_acid_counts: Dictionary mapping amino acids to their countsunderrepresented_amino_acids: List of amino acids that are underrepresentedunderrepresented_aa_count: Integer count of underrepresented amino acid typesmin_aa_frequency_threshold: The minimum frequency threshold used
Usage
Evaluating amino acid balance in protein:python