Software:forcebalance: Difference between revisions

From biowiki
Jump to navigation Jump to search
No edit summary
Yanxing (talk | contribs)
Minor update
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= <span style="font-size:large">'''Background'''</span> =
== <span style="font-size:large">'''Background'''</span> ==


<span style="font-size:medium">ForceBalance is an automatic force field parametrization tool&nbsp;developed by Lee-Ping Wang et al. It allows one to use both quantum chemical data and experimental observables of the liquid phase. It has been applied to parameterize a bunch of water models and organic molecules. The following examples are some of them.</span>
<span style="font-size:medium">ForceBalance is an automatic force field parametrization tool&nbsp;developed by Lee-Ping Wang et al. It allows one to use both quantum chemical data and experimental observables of the liquid phase. It has been applied to parameterize a bunch of water models and organic molecules. The following examples are some of them.</span>
Line 10: Line 10:


<span style="font-size:medium">Here, a&nbsp;brief tutorial on how to install, set up, parallelize and run FB is provided below.&nbsp;&nbsp;&nbsp;</span>
<span style="font-size:medium">Here, a&nbsp;brief tutorial on how to install, set up, parallelize and run FB is provided below.&nbsp;&nbsp;&nbsp;</span>
''See "/home/yw24267/FB-demo" for local files.''


== <span style="font-size:large">'''ForceBalance Installation'''</span> ==
== <span style="font-size:large">'''ForceBalance Installation'''</span> ==


ForceBalance can be installed in different ways. Here I recommend installing FB through conda software manager&nbsp;(either Anaconda or Miniconda). For how to install conda, please go to the anaconda download page ([https://www.anaconda.com/products/individual https://www.anaconda.com/products/individual]).
To make ForceBalance work better on Ren lab cluster, a great amount of modifications have been made based on version 1.7.5, which is recorded at https://github.com/leucinw/Software-mod. To install ForceBalance 1.7.5 along with all the modifications, run the following first.
 
<pre>git clone https://github.com/leucinw/Software-mod.git
cd Software-mod/forcebalance-1.7.5
</pre>
 
The installer requires conda. For how to install conda, please go to the anaconda download page ([https://www.anaconda.com/products/individual https://www.anaconda.com/products/individual]). Then, open `installer.sh` and modify the variables at the beginning of the script to fit your case. You may also want to read [https://github.com/leucinw/Software-mod/blob/master/forcebalance-1.7.5/README.md Software-mod/forcebalance-1.7.5/README.md] for details before you continue. Then, simply running the following will complete the whole installation and patching for you.
 
<pre>bash installer.sh</pre>
 
If you need the original ForceBalance, it can be installed with conda directly.
 
<pre>conda create --name FB forcebalance -c conda-forge</pre>
 
Note that this will install the latest version without any modification for Ren lab cluster. See the official documentation for more installation methods.
 
=='''<span style="font-size:large">ForceBalance input files</span>'''==
 
<font size="3">In the following I will use amoeba water as an example. All the files are located in Renlab cluster at</font>
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code>/home/yw24267/FB-demo</code></div>
<font size="3">A&nbsp;&nbsp;typical job of ForceBalance folder looks like:&nbsp;</font>
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code>├── 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>
<font size="3">where example.in has the settings read by ForceBalance, forcefield directory contains the tinker parameter file, and targets folder contains lots of targets (both QM and Liquid).&nbsp;</font>
 
<font size="3">Inside the QM target is the tinker xyz and interactions.txt, interactions.key files Inside the Liquid target are the input files for Tinker (key and xyz) and experimental data (data.csv).&nbsp;</font>
<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.
 
<font size="3">A QM target folder (showing below)&nbsp;typically contains xyz files, interactions.key and interactions.txt, which defines the QM reference and how you calculate the interaction energy for AMOEBA.&nbsp;</font>
<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 setting up the above files, if you installed the modified version through the procedures stated above, you should be able to run ForceBalance using the following. Just make sure the tinkerpath in example.in is properly set! Note: The name of the bashrc file may vary depending what you set in the installer.sh file.</span>
<div style="background:#eeeeee;border:1px solid #cccccc;padding:5px 10px;"><code><span style="font-size:medium">source ~/.bashrc.FB17<br />ForceBalance example.in</span></code></div>
If ForceBalance jobs crash, check the error message and modify your setting.&nbsp; More information about settings in the example.in, please refer to ForceBalance manual file<span style="display: none">&nbsp;</span>
 
http://leeping.github.io/forcebalance/doc/ForceBalance-Manual.pdf
 
=='''Configurate which nodes to submit jobs on'''==
 
See [https://github.com/leucinw/Software-mod/blob/master/forcebalance-1.7.5/external/nodes.dat Software-mod/forcebalance-1.7.5/external/nodes.dat], which looks like the following
<pre>#===========================================
#  Any line starts with "#" will be ignored.
#  Only the first two columns matter !!
#  Add / remove nodes as needed.
 
#  This file is used by submitTinker.py,
#  and must be placed in the same folder.
#  Do not change the filename.
#===========================================
 
### GPU nodes mainly use
 
GPU node152  4090    2
 
GPU node154  4090    2
 
#CPU nodes nthreads


After you have conda installed, FB can be easily installed through the following commands:
CPU      node145 32
<pre> conda create --name FB17 python=3.7
  conda activate FB17
  conda install --strict-channel-priority -c conda-forge forcebalance</pre>


Now ForceBalance is installed. You should be able to run (but not efficiently) FB jobs with the following settings.
CPU      node146  32


&nbsp;
CPU      node152  64


Alternatively (for AMOEBA only, not AMOEBA+), for GPU tinker modifications and cluster submission. Please read&nbsp;[https://github.com/bdw2292/Ren-Lab-Daemon/blob/main/README_HELP.MD https://github.com/bdw2292/Ren-Lab-Daemon/blob/main/README_HELP.MD] , the section titled'''&nbsp;Creating workers for ForceBalance cluster submission'''
CPU      node153  64
</pre>

Latest revision as of 06:44, 5 April 2024

Background

ForceBalance is an automatic force field parametrization tool developed by Lee-Ping Wang et al. It allows one to use both quantum chemical data and experimental observables of the liquid phase. It has been applied to parameterize a bunch of water models and organic molecules. The following examples are some of them.

J. Phys. Chem. Lett., 2014, 5 (11), pp 1885–1891 (ForceBalance paper, TIP3P and TIP4P water as examples)

J. Phys. Chem. B, 2013, 117 (34), pp 9956–9972 (iAMOEBA paper)

J. Phys. Chem. B, 2015, 119 (29), pp 9423–9437 (AMOEBA14 paper)

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

See "/home/yw24267/FB-demo" for local files.

ForceBalance Installation

To make ForceBalance work better on Ren lab cluster, a great amount of modifications have been made based on version 1.7.5, which is recorded at https://github.com/leucinw/Software-mod. To install ForceBalance 1.7.5 along with all the modifications, run the following first.

git clone https://github.com/leucinw/Software-mod.git 
cd Software-mod/forcebalance-1.7.5

The installer requires conda. For how to install conda, please go to the anaconda download page (https://www.anaconda.com/products/individual). Then, open `installer.sh` and modify the variables at the beginning of the script to fit your case. You may also want to read Software-mod/forcebalance-1.7.5/README.md for details before you continue. Then, simply running the following will complete the whole installation and patching for you.

bash installer.sh

If you need the original ForceBalance, it can be installed with conda directly.

conda create --name FB forcebalance -c conda-forge

Note that this will install the latest version without any modification for Ren lab cluster. See the official documentation for more installation methods.

ForceBalance input files

In the following I will use amoeba water as an example. All the files are located in Renlab cluster at

/home/yw24267/FB-demo

A  typical job of ForceBalance folder looks like: 

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

where example.in has the settings read by ForceBalance, forcefield directory contains the tinker parameter file, and targets folder contains lots of targets (both QM and Liquid). 

Inside the QM target is the tinker xyz and interactions.txt, interactions.key files 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.

A QM target folder (showing below) typically contains 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 setting up the above files, if you installed the modified version through the procedures stated above, you should be able to run ForceBalance using the following. Just make sure the tinkerpath in example.in is properly set! Note: The name of the bashrc file may vary depending what you set in the installer.sh file.

source ~/.bashrc.FB17
ForceBalance example.in

If ForceBalance jobs crash, check the error message and modify your setting.  More information about settings in the example.in, please refer to ForceBalance manual file 

http://leeping.github.io/forcebalance/doc/ForceBalance-Manual.pdf

Configurate which nodes to submit jobs on

See Software-mod/forcebalance-1.7.5/external/nodes.dat, which looks like the following

#===========================================
#   Any line starts with "#" will be ignored.
#   Only the first two columns matter !!
#   Add / remove nodes as needed.

#   This file is used by submitTinker.py,
#   and must be placed in the same folder.
#   Do not change the filename. 
#===========================================

### GPU nodes mainly use

GPU node152   4090    2

GPU node154   4090    2

#CPU nodes nthreads

CPU      node145  32

CPU      node146  32

CPU      node152  64

CPU      node153  64