When a list of bonds, angles and dihedrals is explicitly set in the LT files, Moltemplate generates a molecular topology that is consistent with (and restricted to) the input terms. The discrepancy that you observe originates from missing terms in the monomers and, I suspect, in the polymer topology. Take the file HBA_RU_10132023.lt:
|
Bonds |
Angles |
Dihedrals |
LT |
14 |
11 |
22 |
TopoTools |
13 |
19 |
24 |
In the polymer this difference adds up. I have defined an oligomer to help debug your system:
test01.lt
# Original force filed.
import "OPLS_HBAHNA.lt"
import "HBA_RU_10132023.lt"
import "HNA_RU_10132023.lt"
import "EndgroupH.lt"
import "EndgroupOH.lt"
poly inherits OPLSAAmod {
Endgrouper = new EndgroupH.move(.5,0,-1)
monomersHBA = new HBA_RU
monomersHNA = new HNA_RU.move(0,0,5)
Endgroupee = new EndgroupOH.move(0,0,15.5)
write('Data Bonds') {
$bond:o3_EGh @bond:o3EGh $atom:Endgrouper/h1 $atom:monomersHBA/o3
$bond:c7o8_1 @bond:c7o8 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$bond:c16_EGo @bond:c16EGo $atom:monomersHNA/c16 $atom:Endgroupee/o1
}
write("Data Angles"){
$angle:c7_o8_c9_0 @angle:90_408_406 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$angle:c21_c7_o8_0 @angle:90_90_408 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$angle:c6_c7_o8_0 @angle:90_90_408 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$angle:c7_o8_c9_11 @angle:90_408_406 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$angle:c21_c7_o8_11 @angle:90_90_408 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$angle:c6_c7_o8_11 @angle:90_90_408 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8
}
write("Data Dihedrals"){
$dihedral:c7_o8_c9_o10_0 @dihedral:90_408_406_407 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9 $atom:monomersHNA/o10
$dihedral:c6_c7_o8_c9_0 @dihedral:90_90_408_406 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$dihedral:c5_c6_c7_o8_0 @dihedral:90_90_90_408 $atom:monomersHBA/c5 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$dihedral:c21_c7_o8_c9_0 @dihedral:90_90_408_406 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$dihedral:c22_c21_c7_o8_0 @dihedral:90_90_90_408 $atom:monomersHBA/c22 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$dihedral:c7_o8_c9_o10_11 @dihedral:90_408_406_407 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9 $atom:monomersHNA/o10
$dihedral:c6_c7_o8_c9_11 @dihedral:90_90_408_406 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$dihedral:c5_c6_c7_o8_11 @dihedral:90_90_90_408 $atom:monomersHBA/c5 $atom:monomersHBA/c6 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$dihedral:c21_c7_o8_c9_11 @dihedral:90_90_408_406 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8 $atom:monomersHNA/c9
$dihedral:c22_c21_c7_o8_11 @dihedral:90_90_90_408 $atom:monomersHBA/c22 $atom:monomersHBA/c21 $atom:monomersHBA/c7 $atom:monomersHNA/o8
}
}
polymer = new poly [1]
write_once("Data Boundary") {
0 20 xlo xhi
0 20 ylo yhi
-10 20 zlo zhi
}
With your original force field definition, this is what VMD TopoTools see:
Info) Analyzing structure ...
Info) Atoms: 35
Info) Bonds: 38
Info) Angles: 31 Dihedrals: 66 Impropers: 0 Cross-terms: 0
Info) Bondtypes: 36 Angletypes: 7 Dihedraltypes: 12 Impropertypes: 0
While after regenerating angles and dihedrals:
Info) Analyzing structure ...
Info) Atoms: 35
Info) Bonds: 37
Info) Angles: 57 Dihedrals: 84 Impropers: 0 Cross-terms: 0
Info) Bondtypes: 8 Angletypes: 11 Dihedraltypes: 17 Impropertypes: 0
Info) Residues: 4
Note that in your forcefield 7 unique angle types are present, vs 11 found by TopoTools. Same story for the dihedrals, plus one extra bond defined in the monomer HBA. I have re-defined the topology of the monomers using the auto-generation of angle and dihedral terms. I have also cleaned up duplicate bond, angle, and dihedral coefficients, and defined 4 angle types that were not present in your force field. After the following, the angle count is correct:
Info) Analyzing structure ...
Info) Atoms: 35
Info) Bonds: 37
Info) Angles: 57 Dihedrals: 68 Impropers: 0 Cross-terms: 0
Info) Bondtypes: 7 Angletypes: 11 Dihedraltypes: 7 Impropertypes: 0
Info) Residues: 4
I have no reason to believe the dihedral count is buggy in Moltemplate. I leave to you to work out the 10 missing dihedral types, that should be added to the file OPLS_HBAHNA_rules.lt
. This is the oligomer with automatically generated angle and dihedral terms:
test03.lt
# Let Moltemplate guess the list of angles and dihedrals.
import "OPLS_HBAHNA_rules.lt"
import "HBA_RU_rules.lt"
import "HNA_RU_rules.lt"
import "EndgroupH.lt"
import "EndgroupOH.lt"
poly inherits OPLSAAmod {
Endgrouper = new EndgroupH.move(.5,0,-1)
monomersHBA = new HBA_RU
monomersHNA = new HNA_RU.move(0,0,5)
Endgroupee = new EndgroupOH.move(0,0,15.5)
write('Data Bond List') {
$bond:o3_EGh $atom:Endgrouper/h1 $atom:monomersHBA/o3
$bond:c7o8_1 $atom:monomersHBA/c7 $atom:monomersHNA/o8
$bond:c16_EGo $atom:monomersHNA/c16 $atom:Endgroupee/o1
}
}
polymer = new poly [1]
write_once("Data Boundary") {
0 20 xlo xhi
0 20 ylo yhi
-10 20 zlo zhi
}
and the modified files:
lt_with_rules.tgz (4.9 KB)
@akohlmey I have used the following commands to recompute the angles and dihedrals:
topo readlammpsdata test01.data full
topo clearangles
topo cleardihedrals
topo guessangles
topo guessdihedrals
topo writelammpsdata test01.data2