Alec revised this VMD protocol 7/27/2021. Please review the steps if you are converting simulations.
We use VMD to convert files from GROMACS output formats (.gro, .xtc) to NAMD output formats (.pdb, .psf, .dcd). We need to do this to use tool.py and other software to analyze interaction energies of the simulations we produce, as well as to generate RMSD data.
Necessary Outputs
You will need certain GROMACS output files to run VMD. You can get these from the Google Drive from the links on the COVID-19 Progress page. These outputs are:
step5_production.gro
step6.1_final.xtc (or equivalent .xtc trajectory file)
step6.1_final.pdb (or equivalent .pdb file)
Loading the files in VMD
Open VMD. Three windows (a main menu page, a graphics window, and a terminal or command prompt) should appear.
In the terminal window, use cd to move to your working directory. I recommend having separate folders for your outputs and inputs.
On the main menu, go to File > New Molecule, then click Browse. Open the structure file, step5_production.gro, then click Load.
Once loaded, click Browse again, and open step6.1_final.xtc. Wait until all frames are loaded – when the frames are finished loading, the graphics window should pause.
Optimizing and exporting RMSD
On the main window, go to Extensions > Analysis > RMSD Trajectory Tool.
On the window that appears, check the boxes titled Time and Plot.
Click the button at the top right labeled RMSD, and a plot will appear. Check for three things: that the left-most data points are less than about 10 Å, that the first few data points are not right next to each other, and that there is a generally upward trend across the graph. If all of those conditions are met, skip to step 9. Otherwise, continue to step 8.
Close the RMSD plot. On the main VMD window, right click on step5_production.gro and click Delete Frames. Set the Last box to 0, then click Delete. Repeat step 7.
Check that the RMSD plot shows 0 through 100 on the x axis. If not, change the Step accordingly (e.g. if the x axis shows 0 through 1000, change the Step box from 1 to 0.1).
Close the RMSD plot. Uncheck the Plot box, then check the Save box. Change the file to trajrmsd.csv.
Put a copy of plot-RMSD.py in your VMD folder with trajrmsd.csv. In a separate Terminal or Command Prompt window, cd to that folder, then run python3 plot-RMSD.py. If Python fails because you are missing depedencies, use pip3 install (e.g. pip3 install pandas) to add the packages your installation is missing.
Generating .pdb file
On the main window, go to Extensions > Tk Console.
Use step6.1_final.pdb to determine the atom index number ranges (second column) for each chain (fifth column).
On the TkConsole, enter set a [atomselect top "protein and index x to y"] and press enter. Replace x with the index one before the start (if the index is 1, enter 0) and replace y with the actual index of the last atom (if the index is 999, enter 999). To say this another way, use (x, y], such that the lower boundary is non-inclusive and the upper boundary is inclusive.
Enter $a set chain "A". You can repeat steps 13 and 14 with different letters in place of a each time to define several chains.
Check step6.1_final.pdb to see if the residue ID numbers (sixth column) reflect the actual values. Both sace2 and rg systems should start at 21. If they start at 1, run steps 17 and 18. Otherwise, skip to step 19.
Copy and paste the following code to adjust chain A's residue ID numbers. This code is for sace2 systems; if you are working with an rg system, change 595 to 63.
for {set x 595} {$x>=1} {set x [expr $x - 1]} {
set b [atomselect top "protein and chain A and resid $x"];
$b set resid [expr $x + 20];
}
If your system has a second chain (sace2-rbd or rg-rbd systems), copy and paste the following code to adjust chain B's residue ID numbers. This code is for sace2-rbd systems; if you are working with an rg-rbd system, change 596 to 64, 778 to 244, and $x - 260 to $x + 272.
for {set x 596} {$x<=778} {incr x} {
set b [atomselect top "protein and chain B and resid $x"];
$b set resid [expr $x - 260];
}
Close the TkConsole. On the Main window, select the GROMACS file, right-click, and choose Save Coordinates. Enter protein in the selected atoms box, and ensure the file type is pdb. Change the Frames to be 0 through 0. Click save, and save the file as the system name.
Once the file is saved, manually check your .pdb in a text editor to be sure the chains are listed correctly. Be sure to check the first and last atoms of each chain to verify they have the correct letter. If not, you must edit them with the TkConsole, not in the text editor, or your .psf file will be incorrect.
Generating .psf file
On the main window, go to Extensions > Modeling > Automatic PSF Builder.
Change step5_production in the Output Basename box to the system name (e.g. sace2-rbd-wt-1_autopsf). Then click Load Input Files.
Change Step 2 to Protein. Then click Guess and Split Chains.
Ensure the segments are correct. It may appear to cut off one residue at the end of the last chain; this is correct. Click Create Chains.
If patches appear, click Apply Patches. Otherwise, continue.
Close the AutoPSF window.
Generating .dcd file
On the main window, right-click on step5_production.gro, then click Save Coordinates. Enter protein in the selected atoms box, change the file type to dcd, and click Save. Save the file with the system name.
Uploading to Drive
Use this template for your readme file. Change the date, name, and system names where appropriate, then save it to your outputs folder.
Upload the files list the readme to the appropriate location on the Drive, as well as the readme itself. Create a link to your folder (listed as your name) on the COVID-19 Progress page.