forked from leeping/molssi-synthesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmd.rc
280 lines (246 loc) · 8.1 KB
/
vmd.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
############################################################################
#cr
#cr (C) Copyright 1995-2007 The Board of Trustees of the
#cr University of Illinois
#cr All Rights Reserved
#cr
############################################################################
############################################################################
# RCS INFORMATION:
#
# $RCSfile: .vmdrc,v $
# $Author: johns $ $Locker: $ $State: Exp $
# $Revision: 1.9 $ $Date: 2007/01/12 20:12:44 $
#
############################################################################
# DESCRIPTION:
#
# VMD startup script. The commands here are executed as soon as VMD starts up
############################################################################
# turn on lights 0 and 1
light 0 on
light 1 on
light 2 off
light 3 off
# position the stage and axes
axes location lowerleft
stage location off
# position and turn on menus
menu main move 5 225
menu display move 395 30
menu graphics move 395 500
menu color move 125 225
menu files move 125 325
menu labels move 125 525
menu render move 125 525
menu main on
#menu display on
#menu graphics on
#menu color on
#menu labels on
#menu render on
#menu files on
# start the scene a-rockin'
# rock y by 1
# User's default values for newly loaded molecules/reps, etc
# mol default color {colorID 5}
# mol default style {NewCartoon 0.300000 6.000000 4.100000 0}
# mol default selection {name CA}
# mol default material {Transparent}
mol default style
#mol default style {NewCartoon 0.300000 6.000000 4.100000 0}
#after idle {
# change default rep for already loaded molecules
# mol representation {CPK 0.100000 0.100000 20.000000 20.000000}
# mol representation {CPK 1.000000 0.300000 20.000000 20.000000}
# foreach mid [molinfo list] {
# mol delrep 0 $mid
# mol addrep $mid
# }
#}
#=================#
#| Begin sscache |#
#=================#
# Cache secondary structure information for a given molecule
#VMD --- start of VMD description block
#Name:
# SSCache
#Synopsis:
# Automatically stores secondary structure information for animations
#Version:
# 1.0
#Uses VMD version:
# 1.1
#Ease of use:
# 2
#Procedures:
# <li>start_sscache molid - start caching the given molecule
# <li>stop_sscache molid - stop caching
# <li>reset_sscache - reset the cache
# <li>sscache - internal function used by trace
#Description:
# Calculates and stores the secondary structure assignment for
# each timestep. This lets you see how the secondary structure
# changes over a trajectory.
# <p>
# It is turned on with the command "start_sscache> followed by the
# molecule number of the molecule whose secondary structure should be
# saved (the default is "top", which gets converted to the correct
# molecule index). Whenever the frame for that molecule changes, the
# procedure "sscache" is called.
# <p>
# "sscache" is the heart of the script. It checks if a secondary
# structure definition for the given molecule number and frame already
# exists in the Tcl array sscache_data(molecule,frame). If so, it uses
# the data to redefine the "structure" keyword values (but only for
# the protein residues). If not, it calls the secondary structure
# routine to evaluate the secondary structure based on the new
# coordinates. The results are saved in the sscache_data array.
# <p>
# Once the secondary structure values are saved, the molecule can be
# animated rather quickly and the updates can be controlled by the
# animate form.
# <p>
# To turn off the trace, use the command "stop_sscache", which
# also takes the molecule number. There must be one "stop_sscache"
# for each "start_sscache". The command "clear_sscache" resets
# the saved secondary structure data for all the molecules and all the
# frames.
#Files:
# <a href="sscache.vmd">sscache.vmd</a>
#See also:
# the VMD user's guide
#Author:
# Andrew Dalke <[email protected]>
#Url:
# http://www.ks.uiuc.edu/Research/vmd/script_library/sscache/
#\VMD --- end of block
# start the cache for a given molecule
proc start_sscache {{molid top}} {
global sscache_data
if {! [string compare $molid top]} {
set molid [molinfo top]
}
global vmd_frame
# set a trace to detect when an animation frame changes
trace variable vmd_frame($molid) w sscache
return
}
# remove the trace (need one stop for every start)
proc stop_sscache {{molid top}} {
if {! [string compare $molid top]} {
set molid [molinfo top]
}
global vmd_frame
trace vdelete vmd_frame($molid) w sscache
return
}
# reset the whole secondary structure data cache
proc reset_sscache {} {
global sscache_data
if [info exists sscache_data] {
unset sscache_data
}
return
}
# when the frame changes, trace calls this function
proc sscache {name index op} {
# name == vmd_frame
# index == molecule id of the newly changed frame
# op == w
global sscache_data
# get the protein CA atoms
set sel [atomselect $index "protein name CA"]
## get the new frame number
# Tcl doesn't yet have it, but VMD does ...
set frame [molinfo $index get frame]
# see if the ss data exists in the cache
if [info exists sscache_data($index,$frame)] {
$sel set structure $sscache_data($index,$frame)
return
}
# doesn't exist, so (re)calculate it
vmd_calculate_structure $index
# save the data for next time
set sscache_data($index,$frame) [$sel get structure]
return
}
#proc sscache_loop {{molid top}} {
# if {! [string compare $molid top]} {
# set molid [molinfo top]
# }
# set nf [molinfo $molid get numframes]
# puts "numframes = $nf"
# for {set i 0} {$i < $nf} {incr i} {
# sscache $i $molid w
# }
#}
# Instead I need to:
# 1) Loop over the frames and run sscache
#=================#
#| End sscache |#
#=================#
#==========================#
#| Begin LP's functions |#
#==========================#
# One of LP's favorite functions for displaying reactions
proc dbonds {molid} {
color Labels Atoms black
color Labels Bonds black
color Labels Angles black
color Labels Dihedrals black
color Name C silver
display projection Orthographic
axes location Off
color Display Background white
#display resize 600 600
display depthcue off
display nearclip set 0.010000
mol modselect 0 $molid not name \"H.*\"
mol modstyle 0 $molid DynamicBonds 1.800000 0.150000 21.000000
mol addrep $molid
mol modselect 1 $molid all
mol modstyle 1 $molid DynamicBonds 1.200000 0.150000 21.000000
mol addrep $molid
mol modstyle 2 $molid VDW 0.250000 27.000000
mol modmaterial 0 $molid Diffuse
mol modmaterial 1 $molid Diffuse
mol modmaterial 2 $molid Diffuse
material change ambient Diffuse 0.130000
}
# LP's function to align the trajectory to frame 0 using an atom selection (could be "all")
proc align {args} {
set nf [molinfo top get numframes]
set all [atomselect top all]
set sel [atomselect top $args]
set frame0 [atomselect top $args frame 0]
#set frame0 [atomselect top all frame 0]
puts "Aligning..."
for { set i 1 } { $i <= $nf } { incr i } {
if { ($i > 0) && ($i%10000 == 0) } {
puts "Frame $i/$nf"
}
$all frame $i
$sel frame $i
$all move [measure fit $sel $frame0]
}
display resetview
}
# No teal carbons
color Name C silver
proc ss {molid} {
display projection Orthographic
display depthcue off
display nearclip set 0.010000
mol modstyle 0 $molid NewCartoon
mol modcolor 0 $molid Structure
start_sscache
axes location Off
set sel [atomselect top "protein"]
# pbc wrap -all -centersel "segid P1" -center com -compound fragment
# rmsdtt::align $sel 0 $sel
# align protein
}
# Go to the first frame
animate goto 0
puts "LP's VMD startup file successfully loaded"