def main(args): if len(args) != 3: oechem.OEThrow.Usage("%s <protein> <ligand>" % args[0]) pifs = oechem.oemolistream() if not pifs.open(args[1]): oechem.OEThrow.Fatal("Unable to open %s for reading protein." % args[1]) prot = oechem.OEGraphMol() if not oechem.OEReadMolecule(pifs, prot): oechem.OEThrow.Fatal("Unable to read protein") oechem.OEAddExplicitHydrogens(prot) oechem.OEAssignBondiVdWRadii(prot) lifs = oechem.oemolistream() if not lifs.open(args[2]): oechem.OEThrow.Fatal("Unable to open %s for reading ligand." % args[2]) lig = oechem.OEGraphMol() if not oechem.OEReadMolecule(lifs, lig): oechem.OEThrow.Fatal("Unable to read ligand") oechem.OEAddExplicitHydrogens(lig) oechem.OEAssignBondiVdWRadii(lig) comp = oechem.OEGraphMol(prot) oechem.OEAddMols(comp, lig) compSurf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(compSurf, comp) protSurf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(protSurf, prot) ligSurf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(ligSurf, lig) compVol = oespicoli.OESurfaceVolume(compSurf) protVol = oespicoli.OESurfaceVolume(protSurf) ligVol = oespicoli.OESurfaceVolume(ligSurf) oespicoli.OEWriteSurface("comp.oesrf", compSurf) oespicoli.OEWriteSurface("prot.oesrf", protSurf) oespicoli.OEWriteSurface("lig.oesrf", ligSurf) oechem.OEThrow.Info( "%s-%s: dV(C-P) = %.1f V(L) = %.1f V(C) = %.1f V(P) = %.1f" % (prot.GetTitle(), lig.GetTitle(), compVol - protVol, ligVol, compVol, protVol)) return 0
def main(args): if len(args) != 4: oechem.OEThrow.Usage("%s <protein> <ligand> <surface>" % args[0]) pfs = oechem.oemolistream(args[1]) prot = oechem.OEGraphMol() oechem.OEReadMolecule(pfs, prot) oechem.OEAssignBondiVdWRadii(prot) lfs = oechem.oemolistream(args[2]) lig = oechem.OEGraphMol() oechem.OEReadMolecule(lfs, lig) surf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(surf, prot) # Iterate through all the protein surface vertices for i in range(surf.GetNumVertices()): vert = surf.GetVertex(i) # Check the distance to each atom for atom in lig.GetAtoms(): dist2 = GetDist2(lig.GetCoords(atom), vert) if dist2 < MAX_DIST * MAX_DIST: surf.SetVertexCliqueElement(i, 1) # Crop to the binding site and output oespicoli.OESurfaceCropToClique(surf, 1) oespicoli.OEWriteSurface(args[3], surf) return 0
def main(args): if len(args) != 4: oechem.OEThrow.Usage("%s <protein> <ligand> <surface>" % args[0]) pfs = oechem.oemolistream(args[1]) prot = oechem.OEGraphMol() oechem.OEReadMolecule(pfs, prot) oechem.OEAssignBondiVdWRadii(prot) lfs = oechem.oemolistream(args[2]) lig = oechem.OEGraphMol() oechem.OEReadMolecule(lfs, lig) surf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(surf, prot) oespicoli.OESurfaceToMoleculeDistance(surf, lig) # Mark the vertices to keep for i in range(surf.GetNumVertices()): if surf.GetDistanceElement(i) < MAX_DIST: surf.SetVertexCliqueElement(i, 1) # Crop to the binding site and output oespicoli.OESurfaceCropToClique(surf, 1) oespicoli.OEWriteSurface(args[3], surf) return 0
def main(argv=[__name__]): if len(argv) != 3: oechem.OEThrow.Usage("%s <molfile.pdb> <out.srf>" % argv[0]) mol = oechem.OEGraphMol() ifs = oechem.oemolistream(argv[1]) oechem.OEReadMolecule(ifs, mol) if not oechem.OEHasResidues(mol): oechem.OEPerceiveResidues(mol, oechem.OEPreserveResInfo_All) serials = {} for atom in mol.GetAtoms(): res = oechem.OEAtomGetResidue(atom) serials[res.GetSerialNumber()] = atom outsurf = oespicoli.OESurface() center = oechem.OEFloatArray(3) for line in open(argv[1]): if line.startswith("ANISOU"): serno, factors = ParseFactors(line) if serno in serials: mol.GetCoords(serials[serno], center) surf = GetEllipsoidalSurface(center, factors) oespicoli.OEAddSurfaces(outsurf, surf) oespicoli.OEWriteSurface(argv[2], outsurf)
def main(args): if len(args) != 3: oechem.OEThrow.Usage("%s <protein> <surface>" % args[0]) ifs = oechem.oemolistream() if not ifs.open(args[1]): oechem.OEThrow.Fatal("Unable to open %s for reading" % args[1]) mol = oechem.OEGraphMol() oechem.OEReadMolecule(ifs, mol) oechem.OEPerceiveResidues(mol) oechem.OEAssignBondiVdWRadii(mol) # Generate the molecular surface surf = oespicoli.OESurface() oespicoli.OEMakeMolecularSurface(surf, mol, 0.5) # Mark all the vertices associated with hydrophobic atoms for i in range(surf.GetNumVertices()): atom = mol.GetAtom(oechem.OEHasAtomIdx(surf.GetAtomsElement(i))) if (AtomInHydrophobicResidue(atom)): surf.SetVertexCliqueElement(i, 1) # Crop to only those triangles oespicoli.OESurfaceCropToClique(surf, 1) # nlqs is the number of different connected components nclqs = oespicoli.OEMakeConnectedSurfaceCliques(surf) # Find the largest component maxclq = 0 maxarea = 0.0 for i in range(nclqs): area = oespicoli.OESurfaceCliqueArea(surf, i+1) print("clique: %d area: %f" % (i+1, area)) if (area > maxarea): maxclq = i+1 maxarea = area # Crop to it oespicoli.OESurfaceCropToClique(surf, maxclq) oespicoli.OEWriteSurface(args[2], surf) return 0
def main(args): if len(args) != 3: oechem.OEThrow.Usage("%s <protein> <surface>" % args[0]) prtfs = oechem.oemolistream() if not prtfs.open(args[1]): oechem.OEThrow.Fatal("Unable to open %s for reading" % args[1]) prt = oechem.OEGraphMol() oechem.OEReadMolecule(prtfs, prt) oechem.OEAssignBondiVdWRadii(prt) surf = oespicoli.OESurface() oespicoli.OEMakeCavitySurfaces(prt, surf) oespicoli.OEInvertSurface(surf) oespicoli.OEWriteSurface(args[2], surf) return 0
def main(args): if len(args) != 4: oechem.OEThrow.Usage("%s <protein> <ligand> <surface>" % args[0]) prtfs = oechem.oemolistream(args[1]) prt = oechem.OEGraphMol() oechem.OEReadMolecule(prtfs, prt) oechem.OESuppressHydrogens(prt) oechem.OEAssignBondiVdWRadii(prt) ligfs = oechem.oemolistream(args[2]) lig = oechem.OEGraphMol() oechem.OEReadMolecule(ligfs, lig) oechem.OESuppressHydrogens(lig) oechem.OEAssignBondiVdWRadii(lig) grid = oegrid.OEScalarGrid() oespicoli.OEMakeVoidVolume(prt, lig, grid, 0.5) surf = oespicoli.OESurface() oespicoli.OEMakeSurfaceFromGrid(surf, grid, 0.5) oespicoli.OEWriteSurface(args[3], surf) return 0