Collective Variable of Bond Disance in Metadynamics

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Kyle Kihn
Posts: 29
Joined: Mon Apr 01, 2019 8:18 am

Collective Variable of Bond Disance in Metadynamics

Post by Kyle Kihn » Fri Aug 23, 2019 9:34 am

Hi all,
I am trying to run a metadynamics simulation where the collective variable is bond length. I am trying to track a closed state of the protein which occurs when the distance between to atoms in within a given range. However when I run the attached script (abbreviated) I get the resulting plot where it appears nothing really happened. This plot looks the same when running over 100us. Thank you for the help!
Attachments
meta_dynamics_with_distance.txt
(1.45 KiB) Downloaded 12 times
metdy_plot.2.png
metdy_plot.2.png (12.61 KiB) Viewed 190 times

User avatar
Peter Eastman
Posts: 2593
Joined: Thu Aug 09, 2007 1:25 pm

Re: Collective Variable of Bond Disance in Metadynamics

Post by Peter Eastman » Fri Aug 23, 2019 9:54 am

The definitions of the custom forces are incorrect:

Code: Select all

cv1 = mm.CustomCompoundBondForce(2, '1*distance(3105, 3750)')
The arguments to distance() aren't global particle indices. They're the particles within a particular bond. Then you need to add bonds to the force.

Code: Select all

cv1 = mm.CustomCompoundBondForce(2, '1*distance(p1, p2)')
cv1.addBond([3105, 3750])
You also could do it more simply with a CustomBondForce:

Code: Select all

cv1 = mm.CustomBondForce('r')
cv1.addBond(3105, 3750)

User avatar
Kyle Kihn
Posts: 29
Joined: Mon Apr 01, 2019 8:18 am

Re: Collective Variable of Bond Disance in Metadynamics

Post by Kyle Kihn » Fri Aug 23, 2019 10:49 am

Thank you!

POST REPLY