-
Notifications
You must be signed in to change notification settings - Fork 7
/
marshmallows.py
50 lines (43 loc) · 1.46 KB
/
marshmallows.py
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
from pymol import cmd
count = 0
def marshmallows_one(sel, col, name, resl=1):
global count
count += 1
cmd.delete('map%i' % count)
cmd.delete('surf%i' % count)
cmd.do("remove hydro")
cmd.do("bg_color white")
#cmd.do("hide everything")
cmd.do("set surface_quality, 1")
cmd.do("alter all, b=50")
cmd.do("alter all, q=1")
cmd.do("set gaussian_resolution,10")
cmd.do("map_new map%i, gaussian, %i, (%s and name CA), 10" % (count, resl, sel))
cmd.do("isosurface %s, map%i" % (name, count))
cmd.do("color %s, %s" % (col, name))
cmd.do("set antialias, 2")
cmd.do("set ray_trace_gain, 0.4")
cmd.do("set ray_shadows, 0")
cmd.do("set specular, 0")
cmd.do("show surface, %s" % name)
def marshmallows(sel):
cmd.delete("surf*")
cmd.delete("map*")
COLs = ("green", "cyan", "magenta", "yellow", "pink")
COLs = COLs + COLs + COLs
cmd.do("remove hydro")
cmd.do("bg_color white")
cmd.do("hide everything")
cmd.do("set surface_quality, 1")
cmd.do("alter all, b=50")
cmd.do("alter all, q=1")
cmd.do("set gaussian_resolution,10")
for i, c in enumerate(cmd.get_chains(sel)):
cmd.do("map_new map%s, gaussian, 1, (%s and chain %s), 10" % (c, sel, c))
cmd.do("isosurface surf%s, map%s" % (c, c))
cmd.do("color %s, surf%s" % (COLs[i % 2], c))
cmd.do("set antialias, 2")
cmd.do("set ray_trace_gain, 0.4")
cmd.do("set ray_shadows, 0")
cmd.do("set specular, 0")
cmd.do("show surface, surf*")