- now that you have made a script loaded and played it, lets discuss in a bit more detail what the format of the input file is and what this script does.
- VMD can read in many types of format, but an easy option is to just produce the basic xyz file, this has the following format
number of atoms
title
atom x y z
where atom can be the atomic symbol or atomic number, and you must have as many atom x y z lines as you have number of atoms
- VMD sets some default options that are not optimal for viewing molecules, for example the default representation is lines, which is very difficult to see, so I typically change these default options in the first part of the .tcl script. We didn't set the background in the script above, but you can alter your script to do this by adding the background command. Typically a black background is good for on-screen but if you want to put a snapshot image in a presentation a ligher background works better.
# setup some display settings first
color Display Background iceblue ::set the background colour
display projection Orthographic ::all atoms same size=orthographic
display depthcue off ::turn off the depth shading
axes location off ::turn off the axes
- in VMD anything to do with the molecule is via the "mol" keyword, in this case we want to read in and display a new moleule and the input file type is xyz.
# read in the molecule
mol new mol.xyz type xyz
- now we want to add a new representation of this molecule in the CPK format. First we define that format we want, in this case I have specified particular settings for the CPK representation, these are the sphere_scale then bond_radius then sphere_resolution then bond_resolution. Typically you can play around with these options using the graphical interface, identify those you like and then hard code them into the script. Finally after defining the representation format we add it to the display with the mol addrep command
# change the molecule representation so we can see it
mol representation CPK 1.100000 0.300000 20.000000 16.000000
mol addrep top