qp.cluster.spheres.prune_atoms¶
- qp.cluster.spheres.prune_atoms(center, residues, spheres, max_atom_count, ligands)[source]¶
Prune residues from the cluster to meet the max atom count constraint.
Removes residues furthest from the center first, while preserving specified ligands and co-factors. Modifies
residuesandspheresin place. Empty outer spheres are removed from the list.- Parameters:
center (set) – Set of central residues (used as distance reference).
residues (set) – Set of all residues in the cluster (modified in place).
spheres (list of set) – Residue sets by coordination sphere (modified in place).
max_atom_count (int) – Maximum allowed total atom count in the cluster.
ligands (list) – Ligand residue names to preserve regardless of distance.
Notes
This function operates in place and does not return a value. Residues are removed in order of decreasing distance from the center atoms.