1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """The model-free PyMOL macro module."""
25
26
27 from specific_fns.model_free.macro_base import Macro
28
29
31 """Class containing the Pymol specific functions for model-free analysis."""
32
34 """Colour the given peptide bond."""
35
36
37 self.commands.append("")
38
39
40 colour_name = 'pept_colour_%i' % res_num
41 self.commands.append("set_color %s, [%s, %s, %s]" % (colour_name, rgb_array[0], rgb_array[1], rgb_array[2]))
42
43
44 self.commands.append("select pept_bond, (name ca,n and resi %i) or (name ca,c and resi %i)" % (res_num, res_num-1))
45 self.commands.append("as sticks, pept_bond")
46 self.commands.append("set_bond stick_radius, %s, pept_bond" % width)
47 self.commands.append("set_bond stick_color, %s, pept_bond" % colour_name)
48
49
50 self.commands.append("delete pept_bond")
51
52
54 """Create the header for the pymol macro."""
55
56
57 self.commands.append("hide")
58
59
60 self.commands.append("select bb, (name ca,n,c)")
61 self.commands.append("show lines, bb")
62
63
64 self.commands.append("color black, bb")
65
66
67 self.commands.append("delete bb")
68
69
70 self.commands.append("bg_color white")
71
72
73 - def pymol_macro(self, data_type, style=None, colour_start=None, colour_end=None, colour_list=None, spin_id=None):
74 """Wrapper method for the create_macro method.
75
76 @param data_type: The parameter name or data type.
77 @type data_type: str
78 @keyword style: The Molmol style.
79 @type style: None or str
80 @keyword colour_start: The starting colour (must be a MOLMOL or X11 name).
81 @type colour_start: str
82 @keyword colour_end: The ending colour (must be a MOLMOL or X11 name).
83 @type colour_end: str
84 @keyword colour_list: The colour list used, either 'molmol' or 'x11'.
85 @type colour_list: str
86 @keyword spin_id: The spin identification string.
87 @type spin_id: str
88 """
89
90 self.create_macro(data_type, style=style, colour_start=colour_start, colour_end=colour_end, colour_list=colour_list, spin_id=spin_id)
91