Adding custom bias potential

GROMACS version: Any
GROMACS modification: Yes/No

I am trying to add a bias potential to a protein. I am aware of PLUMED, but after tinkering with it for awhile it seems to be somewhat difficult to define functions of many degrees of freedom (ie; lack of matrix operations and arrays make it difficult to define, say, a multivariate gaussian bias as a function of all bonds and angles, with a vector of means and precision matrix). I could very well be wrong, but it’s not clear to me from PLUMED’s documentation.

Does anyone know if gromacs has any builtin tools to add such a bias, or if not what the best addon to do this might be?

A function of all bonds and angles sounds complicated. Now GROMACS also supports colvars, maybe that can do something for you.

This webpage contains the documentation for all Colvars features currently supported as builtin features for GROMACS 2024.

One that may be relevant is the ability to combine multiple variables into one as a linear combination or as a path variable in collective variable space.

@jhall4 hope that helps, and if not can you please provide more detail?

Giacomo

CC: @Hub @jhenin

I can also add that the GROMACS pull code now supports mathematical transformations from user strings on arbitrary combinations of pull coordinates. So theoretically the pull code can do everything. In practice this can become very tedious and slow when matrix operations are involved. Someone in my unit has modified the transformation pull coordinate code to handle large matrices, including GPU acceleration. I don’t know if that could help you.

1 Like

Thank you both for the advice. I’ll be taking a close look at the pull code and colvars support. I’ve also gotten some pointers elsewhere on how I might modify the PLUMED source code to suit my needs. I’m not sure what the easiest path forward is, but I’ll be experimenting with a few approaches.

In the meantime I am using PLUMED’s metadynamics with a very large PACE parameter (to prevent addition of more gaussians) and “restarting” from a prebuilt HILLS file to create a constant bias as a sum of gaussians, but I am limited to diagonal covariances in this way. This isn’t quite ideal but it is good enough for me for now.