meeko/analysis/interactions.py
def find(self, ligand, receptor):
        """Find distance-based interactions between ligand and receptor.

        Args:
            ligand (PDBQTMolecularr): ligand
            receptor (PDBQTReceptor): receptor

        Returns:
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and rigid receptor
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and flexible sidechain

        """
        dtype = [('ligand_idx', int), ('receptor_idx', int), 
                 ('distance', float)]
        rigid_interactions = [] 
        flex_interactions = []
        has_flexible_residues = ligand.has_flexible_residues()
        lig_atoms = ligand.atoms_by_properties(['ligand', self._atom_properties[0]])

        for lig_atom in lig_atoms:
            # Get interactions with the rigid part of the receptor
            rec_atoms = receptor.closest_atoms_from_positions(lig_atom['xyz'], self._distance, self._atom_properties[1])
            rigid_interactions.extend((lig_atom['idx'], rec_atom['idx'], np.linalg.norm(lig_atom['xyz'] - rec_atom['xyz'])) for rec_atom in rec_atoms)

            # Get interactions with the flexible part of the receptor (if present)
            if has_flexible_residues:
                rec_atoms = ligand.closest_atoms_from_positions(lig_atom['xyz'], self._distance, ['flexible_residue', self._atom_properties[1]])
                flex_interactions.extend((lig_atom['idx'], rec_atom['idx'], np.linalg.norm(lig_atom['xyz'] - rec_atom['xyz'])) for rec_atom in rec_atoms)

        return np.array(rigid_interactions, dtype=dtype), np.array(flex_interactions, dtype=dtype)
Find distance-based interactions between ligand and receptor.

        Args:
            ligand (PDBQTMolecularr): ligand
            receptor (PDBQTReceptor): receptor

        Returns:
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and rigid receptor
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and flexible sidechain

        
Find distance-based interactions between ligand and receptor.
Find distance - based interactions between ligand and receptor .
def find(self, ligand, receptor):
        dtype = [('ligand_idx', int), ('receptor_idx', int), 
                 ('distance', float)]
        rigid_interactions = [] 
        flex_interactions = []
        has_flexible_residues = ligand.has_flexible_residues()
        lig_atoms = ligand.atoms_by_properties(['ligand', self._atom_properties[0]])
        for lig_atom in lig_atoms:
            rec_atoms = receptor.closest_atoms_from_positions(lig_atom['xyz'], self._distance, self._atom_properties[1])
            rigid_interactions.extend((lig_atom['idx'], rec_atom['idx'], np.linalg.norm(lig_atom['xyz'] - rec_atom['xyz'])) for rec_atom in rec_atoms)
            if has_flexible_residues:
                rec_atoms = ligand.closest_atoms_from_positions(lig_atom['xyz'], self._distance, ['flexible_residue', self._atom_properties[1]])
                flex_interactions.extend((lig_atom['idx'], rec_atom['idx'], np.linalg.norm(lig_atom['xyz'] - rec_atom['xyz'])) for rec_atom in rec_atoms)
        return np.array(rigid_interactions, dtype=dtype), np.array(flex_interactions, dtype=dtype)
def find ( self , ligand , receptor ) : dtype = [ ( 'ligand_idx' , int ) , ( 'receptor_idx' , int ) , ( 'distance' , float ) ] rigid_interactions = [ ] flex_interactions = [ ] has_flexible_residues = ligand . has_flexible_residues ( ) lig_atoms = ligand . atoms_by_properties ( [ 'ligand' , self . _atom_properties [ 0 ] ] ) for lig_atom in lig_atoms : rec_atoms = receptor . closest_atoms_from_positions ( lig_atom [ 'xyz' ] , self . _distance , self . _atom_properties [ 1 ] ) rigid_interactions . extend ( ( lig_atom [ 'idx' ] , rec_atom [ 'idx' ] , np . linalg . norm ( lig_atom [ 'xyz' ] - rec_atom [ 'xyz' ] ) ) for rec_atom in rec_atoms ) if has_flexible_residues : rec_atoms = ligand . closest_atoms_from_positions ( lig_atom [ 'xyz' ] , self . _distance , [ 'flexible_residue' , self . _atom_properties [ 1 ] ] ) flex_interactions . extend ( ( lig_atom [ 'idx' ] , rec_atom [ 'idx' ] , np . linalg . norm ( lig_atom [ 'xyz' ] - rec_atom [ 'xyz' ] ) ) for rec_atom in rec_atoms ) return np . array ( rigid_interactions , dtype = dtype ) , np . array ( flex_interactions , dtype = dtype )
Find distance-based interactions between ligand and receptor.
Find distance - based interactions between ligand and receptor .
"""Find distance-based interactions between ligand and receptor.

        Args:
            ligand (PDBQTMolecularr): ligand
            receptor (PDBQTReceptor): receptor

        Returns:
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and rigid receptor
            np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
                for each interaction between ligand and flexible sidechain

        """ # Get interactions with the rigid part of the receptor # Get interactions with the flexible part of the receptor (if present)
array of (ligand_atom_index, receptor_atom_index, distance)
for each interaction between ligand and rigid receptor
np.ndarray: array of (ligand_atom_index, receptor_atom_index, distance)
for each interaction between ligand and flexible sidechain
array of ( ligand_atom_index receptor_atom_index distance ) for each interaction between ligand and rigid receptor np . ndarray : array of ( ligand_atom_index receptor_atom_index distance ) for each interaction between ligand and flexible sidechain
np.ndarray
self
ligand
None
receptor
None