Here, we describe a VMD extension called AutoIMD (where
IMD stands for Interactive Molecular Dynamics). The purpose of
this tool is to automatically setup a NAMD simulation that can be
visualized in real-time in VMD. AutoIMD takes care of generating
all the necessary files (PDB/PSF/NAMD conf.) and of launching and
connecting to a NAMD simulation. Once you have connected VMD to a
running simulation, you can see your molecule's motion as it is
1. In VMD and in the nanotubes working directory, load
the files imdnanotube.psf and imdnanotube.pdb into a new
2. Create a new representation for the molecule in VMD. Select
only atoms of the nanotube for the new representation by typing carbon into the atom selection window. Choose the Charge
Coloring Method. This will display different charges using different
To get started with AutoIMD, follow these steps:
3. Open the AutoIMD window through the VMD Extensions Simulation AutoIMD menu item.
4. In the AutoIMD window, select the Settings Simulation Parameters... menu item. A new
window should pop up (Fig. 3). In this new
window, completely erase the contents of the text input field named
CHARMM Params, and then click on the Add...
button. You will now need to locate the CHARMM parameter file called
par_nanotubes.inp in the nanotubes working directory
and click on Open. When you have specified the right
parameter file, you can dismiss the Simulation Parameters window
(by clicking on its close box).
AutoIMD allows you to specify a region of your molecule that you wish to simulate. To do this, it separates the molecule into three regions: a molten region, a fixed region and an excluded region. The molten region is the one that will be moving in the simulation. To hold the molten region in place, AutoIMD finds all the atoms that surround it (this is the fixed region) and uses them as unmoving constraints for the molten region. Atoms that are very far from the molten region are not simulated in order to make the simulation faster; they constitute the excluded region.
5. In the AutoIMD window, in the molten selection text input box, enter same residue as water and
(x*x + y*y < 16) . This corresponds to the cylinder of water of radius 4 Å that we wish to simulate. The other atoms will become part of the ``fixed" region.
6. Then, choose Local from the next menu in the
window. This will make the simulation run on your local
machine. After these steps, your AutoIMD window should look like
7. Now, click on Submit. This should create and launch
a NAMD simulation on your machine. You should now see a second
molecule called AutoIMD Simulation, which will be used to
connect to the running simulation.
NOTE: If AutoIMD asks to create a directory called autoimd in your home directory, answer Yes.
NOTE: If you get an error message saying ``Unable to
open psf file imdnanotube.psf.", you need to reload your PSF file
on top of your current molecule one more time and click Submit again.
8. Finally, click on the Connect button to start
displaying your simulation. After 100 steps of minimization, the
water molecules in your VMD graphics window will begin to
move. There will be a time counter in the AutoIMD window's status
line indicating the minimization steps, and later, the simulation
time (in ps).
NOTE: It might take a few seconds for the NAMD
simulation to get started. During this time, VMD will not be able
to connect and you will see some error messages of the type: Error connecting to localhost on port 2314. This is perfectly
normal, and these errors can be ignored. VMD will connect as soon
as NAMD is ready.
9. When you are done (after, say, 10 ps or more), click on the
Discard button. This will halt the simulation and bring
you back to the molecule as it was before you started AutoIMD. If
you had clicked on Finish instead, the final coordinates
of the simulation would have been saved into your
initial molecule (overwriting the old coordinates).
10. If you want to run a new simulation with different initial
coordinates or modified parameters (or simply to re-run your old
simulation) you would now only need to repeat steps 8 to 10
(i.e., click on Submit, Connect and
In certain rare cases, when running locally, you might
get a stray simulation running on your machine that hasn't been
properly killed. To kill all namd2 processes on your machine, just
type pkill namd2, either in a Terminal or in TkCon. Do not
perform this while a simulation is running, as it will get