9.2.3. Neighbor Search wrapper for MDAnalysis — MDAnalysis.lib.NeighborSearch
¶
This module contains classes that allow neighbor searches directly with AtomGroup objects from MDAnalysis.
-
class
MDAnalysis.lib.NeighborSearch.
AtomNeighborSearch
(atom_group, bucket_size=10)[source]¶ This class can be used to find all atoms/residues/segements within the radius of a given query position.
This class is using the BioPython KDTree for the neighborsearch. This class also does not apply PBC to the distance calculattions. So you have to ensure yourself that the trajectory has been corrected for PBC artifacts.
Parameters: - *atom_list* – list of atoms (:class: ~MDAnalysis.core.AtomGroup.AtomGroup)
- *bucket_size* – Number of entries in leafs of the KDTree. If you suffer poor performance you can play around with this number. Increasing the bucket_size will speed up the construction of the KDTree but slow down the search.
-
search
(atoms, radius, level='A')[source]¶ Return all atoms/residues/segments that are within radius of the atoms in atoms.
Parameters: - *atoms* – list of atoms (:class: ~MDAnalysis.core.AtomGroup.AtomGroup)
- *radius* – float. Radius for search in Angstrom.
- (optional) (*level*) – char (A, R, S). Return atoms(A), residues(R) or segments(S) within radius of atoms.