Re: Applying weak harmonic force between two proteins

From: Joshua Adelman (
Date: Wed May 21 2008 - 11:42:15 CDT

The alternative to using Tcl forces is to hack namd directly, which
(if you know a little c++) isn't that hard. It doesn't seem to be
published anywhere, but there is actually an example already laid out
in the source code in the file GlobalMasterMisc.C and
GlobalMasterMisc.h for applying a harmonic restraint to two atoms. It
would obviously take a little bit more work to code up the application
of a force to the COM of group of atoms, but it's pretty

This code runs would run only on the head node, but in my experience
for a simply calculation like harmonic restraints, it does not impact
the speed of the simulation unless you are running on a large number
of processors.

If you want your restraint to be keyword driven then you would also
have to modify SimParameters.* and ComputeMgr.C, and the Make.depends
and Makefile.

Hacking all of these things also assumes that you have a fast compiler
and know how to build NAMD on you machine, because you're going to
take a speed hit vs the pre-built binary otherwise.

I can send example code to anyone who is interested, and one of these
days I post a tutorial online somewhere.


On May 21, 2008, at 9:12 AM, <> <> wrote:

> Hello all,
> I am interested in setting up a dimer simulation. The simulation
> cell has two
> proteins and I am interested in studying how each protein responds
> to the
> presence of the other protein. To efficiently do this I want to
> apply a weak
> harmonic force between the center of mass of the two proteins to
> prevent them
> from flying apart. I can write a detailed Tcl force script
> (Identifying all the
> protein coordinates, calculating the center of mass, then
> calculating the force
> on each and every atom) but I am afraid that it might be very
> inefficient. Is there
> any way to do this succinctly and efficiently using NAMD's inbuilt
> commands
> and functions.
> Thank You
> G. Reddy
> Institute for Physical Science and Technology
> University of Maryland, College Park
> MD 20742
> 301-405-9307

Joshua L. Adelman
Biophysics Graduate Group Lab: 510.643.2159
218 Wellman Hall Fax: 510.642.7428
University of California, Berkeley
Berkeley, CA 94720 USA

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:49:29 CST