
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
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
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.object
required
Target dinucleotide -> frequency mapping (natural composition profile).
enum
default:"total_variation"
Distribution distance: ‘total_variation’ (0.5*sum|p-q|) or normalized ‘l2’.Options:
total_variation, l2number
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