Page 1 of 1

mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 9:08 am
by fisiksnju
Hi, I am trying to implement a mixture Gaussian force expressed as

$\sum_{i} V_i exp(-(\phi - \phi_i)^2 / (2 * \sigma_i^2) $

where $\phi$ is a dihedral angle of 4 atoms (out of many atoms) in a protein, $\phi_i$ and $\sigma_i$ are parameters for Gaussian. Does anyone know what might be the best way to do this? I attempted to use "CustomManyParticleForce", but I am a bit confused about how I should specify those 4 atoms for dihedral angle exactly in the expression. There is a function named "addParticle()" which I am not exactly sure if that is the correct function to call. If anyone could provide an example that would be great.

Thank you!

Re: mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 10:01 am
by peastman
Is this a bonded or nonbonded force? That is, does it get applied to specific sets of four atoms that you enumerate in advance? Or does it get applied to any set of four atoms that happen to come close to each other?

Re: mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 10:10 am
by fisiksnju
It is bonded force, involving two set of 4 atoms, first set (defining first dihedral) with index (4,6,8,14) and second set (defining second dihedral) with index (6,8,14,16).

Re: mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 10:55 am
by peastman
You can use CustomTorsionForce. That does exactly what you want.

Re: mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 12:19 pm
by fisiksnju
Looks great! Does "CustomTorsionForce" support multiple torsions? I found that there is an example in the documentation:

Code: Select all

CustomTorsionForce* force = new CustomTorsionForce("0.5*k*(theta-theta0)^2");
I am wondering if it is possible to define two theta's and define following expression:

Code: Select all

CustomTorsionForce* force = new CustomTorsionForce("exp(-0.5*k*(theta1-theta10)^2-0.5*k*(theta2-theta20)^2)");
where theta1 and theta2 are two torsions (each defined by 4 atoms), and theta10, theta20 are potential centers?

Re: mixture Gaussian force with custom force

Posted: Tue Nov 26, 2019 2:53 pm
by peastman
You can have as many torsions as you want. Just call addTorsion() for each one. If you make theta0 a per-torsion parameter, it can have a different value for each one.

Re: mixture Gaussian force with custom force

Posted: Mon Dec 02, 2019 9:28 am
by fisiksnju
I will take a look, thanks for your help!