Introduction
Charmm GUI is a web based input generator that utilizes charmm to generate base files for many different simulation programs to run off of. Charmm GUI offers a quicker, "easier" way to generate files for simulation. Without Charmm GUI, you would need to generate the psf from the pdb and then use these to make a dcd, while with Charmm GUI, all you need is the pdb and it will do the rest. You will also have to use VIM which is used to edit and save changes to files. You first have to put the file in VIM, this is done by typing vi filename.filetype in the console. In order to make changes, you then have to type "i", this will put the program into insert mode. Once you are done editing, you have to press the "esc" key to put it back in view mode. You can tell what mode it is in as it will say "insert" in bold font at the bottom of the terminal. To save and exit, type ":x" while in viewing mode, not insert mode. To just quit, type ":q!". We are editing the input files for the simulation to reduce the time the simulation will take, rather than taking 2 hours or a day, it will take less than half an hour. For a more complete VIM guide, check out the troubleshooting guide and tips page.
Procedure
- Obtain a simple pdb file from rcsb.org (ex. 1qlq)
- Next, clean up the PDB. If you like, you may generate a PSF using PSFGEN (in a tkcon), or the AutoPSF plugin. However, you will only need a PDB for this as CharmmGUI likes to generate all of its own files. If you cannot remember how to clean up a PDB, reference this section.
- Go to charmm-gui.org and select input generator from the menu on the left side of the page, then select Quick MD Simulator.
- Scroll down to the bottom of the page and select your pdb file. Next, click the circle/box that says "PDB" in the PDB format line.
- Next, click on the bottom right of the page. This will take you through several steps, but you do not need to change or select anything until you get to the page where it asks you what input files you would like to have generated. Select "NAMD" and then click next again. (Notice: Some steps may take up to 5 or 10 minutes to process!).
- You will then reach the last page where there is no longer a "Next" button in the corner. There will be a button that says "download .tar file". Click this and it will save the "tarball" into your "Downloads" folder. You will want open this and move the folder created to your working directory.
- In a terminal, change into the charmm-gui directory that you are working in, and then into the "namd" directory inside.
- Now use a text editor such as "vim" or "emacs" to edit step4_equilibration.inp. Reduce each of dcdfreq, run, and minimize by a factor of 10. dcdfreq specifies how often a trajectory/.dcd file is output. This will be found towards the beginning of the file. run specifies the total number of steps in the simulation; however, NAMD considers this to include minimization steps. In this case 3500 steps should be run. Both run and minimize will be found at the very end of the file. When edited properly, the input file should look something like this:
- vi step4_equilibration.inp
- structure ../step3_pbcsetup.xplor.ext.psf
- coordinates ../step3_pbcsetup.pdb
- set temp 303.15;
- set outputname step4_equilibration;
- # read system values written by CHARMM (need to convert uppercases to lowercases)
- exec tr "\[:upper:\]" "\[:lower:\]" < ../step3_pbcsetup.str | sed -e "s/ =//g" > step3_pbcsetup.namd.str
- source step3_pbcsetup.namd.str
- temperature $temp;
- outputName $outputname; # base name for output from this run
- # NAMD writes two files at the end, final coord and vel
- # in the format of first-dyn.coor and first-dyn.vel
- firsttimestep 0; # last step of previous run
- restartfreq 500; # 500 steps = every 1ps
- dcdfreq 100;
- dcdUnitCell yes; # the file will contain unit cell info in the style of
- # charmm dcd files. if yes, the dcd files will contain
- # unit cell information in the style of charmm DCD files.
- xstFreq 1000; # XSTFreq: control how often the extended systen configuration
- # will be appended to the XST file
- outputEnergies 125; # 125 steps = every 0.25ps
- # The number of timesteps between each energy output of NAMD
- outputTiming 1000; # The number of timesteps between each timing output shows
- # time per step and time to completion
- # Force-Field Parameters
- paraTypeCharmm on; # We're using charmm type parameter file(s)
- [a bunch of parameters and other stuff]# multiple definitions may be used but only one file per definition
- langevinDamping 1.0
- langevinTemp $temp
- langevinHydrogen off
- # constant pressure
- langevinPiston on
- langevinPistonTarget 1.01325
- langevinPistonPeriod 50.0
- langevinPistonDecay 25.0
- langevinPistonTemp $temp
- # planar restraint
- colvars on
- exec sed -e "s/\$bb/1.0/g" -e "s/\$sc/0.1/g" mdsetup_restraint.namd.col > restraints/$outputname.col
- colvarsConfig restraints/$outputname.col
- minimize 1000
- numsteps 90000000
- run 2500
- ~
- Once you are satisfied with your work, save the file. In vim, press “esc” to exit input mode. Then type “:wq” to save and exit your work.
- Run a namd simulation of the .inp file you just edited using “namd2 step4_equilibration.inp > step4.log”. The reason you add the end part is so that all the data gets dumped into the log file rather than you losing it or having to have the terminal always open to look at it. To view what's happening in the log file while the simulation runs, use “tail -f step4.log”.
- By the time this is over, a bunch of new files will have been generated that will be used in the next step.
- Use vim again to open and edit the same things you did last time except in the step5_production.inp, minus the minimization step as this is not part of this step. Everything you are looking for should be found in similar parts of the file. Don’t forget to exit and save once you are satisfied with your work!
- structure ../step3_pbcsetup.xplor.ext.psf
- coordinates ../step3_pbcsetup.pdb
- set temp 303.15;
- outputName step5_production; # base name for output from this run
- # NAMD writes two files at the end, final coord and vel
- # in the format of first-dyn.coor and first-dyn.vel
- set inputname step4_equilibration;
- binCoordinates $inputname.coor; # coordinates from last run (binary)
- binVelocities $inputname.vel; # velocities from last run (binary)
- extendedSystem $inputname.xsc; # cell dimensions from last run (binary)
- restartfreq 500; # 500 steps = every 1ps
- dcdfreq 100;
- dcdUnitCell yes; # the file will contain unit cell info in the style of
- # charmm dcd files. if yes, the dcd files will contain
- # unit cell information in the style of charmm DCD files.
- xstFreq 500; # XSTFreq: control how often the extended systen configuration
- # will be appended to the XST file
- outputEnergies 125; # 125 steps = every 0.25ps
- # The number of timesteps between each energy output of NAMD
- outputTiming 500; # The number of timesteps between each timing output shows
- # time per step and time to completion
- # Force-Field Parameters
- paraTypeCharmm on; # We're using charmm type parameter file(s)
- [a bunch of parameters and lines…] # multiple definitions may be used but only one file per definition
- # Integrator Parameters
- timestep 2.0; # fs/step
- rigidBonds all; # Bound constraint all bonds involving H are fixed in length
- nonbondedFreq 1; # nonbonded forces every step
- fullElectFrequency 1; # PME every step
- wrapWater on; # wrap water to central cell
- wrapAll on; # wrap other molecules too
- wrapNearest off; # use for non-rectangular cells (wrap to the nearest image)
- # PME (for full-system periodic electrostatics)
- PME yes;
- PMEInterpOrder 6; # interpolation order (spline order 6 in charmm)
- PMEGridSpacing 1.0; # maximum PME grid space / used to calculate grid size
- # Constant Pressure Control (variable volume)
- useGroupPressure yes; # use a hydrogen-group based pseudo-molecular viral to calcualte pressure and
- # has less fluctuation, is needed for rigid bonds (rigidBonds/SHAKE)
- useFlexibleCell no; # yes for anisotropic system like membrane
- useConstantRatio no; # keeps the ratio of the unit cell in the x-y plane constant A=B
- langevinPiston on; # Nose-Hoover Langevin piston pressure control
- langevinPistonTarget 1.01325; # target pressure in bar 1atm = 1.01325bar
- langevinPistonPeriod 50.0; # oscillation period in fs. correspond to pgamma T=50fs=0.05ps
- # f=1/T=20.0(pgamma)
- langevinPistonDecay 25.0; # oscillation decay time. smaller value correspons to larger random
- # forces and increased coupling to the Langevin temp bath.
- # Equall or smaller than piston period
- langevinPistonTemp $temp; # coupled to heat bath
- # Constant Temperature Control
- langevin on; # langevin dynamics
- langevinDamping 1.0; # damping coefficient of 1/ps (keep low)
- langevinTemp $temp; # random noise at this level
- langevinHydrogen off; # don't couple bath to hydrogens
- # run
- numsteps 500000; # run stops when this step is reached
- run 5000; # 1ns
- Run this using namd2 step5_production.inp > step5.log and open view the log file again in a new terminal.
- Once this simulation is done in about 15-30 minutes, you will see a bunch of new files, including a .dcd file. This step5 dcd is what we ran the NAMD simulation for. Open VMD and load the step3 .psf and the step5 .dcd into it and you will see the molecule in a water box dancing around.
- Select the non water molecules and water molecules separately and hide the water molecules so you will be able to see it without the water box in your way.