

Any number of molecules can be loaded and displayed in VMD simultaneously by repeating the previous step. Use the Browse… button to find the file 1rc2.pdb and press Load. In the Molecule File Browser, make sure you choose New Molecule in the “Load files for:” pull-down menu on the top. If you execute those command lines you can repeat the exact same actions you have performed interactively. This creates a logfile for all your actions in VMD and writes them in the Console window as command lines. Try typing logfile console in your Console window. You can either find it in the VMD User’s Guide ( ), or conveniently use the console command. Many times when you write a script you might want to look up the command for an interactive VMD feature. In fact, you can execute the file in the Tk Console the same way as you execute other script files, i.e., by typing source myfirststate.vmd in the Tk Console window.

Hopefully, by the end of this section, you’ll understand many of those commands. You are encouraged to take a look at that file using a text editor.
#.vmd file player series#
vmd file you saved in Basic Protocol 1, step 47, is actually a series of commands. There are six lines in this file, and each line represents a Tcl command line that you have used before. Using any text editor of your choice, open the file beta.tcl. Take a quick look at the script beta.tcl. The blue residues are the LYS and GLY residues in the ubiquitin. You should see that the protein is mostly a collection of red spheres, with some residues shown in blue. In the Tk Console window, type sourcebeta.tcl and observe the color change.

The script beta.tcl sets the colors of residues LYS and GLY to a different color from the rest of the protein by assigning them a different beta value, a trick you have already learned in Basic Protocol 6, steps 5–9. You should have downloaded a simple script, beta.tcl, with this unit. Just use any text editor to write your script file, and in a VMD session, use the command source filename to execute the file. When performing a task that requires many lines of commands, instead of typing each line in the Tk Console window, it is usually more convenient to write all the lines into a script file and load it into VMD. Thus, $crystal is now a function that performs actions on the contents of the “all” selection. This concept is particularly important when multiple molecules are loaded at the same time (see Basic Protocol 9 for dealing with multiple molecules in VMD). A top molecule means that it is the target for scripting commands. Instead of a molecule ID (which is a number), we have used the shortcut “top” to refer to the top molecule. This step creates a selection, crystal, that contains all the atoms in the molecule and assigns it to the variable crystal. The selection returned by atomselect is itself a command you will learn to use.

The first argument to atomselect is the molecule ID (shown to the very left of the VMD Main window), the second argument is a textual atom selection like what you have been using to describe graphical representations in Basic Protocol 1. This command allows you to select a specific part of a molecule. Type set crystal in the Tk Console window. If you are using a Mac, your vmd console window is the terminal window that shows up when you open VMD.Ģ. The Tcl commands that you enter in the VMD TkConsole window can also be entered in the vmd console window. It should tell you a molecule has been loaded, as well as some of its basic properties like number of atoms, bonds, residues and etc. The vmd console window tells you what’s going on within the VMD session that you are working on. When you open VMD, by default a vmd console window appears. You can use the standard Unix commands in the VMD TkConsole window to navigate to the correct directory. If you see the error message ”Unable to load file ‘1ubq.pdb’ using file type ‘pdb’”, you might not be in the correct directory that contains the file 1ubq.pdb. In the VMD TkConsole window, type the command mol new 1ubq.pdb and hit enter.Īs you can see, this command performs the same function as described at the beginning of Basic Protocol 1, namely, loading a new molecule with file name 1ubq.pdb.
