Professional Documents
Culture Documents
Version 1.4
January 6, 2000
1
Theoreti
al Biophysi
s Group
405 N. Mathews
Urbana, IL 61801
Des
ription
The VMD User's Guide des
ribes how to run and use the mole
ular visualization and analy-
sis program VMD. This guide do
uments the usage of both the graphi
al user interfa
e and the
text
onsole interfa
e for displaying and grapi
ally manipulating mole
ules, and des
ribes how to
ustomize the appearan
e and behavior of VMD for ea
h user.
1
http://www.ks.uiu
.edu/
Contents
1 Introdu
tion 10
1.1 For more information on VMD and MDS
ope . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Conta
ting the authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 Credits and Program Referen
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Copyright and Dis
laimer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Registering VMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.6 A
knowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 Tutorials 14
2.1 Rapid Introdu
tion to VMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 Viewing a mole
ule: Myoglobin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 Rendering an Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 A Qui
k Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 An Introdu
tion to Atom Sele
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.6 Comparing Two Stru
tures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 User Interfa
e Components 19
3.1 Using the Mouse in the Graphi
s Window . . . . . . . . . . . . . . . . . . . . . . . . 19
3.1.1 The Popup Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.1.2 Atom/Mole
ule Spe
i
Popup Menu . . . . . . . . . . . . . . . . . . . . . . 29
3.1.3 Delete Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.4 Hot Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2 Using the Forms library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2.1 Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2.2 Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.3 Choosers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.2.4 Text Entry Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2.5 Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.6 File Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Des
ription of ea
h VMD form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.3.1 Main Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.3.2 Mole
ules (Mol) Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.3.3 Files Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.4 Graphi
s Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3.5 Animate Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3.6 Edit Animation Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2
3.3.7 Labels Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.8 Display Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.3.9 Color Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.3.10 Render Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.3.11 Tra
ker Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.3.12 Sim Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.4 Other User Interfa
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.4.1 External Interfa
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
4 Loading A Mole
ule 62
4.1 Babel interfa
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.2 What happens when a le is loaded? . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4.3 Raster3D le format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4.4 Raster3D Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5 Mole
ular Drawing Methods 65
5.1 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.2 Bonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.3 CPK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.4 Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.5 VDW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.6 Dotted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.7 Solvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
5.8 Tube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.9 Tra
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.10 Li
ori
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.11 Ribbon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.12 Surf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.13 Cartoon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.14 MSMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.15 HBonds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.16 O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6 Coloring Mole
ules and Obje
ts 73
6.1 Color
ategories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.2 Coloring Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
6.2.1 Coloring by
olor
ategories . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.2.2 Color s
ale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.3 Transparen
y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.4 VMD S
ript Commands for Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.4.1 Adjusting the degree of transparen
y . . . . . . . . . . . . . . . . . . . . . . . 77
6.4.2 Changing the
olor s
ale denitions . . . . . . . . . . . . . . . . . . . . . . . 78
6.4.3 Creating a set of bla
k-and-white
olor denitions . . . . . . . . . . . . . . . 79
6.4.4 Revert all RGB values to defaults . . . . . . . . . . . . . . . . . . . . . . . . 80
6.4.5 Setting the transparent
olors a
ording to solid . . . . . . . . . . . . . . . . 80
6.4.6 Making the mole
ule to show up slowly . . . . . . . . . . . . . . . . . . . . . 80
6.4.7 Querying VMD for Color Information . . . . . . . . . . . . . . . . . . . . . . 81
3
7 VMD Atom Sele
tion Language 82
7.1 Denition of Keywords and Fun
tions . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.2 Boolean Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.3 Short Cir
uiting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.4 Quoting with Single Quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.5 Double Quotes and Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.6 Comparison sele
tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.8 Other sele
tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.8.1 sequen
e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.8.2 within and same . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.9 Referen
ing T
l data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.9.1 $referen
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.9.2 referen
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
7.9.3 The dieren
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
8 Creating Output Raster Images 92
8.1 Creating an Output Image File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
8.2 Known Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
8.3 One Step Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9 Viewing Modes 95
9.1 Perspe
tive/Orthographi
views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.2 Monos
opi
Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.3 Stereos
opi
Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.3.1 Side-By-Side and Cross-Eyed Stereo . . . . . . . . . . . . . . . . . . . . . . . 96
9.3.2 Crystal Eyes Stereo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.3.3 Problems with stereo on Indigo2 ma
hines . . . . . . . . . . . . . . . . . . . . 97
9.3.4 Stereo Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.4 Making Stereo Raster Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
10 Text User Interfa
e 99
10.1 Using text
ommands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.2 T
l/Tk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.3 Core Text Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.3.1 animate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
10.3.2 axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
10.3.3
olor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.3.4
olorinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
10.3.5 debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.3.6 display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.3.7 e
ho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.3.8 exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.3.9 external . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.3.10 help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.3.11 imd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.3.12 label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4
10.3.13 light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
10.3.14 logle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
10.3.15 menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
10.3.16 mol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
10.3.17 mole
ule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
10.3.18 mouse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
10.3.19 play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.3.20 quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.3.21 imd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.3.22 render . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
10.3.23 ro
k . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
10.3.24 rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
10.3.25 s
ale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
10.3.26 sim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.3.27 simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.3.28 stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.3.29 tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.3.30 translate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.3.31 user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.3.32 vmdlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.33 vmdinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.34 wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
10.3.35 sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
11 Ve
tors and Matri
es 117
11.1 Ve
tors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
11.2 Matrix routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.3 Multiplying ve
tors and matri
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
11.4 Mis
. fun
tions and values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
12 User-Dened Graphi
s 125
12.1 Introdu
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
12.2 Tutorials and Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
12.2.1 Drawing a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
12.2.2 Triangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
12.2.3 Draw a surfa
e plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
12.2.4 Drawing a box around a mole
ule . . . . . . . . . . . . . . . . . . . . . . . . . 131
12.2.5 Adding a label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
12.2.6 Interfa
e to pi
king . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
12.2.7 Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
12.3 Graphi
s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
12.4 Draw and Drawing Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
13 Mole
ular information: molinfo and atomsele
t 138
13.1 molinfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
13.1.1 Using molinfo to a
ess the mole
ule list . . . . . . . . . . . . . . . . . . . . 138
13.1.2 Using molinfo to a
ess information about a mole
ule . . . . . . . . . . . . . 139
5
13.2 Atom information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
13.3 Analysis s
ripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
14 Tips and Tri
ks 152
14.1 Customizing the Popup Menu and the Hot Keys . . . . . . . . . . . . . . . . . . . . 152
14.1.1 Customizing the popup menu . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
14.1.2 Customizing the Hot Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
14.1.3 Automati
ally loading
ustomization
ommands . . . . . . . . . . . . . . . . 154
14.2 Using VMD as a WWW Client (for
hemi
al/* do
uments) . . . . . . . . . . . . . . 155
14.2.1 MIME types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
14.2.2 Setting up your .mail
ap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
14.2.3 Example sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
14.3 Making a Movie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
14.4 Coloring Tri
k - Override a Coloring Category . . . . . . . . . . . . . . . . . . . . . . 157
14.5 Some Ni
e Represenations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
14.6 Finding Conta
t Residues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
14.7 T
l Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
14.8 Remote Control of VMD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
14.9 Controlling One VMD With Another . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
15 Intera
tive Mole
ular Dynami
s 160
15.1 How the Conne
tion Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
16 Advan
ed S
ript Writing 162
16.1 Drawing a distan
e matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
16.2 Analysis of PDB les . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
16.3 save/load VMD state information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
16.4 Currently pi
ked mole
ule/atom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
16.5 Tra
e on the pi
k variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
16.5.1 Information about the pi
ked atom . . . . . . . . . . . . . . . . . . . . . . . . 169
16.5.2 Making a sphere appear when an atom is pi
ked . . . . . . . . . . . . . . . . 170
16.5.3 Drawing a line from the eye to the pi
ked atom . . . . . . . . . . . . . . . . . 170
16.6 Traje
tory frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
16.6.1 Animating the se
ondary stru
ture . . . . . . . . . . . . . . . . . . . . . . . . 171
16.6.2 Viewing sele
tions whi
h
hange during an animation . . . . . . . . . . . . . 173
16.6.3 Simulation frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
16.7 RMSD and best-t alignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
16.7.1 RMSD Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
16.7.2 Computing the Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
16.7.3 A simulation example s
ript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
17 Customizing VMD Sessions 180
17.1 Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
17.2 Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
17.3 Startup Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
17.3.1 Core S
ript Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
17.3.2 User S
ript Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6
17.3.3 .vmd init File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
17.3.4 .vmdr
File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
18 Future Plans 186
Index 188
7
List of Figures
2.1 Sample VMD session displaying myoglobin. . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 Simple buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.2 A
ommon button motif . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.3 Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.4 Choosers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.5 A Text Entry Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.6 Several Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.7 The File Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.8 The Main form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.9 The Mole
ules form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.10 The Files form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.11 The Graphi
s form (in Image Controls mode) . . . . . . . . . . . . . . . . . . . . . . 56
3.12 The Graphi
s form (in Atom Name Lists mode) . . . . . . . . . . . . . . . . . . . . . 57
3.13 The Animate form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.14 The Edit Animation form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.15 The Labels form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.16 The Display form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.17 Relationship between s
reen height (SCRHEIGHT), s
reen distan
e to origin (SCRDIST),
and the viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.18 The Color form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.19 The Render form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
3.20 The Tra
ker form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
6.1 RGB
olor s
ale: the three plots shows the
ontributions of ea
h
olor, and the
resulting
olors are on the bottom. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
6.2 The shift to the red
omponent of the RGB s
ale
aused by the value of \min". . . . 79
8
List of Tables
3.1 Mouse
ontrol hot keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2 Rotation & s
aling hot keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3 Menu
ontrol hot keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.4 Animation hot keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1 Mole
ular view representation styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.1 Color
ategories used in VMD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
6.2 Mole
ular
oloring methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
6.3 Available Color S
ale Gradations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.1 Atom sele
tion keywords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.2 Atom sele
tion keywords (
ontinued). . . . . . . . . . . . . . . . . . . . . . . . . . . 90
7.3 Atom sele
tion fun
tions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.4 Regular expression methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.5 Regular expression
onversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.1 Supported output rendering formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
10.1 Summary of
ore text
ommands in VMD. . . . . . . . . . . . . . . . . . . . . . . . . 101
10.2 On-line Help Sour
es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
13.1 molinfo keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
13.2 atomsele
t keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
9
Chapter 1
Introdu
tion
VMD is a mole
ular graphi
s program designed for the intera
tive visualization and analysis of
biopolymers su
h as proteins, nu
lei
a
ids, lipids, and membranes. Currently VMD runs on
SGI workstations with IRIX 5.3 or higher, Hewlett-Pa
kard workstations with HP-UX 10.20, Sun
workstations with Solaris 2.6 or higher, IBM RS/6000 workstations with AIX 4.2 or higher, PC's
running Linux, and PC's running Windows 95/98/NT.
Online information about VMD is available from http://www.ks.uiu
.edu/Resear
h/vmd/.
VMD has several features:
General mole
ular visualization
At its heart, this program is a general appli
ation for displaying mole
ules
ontaining any
number of atoms. It is similar in basi
apabilities to
ommer
ial programs su
h as Quanta
and non-
ommer
ial programs su
h as RasMol, XMol, and Ribbons. It
an read PDB les
or use Babel (if available) to
onvert other formats automati
ally. On
e loaded, user-dened
subsets of the mole
ule
an be displayed in various ways in
luding li
ori
e, ribbons, van der
Waal spheres, and mole
ular surfa
es. The display
an be saved dire
tly to a posts
ript le or
in a format suitable for use by ray tra
ing programs su
h as Raster3D, POV, and Rayshade.
Visualization of dynami
mole
ular data
VMD
an read mole
ular traje
tories from DCD and Amber les, or it
an a
quire timesteps
from a running mole
ular dynami
s program. The data
an be used to animate the mole
ule
or to plot the
hange in mole
ular properties su
h as interatomi
distan
es, angles, or dihedrals
over time.
Display and
ontrol of mole
ular dynami
s simulations
VMD
an be used as a graphi
al front end to a mole
ular dynami
s (MD) program running
on a remote super
omputer or high-performan
e workstation. VMD
an intera
tively display
and
ontrol the MD simulation as the simulation is running. The user
an dis
onne
t from
the simulation and let it
ontinue, reatta
h to a running simulation, or halt the MD program.
Support for several input and display (output) devi
es
A number of dierent visual display and
ontrol systems are supported in addition to the
usual monitor, keyboard, and mouse. The UNC tra
ker library is used to get position and
orientation information from a wide variety of spatial input devi
es, in
luding a Polhemus
Fastrak. An interfa
e to the CAVE library has been developed for use in many dierent types
of stereo proje
tion fa
ilities.
10
T
l s
ripting language
VMD uses the freely available T
l s
ripting language for pro
essing text
ommands. This is
a very
ommon and popular language whi
h
ontains variables, loops, subroutines, and mu
h
more. The T
lX and T
l-DP extension pa
kages have been in
luded to improve the usefulness
of the language.
Mole
ular analysis
ommands
Many new T
l
ommands have been added for doing mole
ular analysis. These in
lude
methods to extra
t information about a set of atoms and mole
ules, ve
tor and matrix routines
for
oordinate manipulation, and fun
tions for
omputing values like the
enter of mass and
radius of gyration.
VMD is the visualization
omponent of MDS
ope, a
omputational environment for stru
tural
biology and intera
tive mole
ular dynami
s.
11
1.3 Credits and Program Referen
e
The authors request that any published work or images
reated using VMD in
lude the following
referen
e:
Humphrey, W., Dalke, A. and S
hulten, K., \VMD - Visual Mole
ular Dynami
s" J. Mole
.
Graphi
s 1996, 14.1, 33-38.
VMD has been developed by the Theoreti
al Biophysi
s group at the University of Illinois and
the Be
kman Institute. The main authors of VMD are A. Dalke, J. Gullingsrud, W. Humphrey,
S. Izrailev, J. Stone, J. Ulri
h. This work is supported by grants from the National Institutes of
Health (grant number PHS 5 P41 RR05969-04), the National S
ien
e Foundation (grant number
BIR-9423827 EQ), and the Roy J. Carver Charitable Trust.
The terms for using,
opying, modifying, and distributing VMD are spe
ied by the VMD
Li
ense. The li
ense agreement is distributed with VMD in the le LICENSE. If for any reason
you do not have this le in your distribution, it
an be downloaded from:
ftp://ftp.ks.uiu
.edu/pub/mds
ope/vmd/LICENSE
Some of the
ode and exe
utables used by VMD have dierent restri
tions. They are:
1) STRIDE, the program used for se
ondary stru
ture
al
ulation, is free to both a
ademi
and
ommer
ial sites provided that STRIDE will not be a part of a pa
kage sold for money. The
use of STRIDE in
ommer
ial pa
kages is not allowed without a prior written
ommer
ial li
ense
agreement. See http://www.embl-heidelberg.de/argos/stride/stride info.html
2) The sour
e
ode for SURF is
opyrighted by the original author, Amitabh Varshney, and
the University of North Carolina at Chapel Hill. Permission to use,
opy, modify, and distribute
this software and its do
umentation for edu
ational, resear
h, and non-prot purposes is hereby
granted, provided this noti
e, all the sour
e les, and the name(s) of the original author(s) appear
in all su
h
opies.
BECAUSE THE CODE IS PROVIDED FREE OF CHARGE, IT IS PROVIDED "AS IS" AND
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED.
This software was developed and is made available for publi
use with the support of the
National Institutes of Health, National Center for Resear
h Resour
es under grant RR02170.
See ftp://ftp.
s.un
.edu/pub/proje
ts/GRIP/SURF/surf.tar.Z .
3) The perl s
ript url get, was written by Ja
k Lund at the University of Texas as Austin. There
appear to be no restri
tions on its use.
12
1.5 Registering VMD
VMD is made available free of
harge for non-
ommer
ial use to all interested users (but please see
the Dis
laimer below). We would like to request that you register with us that you are using VMD.
This is so that we
an maintain some idea of the number of users of the program and so that we
know who to
onta
t about program updates, bug xes, et
. To register, please ll out the form at
http://www.ks.uiu
.edu/Resear
h/vmd/VMDregistration.html.
We appre
iate your help in this servi
e.
1.6 A
knowledgments
The authors would parti
ularly like to thank those individuals who have
ontributed improvements
to VMD in the form of new features or entire repla
ement
odes for old features. Spe
ial thanks go
to Andrew Dalke, Paul Grayson, and Charles S
hwieters for their VMD
ontributions. The entire
VMD user
ommunity now benets from your
ontributions.
The authors would like to thank the members of the Theoreti
al Biophysi
s group, past and
present, who have helped tremendously in making suggestions, pushing for new features, and trying
out quite often very bug-ridden
ode. Tom Bishop, the original (and for some time only) VMD
user, has been a driving for
e in suggesting (well, demanding) new features and bug xes. As well,
thanks go to Alexander Balae, Ivo Hofa
ker, Xi
he Hu, Barry Israeliwitz, Dorina Kosztin, Ilya
Logunov, Jim Phillips, Ari Shinozaki, Svilen Tzonev, Willy Wriggers, Dong Xu, Feng Zhou, and
our agent in the eld, Daniel Barsky. Thanks also to all of you who have tried out the program.
Many external libraries and pa
kages are used in VMD, and the program would not be possible
without them. The authors wish to thank Jon Lee
h for the
ode to
ompute the uniform point
distributions; T. C. Zhao and Mark Overmars, authors of the ex
ellent XFORMS library; John
Ousterhout and the other authors of the T
l, Tk, T
lX, TkX and T
l-DP pa
kages; the authors
of the VRPN library from the University of North Carolina; Amitabh Varshney, author of SURF,
also from UNC; Dmitrij Frishman at EMBL for developing STRIDE; Ja
k Lund for the url get
perl s
ript; and Ethan Merrit from the University of Washington for developing the algorithm for
drawing ribbons.
We also re
eived invaluable assistan
e from people who got the sour
e
ode and sent in pat
hes
and expli
it bug reports. The VMD developers would like to thank Axel Berg, Andrew Dalke,
Ri
k Kufrin, Joe Landman, Clare Ma
rae, Lukasz Salwinski, Stephen Searle, Charles S
hwieters,
Mi
hael Tiemann, Raymond de Vries, and Simon Wareld for their bug xes and
orresponden
e.
13
Chapter 2
Tutorials
2.1 Rapid Introdu
tion to VMD
For those of you who don't like reading the manual, here is a qui
k introdu
tion to VMD. To start it
type vmd on the
ommand line of your shell. (If that doesn't work, make sure it is in your path; you
may have to
he
k with your system administrator about how to x it). VMD should start up in
a window titled vmd
onsole, a display window entitled OpenGL Display, and a button bar entitled
main. Text
ommands are typed in the
onsole window, graphi
s are displayed and manipulated
in the display window, and many
ommands are available from the menu interfa
e, a
essible
through the button bar. (The menus are based on the Forms library so all future referen
es in the
do
umentation will refer to them as forms and not menus.) All the forms
an be turned o by
pressing the button in the
enter top; for instan
e, press the button labeled VMD in the main form
to turn it o.
There are two ways to perform almost all fun
tions in VMD, either use the forms or the text
onsole. For many of the
ommands, you
an also use the popup menu available in the display
window by pressing the right mouse button. Some of the more sophisti
ated
ommands, su
h as
T
l s
ripting, are only available in the text interfa
e. Now that the button bar is turned o, you
probably will want it ba
k. The easiest way to a
ess any form is by pla
ing the
ursor in the
display window and holding down the right button on the mouse to obtain a popup menu. Sele
t
the option `show form' on the popup menu, and then sele
t the form `main'. The button bar should
reappear. The same ee
t may be a
omplished by typing the
ommand menu main on in the text
onsole window.
14
the VMD distribution (you may have to ask where this is lo
ated; try /usr/lo
al/lib/vmd or
/usr/lo
al/vmd). On
e there, sele
t the le mb
o.pdb. (Be
areful when
hanging dire
tories as
the Forms library does not understand double
li
ks, and
li
king too rapidly may
ause the form
to get very upset and
ore dump. This problem will be xed in future versions of VMD.) On
e the
PDB le is sele
ted,
li
k on the Load Mole
ule button in the
enter of the Files form. You have
loaded a myoglobin stru
ture. Figure 2.1 shows an example of VMD displaying this protein.
You
an use the mouse to manipulate the stru
ture in the display window. There are three
basi
mouse modes [x3.1.1℄: rotation[x3.1.1℄, translation [x3.1.1℄, s
aling[x3.1.1℄. The mode
an be
hanged from the display window popup menu by pressing the right mouse button and pi
king
the option under `Mouse Mode', or by pressing r, t, or s on the keyboard. Experiment with these
modes, and note how the
ursor
hanges to indi
ate the
urrent mode. In rotation mode, the left
mouse button
ontrols rotation about axes parallel to the s
reen, and the middle button
ontrols
rotation about the axis perpendi
ular to the s
reen. In translation mode, the left mouse button
ontrols translation parallel to the s
reen, while the middle button
ontrols translation in and out
of the s
reen. Finally, in s
aling mode, both the left and middle buttons
ontrol global s
aling
when the mouse is moved left or right, but the middle button
auses larger
hanges. In all modes,
the right mouse button
ontrols the display window popup menu.
By default the myoglobin bonds are represented as lines and non-bonded atoms as points, with
the
olor in both
ases representing the atom type. This representation is easy for the
omputer
to draw but is not always informative, espe
ially when there are a large number of atoms. VMD
allows you to display many of the
ommon mole
ular representations. To a
ess these, open the
Graphi
s form [x3.3.4℄ using the button bar.
Suppose you would like to view the myoglobin stru
ture with its protein ba
kbone represented
as a tube, the heme represented as li
ori
e, the S O4 ion and C O mole
ule represented as van der
Waals spheres, and histidines 64 and 93 represented as CPK models. First, type ba
kbone in the
atom sele
tion text entry area and press 'enter' to sele
t the myoglobin ba
kbone. All of the
15
protein ex
ept for the ba
kbone will disappear. Choose drawing method `Tube' from the drawing
method
hooser to render the ba
kbone as a tube, and
hose
oloring method `Ba
kbone' from the
oloring method
hooser to
olor the tube with the predened ba
kbone
olor. Cli
k on the Create
New button. This
auses a new line to appear on the browser identi
al to the rst line. The new
line
an be
hanged without ae
ting the rst one, so
lear the atom sele
tion text area and then
enter resname HEM to sele
t the heme. At this point the heme isn't visible be
ause it
annot be
drawn as a tube, so
hoose the `Li
ori
e' drawing method to make it appear. Cli
k on Create
New again to make a new view, and enter resname SO4 CO to sele
t the S O4 ion and the C O
mole
ule, and
hoose the drawing method `VDW' to render them as Van der Waal spheres. On
e
again, press the Create New button and enter resid 93 64 to sele
t the two histidines, and render
them as `CPK'. If you followed all that, then
ongratulations, you have made a beautiful image of
myoglobin! Many more ways to represent atoms are possible. Please experiment with the options
available in the Graphi
s form.
16
Load Mole
ule button in order to begin reading the traje
tory. In the display window you should
see a simulation of an alanin residue in va
uo. It isn't parti
ularly informative, but you
an easily
see that the stru
ture is quite unstable in an isolated environment. After the DCD le has loaded,
it will by default stop. To see it again or to ne- tune playba
k, open the Animate form [x3.3.5℄
by
li
king on the appropriate button in the button bar. Press the button that looks like >> to
play the animation. Use the slider at the bottom of the form to
hange the speed of playba
k. By
rotating the mole
ule around, et
. you should get an idea about how the system destabilizes over
the
ourse of the simulation.
17
Start by loading the mb
o.pdb stru
ture with the Files form. Turn on just the heme, CO, and
histidines by using the sele
tion
ommands resname HEM CO or resid 64 93. The dot (probably
green) in the middle is the iron and you
an verify that by
li
king on it with the mouse. The label
HEM154:FE should appear both on the display and in the text
onsole.
To get the distan
e between the iron and the oxygen of the CO,
li
k with the middle mouse
button rst on the iron and then on the oxygen. The rst
li
k turned the FE label o and the
se
ond turned the O label on and drew a line between the two atoms with the distan
e drawn in
the middle and a bit to the right. The distan
e between the two atoms is 2.94 A, as
ompared
to 2.93
A in the paper; not bad. However, pi
king the distan
e between the FE and the C of the
CO reveals a distan
e of 1.91 A as
ompared to 1.85
A in the paper. The dieren
e is that the
stru
tures in the VMD distribution are a
tually preliminary stru
tures obtained before the nal
oordinates were determined.
In order to experiment with more
omplex pi
king modes,
onsider the angle made by the O
of the CO with the FE of the heme and the NE2 of residue 93 (you
an
li
k on the atoms to nd
whi
h ones are whi
h). Using the right mouse button in the Display window, sele
t `Mouse Mode',
then `Pi
k Item', then `Angles.' This should
ause the
ursor to be
ome a red
rosshair. Cli
k on
ea
h of the three atoms. After the third pi
k, a shallow angle will appear indi
ating an 8.71 degree
angle between the three atoms.
Now load the intermediate star.pdb le whi
h
an also be found in the proteins dire
tory of
your distribution. Again use the Files form to do this. Both of the mole
ules will be loaded side by
side. Go to the Graphi
s form and
hange the sele
tion so it the same as the rst, i.e. resname HEM
CO or resid 64 93. The two mole
ules are almost atop ea
h other, making it hard to distinguish
the two, so
hange the
olors to simplify things.
First, in the Graphi
s form,
hange the Coloring method to `Mole
ule'. Use the Sele
ted Mole
ule
hooser to
hange the mb
o.pdb Coloring method to `Mole
ule' as well. Open the Color form [x3.3.9℄
and s
roll the Category browser down until the line `Mole
ule' is visible. Cli
k on it then
li
k
on the line whi
h says mb
o.pdb. (There may be two mb
o lines if the le had been loaded before
in this session.) S
roll the Colors browser up to
li
k on `blue'. This should
hange one of the
mole
ules in the display to blue.
Next,
li
k on the last line in the Names
hooser, whi
h says star.pdb. This time,
hoose `red'
from the Colors
hooser. The display should be mu
h easier to understand. The myoglobin with
the bound CO is in blue and the intermediate state is in red. At this point it is easy to measure
the
hange in position between the two dierent states by using the middle mouse button to pi
k
the same atom in the two
onformations.
On
e that is done, it is easy to point out one interesting aspe
t of the way VMD handles the
graphi
s. Go to the Mol form, sele
t one of the two mole
ules, and press Toggle Fixed. Enter
translation mode and move the other mole
ule around. Noti
e that the number whi
h lists the
distan
e between the two atoms never
hanges. That's be
ause the mouse only ae
ts the way the
oordinates are translated to the s
reen image. It does not ae
t the real
oordinates at all. It is
possible to
hange the
oordinates in a mole
ule using the text
ommand interfa
e, or by using the
atom move pi
k modes [x3.1.1℄).
By the way, unx the mole
ules and do a `Reset View' from the right pull-down menu to reset
everything. Load up the third stru
ture, deoxy.pdb and give it the same sele
tion as the other two
mole
ules. However,
olor this one green. Pull out Nature v. 371, O
t. 27, 1994 and turn to page
740. With a bit of manipulation you should be able to re
reate the image that appears there.
18
Chapter 3
19
key is pressed. VMD has several built-in hot key
ommands (see Tables 3.1, 3.2, 3.3 and 3.4), and
the user
an add new ones as well (overriding the built-in ones if desired). A des
ription of how to
set up personal hot key
ommands is given in se
tion x 14.1.
20
The hot key to enter rotation mode is r. Also, pressing r or any of the other mouse mode
hot keys
auses the rotation to stop.
Mouse Mode ! Translation Mode
When the mouse is in translation mode, holding the left button down allows you to move
the mole
ules parallel to the s
reen plane, so, for example, moving the mouse left moves the
system left. To move the mole
ule towards or away from you, hold the middle button down
and move the mouse right or left, respe
tively.
The translation hot key is t; pressing t while the mouse is in the graphi
s display window
will
hange the mouse to translation mode.
Mouse Mode ! S
aling Mode
The s
aling mode has the simplest mouse
ontrols as pressing either the left or middle button
down and moving to the right enlarges the mole
ules, and moving the mouse left shrinks them.
The dieren
e is that the middle button s
ales faster than the left button.
The s
aling hot key is s.
Mouse Mode ! Move Lights Mode
VMD provides up to four separate light sour
es to illuminate the graphi
s obje
ts in the
display window. These light sour
es a
t independently, and use the native lighting hardware
a
eleration available on the graphi
s workstation (if any). Thus, they do not
ast shadows,
and their ee
t is not
al
ulated with any form of raytra
ing or similar algorithm. They do,
however, add a ni
e realisti
ee
t to the obje
ts and help give the appearan
e of material
hara
teristi
s to spheres,
ylinders, and so forth. You
an use the mouse to rotate ea
h
of the light sour
es in spa
e to a new position; you
an even set a spe
i
light to rotate
ontinuously about the origin.
The light sour
es are lo
ated at innity, so only their orientation is important. To enter the
move light mode in order to position a spe
i
light, sele
t the `Move Light' submenu from
the `Mouse Mode' menu, and sele
t a light. Not all lights are turned on; those that are on
are indi
ated with a
he
k mark. On
e a light is
hosen, the mouse is set to rotate that light
sour
e; a line should appear from the origin towards the
hosen light. The
ontrols for this
mode are the same as the rotation mode
ontrols, so holding the left button down allows
you to rotate the light around an axis parallel to the s
reen, while holding the middle button
allows for rotations perpendi
ular to the s
reen. To stop moving the light sour
e,
hange the
mouse to another mode via the popup menu or by pressing a hot key.
If the light is not
urrently on, moving that light sour
e will not ae
t any
hange in the
displayed image. To turn a light on or o, use the Lights browser in the upper right of the
Display form [x3.3.8℄.
21
display the atom name), or you
an label geometri
values su
h as the distan
e between two atoms
(a bond label), an angle between three atoms (an angle label), or the dihedral angle formed by four
atoms (a dihedral label). This is done by setting the mouse into the proper pi
king mode and then
sele
ting the relevant atoms with the mouse.
You rst sele
t the proper pi
king mode by using the popup menu, and
hoosing the mode
required to perform the desired a
tion. The available a
tions when in pi
k item mode are:
Pi
k Item Mode ! Query
Cli
king with the left or middle mouse button on an item will print out the name of the item
(e.g. the atom name) to the text
onsole window. The hot key to set this mode is `0'.
Pi
k Item Mode ! Center
This mode is used to
hange the point about whi
h a mole
ule rotates when the mole
ule
is rotated. To
ause a mole
ule to rotate about a spe
i
atom, sele
t this mode and then
li
k on that atom. The rotation point may be restored to its default position (the
enter
of volume of the mole
ule) by exe
uting the `Reset View' option from the popup menu (see
below). The hot key to set the mouse to Pi
k Item Mode ! Centering mode is `
'.
Pi
k Item Mode ! Atom
Cli
king on an atom will toggle on/o a label for the atom. The hot key to set this mode is
`1'.
Pi
k Item Mode ! Bond
Cli
king on two atoms in a row will toggle on/o a bond distan
e label between the two atoms
(a dotted line with the distan
e printed at the midpoint). The hot key to set this mode is `2'.
Pi
k Item Mode ! Angle
Cli
king on three atoms in a row will toggle on/o a label showing the angle formed by the
three atoms. The hot key to set this mode is `3'.
Pi
k Item Mode ! Dihedral
Cli
king on four atoms in a row toggles on/o a label showing the dihedral angle formed by
the four atoms. The hot key to set this mode is `4'.
Pi
k Item Mode ! MoveAtom
In this mode, the position of an atom
an be
hanged by
li
king on the desired atom,
and dragging with the mouse while the button is still pressed. This will
hange the atom
oordinates. The hot key to set this mode is `5'.
Pi
k Item Mode ! MoveResidue
This mode may be used to move all the atoms in a sele
ted residue at the same time. Sele
t
an atom in a residue, and move it to a new position while keeping the mouse button pressed.
All the atoms in the same residue as the sele
ted one will be moved the same amount. Holding
down the <shift> key and the left mouse button while moving the mouse will rotate the atoms
in the residue about the sele
ted atom. If the middle mouse button is held down instead, the
atoms in the residue will rotate about a line drawn through the pi
ked atom and parallel to
a line
oming dire
tly out of the s
reen. This behavior is similar to the usual Rotate mode,
ex
ept that
oordinates of atoms are
hanged.
The hot key to set this mode is `6'.
22
Pi
k Item Mode ! MoveFragment
A fragment is a set of atoms all
onne
ted by a series of
ovalent bonds. This mode a
ts just
like MoveResidue, ex
ept that the atoms whi
h are moved are all in the sele
ted fragment
rather than in the sele
ted residue. This will
hange the atom
oordinates. Holding down
the <shift> key and the left mouse button while moving the mouse will rotate the atoms in
the fragment about the sele
ted atom. If the middle mouse button is held down instead, the
atoms in the fragment will rotate about a line drawn through the pi
ked atom and parallel to
a line
oming dire
tly out of the s
reen. This behavior is similar to the usual Rotate mode,
ex
ept that
oordinates of atoms are
hanged.
The hot key to set this mode is `7'.
Pi
k Item Mode ! MoveMole
ule
This mode may be used to move all the atoms in a sele
ted mole
ule at the same time.
Sele
t an atom in a mole
ule, and move it to a new position while keeping the mouse button
pressed. All the atoms in the same mole
ule as the sele
ted one will be moved the same
amount. Holding down the <shift> key and the left mouse button while moving the mouse
will rotate the atoms in the mole
ule about the sele
ted atom. If the middle mouse button
is held down instead, the atoms in the fragment will rotate about a line drawn through the
pi
ked atom and parallel to a line
oming dire
tly out of the s
reen. This behavior is similar
to the usual Rotate mode, ex
ept that
oordinates of atoms are
hanged.
The hot key to set this mode is `8'.
When a label is added to a mole
ule (say, for a bond, or just to show the name of an atom), a
new entry will be added to the list of
urrent labels whi
h is available via the Labels form [x 3.3.7℄,
or from the Labels popup menu
ommands. These
ontrols also
ontain options to turn the labels
on or o, or to delete them entirely from memory.
Sin
e atom and bond pi
king is a very
ommon a
tion, these two types of labels
an be added
without having to set the mouse to a pi
king mode. To just add an atom label,
li
k on and release
the left mouse button while pointing to an atom, without moving the mouse during the
li
k and
release. To add a bond label,
li
k on and release the middle mouse button on rst one, and then
the other, of the two atoms involved. Again, make sure not to move the mouse while the button is
pressed down.
23
Display Modes ! Stereo O
This
ommand sets the display window ba
k to a non-stereo mode, if it was in another mode
displaying stereo images.
Display Modes ! CrystalEyes
Sele
ting this mode tells VMD to display the graphi
s in stereo, using Stereographi
s Corp.
Crystal Eyes stereo equipment (if available). In this mode, the monitor is set to a spe
ial
s
anning state to display overlapping left and right eye images, and the user must wear spe
ial
glasses to see the stereo image. This is des
ribed in depth in se
tion x9.
Display Modes ! CrossEyes
Fit Submenu
When one has two similar stru
tures, one often wants to
ompare them. What's the dieren
e
between two X-ray stru
tures? How mu
h did the stru
ture
hange during a simulation? To
answer these questions, you must rst gure out how to
ompare two stru
tures, whi
h usually
means that you must nd the root mean square deviation (RMSD).
Formally, given N atom positions from stru
ture x and the
orresponding N atoms from stru
-
ture y with a weighting fa
tor w (i), the RMSD is dened as:
PN 12
wi kxi yi k
i=1P
2
(N ; x; y ) =
N N
RM S D
i=1 wi
Using this equation by itself probably won't give you the answer you are looking for. Imagine
two identi
al stru
tures oset by some distan
e. The RMSD should be 0, but the oset prevents
that from happening. What you really want is the minimum RMSD between two given stru
tures;
the best t. There are many ways to do this, but for VMD we have implemented the method of
Kabs
h (A
ta Cryst. (1978) A34, 827-828 or see le Measure.C in the VMD sour
e
ode). This
algorithm
omputes the transformation, needed to move one stru
ture onto another in order to
minimize the RMSD.
With the mathemati
al prerequisites behind us, we still need to be able to spe
ify how to
hoose
the atoms to
ompare. If you want to
ompare all the atoms in both stru
tures, and they both
have the same number of atoms, then the problem is easy { N is everything. This o
urs most
often in MD simulations when the only thing dierent between two stru
tures are the
oordinates.
24
But what about homologous sequen
es? In this
ase, the number of atoms dier be
ause
while the number of residues is the same, the side
hains have dierent numbers of atoms. The
usual solution is to determine the RMSD based solely on the ba
kbone atoms or, in some X-ray
stru
tures where only the C atoms have been determined, based on the C atoms. In addition,
VMD allows two other methods for tting. Fitting by heavy atoms omits the hydrogens, sin
e their
positions are often not well determined. Fitting by \pi
ked atoms" performs only a translation to
bring one atom dire
tly on top of another mole
ule.
Hopefully the previous dis
ussion revealed the importan
e of the options available in the t
submenu. Before examining ea
h of them in turn, you should be aware of some VMD denitions.
In VMD, a \mole
ule" refers to all the atoms from a stru
ture le. The le may
ontain multiple
mole
ules under standard
hemi
al usage, but VMD still thinks of them as one mole
ule. Instead,
those individual parts are
alled \fragments," for la
k of a better term. With this said, the t
options in the submenu in
lude:
Fit ! Do RMSD Fit
The tting will
hange the stored
oordinates of one of the molu
ules.
Fit ! Print RMSD
VMD wll print out the RMSD between the mole
ules after tting them together, without
hanging their stored
oordinates.
Fit ! Two Mole
ules
25
the
oordinates of a mole
ule). Cli
k and drag one of the mole
ules away from the other so
there is a spa
e between the two.
By default the t routines are
ongured to do the best t but for this example you will only
ompute the RMSD, so pi
k \Fit ! Print RMSD." Now go to the pop-up menu and pi
k
\Fit ! Two Mole
ules ! All Atoms." Look at the VMD
onsole window and you'll see a
new line was printed to show the
urrent state. The mouse should look like a
rosshair. Pi
k
one of the atoms in the rst mole
ule and then one of the atoms in the se
ond mole
ule. The
value of the RMSD will be printed to the s
reen, for example:
In
ase of two identi
al mole
ules the RMSD
al
ulation should, of
ourse, give zero as a
result. To stop
omputing RMSDs, simply
hange the mouse mode to what you want to do
next, for example, press r to go to the rotate mode.
A dis
ussion of advan
ed RMSD features available through the s
ripting interfa
e
an be
found in se
tion x16.7.
VMD's atom alignment should be able to handle most
ommon tasks, but there are some it
annot do. If this o
urs, you might want to look at Andrew Martin's ProFit at
http://www.bio
hem.u
l.a
.uk/~martin/text/ProFit.readme
Labels Submenu
The labels submenu is used to
ontrol the appearan
e of text labels whi
h may be pla
ed on atoms,
and of bond, angle, and dihedral angle labels whi
h may be
reated between atoms. On
e a label
is pla
ed on an atom or set of atoms, through the use of the mouse (see se
tion x 3.1.1), it may
be turned on or o, or deleted entirely, through use of this submenu and also through use of the
Labels form [x 3.3.7℄ form as explained later in this manual. The labels submenu has the following
options:
Labels ! Show
If a label has been previously added to, e.g., an atom, but has been hidden from view, this
submenu
ontains options to turn the label ba
k on. It
ontains submenus for the following
ategories of labels:
{ Labels ! Show ! Atoms
{ Labels ! Show ! Bonds
{ Labels ! Show ! Angles
{ Labels ! Show ! Dihedrals
Ea
h submenu
ontains a list of the labels whi
h have been added to that menu; sele
ting the
label from the submenu turns on that label.
Labels ! Hide
This a
ts identi
ally to the Labels ! Show menu, ex
ept that it is used to hide labels from
view instead of to display them. It
ontains the same submenus of label
ategories.
26
Labels ! Delete
This a
ts identi
ally to the Labels ! Show menu, ex
ept that is is used to delete labels
entirely. It
ontains the same submenus of label
ategories.
Labels ! Delete all
This
ommand will delete all the labels
urrently stored in ea
h label
ategory.
27
Spin/Ro
k S
ene Submenu
These
ommands allow you to spin or ro
k the displayed mole
ules. A spin is a
onstant rotation
in a given dire
tion, and a ro
k is rotation that alternates between one dire
tion and its opposite.
Thus, `Spin X' rotates the system in a
onstant speed around the X axis and `Ro
k Z' ro
ks it
around the Z axis. The speed of rotation and total ro
k angle are
urrently xed. Available
ommands are:
Spin/Ro
k S
ene ! Stop Rotation
Halts the rotational motion of the displayed mole
ules, i.e. sets their spin and ro
k values to
be zero.
Spin/Ro
k S
ene ! Spin (X, Y or Z)
Imparts a
onstant angular velo
ity (spin) to the mole
ules around the sele
ted axis.
Spin/Ro
k S
ene ! Ro
k (X, Y or Z)
Imparts a
onstant angular velo
ity (spin) to the mole
ules around the sele
ted axis. After
the mole
ule rotates through a 180Æ ar
, the rotation dire
tion is reversed.
Stop Rotation
Halts the rotational motion of the displayed mole
ules, i.e. sets their spin and ro
k values to be
zero.
Reset View
VMD does not a
tually alter a mole
ule when it is translated or s
aled. Instead, it
hanges the
transformation matrix used to
onvert the atomi
oordinates to s
reen
oordinates. The initial
denition of this matrix is set up so that the top mole
ule [x 3.3.2℄ takes up most of the s
reen.
However, after moving things about, you may want to reset the view to bring the mole
ule ba
k to
the initial position. Sele
ting `Reset View' allows you to do just that.
Help
Starts an HTML viewer (like Mosai
or Nets
ape) and displays on-line VMD help do
uments. The
viewer is designated by the environment variable VMDHTMLVIEWER [x 17.2℄. Starting help multiple
times will start multiple viewers. The default web browser is Nets
ape. The following do
uments
an be a
essed from this submenu:
28
Qui
k Help - A listing of
ommon pro
edures in VMD
User's Guide - An online version of what you are presently reading
VMD Home Page - The WWW site from whi
h you
an a
ess many VMD do
s
VMD FAQ - A listing of fequently asked VMD questions (plus answers)
Mailing List - Allows you to a
ess an ar
hive of past VMD dis
ussions
T
l - If you need hints on programming the s
ripting interfa
e
Software - Links to
ommon programs used by VMD (i.e. renderers)
Note, you may need to have Nets
ape or Mosai
up and running before su
essfully sele
ting
these options. That is, if you obtain a message su
h as ``nets
ape: not running on display
:0.0'', then you will have to start up the program yourself, after whi
h VMD will be able to dire
t
you to the
orre
t page.
Quit Submenu
Opens a submenu asking if you really want to quit.
Play File
For
es VMD to exe
ute the T
l
ommands found in a le of your
hoosing.
Save Cong
With this option, VMD saves information about the representations and viewing angle
hara
ter-
izing your display of the s
ene. It
reates a log le of T
l
ommands whi
h
an be read ba
k in at
a later time to reprodu
e the images seen in the output window. See also se
tion x 16.3 for text
interfa
e that
an be used to save/restore VMD state information.
Center
Designates the position of the atom being
li
ked on to be the new
enter of transformations su
h
as rotation, s
aling, and translation.
Pi
k
Performs a sele
tion of the atom being
li
ked on. This will toggle labels on and o
29
Info
The Info menu gives you a synopsis of properties for the atom that you are holding the mouse over.
In parti
ular, information about the following elds is identied:
Name - the name of the atom as it appeared in the
oordinate le
Type - the type of the atom, as determined by an internal VMD mat
h-up of the given name
to a likely atom type asso
iated with that name
Index - the internal VMD index used to identify the atom; this is useful for spe
ifying sele
tion
syntax to generate dierent representation styles for parti
ular atoms. For PDB les Index
orresponds to the atom number listed in the le minus 1 (so that the index starts with 0).
Resname - the type of the amino or nu
lei
a
id to whi
h this atom belongs
ResId - the internal VMD ID number of the entire residue to whi
h the parti
ular atom
belongs. E.g., ResId for an atom of a protein is the same as the residue number of that atom
as listed in its PDB le.
Chain - if the
oordinate le
ontained data in the \Chain" eld for this atom, then that data
is given here.
Segname - the name of the segment to whi
h this atom belongs
X, Y, Z - the position of the atom in 3D spa
e
In addition, there is an option \Print" in the Info submenu whi
h simply prints the information
into the
onsole window, in
ase you would like to
ut and paste the data somewhere else.
Mol Status
As dis
ussed in se
tion x3.3.2, there are a number of attributes whi
h
hara
terize the display of a
given mole
ule on the s
reen. A few of the most important properties whi
h
an be toggled on and
o with the MolStatus menu in
lude:
Top - makes the mole
ule to whi
h the pi
ked atom belongs to the top one (a
he
k mark
indi
ates its status)
Make A
tive/Make Ina
tive - several VMD
ommands operate on multiple a
tive mole
ules.
Toggling this parameter will allow you to
ontrol whether or not these a
tions are done to
your mole
ule of interest.
Fix/Free - Fixed mole
ules do not undergo rotation, translation, or s
aling. Free mole
ules
do.
Hide - Refrain from displaying the sele
ted mole
ule
30
Atom Sele
tion
This submenu allows you to sele
tively display portions of a mole
ule based on relationships to the
pi
ked atom. Presently this is the only way to dene atom sele
tions in a graphi
al fashion. All
other sele
tions must be des
ribed via a text-based entry form. The following
riteria may be used.
In ea
h
ase, VMD will render only those atoms whi
h have the following property in
ommon with
the sele
ted atom
Same Residue
Same Chain
Same Segname
Same Fragment
In addition, the
urrently sele
ted atom
an be used as a representative of the entire mole
ule by
hoosing to render only the following atoms of the mole
ule.
ba
kbone - VMD should display ba
kbone atoms only
protein - only atoms
omprising a protein should be displayed
nu
lei
- only display atoms
omprising nu
lei
a
ids
water - only display water atoms in the mole
ule
not waters - only display non-water atoms in the mole
ule
heavy atoms- only display the heavy atoms of the mole
ule
Note that this submenu only ae
ts the rst representation (view) listed in the Graphi
s form
[x3.3.4℄ for the given mole
ule.
Rendering Method
With this submenu, you
an again use the
urrently pi
ked atom as a representative of the entire
sele
tion it belongs to. You
an swit
h the representation style to any of those listed in se
tion x5.
This will ae
t only the rst representation
ontaining the pi
ked atom in the list of representations
a
essible through Graphi
s form.
Coloring Method
Mu
h in the spirit of the Rendering Method submenu, with this option you
an
hange the way
in whi
h the rendered sele
tion asso
iated with the pi
ked atom is
olored. Any of the options
des
ribed in the se
tion on
oloring methods [x 6℄ are valid.
31
3.1.4 Hot Keys
When the mouse is in the graphi
s window, several more
ommands are a
essible via programmable
hot keys. They allow you to do things like
hange mouse modes or advan
e the animation by a
frame by simply pressing a key. The default key bindings are listed in the following tables. The
ommands listed are the text
ommands whi
h are exe
uted when the hot key is pressed; these text
ommands are explained in se
tion x10.3. See se
tion x14.1 for information on how to
ustomize
the behavior of these hot keys and how to add new hot key
ommands.
Hot Key Command Purpose
r, R mouse mode 0 0 enter rotate mode; stop rotation
t, T mouse mode 1 0 enter translate mode
s, S mouse mode 2 0 enter s
aling mode
0 mouse mode 4 0 query item
mouse mode 4 1 pi
k
enter
1 mouse mode 4 2 pi
k atom
2 mouse mode 4 3 pi
k bond (2 atoms)
3 mouse mode 4 4 pi
k angle (3 atoms)
4 mouse mode 4 5 pi
k dihedral (4 atoms)
5 mouse mode 4 6 move atom
6 mouse mode 4 7 move residue
7 mouse mode 4 8 move fragment
8 mouse mode 4 9 move mole
ule
% mouse mode 4 10 for
e on atom
^ mouse mode 4 11 for
e on residue
& mouse mode 4 12 for
e on fragment
32
Hot Key Command Purpose
x ro
k x by 1 -1 spin about x axis
X ro
k x by 1 70 ro
k about x axis
y ro
k y by 1 -1 spin about y axis
Y ro
k y by 1 70 ro
k about y axis
z ro
k z by 1 -1 spin about z axis
Z ro
k z by 1 70 ro
k about z axis
j, Cntl-n rotate x by 2 rotate 2Æ about x
k, Cntl-p rotate x by -2 rotate 2Æ about x
l, Cntl-f rotate y by 2 rotate 2Æ about y
h, Cntl-b rotate y by -2 rotate 2Æ about y
g rotate z by 2 rotate 2Æ about z
G rotate z by -2 rotate 2Æ about z
Cntl-a s
ale by 1.1 enlarge 10 per
ent
Cntl-z s
ale by 0.9 shrink 10 per
ent
Table 3.2: Rotation & s
aling hot keys.
3.2.1 Buttons
Figure 3.1 shows some of the buttons used by VMD. For example, the button in 3.1 A draws all
the loaded les and the one in 3.1 C writes the
urrent s
reen des
ription for use in a ray-tra
ing
program. Some buttons, as in 3.1 B, indi
ate if something is turned on or o by turning an indi
ator
light on or o. They
an be turned on or o by
li
king on the button. Others, shown in 3.1 D,
indi
ate that they are pressed by appearing re
essed.
One
ommon button usage motif in VMD is shown in gure 3.2. These indi
ate that the value
in the middle
an be in
reased by pressing the button(s) on the right and de
reased by pressing
the button(s) on the left. If there are two sets of buttons, as in 3.2 B, then the outer set of buttons
hange the number in larger in
rements than the inner set.
33
Hot Key Command Purpose
Alt-M menu main off;menu main on Show main menu
Alt-m menu mol off;menu mol on Show mol menu
Alt-f menu files off;menu files on Show les menu
Alt-a menu animate off;menu animate on Show animate menu
Alt-e menu edit off;menu edit on Show edit menu
Alt-g menu graphi
s off;menu graphi
s on Show graphi
s menu
Alt-l menu labels off;menu labels on Show labels menu
Alt-r menu render off;menu render on Show render menu
Alt-d menu display off;menu display on Show display menu
Alt-
menu
olor off;menu
olor on Show
olor menu
Alt-s menu sim off;menu sim on Show sim menu
Alt-t menu tra
ker off;menu tra
ker on Show tra
ker menu
Cntl-r display resetview Reset display
Alt-q quit
onfirm Quit VMD with
onrmation
Alt-Q quit Quit VMD
Alt-h hyperref invert Invert hyper text mode (NOT help)
Table 3.3: Menu
ontrol hot keys.
Hot Key Command Purpose
+,f,F animate next move to next frame
-,b,B animate prev move to previous frame
.,> animate forward play animation forward
, animate reverse play animation reverse
< animate reverse play animation reverse
/, ? animate pause stop animation
Table 3.4: Animation hot keys.
3.2.2 Sliders
Sliders are used somewhat rarely in VMD, typi
ally to
ontrol some smoothly varying quantity
that should always be set within some denite limits. An example from ea
h is shown in gure 3.3.
To use a slider,
li
k and drag on the interior re
tangle.
3.2.3 Choosers
Choosers look like the items in gure 3.4. They are used to sele
t one of a list of possible
hoi
es.
There are two ways to
hange the sele
tion. Cli
king with the left mouse button brings up the
list of
hoi
es. Move the mouse to the
orre
t sele
tion and release the button to pi
k that item,
or release the button outside of the menu to keep the original sele
tion. Cli
king with the right
mouse button advan
es the sele
tion through the list by one. If the
urrently sele
ted item is the
last element of the list, the sele
tion loops around to the rst item.
34
Figure 3.2: A
ommon button motif
35
Figure 3.5: A Text Entry Area
3.2.5 Browsers
Another way to view a list of items is to use a browser, as shown in gure 3.6. A browser displays
several items on the s
reen (unlike the
hooser whi
h only shows one) and has a slider whi
h is used
to s
roll though all the available options. Sele
ted items are highlighted. Some browsers only allow
one item to be sele
ted, while others allow multiple sele
tions and do not automati
ally desele
t a
line when a new item is pi
ked. To turn o a sele
ted item when multiple sele
tions are allowed,
li
k on the item, and the highlight will disappear.
One
ommon browser motif uses
oupled browsers to des
ribe two-level hierar
hies. Sele
ting
a line in the rst browser determines the possible sele
tions in the se
ond. An example is shown in
gure 3.6 B.
36
Figure 3.7: The File Browser
37
Press the Quit button to exit VMD. This will bring up another form whi
h veries that you do
indeed wish to exit. Press Yes to quit, or No to return to VMD.
38
Changing the Mole
ule's Status
The status of a given mole
ule
an be
hanged by sele
ting the mole
ule in the browser and pressing
the toggle that
ontrols the appropriate
ag. The a
tive, drawn, and xed status values
an be
hanged for several mole
ules at the same time by sele
ting several mole
ules before pressing the
toggle. However, only one mole
ule
an be top at any one time, so Make Top
an only be applied
to one sele
tion. Pressing one of the All ... or No ... buttons either sets or unsets
orresponding
ag on all the loaded mole
ules.
The Single A/D/T button makes the sele
ted mole
ule a
tive, displayed, and top. It also resets
the s
ene so the given mole
ule roughly lls the s
reen. It is a qui
k way to swit
h from viewing
one mole
ule to another when it is desirable to only show one mole
ule within the graphi
s display
window at a time.
39
a
ess to browsers whi
h display the lists of atom names, residue names, and so forth for the sele
ted
mole
ule.
This form is used to
ontrol the appearan
e of one mole
ule at a time. The mole
ule it ae
ts is
sele
ted in the `Sele
ted Mole
ule'
hooser at the top of the form. The browser below this
hooser
lists the views available for the mole
ule. Ea
h line of the browser shows information about the
drawing method, the
oloring method, and the sele
tion whi
h
ompletely spe
ify the view. To
hange the attributes of a given view,
li
k on the view that should be
hanged. The atom sele
tion
for that view will appear in the Atom Sele
tion text area and, if the Image Controls button is
pressed, the drawing and
oloring method
hoosers will also
hange to re
e
t the
urrent view.
To add a new view of the mole
ule, enter the sele
tion into the Atom Sele
tion text area (or
keep what is there) and press Create New. This adds the view to the
urrently sele
ted mole
ule.
To delete a view, sele
t the view in the browser and press the Delete button. Bear in mind that
this does not delete the mole
ule, it only deletes a view of the mole
ule. (To delete the mole
ule,
use the Mol form [x 3.3.2℄.)
Image Controls
The drawing method indi
ates how the view's sele
ted atoms are displayed in the graphi
s display
window, and the
oloring method indi
ates how to
olor the displayed atoms. The sele
ted view's
drawing [x 5℄ and
oloring [x 6℄ methods are
hanged via the
orresponding
hooser. Some of the
methods have additional
ontrols whi
h will appear when that parti
ular method (either drawing
or
oloring) is
hosen. The
ontrols for the drawing method are:
Line Width { only works on some versions of IRIX (see se
tion x12.1).
Sphere Res { detail level for rendered spheres
Sphere Rad { sphere radius s
aling fa
tor
Cylinder Res {
ylinder resolution (number of sides in the polygon approximation)
Cylinder Rad {
ylinder radius s
aling fa
tor
For the
oloring method, the transparent button allows you to make the drawing representation
semi-transparent (see x6.3). Also, when `ColorID' is
hosen for the
oloring method, a text entry
box is shown allowing you to spe
ify the index of a
olor to use for the sele
tion, whi
h may be a
number from 0 to 15.
40
Changing Views
In addition to adding or removing views from a mole
ule, this form is also used to
hange how an
existing view is displayed. After sele
ting a view for a spe
i
mole
ule, the form's
ontrols are
updated to show the
urrent settings for that view. Changing the settings will automati
ally
hange
the respe
tive view, and the new format will be shown in the graphi
s display window. The display
will be updated after every
hange, however, whi
h is sometimes not always desirable (for example,
if a number of dierent aspe
ts need to be
hanged at on
e). The Apply Changes Automati
ally
button may be toggled o to
hange this behavior { if it is turned o, sele
ted
hanges will only be
applied when the Apply Changes button is pressed. Sele
ting a dierent view, or pressing the Clear
Changes button, before applying the
hanges will reset the form
ontrols to the
urrent settings of
the sele
ted view.
To
lear the sele
tion text for a given view double
li
k on the Clear Changes button. The rst
(and every odd)
li
k reverts the text to its previous setting, the se
ond (and every even)
li
k
lears it
ompletely.
A few details regarding the me
hanism for `sele
tions' is in order. For beginners, it is best
to use the Atom Name Lists and the Image Controls together in order to generate and organize
views. For instan
e, load a mole
ule and
hoose the Atom Name Lists option. If you double
li
k
on the name keyword, you will noti
e that two things happen. First, a listing of values appears to
the right of the keyword. Se
ond, the word \name" appears in the text sele
tion window. Now if
you go ahead and single
li
k on some of the available values, you will noti
e that they are also
printed in the text sele
tion box. In this way you
an use the mouse to generate a des
ription of
your sele
tion and then hit Apply Changes in order to have that des
ription register with VMD.
The moral is, if you want to
reate a
omplex des
ription qui
kly with the mouse:
Use the Atom Name Lists to see what your available options are.
Double
li
k on the keyword in order to enter it in the sele
tion text box.
Single
li
k on ea
h of the desired values for the keyword that you want to display.
Hit the Apply Changes button.
Go ba
k to Image Controls and
ustomize your style of presentation
As a nal note, keep in mind that both the Color form [x3.3.4℄ and the Mole
ule form [x3.3.2℄
an be a
essed from the Graphi
s form by
li
king on the buttons lo
ated in the upper
orners of
the form.
41
3.3.5 Animate Form
Ea
h mole
ule displayed by VMD
an
ontain multiple sets of atomi
oordinates, whi
h may be
played ba
k to animate the mole
ule and show its motion. The sour
e of the
oordinates
an be, for
example, from a mole
ular dynami
s simulation, or simply multiple versions of the same mole
ular
stru
ture. The Animate form is one way to
ontrol the playba
k of these traje
tories.
The Animate form handles the traje
tory playba
k of the a
tive mole
ules [x3.3.2℄. The se
ond
line of
ontrols
ontains ve buttons whi
h a
t like the buttons on a tape player or VCR. The
enter
button (with the square) stops the animation. The button to the right of the stop button advan
es
the animation one step forward in the traje
tory, and the next button to the right
ontinually steps
the animation forward. Similarly, the buttons to the left of the stop button steps the animation
ba
kwards either on
e or
ontinuously. (Just remember that the button that looks like fast-forward
is really the play button, and that the one that looks like the play button is really the single step
forward button.)
The mole
ular status shown in this form re
e
ts the state of the top mole
ule. Commands
entered via this form, however, ae
t all a
tive, not just the top mole
ule. This makes it possible
to position several dierent mole
ules at the same frame, and to start them in motion at the same
time with one
ommand. But, sin
e it is not immediately obvious from the information shown in
this form what mole
ules will be ae
ted, some
are must be taken to make sure you have the
proper mole
ules a
tive that you wish to animate.
Animation Speed
The rate of playba
k
an be
ontrolled in two ways. The Frame Skip
ontrols
hange the step size.
By default, the frame skip is 1, so ea
h step of the playba
k in
reases (or de
reases) the animation
frame number by one. If the frame skip is 5 then the animation pro
eeds ve times faster be
ause
only 1/5 of the frames are shown.
The Speed slider at the bottom of the form also ae
ts the playba
k speed. Internally, this
ontrols how many s
reen updates are needed between ea
h step. By default, the slider is at the
far right indi
ating that one step is performed for ea
h s
reen redraw. Moving the slider to the left
in
reases the minimum time required between updates.
Looping Styles
When the animation is playing forward and rea
hes the end of the data available for the top
mole
ule, one of three possible a
tions takes pla
e, as spe
ied in the Style
hooser. The default
42
is `Loop', whi
h will reset the a
tive mole
ules to the rst frame and
ontinue playing forward.
`On
e' will stop the animation when it rea
hes the last frame, and `Ro
k' reverses the dire
tion of
animation. The a
tions are symmetri
al when the animation is playing in reverse.
Reading Frames
VMD
an read in new
oordinate sets from either PDB les (to add a single new frame to the
animation), from as
ii CRD les (whi
h may
ontain several frames), or from binary DCD les
(whi
h may also
ontain several frames). The new
oordinate sets are appended to the end of the
stored animation list for the sele
ted mole
ule. At present, there is no way to use Babel to append
non-PDB and non-CRD/DCD les. The format is determined by sele
ting the appropriate name
in the File Type
hooser. If you want to read in all the information from the le, make sure that the
Amount
hooser says `All', then press the Read button in the bottom right
orner. This will bring
up the le browser so you
an sele
t the le. (Unlike the Files form, the le is loaded immediately
after the lename is entered in the le browser.)
Sometimes you may not want to read in a whole CRD/DCD le. For example, you may only
want the last frame, or every tenth frame. You
an do this by
hoosing the `Sele
ted' option in the
Amount
hooser[x 3.3.6℄. This brings up the frame skip sele
tion
ontrols. On
e you've
hosen the
appropriate values, press the Read button to bring up the le browser and nish as mentioned in
the previous paragraph. The Amount options are ignored when reading in PDB les.
Writing Frames
Using the `Write File' a
tion, you
an write the loaded frames to le in either the PDB or the CRD
ASCII formats, or you may write to a binary le following the DCD format. This may be used
to write out a new traje
tory in a single le after assembling many frames from dierent sour
es
(su
h as PDB CRD, or DCD les, or even from a remote simulation). You
an also use this, in
ombination with Read File, as a way to make PDB les from a DCD/CRD traje
tory.
You
an either save the entire stored traje
tory, or a sli
e of the data by using the Amount
hooser [x 3.3.6℄. Then sele
t the appropriate output le type in the File Type
hooser, and press
the Write button in the bottom right
orner. This brings up the le browser, whi
h you
an use to
enter the new lename. On
e you press the Write button in the browser, the le will be written
without further
onrmation. See se
tion on atomsele
t
ommand [x 13℄ for information on how
to write atom
oordinates for an atom sele
tion in a PDB le.
Deleting Frames
This provides a way to delete frames from memory. First,
hoose the frames you wish to delete with
the Amount
hooser and (possibly) the frame skip
ontrols, then press the Delete button. There is
43
no
onrmation of deletions.
One problem with this me
hanism is there is no way to delete every frame ex
ept for those
given by the frame skip. You
an get around this by writing the skip sele
tion to a CRD/DCD le,
deleting all the frames from memory, then reading the skip ba
k in from disk.
Amount Chooser
The meaning of this option varies depending on the a
tion. If `All' is sele
ted, then all the frames
will be read from the le, or all the frames will be written to the le, or all the frames will be
deleted from memory.
The other option is `Sele
ted.' This will bring up three
ontrols, labeled Begin, End, and Skip.
These make it possible to use a subset of the frames, starting at frame Begin and sele
ting every
Skip frames until the End is rea
hed. For instan
e, to sele
t every fth frame between frames 14
and 98, set:
Begin to 14
End to 98
Skip to 5
(Remember that frame numbers in VMD start at 0, so frame 0 is the rst frame.) The value
`-1' is a spe
ial number; setting Begin to -1 is the same as starting at the rst frame, End = -1 is
the same as ending at the last frame, and Skip = -1 is the same as taking one step.
When the A
tion is `Read File', the sele
tion is applied to the frames from the le to be read.
When it is `Write File', the sele
tion determines the frames to be written, and when `Delete Frames',
the sele
tion determines the frames to be deleted from memory.
Label
ategories
The Category
hooser (in the upper left) is used to sele
t whi
h
ategory of labels to manipulate.
The dierent label
ategories in
lude:
Atoms, whi
h are shown as a text string next to the atom listing the name and residue of the
atom;
Bonds, whi
h are shown as dotted lines between the atoms with the bond length displayed
at the bond midpoint;
Angles, whi
h are shown as dotted lines between the three atoms with the angle displayed at
the
enter of the dened triangle;
44
Dihedrals, whi
h are shown as dotted lines between the four atoms with the dihedral angle
(the angle between the planes formed by the rst three atoms and the last three atoms) shown
at the midpoint of the torsional bond.
dihedrals
All the labels for the sele
ted
ategory whi
h have been previously added are displayed in the
browser in the
enter of the form. The line itself
ontains from 1 to 4 atom names, depending
on the
ategory; the atom names have the form <residue name><residue id>:<atom name>
followed by either (on) or (off). The last word indi
ates if the label is turned on or o.
45
3.3.8 Display Form
The Display form
ontrols many of the
hara
teristi
s of the graphi
s display window. The
hara
-
teristi
s whi
h may be modied in
lude:
AA { Turns antialiasing on or o. Antialiasing helps smooth out the sometimes jagged
appearan
e of lines resulting from the dis
rete pixels used to represent a line on the s
reen. It
is highly re
ommended to leave this on, but on some versions of IRIX (i.e., 6.3) antialiasing
is known to be buggy.
Depth
ue { Turns depth
ueing on or o. Depth
ueing
auses the more distant obje
ts to
blend into the ba
kground
olor. This
an help give a 3D ee
t when viewing in a non-stereo
mode. Warning: There is a known bug that
auses the antialias and depth
ue buttons to
stop working. The existen
e of the bug is known, but the solution is not (yet). Until this is
worked out, it is suggested to not
hange the AA or Depth
ue settings.
Axes { A set of XYZ axes may be displayed at any one of ve pla
es on the s
reen (ea
h of
the
orners or the
enter) or turned o. This is
ontrolled by the Axes
hooser.
Stage { The Stage browser
ontrols the stage, whi
h is a
he
kerboard plane that
an be
lo
ated in any one of six pla
es or turned o.
Detail { The degree of detail in the displayed image. Nothing: show nothing; Points: show
everything as points; Wireframe: show only wireframe representation for spheres,
ylinders,
et
.; Flat: show a
at image (no 3D ee
ts); Full: show
omplete detail. The performan
e
in
reases as the level of detail de
reases.
Alt. Detail { Same as Detail, but for the display during mouse operations on the displayed
mole
ules, su
h as rotation, translation and s
aling. Sin
e VMD redraws the s
reen often
while the mole
ule is rotated, it is sometimes bene
ial to set lower level of detail for the time
of rotation for better performan
e.
Perspe
tive { The view of the s
ene
an be Perspe
tive or Orthographi
. In the perspe
-
tive view (the default), obje
ts whi
h are far away are smaller than those near by. In the
orthographi
view, both obje
ts appear at the same s
ale.
Stereo, Eye Sep, and Fo
al L { These
ontrols set the stereo mode and parameters; stereo
is dis
ussed fully in
hapter x9. The Stereo
hooser
hanges the stereo mode, while the Eye
Sep and Fo
al L
ontrols
hange the eye separation distan
e and the fo
al length, respe
tively.
Lights { The graphi
s display window
an use up to four separate light sour
es to add a
realisti
ee
t to displayed graphi
al obje
ts. The Lights On browser turns these light sour
es
on or o. If the number is highlighted, the light is on, and
li
king on it turns the light o.
See se
tin x3.1.1 for more dis
ussion regarding lights.
Clipping Planes (Near Clip and Far Clip) { Clipping o
urs when only the part of an
image within a
ertain region of spa
e is drawn. Only those parts of graphi
al obje
ts whi
h
are between the near and far
lipping planes are drawn. This feature is useful for viewing
a sli
e of the mole
ule. The
lipping planes also ae
t the depth
ueing, if it is turned on.
Obje
ts at the near
lipping plane are distin
t while obje
ts at the far
lipping plane are
indistinguishable from the ba
kground
olor.
46
The positions of the
lipping planes are
hanged with the Near Clip and Far Clip
ontrols. It
is not possible for the near
lip to be farther away than the far
lip. When using stereo, the
near
lip should be de
reased, or even set to zero.
S
reen Height (H) and Distan
e (D) { The s
reen distan
e parameter determines
the distan
e, in `world'
oordinates, from the origin to the display s
reen. If this is zero, the
origin of the
oordinate system in whi
h mole
ules (and all other graphi
al obje
ts) are drawn
oin
ides with the
enter of the display. If it is less than 0, the origin is lo
ated between the
viewer and the s
reen, while if it is greater than 0, the s
reen is lo
ated
loser to the viewer
than the origin. A negative value puts any stereo image in front of the s
reen, aiding the
three-dimensional ee
t; a positive value results in a stereo image that is behind the s
reen,
a less dramati
ee
t (but easier to see, for some people) stereo ee
t.
The s
reen height, along with the s
reen distan
e, denes the geometry and position of the
display s
reen relative to the viewer. The s
reen height is the verti
al size of the display
s
reen, in `world'
oordinates. Ea
h mole
ule is initially s
aled and translated to t within
a 2 x 2 x 2 box
entered at the origin; so the s
reen height helps determine how large the
mole
ule appears initially to the viewer. This parameter is used mainly to
ongure the VMD
display to the dimensions and position of a large-s
reen display, su
h as a proje
tor, that may
be used as a stereo display.
Figure 3.17 des
ribes the relationship between the s
reen height, the s
reen distan
e, and the
world
oordinate spa
e.
47
button is depressed, as you move one slider the rest will follow. Press the tie button again to untie
the sliders.
For example, suppose, we don't really like the appearan
e of the green
olor and we want to
make it darker. To see what is happening we'll
hange the
olor of the ba
kground, so
hoose
Display in the
ategory eld of the upper part of the Color form, then
hoose Ba
kground, and,
nally,
hoose green. The ba
kground should be
ome green. The (default) RGB values are 0.20,
0.70, 0.20. To make the
olor darker, let's bring the RGB values down by moving the red, green
and blue sliders to the left. You
an see the
olor
hanging as you move the sliders, so this way
you
an easily pi
k the
olor you prefer to be named 'green'. The denition
an be immediately
brought ba
k to the default values by pressing the 'Default' button on the form. Note, that moving
the sliders
hanges both solid and transparent ('green' and 'trans green')
olors (see Chapter x 6
for details).
Color S
ale
Several of the
oloring methods in the graphi
s form are used to
olor a range of values, as
ompared
to a list of names. The a
tual
oloring is determined by the
olor s
ale [x6.2.2℄.
There is only one
olor s
ale available at any one time (out of the ten possible) and it is
hanged
with the Color S
ale Method
hooser. Changing the values of Minimum and Midpoint
hange some
of the proportionality values used in making the s
ale.
The
olors used by the
olor s
ale are not the
olors in the
olor map, so the Edit Colors part
of the form will not ae
t the
olor s
ale
olors.
Rendering
The rendering pro
ess works in two stages. The rst step writes an input le for the image
pro
essing program sele
ted in the Output Formats browser, and the se
ond (optionally) starts
the rendering pro
ess. The le is given the name entered in the Output Filename eld; a default
name is given when a new format is sele
ted, so it is best to hold o entering the lename until
after the le format is sele
ted. Another way to sele
t the lename is available by pressing the
List... button, whi
h opens up a le browser.
Pressing the Go button writes the data le. After that, the Render Command is exe
uted. The
default
ommand should start the appropriate rendering program if it is available.
The fastest of the
urrently supported programs is Raster3D. The rendering
ommand for it
has been set up to
all the SGI program ipaste when the RGB output le is nished. VMD will
wait for the rendering to nish, whi
h
auses VMD to freeze, so you may want to run the job in
the ba
kground. This
an be done by en
losing the existing text with ()'s and putting an & at the
end. For example, the way to make the Raster3D render
ommand run in the ba
kground is:
(render < %s -sgi %s.rgb; ipaste %s.rgb)&
48
Caution
There are some issues to
onsider when using the rendering
ommands, whi
h
an lead to dis
rep-
an
ies between the s
ene displayed in the VMD graphi
s display window and the image generated
by the image pro
essing appli
ation. These issues in
lude:
The near and far
lipping planes are ignored;
The
olors or intensities may be slightly dierent, due to dierent
olormaps, gamma values,
or lighting models;
The rendering
ommands do not
urrently support stereo output, so even if the display is
urrently in stereo mode, a non-stereo perspe
tive will be used for the rendering program
input s
ript;
Text is generally not available as a graphi
s primitive in the image pro
essor input s
ripts, so
label text will not appear, although the lines of bond, angle, et
. labels will be drawn. The
only ex
eption is in Posts
ript output, whi
h supports text output.
Dotted spheres are not drawn with dots.
The ba
kground
olor may be bla
k, as not all output formats support a ba
kground
olor
other than bla
k;
Cylinders will look slightly dierent; in VMD
ylinders are drawn as
ylindri
al polygons
with N fa
ets, while they may appear as smooth in the nal output (whi
h is generally looked
upon as an improvement!)
49
pla
e { the ma
hine that
ontrols it. Devi
es that
annot yet be used on arbitrary
omputers
over the network must have the keyword lo
al here to be
ompatible with future versions.
name { the name of the devi
e within that ma
hine. If multiple devi
es
an't
urrently exist,
su
h as with the CAVE, then a standard name should be used, su
h as
ave, so that the
same USL will make sense in the future, when multiple devi
es are allowed.
nums { a
omma-separated list of numbers of devi
es belonging to that names (optional,
defaults to zero). Some devi
es demand only one number or a spe
i
number but button
devi
es should work
orre
tly now.
The lines of a sensor
onguration le
ome in four
avors:
Comments begin with # and are ignored.
Empty lines are also ignored.
Devi
e lines have the form devi
e name USL, where name is the name that VMD will use
to refer to the devi
e, and USL is the devi
e's USL.
Options tell VMD how to use the most re
ently listed devi
e. Currently, there are four
supported options:
{ \s
ale x" s
ales the position of a tra
ker by a fa
tor x.
{ \offset x y z " adds a
onstant ve
tor to the position of a tra
ker.
{ \rot right|left A00 A01 : : : A33 " multiplies the orientation matrix returned by a
tra
ker on either the right or the left by the matrix A.
{ \for
es
ale x" multiplies the for
e applied to a for
e-feedba
k devi
e by the amount x.
Here is an example, showing all the possible things you
an do with a sensor
onguration le:
# the PHANToM
onne
ted to the
omputer "odessa"
devi
e phantomtra
ker vrpntra
ker://odessa/Phantom0
s
ale 10
rot left 0 0 -1 0 1 0 1 0 0
50
devi
e
avetra
ker
avetra
ker://
ave/
ave
s
ale 0.32
offset 0 -3.03 0
# CAVE buttons
devi
e
avebuttons
avebuttons://
ave/
ave:0,1,2,3
for e-feedba k to the user, but none of them a tually require hapti devi es to work.
51
if the button is pressed far from any atoms in the sele
tion; this is intended to make it easier
for the user to apply for
es only on those atoms he/she intends to steer.
The SMD Tool is a tool intended for use with steered mole
ular dynami
s (SMD). It allows
the user to pull on atoms in only one dire
tion, so that the for
es and motions of the mole
ule
an be more easily analyzed. The user
li
ks at a \target point", drags the pointer ba
k to
the atom he wishes to pull on, then releases the button. The tool now behaves like a tug
tool, but for
es are restri
ted to lie parallel to the line through the atom and the target point.
Using the SMD tool with a hapti
devi
e feels like pushing against a non-rotating, fri
tionless
plane, sin
e the for
es applied to the user's hand must also all point parallel to this line. The
for
e applied and the position of the atom are automati
ally re
orded to the le pull.txt.
To add a new tool to a VMD session, open the tra
ker form and
li
k the Create Tool button.
The tool's number and type are displayed in the list to the left. Devi
es
an be added to the tool by
sele
ting them from the Add Devi
e menu, or removed with the Delete Devi
e button. Some of
the options that
an be spe
ied in the sensor
onguration le
an be edited in using the
ontrols
below, and the tool's type
an be
hanged with the Type menu.
52
will be sent to the remote simulation to
hange it, and there may be some delay between when the
simulation gets the
ommand, a
ts on it, and the results propagate ba
k to VMD.
In the
entral portion of the form is shown a status message for the
hosen
onne
tion. A large
browser near the bottom of the Sim form displays the dierent energy values for the system being
simulated (kineti
, ele
trostati
, et
.), as well as the
urrent timestep and the temperature. It is
automati
ally updated ea
h time a new atomi
oordinate set (timestep) is re
eived and stored in
the VMD animation loop.
At the bottom of the Sim form are two buttons:
The Kill button, whi
h when pressed will terminate the remote simulation whi
h is
urrently
sele
ted in the
onne
tion
hooser. This will not delete the mole
ule stored in VMD's internal
lists, it will just stop the remote program from exe
uting (and thus stop the transfer of new
timesteps from that program to VMD). You must go to the Mole
ule form and delete the
mole
ule from that list to
ompletely remove the mole
ule from VMD memory.
The Deta
h button, whi
h when pressed will sever the
onne
tion between VMD and NAMD,
but will NOT kill the NAMD pro
ess. Instead, the simulation will be left running.
53
The pro
ess that started the
onta
t is the
lient VMD and the one that was
onta
ted is the server
VMD. The other way is to use a T
l based shell whi
h has T
l-DP
ompiled in. Sour
e (or look
at) the le $env(VMDDIR)/s
ripts/vmd/external.t
l to see how the DP
alls are made.
The
lient pro
ess sends a new
ommand to the server with the
ommand external send
<
ommand>.
54
55
Figure 3.9: The Mole
ules form
56
Figure 3.12: The Graphi
s form (in Atom Name Lists mode)
57
Figure 3.14: The Edit Animation form
58
Figure 3.16: The Display form
59
4/3 SCRHEIGHT
i.e. 8.0
Z
SCRDIST
Viewer’s X i.e. -2.0
Eye Position
SCRHEIGHT
i.e. 6.0
Figure 3.17: Relationship between s
reen height (SCRHEIGHT), s
reen distan
e to origin
(SCRDIST), and the viewer
60
Figure 3.19: The Render form
61
Chapter 4
62
these to a series of PDB les whi
h VMD then reads as an animation. For more information about
Babel, see http://www.eyesopen.
om/babel.html VMD supports version 1.6 of Babel. Older
versions of Babel will not work
orre
tly with VMD.
VMD at present has no provision for using Babel to
onvert the output PDB CRD, or DCD les
to anything else (see se
tions x3.3.6, x 10.3.1 and x 13.2 for information on writing output les).
The Babel-VMD interfa
e uses two environment variables [x17.2℄, VMDBABELBIN and VMDTMPDIR.
The rst spe
ies the absolute lo
ation for the Babel binary (i.e. it must in
lude the name of the
exe
utable itself, su
h as /usr/lo
al/bin/babel). The se
ond denes the lo
ation for the temporary
PDB les made by Babel.
There are a
tually several types of fragments. Protein and nu
lei
fragments are homogeneous;
either all proteins or all nu
lei
a
ids. However, it is quite possible for a protein to be
onne
ted to
a nu
lei
a
id or some other non-protein. When this o
urs, a warning message is printed, as in:
Warning 1) Unusual bond between residues 1 and 2
These warnings are known to o
ur with terminal amino a
ids, zin
ngers, myristolated
residues, and poorly dened stru
tures.
63
4.3 Raster3D le format
In addition to the mole
ular le formats, VMD
an read the input le for Raster3D. (Raster3D
onverts an input le into a shaded raster image for use in making high quality pi
tures. It is often
used with MolS
ript.) The ability to read Raster3D allows users to view MolS
ript les in 3D and
in
orporate spe
ial images into the display without having to edit the VMD
ode. If anyone has
used this se
ond option, we would be interested in knowing what was done.
The le format, whi
h is part of the Raster3D do
umentation, des
ribes a simple
olle
tion of
triangles, spheres, and
ylinders with either
at or spheri
al ends. Ea
h shape is
olored by an
RGB triplet.
64
Chapter 5
5.1 Lines
The default representation is `Lines', whi
h is also known as `wireframe'. It draws a line between
ea
h atom and the atoms to whi
h it is bonded. Both atoms have to be sele
ted before the bond
will be drawn. The rst half of ea
h bond is
olored appropriately for the rst atom, while the
olor of the nal half
orresponds to the se
ond atom.
The only parameter for this option is the line thi
kness. On some SGIs you will only noti
e a
dieren
e between settings of 0, 1, and 2. Anything beyond 2 looks the same as 2. To understand
65
Representation styles Des
ription
Lines simple lines for bonds, points for atoms
Bonds lighted
ylinders for bonds
CPK s
aled VDW spheres, with
ylinders for bonds
Points just points for atoms, no bonds
VDW solid van der Waal spheres for atoms, no bonds
Dotted dotted van der Wall spheres for atoms, no bonds
Solvent dotted representation of the solvent a
essible surfa
e
Tra
e
onne
ted
ylindri
al segments through C atoms
Li
ori
e spheres for atoms,
ylinders for bonds, same radius
Ribbons
at ribbon through the C atoms
Tube smooth
ylindri
al tube through the C atoms
Cartoon
artoon diagram (
ylinders and ribbons) based on se
ondary stru
ture
MSMS mole
ular surfa
e as determined by the program MSMS
HBonds display hydrogen bonds
Surf mole
ular surfa
e as determined by SURF
O do not draw anything
Table 5.1: Mole
ular view representation styles.
why, you should see the man page for linewidth (look at an ex
erpt from that man page in se
tion
x12.1).
5.2 Bonds
Nearly everything about this option is the same as lines ex
ept that instead of drawing a bond as
a line between two atoms, a
ylinder is drawn instead. To be more spe
i
, it draws an n-sided
prism, where the number of sides is determined in the Graphi
s form by the \Bond Res"
ontrol
and the radius is given by the value of \Bond Rad," in Angstroms. If the radius or number of sides
gets too small, the bonds are drawn as lines.
In order to ne tune the bond representation, VMD does a small amount of tri
kery to the
prisms. That is, imagine two hollow
ylinders
oming together so that the
enter of the fa
e of one
ylinder is in the same position as the
enter of the fa
e of the other
ylinder. Also suppose these
two
ylinders
ome together at 90 degrees. Although most of these two
ylinders will overlap, there
will appear to be a gap at their interse
tion.
To
orre
t for this problem, VMD extends both
ylinders somewhat so that the far ends tou
h.
If one looks
losely, this produ
es more of an overlap, but it is mu
h ni
er looking than the gap.
When three or more bonds join at one atom, VMD
hooses the lowest numbered bond and extends
all other bonds to meet with that one. It then extends that lowest numbered bond to meet with
the se
ond lowest numbered one. A bit te
hni
al, but not too diÆ
ult to do.
5.3 CPK
`CPK' is a
ombination of both `Bonds' and `VDW' in that it draws the atoms as spheres and the
bonds as
ylinders. The resolution and radius
an be modied independently. The radius of the
sphere drawn in CPK mode is by default smaller than the sphere drawn in VDW mode, but this
66
radius
an be made larger. Sin
e a sphere is drawn for ea
h atom, it will always be slower than
the VDW option, but we will work on performan
e for future versions. If the values for a sphere
or bond attribute are too small, then those obje
ts will not be drawn.
5.4 Points
`Points' draws ea
h atom as a point, and does not draw any of the bonds. This option is not terribly
useful.
5.5 VDW
`VDW' draws the atoms as spheres. The radius used is the van der Waals radius multiplied by a
user-sele
table s
aling fa
tor. The sphere resolution determines how nely to tessellate the spheres
that are drawn. Drawing spheres takes some time, sin
e they are built from a
olle
tion of triangles
produ
ed by a sphere library external to GL/OpenGL.
For those of you interested in the details, what happens is as follows: At the most primitive level,
the sphere drawing algorithm starts with a shape, su
h as a square bipyramid (two pyramids with a
square base joined base-to-base). Then a re
ursive bise
tion is applied to this shape, where at ea
h
level of re
ursion, given a triangular fa
e, the endpoints of the
enters are
omputed and s
aled so
as to be on the surfa
e of the sphere. Given these endpoints and
enters, one
an
onstru
t four
sub-triangles, whi
h themselves are subje
t to bise
tion on the next level of re
ursion. A diagram
illustrating these
on
epts is given below.
Normalize a, b,
a = (0+2)/2
b = (0+1)/2
= (1+2)/2
1
/\ Normalize a, b,
/ \
b/____\
Constru
t new triangles
/\ /\ [0,b,a℄
/ \ / \ [b,1,
℄
/____\/____\ [a,b,
℄
0 a 2 [a,
,2℄
67
The \Sphere Res" setting is a
tually
ontrolling the number of levels of re
ursion being applied.
Note:: Due to variations in atom naming
onventions, in rare instan
es VMD may improperly
assign VDW radii to spe
i
atoms, sin
e VMD determines ea
h atom type based on the rst letter
forming its name. For example, VMD would assume an atom named \HG" to be a hydrogen rather
than a mer
ury. If this happens, you are always free to redene the radii, using a syntax mu
h like
that below:
set sel [atomsele
t top ``name HG''℄
$sel set radius 1.9
5.6 Dotted
Same as `VDW' ex
ept that the spheres are drawn dotted instead of solid. That is, a dot is pla
ed
at ea
h of the verti
es of the triangle making up ea
h sphere. This
an be used, for instan
e, to
imitate a surfa
e representation.
5.7 Solvent
This method is similar in spirit to the Dotted representation in that it gives a qui
k estimate of
the mole
ular surfa
e with a
olle
tion of dots. However, it goes above and beyond the Dotted
option by giving a more uniform
overage of the surfa
e. The method that VMD uses to
he
k for
overlaps isn't te
hni
ally
orre
t, but it is fast and works quite well. A te
hni
al des
ription of the
algorithm is as follows:
For ea
h point of the surfa
e distribution (of radius r = atom radius + probe radius) of atom
i,
he
k ea
h of the atoms j to whi
h it is
ovalently bound. If the point is too
lose to j , don't
display it. Also, if the point is too
lose to any neighbor k of j (k 6= i) then don't draw it. This
is fast sin
e there aren't that many neighbors to
he
k, but it doesn't omit parts of the surfa
e in
onta
t with atoms whi
h aren't one or two bonds away. This
an be
onsidered a good thing sin
e
you might get a better idea of the
onta
t surfa
e.
There are three parameters for this option. One is the probe radius, whi
h was mentioned
in the des
ription. If the probe radius is too large, the problem of over-lapping surfa
es between
non-
onne
ted atoms be
omes more apparent. The se
ond is "Detail", whi
h should probably be
renamed "Density" as it determines the surfa
e density of the distributions. The higher the detail,
the higher the density. The nal option is the "Method". By default the surfa
e is drawn as a
olle
tion of points, but a point is a pixel in size regardless of the s
ale of the mole
ule, so when
s
aled small the surfa
e density appears high, and when s
aled large, the density appears low.
Method 2 draws little plus signs instead of points, whi
h does s
ale better so the density appears
more
ontant. Method 3 draw lines between the surfa
e points that are on the same atom, but
makes no attempt to
onne
t the two spheres.
Thanks to Jan Hermans for implementation pointers and thanks again to Jon Lee
h for the
ode
to
ompute the uniform point distributions. That
ode was in
luded as part of the 1.x distribution.
68
5.8 Tube
There are two ways to draw a `Tube' representation, one for proteins and the other for nu
lei
a
ids. The protein tube is a smooth
urve through the sele
ted C positions, and the nu
lei
a
id
tube is a smooth
urve through the ba
kbone phosphates.
The protein tube is a spline
urve that passes through all the C s in a protein fragment. Five
evenly spa
ed interpolation points are found along the
urve to break the
urve
onne
ting the two
C s into six line segments. If the rst C is sele
ted, the rst three segments are
olored by the
olor assigned to that C . If the se
ond C is sele
ted, the last three segments are
olored by the
olor of the se
ond C . The nu
lei
a
id tube is
onstru
ted in the same manner ex
ept that the
phosphate atoms are used.
The two
ontrols set the spline radius and resolution and have the same meaning as they did in
the `Bond'
ontrol. However, if the bond radius be
omes 0 or the bond resolution is 2 or less then
the spline is drawn as a simple line. This make moving and rotation the image mu
h faster.
It is possible to pi
k with the mouse the C whi
h denes the tube by
li
king near the middle
of the six tube segments whi
h are asso
iated with that atom.
5.9 Tra
e
This representation applies mu
h of the pro
edure used to
onstru
t the Tube. In the end, it
onne
ts the alpha-
arbon atoms of su
essive residues by
ylindri
al segments with adjustable
width. In the
ase of nu
lei
a
ids, it is the P ba
kbone atoms whi
h are
onne
ted. As always, the
segment pie
es are
olored a
ording to the atom they are asso
iated with. If the
ylinder radius
is made 0.00, then the
ylinder segments are repla
ed with lines.
Note: the Tra
e option is useful for people doing threading or protein folding work who only
look at the C
oordinates and residue names, for then they don't have to build the side
hains
ne
essary to see their stru
ture. Also, people working on polymers
an fake their stru
ture by
naming everything \CA." in the PDB le and then using Tra
e.
5.10 Li
ori
e
`Li
ori
e' draws the atoms as spheres and the bonds as
ylinders. The dieren
e between this and
`CPK' is that the sphere radius is not
ontrollable; instead, it is made the same size as the bond.
This makes for a ni
e, smooth transition and is one of the most often used representations. It
an
be rather slow for large mole
ules.
5.11 Ribbon
The `Ribbon' representation is similar to `Tube' in that it follows the same spline
urve for both the
protein and nu
lei
a
ids. However, it uses additional information (the O of the protein ba
kbone
or some of the phosphate oxygens for nu
lei
a
ids) to nd a normal for drawing the oriented
ribbon. (There may be some problems with the ribbon denition for nu
lei
a
ids as it is possible
for the nu
lei
a
id dete
tion routine to label a residue as a nu
lei
a
id even though it does not
have phosphate oxygens.)
Given the
oordinates of ea
h atom and the oset ve
tor for the ribbon ve
tor, the drawing
ode nds the spline
urves for the top and bottom of the ribbon. The two splines are
onne
ted
69
by triangles and both splines are drawn as small tubes. As with the `Tube' representation, the six
ribbon segments nearest the given atom are drawn with the
olor assigned to that atom and the
atom
an be sele
ted by
li
king near the
enter of those six elements.
Bond radius and resolution modify the tubes that make up the top and bottom of the ribbon.
If the radius or resolution get too small, the tubes are not drawn (this speeds up drawing time by
an appre
iable amount). The line thi
kness
ontrols the width of the ribbon and make it look like
everything from vermi
elli to lasagna. Additionally, the sugars are drawn lled in with triangles.
This helps highlight the pu
ker.
Thanks to Ethan Merrit for the ribbon drawing algorithm taken from Raster3D.
5.12 Surf
This option uses the mole
ular surfa
e solver written by Amitabh Varshney when he was at the
University of North Carolina. When this option is used, the radii and
oordinates are written to
a temporary le and the 'surf' exe
utable is run with the probe radius as a parameter. When
nished, the output is written to another temporary le whi
h is then read by VMD and
olored
and displayed. The value of the probe radius is
ontrolled by the sphere radius, and this is identi
al
to the probe size in
A.
This surfa
e is rather slow in both generation and display for systems over several hundred
atoms. The SURF
al
ulation is quite exa
t and will show
omplete detail even when it isn't
needed. The use of disk spa
e as a
ommuni
ations medium takes up about half the time, and the
method used to draw the triangles has not been optimized.
There are two environment variables whi
h
an ae
t the Surf display option:
SURF BIN { lo
ation of the SURF binary (defaults to SURF $ARCH as dened in the vmd startup
s
ript)
SURF TMPDIR { lo
ation of the dire
tory to use for temporary les (defaults to the value of
the environment variable VMDTMPDIR, whi
h defaults to /tmp)
A helpful tri
k when
onstru
ting surfa
es is to use the \Apply Changes Automati
ally" toggle
button on the graphi
s form wisely. That is, sin
e surfa
es often take a long time to build,
hanging
viewing parameters su
h as the probe radius
an
ause long delays. By default, ea
h time you hit
the probe radius button, VMD rebuilds the surfa
e. If you want to redu
e or enlarge the probe
radius by several in
rements, then you would end up rebuilding the surfa
e multiple times. By
toggling the afore-mentioned button, you
an for
e VMD to update on your
ommand only. This
tri
k is sometimes helpful with other representations as well.
For a faster though arguably more impre
ise surfa
e rendering method, see the des
ription of
MSMS below.
5.13 Cartoon
The `Cartoon' option produ
es a simplied representation of a protein based on its se
ondary
stru
ture. Heli
es are drawn as
ylinders, beta sheets as solid ribbons, and all other stru
tures
(
oils and turns) as a tube. If the se
ondary stru
ture has not yet been determined, it will be
al
ulated automati
ally by the program STRIDE.
70
A helix
ylinder is
onstru
ted by nding the least squares linear t along the
oordinates
of the helix's C atoms. If a given residue's C is sele
ted, the small
ylinder (found by linear
interpolation along the line of best t) is drawn with radius determined by the ??? parameter.
Be
ause this method
omputes a best t, a helix must have at least 3 residues before it is drawn
(those heli
ies with one or two residues are drawn as a
oil). It is possible to pi
k the C for
ea
h
ylinder segment, but they are at the lo
ation of the C , whi
h is not near the axis
ylinder.
Interesting results o
ur when the whole protein is dened to be a helix and drawn as a
artoon.
The solid beta ribbon is
onstru
ted by building a spline along the
enter points between ea
h
beta sheet residue. Again, the spline is linearly interpolated to nd the start and end points for ea
h
residue. Those are extended to
onstru
t the
orners for a ribbon with re
tangular
ross se
tion
(the amount of extension is determined with the ??? parameter). A ribbon segment is used if the
orresponding C atom is sele
ted. Note that sin
e this method assumes the protein is in a beta
onformation, it draws a mu
h smoother ribbon than the standard Ribbon option, whi
h draw the
ribbon with an os
illation along the sheet.
The other
onformations are drawn as a tube. Sin
e the endpoints of the helix
ylinder and
artoon sheet are not at the C
oordinate, the tube method was slightly
hanged to make the
tube go to the new lo
ations. This does not always work, resulting in a tube whi
h does not quite
onne
t to a
ylinder.
5.14 MSMS
Another mole
ular surfa
e renderer is MSMS, a program written by Mi
hael Sanner of Olsen's lab
at S
ripps. This program is mu
h faster than the Surf
ode in both generating the initial surfa
e and
then in manipulating the surfa
e after it is built. See the web page http://www.s
ripps.edu/pub/olson-
web/people/sanner/html/msms home.html for more details. Available options in
lude
All Atoms { should the surfa
e be of the sele
tion (0) or of the
ontribution of this sele
tion
to the surfa
e of all the atoms? (1)
Density { triangle density on the surfa
e (typi
al values are 1.0 for mole
ules with more than
one thousand atoms and 3.0 for smaller mole
ules)
Probe { Probe radius used to
onstru
t the mole
ular surfa
e
5.15 HBonds
The HBond representation will draw a dotted line between two atoms if there is a possible hydrogen
bond between them. A possible hydrogen bond is dened by the following
riteria:
Given an atom D with a hydrogen H bonded to it and an atom
A with no hydrogen bonded to it, a hydrogen bond exists between
A and H iff the distan
e ||D-A|| < dist and the angle D-H-A < ang,
where ang and dist are user defined.
Only the sele
ted atoms are sear
hed, so both the donor and a
eptor must be sele
ted for the
bond to be drawn. Also, you'll note that the above doesn't
he
k the atom type of the donor or
a
eptor; the only
riterion is if it already has or doesn't have a hydrogen.
71
One downfall of the
urrent implementation is that it does an n2 sear
h of the sele
ted atoms
so you probably don't want to show all the HBonds of a very large stru
ture. Look for performan
e
improvements in future versions of VMD.
If you
hoose an HBonds representation but fail to see any hydrogen bonds, it may be be
ause
the default angle and distan
e
riterion in VMD are too small, so you might want to try in
reasing
the angle value from 20 to 30 degrees and the distan
e value from 3 to 4.
The HBonds are drawn as dotted lines of a given width. The default is 1 but you should
probably in
rease that to 2. On most SGIs you
an't make it any wider than that, as des
ribed in
the man page for linewidth. The bond is
olored by the
olor asso
iated with the a
eptor.
5.16 O
The `O' representation draws nothing. It is used in pla
e of delete to hide a sele
tion so it
an be
redisplayed qui
kly later.
72
Chapter 6
73
you have ambient for the
olor named '
yan' set to 1 0 0, the obje
t
olored in '
yan' will
appear red in the absen
e of any light sour
es and will have a red
omponent in the 'shaded'
areas in the presen
e of light sour
es. Default is (0.0, 0.0, 0.0).
Diuse: same as RGB; This property determines the
olor of the obje
t. Diuse re
e
tions
are independent of the viewing dire
tion, but depend on the dire
tion of the light sour
e with
respe
t to the surfa
e of the displayed obje
t.
Spe
ular: a triplet of numbers (0.0 to 1.0) des
ribing the
olor of spe
ular re
e
tions. Pro-
du
es highlights, the higher the value, the smaller and the brighter the highlight. Default is
(1.0, 1.0, 1.0). You
an redu
e the re
e
tivity of the surfa
e by redu
ing all three values (say,
to 0.5 0.5 0.5). This would give white light re
e
tions with less intensity. However, you
an
use any settings to produ
e ee
t of a
olored re
e
tion.
Shininess: a number (1 to 100) des
ribing how large is the angle of the spe
ular re
e
tions.
The smaller the number the wider the angle and the more shiny obje
ts appear. Default is
40.
For details regarding these material properties,
onsult an elementary graphi
s book su
h as Foley
& Van Dam (Computer Graphi
s).
74
Category Contents
Display The ba
kground
olor
Axes The
omponents of the axes
Stage The
olors for the
he
kboard stage
Name The available atom names (
olor by Name)
Type The available atom types (
olor by Type)
Resname The residue names (
olor by ResName)
Chain The one-
hara
ter
hain identier.
Segname The segment names (
olor by SegName)
Mole
ule The names assigned to ea
h mole
ule (
olor by Mole
ule)
Highlight The protein, nu
lei
, and non-ba
kbone
olors
Restype The residue types (
olor by ResType)
Stru
ture The se
ondary stru
ture type (helix, sheet,
oil) (
olor by Stru
ture)
Labels The dierent labels (atoms, bonds, et
.)
Table 6.1: Color
ategories used in VMD.
75
Method Des
ription
Name Atom name, using the Name
ategory
Type Atom type, using the Type
ategory
ResName Residue name, using the Resname
ategory
ResType Residue type, using the Restype
ategory
ResID Residue identier, using the resid mod 16 for the
olor
SegName Segment name, using the Segname
ategory
Mole
ule Mole
ule all one
olor, using the Mole
ule
ategory
Stru
ture Helix, sheet, and
oils are
olored dierently
Chain The one-
hara
ter
hain identier, using the Chain
ategory
ColorID Use a user-spe
ied
olor index (from 0 to 15)
Beta Color s
ale based on beta value of the PDB le
O
upan
y Color s
ale based on the o
upan
y eld of the PDB le
Mass Color s
ale based on the atomi
mass
Charge Color s
ale based on the atomi
harge
Pos Color s
ale based on the distan
e of ea
h atom to the
enter of the mole
ule. This is an interesting way to
view globular systems.
Index Color s
ale is based on the atom index. Due to the way
the PDB le is organized, this a
tually looks ni
e.
Ba
kbone Ba
kbone atoms green, everything else is blue
Table 6.2: Mole
ular
oloring methods.
There is only one
olor s
ale used at a time so it is impossible to display obje
ts
olored by
multiple dierent
olor s
ales.
6.3 Transparen
y
Making obje
ts semi-transparent is a potentially powerful means of viewing multiple layers of the
mole
ule simultaneously. Imagine a protein on the surfa
e of, and extending part way into, a
membrane. One way to visualize the extent of the penetration is to represent the lipids as `Bonds'
and make them transparent. That will show the membrane without
ompletely obstru
ting the
view of the protein.
Transparen
y is
urrently not implemented in the OpenGL version of VMD. Thus, the following
suggestions apply only to versions of VMD
ompiled with the GL option for IRIX5.x and IRIX6.x
platforms.
If transparent views of a mole
ule seem to be obs
uring other views, make sure all the trans-
parent views in the Graphi
s form are farther down the list of views than non-transparent views.
Also, VMD will sometimes have problems displaying transparent obje
ts when they are not
drawn in a front-to-ba
k order. If you
li
k on the Transparent button on the Graphi
s form and
rotate the mole
ule around you will see instan
es of this problem. VMD provides a s
ript
ommand
to
orre
t for this, but it tends to slow down the display update
onsiderably. The
ommand to
type into the
onsole window is \display depthsort on". This will for
e VMD to arrange the obje
ts
in a front-to-ba
k order by means of a depth sort. When many obje
ts are on the s
reen, this sort
76
Method Des
ription
RGB small=red, middle=green, large=blue
BGR small=blue, middle=green, large=red
RWB small=red, middle=white, large=blue
BWR small=blue, middle=white, large=red
RWG small=red, middle=white, large=green
GWR small=green, middle=white, large=red
GWB small=green, middle=white, large=blue
BWG small=blue, middle=white, large=green
BlkW small=bla
k, large=white
WBlk small=white, large=bla
k
Table 6.3: Available Color S
ale Gradations.
an result in a substantial amount of
al
ulation. Thus, it is best to rst rotate the view around
until you nd an angle and style that you are happy with, and then turn depth-sorting on to enable
orre
t transparen
y. The
ommand to turn depth sorting o is simply \display depthsort o."
The transparent
olors
hange their denitions automati
ally when the
orresponding solid
olors are redened through the the Color form [x3.3.9℄. Using text interfa
e, however, requires
hanging the settings for the transparent
olors expli
itly.
77
Figure 6.1: RGB
olor s
ale: the three plots shows the
ontributions of ea
h
olor, and the resulting
olors are on the bottom.
# to use:
hange_transparen
y .1
78
Figure 6.2: The shift to the red
omponent of the RGB s
ale
aused by the value of \min".
79
only bad thing about this idea is that bla
k be
omes white, and white
hanges too, so the names
of the
olors (yellow, orange, et
.) be
ome useless.
# vary the alpha value from 0 to 1 thus for
ing an obje
t to slowly
# appear on the s
reen.
pro
fade_in {} {
for {set i 0} {$i < 1} {set i [expr $i + 0.05℄} {
hange_alpha $i
}
}
80
6.4.7 Querying VMD for Color Information
To obtain a list of the available
olor names:
olorinfo
olors
To obtain a listing of the attributes of the
olor red:
81
Chapter 7
name CA
resid 35
name CA and resname ALA
ba
kbone
not protein
protein (ba
kbone or name H)
name 'A 1'
name 'A *'
name "C.*"
mass < 5
numbonds = 2
abs(
harge) > 1
x < 6 and x > 3
sqr(x-5)+sqr(y+4)+sqr(z) > sqr(5)
within 5 of name FE
protein within 5 of nu
lei
same resname as (protein within 5 of nu
lei
)
protein sequen
e "C..C"
name eq $atomname
protein and mysele
tion
There are two types of sele
tion modes. The rst is a keyword followed by a list of either values
or a range of values. For example,
name CA
sele
ts all atoms with the name CA (whi
h
ould be a C or a
al
ium);
82
resname ALA PHE ASP
sele
ts all atoms in either alanine, phenylalanine, or asparagine;
index 5
sele
ts the 6th atom (in the internal VMD numbering s
heme).
VMD
an also do range sele
tions, similar to X-PLOR's `:' notation:
mass 5 to 11.5
sele
ts atoms with mass between 5 and 11.5 in
lusive,
resname ALA to CYS TYR
sele
ts atoms in alanine, arginine, asparagine, asparti
a
id,
ystine, and also tyrosine.
The keyword sele
tion works by
he
king ea
h term on the list following the keyword. The term
is either a single word (eg, name CA) or a range (eg resid 35 to 90).
The method for determining the range
he
king is determined from the keyword data type;
numeri
omparisons are dierent than string
omparisons. The
omparison should work as ex-
pe
ted so that \8" is between \1" and \11" in a numeri
ontext but not in a string one. This
may lead to some pe
uliar problems. Some keywords, su
h as segname,
an take on string values
but
an also be used by some people as a number eld. Suppose someone labeled the segname
eld with the numbers 1 through 12 on the assumption that they are numbers. That person would
be rather
onfused to nd that segname 1 to 11 only returns two segments. Also, strings will be
onverted (via atof()) to a number so if the string isn't a number, it will be given the value of 0.
It is possible to for
e a sear
h to be done in either a string or numeri
ontext using the relational
operator dis
ussed in x7.6
Sele
tions
an be
ombined with the boolean operators and and or,
olle
ted inside of paren-
thesis, and modied by not, as in
(name CA or name CB) and mass 12 to 17
whi
h sele
ts all atoms name CA or CB and have masses between 12 and 17 amu (this
ould be used
to distinguish a C-alpha from a
al
ium). VMD has operator pre
eden
e similar to C so leaving
the parentheis out of the previous expression, as in:
name CA or name CB and mass 12 to 17
a
tually sele
ts all atoms named CA or those that are named CB and have the appropriate mass.
83
Table 7.3 lists the built-in fun
tions whi
h may be used in atom sele
tion expressions with
keywords whi
h take on a numeri
value.
84
resname 'A 1'
More importantly, ribose atoms
an be given names like C5' or C5* (depending on the age of
the PDB re
ord). The lexer in VMD has been modied so that C5', O", and N''
an be used
without quotes, but it
annot handle an unquoted asterisk (*
on
i
ts with multipli
ation and the
parser is not able to resolve the dieren
e). Some examples are:
name 'O5*'
segname 'A *'
name O5'
Quotes may also be used to get around a reserved sele
tion word, like x. The sele
tion
ommand
segname x will give an error be
ause x is another keyword. Instead, use segname 'x'. There is an
es
ape me
hanism for in
luding single quotes inside a single quoted string whi
h uses a ba
kslash
('\') before the single quote. This allows unusual names like C ' to be quoted as 'C \''.
segname x <---- error;
onfli
ts with the 'x' keyword
segname 'x'
name 'O5\''
Also, double quotes (dis ussed in the next se tion) an be used, as in "C '" or "C \*".
As expe
ted, multiple terms
an still be provided on the list of mat
hing keywords, as in
resname "A.*" GLY ".*T"
to sele
t residues starting with an A, the gly
ine residues, and residues ending with a T. Kind of
silly, but it is just to demonstrate. As with a string, a regular expression in a numeri
ontext gets
onverted to an integer, whi
h will always be zero.
In brief, a regular sele
tion allows mat
hing to multiple possibilities, instead of just one
har-
a
ter. Table 7.4 shows some of the methods that
an be used.
So there are many ways to do some sele
tions. For example,
hoosing atoms with a name of
either CA or CB
an be done in the following ways:
85
name CA CB
name "CA|CB"
name "C[AB℄"
name "C(A|B)"
Several
aveats for those who already understand regular expressions. VMD automati
ally
prepends \^(" and appends \)$" to the sele
tion string. This makes the sele
tion O mat
h only
O and not OG or PRO. On the other hand, putting ^ and $ into the
ommand won't really ae
t
anything, sele
tions that mat
h on a substring must be pre
eded and followed by \.*", as in .*O.*,
and some illegal sele
tions
ould be a
epted as
orre
t, but strange, as in C)|(O , whi
h gets
onverted to ^(C)|(O)$ and mat
hes anything starting with a C or ending with an O.
A regular expression is similar to wild
ard mat
hing in X-PLOR. Table 7.5 is a list of
onversions
from X-PLOR style wild
ards to the mat
hing regular expression.
86
The numeri
omparisons are the standard ones: <, <=, = or ==, >=, >, and !=. The
orresponding
string
omparisons are: lt, le, eq, ge, gt, and ne. As in perl there is a \mat
h" operator, =~, so
that
'CA' =~ "C.*"
segname =~ "VP[1-4℄" (mat
hes VP1, VP2, VP3, and VP4, present in some
virus stru
tures)
are valid. No distin tion is made between single and double quotes.
nds the protein atoms that are nearby nu
lei
a
ids. On a
autionary note, the distan
e sear
h
method is not very eÆ
ient, making these sele
tions rather slow. Some sele
tions may be sped up
by short
ir
uiting [x7.3℄.
The same <keyword> as <sele
tion> nds all the atoms whi
h have the same `keyword' as
the atoms in the sele
tion. This
an be used for sele
tions like
same fragment as resid 35
87
whi
h nds all the atoms atta
hed to residue id 35. Any keyword
an be used, so sele
tions like
same resname as (protein within 5 of nu
lei
)
are ne, although weird. The perhaps the most useful keyword for this
ommand is residue, so
you
an say same residue as ....
7.9.1 $referen
es
If a keyword starts with a $, the rest of the keyword is used as the T
l variable name. The T
l
interpreter is queried for the asso
iated data, whi
h is then used as it would be for any other
keyword. The variable
an be either an array, in whi
h
ase element 0 is for the rst atom, 1 for
the se
ond, . . . ; or a s
alar value, in whi
h
ase that value is used for all the atoms. For an array
example, suppose the T
l array \foo"
ontained the values foo(n) = 2*n. Then the statement $foo
< 10 sele
ts atom with indi
es 0 to 4, while $foo 20 to 30 6 sele
ts indi
es 10, 11, 12, 13, 14, 15,
and 3. If foo has a s
alar value, su
h as PRO, the statement resname eq $foo sele
ts the proline
residues. Be
ause of a limitation in T
l, the only way VMD re
ognizes if a variable is an array is
if element 0 exists.
7.9.2 referen
es
The other way to referen
e a T
l variable is as a boolean array. This is most often used when there
is a set of atoms whi
h must be referen
ed often or when the sele
tion is very
ompli
ated. These
start with a sign and spe
ify if the given atom should be on or o. This notation is used in the
same pla
e as a boolean keyword (like protein or water). As with the $ variables, the T
l variable
an be either a s
alar or an array. If the value is false, (or 0) the
orresponding atom is not sele
ted.
If true (or non-zero), it is turned on. Additionally, if the s
alar value is an atom sele
tion, the data
from that sele
tion is used. Here are some examples of variables:
if the array foo(n) is dened as 1 of n is odd, 0 if n is even, then the sele
tion text foo turns
on atoms with an odd numbered atom index.
Let \my sele
tion" be dened as set my sele
tion [atomsele
t top resid 35℄ then the sele
tions
\$my sele
tion and name CA" and \side
hain $my sele
tion" are also valid.
88
Keyword Arg Des
ription
all bool everything
none bool nothing
name str atom name
type str atom type
index num the atom number, starting at 0
hain str the one-
hara
ter
hain identier
residue num a set of
onne
ted atoms with the same residue number
protein bool a residue with atoms named C, N, CA, and O
nu
lei
bool a residue with atoms named P, O1P, O2P and either
O3', C3', C4', C5', O5' or O3*, C3*, C4*, C5*, O5*.
This denition assumes that the base is phosphorylated,
an assumption whi
h will be
orre
ted in the future.
ba
kbone bool the C, N, CA, and O atoms of a protein
and the equivalent atoms in a nu
lei
a
id.
side
hain bool non-ba
kbone atoms and bonds
water, wa- bool all atoms with the resname H2O, HH0, OHH, HOH,
ters
OH2, SOL, WAT, TIP, TIP2, TIP3 or TIP4
fragment num a set of
onne
ted residues
pfrag num a set of
onne
ted protein residues
nfrag num a set of
onne
ted nu
lei
residues
sequen
e str a sequen
e given by one letter names
numbonds num number of bonds
resname str residue name
resid num residue id
segname str segment name
x, y, z num x, y, or z
oordinates
radius num atomi
radius
mass num atomi
mass
harge num atomi
harge
beta num temperature fa
tor
o
upan
y num o
upan
y
at bool residues named ADA A THY T
a
idi
bool residues named ASP GLU
a
y
li
bool \protein and not
y
li
"
aliphati
bool residues named ALA GLY ILE LEU VAL
alpha bool atom's residue is an alpha helix
amino bool a residue with atoms named C, N, CA, and O
aromati
bool residues named HIS PHE TRP TYR
basi
bool residues named ARG HIS LYS
bonded bool atoms for whi
h numbonds>0
buried bool residues named ALA LEU VAL ILE PHE CYS MET TRP
g bool residues named CYT C GUA G
harged bool \basi
or a
idi
"
y
li
bool residues named HIS PHE PRO TRP TYR
Table 7.1: Atom sele
tion keywords.
89
Keyword Arg Des
ription
hetero bool \not (protein or nu
lei
)"
hydrogen bool name "[0-9℄?H.*"
large bool \protein and not (small or medium)"
medium bool residues named VAL THR ASP ASN PRO CYS ASX PCA HYP
neutral bool residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP
polar bool \protein and not hydrophobi
"
purine bool residues named ADE A GUA G
pyrimidine bool residues named CYT C THY T URI U
small bool residues named ALA GLY SER
surfa
e bool \protein and not buried"
helix bool atom's residue is an alpha helix
helix 3 10 bool atom's residue is an alpha helix
extended beta bool atom's residue is a beta sheet
bridge beta bool atom's residue is a beta sheet
rasmol Rasmol translates Rasmol sele
tion syntax to VMD
string
alpha helix bool atom's residue is an alpha helix
pi helix bool atom's residue is a pi helix
helix bool atom's residue is an alpha or pi helix
sheet bool atom's residue is a beta sheet ???
turn bool atom's residue is in a turn
onformation
oil bool atom's residue is in a
oil
onformation
stru
ture str single letter name for the se
ondary stru
ture
within str sele
ts all atoms within a spe
ied distan
e
of a sele
tion (i.e within 5 of name FE).
same str sele
ts all atoms whi
h have the same keyword
as the atoms in a given sele
tion (i.e. same segname as resid 35)
ux, uy, uz num for
e to apply in the x, y, or z
oordinates
Table 7.2: Atom sele
tion keywords (
ontinued).
90
Fun
tion Des
ription
sqr(x) square of x
sqrt(x) square root of x
abs(x) absolute value of x
oor(x) largest integer not greater than x
eil(x) smallest integer not greater than x
sin(x) sine of x
os(x)
osine of x
tan(x) tangent of x
atan(x) ar
tangent of x
asin(x) ar
sin of x
a
os(x) ar
os of x
sinh(x) hyperboli
sine of x
osh(x) hyperboli
osine of x
tanh(x) hyperboli
tangent of x
exp(x) \e to the power x"
log(x) natural log of x
log10(x) log base 10 of x
Table 7.3: Atom sele
tion fun
tions.
91
Chapter 8
92
Name Des
ription Default Render Command
Raster3D1 Fast raster le generator render < %s -sgi %s.rgb; ipaste %s.rgb
tkRaster3D2 Tk interfa
e to Raster3D render < %s -sgi %s.rgb; ipaste %s.rgb
POV33 POV-Ray 3.0 ray tra
er povray3 +H500 +W400 -I%s -O%s.tga +D +X +A
+FT +C
POV3 POV-Ray ray tra
er povray +H250 +W200 -I%s -O%s.tga +P +X +A
+FT
Rayshade4 Rayshade ray tra
er rayshade < %s > %s.rle
Radian
e5 Radiosity ray tra
er o
onv %s > %s.o
t; rview -pe 100 -vp -3.5 0
0 -vd 1 0 0 %s.o
t
ART6 VORT ray tra
er render < %s -sgi %s.rgb; ipaste %s.rgb
PostS
ript Dire
t PostS
ript Output ghostview %s &
STL Stereolithography Format true - Renders Triangles Only
VRML-1 Virtual Reality Markup true - view this with VRML viewers like webspa
e
Language
Token Text Dump of Graphi
al true
Obje
ts
1 See http://www-bio.unizh.
h/visualization/raster3d/raster3d.html for more info.
2 Conta
t ???
3 See http://www.povray.org/ for more info.
4 See http://www-graphi
s.stanford.edu/
ek/rayshade/rayshade.html for more info.
5 See http://radsite.lbl.gov/radian
e/HOME.html for Radian
e
6 Available from ftp://gondwana.e
r.mu.oz.au/pub along with the rest of VORT pa
kage
7 See http://vrml.sgi.
om/intro.html
93
8.2 Known Problems
When VMD
reates the output le it will try to mat
h the
urrent view and s
reen size. For the
most part it does a good a job but there are some problems. The
olors in the nal raster image
seem to be faded when
ompared to the s
reen. We may be able to
orre
t this in future versions
by arti
ially in
reasing the
olor intensity. In the meantime, this
an be remedied with a program
like xv or display whi
h will brighten and sharpen the image.
The eye position seems to be slightly dierent between the s
reen and raster images. This
o
urs be
ause the S
reen Height and S
reen Width (see x3.3.8) values are not propagated to the
output le, so the programs have slightly dierent transformation matri
es. We have added an
extra s
aling fa
tor, determined by trial and error, whi
h redu
es this ee
t for the default s
reen
sizes, but the fa
tor is only valid if the parameters are not
hanged.
The lights are supposed to be positioned in the output le as they are on the s
reen but not
all formats support the number of lights available in VMD. In addition, there seems to be a bug
in the
ode that determines the
orre
t light positions. This
an be
hanged by editing the output
le by hand.
A new option in VMD draws
ylinders with
at disks
overing the ends. Some of the renderers
may not draw the
apped ends.
We have primarily tested the Raster3D output and have little experien
e with the other pro-
grams. The only problem we have found with Raster3D is if there are too many obje
ts to render
(this
ould easily o
ur when using `Tube' or `Ribbon' on large mole
ules), it will not render any-
thing. (Raster3D do
umentation mentions an \obje
t limit"|Raster3D
an be re
ompiled with a
new limit.)
94
Chapter 9
Viewing Modes
There are many dierent viewing modes available. These show the s
ene in orthographi
or per-
spe
tive views, and in several mono- and stereo- graphi
displays. The stereo mode
an be
hanged
using the popup menu available from the graphi
s display window. It
an also be
hanged by using
the stereo entry in the Display form or the text
ommand display stereo mode.
95
9.3.1 Side-By-Side and Cross-Eyed Stereo
Side-by-side stereo means that the normal display is divided into two halves, a left view and a
right view, ea
h o
upying one-half of the original display area. Ea
h view displays the
urrent
mole
ules from a slightly dierent perspe
tive,
orresponding to the left and right eye of the viewer.
The images are separated, however, so to a
tually see a 3D obje
t you must dire
t your eyes until
the two images are on top of ea
h other, and then fo
us on the resulting image until you
an see it
as three-dimensional.
There are two ways of pla
ing the images. In wall-eyed stereo, the left eye's image is lo
ated on
the left side of the display, and the right eye's image is on the right. This is the standard method
for displaying stereo images in publi
ations as it works well when the display (in this
ase, the pie
e
of paper) is
lose to the eyes. It is
alled wall-eyed be
ause your eyes are dire
ted the same way
they would be if looking at a distant wall. In VMD, this method is referred to as \SideBySide"
stereo.
In
ross-eyed stereo, the left eye's image is lo
ated on the right side of the display, and the right
eye's image is on the left, and hen
e the name
ross-eyed. This is mostly used for distant displays
(su
h as overhead proje
tions) as it is mu
h easier to
ross eyes at that range than use the wall-eyed
method { you are already looking at the wall. In VMD, this method is referred to as \CrossEyes"
stereo.
Stereo in a window (aka new-style stereo): Available on workstations equipped with Reality
Engine2-style graphi
s subsystems only (su
h as Onyx or Power Onyx ma
hines), this mode provides
separate left and right eye frame buers. It allows the user to have a window display in stereo, and
the other windows appear as normal. Using this mode, however, requires the monitor to be in a
lower-resolution 960 by 680 display mode. The monitor must be set in this mode before starting
VMD. To do so, do one of the following:
If superuser a
ess is not available, and the monitor is in the normal 1280x1024 mode, exe
ute
the
ommand:
This will
hange the display
hara
teristi
s to the lower resolution mode, with a higher display
frequen
y (108 Hz), but will not
hange the managed size of the X-Window display s
reen.
To
hange ba
k to the normal mode (after running VMD), exe
ute the
ommand:
/usr/gfx/setmon -n 1280x1024 60
96
When the
omputer is in the lower resolution mode, run VMD as normal, but note that the
lower resolution means the windows will appear larger and may end up sometimes positioned
o-s
reen. If this is a problem, a system superuser should set the video mode permanently
with the
ommands listed in the next item.
If superuser a
ess is available, do the following, whi
h will
hange the video mode and restart
the window server with the lower resolution settings. (WARNING: exe
uting this
ommand
will log out anyone on the
onsole)
To reset the omputer to regular 1280x1024 use, exe ute the ommand:
It may be useful, if stereo-in-a-window will be used often, to set the monitor to the lower
resolution mode, and leave it that way.
On
e set in the proper display mode, start VMD as normal, and sele
t `Crystal Eyes stereo' from
the display window pop-up menu. The image should swit
h to two images nearly superimposed,
but slightly oset.
Regular stereo mode: All stereo-equipped SGI workstations
an use this display mode, in
lud-
ing Reality Engine 2 workstations. VMD uses two programs onstereo and offstereo to swit
h the
monitor display mode. You will need to install these programs somewhere in your Unix path in order
to allow VMD to use them. Regular stereo mode will
hange the display window to o
upy the en-
tire monitor s
reen, as opposed to stereo-in-a-window whi
h
an independently set the stereo mode
of just the display window. Versions of onstereo and offstereo whi
h will run on SGI IRIX 5.X
workstations may be obtained via anonymous ftp from ftp://ftp.ks.uiu
.edu/pub/mds
ope/vmd.
97
In general, try to make the eye separation as large as possible without giving the viewer a
migrane, and try to vary the fo
al length to
ut down on double images. It may often help to
translate the mole
ule forward or ba
kward and also adjust the s
aling, sin
e there is typi
ally an
optimum position for a mole
ule for a given set of stereo parameters.
98
Chapter 10
99
10.2 T
l/Tk
T
l (short for Tool Command Language, developed by John Ousterhout) is an embeddable and
extensible s
ripting language. In other words, T
l sits inside VMD as a language interpreter where
it
an exe
ute its standard language
ommands or the various VMD spe
i
extensions. There are
several reasons for using T
l rather than writing our own language, the most important being that
it is easy to use, it was easy to modify our
ode to use it, it has few bugs, and do
umentation is
available at many bookstores. Many other pa
kages use it, in
luding Quanta. It is not ne
essary
that you know T
l to use VMD. However, it is useful for some o
asions, like making movies or
s
ripts.
VMD uses T
l version 7.6 and Tk version 4.2. Sin
e T
l is extensible, many extension pa
k-
ages have been written to improves
urrent features and add new ones. We have in
luded two
of these, T
lX (version 7.6), whi
h adds many useful
ommand for s
ript writing, and T
l-DP
(version 4.0), whi
h adds an interfa
e to Unix so
ket
ommands. This latter extension is used
by the External interfa
es [x3.4.1℄. The TkX version 4.2.0 is also in
luded. We refer you to
http://www.s
ripti
s.
om/ for more information about T
l, and
http://www.s
o.
om/Te
hnology/t
l/T
l.html for referen
es to do
umentation on T
l/Tk and
T
lX. For the do
umentation on T
l-DP see the T
l-DP home page at
http://www.
s.
ornell.edu/Info/Proje
ts/zeno/Proje
ts/T
l-DP.html.
10.3.1 animate
These
ommands
ontrol the animation of a mole
ular traje
tory and are used to read and write
animation frames to/from a le or Play/Pause/Rewind a mole
ular traje
tory.
100
First Word Des
ription
animate Play/Pause/Rewind a mole
ular traje
tory.
axes Position a set of XYZ axes on the s
reen.
olor Change the
olor assigned to mole
ules, or edit the
olormap.
olorinfo (T
l) Obtain
olor properties for various obje
ts
debug Turn on/o printing of debugging messages.
display Change various aspe
ts of the graphi
al display window.
e
ho Turn on/o e
hoing of text
ommands to the
onsole.
exit, quit Quit VMD.
external (T
l) Start an external VMD
ommand sour
e (optional).
help Display an on-line help le with an HTML viewer.
imd Control the
onne
tion to a remote simulation.
logle Turn on/o logging a VMD session to a log le.
label Turn on/o labels for atoms, bonds, angles, or dihedral angles.
light Control the light sour
es used to illuminate graphi
al obje
ts.
menu Control or query the on-s
reen GUI menu forms.
mole
ule or mol Load, modify, or delete a mole
ule in VMD.
mouse Change the
urrent state (mode) of the mouse.
play or run Start exe
uting text
ommands from a spe
ied le.
render Output the
urrently displayed image (s
ene) to a le.
ro
k Rotate the
urrent s
ene
ontinually at a spe
ied rate.
rotate Rotate the
urrent s
ene around a given axis by a
ertain angle.
s
ale S
ale the
urrent s
ene up or down.
stage Position a
he
kerboard stage on the s
reen.
tool Initialize and
ontrol external spatial tra
king devi
es.
translate Translate the obje
ts in the
urrent s
ene.
user Add new
ommands to the graphi
s display pop-up menu.
vmdinfo (T
l) Get information about this version of VMD
wait Wait a number of se
onds before reading another
ommand. Animation
ontinues.
sleep Sleep a number of se
onds before reading another
ommand. Animation is frozen.
Table 10.1: Summary of
ore text
ommands in VMD.
dup [ frame number ℄ molId: Dupli
ate the given frame (default \now") of mole
ule molId
and add the new frame to this mole
ule.
forward: Play animation forward.
for: Same as forward.
reverse: Play animation ba
kward.
rev: Same as reverse.
pause: Pause animation.
prev: Go to previous frame.
next: Go to next frame.
101
skip n: Set stride to n+1 frames.
delete all: Delete all frames from memory.
speed n: Set animation speed to n.
style on
e: Set to play animation on
e.
style loop: Set to loop through animation
ontinuously.
style ro
k: Set to play animation forward and ba
k
ontinuously.
styles: Return a list of the available styles.
goto start: Go to rst frame.
goto end: Go to last frame.
goto n: Go to frame n.
read le type lename [beg nb℄ [end ne ℄ [skip ns℄ [mole
ule number℄: Read data for
mole
ule number from lename, beginning with frame nb, ending with frame ne, with a stride
of ns+1.
write le type lename [beg nb℄ [end ne ℄ [skip ns℄ [mole
ule number℄: Write data from
mole
ule number to lename, beginning with frame nb, ending with frame ne, with a stride
of ns+1.
delete [beg nb℄ [end ne℄ [skip ns℄ [mole
ule number℄: Delete data for mole
ule number,
beginning with frame nb, ending with frame ne, with a stride of ns+1.
readdel lename [beg nb℄ [end ne℄ [skip ns℄ [mole
ule number℄: Read data for mole
ule number
from lename, beginning with frame nb, ending with frame ne, with a stride of ns+1, over-
writing existing data.
10.3.2 axes
The axes (orthogonal ve
tors pointing along the x, y , and z dire
tions)
an be pla
ed in any of 5
lo
ations on the s
reen, or turned o.
Also, though this may seem like a likely
ommand for
hanging the
olor of the axes, this
fun
tion
an only be performed from the Colors form or by the
olor
ommand (see below).
Future implementations of VMD may
hange this.
102
10.3.3
olor
Change the
olor assigned to mole
ules, or edit the
olor s
ale. All
olor values are in the range
0 . . . 1. Please see the se
tion on
oloring [x 6℄ for a full des
ription of the various options.
ategory name
olor: Set
olor of obje
t spe
ied by
ategory and name to
olor.
s
ale method < s
ale name >: Set type of s
ale to use for
oloring obje
ts by values. They
are:
{ RGB { Red to green to blue.
{ BGR { Blue to green to red.
{ RWB { Red to white to blue.
{ BWR { Blue to white to red.
{ RWG { Red to white to green.
{ GWR { Green to white to red.
{ GWB { Green to white to blue.
{ BWG { Blue to white to green.
{ BlkW { Bla
k to white.
{ WBlk { White to bla
k.
s
ale midpoint x: Set midpoint of
olor s
ale to x, in the range 0 . . . 1.
s
ale min x: Set minimum of
olor s
ale to x, in the range 0 . . . 1.
s
ale max x: Set maximum of
olor s
ale to x, in the range 0 . . . 1.
hange < alpha | shininess | rgb | ambient | diuse | spe
ular >
olor: Reset given
property of
olor to default value.
hange < alpha | shininess >
olor value: Set given (s
alar) property of
olor to value.
hange < rgb | ambient | diuse | spe
ular >
olor r g b: Set given (3-valued) property
of
olor to r g b.
See also Chapter x 12 on how to
hange
olor of a user-dened graphi
s obje
t.
10.3.4
olorinfo
(T
l) This
ommand provides a
ess to the
olor denitions. For information on the
olor properties
see the
hapter on Coloring [x6℄.
103
olorinfo
olors: returns a list of the named solid
olors
olorinfo index < name |
olorid >: returns the index of the given name or
olor id.
Useful for the
ases when you do need the integer value and don't want to use lsear
h on
olorinfo
olors.
olorinfo <rgb | alpha | shininess | ambient | spe
ular> < name |
olorid >: returns
the appropriate values for the given name or
olor id
olorinfo s
ale < method | methods | midpoint | min | max >: returns the information
about the
olor s
ales
Examples:
10.3.5 debug
Turn on/o printing of debugging messages. This will have no ee
t if VMD was
ompiled without
the debugging option (the standard distribution was not
ompiled with debugging).
10.3.6 display
Change various aspe
ts of the graphi
al display window. For information about the options, see
the se
tion des
ribing the Display form [x3.3.8℄.
update: For
e the display update. Makes sense if the display update is o. This does not
ne
essarily take
are of resizing the display window or using the Forms GUI while the display
update is turned o.
104
update on: Turn display update on.
update o: Turn display update o. By default VMD does the display updates
onstantly.
Sometimes it is bene
ial to turn the turn the display updates o. This prevents VMD from
redrawing the s
ene as a response to every
hange, thus saving time while doing
hanges of
representations. See se
tions x16.6.2, x 6.4.3 and x 6.4.4 for examples of use.
update status: Return the display update status (on or o).
update ui: Similar to display update, but also for
es updates of the GUI forms. The
Forms interfa
e is subje
t to the following behavior: if the display update is set to off and
a
tions (su
h as, e.g., i
onify/dei
onify) have been performed to the Forms, the Form windows
do not get updated by just display update
ommand, whereas display update ui for
es
both updates to happen. Tk does not seem to have this problem, so this option will be
ome
obsolete after swit
hing to Tk graphi
s user interfa
e.
reshape: Reshape the display. If the display update is turned o, and the display window
has been resized
ommand display update updates the display, but does not ne
essarily
respond to the resizing of the window.
resetview: Reset the view.
eyesep value: Set the eye separation to value.
fo
allength value: Set the fo
al length to value.
height value: Set the s
reen height to value.
distan
e value: Set the s
reen distan
e to value.
antialias < on | o >: Turn antialiasing on or o.
depth
ue < on | o >: Turn depth
ueing on or o.
depthsort < on | o >: Turn depth sorting on or o (useful in transparent mode)
detail < full |
at | lines | points | none >
altdetail < full |
at | lines | points | none >
stereo mode: Set the stereo mode to mode.
near
lip < set | add > value: Add or set near
lipping plane position to it value.
far
lip < set | add > value: Add or set far
lipping plane position to value.
get < eyesep | fo
allength | height | distan
e | antialias | depth
ue | stereo |
proje
tion | detail | altdetail | near
lip | far
lip >: Return information about the
given option.
get < stereomodes | proje
tions | details >: Return a list of the availalble values for
the given options. (See se
tion x 3.3.8 and
hapter x 9 for more information.)
105
10.3.7 e
ho
Turn on/o e
hoing of text
ommands to the
onsole. When this is turned on, text
ommands read
from a le or from the VMD prompt are e
hoed to the s
reen before they are exe
uted. Do not
onfuse this with the standard Unix e
ho
ommand.
< on | o >: Turn e
hoing on or o.
10.3.8 exit
Quit VMD.
on: Start VMD as a server on port 8639 (the number
an be
hanged by
hanging the
variable vmd external port before starting VMD as a server). This lets any pro
ess
onne
t
to VMD and send it new text
ommands. By default, only pro
esses from the same ma
hine
an
onne
t to it, but that
an be
hanged with the host option. See the se
tions on external
interfa
es [x3.4.1℄ and remote
ontrol of VMD [x14.8℄ for more information on how to use this
feature.
o: Deny new external
onne
tions to be made. Old
onne
tions will still exist.
host ma
hinename (ma
hinename ... ): Allow or deny new
onne
tions based on the address
of the requesting ma
hine. The format for ea
h ma
hine on the list is the same as dp Host,
whi
h is based on xhost so external host + allows new
onne
tions from anyone, external
host - denies all new
onne
tions, external host +foo allows
onne
tions from foo and
external host -bar +128.186.7.* will allow any ma
hine from the Florida State physi
s
department to
onne
t.
onne
t ma
hinename: Establish
onne
tion with a VMD pro
ess on the given ma
hine.
The remote pro
ess is the server and the pro
ess establishing the
onne
tion is the
lient.
send
ommand: Evaluate the
ommand on the server pro
ess.
lose: Deta
h from the server.
106
10.3.10 help
Display the on-line help le with an HTML viewer. See Chapter x 17 for information on how to
hange the default viewer (whi
h is Nets
ape).
[ subje
t℄: Jump to help
orresponding to subje
t.
Presently, \subje
t"
an be any one of the following words, whi
h laun
hes the asso
iated URL.
To guarantee that the help system will work
orre
tly, you will probably want to start up your
web browser before
hoosing one of these options. After you do this, VMD will properly dire
t the
browser to the pages mentioned below.
Sour
e Asso
iated URL
faq http://www.ks.uiu
.edu/Resear
h/vmd/allversions/vmd faq.html
raster3d http://www.bms
.washington.edu/raster3d
stride http://www.embl-heidelberg.de/stride/stride info.html
mds
ope http://www.ks.uiu
.edu/Resear
h/mds
ope/
homepage http://www.ks.uiu
.edu/Resear
h/vmd/
qui
khelp http://www.ks.uiu
.edu/Resear
h/vmd/vmd help.html
babel http://www.eyesopen.
om/babel.html
radian
e http://radsite.lbl.gov/radian
e/HOME.html
maillist http://www.ks.uiu
.edu/Resear
h/vmd/mailing list/
namd http://www.ks.uiu
.edu/Resear
h/namd/
vrml http://www.vrml.org/
rayshade http://www-graphi
s.stanford.edu/~
ek/rayshade/rayshade.html
povray http://www.povray.org/
t
l http://www.s
ripti
s.
om/
software http://www.ks.uiu
.edu/Resear
h/vmd/allversions/related programs.html
userguide http://www.ks.uiu
.edu/Resear
h/vmd/vmd-1.3/ug/ug.html
Table 10.2: On-line Help Sour
es
10.3.11 imd
Controls the
onne
tion to a remote simulation.
onne
t host port:
onne
t to an MD simulation running on the ma
hine named host and
listening on port port. This
ommand will fail if a previously-established
onne
tion has not
yet been dis
onne
ted.
deta
h: Dis
onne
t from the simulation; the simulation will
ontinue to run.
kill: Dis
onne
t from the simulation and also
ause it to halt.
pause: Pause the remote simulation.
transfer rate: Set the rate at whi
h new
oordinates are sent by the remote simulation to
VMD to the spe
ied value.
keep rate: Set the keep rate, i.e. the frequen
y at whi
h VMD saves simulation frames, to
the spe
ied value.
107
10.3.12 label
Turn on or o labels for the four
ategories: atoms, bonds, angles, or dihedral angles. On
e a label
is
reated (given the list of asso
iated atoms) it
an be turned on or o until it is deleted. Also, the
value of the label over the traje
tory
an be saved to a le and viewed with an external program
su
h as xmgr. In the following,
ategory implies one of [Atoms|Bonds|Angles|Dihedrals℄.
list: Return a list of available
ategories.
list
ategory: List all labels in the given
ategory.
add
ategory molID1/atomID1 [ molID2/atomID2... ℄: Add a label involving the atom(s)
atomID of the mole
ule molID to the given
ategory.
show
ategory < all | label number >: Turn on labels in the given
ategory.
hide
ategory < all | label number >: Turn o labels in the given
ategory.
delete
ategory < all |label number>: Delete labels in the given
ategory.
graph
ategory label number [
ommand℄: Show a graph of a label from the given
ategory.
The data will be written to a temporary le, and the spe
ied
ommand will be run to graph
the data. %s in the
ommand string will be repla
ed by the temporary lename.
10.3.13 light
There are four light sour
es, numbered 0 to 3, whi
h are used to illuminate graphi
al obje
ts. They
are point sour
es lo
ated at innity so the only
ontrols are to rotate a light or turn it on or o. A
dotted line from the light to the axis
an be turned on to help show where the light is lo
ated.
num: Return the number of lights available.
light number on: Turn a light on.
light number o: Turn a light o.
light number highlight: Display a line indi
ating the position of a light sour
e.
light number unhighlight: Hide the line indi
ating the position of a light sour
e.
light number status: Return the pair on/o highlight/unhighlight
light number rot < x | y | z > angle: Rotate a light (at innity) angle degrees about a given
axis.
10.3.14 logle
Turn on/o logging a VMD session to a log le. This will
reate a log le with
ommands for
all the a
tions taken during the session. The log le may be played ba
k later by using the `play'
ommand or the T
l `sour
e'
ommand. The only a
tions re
orded are those whi
h
hange the state
of the VMD display, so straight T
l
ommands are not saved. All of the
ore VMD
ommands will
write to the log.
108
lename: Turn on logging to lename.
o: Turn o logging.
To write log information to the le `o', use the le name `./o'. To have log information appear
on the text
onsole, use logfile /dev/tty.
10.3.15 menu
The menu forms of the GUI Control or query the on-s
reen GUI menu forms.
main
mol
animate
edit
graphi
s
labels
render
display
olor
sim
tra
ker
remote
Note that in the
ase when VMD is
ompiled without the REMOTE option, Sim and Remote menus
are not dened and do not appear on the Main form [x3.3.1℄.
109
10.3.16 mol
Load, modify, or delete a mole
ule in VMD. In the following, mole
ule number is a string des
ribing
whi
h mole
ules are to be ae
ted by the
ommand. It is one of the following: all, top, a
tive,
ina
tive, displayed, on, off, fixed, free, or one of the unique integer ID
odes assigned to
the mole
ules when they are loaded (starting with 0). The
odes (molIDs) are not reused after a
mole
ule is deleted, so if you, for example, have three mole
ules loaded (numbered 0, 1, 2), delete
mole
ule with molID equal to 0, and then load another mole
ule, the new mole
ule will have molID
3. Thus, the list of available mole
ule IDs be
omes (1 2 3). The index of the mole
ule on this list
is, among many other things, a
essible through the molinfo
ommand [x13℄. In the above
ase,
for example, mole
ule that was loaded the last has molID equal to 3, however, it is the third on
the list of mole
ules, so it has the index equal to 2 (sin
e we start
ountin from 0).
The mole
ule representations (views) are assigned integer number (starting with 0 for ea
h
mole
ule), whi
h appear in the list on the Graphi
s form [x3.3.4℄. The representations
an be
added, deleted or
hanged with the mol
ommand. See also se
tions on molinfo
ommand [x 13℄
for more ways of retrieving information about the representations. See Chapter x 12 for information
on how to use mol
ommand to load user-dened graphi
s.
< new | load > stru
ture le type stru
ture le [
oordinate le type
oordinate le℄ : Load
a new mole
ule from lename(s) using the given format.
urlload <le type> <URL>: Load a mole
ule from a given URL address
pdbload <four letter a
ession id>: ftp mole
ule from PDB.
list: Print a one-line status summary for ea
h mole
ule.
list mole
ule number: Print a one-line status summary for ea
h mole
ule mat
hing the
mole
ule number. If only one mole
ule mat
hes the mole
ule number, also print the rep-
resentation status for this mole
ule, i.e., number of representations as well as the representa-
tion number,
oloring method , representation style and the sele
tion string for ea
h of the
representations.
olor
oloring method: Change the default atom
oloring method setting.
representation rep style: Change the default rendering method setting.
sele
tion sele
t method: Change the default atom sele
tion setting.
mod
olor rep number mole
ule number
oloring method: Change the
urrent
oloring method
for the given representation in the spe
ied mole
ule.
modstyle rep number mole
ule number rep style: Change the
urrent rendering method
(style) for the given representation in the spe
ied mole
ule.
modsele
t rep number mole
ule number sele
t method: Change the
urrent sele
tion for the
given representation in the spe
ied mole
ule.
addrep: Using the
urrent default settings for the atom sele
tion,
oloring, and rendering
methods, add a new representation to the top mole
ule.
110
delrep rep number mole
ule number: Deletes the given representation from the spe
ied
mole
ule.
modrep rep number mole
ule number: Using the
urrent default settings for the atom se-
le
tion,
oloring, and rendering methods,
hanges the given representation to the
urrent
defaults.
delete mole
ule number: Delete mole
ule(s).
a
tive mole
ule number: Make mole
ule(s) a
tive.
ina
tive mole
ule number: Make mole
ule(s) ina
tive.
on mole
ule number: Turn mole
ule(s) on (make drawn).
o mole
ule number : Turn mole
ule(s) o (hide).
x mole
ule number: Fix mole
ule(s).
free mole
ule number: Unx mole
ule(s).
top mole
ule number: Set the top mole
ule.
10.3.18 mouse
Change the
urrent state (mode) of the mouse.
mode 0: Set mouse mode to rotation.
mode 1: Set mouse mode to translation.
mode 2: Set mouse mode to s
aling.
mode 3 N: Set mouse mode to rotate light N.
mode 4 N: Set mouse mode to pi
king mode N, where N is one of the following:
{ 0: query item
{ 1: pi
k
enter
{ 2: pi
k atom
{ 3: pi
k bond
{ 4: pi
k angle
{ 5: pi
k dihedral
{ 6: move atom
{ 7: move residue
{ 8: move fragment
111
{ 9: move mole
ule
{ 10: for
e on atom
{ 11: for
e on residue
{ 12: for
e on fragment
10.3.19 play
Start exe
uting text
ommands from a spe
ied le, instead of from the
onsole. When the end of
the le is rea
hed, VMD will resume reading
ommands from the previous sour
e. This
ommand
may be nested, so
ommands being read from one le
an in
lude
ommands to read other les.
10.3.20 quit
Same as exit.
10.3.21 imd
Set up VMD to
onne
t to or start a remote simulation program (optional).
onne
t
10.3.22 render
Output the
urrently displayed image (s
ene) to a le.
112
{ Token
method lename
ommand: Render the global s
ene to lename, then exe
ute `
ommand'.
Any %s in `
ommand' are repla
ed by the lename (up to 5).
options method: Get the default
ommand string.
options method
ommand: Set new default
ommand.
default method: Get the original default
ommand.
10.3.23 ro
k
Rotate the
urrent s
ene
ontinually at a spe
ied rate.
o: Stops ro
king.
< x | y | z > by step: Ro
k around the given axis at a rate of step degrees per redraw.
< x | y | z > by step n: Ro
k around the given axis at a rate of step degrees per redraw for
n steps, reverse, and repeat.
10.3.24 rotate
Rotate the
urrent s
ene around a given axis by a
ertain angle. This does not
hange atom
oordinates.
10.3.25 s
ale
S
ale the
urrent s
ene up or down. This does not
hange atom
oordinates.
113
10.3.26 sim
Control the state of a remote simulation after it is
onne
ted (optional).
list: Return information about remote simulations. Ea
h element returned
ontains three
pie
es of information; the mole
ule id, the remote ma
hine name, and the
urrent status. The
status is one of:
{ No Conne
tion: remote
onne
tion has been dis
onne
ted or stopped
{ Running Simulation:
onne
ted to an a
tive simulation
top sim number: Set the top simulation.
top: Get the mole
ule id of top simulation.
modify parameter value: Change a parameter for the top simulation. Possible parameters
are
{ rate n: Send only every n simulation timesteps.
{ keep n: Keep only every n re
eived timesteps, appended to the animation.
pat
h < o | byatom | byload | bynode >: Display the pat
hes from a simulation (if
any),
oloring them by the spe
ied
riteria, for the top simulation.
deta
h sim number: Deta
h from a simulation, leaving it running on the remote
omputer.
kill sim number: Kill a simulation.
10.3.27 simulation
Same as sim.
10.3.28 stage
Position a
he
kerboard stage on the s
reen.
lo
ation < o | origin | bottom | top | left | right | behind >: Set the lo
ation.
lo
ation: Get the
urrent lo
ation.
lo
ations: Get a list of possible lo
ations.
panels n: Set number of panels in stage, up to 30.
panels: Get the number of panels in use
114
10.3.29 tool
Initialize and
ontrol the tools that are
ontrolled by external tra
king devi
es.
10.3.30 translate
Translate the obje
ts in the
urrent s
ene. This does not
hange the atom
oordinates.
by x y z: Translate by ve
tor (x, y, z) in s
reen units (note, that this does not
hange the
atom
oordinates).
to x y z: Translate to the absolute position (x, y, z) in s
reen units.
10.3.31 user
Add user-
ustomized
ommands to the graphi
s display popup menu.
add menu name: Add a new submenu name to the main popup menu. The submenu will
be initially empty, and will not appear until items are added to it.
add item name
ommand: Add a new menu item named name to the `User Command'
submenu of the main menu. If a
ommand is spe
ied, then when the menu item is sele
ted
by the user, that
ommand will be exe
uted as if it had been typed at the
onsole.
add separator: Add a separator to the end of the `User Command' submenu of the main
menu.
115
add subitem menu name
ommand: Add an item name to the given submenu menu, whi
h
must have been added already with an add menu
ommand. The given
ommand will be
exe
uted when the item is sele
ted by the user.
add subseparator menu: Add a separator to the end of the given submenu.
add key key
ommand: Assign the given text
ommand to the hot key key. When key is
pressed while the mouse is in the display window, the spe
ied
ommand will be exe
uted.
print < menus | keys >: Print out the
urrent denition of the user-dened menus, or the
hot keys.
See se
tion x 14.1 for examples of the use of the user
ommand.
10.3.32 vmdlog
(T
l) By default this pro
edure does not exist. If it is
reated, (nearly) every
ommand that ae
ts
the display state of VMD is passed to it as its single parameter. This
an be used as an interfa
e
alternative to the logfile [x10.3.14℄
ommand.
10.3.33 vmdinfo
(T
l) Returns information about this version of VMD.
version: Returns the version number;
versionmsg: Full information about this version;
authors: List of authors;
ar
h: ar
hite
ture type (in
ase you
ouldn't tell);
options: options used to
ompile VMD;
www: VMD home page;
wwwhelp: VMD help page.
This fun
tion is available without T
l and the information is displayed to the s
reen.
10.3.34 wait
Spe
ify a number of se
onds to wait before reading another
ommand. Animation
ontinues during
this time.
time: wait time se
onds.
10.3.35 sleep
Spe
ify a number of se
onds to sleep before reading another
ommand. Animation stops during
this time.
time: sleep time se
onds.
116
Chapter 11
11.1 Ve
tors
ve
zero { Returns the zero ve
tor, f0 0 0g
Example:
vmd > ve
zero
Info) 0 0 0
(C++) ve add v1 v2 [v3 ... vn℄ { Returns the ve tor sum of all the terms.
Examples:
vmd > ve
add {1 2 3} {4 5 6} {7 8 9} {-11 -11 -11}
Info) 1 4 7
vmd > ve
add {0.1 0.2 0.4 0.8} {1 1 2 3} {3 1 4 1}
Info) 4.1 2.2 6.4 4.8
vmd > ve
add 4 5
Info) 9
117
(C++) ve
sub v1 v2 { Returns the ve
tor subtra
tion of the se
ond term from the rst
Examples:
vmd > ve
sub 6 3.2
Info) 2.8
vmd > ve
sub {10 9.8 7} {0.1 0 -0.1}
Info) 9.9 9.8 7.1
vmd > ve
sub {1 2 3 4 5} {6 7 8 9 10}
Info) -5 -5 -5 -5 -5
(C++) ve
s
ale
v {
(C++) ve
s
ale v
{ Returns the ve
tor of the s
alar value
applied to ea
h term of v
Examples:
vmd > ve
s
ale .2 {1 2 3}
Info) 0.2 0.4 0.6
vmd > ve
s
ale {-5 4 -3 2} -2
Info) 10 -8 6 -4
vmd > ve
s
ale -2 3
Info) -6
Examples:
vmd> ve
length 5
Info) 5.0
vmd > ve
length {5 12}
118
Info) 13.0
vmd > ve
length {3 4 12}
Info) 13.0
vmd > ve
length {1 -2 3 -4}
Info) 5.47723
Examples:
vmd > ve
length2 5
Info) 25
vmd > ve
length2 {5 12}
Info) 169
vmd > ve
length2 {3 4 12}
Info) 169
vmd > ve
length2 {1 -2 3 -4}
Info) 30
119
11.2 Matrix routines
Be
ause matri
es are rather large when expressed in text form, the following denitions are used
for the examples.
transidentity { Returns the identity matrix.
Example:
vmd > transidentity
Info) {1.0 0.0 0.0 0.0} {0.0 1.0 0.0 0.0} {0.0 0.0 1.0 0.0} {0.0 0.0 0.0 1.0}
(C++) transmult m1 m2 [m3 ... mn℄ { Returns the matrix multipli
ation of the given
matri
es
Examples:
vmd > set mat1 {{1 2 3 4} {-2 3 -4 5} {3 -4 5 -6} {4 5 -6 -7}}
vmd > set mat2 {{1 0 0 0} {0 0.7071 -0.7071 0} {0 0.7071 0.7071 0} {0 0 0 1}}
vmd > set mat3 {{0.866025 0 0 0} {0 1 0 0} {-0.5 0 0.866025 0} {0 0 0 1}}
vmd > transmult $mat1 [transidentity℄
Info) {1.0 2.0 3.0 4.0} {-2.0 3.0 -4.0 5.0} {3.0 -4.0 5.0 -6.0}
{4.0 5.0 -6.0 -7.0}
vmd > transmult $mat1 $mat2 $mat3
Info) {0.512475 3.5355 0.612366 4.0} {0.7428 -0.7071 -4.28656 5.0}
{-0.58387 0.7071 5.5113 -6.0} {7.35315 -0.7071 -6.73603 -7.0}
transaxis x|y|z
< > amount [deg|rad|pi℄ { Returns the transformation matrix needed to
rotate around the spe
ied axis by a given amount. By default, the amount is spe
ied in
degrees, though it
an also be given in radians or fa
tors of pi.
Examples:
vmd > transaxis x 90
Info) {1.0 0.0 0.0 0.0} {0.0 -3.67321e-06 -1.0 0.0} {0.0 1.0 -3.67321e-06 0.0}
{0.0 0.0 0.0 1.0}
vmd > transaxis y 0.25 pi
Info) {0.707107 0.0 0.707107 0.0} {0.0 1.0 0.0 0.0}
{-0.707107 0.0 0.707107 0.0} {0.0 0.0 0.0 1.0}
vmd > transaxis z 3.1415927 rad
Info) {-1.0 -2.65359e-06 0.0 0.0} {2.65359e-06 -1.0 0.0 0.0} {0.0 0.0 1.0 0.0}
{0.0 0.0 0.0 1.0}
transve
v { Returns the transformation matrix needed to bring the x axis along the v
ve
tor. This matrix is not unique, sin
e a nal rotation is allowed around the ve
tor. The
matrix is made from a rotation around y, then one about z.
120
Examples:
vmd > transve
{0 1 0}
Info) {-3.67321e-06 -1.0 0.0 0.0} {1.0 -3.67321e-06 0.0 0.0} {0.0 0.0 1.0 0.0}
{0.0 0.0 0.0 1.0}
vmd > ve
trans [transve
{0 0 2}℄ {1 0 0}
Info) 0.0 0.0 1.0
transve
inv v { Returns the transformation needed to bring the ve
tor v to the x axis. This
produ
es the inverse matrix to transve
, and is
omposed of a rotation about z then one about
y.
Examples:
vmd > transve
inv {0 -1 0}
Info) {-3.67321e-06 -1.0 0.0 0.0} {1.0 -3.67321e-06 0.0 0.0} {0.0 0.0 1.0 0.0}
{0.0 0.0 0.0 1.0}
vmd > ve
trans [transve
inv {-3 4 -12}℄ {-3 4 -12}
Info) 13.0 -1.8e-05 5.8e-05
vmd > transmult [transve
{6 -5 7}℄ [transve
inv {6 -5 7}℄
Info) {0.999999 2.29254e-07 -6.262e-09 0.0} {2.29254e-07 0.999999
-4.52228e-07 0.0} {-6.262e-09 -4.52228e-07 1.0 0.0} {0.0 0.0 0.0 1.0}
(C++) transoset v { Returns the transformation matrix needed to translate by the given
oset
Examples:
vmd > transoffset {1 0 0}
Info) {1.0 0.0 0.0 1} {0.0 1.0 0.0 0} {0.0 0.0 1.0 0} {0.0 0.0 0.0 1.0}
vmd > transoffset {-6 5 -4.3}
Info) {1.0 0.0 0.0 -6} {0.0 1.0 0.0 5} {0.0 0.0 1.0 -4.3} {0.0 0.0 0.0 1.0}
121
trans [
enter fx y zg℄ [origin fx y zg℄ [oset fx y zg℄ [axis x amount [rad|deg|pi℄℄
[axis y amount [rad|deg|pi℄℄ [axis z amount [rad|deg|pi℄℄ [x amount [rad|deg|pi℄℄
[y amount [rad|deg|pi℄℄ [z amount [rad|deg|pi℄℄ [axis fx y zg amount [rad|deg|pi℄℄
[bond fx1 y1 z1g fx2 y2 z2g amount [rad|deg|pi℄℄ [angle fx1 y1 z1g fx2 y2 z2g fx3 y3
z3g amount [rad|deg|pi℄℄ {
This
ommand
an do almost everything the other ones
an do, and then some. It is designed
to be the main fun
tion used for generating transformation matri
es.
Using it
orre
tly
alls for understanding how it works internally. There are three matri
es:
entering, rotation, and oset. The
entering matrix determines where the
enter of rotation is
lo
ated. By default, this is the origin, but it
an be
hanged to pivot about any point. The
rotation matrix denes the rotation about that
entering point, and the oset matrix denes the
nal translation after the rotation.
For example, to rotate around a given point, the transformations would be 1) the
entering
matrix to bring that point to the origin, 2) the rotation about the
enter, and 3) the nal oset to
return the origin ba
k to its original lo
ation.
The dierent options for the trans
ommand modify the matri
es in various ways.
{
enter fx y zg { Sets the
entering matrix so that point x y z is brought to the origin
{ oset fx y zg { Sets the oset matrix so that the origin is brought to x y z
{ origin fx y zg { Sets both the
entering and oset matri
es to x y z
{ axis x amount [rad|deg|pi℄ { Adds a rotation about the x axis by the given amount to the
rotation matrix
{ axis y amount [rad|deg|pi℄ { Adds a rotation about the y axis by the given amount to the
rotation matrix
{ axis z amount [rad|deg|pi℄ { Adds a rotation about the z axis by the given amount to the
rotation matrix
{ axis fx y zg amount [rad|deg|pi℄ { Adds a rotation of the given amount about the given
ve
tor to the rotation matrix
{ bond fx1 y1 z1g fx2 y2 z2g amount [rad|deg|pi℄ { Sets the
enter and oset transforma-
tions to the rst point, and denes a rotation about the bond axis by the given amount.
{ angle fx1 y1 z1g fx2 y2 z2g fx3 y3 z3g amount [rad|deg|pi℄ { Sets the
enter and oset
transformation to the se
ond point, and denes a rotation about the axis perpendi
ular to
the plane made by the three points (the ve
tor is
omputed from the
ross produ
t of the
ve
tor
onne
ting the rst two points with that
onne
ted the last two).
122
(C++) ve
trans m v { Multiple the matrix m with the ve
tor v (length 4); returns a ve
tor
oordtrans m v { Multiple the matrix m with the
oordinate v (length 3); returns a ve
tor
Examples:
vmd > ve
trans [transaxis z 90℄ {1 0 0}
Info) -3.67321e-06 1.0 0.0
vmd > ve
trans [transve
inv {-3 4 -12}℄ {-3 4 -12}
Info) 13.0 -1.8e-05 5.8e-05
123
vmd > find_rotation_value a
Info) 0.785398
vmd > expr $M_PI * 3.0 / 2.0
Info) 4.71239
vmd > set a "4.71238 radians"
Info) 4.71238 radians
vmd > find_rotation_value a
Info) 4.71238
124
Chapter 12
IRIS-4D VGX model supports antialiased line widths 1.0 and 2.0, and
aliased line widths one through 255. IRIS-4D G, GT, and GTX models, the
Personal Iris, Indy, Iris Entry, XL, XS, XS24, XZ, Elan and Extreme
systems support antialiased line width 1.0, and aliased line widths one
through 255.
125
Note that there is a known bug in VMD whi
h
auses it to mix up and lose tra
k of the
anti-alias and depth-
ue modes.
ylinder fx1 y1 z1g fx2 y2 z2g [radius r℄ [resolution n℄ [lled yes|no ℄ {
< >
draws a
ylinder of the given radius (default r=1) from the rst point to the se
ond. The
ylinder is a
tually drawn as an n sided polygon. If the filled option is true (default), the
ends are
apped with
at disks, otherwise the
ylinder is hollow.
one fbasex basey basezg ftipz tipy tipzg [radius r℄ [resolution n℄ {
draw a
one with the
enter of the base at the rst point and the tip at the se
ond. The
radius(default r=1) determines the width of the base. As with
ylinder, the resolution
determines the number of polygons used in the approximation.
triangle fx1 y1 z1g fx2 y2 z3g fx3 y3 z3g {
draws a triangle with endpoints at ea
h of the three verti
es
trinorm fx1 y1 z1g fx2 y2 z3g fx3 y3 z3g fnx1 y1 z1g fnx2 ny2 nz3g fnx3 ny3 nz3g {
draws a triangle with endpoints at ea
h of the rst three points. The se
ond group of three
values spe
ify the normals for the three points. This is used for making a smooth shading
a
ross the triangle.
sphere fx y zg [radius r℄ [resolution n℄ {
draws a sphere of the given radius (default r=1)
entered at the vertex. The resolution
(default n=6) determines how many polygons are used in the approximation of a sphere.
text fx y zg \text string" {
displays the text string with the bottom left of the string starting at the given vertex.
olor
olorId {
olor name {
olor trans name { Ea
h of the above geometri
al obje
ts are drawn using the
urrent
olor.
Initially, that
olor is blue, whi
h has the
olorid of 0. The
olor
ommand
hanges the
urrent
olor, and stays info ee
t until the next
olor
ommand. Thus, to draw a red
ylinder then a red sphere, rst use the
ommand
olor red
ommand to
hange the
olor,
then use the
ylinder and sphere
ommands.
materials on|o
< > { Material properties are used to make the graphi
al obje
ts (lines,
ylinders, et
.) be ae
ted by the light sour
es. These make the obje
ts look more realisti
,
but are slower on ma
hines whi
h don't implement materials in hardware (see
hapter x 6
and se
tions on
olor [x 10.3.3℄ and
olorinfo [x 10.3.4℄
ommands for the information on how
to turn o material
hara
teristi
s for all obje
ts in VMD). One surprising ee
t of material
hara
teristi
s is that lines are ae
ted. In some lighting situations, the lines
an even appear
to disappear. Thus, you may want to turn o materials before drawing lines.
126
12.2 Tutorials and Examples
We'll start with some basi
examples. Load VMD and enter:
draw
ylinder {0 0 0} {5 0 0} radius 0.2
VMD will print:
Info) Loading new mole
ule ...
be
ause of the way graphi
s are implemented (don't worry about the details yet) and draw a blue
ylinder on the s
reen.
Now
hange the
olor to red and draw two more
ylinders:
draw
olor red
draw
ylinder {4 1 0} {5 0 0} radius 0.1
draw
ylinder {4 -1 0} {5 0 0} radius 0.1
You might want to reset the view. Sin
e the original s
ene had no data, a default size was
hosen.
Now that there is data, a reset view will
enter the graphi
s just as if it was a regular mole
ule (in
fa
t, the implementation is a mole
ule with no atoms and only graphi
s). You now have a simple
arrow. Let's make a ni
er looking one now. First, remove all the graphi
s:
draw delete all
and make a
ylinder with a
one on the end
draw
ylinder {0 0 0} {4 0 0} radius 0.1
draw
one {4 0 0} {5 0 0} radius 0.15
Note that the widest part of the
one is at the rst point. As long as we're at it, let's add some
text to the end of the arrow in green
draw
olor green
draw text {5 0 0} "This way"
Cool, eh? Of
ourse, more things are available than a
ylinder,
one, and text. How about a sphere?
draw sphere {0 0 0} radius 0.3
draw sphere {0 2 0} radius 0.2
The
olor of the spheres is green be
ause that was the previously assigned
olor. The
olor doesn't
hange until expli
itly spe
ied with the
olor option. The default
olor is blue.
And some lines, rst, a dotted line
onne
ting the spheres
draw line {0 0 0} {0 2 0} style dashed
then a solid one from the se
ond sphere to the end of the arrow
draw line {0 2 0} {5 0 0}
Now, reset the view and move things around a bit. You may be surprised to see the lines appear
and disappear. This is be
ause the lines have a "material property"; whi
h means they are ae
ted
by the lights. For some things, this may be useful, but usually if you want to draw lines, you'll
need to turn materials o.
draw materials off
127
12.2.1 Drawing a graph
Here's an example of how to draw a 2-D graph. First, get rid of the
urrent graphi
s (sin
e there
may be graphi
s from the previous tutorial):
draw delete all
Dene a fun
tion to graph, in this
ase, a parabola.
pro
f {x} {
expr $x * $x
}
The following fun
tion draws a graph given the fun
tion name, the start and end values, and
the step size.
pro
draw_graph {fun
tion start end step} {
# do some error
he
king
if {$step < 0} {set step -$step}
if {$step == 0} {error "draw_graph:
annot have step size of zero"}
if {$start > $end} {
set tmp $start
set start $end
set end $tmp
}
# turn materials off
draw materials off
# draw the data in green
draw
olor green
128
# draw a red box around everything
draw
olor red
draw line "$start $miny 0" "$end $miny 0"
draw line "$start $miny 0" "$start $maxy 0"
draw line "$end $maxy 0" "$end $miny 0"
draw line "$end $maxy 0" "$start $maxy 0"
# and put some labels down
draw text "$end $miny 0" "x ->"
draw text "$start $maxy 0" "f(x)"
}
Copy these two denitions into VMD's text
onsole (this s
ript is available from the VMD s
ript
library at http://www.ks.uiu
.edu/Resear
h/vmd/s
ript library/), then enter
draw_graph f -5 4 0.2
and reset the view. Presto, a ni
e little parabola.
12.2.2 Triangles
If you want to draw the surfa
e of a solid obje
t you
an build it out of triangles. The graphi
s
interfa
e to VMD supports two types of triangles, simple triangles with just the
orners dened, or
"trinorms" whi
h have normals dened for ea
h
orner.
First, a simple red triangle
draw delete all
draw
olor red
draw triangle {1 0 0} {0 1 0} {0 0 1}
Not bad, so let's put some more in
draw triangle {1 0 0} {0 1 0} {0 0 -1}
draw triangle {1 0 0} {0 -1 0} {0 0 1}
draw triangle {1 0 0} {0 -1 0} {0 0 -1}
draw triangle {-1 0 0} {0 1 0} {0 0 1}
draw triangle {-1 0 0} {0 1 0} {0 0 -1}
draw triangle {-1 0 0} {0 -1 0} {0 0 1}
draw triangle {-1 0 0} {0 -1 0} {0 0 -1}
And you have yourself an o
tahedron. See how the
olors on the fa
es don't go smoothly from
one side to the next? This is be
ause the surfa
e normals for one fa
e are quite dierent from
another, so the lights are re
e
ted dierently. The
olors
an be made smoother by dening the
normals for the
orners su
h that the normals of the edges are the same. One
aution about
dening the verti
es and normals: they must be given in
ounter-
lo
kwise order or the shading
will be wrong.
As an example, here's the above o
tahedron with the normals spe
ied:
draw delete all
draw
olor red
draw trinorm {1 0 0} {0 1 0} {0 0 1} {1 0 0} {0 1 0} {0 0 1}
129
draw trinorm {1 0 0} {0 0 -1} {0 1 0} {1 0 0} {0 0 -1} {0 1 0}
draw trinorm {1 0 0} {0 0 1} {0 -1 0} {1 0 0} {0 0 1} {0 -1 0}
draw trinorm {1 0 0} {0 -1 0} {0 0 -1} {1 0 0} {0 -1 0} {0 0 -1}
draw trinorm {-1 0 0} {0 0 1} {0 1 0} {-1 0 0} {0 0 1} {0 1 0}
draw trinorm {-1 0 0} {0 1 0} {0 0 -1} {-1 0 0} {0 1 0} {0 0 -1}
draw trinorm {-1 0 0} {0 -1 0} {0 0 1} {-1 0 0} {0 -1 0} {0 0 1}
draw trinorm {-1 0 0} {0 0 -1} {0 -1 0} {-1 0 0} {0 0 -1} {0 -1 0}
pro
draw_surfa
e { f } {
set minx -5
set maxx 5
set miny -5
set maxy 5
set step 0.5
# first, get the data (this isn't the most data effi
ient way of
# doing things)
for {set i $minx} {$i <= $maxx} {set i [expr $i + $step℄} {
for {set j $miny} {$j <= $maxy} {set j [expr $j + $step℄} {
set data($i,$j) [$f $i $j℄
}
}
# make another pass through to plot it
for {set i $minx} {$i <= [expr $maxx - $step℄} {set i [expr $i + $step℄} {
for {set j $miny} {$j <= [expr $maxy - $step℄} {set j [expr $j + $step℄} {
# get the next two
orners
set i2 [expr $i + $step℄
set j2 [expr $j + $step℄
# find the middle
set imiddle [expr $i + $step/2℄
set jmiddle [expr $j + $step/2℄
set kmiddle [expr ($data($i,$j) + $data($i2,$j) + $data($i2,$j2) \
+ $data($i,$j2)) / 4.0℄
# use a
ool
oloring s
heme (this depends on the graph having a min
# value of 0 and max of 5, or at least less than about 30)
draw
olor [expr 34 + [int [expr 6 * $kmiddle℄℄ % 32℄
# make 4 triangles
draw triangle "$i $j $data($i,$j)" "$imiddle $jmiddle $kmiddle" \
"$i2 $j $data($i2,$j)"
draw triangle "$i $j $data($i,$j)" "$i $j2 $data($i,$j2)" \
130
"$imiddle $jmiddle $kmiddle"
draw triangle "$i2 $j2 $data($i2,$j2)" "$i2 $j $data($i2,$j)" \
"$imiddle $jmiddle $kmiddle"
draw triangle "$i2 $j2 $data($i2,$j2)" "$imiddle $jmiddle $kmiddle" \
"$i $j2 $data($i,$j2)"
}
}
}
And graph it with the
ommand:
draw_surfa
e g
Looks like it should be on a quilt, doesn't it?
131
draw line "$minx $miny $maxz" "$maxx $miny $maxz"
draw line "$minx $miny $maxz" "$minx $maxy $maxz"
132
draw sphere $
oords radius 1.0
}
tra
e variable vmd_pi
k_atom w sphere_pi
k
12.2.7 Animation
One last example of what
an be done with the user-dened graphi
s. While VMD is not designed
for animation, it
an be made to animate obje
ts by repeating the
y
le of drawing the obje
ts
then
alling the display update
ommand. Here's an example whi
h has several balls swinging
(non-physi
ally) at the end of a
hain. If you want to stop it before it nishes, use <Ctrl-C>, but
if you
at
h it in the wrong pla
e and nothing moves, you'll need to exe
ute the
ommand display
update on (see se
tion x 10.3.6 for details about display updates.
pro
swing {} {
# get rid of everything else (if there is anything)
if [expr [molinfo top℄ != -1℄ { mol off all }
#
reate a new graphi
s mole
ule to handle just this
mol load graphi
s "swing"
set mol [molinfo top℄
set
enter {0 0.5 0}
set radius 0.125
set offset ".25 0 0"
set length 1
set firsttime 1
display resetview
axes lo
ation off
stage lo
ation off
for {set i 0} {$i < 1000} {in
r i} {
display update off
s
ale by 1.003
rotate y by 5
display update on
set top1 [ve
sub $
enter $offset℄
set top2 $
enter
set top3 [ve
add $
enter $offset℄
#
ompute the bottom lo
ation
set bot1 [ve
sub $top1 "0 $length 0"℄
set bot2 [ve
sub $top2 "0 $length 0"℄
set bot3 [ve
sub $top3 "0 $length 0"℄
set xdiff [expr sin($i/10.0)℄
set ydiff [expr 1.0 - abs(
os($i/10.0))℄
133
if $firsttime {
set firsttime 0
display resetview
} else {
graphi
s $mol delete all
}
# draw the three different balls/strings in different
olors
graphi
s $mol
olor red
graphi
s $mol sphere $bot1 radius $radius
graphi
s $mol
olor green
graphi
s $mol sphere $bot2 radius $radius
graphi
s $mol
olor blue
graphi
s $mol sphere $bot3 radius $radius
graphi
s $mol materials off
graphi
s $mol
olor red
graphi
s $mol line $top1 $bot1
graphi
s $mol
olor green
graphi
s $mol line $top2 $bot2
graphi
s $mol
olor blue
graphi
s $mol line $top3 $bot3
display reshape
}
display update on
}
12.3 Graphi
s
This se
tion des
ribes te
hni
al aspe
ts of how the graphi
s
ommands are implemented and used.
It should be read by those who want to understand how to build s
ript-level extensions and those
who like knowing more about how things work.
The user
ontrolled graphi
s are implemented as if they are mole
ules of zero length whi
h
ontains only a list of graphi
al obje
ts. (Indeed, internally the
lass is
alled \Mole
uleGraphi
s"
and is derived from the Mole
ule
lass.) Thus, all the normal
ontrols are appli
able, and this is
why the graphi
s \mole
ules" are on the Mol form. This simplies matters as many of the
ontrols,
su
h as the mouse
ontrols, do not need to be dupli
ated. However, some of the
ommands that
apply only to mole
ules then make no sense, su
h as the graphi
s form.
Multiple graphi
s lists
an be
reated. Sin
e they are just spe
ializations of a normal mole
ule,
they are
reated with the mol load
ommand, just like any other mole
ule. The full
ommand is:
mol load graphi
s name
The name parameter should be a disti
tive string related to the mole
ule. For instan
e, if the
purpose of a new graphi
s list is to read in a graphi
s le format, the name should be the le name.
If it is a method of viewing data from another, loaded mole
ule, the name should
ontain the name
of the method and the mole
ule Id of the mole
ule from whi
h it was derived. VMD reserves the
name \graphi
s" for use with the draw
ommand as that
ommand always adds its graphi
s to the
last graphi
al mole
ule with that name.
134
On
e the graphi
s list is loaded and on the list of mole
ules, it
an be distinguished from a
normal mole
ule by using the molinfo <molID> get sour
e
ommand, whi
h returns \Graphi
s"
for graphi
s mole
ules.
The information pertaining to a given graphi
s list is a
essed via the graphi
s
ommand,
whi
h is of the following form:
graphi
s mole
ule id
ommand [options ...℄
< >
where the "mole
ule id" is the id of the graphi
s mole
ule on the mole
ule list. The
ommand eld
an be one of the graphi
al items listed in se
tion x12.1, or one of the
ommands exists, delete,
repla
e, list or info. The graphi
s
ommand returns a value, whi
h depends on the
ommand
given.
As graphi
al primitives are added to the list they are assigned a unique, in
reasing value. The
rst obje
t added is assigned 0, the se
ond is assigned 1, et
. The
ommands whi
h add an item
return its value. A list of the available obje
t ids is available with the list
ommand. To test if a
spe
i
primitive exists, use the exists
ommand followed by the obje
t index. This returns a 1
if the index exists, and 0 if it does not. Information
an be retrieved about a given item with the
info
ommand. This takes one option, whi
h is the number of graphi
al information from whi
h
information is desired.
A given primitive is deleted with the delete
ommand followed by the index of the obje
t to
delete. It does not have a return value. If the parameter is the string all, then all the primitives
are deleted and the index
ount reset to 0.
Another deletion method allows one primitive to be repla
ed by another; suspi
iously enough,
this is the repla
e
ommand. What it does is delete the given primitive and set things up so
the next primitive is put in the same spot on the list and given the same index. This is designed
for situations where the graphi
s are
ompli
ated to build, but where the
olors might want to be
easily
hanged. The
olor denition
an be repla
ed without needing to rebuild the full list.
Here are examples of all the above
ommands:
vmd > mol load graphi
s testing
Info) Loading new mole
ule ...
vmd > graphi
s top sphere {0.1 0.2 0.3} radius 0.4
Info) 0
vmd > graphi
s top
ylinder {-1 -1 -1} {2.6 2.5 2.4} resolution 3
Info) 1
vmd > graphi
s top line {0 0 0} {3 0 0} style dashed
Info) 2
vmd > graphi
s top delete 1
vmd > graphi
s top list
Info) 0 2
vmd > graphi
s top exists 0
Info) 1
vmd > graphi
s top exists 1
Info) 0
vmd > graphi
s top info 0
Info) sphere {0.100000 0.200000 0.300000} radius 0.400000 resolution 6
vmd > graphi
s top repla
e 0
vmd > graphi
s top point {3.3 2.2 1.1}
135
Info) 0
vmd > graphi
s top info 0
Info) point {3.300000 2.200000 1.100000}
vmd > graphi
s top list
Info) 0 2
and here's one whi
h adds the \
olor" option to the \
ylinder primitive. It works be
ause the draw
ommand tries the \graphi
s"
ommand and fails, be
ause the \
olor" option doesn't exist. At
that point, the extensions are
he
ked.
pro
vmd_draw_
ylinder {mol start end args} {
if [expr [llength $args℄ % 2℄ {
error "draw:
ylinder: in
orre
t argument list"
}
# start the
onstru
tion of the graphi
s
ommand
set opts [list graphi
s $mol
ylinder℄
lappend opts $start $end
# sear
h for the "
olor" option
while {[string
ompare $args {}℄} {
# get the parameter and value
set a [lvarpop args℄
set b [lvarpop args℄
#
he
k if it is the
olor
ommand
if [string
ompare $a "
olor"℄ {
136
# if it isn't, save the options
lappend opts $a $b
} else {
# otherwise, save the
olor
set
olor $b
}
}
#
all the graphi
s
ommands
graphi
s $mol
olor $
olor
eval $opts
}
137
Chapter 13
This Chapter
overs how to extra
t information about mole
ules and atoms using the VMD text
ommands molinfo and atomsele
t.
13.1 molinfo
The molinfo
ommand is used to get information about a mole
ule (or loaded le) in
luding the
number of loaded atoms, the lename, the graphi
s sele
tions, and the viewing matri
es. It
an
also be used to return information about the list of loaded mole
ules.
138
Info) 3
vmd > mol delete 1
Info) Deleted 1 mole
ules.
vmd > molinfo list
Info) 0 2
vmd > molinfo top
Info) 2
vmd > molinfo index 1
Info) 2
139
A similar behavior
an be a
hieved by using mol list top , in whi
h
ase, however, there is no
dire
t a
ess to the data. A
omplete list of keywords is given in Table 13.1.2.
The molinfo
ommand,
ontrary to its name,
an also be used to set some keyword values, su
h
as the
urrent frame number and the display state
ags. This dupli
ates some of the fun
tionality
of the mol
ommand, though there are distin
t dieren
es in the implementation. Spe
i
ally, the
mol
ommand uses the internal
ommand queue whi
h, among other things, noties the appropriate
forms that a
hange o
ured, redraws the graphi
s, and logs the
ommands to the log le, of logging
is enabled. In future versions of VMD there will be only one
ommand; for now we suggest only
using the molinfo
ommand to get information and to set the frame value and the various viewing
matri
es.
Examples:
Two fun
tions, one to save the
urrent view position, the other to restore it. The position of
the axis is not
hanged by these operations.
pro
save_viewpoint {} {
global viewpoints
if [info exists viewpoints℄ {unset viewpoints}
# get the
urrent matri
ies
forea
h mol [molinfo list℄ {
set viewpoints($mol) [molinfo $mol get {
enter_matrix rotate_matrix s
ale_matrix global_matrix}℄
}
}
pro
restore_viewpoint {} {
global viewpoints
forea
h mol [molinfo list℄ {
puts "Trying $mol"
if [info exists viewpoints($mol)℄ {
molinfo $mol set {
enter_matrix rotate_matrix s
ale_matrix
global_matrix} $viewpoints($mol)
}
}
}
Cy
le through the list of displayed mole
ules, turning ea
h one on one at a time. At the end,
return the display
ags to their original state.
# save the
urrent display state
forea
h mol [molinfo list℄ {
set disp($mol) [molinfo $mol get drawn℄
}
# turn everything off
mol off all
# turn ea
h mole
ule on then off again
forea
h mol [molinfo list℄ {
if $disp($mol) {
mol on $mol
sleep 1
140
mol off $mol
}
}
# turn the original ones ba
k on
forea
h mol [molinfo list℄ {
if $disp($mol) {mol on $mol }
}
The last loop, whi
h turns the originally drawn mole
ules ba
k on, doesn't turn them on at
the same time. That's be
ause some
ommands (those whi
h use the
ommand queue) redraw the
graphi
s when they are used. This
an be disabled with the display update (see se
tion x 10.3.6
for more information). Using this, the nal loop be
omes
#turn the original ones ba
k on
display update off
forea
h mol [molinfo list℄ {
if $disp($mol) {mol on $mol }
}
display update on
Alternatively, sin
e the drawn option is settable, you
ould do:
forea
h mol [molinfo list℄ {
if $disp($mol) {molinfo $mol set drawn 1}
}
However, that won't set the
ag to redraw the s
ene so you need to for
e a redraw with display
redraw.
141
hanged on
e a sele
tion is made. Some of the terms in the sele
tion depend on data that
hange
during a traje
tory (so far only the keywords 'x', 'y', and 'z'
an
hange over time). For these,
the optional 'frame value' is used to determine whi
h spe
i
frame to use. The frame number
an
be a non-negative integer, the word "now" (the
urrent frame), the word "rst" (for frame 0) and
"last" (for the last frame).
In terms of usage, the form of the atom sele
tion
ommand is:
atomsele
t mole
ule id sele
tion text [frame frame number℄
Some examples are:
vmd> atomsele
t top "name CA"
atomsele
t0
vmd> atomsele
t 3 "resid 25" frame last
atomsele
t1
vmd> atomsele
t top "within 5 of resname LYR" frame 23
atomsele
t2
The name returned is a fun
tion name, and you
an use it like any other fun
tions. There are
several parameters to these, as shown in the following:
# Number of atoms in the sele
tion
vmd> atomsele
t1 num
13
# The sele
tion text used to
reate the sele
tion
vmd> atomsele
t1 text
{resid 25}
# list of atom indi
ies in the sele
tion
vmd> atomsele
t0 list
0 5 11 17 23 29 35 41 47 53 59 65
The "resid 25" is in bra
es be
ause it is one element of a T
l list. This is an important point to
noti
e, for reasons to be dis
ussed after multiple attributes are introdu
ed.
The way to use the fun
tion
reated by the atomsele
t
ommand is to store the name into a
variable, then use the variable to get the name when needed.
vmd> set sel [atomsele
t top "water"℄
atomsele
t3
vmd> $sel text
water
This is equivalent to saying
vmd> atomsele
t3 text
The easiest way of thinking about this is that the atomsele
t
ommand
reates an obje
t.
To get information from the obje
t you have to send it a
ommand. Thus, in the example above
(atomsele
t1 num) the obje
t "atomsele
t1" was sent the
ommand "num", whi
h asks the obje
t
to return the number of atoms in the sele
tion.
These derived obje
t fun
tions (the ones with names like atomsele
t3) take many options. They
are listed in Table 13.2.
142
You already saw some examples of the rst few of these
ommands. The se
ond half of the
ommands allows you to get or set atom information. The information that
an be returned are
the same keywords available in the sele
tion
ommand (eg, "resid", "x", "segname") as well as the
boolean words like "water" and "ba
kbone" (these are returned as 1 if true and 0 if false).
For instan
e, given the sele
tion
vmd> set sel [atomsele
t top "resid 4"℄
atomsele
t4
you
an get the atom names for ea
h of the atoms in the sele
tion with
vmd> $sel get name
{N} {H} {CA} {CB} {C} {O}
(whi
h, remember, is the same as
vmd> atomsele
t4 get name
)
Multiple attributes
an be requested by submitting a list, so if you want to see whi
h atoms are
on the ba
kbone,
vmd> $sel get {name ba
kbone}
{N 1} {H 0} {CA 1} {CB 0} {C 1} {O 1}
and the atom
oordinates with
vmd> $sel get {x y z}
{0.710000 4.211000 1.093000} {-0.026000 3.700000 0.697000} {0.541000
4.841000 2.388000} {-0.809000 4.462000 2.976000} {1.591000 4.371000
3.381000} {2.212000 5.167000 4.085000}
It is very important to note that the information returned by one of these
ommands is a list
of lists. Spe
i
ally, it is a list of size n where ea
h element is itself a list of size i, where n is the
number of atoms in the sele
tion and i is the number of attributes requested.
One qui
k fun
tion you
an build with the
oordinates is a method to
al
ulate the geometri
al
enter (not quite the
enter of mass; that's a bit harder). This also uses some of the ve
tor
ommands dis
ussed in the se
tion about ve
tors and matri
es [x11℄, but you should be able to
gure them out from
ontext.
pro
geom_
enter {sele
tion} {
# set the geometri
al
enter to 0
set g
[ve
zero℄
# [$sele
tion get {x y z}℄ returns a list of {x y z}
# values (one per atoms) so get ea
h term one by one
forea
h
oord [$sele
tion get {x y z}℄ {
# sum up the
oordinates
set g
[ve
add $g
$
oord℄
}
# and s
ale by the inverse of the number of atoms
return [ve
s
ale [expr 1.0 /[$sele
tion num℄℄ $g
℄
}
143
With that dened you
an say (assuming $sel was
reated with the previous atomsele
tion
example)
vmd> geom_
enter $sel
0.703168 4.45868 2.43667
I'll go through the example line by line. The fun
tion is named geom
enter and takes one param-
eter, the name of the sele
tion. The rst line sets the variable \g
" to the zero ve
tor, whi
h is 0 0
0. On the se
ond line of
ode, two things o
ur. First, the
ommand
$sele
tion get {x y z}
is exe
uted, and the string is repla
ed with the result, whi
h is
{0.710000 4.211000 1.093000} {-0.026000 3.700000 0.697000} {0.541000
4.841000 2.388000} {-0.809000 4.462000 2.976000} {1.591000 4.371000
3.381000} {2.212000 5.167000 4.085000}
This is a list of 6 terms (one for ea
h atom in the sele
tion), and ea
h term is a list of three elements,
the x, y, and z
oordinate, in that order.
The "forea
h"
ommand splits the list into its six terms and goes down the list term by term,
setting the variable "
oord" to ea
h su
essive term. Inside the loop, the value of $
oord is added
to total sum.
The last line returns the geometri
al
enter of the atoms in the sele
tion. Sin
e the geometri
al
enter is dened as the sum of the
oordinate ve
tors divided by the number of elements, and so
far I have only
al
ulated the sum of ve
tors, I need the inverse of the number of elements, whi
h
is done with the expression
expr 1.0 / [$sele
tion num℄
The de
imal in "1.0" is important sin
e otherwise T
l does integer division. Finally, this value is
used to s
ale the sum of the
oordinate ve
tors (with ve
s
ale), whi
h returns the new value, whi
h
is itself returned as the result of the pro
edure.
The
enter of mass fun
tion is slightly harder be
ause you have to get the mass as well as
the
P
x, y, Pz values, then break that up into to
omponents. The formula for the
enter of mass is
i i
m x = mass i
144
forea
h
oord [$sele
tion get {x y z}℄ m [$sele
tion get mass℄ {
# sum of the masses
set mass [expr $mass + $m℄
# sum up the produ
t of mass and
oordinate
set
om [ve
add $
om [ve
s
ale $m $
oord℄℄
}
# and s
ale by the inverse of the number of atoms
if {$mass == 0} {
error "
enter_of_mass: total mass is zero"
}
# The "1.0"
an't be "1", sin
e otherwise integer division is done
return [ve
s
ale [expr 1.0/$mass℄ $
om℄
}
The opposite of "get" is "set". A few of the keywords (most notably, "x", "y", and "z")
an be
set to new values. This allows, for instan
e, atom
oordinates to be
hanged, the o
upan
y values
to be updated, or user for
es to be added. Right now the only things that
an be
hanged are the
oordinates, the beta and o
upan
y values and user for
es.
set sel [atomsele
t top "index 5"℄
$sel get {x y z}
{1.450000 0.000000 0.000000}
$set set {x y z} {{1.6 0 0}}
Note that just as the get option returned a list of lists, the set option needs a list of lists, whi
h
is why the extra set of
urly bra
es were need. Again, this must be a list of size n
ontaining
elements whi
h are a list of size i. The exe
eption is if n is 1, the list is dupli
ated enough times
so there is one element for ea
h atom.
# get two atoms and set their
oordinates
set sel [atomsele
t top "index 6 7"℄
$sel set {x y z} { {5 0 0} {7.6 5.4 3.2} }
In this
ase, the atom with index 6 gets its (x, y, z) values set to 5 0 0 and the atom with index
7 has its
oordinates
hanged to 7.6 5.4 3.2.
It is possible to move atoms this way by getting the
oordinates,
hanging them (say by adding
some oset) and repla
ing it. Following is a fun
tion whi
h will do just that:
145
And to use this fun
tion (in this
ase, to apply an oset of (x y z) = (0.1 -2.8 9) to the sele
tion
"$movesel"):
moveby $movesel {0.1 -2.8 9}
However, to simplify matters some options have been added to the sele
tion to deal with movements
(these
ommands are also implemented in C++ and are mu
h faster than the T
l versions). These
fun
tions are moveby, moveto, and move. The rst two take a position ve
tor and the last takes a
transformation matrix.
The rst
ommand, moveby, moves ea
h of the atoms in the sele
tion over by the given ve
tor
oset.
$sel moveby {1 -1 3.4}
The se
ond, moveto, moves all the atoms in a sele
tion to a given
oordinate (it would be strange
to use this for a sele
tion of more than one atom, but that's allowed). Example:
$sel moveto {-1 1 4.3}
The last of those, move, applies the given transformation matrix to ea
h of the atom
oordinates.
This is best used for rotating a set of atoms around a given axis, as in
$sel move [trans x by 90℄
whi
h rotates the sele
tion 90 degrees about the x axis. Of
ourse, any transformation matrix may
be used.
A more useful example is the following, whi
h rotates the side
hain atoms around the CA-CB
bond by 10 degrees.
# get the side
hain atoms (CB and onwards)
set side
hain [atomsele
t top "side
hain residue 22"℄
# get the CA
oordinates --
ould do next two on one line ...
set CA [atomsele
t top "name CA and residue 22"℄
set CA
oord [lindex [$CA get {x y z}℄ 0℄
# and get the CB
oordinates
set CB [atomsele
t top "name CB and residue 22"℄
set CB
oord [lindex [$CB get {x y z}℄ 0℄
# apply a transform of 10 degrees about the given bond axis
$side
hain move [trans bond $CA
oord $CB
oord 10 deg℄
146
set sum [expr $sum + $mass℄
}
return $sum
}
Here's another (slower) way to do the same thing. This works be
ause the mass returned from the
sele
tion is a list of lists. Putting it inside the quotes of the eval makes it a sequen
e of ve
tors, so
the ve
add
ommand will work on it.
pro
total_mass1 {sele
tion} {
set mass [$sele
tion get mass℄
eval "ve
add $mass"
}
Find the min and max
oordinate values of a given mole
ule in the x, y, and z dire
tions (see
also the measure
ommand 'minmax'). The fun
tion takes the mole
ule id and returns two ve
tors;
the rst
ontains the min values and the se
ond
ontains the max.
pro
minmax {molid} {
set sel [atomsele
t $molid all℄
set
oords [$sel get {x y z}℄
set
oord [lvarpop
oords℄
lassign $
oord minx miny minz
lassign $
oord maxx maxy maxz
forea
h
oord $
oords {
lassign $
oord x y z
if {$x < $minx} {set minx $x} else {if {$x > $maxx} {set maxx $x}}
if {$y < $miny} {set miny $y} else {if {$y > $maxy} {set maxy $y}}
if {$z < $minz} {set minz $z} else {if {$z > $maxz} {set maxz $z}}
}
return [list [list $minx $miny $minz℄ [list $maxx $maxy $maxz℄℄
}
Compute the radius of gyration P
for a sele
tionP(see also measure rgyr). The square of the
radius of gyration is dened as i mi (~ri ~r
)2 = i mi . This uses the
enter of mass fun
tion
dened earlier in this
hapter; a faster version would repla
e that with measure
enter.
pro
gyr_radius {sel} {
# make sure this is a proper sele
tion and has atoms
if {[$sel num℄ <= 0} {
error "gyr_radius: must have at least one atom in sele
tion"
}
# gyration is sqrt( sum((r(i) - r(
enter_of_mass))^2) / N)
set
om [
enter_of_mass $sel℄
set sum 0
forea
h
oord [$sel get {x y z}℄ {
set sum [ve
add $sum [ve
length2 [ve
sub $
oord $
om℄℄℄
}
return [expr sqrt($sum / ([$sel num℄ + 0.0))℄
}
147
Applying this to the alanin.pdb
oordinate le
vmd > mol load pdb alanin.pdb
vmd > set sel [atomsele
t top all℄
vmd > gyr_radius $sel
Info) 5.45443
Compute the rms dieren
e of a sele
tion between two frames of a traje
tory. This takes a
sele
tion and the values of the two frames to
ompare.
pro
frame_rmsd {sele
tion frame1 frame2} {
set mol [$sele
tion molindex℄
#
he
k the range
set num [molinfo $mol get numframes℄
if {$frame1 < 0 || $frame1 >= $num || $frame2 < 0 || $frame2 >= $num} {
error "frame_rmsd: frame number out of range"
}
# get the first
oordinate set
set sel1 [atomsele
t $mol [$sele
tion text℄ frame $frame1℄
set
oords1 [$sel1 get {x y z}℄
# get the se
ond
oordinate set
set sel2 [atomsele
t $mol [$sele
tion text℄ frame $frame2℄
set
oords2 [$sel2 get {x y z}℄
# and
ompute the rmsd values
set rmsd 0
forea
h
oord1 $
oords1
oord2 $
oords2 {
set rmsd [expr $rmsd + [ve
length2 [ve
sub $
oord2 $
oord1℄℄℄
}
# divide by the number of atoms and return the result
return [expr $rmsd / ([$sele
tion num℄ + 0.0)℄
}
The following uses the frame rmsd fun
tion to list the rmsd of the mole
ule over the whole
traje
tory, as
ompared to the rst frame.
vmd > mol load psf alanin.psf d
d alanin.d
d
vmd > set sel [atomsele
t top all℄
vmd > for {set i 0} {$i < [molinfo top get numframes℄} {in
r i} {
? puts [list $i [frame_rmsd $sel $i 0℄℄
? }
0 0.0
1 0.100078
2 0.291405
3 0.523673
....
97 20.0095
98 21.0495
99 21.5747
148
The last example shows how to set the beta eld. This is useful be
ause one of the
oloring
methods is 'Beta', whi
h uses the beta values to
olor the mole
ule a
ording to the
urrent
olor
s
ale. (This
an also be done with the o
upan
y eld.) Thus redening the beta values allows you
to
olor the mole
ules based on your own denition. One useful example is to
olor the mole
ule
based on the distan
e from a spe
i
point (for this
ase,
oloring a poliovirus protomer based on
its distan
e to the
enter of the virus (0, 0, 0) helps bring out the surfa
e features).
pro
beta
olor_distan
e {$sel point} {
set newbeta {}
# get the
oordinates
forea
h
oord [$sel get {x y z}℄ {
# get the distan
e and put it in the "newbeta" list
set dist [ve
length2 [ve
sub $
oord $point℄℄
lvarpush newbeta $dist
}
# set the beta term
$sel set beta $newbeta
}
And here's one way to use it:
Then go to the graphi s menu and set the 'Coloring Method' to 'Beta'.
149
Keyword Aliases Arg Set Des
ription
id int N mole
ular id
index int N index on the mole
ule list
numatoms int N number of atoms
sour
e str N one of File, Graphi
s, Remote, or Sigma
name str N the name of the mole
ule (usually the name of the le)
lename str N full lename (if two les, the topology le)
letype str N
orresponding le type (PSF, PDB, XYZ, ...)
lename2 str N full lename of
oordinate le (if two les)
letype2 str N
orresponding le type (DCD or PDB)
a
tive bool Y is/make the mole
ule a
tive
drawn displayed bool Y is/make the mole
ule drawn
xed bool Y is/make the mole
ule xed
top bool Y is/make the mole
ule top
enter ve
tor Y get/set the
oordinate used as the
enter
enter matrix matrix Y get/set the
entering matrix
rotate matrix matrix Y get/set the rotation matrix
s
ale matrix matrix Y get/set the s
aling matrix
global matrix matrix Y get/set the global (rotation/s
aling) matrix
view matrix matrix N get/set the overall viewing matrix
numreps int N the number of representations
sele
tion i string N the string for the i'th sele
tion
rep i string N the string for the i'th representation
olor i
olour string N the string for the i'th
oloring method
numframes int N number of animation frames
frame int Y
urrent frame number
bond
oat N the bond energy (for the
urrent frame)
angle
oat N the angle energy
dihedral
oat N the dihedral energy
improper
oat N the improper energy
vdw
oat N the van der Waal energy
ele
trostati
ele
oat N the ele
trostati
energy
hbond
oat N the hydrogen bond energy
kineti
oat N the total kineti
energy
potential
oat N the total potential energy
energy
oat N the total energy
temperature temp
oat N the overall temperature
150
Option Des
ription
num return the number of atoms in the sele
tion
list return a list of the atom indi
ies in the sele
tion (BTW, this is the same as "get index")
text return the text used to
reate this sele
tion
molid returns the mole
ule id used to
reate this
type returns the string 'atomsele
t'
delete delete this obje
t (removes the fun
tion)
global moves the obje
t into the global namespa
ee
uplevel moves the obje
t to another level
get given a list of attributes, return the list
ontaining the list of attribute values (see
examples)
set the
omplimentary fun
tions (
urrently only works for a few terms)
move move the sele
tion by a a 4x4 tranformation matrix
moveby move all the atoms by a given oset
lmoveby move ea
h atom by an oset given in the list
moveto move all the atoms to a given lo
ation
lmoveto move ea
h atom to a point given by the appropriate list element
writepdb write the sele
ted atoms in a pdb le
151
Chapter 14
152
user add subitem Favorites BPTI {mol pdbload 9pti}
user add subitem Favorites alanin {mol load pdb alanin.pdb}
user add subitem Favorites bR {mol load pdb brH.pdb}
Enter these three lines and then bring up the popup menu. You should see the new menu item
just above the \Help" lines. Unless you also happen to have these mole
ules available, the last two
items probably won't work, but the rst one should. Try it out.
You
an also add a separator in the menu, using:
user add subseparator menu
So if you wanted a separation between the rst three mole
ules and a fourth, say the poliovirus
2PLV stru
ture, then you would type:
user add subseparator Favorites
user add subitem Favorites Polio {mol pdbload 2plv}
As a se
ond
omplete example, the
ode below will produ
e a
as
ading menu whi
h allows you
to qui
kly adjust the degree of transparen
y for transparenent objets (i.e. the default is .3, where
1.0 is opaque and 0.0 is invisible).
# Set the alpha value of the "transparent" materials
pro
set_transparen
y_value {alpha} {
display update off
#
hange the opaqui
ity of the transparent
olors
for {set
olor 17} {$
olor < 34} {in
r
olor} {
olor
hange alpha $
olor $alpha
}
# and the transparent
olor s
ale (66 to 97)
for {set
olor 66} {$
olor < 98} {in
r
olor} {
olor
hange alpha $
olor $alpha
}
display update on
}
user add menu Transparen
y
for {set i 1.0} {$i >= 0.0} {set i [expr $i - 0.1℄} {
eval "user add subitem Transparen
y $i {
set_transparen
y_value $i}"
}
Unfortunately, the user modiable popup menus are not hierar
hi
al. There is no way to add a
submenu to one of your own menus. They
an only be added to the main popup menu. However,
there is another pla
e to add new menu items, the `User Commands' submenu of the main menu.
\Where is it?" you ask? It doesn't
ontain anything, so it isn't displayed. You
an add items to it
just as you
an to the main menu, but the
ommands are slightly dierent. Admittedly this is not
an optimal solution. Future versions of VMD will use Tk menus to alleviate this problem. Until
then though, here is a spe
i
ation of the syntax.
To add an item to the `User Commands' menu:
user add item name
ommand
153
To add a separator to the 'User Commands' menu:
user add separator
The usage is the same as their related
ommands, so we won't give a detailed example, but to see
how it works, try this:
# Turn off the axis
user add item {Axes Off} axes lo
ation off
user add item {Axes On} axes lo
ation LowerLeft
# a break
user add separator
# delete all the loaded mole
ule
user add item {Zap Everything} {
forea
h mole
ule [molinfo list℄ {
mol delete $mole
ule
}
}
Finally, if you wish to see the
urrent denitions of the user-
ustomized menu items, use the
ommand
user print menus
This will print out to the
onsole the names and asso
iated text
ommands for all menu items
added by the user.
154
14.2 Using VMD as a WWW Client (for
hemi
al/* do
uments)
Mosai
, Nets
ape, and possibly other browsers
an be
ongured to use VMD as a helper appli
ation
for viewing some
hemi
al/* do
uments.
155
./images and the full pro
ess
ould take up a lot of disk spa
e, depending on the size of the VMD
graphi
s window. This s
ript does not automati
ally delete the les or the dire
tory.
The en
oder input le is given after the T
l s
ript.
VMD s
ript to make a movie of a rotating system
for { set i 0 } { $i < 360 } { set i [ expr $i + 1 ℄ } {
render Raster3D out.r3d
at
h { exe
render < out.r3d -sgi out.rgb }
# get the right format for the number (only works up to 99)
if { $i < 1 } {
set nm "00"
} elseif { $i < 10 } {
set nm "0$i"
} else {
set nm $i
}
#
onvert from RGB to PPM
at
h { exe
toppm out.rgb $nm.ppm }
# delete the RGB file
at
h { exe
rm out.r3d out.rgb }
# and rotate by 10 degrees
rot y by 10
}
# now make the mpeg
at
h { exe
mpeg_en
ode-1.3.sgi.bin mpeg.input }
The mpeg en
oder s
ript follows, but be
areful as we guessed at most of the values.
PATTERN I
OUTPUT spin.mpg
INPUT_DIR .
INPUT
*.ppm [00-89℄
END_INPUT
BASE_FILE_FORMAT PPM
INPUT_CONVERT
at *
GOP_SIZE 4
SLICES_PER_FRAME 2
PIXEL FULL
RANGE 5
PSEARCH_ALG LOGARITHMIC
BSEARCH_ALG SIMPLE
IQSCALE 1
PQSCALE 1
BQSCALE 1
REFERENCE_FRAME DECODED
You would use this by rst loading a mole
ule,
hanging to the dire
tory you wish to use to
store the image les, and entering the
ommand
156
play <T
l s
ript filename>
It does work. Honest.
157
B be nu
lei
, and dene
onta
t as an atom in A whi
h is within 2
A of an atom in B. Then the
sele
tion
ommand is
protein within 2 of nu
lei
If you want to see all the residues of A whi
h have at least one atom in
onta
t with B, use
same residue as (protein within 2 of nu
lei
)
14.7 T
l Logging
Every issued
ommand whi
h
hanges the state of VMD (loading a mole
ule, rotation, opening a
form, et
.)
an be saved to a le via the log
ommand. In addition, if the T
l
ommand vmdlog
exists, it is
alled with the issued
ommand as its only term. One use for this is to lter out some
of the
ommands.
One pra
ti
al use of this feature is to lter out the menu
ommands so they don't
onstantly
disappear and reappear on playba
k. In addition, this adds wait
ommand if the time between
su
esive
ommands was more than a se
ond so the playba
k will emulate the timings of original
a
tions.
# set things up to re
ord
ommands to the file ``session_log.vmd''
pro
start_re
ording {} {
global re
ording_fileid
set re
ording_fileid [open session_log.vmd w℄
}
pro
vmdlog s {
if {[regexp {^menu } $s℄ != 1} {
global re
ording_fileid
global re
ording_time
set now [get
lo
k℄
set delay [expr $now - $re
ording_time℄
if {$delay > 1} {
puts $re
ording_fileid "wait $delay"
}
puts $re
ording_fileid $s
flush $re
ording_fileid
set re
ording_time $now
}
}
158
14.8 Remote Control of VMD
As part of our resear
h on developing new types of user interfa
es for mole
ular modelling, we have
added a simple way for other programs to send information to a VMD pro
ess via the T
l-DP RPC
me
hanism. (See se
tions x 3.4.1 and x10.3.9). As an example of use, here's how to
ontrol one
VMD session from another program.
For now, I'll assume that both programs are on the same
omputer. Start VMD and exe
ute
external on. This tells VMD to start listening for
ommands from one of the ma
hine ports. (For
those interested in the details, this fun
tion disables a
eptan
e of
ommands from other ma
hines
( dp_Host -; dp_Host +[exe
hostname℄) then starts the server as dp MakeRPCServer 8639.)
SECURITY WARNING: On
e the external option is enabled, VMD will allow any program to
onne
t to it and exe
ute a T
l s
ript as you. By default, VMD limits its
onne
tions to other
pro
esses on the same ma
hine, so you are reasonably safe if you trust the other users. However,
it is easy to modify the settings to allow anyone in the world to
onne
t and do whatever they
wanted. It is possible to make the
onne
tion more se
ure, but sin
e VMD is designed for an
a
ademi
environment where dierent users trust ea
h other, we have not implemented it. (See the
T
l-DP distribution for do
umentation of how to do so.)
Start up another program that uses T
l-DP, like dpwish or another instan
e of VMD. (Remem-
ber, you
an start VMD without a display with vmd -dispdev none.) Exe
ute the
ommand
set vmd_server [dp_MakeRPCClient [exe
hostname℄ 8639℄
This should return a name like \le7" if su
essful. To send a
ommand (in this
ase, rotate x by 90)
to VMD, enter
dp_RPC $vmd_server rotate x by 90
To simplify matters you might want to implement a new pro
edure to handle these messages
pro
tell_vmd {args} {
global vmd_server
dp_RPC $vmd_server eval $args
}
tell_vmd rotate x by 90
Where the last line is an example of how this pro
edure is used.
If you want to
ontrol VMD on from ma
hine, on the
ontrolling pro
ess, repla
e the [exe
hostname℄ with the name of the ma
hine with VMD.
159
Chapter 15
160
On
e the mole
ule is loaded and NAMD has been started and is listening for a
onne
tion, the
user is ready to
onne
t to the simulation and start re
eiving
oordinates. To establish a
onne
tion,
type the following at the
ommand line: "imd
onne
t <host> <port>". <host> is the name of the
ma
hine on whi
h NAMD started; if NAMD is running on several distributed nodes, VMD must
onne
t to the root node on whi
h NAMD initially started out.
VMD
an
onne
t to only one mole
ular dynami
s simulation at a time. To pause, deta
h, or
kill a running simulation, see the Sim Form se
tion 3.3.12.
161
Chapter 16
162
twi
e as fast, whi
h speeds up the overall subroutine by almost 10%. The s
ript is not very fast;
after all, for a 234 residue protein, 27495 distan
e
al
ulations are made and 54756*2 triangles
generated. Nearly all of that is done in T
l. In terms of times, about 1/3 is spent in the distan
e
al
ulations, another 1/3 in the math to make the triangles, and another 1/3 in the three \graphi
s"
alls. The residue 234 example protein took 70 se
onds to do everything on a Crimson.
Example usage:
mol load pdb $env(VMDDIR)/proteins/alanin.pdb
set sel [atomsele
t top all℄
a_distan
e $sel
\index{atom!
oordinates}
\index{atomsele
t!
ommand}
# Input: a sele
tion
# Does: finds the CAs in the sele
tion then
omputes and draws the
# CA-CA distan
e grid with
olors based on the
olor s
ale
# Returns: the id of the new graphi
s mole
ule
ontaining the grid
pro
a_distan
e {main_sel} {
# get the CA atoms from the sele
tion
set mol [$main_sel molindex℄
set sel [atomsele
t $mol "$main_sel and name CA"℄
163
# draw the pretty graphi
puts "Distan
es
al
ulated, now drawing the distan
e map ..."
mol load graphi
s "CA_distan
e($mol)"
set gmol [molinfo top℄
# turn material
hara
teristi
s off
graphi
s $gmol materials off
# i1 and j1 are i+1 and j+1; this speeds up
onstru
tion of x{01}{01}
set i 0
set i1 1
# preset the s
aling fa
tor (31.95 instead of 32 ensures there will be
# no
olor 66 (for the max
olor), whi
h is transparent)
set s
ale [expr 31.95 / ($max + 0.)℄
set list2 [$sel list℄
forea
h id1 [$sel list℄ {
set j 0
set j1 1
set x00 "$i $j 0"
set x10 "$i1 $j 0"
set x11 "$i1 $j1 0"
set x01 "$i $j1 0"
forea
h id2 $list2 {
set
ol [expr int($s
ale * $dist($id1,$id2)) + 34℄
graphi
s $gmol
olor $
ol
graphi
s $gmol triangle $x00 $x10 $x11
graphi
s $gmol triangle $x00 $x11 $x01
in
r j
in
r j1
set x00 $x01
set x10 $x11
set x11 "$i1 $j1 0"
set x01 "$i $j1 0"
}
in
r i
in
r i1
}
# put some numbers down to give an idea of what is where
set resids [$sel get resid℄
set num [llength $resids℄
set start [lindex $resids 0℄
set end [lindex $resids [expr $num - 1℄℄
graphi
s $gmol
olor yellow
graphi
s $gmol text "0 0 0" "$start,$start"
graphi
s $gmol text "$num 0 0" "$end,$start"
graphi
s $gmol text "0 $num 0" "$start,$end"
graphi
s $gmol text "$num $num 0" "$end,$end"
return $gmol
164
}
# given the atom index, find the ions within the given distan
e
# return
pro
find_nearby_residues {index ion distan
e} {
set nearby [atomsele
t top "(within $distan
e of index $index) \
and not index $index"℄
165
# same residue have su
essive indi
es, the luniq gets just one
# of them.
forea
h res_pair [luniq [$nearby get {resname residue}℄℄ {
lassign $res_pair resname
myin
r
ount($ion,$distan
e,$resname) 1
}
}
For the example, the les 1TRZ, 1LND, and 1EZM
ontain zin
s.
vmd> unset
ount
166
vmd> analyze_ion_propensity {1trz 1lnd 1ezm} ZN
ALA :****
ARG :***
ASN :****
ASP :***
CYS :**
GLN :
GLU :******
GLY :
HIS :***********
ILE :
LEU :*
LYS :**
MET :
PHE :*
PRO :
SER :****
THR :
TRP :
TYR :***
VAL :****
As expe
ted, histidines were one of the most
ommon zin
neighbors. Of
ourse, there will still
be problems of missampling (for instan
e, over
ounting mole
ules with zin
nger dimers) so you
should be very sure of what you are doing when using this type of automated analysis.
167
Loading a new mole
ule resets all the viewing matri
es
Ivo Hofa
ker has gra
iously struggled through all the above
aveats to write a set of T
l
om-
mands whi
h will save nearly all of the
urrent VMD state to a le, and restore it ba
k again. The
ommands are
save state le name { saves the vmd state in the form of a s
ript in le le name. Restarting
vmd as vmd -e le name should restore most of the previous session. Essentially everything
that
an be
hanged from the graphi
s and mol and
olor forms will be saved, but nothing
else. In parti
ular, the s
ript will restore:
{ mole
ules read in from les
{ graphi
s obje
ts (spheres,
ylinders...)
{ all representations
{ the transformation matri
es for ea
h mole
ule
{ whi
h
olor to use for whi
h representation, denitions of
olors 0..33
It will not restore:
{ traje
tories loaded via the edit menu
{ labels
{ intera
tive MD sessions
{ anything in the display form, su
h as lighting, axes, stage, ...
save viewpoint { saves the
enter, rotation, s
aling and global matri
es (in this order) in
a global variable viewpoints
restore viewpoint { restores the viewpoint saved in variable viewpoints
save reps { saves the
urrent mole
ule(s) representations in a global array representations.
restore reps { repla
es
urrent representations by the representations stored in the global
array representations. Note, that save reps saves mole
ule Ids along with the representa-
tions, so if the molId of a
urrently loaded mole
ule is dierent from that saved, this
ommand
will not work properly.
save
olors le des
riptor { writes
olor denitions to a le spe
ied by a le des
riptor.
This le
an later be sour
ed to restore the denitions. To save the
olor denitions, the
following pro
edure
an be used.
# save the
olor definitions in a file
# argument: file name
pro
sav
ol {file} {
save_
olors [open $file w℄
lose $filedes
}
This pro
edure takes the le name as a parameter (as opposed to le des
riptor in save
olors).
If you plan to write s
ripts whi
h intera
t with VMD itself (not just the analysis
ommands), you
are highly advised to look at the
ommands, whi
h are dened in $VMDDIR/s
ripts/vmd/save state.t
l
(The
ode is too long to be in
luded in this se
tion.)
168
16.4 Currently pi
ked mole
ule/atom
Every time an atom is pi
ked, the T
l variables vmd pi
k mol and vmd pi
k atom are set to the
mole
ule id and atom index of the pi
ked atom. This is useful for s
ripts that need to a
t on used
dened atom.
For example, the following pro
edure takes the pi
ked atom and nds the mole
ular weight of
residue it is on.
pro
mol_weight {} {
# use the pi
ked atom's index and mole
ule id
global vmd_pi
k_atom vmd_pi
k_mol
set sel [atomsele
t $vmd_pi
k_mol "same residue as index $vmd_pi
k_atom"℄
set mass 0
forea
h m [$sel get mass℄ {
set mass [expr $mass + $m℄
}
# get residue name and id
set atom [atomsele
t $vmd_pi
k_mol "index $vmd_pi
k_atom"℄
lassign [$atom get {resname resid}℄ resname resid
# print the result
puts "Mass of $resname $resid = $mass"
}
On
e an atom has been pi
ked, run the
ommand mol weight to get output like:
Mass of ALA 7 : 67.047
169
16.5.2 Making a sphere appear when an atom is pi
ked
Similarly, you
an use the
allba
k to generate a sphere when an atom is pi
ked.
Whenever you
li
k on an atom, a sphere will appear at the same lo
ation. Sin
e the graphi
s
and the mole
ule aren't the same graphi
s obje
t, you may need to reset view to make them aligned.
To turn the tra
e o:
pro
eye_line {} {
global vmd_pi
k_atom vmd_pi
k_mol
set sel [atomsele
t $vmd_pi
k_mol "index $vmd_pi
k_atom"℄
170
#
onvert ba
k to mole
ule spa
e
# (need an inverse, whi
h is only available with the
# measure
ommand)
set inv [measure inverse $mat℄
set
oords2 [ve
trans $inv $world2℄
but this isn't the fastest solution for a
ouple of reasons. First o, the se
ondary stru
ture
ode
is somewhat slow (and about 2/3 of the time is spent in the T
l interfa
e; mostly in writing a
temporary PDB le). If you don't plan to modify the
oordinates, it is possible to store, or
a
he,
the se
ondary stru
ture from one frame to the next. Se
ond, if there are multiple mole
ules loaded
and animated, the se
ondary stru
tures of all of them are
omputed.
The following s
ript, ss
a
he (for \se
ondary stru
ture
a
he") addresses those two problems.
It is turned on with the
ommand start ss
a
he followed by the mole
ule number of the mole
ule
whose se
ondary stru
ture should be saved (the default is \top", whi
h gets
onverted to the
orre
t
mole
ule index). Whenever the frame for that mole
ule
hanges, the pro
edure ss
a
he is
alled.
ss
a
he is the heart of the s
ript. It
he
ks if a se
ondary stru
ture denition for the given
mole
ule number and frame already exists in the T
l array ss
a
he data(mole
ule,frame). If so,
it uses the data to redene the \stru
ture" keyword values (but only for the protein residues). If
not, it
alls the se
ondary stru
ture routine to evaluate the se
ondary stru
ture based on the new
oordinates. The results are saved in the ss
a
he data array.
171
On
e the se
ondary stru
ture values are saved, the mole
ule
an be animated rather qui
kly
and the updates
an be
ontrolled by the animate form.
To turn o the tra
e, use the
ommand stop ss
a
he, whi
h also takes the mole
ule number.
There must be one stop ss
a
he for ea
h start ss
a
he. The
ommand
lear ss
a
he resets
the saved se
ondary stru
ture data for all the mole
ules and all the frames.
172
global ss
a
he_data
return
}
173
}
tra
e variable vmd_frame($molid) w
al
_bridging
set bridging_mole
ule $molid
}
Sin
e the sele
tions are available in the global s
ope, you
an analyze the results at any time.
This simple fun
tion prints how many atoms are in ea
h sele
tion of the
a
he.
pro
num_bridging {} {
global bridging_waters
set nums [lsort -integer [array names bridging_waters℄℄
forea
h num $nums {
set num_atoms [$bridging_waters($num) num℄
puts "Frame $num has $num_atoms atoms"
}
174
}
It would be ni
e to
hange the text sele
tion used, support multiple sele
tions, have the \"
variables in more
ompli
ated expressions in the graphi
s sele
tions, and be able to use this s
ript
for multiple mole
ules. These are left to the student as an exer
ise :).
Of
ourse, why do textually what you
an do graphi
ally? The following makes a plot of the
last ten temperatures. For simpli
ity, only one plot is allowed.
The begin temp plot sets up the temperature plot variables and
alls the tra
e. The tra
e
alls timestep temp tra
e whi
h adds the new temperature to the storage list and then
alls the
graphi
s routine. (A list was used here be
ause, while slower than an array, the lvarpop was handy.)
There is nothing new or unusual about the plotting pro
edure (draw temps plot) or the routine
to nish the real-time plotting (end temp plot).
pro
begin_temp_plot {molid} {
# make sure the mole
ule exists
molinfo $molid get frame
pro
end_temp_plot {} {
global temps_tra
e_mol
# remove the tra
e
tra
e vdelete vmd_timestep($temps_tra
e_mol) w timestep_temp_tra
e
}
175
pro
draw_temps_plot {} {
global temps temps_mol
graphi
s $temps_mol delete all
graphi
s $temps_mol
olor red
set tmp $temps
set pt0 [lvarpop tmp℄
set x0 0
set x1 10
forea
h pt1 $tmp {
graphi
s $temps_mol line "$x0 $pt0 0" "$x1 $pt1 0"
set x0 $x1
in
r x1 10
set pt0 $pt1
}
graphi
s $temps_mol
olor green
graphi
s $temps_mol line {0 0 0} {100 0 0}
graphi
s $temps_mol line {0 0 0} {0 500 0}
}
Needless to say, many more options
an be added to this for plotting dierent variables, au-
tos
aling, adding text, et
.
By the way, though it has not yet been tested out, we envision that a tra
e on the vmd timestep
variable
ould be used to modify the user for
es as the simulation progresses. This makes the linear
for
e
ontrols emulate a harmoni
well, or let you apply the for
es along a path. You
ould even
make two atoms
ome towards ea
h other, or draw apply the for
es to the atoms on a sele
tion
su
h that the
enter of mass of the sele
tion is the important term. If you want to try it out, good
lu
k!
176
16.7.1 RMSD Computation
There are two atom sele
tions needed to do an RMSD
omputation, the list of atoms to
ompare
in both mole
ules. The rst atom of the rst sele
tion is
ompared to the rst atom of the se
ond
sele
tion, fth to fth, and so on. The a
tual order is identi
al to the order from the input PDB
le.
On
e the two sele
tions are made, the RMSD
al
ulation is a matter of
alling the measure
rmsd fun
tion. Here's an example:
set sel1 [atomsele
t 0 "ba
kbone"℄
set sel2 [atomsele
t 1 "ba
kbone"℄
measure rmsd $sel1 $sel2
Info) 10.403014
This prints the RMSD between the ba
kbone atoms of mole
ule 0 with those of mole
ule 1.
You
ould also use a weighting fa
tor in these
al
ulations. The best way to understand how to do
this is to see another example:
set weighted_rmsd [measure rmsd $sel1 $sel2 weight mass℄
Info) 10.403022
In this
ase, the weight is determined by the mass of ea
h atom. A
tually, the term is really
one of the standard keywords available to an atom sele
tion. Other ones in
lude index and resid
(whi
h would both be rather strange to use) as well as
harge, beta and o
upan
y. These last
terms useful if you want to spe
ify your own values for the weighting fa
tors.
177
As a more
ompli
ated example, with the mouse you
annot do something like "align all of
mole
ule 1 with mole
ule 9 using only the ba
kbone atoms of residues 4 to 10 in both systems"
with the mouse. However, you
an do it with the text
ommand. Here's how:
#
ompute the transformation matrix
set referen
e_sel [atomsele
t 9 "ba
kbone and resid 4 to 10"℄
set
omparison_sel [atomsele
t 1 "ba
kbone and resid 4 to 10"℄
set transformation_mat [measure fit $
omparison_sel $referen
e_sel℄
178
RMSD of 0 is 0.000000
RMSD of 1 is 1.060704
RMSD of 2 is 0.977208
RMSD of 3 is 0.881330
RMSD of 4 is 0.795466
RMSD of 5 is 0.676938
RMSD of 6 is 0.563725
RMSD of 7 is 0.423108
RMSD of 8 is 0.335384
RMSD of 9 is 0.488800
RMSD of 10 is 0.675662
RMSD of 11 is 0.749352
[...℄
If you wanted you
ould do all sorts of things, like graph this value through time.
179
Chapter 17
1. Command-line options.
2. Environment variable settings.
3. Values spe
ied in the initialization le (.vmd init, se
tion 17.3.3).
4. Built-in defaults, as spe
ied by
ompilation
ongurable parameters. These are used only
if no other values are spe
ied by the other methods mentioned in this list. The Installation
Guide des
ribes how to
hange these default values when
ompiling VMD.
180
-e filename : After initialization, exe
ute the text
ommands in lename, and then resume
normal operation.
-psf filename : Load the spe
ied mole
ule (in PSF format) at startup. The PSF le only
ontains the mole
ular stru
ture; a PDB or DCD le must also be spe
ied when this option
is used.
-pdb filename : Load the spe
ied mole
ule (in PDB format) at startup.
-d
d filename : Load the spe
ied traje
tory le (in binary DCD format) at startup. The
DCD le only
ontains atomi
oordinates; a PDB or PSF le must also be spe
ied when
this option is used.
-dispdev < win | text |
ave |
aveforms | none > : Spe
ify the type of graphi
al
display to use. The possible display devi
es in
lude:
{ win: a standard graphi
s display window.
{ text: do not provide any graphi
s display window.
{
ave: use the CAVE virtual environment for display, forms are disabled.
{
aveforms: use the CAVE virtual environment for display and with forms enabled. This
is useful with -display ma
hine:0 for remote display of the forms when the CAVE uses
the lo
al s
reen.
{ none: same as text.
It is possible to use VMD as a lter to
onvert
oordinate les into rendered images, by using
the -dispdev text and -e options.
-dist z : Spe
ify the distan
e to the VMD image plane.
-height y : Spe
ify the height of the VMD image plane.
-pos x y : Spe
ify the position for the graphi
s display window. The position (x,y) is the
number of pixels from the lower-left
orner of the display to the lower-left
orner of the
graphi
s window.
-size x y : Spe
ify the size for the graphi
s display window, in pixels.
-nt : Do not display the VMD title at startup.
-startup filename : Use lename as the VMD startup
ommand s
ript, instead of the
default .vmdr
le.
-debug [level : Turn on output of debugging messages, and optionally set the
urrent debug
level (1=few messages ... 5=many verbose messages). Note this is only useful if VMD has
been
ompiled with debugging option in
luded.
181
17.2 Environment Variables
Several environment variables are used by VMD to determine the lo
ation of
ertain les and
dire
tories. These variables are a
essible to text interfa
e through array env. These variables
in
lude:
VMDDIR : The dire
tory whi
h
ontains the VMD data les (su
h as this help le) and
ar
hite
ture-spe
i
exe
utables. By default, this is /usr/lo
al/lib/vmd.
VMDTMPDIR : The dire
tory whi
h VMD should use for temporary data les. By default, this
is /tmp.
VMDBABELBIN : The
omplete path and lename for the program babel, whi
h is used by
VMD to
onvert mole
ular stru
ture/
oordinates les into PDB les whi
h VMD
an a
tually
understand. If this is not set expli
itly, the VMD startup s
ript will attempt to nd babel in
the
urrent path. If Babel
annot be found or is not installed, VMD will not be able to read
mole
ular le formats other than PDB, PSF, and binary DCD les.
VMDCAVEMEM : This overrides the default size of the shared memory arena whi
h is allo
ated
by VMD when the CAVE starts up. The variable must be an integer number of megabytes.
Sin
e this is the only shared memory pool allo
ated, and it is done only on
e, you must
hoose a value suÆ
ient to a
ount for the largest s
ene you intend to render in VMD in
that CAVE session. The default value unless otherwise spe
ied is 80 Megabytes. Values
of 200MB to 512MB are
ommonly needed for large mole
ular systems
ontaining several
hundred thousand atoms.
VMDHTMLVIEWER : The name of the HTML viewer (Nets
ape, Mosai
, whatever you prefer)
that VMD should use to display HTML do
uments (su
h as this help le). By default, this
is Nets
ape.
VMDIMAGEVIEWER : The name of the external program to use for displaying VMD snapshots
(or other images), in various formats.
VMDSCRDIST : Distan
e to the VMD image plane.
VMDSCRHEIGHT : Height of the VMD image plane.
VMDSCRPOS : Position of the VMD graphi
s window (x,y).
VMDSCRSIZE : Size of the VMD graphi
s window (x,y).
VMDSNAPSHOT : The name of the external program to use for taking snapshots (s
reen
apture)
of VMD graphi
s window.
182
of the vmd startup s
ript (head `whi
h vmd`) or by starting VMD and using the
ommand set
env(VMDDIR).
As mentioned elsewhere, VMD uses the T
l interpreter with two language extensions, T
lX
and T
l-DP. Ea
h of these three pa
kages reads T
l s
ripts at initialization, whi
h are
ontained in
VMD distribution; with a dierent dire
tory for ea
h pa
kage. The lo
ations of the dire
tories is
determined by the environment variables dened in the vmd s
ript. In order they are TCL LIBRARY,
TCLX LIBRARY, and DP LIBRARY, whi
h are set in the vmd startup s
ript to $VMDDIR/s
ripts/t
l,
$VMDDIR/s
ripts/t
lX, and $VMDDIR/s
ripts/dp, respe
tively. In addition, VMD has its own
dire
tory of
ore T
l routines.
The most important of these is tt $VMDDIR/s
ripts/vmd/vmdinit.t
l. This le sets up the
basi
T
l initialization
ommands in
luding the
ommands that
at
h Ctrl-C interrupts, dene
some environment variables, and add the vmd s
ript dire
tory to the T
l autoindex path. Most of
the other les are referen
ed through the auto path.
There are a few non-T
l s
ripts in this dire
tory. Currently these are perl s
ripts used for the
urlload
ommand and web
lient startup (see se
tion x 10.3.16 and se
tion x14.2).
183
HTMLVIEWER = <lename>
The name of the HTML browser whi
h should be used to display HTML les (su
h as the
VMD on-line help le). Typi
al examples are Mosai
or Nets
ape; by default this is Nets
ape.
SCRDIST = <value>
The distan
e, in `world'
oordinates, from the origin to the display s
reen. If this is zero,
the origin of the
oordinate system in whi
h mole
ules are drawn
oin
ides with the
enter
of the display. If it is < 0, the origin is lo
ated between the viewer and the s
reen, while if
it is > 0, the s
reen is lo
ated
loser to the viewer than the origin. A value < 0 puts any
stereo image in front of the s
reen, aiding the three-dimensional ee
t; a value > 0 results in
a stereo image that is behind the s
reen, a less dramati
(but easier to see, for some people)
stereo ee
t when stereo display is used. Figure 3.17 des
ribes the relationship between this
parameter and the world
oordinate spa
e.
SCRHEIGHT = <value>
This parameter, with SCRDIST, denes the size and distan
e of the display s
reen. SCRHEIGHT
is the default value for the s
reen height, whi
h is the verti
al size of the display s
reen in
`world'
oordinates. Ea
h mole
ule is initially s
aled and translated to t within a 2 x 2 x 2
box
entered at the origin; so the height of the s
reen helps determine how large the mole
ule
appears initially. If VMD is being displayed on a workstation monitor only, it is best not to
hange this value from the default setting. This parameter is used mainly to
ongure the
VMD display to the dimensions and position of a large-s
reen display, su
h as a proje
tor,
that may be used as a stereo display. As for SCRDIST, gure 3.17 des
ribes the relationship
between this parameter and the world
oordinate spa
e.
SCRPOS = <xpos> <ypos>
The position of the lower-left
orner of the window used to display images, if the display
type is WIN. Both xpos and ypos are in pixels. If they are not spe
ied, and are not given as
ommand-line options, the window will have to be intera
tively pla
ed with the mouse.
SCRSIZE = <xsize> <ysize>
The size of the window used to display images, if the display type is WIN. Both xpos and
ypos are in pixels. If they are not spe
ied, and are not given as
ommand-line options, the
window will have to be intera
tively sized with the mouse.
TITLE = <ON | OFF>
A
ag indi
ating whether to display the VMD title in the main display when the program
starts. This
an have the value of ON or OFF. By default, TITLE is set to be ON. If the title is
turned on, it will remain displayed until a mole
ule is loaded, after whi
h it will be hidden
from view. This
an also be set with the
ommand line option -nt.
Here is an example of an initialization le:
display = win
title = on
s
rheight = 6.0
s
rdist = -2.0
s
rpos = 596 190
s
rsize = 669 834
184
17.3.4 .vmdr
File
After everything is initialized, VMD reads the startup le using the equivalent of the
ommand play
.vmdr
. This le
ontains text
ommands for VMD to exe
ute just as if they had been entered at
the VMD text
onsole
ommand prompt. The le
an
ontain any number of
ommands, in
luding
blank lines and
omment lines (whi
h begin with the #
hara
ter). If an error is en
ountered while
reading this le, the
ommand in error is skipped and pro
essing of the le
ontinues.
VMD sear
hes for this le in three lo
ations; ./.vmdr
, $HOME/.vmdr
and $VMDDIR/.vmdr
.
Only the rst le found will be read in and pro
essed.
See
hapter x 10 for a des
ription of the VMD text
ommands whi
h may be put in this le.
Also, se
tion x 14.1 dis
usses how to put
ommands into the .vmdr
le to
ustomize the behavior
of the popup menu and hot keys.
Here is an example of a startup le:
# add personalized keyboard short
uts
user add key E e
ho on
user add key e e
ho off
user add key g display reset
user add key A stage lo
ation bottom
user add key m mol list
menu main on
185
Chapter 18
Future Plans
Following is a list of features we would like to add. They will be implemented as they are needed,
but some will not be done until the next major version.
Improve PDB reader to read multiple models and the new "element" eld (see ??? for a
program to
onvert CONECT re
ords to a PSF le)
element type based on atom name and residue type, if information isn't given in the PDB
append and delete spe
i
atoms
text for raster outputs
improve surfa
e rendering speeds
improve sphere rendering speeds
save more information about
urrent setup (see se
tion x 16.3 for the s
ript
ommands to
save the
urrent setup)
standardize nomen
lature and usage of keywords and other denitions
add more sele
tion denitions, like purine
expand the ability of the mouse to pi
k atoms
add atom
oloring methods
rewrite the forms using Tk
faster
al
ulation of hydrogen bonds
implement \
orre
t" transparen
y
be able to sele
t bonds
draw mole
ular and isoele
tri
surfa
es (a la GRASP) ???
develop the 3D interfa
e
improve the intera
tive steering
186
will need to add a new input/output
oordinate le (probably GROMOS) be
ause we are
approa
hing limits to atom and residue number
read in the ele
tron density maps made by X-PLOR and display isosurfa
es ??? get the right
name (based on Joel's
omments)
work on an interfa
e to use X-PLOR s
ripts as subroutines, perhaps via T
l's \expe
t"
187
Index
.mail
ap, 164 atom
.vmd init, 189
hanging properties, 154
.vmdr
, 163, 191
oordinates, 122, 123
eye line, 177
hanging, 21, 154
ss
a
he, 178 min and max, 156
info, 32, 150
angles, 49 name lists, 43, 45
animate pi
king, 20
ommand, 109, 110 sele
tion, 18, 19, 33, 67, 84, 150
form, 46
omparison, 88
frames from remote, 59 default, 119
remote simulation, 59 examples, 19, 84
animation, 19, 29, 178 keywords, 34, 45, 84, 92, 93
amount, 48 logi
, 86
appending, 48 math fun
tions, 94
delete, 48, 111 modes, 84
edit, 47 quoting, 86
goto end, 30, 111 referen
es in, 90
goto start, 30, 111 regular expression, 87
hot keys, 37 same, 89
jump, 47, 111 sequen
e, 89
movie, 164 text, 151
of se
ondary stru
ture, 178 within, 89
pause, 30 atoms
play, 29, 30, 110 distan
e between, 20
read, 48, 111 plotting, 50
skip, 46 atomsele
t
speed, 46, 111
ommand, 147, 150, 172
step, 30 axes, 51
style, 30, 111
ommand, 110, 111
loop, 30, 47
on
e, 30, 47 Babel, 64
ro
k, 30, 47 beta values, 158
viewing
hanges, 180 bonds
with user-dened graphi
s, 142 determining, 65
write, 48, 111 label, 49
animationdupli
ate frame, 110 representation, 68
annmm, 90 resolution, 68
antialiasing, 51, 114 unusual, 65
188
button bar, 39
ommand, 79, 110, 113
rosseyes, 26
artoon representation, 68, 72
rystaleyes, 26
enter, 32 devi
e, 188
enter of mass, 153 form, 51
lipping planes, 52 left, 27
olor modes, 26
a
ess denitions, 112 NAMD pat
hes, 59
assignment, 20 orthographi
, 26
ba
kground, 53 perspe
tive, 26
ategory, 53, 76, 77, 112, 166 right, 27
ommand, 75, 110, 111 sidebyside, 26
form, 20, 53, 75{77 stereo o, 26
id, 45, 75, 112 update, 81, 82, 113, 114, 150, 180
in user-dened graphi
s, 135 distan
e
map, 53 matrix, 169
material properties, 135 distan
e between atoms, 20
names, 75, 113 dotted van der Waals representation, 68, 70
properties, 75, 113 draw
redenition, 53, 80, 81, 162
ommand, 134, 145
revert to default, 82 extensions, 145
s
ale, 54, 77, 80, 81, 112 drawing
hanging, 54 box around mole
ule, 140
transparent, 45, 54, 75, 79, 80, 82, 162 method, 18, 43
olor map, 76 drawn, 41
olorinfo
ommand, 83, 110, 112 e
ho
oloring
ommand, 110, 114
by
ategory, 77 environment variables, 188
by
olor s
ale, 77, 80 DP LIBRARY, 189
by property, 166 SURF BIN, 72
methods, 18, 34, 43, 67, 75, 76, 79, 118, SURF TMPDIR, 72
119, 166 TCL LIBRARY, 189
ommand line options, 187 TCLX LIBRARY, 189
onta
t residues, 166 VMDBABELBIN, 65, 189
opyright, 14 VMDDIR, 189
ore
ommands, 63, 109 VMDHTMLVIEWER, 189
CPK, 68 VMDTMPDIR, 65, 189
exit
debug
ommand, 110
ommand, 110, 113 external
delete
ommand, 62, 110, 115, 168
representation, 34
ontrol of VMD, 168
depth
ue, 51, 114 interfa
e, 61
depthsort, 79, 114 eye separation, 100, 114
detail, 51, 114
display le
189
browser, 38 grabber, 57
load, 16 graphi
s
le types
ommand, 134, 143, 169
input, 48, 64 delete, 144
output, 48 form, 43, 76
les loading, 143
initialization, 189 primitives, 134
output, 18 repla
e, 144
read, 111 user-dened, 134
reading, 17, 19, 40, 42, 48, 64, 118, 188 gyration, radius of, 156
startup, 163, 188, 189, 191
writing, 48, 65, 111 hbonds representation, 68, 73
t, 27 help, 31, 40
example, 28
ommand, 110, 115
RMSD, 183, 184 topi
s, 116
al
ulate, 27 hot keys, 34, 124
print, 28 animation
ontrol, 37
two fragments, 28
ustomizing, 163
two mole
ules, 28 menu
ontrol, 37
at, 51 mouse
ontrol, 35
fo
al length, 100, 114 rotation and s
aling, 36
form hydrogen bonds, 73
animate, 19, 46, 59
info menu, 32
lose, 31
olor, 20, 53, 75{77 label
display, 24, 51
ommand, 110, 115
edit animation, 47 labels, 20, 29
les, 16, 42
ategories, 49, 116
graphi
s, 18, 19, 43, 76, 79 delete, 29, 50
hot keys, 37 delete all, 29
label, 26, 49 form, 49
main, 16, 39 hide, 29, 50
mole
ules, 16, 19, 40 pi
king with mouse, 24
open, 31 plotting, 50
remote, 41, 57 show, 29, 50
render, 18, 54 text, 141
sim, 59 li
ori
e representation, 68, 71
tra
ker, 56 light
forms, 117
ommand, 110, 116
frame
ontrolling with mouse, 24
delete, 48, 111 toggle, 52
dupli
ate, 110 line width, 44, 134
write, 111 lines representation, 67, 68
frames, 41 logle
full detail, 51
ommand, 110, 117
logging t
l
ommands, 114, 117, 124, 167, 174
geometri
enter, 152
190
mass
ommand, 147
enter of, 153 keywords, 159
of residue atoms, 176 setting values with, 149
total, 155 mouse
material properties, 135
ommand, 110, 119
matrix routine, 128 modes, 17, 20, 23, 35, 119
trans, 130 using, 22
transaxis, 129 movies, 164
transidentity, 128 MSMS
transmult, 129 representation, 68, 73
transoset, 130
transtranspose, 129 NAMD, 58, 102
transve
, 129 namd, 11, 123
transve
inv, 130 namd
onsumer, 103
MDComm, 11, 58, 102 namdd, 103
MDS
ope, 11, 60 orthographi
view, 52, 98
measure output
ommand, 155, 156 format, 18
menu
ommand, 110, 117 pdbload
popup, 17, 20, 23, 80, 110, 124
ommand, 172
ustomizing, 161 perspe
tive view, 52, 98
vs forms, 16 pi
king, 32, 176
mole
ular surfa
e, 68, 72, 73 angles, 24, 25
mole
ule atoms, 20, 24, 25
a
tive, 33, 41, 46 bonds, 20, 24, 25
analysis, 155, 172
enter, 25
best-t alignment, 184 dihedrals, 24, 25
ommand, 110, 118, 119, 149 distan
es, 20, 26
data, 159 hot keys, 35
deleting, 42 modes, 20, 24
drawn, 33, 41 move atom, 25
xed, 21, 33, 41 move fragment, 25
graphi
s, 143 move mole
ule, 26
id, 118, 144, 147, 150 move residue, 25
index, 118, 147 query, 25
info, 147 text
ommand, 120
list, 41, 149 tra
ing variables, 141, 176
loading, 17, 19, 40, 143, 158 play
remote, 59, 122
ommand, 108, 110, 120, 166, 188
sour
e, 148 le, 32
status, 33, 41, 118 plot
hanging, 42, 119, 149 data with graphi
s, 137
top, 31, 33, 41, 47, 147 geometry monitors, 50
translation, 21 temperature, 182
molinfo pointer, 57
points
191
detail, 51 stereo, 101
representation, 68, 69 representation, 43, 67, 118
popup menu, 17, 20, 23, 80, 108, 110, 161 add new, 43
atom spe
i
, 32
hanging, 19, 43, 45, 119
ustomizing, 124 deleting, 44
posts
ript, 96, 97 examples, 166
Pov-Ray, 96 info, 148
o, 74
quit, 32, 40 style, 18, 43, 67, 68, 118
ommand, 114, 120 options, 44
quoting, 86 reset view, 31, 114
Radian
e, 96 resolution
ylinder, 44
radius
level, 51, 114
of gyration, 156
rapp, 102 sphere, 44
raster image
reation, 95 restore
Raster3D, 18, 55, 66, 96, 97, 101, 121, 165 representations, 175
RayShade, 96 viewpoint, 149, 175
vmd state, 174
regular expression, 87, 94
ribbon representation, 68, 71
X-PLOR
onversion, 94
remote RMSD, 157, 183{185
ommand, 110, 120 ro
k, 30, 47
onne
tion, 102, 120
ommand, 110, 121
ontrolling, 59 rotate
ommand, 110, 122
des
ription, 103
deta
hing, 60 side
hain, 155
initializing, 58 rotation
installation, 104 automati
, 30
killing, 60 ro
k, 31
spin, 30
modiable parameters, 60
stop, 30, 31
requirements, 102
starting, 58
ontinuous, 23
troubleshooting, 106 hot keys, 36
using, 59 stop, 23
form, 57 transformation matrix, 129, 131
using mouse, 23
options, 120
simulation
ontrol, 57, 120, 122 save
remote
ontrol of VMD, 168
olors, 175
render
onguration, 32, 174
ommand, 110, 121 representations, 175
form, 18, 54 viewpoint, 149, 175
rendering, 18, 54, 55, 95 vmd state, 32, 174
aveats, 55, 97 s
ale
exe
ommand, 121
ommand, 110, 122
in ba
kground pro
ess, 55 s
aling
method, 34, 96, 121 using mouse, 24
192
s
reen parameters, 52, 97 tra
e representation, 68, 71
se
urity, 62, 168 tra
ker
sele
tion, 18, 19, 43, 67, 118, 150
ommand, 110, 123
omparison, 88 form, 56
keywords, 45, 84, 92 traje
tory
boolean, 86 les, 64
logi
, 86 read, 48, 188
math fun
tions, 94 write, 48
modes, 84 transformation matrix, 128
text, 151 align, 129
short
ir
uit logi
, 86, 89
entering, 131
simulation identity, 128
ommand, 110, 122 oset, 130, 131
ontrol, 57, 122 rotation, 129, 131
form, 59 translate
parameters, 58, 182
ommand, 110, 123
solvent a
essible surfa
e, 68, 70 translation
solvent representation, 68, 70
hange atom
oordinates, 155
sour
e transformation matrix, 130
ommand, 108 using mouse, 24
spin, 30 transparen
y, 45, 75, 79, 80, 82, 162
stage, 51 tube representation, 68, 71
ommand, 110, 123
startup les, 163, 188, 189, 191 user
stereo
ommand, 110, 123, 161
mode, 98 user interfa
es, 60
modes, 26 3D, 61
o, 98 external, 61, 109, 115, 168
parameters, 52, 100, 114 forms, 35
problems, 100 gesture, 62
surf spee
h, 62
representation, 68, 72 text, 108
surfa
e
van der Waals representation, 68, 69
mole
ular, 68, 70
variables
solvent a
essible, 68, 70
env, 188, 189
surfa
e plot, 139
M PI, 132
T
l, 109 vmd frame, 178
T
l-DP, 62, 109, 168 vmd pi
k atom, 141, 176
T
lX, 109 vmd pi
k mol, 141, 176
text vmd timestep, 178, 182
displayed, 135 ve
tor
ommand
Tk, 109
oordtrans, 131
top, 31 ve
add, 126
topology les, 64 ve
ross, 127
tra
e ve
dot, 127
variables, 141, 178, 182 ve
invert, 128
193
ve
length, 127
ve
length2, 128
ve
norm, 128
ve
s
ale, 127
ve
sub, 127
ve
trans, 131
ve
zero, 126
ve
tor routines, 126
view, 43, 67, 118
adding, 44
deleting, 44
viewing modes
hanging, 98
VMD, 11
as a server, 168
as helper appli
ation, 164
ommand line options, 187
ompile options, 124
ontrol from another VMD, 168
opyright, 14
ustomizing, 163, 187
vmdinfo
ommand, 110, 124
vmdlog
ommand, 63, 124
VRML, 96
wait
ommand, 110, 124
wireframe, 51, 67
194