0cd1348f3c432cc2afcc491c06b2b9301d526882,rdkit_fixer.py,,ExtractPocketAndLigand,#,198

Before Change


                        reverse=True)[0]
    ligand_amap = hetatm_residues[ligand_key]
    ligand = AtomListToSubMol(mol, ligand_amap, includeConformer=True)
    ligand_coords = np.array(ligand.GetConformer().GetPositions())

    // Get protein and waters
    blacklist_ids = list(chain(*hetatm_residues.values()))
    protein_amap = np.array([i for i in range(mol.GetNumAtoms())
                             if i not in blacklist_ids])
    protein_coords = np.array(mol.GetConformer().GetPositions())[protein_amap]

    // Pocket selection based on cutoff
    mask = (cdist(protein_coords, ligand_coords) <= cutoff).any(axis=1)
    // IDs of atoms within cutoff
    pocket_amap = protein_amap[np.where(mask)[0]].tolist()

    // Expand pocket"s residues
    if expandResidues:
        pocket_residues = OrderedDict()
        for res_id in protein_residues.keys():
            if any(1 for res_aix in protein_residues[res_id]
                   if res_aix in pocket_amap):
                pocket_residues[res_id] = protein_residues[res_id]
        pocket_amap = list(chain(*pocket_residues.values()))

    // Create pocket mol, pocket_amap needs to be mapped to mol Idxs
    pocket = AtomListToSubMol(mol, pocket_amap, includeConformer=True)

    return pocket, ligand

After Change


                        reverse=True)[0]
    ligand_amap = hetatm_residues[ligand_key]
    ligand = AtomListToSubMol(mol, ligand_amap, includeConformer=True)
    conf = ligand.GetConformer()
    ligand_coords = np.array([conf.GetAtomPosition(i)
                              for i in range(ligand.GetNumAtoms())])

    // Get protein and waters
    blacklist_ids = list(chain(*hetatm_residues.values()))
    protein_amap = np.array([i for i in range(mol.GetNumAtoms())
                             if i not in blacklist_ids])
    conf = mol.GetConformer()
    protein_coords = np.array([conf.GetAtomPosition(i)
                              for i in range(mol.GetNumAtoms())])[protein_amap]

    // Pocket selection based on cutoff
    mask = (cdist(protein_coords, ligand_coords) <= cutoff).any(axis=1)
    // IDs of atoms within cutoff
    pocket_amap = protein_amap[np.where(mask)[0]].tolist()

    // Expand pocket"s residues
    if expandResidues:
        pocket_residues = OrderedDict()
        for res_id in protein_residues.keys():
            if any(1 for res_aix in protein_residues[res_id]
                   if res_aix in pocket_amap):
                pocket_residues[res_id] = protein_residues[res_id]
        pocket_amap = list(chain(*pocket_residues.values()))

    // Create pocket mol, pocket_amap needs to be mapped to mol Idxs
    pocket = AtomListToSubMol(mol, pocket_amap, includeConformer=True)

    return pocket, ligand
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: oddt/oddt
Commit Name: 0cd1348f3c432cc2afcc491c06b2b9301d526882
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: ExtractPocketAndLigand


Project Name: oddt/oddt
Commit Name: aa5d761c03ea31df01ff51ec3634dd89cd73bec1
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: oddt/toolkits/extras/rdkit_fixer.py
Class Name:
Method Name: UFFConstrainedOptimize