From: Chandra Ramananjara (
Date: Wed Jun 21 2006 - 21:17:13 CDT

Hi Peter,
Thanks a lot for the tcl script. It worked even on the PDB files with the CRYST header.


Peter Freddolino <> wrote: Hi Chandra,
I can reproduce the crash with your file. It looks like an odd
interaction between the dcd writers of vmd and namd actually. I'll have
a look at it with the devs tomorrow. In the meantime, I'm attaching a
patched version of namdenergy that should work around this problem;
please just source it before you open the namdenergy gui.

Chandra Ramananjara wrote:
> Hi Peter,
> Thanks for your email. The version of VMD that I'm using is VMD for
> Linux, version 1.8.4b6 (December 22, 2005).
> Thanks, attached to this email is the psf/pdb combo in which the pdb
> file has the CRYST header, I tried namdenergy on this combo just now
> and I'm still getting the null results. The pdb file was created using
> the writepdb command (in VMD) to save the coordinates of a particular
> frame (frame 78) of the trajectory.
> Yes you're right, if namdenergy is run on a loaded dcd file, it will
> loop over the trajectory, and the selected atoms of interest (whose
> interaction energies are to be calcuated) will be updated in each
> frame. My case is different. In each frame, the atoms of interest
> (whose interaction energies I want to calculate) are different from
> frame to frame so its not as straightforward as using just one
> selection of atoms for all frames. I think the example script I posted
> in my last email must have confused you, because the atoms of interest
> were all oxygens. I just did this to simplify the script.
> In the actual script I'm writing, the selection of the atoms of
> interest (whose interaction energy I want to calculate) is more
> complicated and the atoms of interest vary from frame to frame so
> using one selection text (e.g. [atomselect top "name C"]) for all
> frames in the trajectory is not an option.
> Do you think it might be my version of VMD ? I think the version I'm
> using (1.8.4b6) is a relatively new version. The pdb/psf combo I'm
> having problems with are attached to the email. Thanks.
> -Chandra
> */Peter Freddolino
/* wrote:
> Hi Chandra,
> a couple things here... could you let us know what version of VMD
> you're
> using, and on what platform?
> Namdenergy uses NAMD itself for the actual energy calculations so it
> seems very odd that changing the CRYST header causes a problem
> (indeed,
> I have used it many times in cases where it hasn't caused a problem,
> hence my confusion--in fact, it just worked ok for me now).
> Perhaps you
> could send me one of the pdb/psf combos that fails?
> Also, just for your information, if you run namdenergy on a loaded
> dcd
> it will automatically loop over the trajectory; there's no need to
> run
> each frame separately.
> Peter
> Chandra Ramananjara wrote:
> > Hi all,
> > I am observing a strange error in namdenergy. I am using the
> > text-based version of namdenergy in VMD (in text mode) which can be
> > called using the command 'package require namdenergy'.
> > Here is the problem. I have a dcd file and I want to step
> through each
> > frame and calculate energies for interactions between various
> atoms.
> > So, for each frame of the dcd file, I select all the atoms and
> write
> > them to a pdb file (called temp.pdb) and then load the pdb file
> (along
> > with a general psf file) so I can run namdenergy on the atoms in
> that
> > PDB file. So, for example, the script for looping through 1000 dcd
> > frames is something like this:
> >
> > for { set i 0 } { $i < 1000 } { incr i 1 } {
> >
> > molinfo top set frame $i
> > set all [atomselect top all]
> > $all writepdb TEMP.pdb
> > mol load psf base.psf pdb TEMP.pdb
> > set group [atomselect top "name O"]
> > namdenergy -nonb -sel $group -par param.inp
> >
> > }
> >
> > The problem I encounter is that the results I get from
> namdenergy are
> > always 0 (obviously wrong).
> > But when I open the TEMP.pdb file (generated in VMD using
> writepdb) I
> > notice the first line in the PDB file is something like: "CRYST1
> 24 24
> > 24 90.0 90.0 90.0". This line is the first line in every PDB file
> > generated using VMD's writepdb command. It specifies the unit cell
> > length and angles.
> > I notice that if I delete this line, reload the PDB file into
> VMD and
> > re-run namdenergy, I get the right answer for the energy. It
> seems the
> > namdenergy program cannot recognize PDB files with the "CRYST1...."
> > header.
> > Unfortunately, all PDB files generated using the writepdb
> command in
> > VMD have this header. As I mentioned, manually deleting this header
> > allows namdenergy to recognize the PDB file and gives right
> answers.
> > But since I want everything to be automated, programmatically
> (using
> > Tcl file commands) deleting the header of every generated PDB file
> > would use up valuable computational time. Is there any workaround ?
> > And does anybody have any idea why namdenergy refuses to
> recognize PDB
> > files with the "CRYST1...." header ?
> >
> > Thanks,
> > Chandra
> >
> >
> ------------------------------------------------------------------------
> > Do you Yahoo!?
> > Get on board. You're invited
> >
> > to try the new Yahoo! Mail Beta.
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around