/
view.tcl
257 lines (202 loc) · 6.2 KB
/
view.tcl
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
source input_param.tcl
source add_text_layer.tcl
####
#Display the reference crystal structure
mol load psf only_nucl_init.psf
mol addfile only_nucl_init.pdb
mol modstyle 0 0 NewCartoon 0.840000 20.000000 2.630000 0
###
mol load psf only_nucl_init.psf
mol addfile only_nucl_init.pdb
mol ssrecalc top
mol addfile md.dcd step 10 waitfor all
set molid [ molinfo top ]
display rendermode GLSL
mol delrep 0 top
# H3 H3 Dimer representation
mol representation NewCartoon 0.840000 20.000000 2.630000 0
mol color Segname
mol selection {segname CHA CHE}
mol material AOShiny
mol addrep top
mol selupdate 0 top 0
mol colupdate 0 top 0
# H4 H4 Dimer representation
mol representation NewCartoon 0.840000 20.000000 2.630000 0
mol color Segname
mol selection {segname CHB CHF}
mol material AOShiny
mol addrep top
mol selupdate 1 top 0
mol colupdate 1 top 0
# H2a H2a Dimer representation
mol representation NewCartoon 0.840000 20.000000 2.630000 0
mol color Segname
mol selection {segname CHC CHG}
mol material AOShiny
mol addrep top
mol selupdate 2 top 0
mol colupdate 2 top 0
# H2b H2b Dimer representation
mol representation NewCartoon 0.840000 20.000000 2.630000 0
mol color Segname
mol selection {segname CHD CHH}
mol material AOShiny
mol addrep top
mol selupdate 3 top 0
mol colupdate 3 top 0
# Dna sugar-phosphate backbone representation
mol representation NewCartoon 1.090000 10.000000 2.070000 1
mol color ColorID 6
mol selection {nucleic and backbone}
mol material AOEdgy
mol addrep top
mol selupdate 4 top 0
mol colupdate 4 top 0
# Dna nucleobases representation
mol representation Licorice 0.300000 10.000000 10.000000
mol color ColorID 6
mol selection { nucleic and noh and not name P O1P O2P O3' O5' C5' and resname GUA CYT}
mol material AOEdgy
mol addrep top
mol selupdate 5 top 0
mol colupdate 5 top 0
mol representation Licorice 0.300000 10.000000 10.000000
mol color ColorID 6
mol selection {nucleic and noh and not name P O1P O2P O3' O5' C5' and resname THY ADE}
mol material AOEdgy
mol addrep top
mol selupdate 6 top 0
mol colupdate 6 top 0
#Key argininges
mol representation VDW
mol color ColorID 3
mol selection {(segname CHA CHE and resid 83 63 49) or (segname CHB CHF and resid 45) or (segname CHC CHG and resid 42 77) or (segname CHD CHH and resid 30)}
mol material AOShiny
mol addrep top
mol selupdate 7 top 0
mol colupdate 7 top 0
# mol representation VDW
# mol color Violet
# mol selection { (segname CHC CHG and resid 30 33 35 37 38 39 40 41 48 62 71 73 75 76 79 89 94 95 97 98 100 104 110 117) }
# mol material AOShiny
# mol addrep top
# mol selupdate 8 top 0
# mol colupdate 8 top 0
#color scheme for histones and DNA
#old scheme
# color Segname CHA orange2
# color Segname CHB yellow3
# color Segname CHC mauve
# color Segname CHD cyan3
# color Segname CHE orange2
# color Segname CHF yellow3
# color Segname CHG mauve
# color Segname CHH cyan3
color Segname CHA blue3
color Segname CHB green
color Segname CHC yellow2
color Segname CHD red3
color Segname CHE blue3
color Segname CHF green
color Segname CHG yellow2
color Segname CHH red3
color Highlight Nonback 6
color Highlight Nucback 2
color Display Background white
color scale method RWB
color change rgb 0 0.1 0.2 0.7 ;# blue
color change rgb 1 0.7 0.2 0.1 ;# red
color change rgb 3 0.7 0.4 0.0 ;# orange
color change rgb 4 0.8 0.7 0.1 ;# yellow
color change rgb 7 0.1 0.7 0.2 ;# green
color change rgb 10 0.1 0.7 0.8 ;# cyan
color change rgb 11 0.6 0.1 0.6 ;# purple
color change rgb 23 0.550000011920929 0.7099999785423279 0.9800000190734863
color change rgb 24 0.15 0.25 0.93
color change rgb 30 0.81 0.18 0.18
# ================= movie starts ====================
# sets a variable for knowing were real molecules ends if there are more than one
set molnum [expr [molinfo num]]
# #--------set start txt position in px-----
set txtx [expr -($dispw/2) + 20 ]
set txty [expr ($disph/2) - 20 ]
# set step of txt lines
set txtstep [expr $disph/30 ]
# # set counter for lines
set txtlncount 0
# #prepare scene
scale by $scale
translate by $transx $transy $transz
axes location off
display update ui
# #add some text on new layer
add_text_layer HEADNAME
draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "MD simulations of nucleosome without tails (1000 ns)" size 1.5 thickness 3
incr txtlncount 2
add_text_layer HISTONES
# #Turn off all
set num_of_reps [molinfo $molid get numreps]
#for {set i 0} { $i < $num_of_reps } { incr i 1 } {
#mol showrep $molid $i off }
set matnum 22
set text(0) "Histones H3"
set text(1) "Histones H4"
set text(2) "Histones H2A"
set text(3) "Histones H2B"
set color_text(0) blue3
set color_text(1) green
set color_text(2) yellow2
set color_text(3) red3
# #First four pair of histones
for {set r 0} {$r < 4} {incr r 1} {
#text
draw color $color_text($r)
draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "$text($r)" size 1.5 thickness 3
incr txtlncount 1
#molecule
mol showrep $molid $r on
#copy a material for them
material add copy AOShiny
# mol modmaterial $r top Material$matnum
mol modmaterial $r top AOShiny
# #make a smooth transparent appearance for 30 frames with rotation
material change opacity Material$matnum 1
#render Tachyon dat/$fc.dat
#
incr matnum 1
}
# # Adding DNA
# #text
add_text_layer DNA
draw color 6
draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "DNA" size 1.5 thickness 3
incr txtlncount 1
draw color 3
draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "Min groove ARG" size 1.5 thickness 3
incr txtlncount 1
# draw color 6
# draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "GC pairs" size 1.5 thickness 3
# incr txtlncount 1
#ion lables
# draw color 1
# draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "Sodium ions" size 1.5 thickness 3
# incr txtlncount 1
# draw color 7
# draw text " $txtx [expr $txty-($txtlncount*$txtstep)] 0 " "Chloride ions" size 1.5 thickness 3
# incr txtlncount 1
#molecule
mol showrep $molid 4 on
mol showrep $molid 5 on
mol showrep $molid 6 on
mol showrep $molid 7 on
mol showrep $molid 8 on
mol modmaterial 4 $molid AOEdgy
mol modmaterial 5 $molid AOEdgy
mol modmaterial 6 $molid AOEdgy
mol modmaterial 7 $molid AOEdgy
mol modmaterial 8 $molid AOEdgy
display update
#material change opacity AOEdgy 0.8
display update
mol top 1