def findGmec(epart): print("\n\nFinding GMEC with energy partition: %s\n" % epart) # configure conformation energies with the desired energy partition confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc, energyPartition=epart) # find the GMEC emat = osprey.EnergyMatrix(confEcalc) astar = osprey.AStarTraditional(emat, confSpace) gmec = osprey.GMECFinder(astar, confEcalc).find()
strand = osprey.Strand('1CC8.ss.pdb') strand.flexibility['A2'].setLibraryRotamers('ALA', 'GLY') strand.flexibility['A3'].setLibraryRotamers(osprey.WILD_TYPE, 'VAL') strand.flexibility['A4'].setLibraryRotamers(osprey.WILD_TYPE) # make the conf space confSpace = osprey.ConfSpace(strand) # choose a forcefield ffparams = osprey.ForcefieldParams() # how should we compute energies of molecules? ecalc = osprey.EnergyCalculator(confSpace, ffparams) # how should we define energies of conformations? confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) # compute the energy matrix emat = osprey.EnergyMatrix(confEcalc) # run DEE with just steric pruning pmat = osprey.DEE(confSpace, emat, showProgress=True) # or run DEE with Goldstein pruning #i0 = 10.0 # kcal/mol #pmat = osprey.DEE(confSpace, emat, showProgress=True, singlesGoldsteinDiffThreshold=i0, pairsGoldsteinDiffThreshold=i0) # find the best sequence and rotamers astar = osprey.AStarMPLP(emat, pmat) gmec = osprey.GMECFinder(astar, confEcalc).find()
protein = osprey.Strand(mol, residues=['A2', 'A30']) protein.flexibility['A2'].setLibraryRotamers('ALA', 'GLY') protein.flexibility['A3'].setLibraryRotamers(osprey.WILD_TYPE, 'VAL', 'ARG').setContinuous(10) protein.flexibility['A4'].setLibraryRotamers( osprey.WILD_TYPE).addWildTypeRotamers() # make the conf space confSpace = osprey.ConfSpace(protein) # how should molecule energies be calculated? ecalc = osprey.EnergyCalculator(confSpace, ffparams, parallelism=parallelism) # how could conformation energies be calculated? confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) # calculate the energy matrix emat = osprey.EnergyMatrix(confEcalc, cacheFile='/tmp/emat.dat') # define the conformation search astar = osprey.AStarMPLP(emat, confSpace, numIterations=1) # or traditionalAstar = osprey.AStarTraditional(emat, confSpace) energyWindow = 0.1 # kcal/mol confs = osprey.GMECFinder(astar, confEcalc, printIntermediateConfs=True, confLog='confs.txt').find(energyWindow)
strand.flexibility[resNum].setLibraryRotamers(osprey.WILD_TYPE, 'ARG', 'LYS') # make the conf space confSpace = osprey.ConfSpace(strand) # choose a forcefield ffparams = osprey.ForcefieldParams() # how should we compute energies of molecules? ecalc = osprey.EnergyCalculator(confSpace, ffparams) # how should we define energies of conformations? confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) emat = osprey.EnergyMatrix(confEcalc) # let's use an energy window so the search takes a noticeable amount of time energyWindow = 5.0 # kcal/mol # find the best sequence and rotamers # and store conformations in a database confDBFile = 'gmec.conf.db' astar = osprey.AStarMPLP(emat, confSpace) gmec = osprey.GMECFinder(astar, confEcalc, confDBFile=confDBFile).find(energyWindow) # If OSPREY exits unexpectedly, the 'gmec.conf.db' file will still remain. # running the design again using an existing confDB should be MUCH faster! # meaning, your design should catch up to where it left off very quickly. astar = osprey.AStarMPLP(emat, confSpace) gmec2 = osprey.GMECFinder(astar, confEcalc, confDBFile=confDBFile).find(energyWindow)
# negatively charged residues: ASP, GLUE # polar uncharged: SER, THR, ASN, GLN, TYR, CYS # Conversely, "deep" residues should only mutate to hydrophobic # Fow now here are the residues in the "native pocket" # For chain X residue number N, the residue is identified by 'XN' strand.flexibility['A54'].setLibraryRotamers( osprey.WILD_TYPE, 'ASP', 'GLU') # Wild type means the residue is free to be unchanged # BUT will still have it's flexibility modelled strand.flexibility['A55'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A145'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A185'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A239'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A241'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A242'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') strand.flexibility['A241'].setLibraryRotamers(osprey.WILD_TYPE, 'ASP', 'GLU') # Now the conf space is defined confSpace = osprey.ConfSpace(strand) # DEFAULT CONFIG FOR NOW ffparams = osprey.ForceFieldParams() ecalc = osprey.EnergyCalculator(confSpace, ffparams) confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) emat = osprey.EnergyMatrix(confEcalc) astar = osprey.AStarMPLP(emat, confSpace) # find the best sequence and rotamers gmec = osprey.GMECFinder(confSpace, astar, ecalc).find()
import osprey osprey.start() # define a strand strand = osprey.Strand('1CC8.ss.pdb') strand.flexibility['A2'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous() strand.flexibility['A3'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous() strand.flexibility['A4'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous() # make the conf space confSpace = osprey.ConfSpace(strand) # choose a forcefield ffparams = osprey.ForcefieldParams() # how to compute the energy of a conformation? ecalc = osprey.EnergyCalculator(confSpace, ffparams) confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) # configure external memory settings osprey.initExternalMemory(64) # how should confs be ordered and searched? emat = osprey.EnergyMatrix(confEcalc) astar = osprey.AStarMPLP(emat, confSpace, useExternalMemory=True) # find the best sequence and rotamers gmec = osprey.GMECFinder(astar, confEcalc, useExternalMemory=True).find()
ffparams = osprey.ForcefieldParams() # how should we compute energies of molecules? ecalc = osprey.EnergyCalculator(confSpace, ffparams) # how should we define energies of conformations? confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc) # how should confs be ordered and searched? emat = osprey.EnergyMatrix(confEcalc) astar = osprey.AStarMPLP(emat, confSpace) # find the best sequence and rotamers # and save all the conformations in the confdb for easier analysis later confDBFile = 'conf.db' gmec = osprey.GMECFinder(astar, confEcalc, confDBFile=confDBFile).find() # get the conformation analyzer analyzer = osprey.ConfAnalyzer(confEcalc) # analyze the gmec analysis = analyzer.analyze(gmec) print('\n') print(analysis) osprey.writePdb(analysis.epmol, 'gmec.pdb') # breakdown the forcefield energy by position print('Forcefield breakdown:') print(analysis.breakdownEnergyByPosition(osprey.BreakdownType.All)) # breakdown the forcefield energy by position and effect