meeko/receptor_pdbqt.py
def closest_atoms_from_positions(self, xyz, radius, atom_properties=None, ignore=None):
        """Retrieve indices of the closest atoms around a positions/coordinates 
        at a certain radius.

        Args:
            xyz (np.ndarray): array of 3D coordinates
            raidus (float): radius
            atom_properties (str): property of the atoms to retrieve 
                (properties: ligand, flexible_residue, vdw, hb_don, hb_acc, metal, water, reactive, glue)
            ignore (int or list): ignore atom for the search using atom id (0-based)

        Returns:
            ndarray: 2d ndarray (atom_id, atom_name, resname, resid, chainid, xyz, q, t)

        """
        index = self._KDTree.query_ball_point(xyz, radius, p=2, return_sorted=True)

        # When nothing was found around...
        if not index:
            return np.array([])

        # Handle the case when positions for of only one atom was passed in the input
        try:
            index = {i for j in index for i in j}
        except:
            index = set(index)

        if atom_properties is not None:
            if not isinstance(atom_properties, (list, tuple)):
                atom_properties = [atom_properties]

            try:
                for atom_property in atom_properties:
                    index.intersection_update(self._atom_annotations[atom_property])
            except:
                error_msg = 'Atom property %s is not valid. Valid atom properties are: %s'
                raise KeyError(error_msg % (atom_property, self._atom_annotations.keys()))

        if ignore is not None:
            if not isinstance(ignore, (list, tuple, np.ndarray)):
                ignore = [ignore]
            index = index.difference([i for i in ignore])

        index = list(index)
        atoms = self._atoms[index].copy()

        return atoms
Retrieve indices of the closest atoms around a positions/coordinates 
        at a certain radius.

        Args:
            xyz (np.ndarray): array of 3D coordinates
            raidus (float): radius
            atom_properties (str): property of the atoms to retrieve 
                (properties: ligand, flexible_residue, vdw, hb_don, hb_acc, metal, water, reactive, glue)
            ignore (int or list): ignore atom for the search using atom id (0-based)

        Returns:
            ndarray: 2d ndarray (atom_id, atom_name, resname, resid, chainid, xyz, q, t)

        
Retrieve indices of the closest atoms around a positions/coordinates
at a certain radius.
Retrieve indices of the closest atoms around a positions / coordinates at a certain radius .
def closest_atoms_from_positions(self, xyz, radius, atom_properties=None, ignore=None):
        index = self._KDTree.query_ball_point(xyz, radius, p=2, return_sorted=True)
        if not index:
            return np.array([])
        try:
            index = {i for j in index for i in j}
        except:
            index = set(index)
        if atom_properties is not None:
            if not isinstance(atom_properties, (list, tuple)):
                atom_properties = [atom_properties]
            try:
                for atom_property in atom_properties:
                    index.intersection_update(self._atom_annotations[atom_property])
            except:
                error_msg = 'Atom property %s is not valid. Valid atom properties are: %s'
                raise KeyError(error_msg % (atom_property, self._atom_annotations.keys()))
        if ignore is not None:
            if not isinstance(ignore, (list, tuple, np.ndarray)):
                ignore = [ignore]
            index = index.difference([i for i in ignore])
        index = list(index)
        atoms = self._atoms[index].copy()
        return atoms
def closest_atoms_from_positions ( self , xyz , radius , atom_properties = None , ignore = None ) : index = self . _KDTree . query_ball_point ( xyz , radius , p = 2 , return_sorted = True ) if not index : return np . array ( [ ] ) try : index = { i for j in index for i in j } except : index = set ( index ) if atom_properties is not None : if not isinstance ( atom_properties , ( list , tuple ) ) : atom_properties = [ atom_properties ] try : for atom_property in atom_properties : index . intersection_update ( self . _atom_annotations [ atom_property ] ) except : error_msg = 'Atom property %s is not valid. Valid atom properties are: %s' raise KeyError ( error_msg % ( atom_property , self . _atom_annotations . keys ( ) ) ) if ignore is not None : if not isinstance ( ignore , ( list , tuple , np . ndarray ) ) : ignore = [ ignore ] index = index . difference ( [ i for i in ignore ] ) index = list ( index ) atoms = self . _atoms [ index ] . copy ( ) return atoms
Retrieve indices of the closest atoms around a positions/coordinates
at a certain radius.
Retrieve indices of the closest atoms around a positions / coordinates at a certain radius .
"""Retrieve indices of the closest atoms around a positions/coordinates 
        at a certain radius.

        Args:
            xyz (np.ndarray): array of 3D coordinates
            raidus (float): radius
            atom_properties (str): property of the atoms to retrieve 
                (properties: ligand, flexible_residue, vdw, hb_don, hb_acc, metal, water, reactive, glue)
            ignore (int or list): ignore atom for the search using atom id (0-based)

        Returns:
            ndarray: 2d ndarray (atom_id, atom_name, resname, resid, chainid, xyz, q, t)

        """ # When nothing was found around... # Handle the case when positions for of only one atom was passed in the input
2d ndarray (atom_id, atom_name, resname, resid, chainid, xyz, q, t)
2d ndarray ( atom_id atom_name resname resid chainid xyz q t )
ndarray
self
xyz
array of 3D coordinates
array of 3D coordinates
radius
atom_properties
property of the atoms to retrieve
(properties: ligand, flexible_residue, vdw, hb_don, hb_acc, metal, water, reactive, glue)
property of the atoms to retrieve ( properties : ligand flexible_residue vdw hb_don hb_acc metal water reactive glue )
ignore
ignore atom for the search using atom id (0-based)
ignore atom for the search using atom id ( 0 - based )
raidus
None