Skip to content

Feature request: per-modification occurrence limits and a total variable-mod combination cap #231

Description

@pgarrett-scripps

Summary

Two opt-in controls on variable modification generation:

  • Per-mod occurrence limits: cap how many times a single variable mod can appear on one peptide (e.g. "acetyl at most once"), independent of max_variable_mods.
  • max_combinations: a hard cap on the total number of modified variants generated per peptide, preferring fewer-PTM forms.

Both default to off, so existing search behavior is unchanged.

Motivation

For PTM-heavy samples (histones especially), the variable-mod search space explodes combinatorially. max_variable_mods is the only current lever, but it's coarse. It can't express "allow up to 2 mods, but never two of the same mod on one peptide," and it can't bound the per-peptide variant count.

In practice, not all mods occur at the same frequency, so a single max_variable_mods lever is too coarse. Per-mod occurrence limits let the user say "this mod is rare, allow it at most once" while leaving common mods unrestricted, and max_combinations bounds the total variant count per peptide. This is especially important for histone data, where many residues are modifiable and the search space explodes combinatorially. Both are opt-in. MSFragger exposes similar controls.

Proposed config

variable_mods entries accept either a bare mass (unchanged) or a [mass, max_count] tuple, plus a new top-level max_combinations:

"database": {
  "variable_mods": {
    "M": [15.9949],
    "K": [[42.0106, 1], 14.0157]
  },
  "max_variable_mods": 2,
  "max_combinations": 8
}

Acetyl on K is capped at one occurrence per peptide; methyl on K has no per-mod cap (still bounded by max_variable_mods); and no peptide produces more than 8 modified variants total.

I have a working implementation with unit tests and can open a PR if such a feature would be a useful addition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions