Difference between revisions of "Tinkergpu:Forcebalance"

From tinkergpu
Jump to navigation Jump to search
(update ForceBalance tutorial)
Line 1: Line 1:


= <span style="font-size:large">'''Background'''</span> =
= '''(Updated: Dec 2020)''' =


<span style="font-size:medium">ForceBalance is an automatic parameter optimization tool that was developed by Lee-Ping Wang et al. Please read at least these three papers I listed here to get a basic understanding of ForceBalance.</span>
== <span style="font-size:large">'''Background'''</span> ==


<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. Lett.</cite>,&nbsp;2014,&nbsp;5&nbsp;(11), pp 1885–1891 (ForceBalance paper, TIP3P and TIP4P as examples)</span>
<span style="font-size:medium">ForceBalance is an automatic parameter optimization tool that was developed by Lee-Ping Wang et al. Please read at least the following papers to understand the algorithms.</span>


<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. B</cite>,&nbsp;2013,&nbsp;117&nbsp;(34), pp 9956–9972 (iAMOEBA&nbsp;paper)</span>
#<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. Lett.</cite>,&nbsp;2014,&nbsp;5&nbsp;(11), pp 1885–1891 (ForceBalance paper, TIP3P and TIP4P water as examples)</span>
#<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. B</cite>,&nbsp;2013,&nbsp;117&nbsp;(34), pp 9956–9972 (iAMOEBA&nbsp;paper)</span>
#<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. B</cite>,&nbsp;2015,&nbsp;119&nbsp;(29), pp 9423–9437 (AMOEBA14 paper)</span>  


<span style="font-size:medium"><cite>&nbsp; &nbsp;J. Phys. Chem. B</cite>,&nbsp;2015,&nbsp;119&nbsp;(29), pp 9423–9437 (AMOEBA14 paper)</span>
<span style="font-size:medium">A brief tutorial on how to install, set up, and run FB is provided below.&nbsp;&nbsp;&nbsp;</span>


<span style="font-size:medium">In the following I will provide a brief tutorial on how to set up and run ForceBalance according to my experience.&nbsp;</span>
== <span style="font-size:large">'''ForceBalance Installation'''</span> ==


&nbsp;
It is easy to install FB through conda tool (either Anaconda or Miniconda). For how to install conda, please go to anaconda download page ([https://www.anaconda.com/products/individual https://www.anaconda.com/products/individual]).
 
= <span style="font-size:large">'''ForceBalance Installation'''</span> =
 
According to my experience, this is the simplest way to install ForceBalance software.
 
Make sure you have:
 
1) python 2.7 or later version;


2) pip (how to&nbsp;get it and install: [https://pip.pypa.io/en/stable/installing https://pip.pypa.io/en/stable/installing]);
After you have conda installed, FB can be installed through the following commands:
<pre><code>  conda create --name FB17 python=3.7
  conda activate FB17
  conda install --strict-channel-priority -c conda-forge forcebalance</code></pre>


3)&nbsp;forcebalance&nbsp;source code.
Now you should be able to run ForceBalance jobs. In order to&nbsp;


'''Keep in mind''': whichever dependencies required by next steps, you can easily install them by pip.
= '''<span style="font-size:large">ForceBalance input files</span>''' =
<pre>pip install xxx </pre>


'''Install ''''''forcebalance'''''':'''
<font size="3">To take amoeba water parameterization using tinker as an example, the following files are necessary to successfully run FB.&nbsp;</font>
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code>.<br/> ├── example.in<br/> ├── forcefield<br/> │&nbsp; &nbsp;└── water.prm<br/> └── targets<br/> &nbsp; &nbsp; ├── DimerMin<br/> &nbsp; &nbsp; ├── Interactions_CCSDT<br/> &nbsp; &nbsp; ├── Interactions_MP2<br/> &nbsp; &nbsp; ├── Liquid<br/> &nbsp; &nbsp; ├── Monomer_Moments<br/> &nbsp; &nbsp; ├── Monomer_Vibration<br/> &nbsp; &nbsp; ├── cluster-02<br/> &nbsp; &nbsp; ├── cluster-03</code></div>
Inside the Liquid target are&nbsp;the input files for tinker (.key and .xyz) and experimental data (data.csv)
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code>&nbsp;Liquid/<br/> ├── data.csv<br/> ├── gas.key<br/> ├── gas.xyz<br/> ├── liquid.key<br/> └── liquid.xyz</code></div>
A cluster folder typically contains the xyz files, interactions.key and interactions.txt, which defines the QM reference and how you calculate the interaction energy for AMOEBA.
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code>Interactions_CCSDT/<br/> ├── 01-Prism.xyz<br/> ├── 02-Cage.xyz<br/> ├── 03-Bag.xyz<br/> ├── 04-Cyclic-Chair.xyz<br/> ├── 05-Book-1.xyz<br/> ├── 06-Book-2.xyz<br/> ├── 07-Cyclic-Boat-1.xyz<br/> ├── 08-Cyclic-Boat-2.xyz<br/> ├── interactions.key<br/> ├── interactions.txt<br/> ├── monomer_exp.xyz<br/> ├── monomer_mp2.xyz<br/> ├── monomer_opt.xyz</code></div>
<span style="font-size:small;">After you setup the above files, you should be able to run ForceBalance using the simple command:</span>
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code><span style="font-size:medium">ForceBalance example.in</span></code></div>
If ForceBalance jobs crash, check the error message and modify your setting. &nbsp;<span style="display: none">&nbsp;</span>


Go to forcebalance&nbsp;directory and do the following:
== '''Customization for AMOEBA+ force field''' ==
<pre>python setup.py install --user</pre>


This will install the python modules in ~/.local/lib/python?.?/site-packages/forcebalance*/forcebalance
1. Backup original FB source files
<pre><code> export condaHOME = /home/liuchw/anaconda3/envs/FB17/lib/python3.7/site-packages/forcebalance
  cp $condaHOME/binding.py $condaHOME/binding.py_back
  cp $condaHOME/liquid.py $condaHOME/liquid.py_back
  cp $condaHOME/tinkerio.py $condaHOME/tinkerio.py_back
  cp $condaHOME/parser.py $condaHOME/parser.py_back
  cp $condaHOME/data/npt.py $condaHOME/data/npt.py_back</code></pre>


Add the ForceBalance executable to your PATH
2.&nbsp;Download modified files and copy them to the anaconda lib directory
<pre>export PATH=$PATH:~/.local/bin</pre>
<pre><code>  git clone git@github.com:leucinw/Software-mod.git modcode
</code><code>  export modfileHOME=/home/liuchw/modcode/forcebalance-1.7.5
  cp $modfileHOME/binding.py $condaHOME/binding.py
  cp $modfileHOME/liquid.py  $condaHOME/liquid.py
  cp $modfileHOME/tinkerio.py $condaHOME/tinkerio.py
  cp $modfileHOME/parser.py $condaHOME/parser.py
  cp $modfileHOME/data/npt.py $condaHOME/data/npt.py</code></pre>


&nbsp;
&nbsp;


= '''<span style="font-size:large">ForceBalance setup</span>''' =
The above customization mostly involves supports for AMOEBA+ keywords and parallelization of the serial jobs in:
 
<span style="display: none">&nbsp;</span><span style="font-size:medium">I will take&nbsp;forcebalance&nbsp;directory /forcebalance/studies/015_tinker_amoeba as an example.</span>
 
<span style="font-size:medium">A directory called "forcefield" is necessary, under which the amoeba parameter file is presented and a shot.key file for gas phase run.&nbsp;</span>
 
<span style="font-size:medium">Another directory called "targets" is necessary which specify different targets (such as cluster force and energy matching, liquid properties, cluster binding energies etc).</span>
 
<span style="font-size:medium">Remember: you can design your&nbsp;own target either like the current ForceBalance supported ones, or completely different ones, which you may need to modify the source code.</span>
 
<span style="font-size:medium">Running ForceBalance is a&nbsp;simple command: ForceBalance example.in</span>
 
<span style="font-size:medium">The example.in file is the FB input which tells FB program to do the optimization/single point task. About the detailed control keywords, please look at the </span><span style="font-size:medium">forcebalance&nbsp;</span><span style="font-size:medium">manual file.</span><span style="display: none">&nbsp;</span>
 
= <span style="font-size:large;">'''ForceBalance Run with TINKER for AMOEBA+ model'''</span> =
 
== New features added to ForceBalance ==
 
<span style="font-size:medium">ForceBalance code was modified to deal with our new terms in AMOEBA+ model, which includes, charge transfer, charge penetration (as a correction of multipole-multipole interation), vdW shape parameters and Quadupole scaling.</span>
 
<span style="font-size:medium">All these modifications are made in </span><span style="font-size:medium">tinkerio'''.py'''</span><span style="font-size:medium">file.</span>
<pre>allp = [ ..., "ct', 'delta-halgren', 'gamma-halgren','cp', ...]
eckeys = [..., 'Charge-Charge', ...] #Chengwen added
pdict = {..., 'CT'          &nbsp;: {'Atom':[1], 2:'A',3:'B'},  # CT parameters
        'DELTA-HALGREN': {'Atom':[], 0:''},    #Delta in VDW function
        'GAMMA-HALGREN': {'Atom':[], 0:''},    #Gamma in VDW function
        'QPOLESCALING'&nbsp;: {'Atom':[], 0:'', #Quadrupole scaling factor&nbsp
&nbsp;        ...};
</pre>
 
== <span style="font-size:medium">Liquid simulation parallelization</span> ==
 
&nbsp; &nbsp; &nbsp; <span style="font-size:medium">The original code was modified in the '''liquid.py&nbsp;'''file in order to run liquid simulation parallelly. Basically, I am using a&nbsp;combination of "ssh" and background command "&" to accomplish this goal. Besides, inparser'.py file, we need to add a line to specify the file location which will specify file contains the temperature-node list information. Here is the core part of the code:</span>
<pre> 
&nbsp;373 &nbsp; &nbsp;#! Modified by Chengwen Liu for multiple trajectores liquid simulations
&nbsp;374 &nbsp; &nbsp;#==============================================================================================================
&nbsp;375 &nbsp; &nbsp; def npt_simulation(self, temperature, pressure, simnum):
&nbsp;376 &nbsp; &nbsp; &nbsp; &nbsp; """ Submit Several NPT simulations on our Clusters """
&nbsp;377 &nbsp; &nbsp; &nbsp; &nbsp; temps = [];nodes = []
&nbsp;378 &nbsp; &nbsp; &nbsp; &nbsp; lines = file(self.liquid_node).readlines()
&nbsp;379 &nbsp; &nbsp; &nbsp; &nbsp; for line in lines:
&nbsp;380 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data = line.split()
&nbsp;381 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temps.append(float(data[0]))
&nbsp;382 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nodes.append(str(data[1]))
&nbsp;383 &nbsp; &nbsp; &nbsp; &nbsp; if not os.path.exists('npt_result.p'):
&nbsp;384 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; link_dir_contents(os.path.join(self.root,self.rundir),os.getcwd())
&nbsp;385 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.last_traj += [os.path.join(os.getcwd(), i) for i in self.extra_output]
&nbsp;386 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.liquid_mol[simnum%len(self.liquid_mol)].write(self.liquid_coords, ftype='tinker' if self.engname == 'tinker' else None)
&nbsp;387 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if temperature in temps[0:-1]:
&nbsp;388 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdstr = 'ssh&nbsp;%s "source ~/.forcebalance; cd&nbsp;%s; nohup&nbsp;%s python -u npt.py&nbsp;%s&nbsp;%.3f&nbsp;%.3f > npt.out 2>err.log &" '&nbsp;% (nodes[int(temps.index(temperature))], os.getcwd(), self.nptpfx, self.eng
&nbsp;389 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _exec(cmdstr, copy_stderr=True, outfnm='npt.out')
&nbsp;390
&nbsp;391 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if temperature == temps[-1]:
&nbsp;392 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdstr = '%s python -u npt.py&nbsp;%s&nbsp;%.3f&nbsp;%.3f >npt.out 2>err.log'&nbsp;% (self.nptpfx, self.engname, temperature, pressure)
&nbsp;393 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _exec(cmdstr, copy_stderr=True, outfnm='npt.out')
&nbsp;394
&nbsp;395 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #Check whether ALL simulations are completed; if not, wait for 30sec
&nbsp;396 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; parent_dir = os.getcwd()[0:-14]
&nbsp;397 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sleepingtime = 0.0
&nbsp;398 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allFiles = 0
&nbsp;399 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while allFiles&nbsp;!= len(temps):
&nbsp;400 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allFiles = 0
&nbsp;401 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for temp in temps:
&nbsp;402 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; directory_name = parent_dir+str(temp)+"K-1.0atm/"
&nbsp;403 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; allFiles = allFiles + int(os.path.isfile(directory_name+'npt_result.p'))
&nbsp;404 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if not os.path.isfile(directory_name+'npt_result.p'):
&nbsp;405 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print("File&nbsp;%s does not exist, I will sleep for 30sec"%(directory_name+'npt_result.p'))
&nbsp;406 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; time.sleep(30.0)
&nbsp;407 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sleepingtime += 30.0
&nbsp;408 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #if sleepingtime >= 900:break # which means some trajectories were probably crashed.
&nbsp;409 #Above ============================================================================================================</pre>
 
&nbsp;
 
= '''ForceBalance run with Tinker-OpenMM''' =
 
For GPU run, we have to change the following lines:
 
1. In tinkerio.py: rbytes=1024 should be smaller, otherwise it will cause a "stream interleave" error. (change it to 1)
 
2. In npt.py, comment out the PrintEDA&nbsp;function calls. In tinker-openmm&nbsp;it will not print this information.
 
3. In tinkerio.py, change "dynamic" to "dynamic_omm", which is the GPU executable. For gas phase, we are still using "dynamic".
 
4. In order to speed up the post-processing (analyze *.arc file to get energy and dipole gradient), I made a new version of energy_derivatives() function in npt.py, which allows one to run as many analyze jobs as possible.
<pre>188 def energy_derivatives_TINKER(FF, mvals, h, pgrad, length, AGrad=True):
189    #initialize the energy gradient and dipole gradient array
190    G  = np.zeros((FF.np,length))
191    GDx = np.zeros((FF.np,length))
192    GDy = np.zeros((FF.np,length))
193    GDz = np.zeros((FF.np,length))
194    if not AGrad:
195        return G, GDx, GDy, GDz
196    #Actually tinkerpath is an argument in FB
197    tinkerpath = "/home/liuchw/bin/tinkerOMM0910"
198    #Record key file except for the first line
199    lines = file("liquid-md.key").readlines()[1:]
200    ofile = open("runAna_m.sh","w")
201    ofil1 = open("runAna_p.sh","w")
202    #backup the current water.prm
203    os.rename("water.prm", "water.prm.org")
204    for i in pgrad:
205        #minus and plus
206        prmfile1 = open("liquid_%02d_m.key"%i, 'w')
207        prmfile2 = open("liquid_%02d_p.key"%i, 'w')
208        prmfile1.write("parameters ./water_%02d_m.prm\n"%i)
209        prmfile2.write("parameters ./water_%02d_p.prm\n"%i)
210        for line in lines:
211            prmfile1.write(line)
212            prmfile2.write(line)
213        prmfile1.close()
214        prmfile2.close()
215
216        mvals_= mvals
217        mvals_[i] += -abs(h)
218        FF.make(mvals_)
219        os.rename("water.prm", "water_%02d_m.prm"%i)
220        mvals_[i] += abs(h)*2.0
221        FF.make(mvals_)
222        os.rename("water.prm", "water_%02d_p.prm"%i)
223        mvals_[i] += -abs(h)
224
225        if i == pgrad[-1]:
226            cmdstr1 = tinkerpath+"/analyze ./liquid-md.arc -k ./liquid_%02d_m.key G,E,M > liquid_%02d_m.out \n"%(i,i)
227            cmdstr2 = tinkerpath+"/analyze ./liquid-md.arc -k ./liquid_%02d_p.key G,E,M > liquid_%02d_p.out \n"%(i,i)
228        else:
229            cmdstr1 = tinkerpath+"/analyze ./liquid-md.arc -k ./liquid_%02d_m.key G,E,M > liquid_%02d_m.out &\n"%(i,i)
230            cmdstr2 = tinkerpath+"/analyze ./liquid-md.arc -k ./liquid_%02d_p.key G,E,M > liquid_%02d_p.out &\n"%(i,i)
231        ofile.write(cmdstr1)
232        ofil1.write(cmdstr2)
233    ofile.close()
234    ofil1.close()
235    #wait 5sec, for safe
236    time.sleep(5.0)
237    os.rename("water.prm.org", "water.prm")
238
239    os.system("sh runAna_m.sh")
240    os.system("sh runAna_p.sh")
241    #Check whether all analyze jobs finished!
242    readFlag = 0
243    while readFlag==0:
244        cmdstr1 = "grep 'Dipole X,Y,Z-Components&nbsp;:' liquid_*_m.out >dipole_m.dat"
245        cmdstr2 = "grep 'Dipole X,Y,Z-Components&nbsp;:' liquid_*_p.out >dipole_p.dat"
246        os.system(cmdstr1)
247        os.system(cmdstr2)
248        nLinesDm = sum(1 for line in open("dipole_m.dat"))
249        nLinesDp = sum(1 for line in open("dipole_p.dat"))
250        if ((nLinesDm==length*len(pgrad)) and (nLinesDp==length*len(pgrad))):
251            readFlag = 1
252            break
253        else:
254            print("Some analyze jobs are still running! I will sleep for 30 sec!")
255            time.sleep(30.0)
256    #If all jobs finished, calculate numerical gradients
257    if readFlag==1:
258        for i in pgrad:
259            eanl_m = []
260            eanl_p = []
261            dip_px = []
262            dip_py = []
263            dip_pz = []
264            dip_mx = []
265            dip_my = []
266            dip_mz = []
267            lines = file("liquid_%02d_m.out"%i).readlines()
268            for line in lines:
269                s = line.split()
270                if 'Total Potential Energy&nbsp;: ' in line:
271                    eanl_m.append(float(s[4]) * 4.184)
272                if 'Dipole X,Y,Z-Components&nbsp;:' in line:
273                    dip_mx.append(float(s[-3]))
274                    dip_my.append(float(s[-2]))
275                    dip_mz.append(float(s[-1]))
276            lines = file("liquid_%02d_p.out"%i).readlines()
277            for line in lines:
278                s = line.split()
279                if 'Total Potential Energy&nbsp;: ' in line:
280                    eanl_p.append(float(s[4]) * 4.184)
281                if 'Dipole X,Y,Z-Components&nbsp;:' in line:
282                    dip_px.append(float(s[-3]))
283                    dip_py.append(float(s[-2]))
284                    dip_pz.append(float(s[-1]))
 
285
286            #use np.array here
287            eanl_p = np.array(eanl_p)
288            eanl_m = np.array(eanl_m)
289            dip_px = np.array(dip_px)
290            dip_py = np.array(dip_py)
291            dip_pz = np.array(dip_pz)
292            dip_mx = np.array(dip_mx)
293            dip_my = np.array(dip_my)
294            dip_mz = np.array(dip_mz)
295            #2-sides numerical grad.
296            G[i,:]  = (eanl_p - eanl_m)/(2*h)
297            GDx[i,:] = (dip_px - dip_mx)/(2*h)
298            GDy[i,:] = (dip_py - dip_my)/(2*h)
299            GDz[i,:] = (dip_pz - dip_mz)/(2*h)
300    return G, GDx, GDy, GDz</pre>
 
 
 
= '''Code availability''' =


All of the modified code can be found in&nbsp;[https://biomol.bme.utexas.edu/~liuchw/ https://biomol.bme.utexas.edu/~liuchw/]
*Tinker binding energy calculations (<code>minimize</code> and <code>analyze</code>)
*Tinker post-MD&nbsp;<code>analyze</code>&nbsp;jobs
*Tinker/Tinker-OpenMM&nbsp;<code>dynamic</code>&nbsp;jobs

Revision as of 15:09, 16 December 2020

(Updated: Dec 2020)

Background

ForceBalance is an automatic parameter optimization tool that was developed by Lee-Ping Wang et al. Please read at least the following papers to understand the algorithms.

  1.    J. Phys. Chem. Lett., 2014, 5 (11), pp 1885–1891 (ForceBalance paper, TIP3P and TIP4P water as examples)
  2.    J. Phys. Chem. B, 2013, 117 (34), pp 9956–9972 (iAMOEBA paper)
  3.    J. Phys. Chem. B, 2015, 119 (29), pp 9423–9437 (AMOEBA14 paper)

A brief tutorial on how to install, set up, and run FB is provided below.   

ForceBalance Installation

It is easy to install FB through conda tool (either Anaconda or Miniconda). For how to install conda, please go to anaconda download page (https://www.anaconda.com/products/individual).

After you have conda installed, FB can be installed through the following commands:

<code>  conda create --name FB17 python=3.7
  conda activate FB17
  conda install --strict-channel-priority -c conda-forge forcebalance</code>

Now you should be able to run ForceBalance jobs. In order to 

ForceBalance input files

To take amoeba water parameterization using tinker as an example, the following files are necessary to successfully run FB. 

.
├── example.in
├── forcefield
│   └── water.prm
└── targets
    ├── DimerMin
    ├── Interactions_CCSDT
    ├── Interactions_MP2
    ├── Liquid
    ├── Monomer_Moments
    ├── Monomer_Vibration
    ├── cluster-02
    ├── cluster-03

Inside the Liquid target are the input files for tinker (.key and .xyz) and experimental data (data.csv)

 Liquid/
├── data.csv
├── gas.key
├── gas.xyz
├── liquid.key
└── liquid.xyz

A cluster folder typically contains the xyz files, interactions.key and interactions.txt, which defines the QM reference and how you calculate the interaction energy for AMOEBA.

Interactions_CCSDT/
├── 01-Prism.xyz
├── 02-Cage.xyz
├── 03-Bag.xyz
├── 04-Cyclic-Chair.xyz
├── 05-Book-1.xyz
├── 06-Book-2.xyz
├── 07-Cyclic-Boat-1.xyz
├── 08-Cyclic-Boat-2.xyz
├── interactions.key
├── interactions.txt
├── monomer_exp.xyz
├── monomer_mp2.xyz
├── monomer_opt.xyz

After you setup the above files, you should be able to run ForceBalance using the simple command:

ForceBalance example.in

If ForceBalance jobs crash, check the error message and modify your setting.   

Customization for AMOEBA+ force field

1. Backup original FB source files

<code> export condaHOME = /home/liuchw/anaconda3/envs/FB17/lib/python3.7/site-packages/forcebalance
  cp $condaHOME/binding.py $condaHOME/binding.py_back
  cp $condaHOME/liquid.py $condaHOME/liquid.py_back
  cp $condaHOME/tinkerio.py $condaHOME/tinkerio.py_back
  cp $condaHOME/parser.py $condaHOME/parser.py_back
  cp $condaHOME/data/npt.py $condaHOME/data/npt.py_back</code>

2. Download modified files and copy them to the anaconda lib directory

<code>  git clone git@github.com:leucinw/Software-mod.git modcode
</code><code>  export modfileHOME=/home/liuchw/modcode/forcebalance-1.7.5
  cp $modfileHOME/binding.py $condaHOME/binding.py
  cp $modfileHOME/liquid.py  $condaHOME/liquid.py
  cp $modfileHOME/tinkerio.py $condaHOME/tinkerio.py
  cp $modfileHOME/parser.py $condaHOME/parser.py
  cp $modfileHOME/data/npt.py $condaHOME/data/npt.py</code>

 

The above customization mostly involves supports for AMOEBA+ keywords and parallelization of the serial jobs in:

  • Tinker binding energy calculations (minimize and analyze)
  • Tinker post-MD analyze jobs
  • Tinker/Tinker-OpenMM dynamic jobs