Skip to content

Commit 5a17d31

Browse files
committed
ML/MM with GROMACS and Metatomic
1 parent 07c8a57 commit 5a17d31

File tree

11 files changed

+7216
-1
lines changed

11 files changed

+7216
-1
lines changed

docs/src/software/gromacs.sec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ comprehensive suite for MD workflows. Its open-source nature and active communit
1515
continuous development and support.
1616

1717
- examples/water-pulsed/water-pulsed
18+
- examples/ml-mm/ml-mm

docs/src/topics/ml-models.sec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ data.
1818
- examples/flashmd/flashmd-demo
1919
- examples/shiftml/shiftml-example
2020
- examples/hamiltonian-qm7/hamiltonian-qm7
21+
- examples/ml-mm/ml-mm

docs/src/topics/universal.sec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ structural space.
1111
- examples/pet-mad-uq/pet-mad-uq
1212
- examples/flashmd/flashmd-demo
1313
- examples/eon-pet-neb/eon-pet-neb
14+
- examples/ml-mm/ml-mm

examples/ml-mm/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#*
2+
*.cpt
3+
*.edr
4+
*.lock
5+
*.log
6+
*.npz
7+
*.pt
8+
*.trr
9+
*.tpr
10+
confout.gro
11+
mdout.mdp

examples/ml-mm/README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ML-MM Simulations with GROMACS and Metatomic
2+
============================================
3+
4+
Simulate alanine dipeptide in water using a machine learning potential for the
5+
solute (ML-MM simulation) with GROMACS and the Metatomic interface.

examples/ml-mm/data/conf.gro

Lines changed: 6790 additions & 0 deletions
Large diffs are not rendered by default.

examples/ml-mm/data/topol.top

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
; Include forcefield parameters
2+
#include "amber99sb.ff/forcefield.itp"
3+
4+
[ moleculetype ]
5+
; Name nrexcl
6+
Protein_chain_A 3
7+
8+
[ atoms ]
9+
; nr type resnr residue atom cgnr charge mass typeB chargeB massB
10+
; residue 1 ACE rtp ACE q 0.0
11+
1 HC 1 ACE HH31 1 0.1123 1.008
12+
2 CT 1 ACE CH3 2 -0.3662 12.01
13+
3 HC 1 ACE HH32 3 0.1123 1.008
14+
4 HC 1 ACE HH33 4 0.1123 1.008
15+
5 C 1 ACE C 5 0.5972 12.01
16+
6 O 1 ACE O 6 -0.5679 16 ; qtot 0
17+
; residue 2 ALA rtp ALA q 0.0
18+
7 N 2 ALA N 7 -0.4157 14.01
19+
8 H 2 ALA H 8 0.2719 1.008
20+
9 CT 2 ALA CA 9 0.0337 12.01
21+
10 H1 2 ALA HA 10 0.0823 1.008
22+
11 CT 2 ALA CB 11 -0.1825 12.01
23+
12 HC 2 ALA HB1 12 0.0603 1.008
24+
13 HC 2 ALA HB2 13 0.0603 1.008
25+
14 HC 2 ALA HB3 14 0.0603 1.008
26+
15 C 2 ALA C 15 0.5973 12.01
27+
16 O 2 ALA O 16 -0.5679 16 ; qtot 0
28+
; residue 3 NME rtp NME q 0.0
29+
17 N 3 NME N 17 -0.4157 14.01
30+
18 H 3 NME H 18 0.2719 1.008
31+
19 CT 3 NME CH3 19 -0.149 12.01
32+
20 H1 3 NME HH31 20 0.0976 1.008
33+
21 H1 3 NME HH32 21 0.0976 1.008
34+
22 H1 3 NME HH33 22 0.0976 1.008 ; qtot 0
35+
36+
[ bonds ]
37+
; ai aj funct c0 c1 c2 c3
38+
1 2 1
39+
2 3 1
40+
2 4 1
41+
2 5 1
42+
5 6 1
43+
5 7 1
44+
7 8 1
45+
7 9 1
46+
9 10 1
47+
9 11 1
48+
9 15 1
49+
11 12 1
50+
11 13 1
51+
11 14 1
52+
15 16 1
53+
15 17 1
54+
17 18 1
55+
17 19 1
56+
19 20 1
57+
19 21 1
58+
19 22 1
59+
60+
[ pairs ]
61+
; ai aj funct c0 c1 c2 c3
62+
1 6 1
63+
1 7 1
64+
2 8 1
65+
2 9 1
66+
3 6 1
67+
3 7 1
68+
4 6 1
69+
4 7 1
70+
5 10 1
71+
5 11 1
72+
5 15 1
73+
6 8 1
74+
6 9 1
75+
7 12 1
76+
7 13 1
77+
7 14 1
78+
7 16 1
79+
7 17 1
80+
8 10 1
81+
8 11 1
82+
8 15 1
83+
9 18 1
84+
9 19 1
85+
10 12 1
86+
10 13 1
87+
10 14 1
88+
10 16 1
89+
10 17 1
90+
11 16 1
91+
11 17 1
92+
12 15 1
93+
13 15 1
94+
14 15 1
95+
15 20 1
96+
15 21 1
97+
15 22 1
98+
16 18 1
99+
16 19 1
100+
18 20 1
101+
18 21 1
102+
18 22 1
103+
104+
[ angles ]
105+
; ai aj ak funct c0 c1 c2 c3
106+
1 2 3 1
107+
1 2 4 1
108+
1 2 5 1
109+
3 2 4 1
110+
3 2 5 1
111+
4 2 5 1
112+
2 5 6 1
113+
2 5 7 1
114+
6 5 7 1
115+
5 7 8 1
116+
5 7 9 1
117+
8 7 9 1
118+
7 9 10 1
119+
7 9 11 1
120+
7 9 15 1
121+
10 9 11 1
122+
10 9 15 1
123+
11 9 15 1
124+
9 11 12 1
125+
9 11 13 1
126+
9 11 14 1
127+
12 11 13 1
128+
12 11 14 1
129+
13 11 14 1
130+
9 15 16 1
131+
9 15 17 1
132+
16 15 17 1
133+
15 17 18 1
134+
15 17 19 1
135+
18 17 19 1
136+
17 19 20 1
137+
17 19 21 1
138+
17 19 22 1
139+
20 19 21 1
140+
20 19 22 1
141+
21 19 22 1
142+
143+
[ dihedrals ]
144+
; ai aj ak al funct c0 c1 c2 c3 c4 c5
145+
1 2 5 6 9
146+
1 2 5 7 9
147+
3 2 5 6 9
148+
3 2 5 7 9
149+
4 2 5 6 9
150+
4 2 5 7 9
151+
2 5 7 8 9
152+
2 5 7 9 9
153+
6 5 7 8 9
154+
6 5 7 9 9
155+
5 7 9 10 9
156+
5 7 9 11 9
157+
5 7 9 15 9
158+
8 7 9 10 9
159+
8 7 9 11 9
160+
8 7 9 15 9
161+
7 9 11 12 9
162+
7 9 11 13 9
163+
7 9 11 14 9
164+
10 9 11 12 9
165+
10 9 11 13 9
166+
10 9 11 14 9
167+
15 9 11 12 9
168+
15 9 11 13 9
169+
15 9 11 14 9
170+
7 9 15 16 9
171+
7 9 15 17 9
172+
10 9 15 16 9
173+
10 9 15 17 9
174+
11 9 15 16 9
175+
11 9 15 17 9
176+
9 15 17 18 9
177+
9 15 17 19 9
178+
16 15 17 18 9
179+
16 15 17 19 9
180+
15 17 19 20 9
181+
15 17 19 21 9
182+
15 17 19 22 9
183+
18 17 19 20 9
184+
18 17 19 21 9
185+
18 17 19 22 9
186+
187+
[ dihedrals ]
188+
; ai aj ak al funct c0 c1 c2 c3
189+
2 7 5 6 4
190+
5 9 7 8 4
191+
9 17 15 16 4
192+
15 19 17 18 4
193+
194+
; Include Position restraint file
195+
#ifdef POSRES
196+
#include "posre.itp"
197+
#endif
198+
199+
; Include water topology
200+
#include "amber99sb.ff/tip3p.itp"
201+
202+
#ifdef POSRES_WATER
203+
; Position restraint for each water oxygen
204+
[ position_restraints ]
205+
; i funct fcx fcy fcz
206+
1 1 1000 1000 1000
207+
#endif
208+
209+
; Include topology for ions
210+
#include "amber99sb.ff/ions.itp"
211+
212+
[ system ]
213+
; Name
214+
Alanine dipeptide in water
215+
216+
[ molecules ]
217+
; Compound #mols
218+
Protein_chain_A 1
219+
SOL 2255

examples/ml-mm/environment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- chemiscope
5+
- gromacs
6+
- mdanalysis
7+
- metatrain
8+
- python=3.12

examples/ml-mm/grompp.mdp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
; Run control
2+
integrator = md
3+
dt = 0.0005
4+
nsteps = 500
5+
6+
; Output control
7+
nstxout = 10
8+
nstvout = 10
9+
nstenergy = 10
10+
nstcalcenergy = 10
11+
nstlog = 10
12+
13+
; Neighborsearching
14+
cutoff-scheme = Verlet
15+
pbc = xyz
16+
17+
; Electrostatics
18+
coulombtype = PME
19+
20+
; Temperature coupling
21+
tcoupl = v-rescale
22+
tc-grps = water protein ; two coupling groups - more accurate
23+
tau-t = 2.0 2.0 ; time constant, in ps
24+
ref-t = 300 300
25+
26+
; Metatomic interface
27+
; metatomic-active = yes
28+
; metatomic-input-group = protein ; the group on which ML forces are applied
29+
; metatomic-modelfile = pet-mad-v1.0.2.pt ; path to the ML model file
30+
; metatomic-device = cpu ; device to run the ML model on (cpu or cuda)

0 commit comments

Comments
 (0)