In [1]:
import AlGDock.BindingPMF_plots
from AlGDock.BindingPMF_plots import *
import os, shutil, glob

phases = ['NAMD_Gas', 'OpenMM_OBC2']
# 'NAMD_OBC', 
# phases = ['sander_Gas', \
#   'sander_HCT', 'sander_OBC1', 'sander_OBC2', 'sander_GBn', 'sander_GBn2', \
#   'sander_PBSA', 'sander_ALPB_HCT', 'sander_ALPB_OBC1', 'sander_ALPB_OBC2', \
#   'sander_ALPB_GBn', 'gbnsr6_Still', 'gbnsr6_CHA']

self = AlGDock.BindingPMF_plots.BPMF_plots(\
  dir_CD='CD', dir_BC='BC',\
  ligand_database='prmtopcrd/ligand.db', \
  forcefield='prmtopcrd/gaff2.dat', \
  ligand_prmtop='prmtopcrd/ligand.prmtop', \
  ligand_inpcrd='prmtopcrd/ligand.trans.inpcrd', \
  ligand_mol2='prmtopcrd/ligand.mol2', \
  ligand_rb='prmtopcrd/ligand.rb', \
  receptor_database='prmtopcrd/receptor.db', \
  receptor_prmtop='prmtopcrd/receptor.prmtop', \
  receptor_inpcrd='prmtopcrd/receptor.trans.inpcrd', \
  receptor_fixed_atoms='prmtopcrd/receptor.pdb', \
  complex_prmtop='prmtopcrd/complex.prmtop', \
  complex_inpcrd='prmtopcrd/complex.trans.inpcrd', \
  complex_fixed_atoms='prmtopcrd/complex.pdb', \
  score = 'prmtopcrd/xtal_plus_dock6_scored.mol2', \
  temperature_scaling = 'Quadratic', \
  pose = -1, \
  rmsd=True, \
  dir_grid='grids', \
  protocol='Adaptive', BC_therm_speed=25.0, CD_therm_speed=0.25, \
  T_HIGH=450.0, T_SIMMIN=300.0, T_TARGET=300.0, \
  sampler='HMC', \
  MCMC_moves=1, \
  sampling_importance_resampling = True, \
  solvation = 'Full', \
  seeds_per_state=10, steps_per_seed=200, darts_per_seed=0, \
  sweeps_per_cycle=50, snaps_per_cycle=25, attempts_per_sweep=100, \
  steps_per_sweep=50, darts_per_sweep=0, \
  BC_repX_cycles=3, CD_repX_cycles=4, \
  site='Sphere', site_center=[1.7416, 1.7416, 1.7416], \
  site_max_R=1.0, \
  site_density=10., \
  phases=phases, \
  cores=-1, \
  random_seed=-1, \
  max_time=240, \
  keep_intermediate=True)


using 12/12 available cores
using random number seed of -1

*** Directories ***
  start: /Users/dminh/Documents/Code/AlGDock-0.0.1/Example
  BC: /Users/dminh/Documents/Code/AlGDock-0.0.1/Example/BC
  CD: /Users/dminh/Documents/Code/AlGDock-0.0.1/Example/CD

*** Files ***
previously stored in BC directory:
  prmtop:
    L: prmtopcrd/ligand.prmtop
  ligand_database: prmtopcrd/ligand.db
  forcefield: prmtopcrd/gaff2.dat
  inpcrd:
    L: prmtopcrd/ligand.trans.inpcrd

previously stored in CD directory:
  namd: ../../../../../../Applications/NAMD_2.13_MacOSX-x86_64-multicore/namd2
  receptor_database: prmtopcrd/receptor.db
  prmtop:
    L: prmtopcrd/ligand.prmtop
    R: prmtopcrd/receptor.prmtop
    RL: prmtopcrd/complex.prmtop
  ligand_database: prmtopcrd/ligand.db
  dir_BC: BC
  fixed_atoms:
    R: prmtopcrd/receptor.pdb
    RL: prmtopcrd/complex.pdb
  grids:
    LJr: grids/LJr.nc
    LJa: grids/LJa.nc
    sELE: grids/pbsa.nc
    ELE: grids/direct_ELE.nc
    desolv: grids/desolv.nc
  mol2:
    L: prmtopcrd/ligand.mol2
  score: prmtopcrd/xtal_plus_dock6_scored.mol2
  forcefield: prmtopcrd/gaff2.dat
  inpcrd:
    L: prmtopcrd/ligand.trans.inpcrd
    R: prmtopcrd/receptor.trans.inpcrd
    RL: prmtopcrd/complex.trans.inpcrd

from arguments and defaults:
  ligand_database: prmtopcrd/ligand.db
  receptor_database: prmtopcrd/receptor.db
  forcefield: prmtopcrd/gaff2.dat
  prmtop:
    L: prmtopcrd/ligand.prmtop
    R: prmtopcrd/receptor.prmtop
    RL: prmtopcrd/complex.prmtop
  inpcrd:
    L: prmtopcrd/ligand.trans.inpcrd
    R: prmtopcrd/receptor.trans.inpcrd
    RL: prmtopcrd/complex.trans.inpcrd
  mol2:
    L: prmtopcrd/ligand.mol2
  fixed_atoms:
    R: prmtopcrd/receptor.pdb
    RL: prmtopcrd/complex.pdb
  grids:
    LJr: grids/LJr.nc
    LJa: grids/LJa.nc
    sELE: grids/pbsa.nc
    ELE: grids/direct_ELE.nc
    desolv: grids/desolv.nc
  score: prmtopcrd/xtal_plus_dock6_scored.mol2
  dir_BC: BC

to be used:
  ligand_database: prmtopcrd/ligand.db
  receptor_database: prmtopcrd/receptor.db
  forcefield: prmtopcrd/gaff2.dat
  frcmodList: ['/Users/dminh/Documents/Code/AlGDock-0.0.1/Example/prmtopcrd/ligand.frcmod']
  prmtop:
    L: prmtopcrd/ligand.prmtop
    R: prmtopcrd/receptor.prmtop
    RL: prmtopcrd/complex.prmtop
  inpcrd:
    L: prmtopcrd/ligand.trans.inpcrd
    R: prmtopcrd/receptor.trans.inpcrd
    RL: prmtopcrd/complex.trans.inpcrd
  mol2:
    L: prmtopcrd/ligand.mol2
  fixed_atoms:
    R: prmtopcrd/receptor.pdb
    RL: prmtopcrd/complex.pdb
  grids:
    LJr: grids/LJr.nc
    LJa: grids/LJa.nc
    sELE: grids/pbsa.nc
    ELE: grids/direct_ELE.nc
    desolv: grids/desolv.nc
  score: prmtopcrd/xtal_plus_dock6_scored.mol2
  dir_BC: BC
  namd: ../../../../../../Applications/NAMD_2.13_MacOSX-x86_64-multicore/namd2


*** Simulation parameters and constants ***

for BC:
  protocol: Adaptive
  therm_speed: 25.0
  T_HIGH: 450.0
  T_SIMMIN: 300.0
  T_TARGET: 300.0
  H_mass: 4.0
  delta_t: 4.0
  sampler: HMC
  steps_per_seed: 200
  seeds_per_state: 10
  darts_per_seed: 0
  repX_cycles: 3
  min_repX_acc: 0.4
  sweeps_per_cycle: 50
  snaps_per_cycle: 25
  attempts_per_sweep: 100
  steps_per_sweep: 50
  darts_per_sweep: 0
  phases: ['NAMD_Gas', 'OpenMM_OBC2']
  sampling_importance_resampling: True
  solvation: Full
  keep_intermediate: True
  GMC_attempts: 0
  GMC_tors_threshold: 0.0

for CD:
  protocol: Adaptive
  therm_speed: 0.25
  T_HIGH: 450.0
  T_SIMMIN: 300.0
  T_TARGET: 300.0
  H_mass: 4.0
  delta_t: 4.0
  sampler: HMC
  steps_per_seed: 200
  seeds_per_state: 10
  darts_per_seed: 0
  repX_cycles: 4
  min_repX_acc: 0.4
  sweeps_per_cycle: 50
  snaps_per_cycle: 25
  attempts_per_sweep: 100
  steps_per_sweep: 50
  darts_per_sweep: 0
  phases: ['NAMD_Gas', 'OpenMM_OBC2']
  sampling_importance_resampling: True
  solvation: Full
  keep_intermediate: True
  GMC_attempts: 0
  GMC_tors_threshold: 0.0
  temperature_scaling: Quadratic
  site: Sphere
  site_center: array([ 1.7416,  1.7416,  1.7416])
  site_max_R: 1.0
  site_density: 10.0
  pose: -1
  k_pose: 1000.0
  MCMC_moves: 1
  rmsd: True
  receptor_NAMD_Gas: array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
ligand residue name: iga

*** Simulation parameters and constants ***

for BC:
  protocol: Adaptive
  therm_speed: 25.0
  T_HIGH: 450.0
  T_SIMMIN: 300.0
  T_TARGET: 300.0
  H_mass: 4.0
  delta_t: 4.0
  sampler: HMC
  steps_per_seed: 200
  seeds_per_state: 10
  darts_per_seed: 0
  repX_cycles: 3
  min_repX_acc: 0.4
  sweeps_per_cycle: 50
  snaps_per_cycle: 25
  attempts_per_sweep: 100
  steps_per_sweep: 50
  darts_per_sweep: 0
  phases: ['NAMD_Gas', 'OpenMM_OBC2']
  sampling_importance_resampling: True
  solvation: Full
  keep_intermediate: True
  GMC_attempts: 0
  GMC_tors_threshold: 0.0

for CD:
  protocol: Adaptive
  therm_speed: 0.25
  T_HIGH: 450.0
  T_SIMMIN: 300.0
  T_TARGET: 300.0
  H_mass: 4.0
  delta_t: 4.0
  sampler: HMC
  steps_per_seed: 200
  seeds_per_state: 10
  darts_per_seed: 0
  repX_cycles: 4
  min_repX_acc: 0.4
  sweeps_per_cycle: 50
  snaps_per_cycle: 25
  attempts_per_sweep: 100
  steps_per_sweep: 50
  darts_per_sweep: 0
  phases: ['NAMD_Gas', 'OpenMM_OBC2']
  sampling_importance_resampling: True
  solvation: Full
  keep_intermediate: True
  GMC_attempts: 0
  GMC_tors_threshold: 0.0
  temperature_scaling: Quadratic
  site: Sphere
  site_center: array([ 1.7416,  1.7416,  1.7416])
  site_max_R: 1.0
  site_density: 10.0
  pose: -1
  k_pose: 1000.0
  MCMC_moves: 1
  rmsd: True
  receptor_NAMD_Gas: array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])

In [2]:
self.log.clear_lock('BC')
self.log.clear_lock('CD')
self._run('all')


>>> Postprocessing, starting at Thu, 17 Oct 2019 17:15:45

  postprocessed CD, state 81, cycle 3, LOpenMM_OBC2 in 5.85 s
  postprocessed CD, state 81, cycle 1, LOpenMM_OBC2 in 5.86 s
  postprocessed CD, state 81, cycle 2, LOpenMM_OBC2 in 5.85 s
  postprocessed CD, state 81, cycle 0, LOpenMM_OBC2 in 5.89 s
  postprocessed original, state 0, cycle 0, ROpenMM_OBC2 in 11.78 s
  postprocessed CD, state 81, cycle 3, RLOpenMM_OBC2 in 12.28 s
  postprocessed CD, state 81, cycle 2, RLOpenMM_OBC2 in 13.21 s
  postprocessed CD, state 81, cycle 1, RLOpenMM_OBC2 in 13.74 s
  postprocessed CD, state 81, cycle 0, RLOpenMM_OBC2 in 17.82 s
  an average of 2.147 s per LOpenMM_OBC2 snapshot
  an average of 5.3491 s per RLOpenMM_OBC2 snapshot
  an average of 11.784 s per ROpenMM_OBC2 snapshot
  wrote to CD_progress.pkl.gz
  saved CD progress
  wrote to CD_progress.pkl.gz
  saved CD progress
  wrote to CD_data.pkl.gz
  saved CD data

Elapsed time for postprocessing: 19.10 s
/miniconda2/envs/algdock/lib/python2.7/site-packages/scipy/optimize/minpack.py:237: RuntimeWarning: xtol=0.000000 is too small, no further improvement in the approximate
  solution is possible.
  warnings.warn(msg, RuntimeWarning)
>>> Complex free energy calculations, starting at Thu, 17 Oct 2019 17:16:04

  calculated grid scaling free energy of -245.85 RT using cycles 0 to 0
  calculated NAMD_Gas binding PMF of -178.63 RT with cycles 0 to 0
  calculated NAMD_Gas binding PMF of -177.31 RT with cycles 1 to 1
  calculated NAMD_Gas binding PMF of -177.36 RT with cycles 1 to 2
  calculated NAMD_Gas binding PMF of -180.37 RT with cycles 1 to 3
  calculated OpenMM_OBC2 binding PMF of -39.243 RT with cycles 0 to 0
  calculated OpenMM_OBC2 binding PMF of -37.879 RT with cycles 1 to 1
  calculated OpenMM_OBC2 binding PMF of -37.782 RT with cycles 1 to 2
  calculated OpenMM_OBC2 binding PMF of -40.539 RT with cycles 1 to 3
  wrote to f_RL.pkl.gz

Elapsed time for binding PMF estimation: 0.60 s

Elapsed time for execution of all: 19.76 s

In [ ]: