qp.protonate.fix.clean_occupancy

qp.protonate.fix.clean_occupancy(path: str, center_residues: CenterResidue) bool[source]

Resolve partial occupancy conflicts by selecting a self-consistent coordinate set.

Iterates over all residues with partial occupancy and removes lower-priority residues that clash spatially. Priority order: center residues > standard amino acids > non-standard residues > higher average occupancy > more atoms. Distance criteria are 1.0 A for center residues (allowing coordination bonds) and 2.5 A for all others.

The PDB file at path is overwritten in place with the cleaned structure.

Parameters:
  • path (str) – Path to the PDB file (modified in place).

  • center_residues (CenterResidue) – The center residue definition for priority assignment.

Returns:

True if partial occupancy was detected and cleaned, False otherwise.

Return type:

bool