forked from PyMOL-Ross/Pymol-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTutorial-4-movies.txt
506 lines (379 loc) · 10.1 KB
/
Tutorial-4-movies.txt
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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
Lets make a movie!
Additional software
OPTIONAL - For complicated image compilations use ffmpeg
This software turns images into movies (ffmpeg is commandline)
ffmpeg -r 25 -i img%04d.png -f mp4 -q:v 0 -vcodec mpeg4 myVideo.mp4
REQUIRED - Pymol makes BIG movie files.
This software compresses files without losing resolution (nice GUI)
Handbrake using RF 24
Links
https://www.pymolwiki.org/index.php/MovieSchool
Good but old! (pymol v1.2)
PART 1
##########################################################
# USING THE GUI TO MAKE A MOVIE
##########################################################
rein
fetch 2chb, async=0
remove hydrogen
hide all
bg_color white
select lig, organic
select bb, bb.
select sc, polymer & ! bb + name ca + /*//*/PRO`*/N
as cartoon, bb
show sticks, sc + lig
util.cbc
color black, lig
util.cnc
orient bb
select none
dist hbbb, org, bb, mode=2
dist hbsc, org, sc, mode=2
color grey20, hbbb
color grey80, hbsc
hide labels
ok, now we can us the GUI
Movie > Program > Camera loop > Nutate > 30deg.4sec
Movie > Program > Camera loop > X-roll > 8s
Movie > Append > 4s
Movie > FrameRate > 5fps
Movie > Reset
##########################################################
Appending multiple gui camera controls that look good!
orient
Movie > Program > Camera loop >Nutate > 30deg.4sec
Movie > Update last program # if required
Movie > append > 2s
orient c. D
Movie > Program > Camera loop > Nutate > 30deg.4sec
Movie > append > 2s
orient c. D & org
Movie > Program > Camera loop > Nutate > 30deg.4sec
Movie > append > 2s
##########################################################
HEY!! I want to cycle through my NMR/MD/morph/other states!!
ok, we can use
rein
fetch 2adt, async=0
as sticks
Movies > Program > state loop > Full speed
*** Actually, you can just save as movie, as states are present.
HEY!! I want my states to cycle while i move around the structure
Well, you can’t do that in the GUI, sorry! (at least i dont know how)
##########################################################
GUI scenes # scenes are amazing!
make scenes with
Scene > Store > F?
Movie > Program > Scene loop > Nutate > 30deg.4sec
Can be a bit clunky to use but your creative skills can get around this.
PART 2
##########################################################
Movies on the command line
##########################################################
what is a state?
what is a frame?
# what is mset
mset 1 x200 (x[num]) gives appended frames at given state
# if you have states too
mset 1 -200 (-[num]) gives movement between states (while moving between frames)
mset 1 200 ([num]) moves straight to numbered state
So, you can make some fancy movies of MD simulations, NMR, morphs!
###################################################
# what is mview
https://pymolwiki.org/index.php/Mview
### Ligand zoom
rein
fetch 1rx1, async=0
as cartoon
as sticks, organic
mset 1 x150
orient
mview store, 1
mview store, 50
orient organic
mview store, 100
mview store, 150
mplay
# commands don't have to be in sequencial order.
rein
fetch 1rx1, async=0
as cartoon
as sticks, organic
mset 1 x150
orient
mview store, 1
mview store, 150
orient organic
mview store, 50
mview store, 100
mplay
### 360° rotation
rein
fetch 1rx1, async=0
as cartoon
as sticks, organic
mset 1 x180
mview store, 1
mview store, 180
turn y, 120
mview store, 60, power=1.0
turn y, 120
mview store, 120, power=1.0
mplay
###################################################
Moving through states while moving the camera
rein
load structures.pse # load a file with states for this one.
remove hydrogen
hide all
bg_color white
select lig, organic
select bb, bb.
select sc, sc. + name ca + /*//*/PRO`*/N
as cartoon, bb
set cartoon_gap_cutoff, 0
show sticks, sc + lig
util.cbc
color black, lig
util.cnc
orient bb
select none
dss
#reset the movie!
mview reset
orient
mset 1 x30 -150 x20
mview interpolate
mview smooth
mview store, 1
turn x, -90
mview store, 50
mview store, 198
###################################################
a little more involved
mview and mset together
mview reset
orient
mset 1 x50 -500 x50
mview interpolate
mview smooth
mview store, 1
turn x, -90
mview store, 50
mview store, 150
turn x, 90
mview store, 250
mview store, 350
turn y, 90
mview store, 450
mview store, 550
ridiculous mset
mset 1 x200 -78 -2 -78 x200 79 -156 157 x200 -234 235 x400
# mset 1 x200 makes the first state last for 200 frames
# -78 -2 takes us FROM state 1 to 78, then back to frame 2.
# I've repeated this for dramatic effect.
# Then we pause at 78 for 200 frames,
# then go from 79-156 and pause at 157 for 200 frames, etc.
You MUST have the full number of mset frames declared utilised via mview!
Otherwise the interpolation will move back to the beggining at the end of the video
Alternatively, if you are making a looping video, you may want to allow this to happen.
PART 3
###################################################
Movies on the command line with state control and morph
###################################################
'morph' - available on pymol-2.x - transitions between structures
'create' seperates and merges objects and states
rein
load reduced.pdb # load a file with states for this one.
remove hydrogen
hide all
bg_color white
select lig, organic
select bb, polymer & name c+o+n+ca
select sc, sc. + name ca + /*//*/PRO`*/N
as cartoon, bb
show sticks, sc + lig
util.cbc
color black, lig
util.cnc
orient bb
select none
dss
create pent1, reduced, 1, 1
create mono1, reduced & s. PROA, 1, 1
create mono2, reduced & s. PROB, 1, 1
create mono3, reduced & s. PROC, 1, 1
create mono4, reduced & s. PROD, 1, 1
create mono5, reduced & s. PROE, 1, 1
Move and denature
extract pent2, mono*
delete mono*
morph morphname, pent2, pent1, refinement=1, steps=100
create fullmodel, morphname, 0, 1
smooth reduced, 10, 10
create fullmodel, reduced, 0, 101
PART 4
###################################################
Movies on the command line with scenes
###################################################
With scenes you can change representations during the movie
rein
load structures.pse # load a file with states for this one.
remove hydrogen
hide all
bg_color white
select lig, organic
select bb, bb.
select sc, sc. + name ca + /*//*/PRO`*/N
as cartoon, bb
set cartoon_gap_cutoff, 0
show sticks, sc + lig
util.cbc
color black, lig
util.cnc
orient bb
select none
dss
extract trimer, c. A
extract dimer, c. B
orient trimer
select bb, bb.
select sc, sc. + name ca + /*//*/PRO`*/N
orient
###################################################
- - THIS CAN ACT AS A GOOD TEMPLATE!! - -
mview reset
mset 1 x400 -380 x20
set scene_animation,-1
set scene_animation_duration,0
set ray_trace_frames=0 # set this to 1 to get ray traced frames (takes a while)
mview interpolate
mview smooth
disable dimer
orient trimer
hide sticks
scene 001, store
turn y, 90
show lines, sc
scene 002, store
show sticks, sc
scene 003, store
set_view (\
0.206935033, -0.007686321, 0.978324473,\
-0.978228033, 0.014468522, 0.207028300,\
-0.015746213, -0.999865770, -0.004524941,\
0.000000000, 0.000000000, -135.752883911,\
-1.243819475, 7.003369808, 15.669667244,\
107.028610229, 164.477157593, -20.000000000 )
scene 004, store
enable dimer
scene 005, store
scene 001
mview store, 1
turn x, -120
mview store, 50, power=1.0
turn x, -120
mview store, 100, power=1.0
turn x, -120
mview store, 150
scene 002
mview store, 195
scene 003
mview store, 200
turn z, -120
mview store, 250, power=1.0
turn z, -120
mview store, 300, power=1.0
turn z, -120
mview store, 350
scene 004
mview store, 395
scene 005
mview store, 400
turn y, 180
mview store, 600
mview store, 798
mview interpolate
mview smooth
rewind
PART 4
###################################################
Movies and molecular transitions in powerpoint
###################################################
Show example in powerpoint and session file
(Sorry youtubers, this bit has some unpublished work in it)
PART 5
###################################################
Movies and molecular transitions in powerpoint
###################################################
Complex Movies Examples
#################################################
How the professionals do it!! (examples from the net)
# setup PyMOL for the movie
reinitialize
set matrix_mode, 1
set movie_panel, 1
# load the PDBs
fetch 1cll 1ggz, async=0
# orient the scene
as cartoon
orient
# make 100-frame movie
mset 1 x100
# goto frame 1
frame 1
# store the camera position and object
# positions in frame 1
mview store
mview store, object=1cll
mview store, object=1ggz
# goto frame 90
frame 90
# align the two proteins
super 1cll, 1ggz
# we rezoom to center the camera on the
# two aligned proteins
zoom
# store the camera positions
mview store
# store the new object position(s)
mview store, object=1cll
mview store, object=1ggz
# have PyMOL stitch together the scenes.
mview reinterpolate
mview reinterpolate, object=1cll
mview reinterpolate, object=1ggz
# rewind
frame 1
# get some popcorn!
mplay
#################################################
Backbone walking
# usual setup
reinitialize
set matrix_mode, 1
set movie_panel, 1
# fetch 1CLL to work on; this will only work on 1cll
# or any other protein with 144 AAs starting at resi 4.
fetch 1cll, async=0
as sticks
color marine
util.cnc
#zoom i. 1+2, 2
# 10 frames per AA
mset 1 x1440
mview store
# this code maps the zooming of
# one AA and it's neighbor to 10 frames
python
for x in range(0,144):
cmd.frame((20*x)+1)
cmd.zoom( "n. CA and i. " + str(x) + "+" + str(x+1), 2)
cmd.mview("store")
python end
# goto the end and interpolate all the frames
#frame 288
mview store
mview reinterpolate
mplay