# load the conformation spaces complex = osprey.readConfSpace("4tu5.complex.ccsx") dhfr = osprey.readConfSpace("4tu5.DHFR.ccsx") nadph06w = osprey.readConfSpace("4tu5.NADPH.06W.ccsx") # more cores is more faster parallelism = osprey.Parallelism(cpuCores=4) tasks = parallelism.makeTaskExecutor() # configure K* kstar = osprey.KStar( dhfr, nadph06w, complex, epsilon=0.68, writeSequencesToConsole=True, # turn this one off when you get tired of the log spam showPfuncProgress=True ) # configure K* inputs for each conf space for info in kstar.confSpaceInfos(): # TODO: make python API for constructor? using parallelism? ecalc = osprey.c.energy.compiled.CPUConfEnergyCalculator(info.confSpace, tasks) # compute reference energies # TODO: make python API eref = osprey.jvm.getInnerClass(osprey.c.ematrix.compiled.ErefCalculator, 'Builder')(ecalc) \ .build() \
# how should we compute energies of molecules? # (give the complex conf space to the ecalc since it knows about all the templates and degrees of freedom) parallelism = osprey.Parallelism(cpuCores=4) ecalc = osprey.EnergyCalculator(complexConfSpace, ffparams, parallelism=parallelism) # MARK* needs a rigid energy calculator too ecalcRigid = osprey.SharedEnergyCalculator(ecalc, isMinimizing=False) # configure K* kstar = osprey.KStar( proteinConfSpace, ligandConfSpace, complexConfSpace, epsilon= 0.95, # you proabably want something more precise in your real designs writeSequencesToConsole=True, writeSequencesToFile='kstar.results.tsv') # configure K* inputs for each conf space for info in kstar.confSpaceInfos(): # how should we define energies of conformations? eref = osprey.ReferenceEnergies(info.confSpace, ecalc) info.confEcalc = osprey.ConfEnergyCalculator(info.confSpace, ecalc, referenceEnergies=eref) # compute the minimized energy matrix ematMinimized = osprey.EnergyMatrix(info.confEcalc,
# make the conf space for the ligand ligandConfSpace = osprey.ConfSpace(ligand) # make the conf space for the protein+ligand complex complexConfSpace = osprey.ConfSpace([protein, ligand]) # how should we compute energies of molecules? # (give the complex conf space to the ecalc since it knows about all the templates and degrees of freedom) parallelism = osprey.Parallelism(cpuCores=4) ecalc = osprey.EnergyCalculator(complexConfSpace, ffparams, parallelism=parallelism, isMinimizing=True) # configure K* kstar = osprey.KStar(proteinConfSpace, ligandConfSpace, complexConfSpace) # configure K* inputs for each conf space for info in kstar.confSpaceInfos(): # how should we define energies of conformations? eref = osprey.ReferenceEnergies(info.confSpace, ecalc) info.confEcalc = osprey.ConfEnergyCalculator(info.confSpace, ecalc, referenceEnergies=eref) # compute the energy matrix emat = osprey.EnergyMatrix(info.confEcalc, cacheFile='emat.%s.dat' % info.id) # how should confs be ordered and searched? (don't forget to capture emat by using a defaulted argument)
import osprey osprey.start() # run this example AFTER you've trained the three LUTE models using LUTE.train.py # import our conf spaces from another file execfile('LUTE.confSpaces.py') # configure K* kstar = osprey.KStar(confSpaces['protein'], confSpaces['ligand'], confSpaces['complex'], epsilon=0.01, writeSequencesToConsole=True, writeSequencesToFile='kstar.results.tsv') # configure K* inputs for each conf space for (id, confSpace) in confSpaces.items(): # read the trained LUTE model pmat = osprey.DEE_read(confSpace, 'LUTE.pmat.%s.dat' % id) model = osprey.LUTE_read('LUTE.%s.dat' % id) # make a LUTE energy calculator from the model luteEcalc = osprey.LUTE_ConfEnergyCalculator(confSpace, model) # how should confs be ordered and searched? (don't forget to capture pmat,luteEcalc by using defaulted arguments) def makeAStar(rcs, pmat=pmat, luteEcalc=luteEcalc): return osprey.LUTE_AStar(rcs, pmat, luteEcalc, showProgress=False)
complexConfSpace = confspaces['complex'] # how should we compute energies of molecules? # (give the complex conf space to the ecalc since it knows about all the templates and degrees of freedom) parallelism = osprey.Parallelism(cpuCores=4) ecalc = osprey.EnergyCalculator(complexConfSpace, ffparams, parallelism=parallelism) # MARK* needs a rigid energy calculator too ecalcRigid = osprey.SharedEnergyCalculator(ecalc, isMinimizing=False) # configure K* kstar = osprey.KStar(proteinConfSpace, ligandConfSpace, complexConfSpace, epsilon=0.683, writeSequencesToConsole=True, writeSequencesToFile='kstar.results.tsv') # configure K* inputs for each conf space for info in kstar.confSpaceInfos(): # how should we define energies of conformations? eref = osprey.ReferenceEnergies(info.confSpace, ecalc) info.confEcalc = osprey.ConfEnergyCalculator(info.confSpace, ecalc, referenceEnergies=eref) # compute the minimized energy matrix ematMinimized = osprey.EnergyMatrix(info.confEcalc, cacheFile='emat.%s.dat' % info.id)