molsysmt.build.remove_overlapping_molecules#
- molsysmt.build.remove_overlapping_molecules(molecular_system, selection, selection_2=None, structure_index=0, threshold='3 angstroms', pbc=True, syntax='MolSysMT')[source]#
Removing molecules that overlap a reference selection within a distance threshold.
Given a reference selection (and optionally a second selection), this function finds contacts closer than threshold and removes the molecules containing the overlapping atoms.
- Parameters:
molecular_system (molecular system) – System to process.
selection (str, list, tuple or numpy.ndarray) – Reference atoms (MolSysMT selection syntax or indices).
selection_2 (str, list, tuple or numpy.ndarray, optional) – Second set of atoms; if None, uses the complement of selection.
structure_index (int, default 0) – Structure/frame index used to detect contacts.
threshold (pyunitwizard quantity or str, default '3 angstroms') – Distance cutoff for defining overlaps.
pbc (bool, default True) – Whether to consider periodic boundary conditions (auto-detected if True).
syntax (str, default 'MolSysMT') – Selection syntax for string-based selections.
- Returns:
The pruned molecular system with overlapping molecules removed.
- Return type:
molecular system