
License: MAFFT is open source and free for academic and commercial use under a BSD-3-Clause license. Please refer to the 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.

- Aligns the two protein sequences with MAFFT.
- Optionally trims (center-crop 80%, strip end gaps).
- Computes gap run-length Gini for both sequences; takes the max.
- Returns 0.0 if gap_gini <= max_gap_gini, else scales linearly to 1.0.
API Reference
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).
Maximum acceptable gap Gini score (0-1). Alignments above this are penalized.
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
Metadata
| Property | Value |
|---|---|
| Key | gap-gini |
| Function | gap_gini_constraint |
| Category | sequence_alignment |
| Mode | discrete |
| Uses GPU | False |
| Supported Types | protein |