VMD Scripting

VMD scripting is handy for executing command that you do often–like preparing a molecule for a figure, or for carrying out certain analyses. When I use PyMOL, I have a set of scripts for coloring atoms and defining various representations so I don’t have to repeat these by hand each time I need them. In addition, there are useful scripts available for analyzing protein structure and trajectories.

Scripting Resources

Here are some web resources for scripting in VMD:

From the VMD wiki:
Scripting in VMD
Advanced Script Writing

Other VMD scripting resources:
VMD Script Library
A few useful short scripts: VMD
Resources

Other useful structural biology resources:
OpenStructure
SpotOn: High Accuracy Identification of Protein-Protein Interface Hot-Spots

From the VMD wiki:

Finding contact residues Suppose you want to view the atoms in A which are in contact with B. Use the within of selection command. For purposes of demonstration, let A be protein, B be nucleic, and define contact as an atom in A which is within 2 Å of an atom in B. Then the selection command is

protein within 2 of nucleic

If you want to see all the residues of A which have at least one atom in contact with B, use

same residue as (protein within 2 of nucleic)

mono2poly 1.0 script
This script takes a monomer from an asymmetric unit of a crystal structure and makes the appropriate translations as found in the .pdb header to get the full polymer.

The mono2poly.tcl script strips out ligands and other hetero atoms.

How to use:

source mono2poly.tcl
mol delete all
mol new 1c8e.pdb
set sel [atomselect top all]
set matrix [parsematrix 1c8e.pdb]
mono2poly -o outname $sel $matrix

An alternative to the mono2poly.tcl script to build the biological assembly from a monomer in the asymmetric unit is to:

  1. download the biological assembly file from RCSB.
  2. Go into the Trajectory tab and change the Draw Multiple Frames: value to 0.20 for a dimer, or 0.30 for a trimer, etc.

With the above alternative, I cannot select residues on each monomer–I can only select residues on one monomer, and each monomer is labeled chain A.

Here is another script to create a biological assembly from a .pdb file:

mergemultiframepdb 1.0

EXAMPLE USAGE:

source mergemultiframepdb.tcl # the script is in the working directory
mol delete all
mol new 2cft.pdb # the multi-frame .pdb file
merge_multi_frame_structure top /tmp/ 2cft-poly

# Results will be written to /my/final/filename.psf and /my/final/filename.pdb

The above script fails if your protein has a ligand.

check out this site

Try TopoTools

This is probably the best way: I could use grep or awk or just do it by hand:

preparing a dimeric protein for NAMD

build section of main menu and use the pdb scan function. ( I can’t find it)

DGO, 17 October 2021