-
Notifications
You must be signed in to change notification settings - Fork 0
/
python_pymol.snippets
2950 lines (2576 loc) · 138 KB
/
python_pymol.snippets
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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
snippet ao "Apply the ambient occlussion effect to get the photorealistic effect." b
cmd.do("set_color oxygen, [1.0,0.4,0.4];")
cmd.do("set_color nitrogen, [0.5,0.5,1.0];")
cmd.do("remove solvent;")
cmd.do("as spheres;")
cmd.do("# the \"as\" command is a shortcut for show_as")
cmd.do("util.cbaw;")
cmd.do("# \"cba\" represents \"color by atom\". ")
cmd.do("# The last letter represents the colore of the carbon atom.")
cmd.do("bg white;")
cmd.do("# bg is an alias for bg_color or background color.")
cmd.do("set light_count,10;")
cmd.do("# light_count is the number of light sources. ")
cmd.do("# The max is 10. The defualt is 10.")
cmd.do("set spec_count,1;")
cmd.do("# Not documented on Wiki.")
cmd.do("set shininess, 10;")
cmd.do("# sets the shininess of the object.")
cmd.do("set specular,0.25;")
cmd.do("# Controls the amount of directly reflected light and not the shininess of the reflection.")
cmd.do("set ambient,0;")
cmd.do("# Controls the amount of ambient light. Default is 0. Ranges from -1 to 1.")
cmd.do("set direct,0; ")
cmd.do("# Not documented on Wiki.")
cmd.do("set reflect,1.5;")
cmd.do("# Controls the amount of light reflection and the effect that directional light has on shadows ")
cmd.do("# and the general lighting of the scene. Default value is 0.5.")
cmd.do("set ray_shadow_decay_factor, 0.1;")
cmd.do("set ray_shadow_decay_range, 2;")
cmd.do("set depth_cue, 0;")
cmd.do("ray;")
${0}
endsnippet
snippet sas "Show the solvent excluded surface." b
cmd.do("set surface_solvent, ${1:on}")
${0}
endsnippet
snippet ellipcol "Set color of thernal ellipsoids. The PDB must have anisotopic temperature factors. See https://pymolwiki.org/index.php/Color_Values for the PyMOL colors." b
cmd.do("set ellipsoid_color, ${1:red};")
${0}
endsnippet
snippet sigdist "Set distance labels to display 2 decimals." b
cmd.do("set label_distance_digits, ${1:2};")
${0}
endsnippet
snippet sigang "Set angle labels to display 2 decimals places." b
cmd.do("set label_angle_digits, ${1:2};")
${0}
endsnippet
snippet bs "Ball and stick representation." b
cmd.do("show sticks;")
cmd.do("set stick_radius, 0.12;")
cmd.do("set stick_ball, on;")
cmd.do("set stick_ball_ratio, 1.9;")
cmd.do("show nb_spheres;")
cmd.do("set nb_spheres_size=0.33;")
${0}
endsnippet
snippet stack "Base-stacking figure." b
cmd.do("delete all;")
cmd.do("fetch ${1:4PCO}, type=pdb,async=0;")
cmd.do("select ${2:G2G3}, ( ((resi ${3:2} or resi ${4:3}) and chain A) or ((resi ${5:8} or resi ${6:9}) and chain B) );")
cmd.do("hide everything, element h; ")
cmd.do("remove not ${2:G2G3};")
cmd.do("bg_color white;")
cmd.do("show sticks;")
cmd.do("set stick_radius=0.14;")
cmd.do("set stick_ball, on; ")
cmd.do("set stick_ball_ratio,1.9;")
cmd.do("set_view (-0.75,0.09,0.66,-0.2,0.92,-0.35,-0.64,-0.39,-0.67,-0.0,-0.0,-43.7,7. 24,9.55,11.78,29.46,57.91,-20.0);")
cmd.do("hide everything, element H;")
cmd.do("select carbon1, element C and (resi ${4:3} or resi ${5:8}); ")
cmd.do("# select lower base pair;")
cmd.do("select carbon2, element C and (resi ${3:2} or resi ${6:9});")
cmd.do("#select upper base pair;")
cmd.do("color gray70,carbon1;")
cmd.do("color gray10,carbon2;")
cmd.do("space cmyk;")
cmd.do("distance hbond1,/${1:4PCO}//B/U`9/N3,/${1:4PCO}//A/G`2/O6;")
cmd.do("distance hbond2,/${1:4PCO}//B/U`9/O2,/${1:4PCO}//A/G`2/N1;")
cmd.do("distance hbond3,/${1:4PCO}//A/U`3/N3,/${1:4PCO}//B/G`8/O6;")
cmd.do("distance hbond4,/${1:4PCO}//A/U`3/O2,/${1:4PCO}//B/G`8/N1;")
cmd.do("color black, hbond1;")
cmd.do("color black, hbond2;")
cmd.do("color gray70, hbond3;")
cmd.do("color gray70, hbond4;")
cmd.do("show nb_spheres;")
cmd.do("set nb_spheres_size, 0.35;")
cmd.do("hide labels;")
cmd.do("ray 1600,1000;")
cmd.do("png ${1:4PCO}.png")
${0}
endsnippet
snippet bu "Generate the biological unit using the quat.py script. Edit the path to the file quat.py. You may have to download it from the PyMOL Wiki page." b
cmd.do("run ~/${1:Scripts/PyMOLScripts}/quat.py;")
cmd.do("quat;")
${0}
endsnippet
snippet doubleBond "Valence bond." b
cmd.do("set valence, 1; ")
cmd.do("set valence_mode, 1;")
${0}
endsnippet
snippet cblind "Apply color blind friendly to ribbon diagrams. Edit the path to the Pymol-script-repo in your computer account. See PyMOL wiki for more information about the Pymol-script-reo." b
cmd.do("run ~/${1:Pymol-script-repo}/colorblindfriendly.py;")
cmd.do("as cartoon;")
cmd.do("color cb_red, ss H;")
cmd.do("color cb_yellow,ss S;")
cmd.do("color cb_green, ss L+;")
${0}
endsnippet
snippet centerpi "Center pi. Edit the atoms selected for positioning the pseudoatom." b
cmd.do("pseudoatom pi_cent,/${1:3nd3}/${2:A}/${3:U`15}/cg+cz;")
cmd.do("dist pi_cent////ps1, b/${4:U`15}/${5:aaa};")
${0}
endsnippet
snippet cribbon "Color ribbon H red, strand yellow, loop green." b
cmd.do("as cartoon;")
cmd.do("color red, ss H;")
cmd.do("color yellow,ss S;")
cmd.do("color green, ss L+;")
${0}
endsnippet
snippet cspheres "Colored spheres." b
cmd.do("as spheres;")
cmd.do("color gray30, chain ${1:A};")
cmd.do("color white, chain ${2:B};")
cmd.do("color green, name CL;")
cmd.do("color brown, resn NAG;")
cmd.do("color red, resi 381;")
cmd.do("remove solvent;")
cmd.do("set specular, 0;")
cmd.do("set ray_trace_gain, 0;")
cmd.do("set ray_trace_mode, 3;")
cmd.do("bg_color white;")
cmd.do("set ray_trace_color, black;")
cmd.do("set depth_cue,0;")
${0}
endsnippet
snippet coordinate "Coordinate covalent bonds to metals and H-bonds from RNA." b
cmd.do("viewport 900,600;")
cmd.do("fetch 3nd4, type=pdb, async=0;")
cmd.do("run ~/Scripts/PyMOLScripts/quat.py;")
cmd.do("quat 3nd4;")
cmd.do("show sticks;")
cmd.do("set stick_radius=0.125;")
cmd.do("hide everything, name H*;")
cmd.do("bg_color white;")
cmd.do("create coorCov, (3nd4_1 and (resi 19 or resi 119 or resi 219 or resi 319 or resi 419 or resi 519 or (resi 3 and name N7)));")
cmd.do("bond (coorCov//A/NA`19/NA),(coorCov//A/A`3/N7);")
cmd.do("bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`119/O);")
cmd.do("bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`219/O);")
cmd.do("bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`319/O);")
cmd.do("bond (coorCov//A/NA`19/NA),(coorCov//A/HOH`519/O);")
cmd.do("distance (3nd4_1 and chain Aand resi 19 and name NA), (3nd4_1 and chain A and resi 519);")
cmd.do("distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 419);")
cmd.do("distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 319);")
cmd.do("distance (3nd4_1 and chain A and resi 19 and name NA), (3nd4_1 and chain A and resi 219);")
cmd.do("show nb_spheres; ")
cmd.do("set nb_spheres_size, .35;")
cmd.do("distance hbond1,/3nd4_1/1/A/HOH`119/O, /3nd4_1/1/A/A`3/OP2;")
cmd.do("distance hbond2,/3nd4_1/1/A/HOH`319/O, /3nd4_1/1/A/A`3/OP2;")
cmd.do("distance hbond3,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/HOH`119/O;")
cmd.do("distance hbond4,/3nd4_1/1/A/G`4/N7,/3nd4_1/1/A/HOH`91/O;")
cmd.do("distance hbond5,/3nd4_1/1/A/G`4/O6, /3nd4_1/1/A/HOH`419/O;")
cmd.do("distance hbond6,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2;")
cmd.do("distance hbond7,/3nd4_1/1/A/HOH`319/O,/3nd4_1/1/A/G`2/OP2;")
cmd.do("distance hbond9,/3nd4_1/1/A/HOH`419/O,/3nd4_2/2/A/HOH`74/O;")
cmd.do("distance hbond10,/3nd4_2/2/A/C`15/O2,/3nd4_1/1/A/G`2/N2;")
cmd.do("distance hbond11, /3nd4_2/2/A/C`15/N3,/3nd4_1/1/A/G`2/N1;")
cmd.do("distance hbond12,/3nd4_2/2/A/C`15/N4,/3nd4_1/1/A/G`2/O6;")
cmd.do("distance hbond13, /3nd4_2/2/A/U`14/N3,/3nd4_1/1/A/A`3/N1;")
cmd.do("distance hbond14,3nd4_2/2/A/U`14/O4,/3nd4_1/1/A/A`3/N6;")
cmd.do("distance hbond15, /3nd4_2/2/A/C`13/N4,/3nd4_1/1/A/G`4/O6;")
cmd.do(" distance hbond16,/3nd4_2/2/A/C`13/N3, /3nd4_1/1/A/G`4/N1;")
cmd.do("distance hbond17, /3nd4_1/1/A/G`4/N2,/3nd4_2/2/A/C`13/O2;")
cmd.do("distance hbond18,/3nd4_1/1/A/G`2/N2,/3nd4_2/2/A/C`15/O2;")
cmd.do("distance hbond19,/3nd4_1/1/A/HOH`91/O,/3nd4_1/1/A/G`4/OP2; ")
cmd.do("set depth_cue=0;")
cmd.do("set ray_trace_fog=0;")
cmd.do("set dash_color, black;")
cmd.do("set label_font_id, 5;")
cmd.do("set label_size, 36;")
cmd.do("set label_position, (0.5, 1.0, 2.0);")
cmd.do("set label_color, black;")
cmd.do("set dash_gap, 0.2;")
cmd.do("set dash_width, 2.0;")
cmd.do("set dash_length, 0.2;")
cmd.do("set label_color, black;")
cmd.do("set dash_gap, 0.2;")
cmd.do("set dash_width, 2.0;")
cmd.do("set dash_length, 0.2;")
cmd.do("select carbon, element C;")
cmd.do("color yellow, carbon;")
cmd.do("disable carbon;")
cmd.do("set_view(-0.9,0.34,-0.26,0.33,0.18,-0.93,-0.27,-0.92,-0.28,-0.07,-0.23,-27.83,8.63,19.85,13.2,16.0,31.63,-20.0)")
${0}
endsnippet
snippet distance "H-bond distance between a H-bond donor and acceptor. Edit the name for the ditance, the selection criteria for atom 1, and the selection criteria for atom 2." b
cmd.do("# Edit the name for the ditance, the selection criteria for atom 1, and the selection criteria for atom 2.;")
cmd.do("distance ${1:dist3}, ${2:/rcsb074137//B/IOD`605/I`B}, ${3:/rcsb074137//B/IOD`605/I`A};")
${0}
endsnippet
snippet drawHbonds "Display H-bonds as dashes colored black." b
cmd.do("hide everything, hydrogens;")
cmd.do("hide labels;")
cmd.do("# set the color of the dashed lines representing the H-bond.;")
cmd.do("set dash_color, ${1:black};")
cmd.do("set dash_gap, 0.4;")
cmd.do("set dash_radius, 0.08;")
${0}
endsnippet
snippet carvedIsomesh "Carved isomesh representation of electron density." b
cmd.do("delete all;")
cmd.do("# Fetch the coordinates. Need internet connection.")
cmd.do("fetch ${1:4dgr}, async=0;")
cmd.do("# Fetch the electron density map.")
cmd.do("fetch ${1:4dgr}, type=2fofc,async=0;")
cmd.do("# create a selection out of the glycan")
cmd.do("select ${2:LongGlycan}, resi ${3:469:477};")
cmd.do("orient ${2:LongGlycan};")
cmd.do("remove not ${2:LongGlycan};")
cmd.do("remove name H*;")
cmd.do("isomesh 2fofcmap, ${1:4dgr}_2fofc, 1, ${2:LongGlycan}, carve = 1.8;")
cmd.do("color density, 2fofcmap; ")
cmd.do("show sticks;")
cmd.do("show spheres;")
cmd.do("set stick_radius, .07;")
cmd.do("set sphere_scale, .19;")
cmd.do("set sphere_scale, .13, elem H;")
cmd.do("set bg_rgb=[1, 1, 1];")
cmd.do("set stick_quality, 50;")
cmd.do("set sphere_quality, 4;")
cmd.do("color gray85, elem C;")
cmd.do("color red, elem O;")
cmd.do("color slate, elem N;")
cmd.do("color gray98, elem H;")
cmd.do("set stick_color, gray50;")
cmd.do("set ray_trace_mode, 1;")
cmd.do("set ray_texture, 2;")
cmd.do("set antialias, 3;")
cmd.do("set ambient, 0.5;")
cmd.do("set spec_count, 5;")
cmd.do("set shininess, 50;")
cmd.do("set specular, 1;")
cmd.do("set reflect, .1;")
cmd.do("set dash_gap, 0;")
cmd.do("set dash_color, black;")
cmd.do("set dash_gap, .15;")
cmd.do("set dash_length, .05;")
cmd.do("set dash_round_ends, 0;")
cmd.do("set dash_radius, .05;")
cmd.do("set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);")
cmd.do("preset.ball_and_stick(\"all\",mode=1);")
cmd.do("draw;")
${0}
endsnippet
snippet fetch2FoFcIsomesh "Fetch 2FoFc map as an isomesh." b
cmd.do("fetch ${1:3nd4}, ${1:3nd4}_2fofc, type=2fofc, async=0;")
cmd.do("isomesh 2fofcmap, ${1:3nd4}_2fofc, 1, ${1:3nd4}, carve = 1.8;")
${0}
endsnippet
snippet fetchCIF "Fetch the atomic coordinates as a cif file from the PDB." b
cmd.do("fetch ${1:3nd4}, type=cif, async=0;")
${0}
endsnippet
snippet fetchFoFc "Fetch fofc map from the PDB." b
cmd.do("fetch ${1:3nd4}, ${1:3nd4}_fofc, type=fofc, async=0;")
${0}
endsnippet
snippet filledRing "Filled rings in nucleic acids." b
cmd.do("show sticks;set cartoon_ring_mode, 3;")
cmd.do("set cartoon_ring_finder, 1;")
cmd.do("set cartoon_ladder_mode, 1;")
cmd.do("set cartoon_nucleic_acid_mode, 4;")
cmd.do("set cartoon_ring_transparency, 0.5;")
cmd.do("as cartoon;")
${0}
endsnippet
snippet hbonddash "Set up H-bond dashes." b
cmd.do("hide everything, hydrogens;")
cmd.do("hide labels;")
cmd.do("set dash_color, black; ")
cmd.do("set dash_gap, 0.4;")
cmd.do("set dash_radius, 0.08;")
${0}
endsnippet
snippet hidealtloc "Hide the partially occupied atoms with the part b alternate locator." b
cmd.do("select altconf, alt ${1:b} # select B alternative locators;")
cmd.do("hide everything, altconf # hide alt B locators;")
${0}
endsnippet
snippet labelResnResi "Label CA atom with single-letter residue name and residue number." b
cmd.do("label name ca, \"%s%s\" %(one_letter[${1:resn}],${2:resi});")
${0}
endsnippet
snippet labelSS "Label SS." b
cmd.do("alter ${1:chain A}, ss=\"${2:helix}\";")
cmd.do("label (%2),\"%3\";")
${0}
endsnippet
snippet loadPDBbs "Load PDB ball-and-stick." b
cmd.do("fetch ${1:3nd3},name=${1:3nd3}, type=pdb, async=0;")
cmd.do("hide (name H*);")
cmd.do("hide lines;")
cmd.do("show sticks;")
cmd.do("set stick_radius, ${2:1.2};")
cmd.do("set nb_sphere_radius, ${3:0.35};")
cmd.do("orient;")
${0}
endsnippet
snippet loadPDBnb "Load PDB nb spheres." b
cmd.do("fetch ${1:3nd3}, name=${1:3nd3}, type=pdb, async=0;")
cmd.do("orient;")
cmd.do("set stick_radius, ${2:1.2};")
cmd.do("hide (name H*);")
cmd.do("set nb_sphere_size, ${3:0.35};")
cmd.do("set nb_spheres_quality, ${4:1};")
cmd.do("show nb_spheres;")
${0}
endsnippet
snippet ms "Measure surface area of the selection with the msms_pymol.py script." b
cmd.do("fetch ${1:3nd3}, name=${1:3nd3}, type=pdb, async=0;")
cmd.do("select ${2:temp}, ${1:3nd3} and chain ${4:A};")
cmd.do("run ${5:/Users/blaine-mooers/Scripts/PyMOLScripts/msms_pymol.py};")
cmd.do("calc_msms_area ${2:temp};")
${0}
endsnippet
snippet molscriptRibbon "Show cartoon in the style of Molscript ribbons." b
cmd.do("set cartoon_highlight_color, grey;")
cmd.do("show cartoon;")
cmd.do("set cartoon_flat_sheets, 0;")
cmd.do("set cartoon_smooth_loops, 0;")
cmd.do("set cartoon_fancy_helices, 1;")
${0}
endsnippet
snippet oneLetter "Switch from three letter code to one-letter code for amino acids." b
cmd.do("one_leVer%={\"VAL\":\"V\",%\"ILE\":\"I\",%\"LEU\":\"L\",%\"GLU\":\"E\",%\"GLN\":\"Q\",\"ASP\":\"D\",%\"ASN\":\"N\",%\"HIS\":\"H\",%\"TRP\":\"W\",%\"PHE\":\"F\",%\"TYR\":\"Y\",%\"ARG\":\"R\",%\"LYS\":\"K\",%\"SER\":\"S\",%\"THR\":\"T\",%\"MET\":\"M\",%\"ALA\":\"A\",%\"GLY\":\"G\",%\"PRO\":\"P\",%\"CYS\":\"C\"}%")
${0}
endsnippet
snippet pseudolabel "Position label with pseudoatom." b
cmd.do("pseudoatom ${1:forLabel};")
cmd.do("label ${1:forLabel}, \"%0\";")
cmd.do("set label_color, ${2:red};")
${0}
endsnippet
snippet rotate "Rotate a selection about and axis by a given angle." b
cmd.do("rotate ${1:x}, ${2:45}, ${3:pept};")
${0}
endsnippet
snippet stereoDraw "Stereo draw." b
cmd.do("stereo walleye; ")
cmd.do("set ray_shadow, off; ")
cmd.do("#draw 3200,2000;")
cmd.do("draw ${1:1600,1000}; ")
cmd.do("png ${2:aaa}.png;")
${0}
endsnippet
snippet stereoRay "Stereo ray." b
cmd.do("stereo; ")
cmd.do("set ray_shadow, off;")
cmd.do("ray ${1:2400,1200};")
cmd.do("png ${2:aaa}.png;")
${0}
endsnippet
snippet loadThreeMaps "Three electron density as Isomesh." b
cmd.do("load ${1:4dgr}.pdb;")
cmd.do("# Make sure to rename map file so that;")
cmd.do("# the root filename differs from pdb root filename;")
cmd.do("load ${1:4dgr}_2fofc.ccp4, 2fofc;")
cmd.do("load ${1:4dgr}_fofc.ccp4, fofc;")
cmd.do("select ${2:glycan}, resid 200 or (resid 469:477);")
cmd.do("isomesh ${3:mesh1}, 2fofc, 1.0, ${2:glycan};")
cmd.do("color density, ${3:mesh1};")
cmd.do("isomesh ${4:mesh2}, fofc, 3.0, ${2:glycan};")
cmd.do("color green, ${4:mesh2};")
cmd.do("isomesh ${5:mesh3}, fofc, -3.0, ${2:glycan};")
cmd.do("color red, ${5:mesh3};")
${0}
endsnippet
snippet turnAboutAxis "Turn about axis." b
cmd.do("turn ${1:x},${2:90};")
${0}
endsnippet
snippet volumeRamp "Volume ramp." b
cmd.volume_ramp_new("ramp_magenta", [0.01, 1.00, 0.00, 1.00, 0.00, 4.01, 1.00, 0.00, 1.00, 0.10, 4.99, 1.00, 0.00, 1.00, 0.50,])${0}
endsnippet
snippet solventRadius "Set radius of ball used to make solvent accessible surface." b
cmd.do("set solvent_radius, ${1:1.55};")
${0}
endsnippet
snippet rv "Return settings in rounded format." b
cmd.do("run roundview.py;")
${0}
endsnippet
snippet spse "Save session file (*.pse) with timestamp." b
cmd.do("python;")
cmd.do("import datetime;")
cmd.do("from pymol import cmd; ")
cmd.do("DT =datetime.datetime.now().strftime(\"yr%Ymo%mday%dhr%Hmin%M\");")
cmd.do("s = str(DT); ")
cmd.do("cmd.save(stemName+s+\".pse\"); ")
cmd.do("python end;")
${0}
endsnippet
snippet sc222 "Run supercell script to generate three cells in all directions. This script was written by Thomas Holder." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 2, 2, 2, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet pearl "The pearl effect is made with two spheres with the outer sphere being transparent." b
cmd.do("create ${1:sodium2}, ${2:sodium1};")
cmd.do("set sphere_transparency, 0.4, ${1:sodium2};")
cmd.do("set sphere_scale, 1.05, ${1:sodium2};")
cmd.do("ray;")
${0}
endsnippet
snippet fog "Blur the background atoms." b
cmd.do("set fog, 0;")
${0}
endsnippet
snippet rmwater "Remove waters from molecular object." b
cmd.do("remove resn HOH;")
${0}
endsnippet
snippet setcolor "Set color name to a RGB code." b
cmd.do("set_color ${1:bark}, [${2:0.1, ${3:0.1}, ${4:0.1}];")
cmd.do("color ${1:bark}, ${5:protein};")
${0}
endsnippet
snippet duplicateObject "Duplicate object. Create an object with the first argument using the selection, which is the second argument." b
cmd.do("create ${1:t4l}, ${2:1lw9};")
${0}
endsnippet
snippet selectChain "Select a chain." b
cmd.do("select ${1:rna}, ${2:chain B};")
${0}
endsnippet
snippet selectResidues "Select residues by name." b
cmd.do("select aromatic, resn phe+tyr+trp;")
${0}
endsnippet
snippet selectResi "Select residues by a range of numbers." b
cmd.do("select ${!:se}; resi ${2: 1:100};")
${0}
endsnippet
snippet selectElement "Select atoms by element." b
cmd.do("select ${1:oxygen}, elem ${2:O};")
${0}
endsnippet
snippet selectName "Select atoms by name." b
cmd.do("select ${1:oxygen2}, name ${2:O2};")
${0}
endsnippet
snippet selectHelices "Select atoms by alpha helices." b
cmd.do("select ${1:helices}, ss h; ")
${0}
endsnippet
snippet selectStrands "Select atoms by beta strands." b
cmd.do("select ${1:strands}, ss s; ")
${0}
endsnippet
snippet selectLoops "Select atoms by beta loops." b
cmd.do("select ${1:loops}, ss l;")
${0}
endsnippet
snippet selectAllBut "Select all nitrogen atom in a selelction except from lysine." b
cmd.do("select ${1:select1}, elem ${2:N} and chain ${3:A} and not resn ${4:LYS};")
${0}
endsnippet
snippet selectAtomsAround "Select atoms within a radius around a ligand." b
cmd.do("select ${1:nearby}, resn ${2:drug} around ${3:5};")
${0}
endsnippet
snippet selectResiduesAround "Select residues within a radius around a ligand." b
cmd.do("select ${1:nearby}, br. resn ${2:drug} around ${3:5};")
${0}
endsnippet
snippet undoSelection "Undo a selection." b
cmd.do("disable ${1:sele}; ")
${0}
endsnippet
snippet loadPDBfile "Load a pdb file in the current directory." b
cmd.do("load ${1:my}.pdb;")
${0}
endsnippet
snippet savePNG "Save a png file of current scene to the current directory. PyMOL writes out only png files. This file may need to be converted to a tiff file. See the png2tiff snippet for a bash script that converts all png files in a folder into tiff files. 1: png filename. 2: x-dimension in pixels. 3: y-dimension in pixels, 1600 x 1000 approximates the golden ratio. Usually want a square for multipanel figures..4: dots per inch. 5: ray tracing off, 0; ray tracing on, 1 should also consider image without ray tracing shadows. " b
cmd.do("png ${1:saveMe}.png, ${2:1920}, ${3:1920}, ${4:600}, ${5:1};")
${0}
endsnippet
snippet ringMode "Set the ring mode to a value between 0 and 6 in cartoons of nucleic acids." b
cmd.do("show cartoon, ${1:rna}; set cartoon_ring_mode, ${2:3};")
${0}
endsnippet
snippet sidehChainHelper "In cartoons, hide the backbone atoms of selected residues when showing then as sticks." b
cmd.do("set cartoon_side_chain_helper, on;")
${0}
endsnippet
snippet extractPartObj "Create a new object from part of an existing object." b
cmd.do("extract new_obj, chain A;")
${0}
endsnippet
snippet puttyCartoon "Create a putty cartoon. The command may be needed if the above setting does not work. This can happen if using the presets. The command below may be needed if the above setting does not work.This can happen if using the presets. The command below may be needed if the above setting does not work. This can happen if using the presets." b
cmd.do("show cartoon;")
cmd.do("cartoon putty;")
cmd.do("set cartoon_smooth_loops, 0;")
cmd.do("set cartoon_flat_sheets, 0;")
cmd.do("set cartoon_smooth_loops,0;")
cmd.do("## unset cartoon_smooth_loops;")
${0}
endsnippet
snippet hideSelection "Turn off magenta squares on current selection." b
cmd.do("indicate none")
${0}
endsnippet
snippet discreteCartoonColoring "Turn on discrete colors between secondary structure elements." b
cmd.do("set cartoon_discrete_colors, on;")
${0}
endsnippet
snippet sc111 "Display all symmetry mates in one unit cell. Uses supercell.py in $HOME/Scripts/PyMOLscripts/. Change to your path to supercell.py." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 1, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet saxsEnvelope "Display SAXS envelope. Edit to enter the name of the bead model object." b
cmd.do("alter ${1:refine_A_Ave_SM_015_0_370-374-0r}, vdw=3.0;")
cmd.do("set solvent_radius = 3.0;")
${0}
endsnippet
snippet setpath "Set additional path for PyMOL to search on startup." b
os.environ["PATH"] += os.pathsep +${1: "~/ATSAS-3.0.3-1/bin"};${0}
endsnippet
snippet fetchPath "Set path for location to save fetched pdb files." b
cmd.do("set fetch_path, ${1:/Users/blaine/pdbFiles};")
${0}
endsnippet
snippet antialias "Set antialias to on to get smoother edges." b
cmd.do("set antialias, 1;")
${0}
endsnippet
snippet sigDigits "Set number of decimals places to show in distance labels." b
cmd.do("set label_distance_digits, ${1:2};")
cmd.do("set label_angle_digits, ${2:2};")
${0}
endsnippet
snippet labelCAs "Label the CA atoms with the Ala333 style format." b
cmd.do("label name CA,\"%s%s\" % (resn,resi);")
${0}
endsnippet
snippet labelWatersHOH "Label waters with HOH and their residue number." b
cmd.do("label resn HOH ,\"%s%s\" % (resn,resi);")
${0}
endsnippet
snippet labelWatersW "Label waters with W and their reisude number." b
cmd.do("label resn HOH ,\"W%s\" % (resi);")
${0}
endsnippet
snippet findHbonds "Find H-bonds around a residue." b
cmd.do("remove element h; distance hbonds, all, all, 3.2, mode=2;")
${0}
endsnippet
snippet printBs "Print the B-factors of a residue." b
cmd.do("remove element h; iterate resi ${1: 1:13}, print(resi, name,b);")
${0}
endsnippet
snippet labelMainChain "Label the main chain atoms with the following: resn,resi,atom name." b
cmd.do("label name n+c+o+ca,\"%s%s%s\" % (resn,resi,name);")
${0}
endsnippet
snippet printBspartB "Print B factors of part B of a residue." b
cmd.do("iterate resi ${1:38} and altloc ${2:B}, print resi, name, alt, b;")
${0}
endsnippet
snippet printBs2digits "Print B--factors for a residue with the B-factors rounded off to two decimal places." b
cmd.do("iterate (resi ${1:133}), print(name + \" %.2f\" % b);")
${0}
endsnippet
snippet writeCommandReference2HTML "Write the command reference to html file in the present working directory. " b
cmd.write_html_ref("pymol-command-ref.html");${0}
endsnippet
snippet averageB "Average the B-factors by using a regular list as opposed to a stored list in PyMOL. Edit the selection as needed. " b
cmd.do("Bfactors = []; ")
cmd.do("# >>> edit the selection below, which is a range of residue numbers here.;")
cmd.do("iterate (resi ${1:133}), Bfactors.append(b);")
cmd.do("print(\"Sum = \", \"%.2f\" % (sum(Bfactors)));")
cmd.do("print(\"Number of atoms = \", len(Bfactors));")
cmd.do("print( \"Average B =\" , \"%.2f\" % ( sum(Bfactors)/float(len(Bfactors))));")
${0}
endsnippet
snippet printNameB4ResiX "Print name and b-factor for a residue." b
Bfac_dict = { "Bfactors3" : [] };
cmd.iterate("(${1:resi 133})","Bfactors3.append((name, b))", space=Bfac_dict);
[print("%s %.2f" % (i,j)) for i,j in Bfac_dict["Bfactors3"];${0}
endsnippet
snippet printResiResnNameB4ResiX "Print resn, resi, atom name, and b-factor. " b
Bfac_dict = { "Bfactors3" : [] };
cmd.iterate("(${1:resi 133})","Bfactors3.append((resn,resi,name, b))", space=Bfac_dict);
[print("%s %s %s %.2f" % (i,j,k,l)) for i,j,k,l in Bfac_dict["Bfactors3"]]${0}
endsnippet
snippet printResiResnNameB4ResiXNoH "Print name and b-factor for a residue or residue range (e.g. 81:120). The noH variant." b
Bfac_dict = { "Bfactors3" : [] };
cmd.iterate("(${1:resi 133} and not elem H)","Bfactors3.append((resn,resi,name, b))", space=Bfac_dict);
[print("%s %s %s %.2f" % (i,j,k,l))for i,j,k,l in Bfac_dict["Bfactors3"]];${0}
endsnippet
snippet internalGUImode2 "Make the background of the internal gui transparent to expand viewport." b
cmd.do("internal_gui_mode=2;")
${0}
endsnippet
snippet internalGUIwidth "Set the width of the internal gui. Set to 0 to make the internal gui vanish." b
cmd.do("set internal_gui_width=${1:0};")
${0}
endsnippet
snippet printDoc "Print document string of a function." b
print(${1:my_func}.__doc__);${0}
endsnippet
snippet his31asp70 "Display the famous Asp70-His31 salt-bridge from T4 lysozyme that contributes3-5 kcal/mol to protein stability. " b
cmd.do("fetch ${1:1lw9}, async=0; ")
cmd.do("zoom (${2:resi 31 or resi 70}); ")
cmd.do("preset.technical(selection=\"all\"); ")
cmd.do("bg_color ${3:gray70}; ")
cmd.do("clip slab, 7,(${4:resi 31 or resi 70});")
cmd.do("rock;")
${0}
endsnippet
snippet waterTriple "Examples of a triple water pentagon. Zoom in on the selection. Edit by changing the residue number." b
cmd.do("fetch ${1:lw9}, async=0; ")
cmd.do("zoom resi ${2:313}; ")
cmd.do("preset.technical(selection=\"all\", mode=1);")
${0}
endsnippet
snippet ligandSelect "Make selection of ligand atoms." b
cmd.do("select ${1:ligand}, organic;")
${0}
endsnippet
snippet github "Print url of README.md file of the pymolsnips repository." b
cmd.do("https://github.com/MooersLab/pymolsnips/blob/master/README.md")
${0}
endsnippet
snippet sigdihedral "Set dihedral labels to display 2 decimals places to the right of the decimal point." b
cmd.do("set label_dihedral_digits, ${1:2};")
${0}
endsnippet
snippet stateOne "Select state 1 from a model with multiple states." b
cmd.create("newobject", "oldobject", "1", "1");${0}
endsnippet
snippet sc112 "Display all symmetry mates in two unit cells along the c axis. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 1, 2, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc113 "Display all symmetry mates in three unit cels along c. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 1, 3, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc311 "Display all symmetry mates three three unit cells along a. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 3, 1, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc131 "Display all symmetry mates in three unit cells along b. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 3, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc211 "Display all symmetry mates in two unit cell along a. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 2, 1, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc121 "Display all symmetry mates in two unit cells along the b axis. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 2, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc122 "Display all symmetry mates in a 1 x 2 x 2 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 2, 2, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc221 "Display all symmetry mates in 2 x 2 x 1 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 2, 2, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc212 "Display all symmetry mates in a 2 x 1 x 2 arrays of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 2, 1, 2, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc133 "Display all symmetry mates in 1 x 3 x 3 array of unit cell. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 3, 3, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc313 "Display all symmetry mates in a 3 x 1 x 3 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 3, 1, 3, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc331 "Display all symmetry mates in 3 x 3 x 1 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 3, 3, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc233 "Display all symmetry mates in a 2 x 3 x 3 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 2, 3, 3, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc323 "Display all symmetry mates in a 3 x 2 x 3 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 1, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc332 "Display all symmetry mates in 3 x 3 x 2 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 3, 3, 2, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc333 "Display all symmetry mates in 3 x 3 x 3 array of unit cells. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 3, 3, 3, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc114 "Display all symmetry mates in four unit cells stacked long c-axis. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 1, 4, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc141 "Display all symmetry mates in four unit cells stacked long b-axis. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 1, 4, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sc411 "Display all symmetry mates in four unit cells stacked long a-axis. Uses supercell.py in $HOME/Scripts/PyMOLscripts/." b
cmd.do("run $HOME/${1:Scripts/PyMOLscripts/}supercell.py;")
cmd.do("supercell 4, 1, 1, , ${2:orange}, ${3:supercell1}, 1;")
${0}
endsnippet
snippet sccp4 "Save electron density map flle with timestamp." b
cmd.do("python;")
cmd.do("import datetime;")
cmd.do("from pymol import cmd; ")
cmd.do("DT =datetime.datetime.now().strftime(\"yr%Ymo%mday%dhr%Hmin%M\");")
cmd.do("s = str(DT); ")
cmd.do("cmd.save(stemName+s+\".ccp4\"); ")
cmd.do("python end;")
${0}
endsnippet
snippet sdae "Save dae file with timestamp." b
import datetime;
DT =datetime.datetime.now().strftime("yr%Ymo%mday%dhr%Hmin%M");
s = str(DT);
cmd.save(stemName+s+".dae");
${0}
endsnippet
snippet carvedIsosurface "Carved isosurface representation of electron density." b
cmd.do("delete all;")
cmd.do("# Fetch the coordinates. Need internet connection.;")
cmd.do("fetch ${1:4dgr}, async=0;")
cmd.do("# Fetch the electron density map.;")
cmd.do("fetch ${1:4dgr}, type=2fofc,async=0;")
cmd.do("# create a selection out of the glycan;")
cmd.do("select ${2:LongGlycan}, resi ${3:469:477};")
cmd.do("orient ${2:LongGlycan};")
cmd.do("remove not ${2:LongGlycan};")
cmd.do("remove name H*;")
cmd.do("isosurface 2fofcmap, ${1:4dgr}_2fofc, 1, ${2:LongGlycan}, carve = 1.8;")
cmd.do("color density, 2fofcmap; ")
cmd.do("show sticks;")
cmd.do("show spheres;")
cmd.do("set stick_radius, .07;")
cmd.do("set sphere_scale, .19;")
cmd.do("set sphere_scale, .13, elem H;")
cmd.do("set bg_rgb=[1, 1, 1];")
cmd.do("set stick_quality, 50;")
cmd.do("set sphere_quality, 4;")
cmd.do("color gray85, elem C;")
cmd.do("color red, elem O;")
cmd.do("color slate, elem N;")
cmd.do("color gray98, elem H;")
cmd.do("set stick_color, gray50;")
cmd.do("set ray_trace_mode, 1;")
cmd.do("set ray_texture, 2;")
cmd.do("set antialias, 3;")
cmd.do("set ambient, 0.5;")
cmd.do("set spec_count, 5;")
cmd.do("set shininess, 50;")
cmd.do("set specular, 1;")
cmd.do("set reflect, .1;")
cmd.do("set dash_gap, 0;")
cmd.do("set dash_color, black;")
cmd.do("set dash_gap, .15;")
cmd.do("set dash_length, .05;")
cmd.do("set dash_round_ends, 0;")
cmd.do("set dash_radius, .05;")
cmd.do("set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);")
cmd.do("preset.ball_and_stick(\"all\",mode=1);")
cmd.do("draw;")
${0}
endsnippet
snippet fetch2FoFcIsosurface "Fetch 2FoFc map as an isosurface. Edit the PDB-ID code. Use lowercase letter for the fifth character to select a single chain. Render and display a contour of this map as a chicken wire representation." b
cmd.do("fetch ${1:3nd4}, ${1:3nd4}_2fofc, type=2fofc, async=0;")
cmd.do("isosurface 2fofcmap, ${1:3nd4}_2fofc, 1, ${1:3nd4}, carve = 1.8;")
${0}
endsnippet
snippet threeMapsIsosurface "Display three electron density maps as isosurfaces." b
cmd.do("load ${1:4dgr}.pdb;")
cmd.do("# Make sure to rename map file so that ;")
cmd.do("# the root filename differs from pdb root filename;")
cmd.do("load ${1:4dgr}_2fofc.ccp4, 2fofc;")
cmd.do("load ${1:4dgr}_fofc.ccp4, fofc;")
cmd.do("select ${2:glycan}, ${3:resid 200 or (resid 469:477)};")
cmd.do("isosurface ${4:mesh1}, 2fofc, 1.0, ${2:glycan};")
cmd.do("color density, ${4:mesh1};")
cmd.do("isosurface ${5:mesh2}, fofc, 3.0, ${2:glycan};")
cmd.do("color green, ${5:mesh2};")
cmd.do("isosurface ${6:mesh3}, fofc, -3.0, ${2:glycan};")
cmd.do("color red, ${6:mesh3};")
${0}
endsnippet
snippet carvedVolume "Carved volume representation of electron density." b
cmd.do("delete all;")
cmd.do("# Fetch the coordinates. Need internet connection.;")
cmd.do("fetch ${1:4dgr}, async=0;")
cmd.do("# Fetch the electron density map.;")
cmd.do("fetch ${1:4dgr}, type=2fofc,async=0;")
cmd.do("# create a selection out of the glycan;")
cmd.do("select ${2:LongGlycan}, resi ${3:469:477};")
cmd.do("# oreint the long axes of the object along the x-axis;")
cmd.do("orient ${2:LongGlycan};")
cmd.do("# remove everything except the glycan;")
cmd.do("remove not ${2:LongGlycan};")
cmd.do("# remove the remaining hydrogen atoms;")
cmd.do("remove name H*;")
cmd.do("# show the electron density map as a surface.")
cmd.do("surface 2fofcmap, ${1:4dgr}_2fofc, 1, ${2:LongGlycan}, carve = 1.8;")
cmd.do("color density, 2fofcmap; ")
cmd.do("show sticks;")
cmd.do("show spheres;")
cmd.do("set stick_radius, .07;")
cmd.do("set sphere_scale, .19;")
cmd.do("set sphere_scale, .13, elem H;")
cmd.do("set bg_rgb=[1, 1, 1];")
cmd.do("set stick_quality, 50;")
cmd.do("# make the spheres smooth with larger settings.;")
cmd.do("set sphere_quality, 4;")
cmd.do("# gray85 is off-white, gray0 is black;")
cmd.do("color gray85, elem C;")
cmd.do("color red, elem O;")
cmd.do("color slate, elem N;")
cmd.do("color gray98, elem H;")
cmd.do("set stick_color, gray50;")
cmd.do("set ray_trace_mode, 1;")
cmd.do("set ray_texture, 2;")
cmd.do("set antialias, 3;")
cmd.do("set ambient, 0.5;")
cmd.do("set spec_count, 5;")
cmd.do("set shininess, 50;")
cmd.do("set specular, 1;")
cmd.do("set reflect, .1;")
cmd.do("set dash_gap, 0;")
cmd.do("set dash_color, black;")
cmd.do("set dash_gap, .15;")
cmd.do("set dash_length, .05;")
cmd.do("set dash_round_ends, 0;")
cmd.do("set dash_radius, .05;")
cmd.do("set_view (0.34,-0.72,0.61,0.8,0.56,0.22,-0.51,0.4,0.77,0.0,0.0,-81.31,44.64,-9.02,58.62,65.34,97.28,-20.0);")
cmd.do("preset.ball_and_stick(\"all\",mode=1);")
cmd.do("draw;")
${0}
endsnippet
snippet fetch2FoFcVolume "Fetch 2FoFc map as a volume." b
cmd.do("fetch ${1:3nd4}, type=cif, async=0;")
cmd.do("fetch ${1:3nd4}, {1:3nd4}_2fofc, type=2fofc, async=0;")
cmd.do("# Render and display a contour of this map as a volume around a selection called LongGlycan.;")
cmd.do("volume 2fofcmap, ${1:3nd4}_2fofc, 1, ${2:LongGlycan}, carve = 1.8;")
${0}
endsnippet