From: Erik Nordgren (nordgren_at_sas.upenn.edu)
Date: Wed Nov 24 2010 - 20:55:06 CST

Hi folks,

At first I thought I'd found a bug in VMD (or more specifically, in it's
PSFGEN plugin)... but I now see it's merely an obscure implementation
detail... anyway, this may be obvious to some of you already, but since I
found it surprising I thought I'd share.

Basically, I used to think that PSFGEN's "regenerate angles" and "regenerate
dihedrals" commands were independent, and each based only upon the bonding
topology of the molecular system. However, it turns out that if you build a
system and then issue the commands:
regenerate angles
regenerate dihedrals
you will get, in general, a different (larger) result for the number of
dihedrals than if you say:
regenerate dihedrals
regenerate angles
(i.e., with the commands in the opposite order).

Technically, this is documented... quoting from the "regenerate" command
entry in the PSFGEN section of the (NAMD) user's guide:
Arguments: angles: Enable generation of angles from bonds. dihedrals: *Enable
generation of dihedrals from angles.*

In other words, if you regenerate the dihedrals BEFORE the angles, then some
angles won't be created yet, meaning that some dihedrals (which apparently
are defined in terms of angles) won't be created. Fair enough... although
it might be nice if the user guide made this fact a bit more obvious!

Hoping to save someone else the debugging headaches I just went through...
:)

-Erik

-- 
C. Erik Nordgren, Ph.D.
Chemistry Department
University of Pennsylvania