VMD and NAMD are two closely linked molecular dynamics tools from the UIUC Computational Biophysics Group. As you can probably guess from the ‘Biophysics’ header, the emphasis for this suite is on large-scale macromolecular clusters such as proteins or even lipid bilayers, meaning CHARMM and force field models are the order of the day.
Despite the emphasis on biochemistry, there is an interesting tutorial on simulating water permeation through carbon nanotubes. When I stumbled across that tutorial on the same day I saw a post about desalinization using carbon nanotubes, I thought ‘kismet!’.
The tutorial is really quite good, and I encourage you to follow it, but there are a few steps to get you started.
- To download the software from UIUC, you’ll need to go to:
which will prompt you to create a new user account.
- Once that rigmarole is out of the way, you’ll need to actually download NAMD, the actual molecular dynamics simulator. If you’re running this on a Windows PC ( I’m assuming you are, otherwise you should know enough about what you’re doing to not need me! ) you’ll need to download the NAMD_2.6 Win32 version, instead of whatever is the latest version. Apparently Windows users don’t need up to date molecular modeling, or so I’m told. If this post if more than 6 mo old, you might try the newest version instead of 2.6, YMMV.
- Next download VMD, the MD visualizer component. For the windows users, there is an auto installer. It will drop the VMD link into a ‘Programs’->’University of Illinois’ folder in your start menu.
- Finally you’ll need to download the nanotube tutorial files, as mentioned in the tutorial file itself.
- Put all those files into one directory, unzip the zip files, and run the VMD installer if you chose that route.
You should now be set up for following the water permeation tutorial.
Note that when it says ‘run source xxx.tcl’, what it really means is: navigate to the directory where you unzipped the nanotube_tutorial files first using something like:
( note the commands are DOS but using unix style ‘/’ instead of DOS ‘\’ separators )
Do the tutorial. Note in the AutoIMD section, you can grab molecules while the sim is running and fling them willy-nilly. It’s quite fun and possibly even useful.
Well, that was fun, yes? Now let’s sexy it up a bit by adding two ions, good old Na+ and Cl-. The basic premise of the article, was that carbon nanotubes will magically stop ions from flowing through the tube for a lot of different hand waving reasons. Personally, I don’t buy it … sure the ions won’t get through the tube, that’s just a VdW argument ( at least on the cation side ). To me, the bigger issue to me is tube blockage. My naive assumption would be that these ions ( and their loosely bound primary solvation sphere ) will hit the tube aperture and block other water molecules from getting through.
Enough talk, tell me how to test it!
- We need to add our Na and Cl atoms to the PDB file you ran sims on in the tutorial. Make a copy of cnt.pdb called cnt_mod.pdb. Edit the new file, by placing the following lines:
ATOM 1321 SOD SOD I 1 8.010 6.395 -9.214 0.00 0.00 ION NA ATOM 1322 CLA CLA I 2 -2.251 4.666 -9.206 0.00 0.00 ION CL
the logic should be pretty clear, but to break it down:
(1321) atom number, (SOD) atom label, (SOD I) aminoacid name,
(1) aa chain-id, (8,6,-9) x,y,z atom coordinates, (0) occupancy
(0) not sure, (ION NA) residue name
Note that NAMD uses the occupancy value to tell which atoms to process (0) and which to leave fixed (1).
- Next, copy of the cnt.psf file to cnt_mod.psf. Add this starting on line 1328:
1321 ION 1 SOD SOD SOD 1.000000 22.9898 0 1322 ION 2 CLA CLA CLA -1.000000 35.4500 0
(1321) atom number, (ION) residue, (1) residue subgroup,
(SOD) aa code, (SOD) aa subgroup code, (SOD) atom-type label,
(1) partial charge, (23) atom mass, (0) dunno.
Unfortunately, since we’ve changed the atom count, we need to change the atom count on line 8. Increase it by 2 to 1322.
- Finally, let’s tell our NAMD conf file what to do. Copy sim_short.conf to sim_mod.conf and edit:
structure cnt_mod.psf coordinates cnt_mod.pdb set temperature 300 set outputname sim_mod temperature 300.00K # Needed since we don't have # precomputed coor and vel files
minimize 500; # We've changed the atom positions and are not providing # and are not providing an optimized starting position # a few minimize cycles will find us good starting points # and avoid the ' atoms moving too fast ' error run 40000 ;# 40ps
- Run that in the same way as with the tutorial sim_short.conf. If you’re running a multicore processor, you might want to add the multiprocessor option, +pN, where N is number of processors:
namd2.exe +p2 nano_tutorial/sim_mod.conf
- Get some tea. When you come back, load the files cnt_mod.psf and sim_mod.dcd and enjoy.
If, like me, you ran sim_mod and sim_short for 150000 ticks, you’d find that ( using flow.tcl ):
sim_short ( no ions ): 56 water molecules (+z)
sim_mod ( one pair of NaCl ions over separate nanotubes ): 42 water molecules (+z)
An examination of the video of the salty water simulation shows that while the sodium ion with its solvation shell is able to plug up one nanotube a little, the chloride ion tends to slip out, allowing free passage to the water.
Basically, I have to eat my words … on balance, water molecules continue to flow ( if a bit slower ) even when the sodium ion and its bulky coordination sphere are jammed into the nanotube’s narrow pipe … that’s what she said!
Yup, this whole entry was build up for that one joke. That’s what I call commitment to a bit.