Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
0993868a
Unverified
Commit
0993868a
authored
Nov 11, 2021
by
Peter Eastman
Committed by
GitHub
Nov 11, 2021
Browse files
NBFIX is applied correctly to 1-4 interactions (#3324)
parent
892839b8
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6043 additions
and
2 deletions
+6043
-2
wrappers/python/openmm/app/charmmpsffile.py
wrappers/python/openmm/app/charmmpsffile.py
+7
-2
wrappers/python/tests/TestCharmmFiles.py
wrappers/python/tests/TestCharmmFiles.py
+24
-0
wrappers/python/tests/systems/chl1.crd
wrappers/python/tests/systems/chl1.crd
+79
-0
wrappers/python/tests/systems/chl1.psf
wrappers/python/tests/systems/chl1.psf
+341
-0
wrappers/python/tests/systems/par_all36_lipid.prm
wrappers/python/tests/systems/par_all36_lipid.prm
+532
-0
wrappers/python/tests/systems/toppar_all36_lipid_cholesterol.str
...s/python/tests/systems/toppar_all36_lipid_cholesterol.str
+5060
-0
No files found.
wrappers/python/openmm/app/charmmpsffile.py
View file @
0993868a
...
@@ -1387,6 +1387,11 @@ class CharmmPsfFile(object):
...
@@ -1387,6 +1387,11 @@ class CharmmPsfFile(object):
atom1
=
self
.
atom_list
[
ia1
]
atom1
=
self
.
atom_list
[
ia1
]
atom4
=
self
.
atom_list
[
ia4
]
atom4
=
self
.
atom_list
[
ia4
]
charge_prod
=
(
atom1
.
charge
*
atom4
.
charge
)
*
params
.
e14fac
charge_prod
=
(
atom1
.
charge
*
atom4
.
charge
)
*
params
.
e14fac
try
:
rij
,
wdij
,
rij14
,
wdij14
=
atom1
.
type
.
nbfix
[
atom4
.
type
.
name
]
epsilon
=
wdij14
*
ene_conv
sigma
=
rij14
*
length_conv
*
sigma_scale
except
KeyError
:
epsilon
=
sqrt
(
abs
(
atom1
.
type
.
epsilon_14
*
atom4
.
type
.
epsilon_14
))
*
ene_conv
epsilon
=
sqrt
(
abs
(
atom1
.
type
.
epsilon_14
*
atom4
.
type
.
epsilon_14
))
*
ene_conv
sigma
=
(
atom1
.
type
.
rmin_14
+
atom4
.
type
.
rmin_14
)
*
(
length_conv
*
sigma_scale
)
sigma
=
(
atom1
.
type
.
rmin_14
+
atom4
.
type
.
rmin_14
)
*
(
length_conv
*
sigma_scale
)
force
.
addException
(
ia1
,
ia4
,
charge_prod
,
sigma
,
epsilon
)
force
.
addException
(
ia1
,
ia4
,
charge_prod
,
sigma
,
epsilon
)
...
...
wrappers/python/tests/TestCharmmFiles.py
View file @
0993868a
...
@@ -150,6 +150,30 @@ class TestCharmmFiles(unittest.TestCase):
...
@@ -150,6 +150,30 @@ class TestCharmmFiles(unittest.TestCase):
ene
=
state
.
getPotentialEnergy
().
value_in_unit
(
kilocalories_per_mole
)
ene
=
state
.
getPotentialEnergy
().
value_in_unit
(
kilocalories_per_mole
)
self
.
assertAlmostEqual
(
ene
,
15559.71602
,
delta
=
0.05
)
self
.
assertAlmostEqual
(
ene
,
15559.71602
,
delta
=
0.05
)
def
test_NBFIX14
(
self
):
"""Tests CHARMM systems with NBFIX modifications to 1-4 interactions"""
warnings
.
filterwarnings
(
'ignore'
,
category
=
CharmmPSFWarning
)
psf
=
CharmmPsfFile
(
'systems/chl1.psf'
)
crd
=
CharmmCrdFile
(
'systems/chl1.crd'
)
params
=
CharmmParameterSet
(
'systems/par_all36_lipid.prm'
,
'systems/par_all36_cgenff.prm'
,
'systems/toppar_all36_lipid_cholesterol.str'
)
# Turn off charges so we only test the Lennard-Jones energies
for
a
in
psf
.
atom_list
:
a
.
charge
=
0.0
# Compute the Lennard-Jones energy
system
=
psf
.
createSystem
(
params
,
nonbondedMethod
=
CutoffNonPeriodic
,
nonbondedCutoff
=
12
*
angstroms
)
for
i
,
f
in
enumerate
(
system
.
getForces
()):
if
isinstance
(
f
,
NonbondedForce
)
or
isinstance
(
f
,
CustomNonbondedForce
):
f
.
setForceGroup
(
1
)
else
:
f
.
setForceGroup
(
0
)
context
=
Context
(
system
,
VerletIntegrator
(
2
*
femtoseconds
),
Platform
.
getPlatformByName
(
'Reference'
))
context
.
setPositions
(
crd
.
positions
)
state
=
context
.
getState
(
getEnergy
=
True
,
groups
=
{
1
})
energy
=
state
.
getPotentialEnergy
().
value_in_unit
(
kilocalories_per_mole
)
self
.
assertAlmostEqual
(
energy
,
3.1166
,
delta
=
1e-4
)
def
test_NBThole
(
self
):
def
test_NBThole
(
self
):
"""Tests CHARMM system with NBTHole"""
"""Tests CHARMM system with NBTHole"""
warnings
.
filterwarnings
(
'ignore'
,
category
=
CharmmPSFWarning
)
warnings
.
filterwarnings
(
'ignore'
,
category
=
CharmmPSFWarning
)
...
...
wrappers/python/tests/systems/chl1.crd
0 → 100644
View file @
0993868a
* GENERATED BY CHARMM-GUI (HTTP://WWW.CHARMM-GUI.ORG) V2.0 ON APR, 20. 2017. JOB
* GET A DIFFERENT CONFORMATION FOR LIPIDS PENETRATING PROTEIN / CHOL
* DATE: 9/22/21 15:13: 3 CREATED BY USER: jlee
*
74 EXT
1 1 CHL1 C3 2.0758430000 1.4287490000 -0.0024380000 CHL1 1 0.0000000000
2 1 CHL1 H3 1.7789920000 1.9075100000 -0.9655430000 CHL1 1 0.0000000000
3 1 CHL1 O3 3.4901020000 1.4114150000 0.0741910000 CHL1 1 0.0000000000
4 1 CHL1 H3' 3.6956580000 0.9624930000 0.8967140000 CHL1 1 0.0000000000
5 1 CHL1 C4 1.5114820000 2.2413810000 1.1750860000 CHL1 1 0.0000000000
6 1 CHL1 H4A 1.9148670000 3.2768030000 1.0908510000 CHL1 1 0.0000000000
7 1 CHL1 H4B 1.9116520000 1.8253500000 2.1234900000 CHL1 1 0.0000000000
8 1 CHL1 C5 -0.0042430000 2.2232410000 1.2047520000 CHL1 1 0.0000000000
9 1 CHL1 C6 -0.7185500000 3.3605640000 1.1867230000 CHL1 1 0.0000000000
10 1 CHL1 H6 -0.1961740000 4.3287470000 1.1811170000 CHL1 1 0.0000000000
11 1 CHL1 C7 -2.2182720000 3.4093590000 1.2529030000 CHL1 1 0.0000000000
12 1 CHL1 H7A -2.6174250000 3.6976270000 0.2559360000 CHL1 1 0.0000000000
13 1 CHL1 H7B -2.5510300000 4.1816550000 1.9801080000 CHL1 1 0.0000000000
14 1 CHL1 C8 -2.8493790000 2.0493740000 1.6586470000 CHL1 1 0.0000000000
15 1 CHL1 H8 -2.6976970000 1.9177710000 2.7522240000 CHL1 1 0.0000000000
16 1 CHL1 C14 -4.3402020000 2.0530670000 1.3479140000 CHL1 1 0.0000000000
17 1 CHL1 H14 -4.4174730000 2.1586370000 0.2344860000 CHL1 1 0.0000000000
18 1 CHL1 C15 -5.1864690000 3.2052640000 1.9147900000 CHL1 1 0.0000000000
19 1 CHL1 H15A -5.0243010000 4.1528850000 1.3633690000 CHL1 1 0.0000000000
20 1 CHL1 H15B -4.9339520000 3.3605530000 2.9859010000 CHL1 1 0.0000000000
21 1 CHL1 C16 -6.6269070000 2.6905440000 1.7787000000 CHL1 1 0.0000000000
22 1 CHL1 H16A -7.1958500000 3.2680330000 1.0215770000 CHL1 1 0.0000000000
23 1 CHL1 H16B -7.1376360000 2.7834600000 2.7609420000 CHL1 1 0.0000000000
24 1 CHL1 C17 -6.5372270000 1.1878570000 1.3493380000 CHL1 1 0.0000000000
25 1 CHL1 H17 -6.6019490000 1.1763380000 0.2350740000 CHL1 1 0.0000000000
26 1 CHL1 C13 -5.0880620000 0.7643510000 1.6898470000 CHL1 1 0.0000000000
27 1 CHL1 C18 -5.0064860000 0.4701080000 3.2112890000 CHL1 1 0.0000000000
28 1 CHL1 H18A -5.4771980000 1.2760610000 3.8078890000 CHL1 1 0.0000000000
29 1 CHL1 H18B -3.9571470000 0.3656950000 3.5470390000 CHL1 1 0.0000000000
30 1 CHL1 H18C -5.5253140000 -0.4812360000 3.4456420000 CHL1 1 0.0000000000
31 1 CHL1 C12 -4.4501040000 -0.3574190000 0.8429720000 CHL1 1 0.0000000000
32 1 CHL1 H12A -4.6174580000 -0.1329160000 -0.2328530000 CHL1 1 0.0000000000
33 1 CHL1 H12B -4.9071470000 -1.3405780000 1.0619880000 CHL1 1 0.0000000000
34 1 CHL1 C11 -2.9326770000 -0.4609040000 1.1008090000 CHL1 1 0.0000000000
35 1 CHL1 H11A -2.5100440000 -1.2251340000 0.4155920000 CHL1 1 0.0000000000
36 1 CHL1 H11B -2.8003630000 -0.8324760000 2.1373400000 CHL1 1 0.0000000000
37 1 CHL1 C9 -2.1768110000 0.8895300000 0.9143010000 CHL1 1 0.0000000000
38 1 CHL1 H9 -2.2977970000 1.1402610000 -0.1695780000 CHL1 1 0.0000000000
39 1 CHL1 C10 -0.6446230000 0.8183080000 1.1682710000 CHL1 1 0.0000000000
40 1 CHL1 C19 -0.3877040000 0.1475000000 2.5441910000 CHL1 1 0.0000000000
41 1 CHL1 H19A -0.9335740000 0.6777980000 3.3513270000 CHL1 1 0.0000000000
42 1 CHL1 H19B 0.6897940000 0.1400840000 2.8025550000 CHL1 1 0.0000000000
43 1 CHL1 H19C -0.7162580000 -0.9108240000 2.5315180000 CHL1 1 0.0000000000
44 1 CHL1 C1 0.0140190000 -0.0227780000 0.0327100000 CHL1 1 0.0000000000
45 1 CHL1 H1A -0.3316670000 0.3767310000 -0.9472730000 CHL1 1 0.0000000000
46 1 CHL1 H1B -0.3334130000 -1.0747520000 0.1067690000 CHL1 1 0.0000000000
47 1 CHL1 C2 1.5521950000 -0.0100270000 0.0330650000 CHL1 1 0.0000000000
48 1 CHL1 H2A 1.9243040000 -0.5230830000 0.9458070000 CHL1 1 0.0000000000
49 1 CHL1 H2B 1.9346080000 -0.5653680000 -0.8513700000 CHL1 1 0.0000000000
50 1 CHL1 C20 -7.7246780000 0.3593490000 1.8737490000 CHL1 1 0.0000000000
51 1 CHL1 H20 -7.7090080000 0.3716970000 2.9880740000 CHL1 1 0.0000000000
52 1 CHL1 C21 -7.6153060000 -1.1076400000 1.4054310000 CHL1 1 0.0000000000
53 1 CHL1 H21A -6.7567890000 -1.6098270000 1.8911100000 CHL1 1 0.0000000000
54 1 CHL1 H21B -7.4954750000 -1.1568730000 0.3031920000 CHL1 1 0.0000000000
55 1 CHL1 H21C -8.5172290000 -1.6860490000 1.6875930000 CHL1 1 0.0000000000
56 1 CHL1 C22 -9.0849100000 0.9697470000 1.4326760000 CHL1 1 0.0000000000
57 1 CHL1 H22A -9.1561990000 0.9304830000 0.3238230000 CHL1 1 0.0000000000
58 1 CHL1 H22B -9.1287420000 2.0387760000 1.7346150000 CHL1 1 0.0000000000
59 1 CHL1 C23 -10.3258450000 0.2922230000 2.0422060000 CHL1 1 0.0000000000
60 1 CHL1 H23A -10.2114010000 0.2526360000 3.1483210000 CHL1 1 0.0000000000
61 1 CHL1 H23B -10.4034320000 -0.7498490000 1.6668930000 CHL1 1 0.0000000000
62 1 CHL1 C24 -11.6240990000 1.0427750000 1.7005560000 CHL1 1 0.0000000000
63 1 CHL1 H24A -11.7579260000 1.0650290000 0.5968610000 CHL1 1 0.0000000000
64 1 CHL1 H24B -11.5215770000 2.0951660000 2.0485660000 CHL1 1 0.0000000000
65 1 CHL1 C25 -12.8929290000 0.4444570000 2.3453720000 CHL1 1 0.0000000000
66 1 CHL1 H25 -12.7160890000 0.3730380000 3.4453480000 CHL1 1 0.0000000000
67 1 CHL1 C26 -14.0995530000 1.3709480000 2.1214960000 CHL1 1 0.0000000000
68 1 CHL1 H26A -14.3073370000 1.4755350000 1.0355250000 CHL1 1 0.0000000000
69 1 CHL1 H26B -13.8988040000 2.3788300000 2.5421330000 CHL1 1 0.0000000000
70 1 CHL1 H26C -15.0033380000 0.9555930000 2.6153310000 CHL1 1 0.0000000000
71 1 CHL1 C27 -13.2063260000 -0.9657240000 1.8173800000 CHL1 1 0.0000000000
72 1 CHL1 H27A -12.3832270000 -1.6705450000 2.0552520000 CHL1 1 0.0000000000
73 1 CHL1 H27B -13.3457700000 -0.9412980000 0.7159300000 CHL1 1 0.0000000000
74 1 CHL1 H27C -14.1385570000 -1.3514600000 2.2815630000 CHL1 1 0.0000000000
wrappers/python/tests/systems/chl1.psf
0 → 100644
View file @
0993868a
This diff is collapsed.
Click to expand it.
wrappers/python/tests/systems/par_all36_lipid.prm
0 → 100644
View file @
0993868a
This diff is collapsed.
Click to expand it.
wrappers/python/tests/systems/toppar_all36_lipid_cholesterol.str
0 → 100644
View file @
0993868a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment