How to run a RESP calculation
Most information here is now obsolete: RESP fits are now done in an
automatic way by antechanber.
A typical antechamber command is:
antechamber -fi gout
-fo
prepi -c resp -i file.out -o res.in -rn RES
-at amber
where, you should insert
the file name, and the residue name, (three letters) twice, first in
lower-case and second in capital letters. -at amber, indicates that you
will use only standard Amber atom types (otherwise you will get gaff
atom types).
Often Amber gives you strange atom names. Then, you can use the program
fixatomin
to replace the wrong atom names. Insert the correct atom names into the
file NEWPDB.PDB file and then read it into the program together with
the NEWPDB.PDB file and the *.in file from
antechamber.
However, for the polarisable Amber
ff02 force field, you still need to use this home page
(because
you need to remove the self-polarisation of the molecule). The
procedure is described in Cieplak, Caldwell & Kollman, J. Comput.
Chem. 22 (2001) 1048.
Sometimes (when antechamber fails), you may also need to use the old version by
hand.
How to determine RESP
charges for the polarisable Amber ff02 force field.
- Run a Gaussian geometry optimisation, either at the
HF/6-31G* level or at the B3LYP/DZpdf/6-31G* level (with transition
metals).
Then run a single-point energy calculations with the B3LYP/cc-pVTZ
level and
include the following keywords in the command line.
SCF=Tight Pop=MK
IOp(6/33=2,6/41=10,6/42=17)
If you already have a converged wavefunction at the appropriate level
of
theory, you can simply run:
Guess=(Read,Only) Pop=(Minimal,MK)
IOp(6/33=2,6/41=10,6/42=17)
If the system includes transition metal, you also have to specify:
Pop=ReadRadii
and give a row for each metal at the end of the script, (with one blank
line
before and after) e.g.
Cu 2.0
IOp(6/33=2) makes Gaussian write out the potential points and
potentials (do not change)
IOp(6/41=10) specifies that 10 concentric layers of points are used for
each
atom (do not change)
IOp(6/42) givest the density of points in each layer. A value of 17
gives
about 2500 points/atom. Lower values may be needed for large molecules,
since
the programs cannot normally handle more than 100 000 potential points.
A
value of 10 gives about 1000 points/atom.
Example of a full Gaussian script:
%Chk=btn.chk
#P HF/6-31g* Opt
Biotin, HF, 6-31G*, 1/9-05
-1 1
c 33.34700000000000
7.55100000000000 14.58000000000000
c 33.06400000000000
8.81200000000000 15.35700000000000
...
h 36.15300000000000
11.00700000000000 16.90000000000000
--Link1--
%Chk=btn1.chk
#P B3LYP/cc-pVTZ SCF=Tight Geom=AllCheck Guess=Read
Pop=MK IOp(6/33=2,6/41=10,6/42=17)
- Use the program changepot
to convert the Gaussian output file to resp input files. All defaults
are valid, except the name of the Gaussian file.
This gives the files resp.in, resp.pot, and qin.
- Set qwt=0.0000 in the resp.in file.
Then run resp:
resp -O -i resp.in -o resp.out -q qin -e resp.pot
This gives the first charges (in file qout). Check that they
are identical to the input charges in qin (can be seen in resp.out).
- Run
antechamber -i file.out -fi gout
-o res.in -fo
prepi -c resp -rn RES
-at amber
to get a *.in file for the molecule.
You also get a PDB file, NEWPDB.PDB
- Run tleap to get the prmtop and prmcrd files for the molecule
alone:
tleap -s -f leaprc.ff02
loadAmberPrep bt1.in
loadamberparams
btn.dat (optional)
x=loadpdb NEWPDB.PDB
check x
saveamberparmpol x prmtop
prmcrd
quit
- Convert the prmtop file to the old format:
new2oldparm <prmtop
>p.for
- If amber reorders the atoms, you need to construct a file "order"
with:
#atoms
1 line for each atom with number in the gaussian=resp files
and in the amber=*.in file (arbitrary order)
You can get a pdb file from the gaussian calculation by
gausstopdb
Otherwise, you do
ln qout qout1
- Run the (undocumented program) changeQ_parm to move the
charges from resp into the prmtop file:
$AMBERHOME/src/resp/changeQ_parm
It reads the file p.for and qout1 and writes the file p_mod.for, which
is a prmtop file with charges taken from qout1.
If the program is not compiled, you can compile it by make changeQ_parm in $AMBERHOME/src/resp.
- Run sander with the following sander.in file:
Title
&cntrl
irest=0,ntx=1,
imin=1,maxcyc=1,
ntc=1,ntf=1,
cut=999.0,
ntpr=100,ntwx=0,ntwv=0,ntwe=0,
ipol=1,iesp=1,
igb=0,ntb=0,
scnb=2.0,scee=1.2
&end
&ewald
indmeth=1
&end
The (undocumented) parameter iesp=1 forces the program to read the file
esp.dat and write out the two files esp.induced and esp.qm-induced. The
latter is the ESP(QM)-ESP(induced dipole), which we need for the new
Resp calculations. Thus run:
ln resp.pot esp.dat
sander -O -i sander.in -o
sander.out -c prmcrd -p p_mod.for
- Set up some links to make the iterations working
cp qout1 q0
- Now you can iterate in the following way (in each subsequent
iteration, you should increase the highlighted number after q with 1):
resp -O -i resp.in -o
resp.out -q qout -e esp.qm-induced
reorder_qout
cp qout1 q1
less resp.out
\mv p_mod.for p.for
$AMBERHOME/src/resp/changeQ_parm
sander -O -i sander.in -o sander.out -c prmcrd -p p_mod.for
You should iterate (repete these lines) until the charges (qin and
qout) in resp.out are identical. Alternatively, you may check it by
diff q7 q8
You can do it automatically by this script:
cp qout1 q0
xold=0
for x in 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20
do
resp -O -i
resp.in -o
resp.out -q qout -e esp.qm-induced
reorder_qout
cp qout1 q"$x"
diff q"$xold" q"$x" >script.tmp
if [ ! -s script.tmp ] ; then exit ; fi
cat script.tmp
\mv p_mod.for
p.for
$AMBERHOME/src/resp/changeQ_parm
sander -O -i sander.in -o sander.out -c prmcrd -p p_mod.for
xold=$x
done
- Control if there are any polar hydrogens bound to the same atoms
or if there are identical polar heavy atoms (e.g. in carboxylic
groups).
If so, constrain these to have the same charge (in resp.in1).
Example (water)
Water
&cntrl ihfree=0, qwt=0.0005, iqopt=2
&end
1.0
Mol1
0 3
8 0
1 0
1 2
The lines contain the following information:
Title
Control keywords
Weight of the molecule
Name of the molecule
Total charge, number of atoms
Atom number Fitting_number
Valid fitting_numbers are:
-n fixed charge (to the one in file qin)
0 free charge
n the charge is constrained to be the same as
the one
of atom #n.
The keywords mean:
ihfree (0 = hydrogen atoms are restrained; 1 = not restrained)
qwt (wheight of the constraint. Use 0.0005 for stage 1 and 0.0001 for
stage 2)
iqopt (1 = set all initial charges to 0; 2 = read initial charges
from
-q (qin)
irstrnt (0 = harmonic restraints; 1 = hyperbolic restraints,
default)
nmol (number of molecules, i.e. different conformations)
- Run resp:
resp -O -i resp.in1 -o resp.out1 -q qout -e esp.qm-induced
- Fix the charge of all atoms except carbons with more than one
hydrogen (methyl and methylene groups).
Constrain hydrogens bound to the same carbon
to
have equal charges.
Change qwt=0.001.
Do this in resp.in2.
Example:
Methanol
&cntrl ihfree=0, qwt=0.001, iqopt=2
&end
1.0
Mol1
0 6
6 0
1 0
1 2
1 2
8 -1
1 -1
- Run resp again:
resp -O -i resp.in2 -o resp.out2 -q qout -e esp.qm-induced
- The results are found in file resp.out2
Insert these charges into the *.in file created by antechanber above.
Note that antechanber renumbers the atoms, so you need to check that
you use the right atom, but the file order gives the right order.
You can check the charges by running
changeparm
p_mod.for
p
pdb
m
prmcrd
q
How to
determine RESP charges -
old version by hand (normally obsolete)
1. Optimise the geometry, either at the
- B3LYP/6-31G* level (small molecules or transition-metal
complexes,
accurate calculations)
- AM1 level (large organic molecules, relatively crude
calculations).
2. For Turbomole, see below:
Run a Gaussian single-point energy calculation, either at
the
HF/6-31G* level (without transition metals) or at the
B3LYP/DZpdf/6-31G* level.
Include the following keywords in the command line.
SCF=Tight Pop=MK
IOp(6/33=2,6/41=10,6/42=17)
If you already have a converged wavefunction at the appropriate
level of
theory, you can simply run:
Guess=(Read,Only) Pop=(Minimal,MK)
IOp(6/33=2,6/41=10,6/42=17)
If the system includes transition metal, you also have to specify:
Pop=ReadRadii
and give a row for each metal at the end of the script, (with one blank
line
before and after) e.g.
Cu 2.0
IOp(6/33=2) makes Gaussian write out the potential points and
potentials (do not change)
IOp(6/41=10) specifies that 10 concentric layers of points are used for
each
atom (do not change)
IOp(6/42) givest the density of points in each layer. A value of 17
gives
about 2500 points/atom. Lower values may be needed for large molecules,
since
the programs cannot handle more than 100 000 potential points.
A
value of 10 gives about 1000 points/atom.
Example of a full Gaussian script:
%Chk=g.chk
#P B3LYP/Gen Geom=AllCheck
Guess=(Read,Only)
Pop=(Minimal,MK,ReadRadii)
IOp(6/33=2,6/41=10,6/42=17)
! Gen basis set
@/teo/ulf/Basis/stdbas/N
! Non-default atomic radii
Zn 2.0
Cu 2.0
3. Use the program changepot
to convert the output file to resp input files. All defaults
are valid, except the name of the Gaussian file.
This gives the files resp.in, resp.in1, resp.pot, and qin.
4. Control if there are any polar hydrogens bound to the same
atoms or any symmetry related other atoms.
If so, constrain these to have the same charge (in resp.in), e.g. for
water:
Water
&cntrl ihfree=0, qwt=0.0005, iqopt=2
&end
1.0
Mol1
0 3
8 0
1 0
1 2
The lines contain the following information:
Title
Control keywords
Weight of the molecule
Name of the molecule
Total charge, number of atoms
Atom number Fitting_number
Valid fitting_numbers are:
-n fixed charge (to the one in file qin)
0 free charge
n the charge is constrained to be the same as the
one
of atom #n.
The keywords mean:
ihfree (0 = hydrogen atoms are restrained; 1 = not restrained)
qwt (wheight of the constraint. Use 0.0005 for stage 1 and 0.0001 for
stage 2)
iqopt (1 = set all initial charges to 0; 2 = read initial charges
from
-q (qin)
irstrnt (0 = harmonic restraints; 1 = hyperbolic restraints,
default)
nmol (number of molecules, i.e. different conformations)
5. Run resp:
resp -O -i resp.in -o resp.out -q qin -e resp.pot
6. Fix the charge of all atoms except carbons with more than
one
hydrogen (methyl and methylene groups).
Constrain hydrogens bound to the same carbon
to
have equal charges.
Change qwt=0.001.
Do this in resp.in1.
There is now already a template resp.in1 file (from changepot) that is
correct, provided that hydrogen atoms come after there respective heavy
atom. Othewise, you have to this by hand.
cp qout qin1
Example:
Methanol
&cntrl ihfree=0, qwt=0.001, iqopt=2
&end
1.0
Mol1
0 6
6 0
1 0
1 2
1 2
8 -1
1 -1
7. Run resp again:
resp -O -i resp.in1 -o resp.out1 -q qin1 -e resp.pot
The result is found in file resp.out1
How to run a Resp calculation with multiple conformations
- Run changepot on all Gaussian files for each configuration.
Save the potentials in different files
- Concatenate all potential files to one single file
cat files >espot (if you use this file name, you do not
need
to have a -e flag)
- Add
nmol=number_of_configurations
to the &cntrl list in resp.in
- Add a section:
1.0
Mol1
0 3
8 0
1 0
1 2
for each molecule.
The first line is a general weight for the molecule (preferably the
Boltzmann weight based on the total energy (in solution or in a
MD simulation).
The second line is the name of the molecule.
The third row is the total charge and the number of atoms as usual.
The rest of the rows are the normal atom number - charge constraints
rows.
There should be one blank row between each molecule.
- Finally, after two blak rows, add a section which equates the
charge
of the same atom in all molecules.
The program /teo/ulf/Bin/respconfig generates these row
(fixed format).
You just give the number of atoms and number of molecules.
The format is two rows for each atom (16i5), the first with the number
of
constraints = number of molecules, and the second is the
constraint: molecule_1 atom_1, molecule_2 atom_2, ...
6
1 1
2 1 3
1 4 1
5 1 6 1
6
1 2
2 2 3
2 4 2
5 2 6 2
6
1 3
2 3 3
3 4 3
5 3 6 3
...
- Then run the two stage RESP as usual.
It seems that there are some error in the code if the weights differ
from 1.0. Then the residual sum can become negative, giving NAN for the
stddev and rrms. I do not know if the results are correct.
RESP with Turbomole
- Optimise the structure with QM.
- If it is an UHF calculation, you need to have natural orbitals.
If you do not:
Insert into the control file the following keywords and rerun ridft
(dscf):
$natural orbitals
file=natural
$natural orbital
occupation file=natural
- Run makepoints to
get the points where you will calculate the electrostatic potential
(ESP).
Select Turbomole (t),
Ball (b), 3.0,
0.3,
ChelpG (c), 10000,
8 Å, and Turbomole (non-default values highlighted).
This gives the file esppoints.
Note that moloch only writes out at the most 10 000 ESP points. If you
want more than that, you need to construct several files and
concatenate the results.
Therefore, you should probably modify the distance between the points
(in green
above), until you get approximately 10 000 points.
Old version (<5.8):
- Insert the suggested rows into the control file (in the
beginning to avoid already existing keywords).
- Run moloch (RHF) or moloch2 (UHF) to get the potentials and
also the Mulliken charges.
moloch2 is stupid and does not copy the file esppoints to the new
directory. Therefore, you have to do:
moloch2
cd moloch_n_dir
cp ../esppoints .
moloch2
The calculation takes ~30 minutes and the result is in moloch_n_dir/moloch.out.
- This file can be read by changepot as detailed above.
With the new (>5.7) version of
Turbomole, some changes are needed:
- Insert in the control file
$pointval geo=point pot fmt=xyz
and then the list of coordinates from the file esppoints
- Run
ridft -proper >logm
- The results is in the file tp.xyz
How
to ensure that RESP can read more than 9999 potential points
by Matteo Guglielmi 090824
vim ${AMBERHOME}/src/antechamber/espgen.c
# 207c207
# < fprintf(fpout, "%5d%5d%5d\n", tmpint1, tmpint2, 0);
# ---
# > fprintf(fpout, "%10d%10d%10d\n", tmpint1, tmpint2, 0);
vim ${AMBERHOME}/src/resp/resp.f
# 927,928c927,928
# < read(10,'(2i5)') inat,nesp
# < WRITE(6,'(/,t2,a,i3,/,t2,a,i5,/,t2,a,i5)')
# ---
# > read(10,'(2i10)') inat,nesp
# > WRITE(6,'(/,t2,a,i3,/,t2,a,i5,/,t2,a,i10)')
vim ${AMBERHOME}/src/sander/sander.f
# 1046,1048c1046,1048
# < read (dat_unit,'(3i5)')inat,nesp,idum
# < write(6,'(t2,''inat = '',i5)')inat
# < write(6,'(t2,''nesp = '',i5)')nesp
# ---
# > read (dat_unit,'(3i10)')inat,nesp,idum
# > write(6,'(t2,''inat = '',i10)')inat
# > write(6,'(t2,''nesp = '',i10)')nesp
# 1050,1051c1050,1051
# < write(new_unit,'(2i5)')inat,nesp
# < write(minus_new_unit,'(2i5)')inat,nesp
# ---
# > write(new_unit,'(2i10)')inat,nesp
# > write(minus_new_unit,'(2i10)')inat,nesp
vim ~/bin/CHANGEPOT/changepot.f
# 216c216
# < 111 format(2i5)
# ---
# > 111 format(2i10)
... and then recompile the whole amber9 package.
References
1. CI Bayly et al, J. Phys. Chem. 97(93)10269.
2. WD Cornell et al, J. Am. Chem. Soc. 115(93)9620.