def atoms_surfnet(osl, useMesh=True, interval=1.0, cutoff=10, density='Gaussian', color=None): try: atomList = Midas._selectedAtoms(osl) except (Midas.MidasError, chimera.oslParser.OSLSyntaxError), e: return str(e)
def interface_surfnet(receptorOSL, ligandsOSL, useMesh=True, interval=1.0, cutoff=10, density='Gaussian', color=None): try: receptorAtomList = Midas._selectedAtoms(receptorOSL) except (Midas.MidasError, chimera.oslParser.OSLSyntaxError), e: return str(e)
def MethodTwo(): Midas.close("all") # Parameters featureNumShells = 6 featureShellThickness = 1.0 # Load Molecule modelSel = "#0" [mol] = chimera.openModels.open(pdbfilename) chimera.viewer.scaleFactor = 4.5 # Draw as Ribbon Midas.resrepr("smooth", modelSel) for res in mol.residues: res.drawMode = chimera.Residue.Ribbon_Edged # Display Calciums calciumsSel = modelSel + "::ca" Midas.vdwdefine("ca", "ca", 0.5, calciumsSel) Midas.show(calciumsSel) Midas.represent("sphere", calciumsSel) # Display Shells calciums = Midas._selectedAtoms(calciumsSel) featureModels = [] for calcium in calciums: location = calcium.coord().xyz.data() t = apply(newTranslation, location) f = FeatureShellNode(featureNumShells, featureShellThickness) t.addChild(f) featureModels += useVRML(t, name="FEATURE Shell") # Load hitsfile import viewhitfile viewhitfile.loadFile(hitfilename)
def interface_surfnet(receptorOSL, ligandsOSL, useMesh=True, interval=1.0, cutoff=10, density='Gaussian', color=None): try: receptorAtomList = Midas._selectedAtoms(receptorOSL) except (Midas.MidasError, chimera.oslParser.OSLSyntaxError), e: return str(e) if not receptorAtomList: return 'No receptor atoms selected' try: ligandsAtomList = Midas._selectedAtoms(ligandsOSL) except (Midas.MidasError, chimera.oslParser.OSLSyntaxError), e: return str(e) if not ligandsAtomList: return 'No ligand atoms selected' surfmol = _surfnet.interface_surfnet(receptorAtomList, ligandsAtomList, True, cutoff=cutoff, threshold=interval) print '%d spheres' % len(surfmol.atoms) mList = show_surfnet(surfmol, useMesh, interval, density, color) for m in mList: m.name = 'Surfnet for "%s" - "%s"' % (receptorOSL, ligandsOSL) surfmol.destroy() return None
def getLocation(specifier): [atom] = Midas._selectedAtoms(specifier) return atom.coord().xyz.data()