1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
21   
22   
23  """The Molmol macro methods of the specific API for model-free analysis.""" 
24   
25   
26  from specific_fns.model_free.macro_base import Macro 
27   
28   
30      """Class containing the Molmol specific functions for model-free analysis.""" 
31   
33          """Colour the given peptide bond.""" 
34   
35           
36          self.commands.append("SelectBond 'atom1.name = \"CA\"  & atom2.name = \"C\" & res.num = " + repr(res_num-1) + "'") 
37          self.commands.append("StyleBond neon") 
38          self.commands.append("RadiusBond " + repr(width)) 
39          self.commands.append("ColorBond " + repr(rgb_array[0]) + " " + repr(rgb_array[1]) + " " + repr(rgb_array[2])) 
40   
41           
42          self.commands.append("SelectBond 'atom1.name = \"C\"  & atom2.name = \"N\" & res.num = " + repr(res_num-1) + "'") 
43          self.commands.append("StyleBond neon") 
44          self.commands.append("RadiusBond " + repr(width)) 
45          self.commands.append("ColorBond " + repr(rgb_array[0]) + " " + repr(rgb_array[1]) + " " + repr(rgb_array[2])) 
46   
47           
48          self.commands.append("SelectBond 'atom1.name = \"N\"  & atom2.name = \"CA\" & res.num = " + repr(res_num) + "'") 
49          self.commands.append("StyleBond neon") 
50          self.commands.append("RadiusBond " + repr(width)) 
51          self.commands.append("ColorBond " + repr(rgb_array[0]) + " " + repr(rgb_array[1]) + " " + repr(rgb_array[2])) 
52   
53           
54          self.commands.append("") 
 55   
56   
58          """Create the header for the molmol macro.""" 
59   
60           
61          self.commands.append("SelectBond ''") 
62          self.commands.append("StyleBond invisible") 
63   
64           
65          self.commands.append("SelectBond 'bb'") 
66          self.commands.append("StyleBond line") 
67   
68           
69          self.commands.append("ColorBond 0 0 0") 
 70   
71   
72 -    def molmol_macro(self, data_type, style=None, colour_start=None, colour_end=None, colour_list=None, spin_id=None): 
 73          """Wrapper method for the create_macro method. 
74   
75          @param data_type:       The parameter name or data type. 
76          @type data_type:        str 
77          @keyword style:         The Molmol style. 
78          @type style:            None or str 
79          @keyword colour_start:  The starting colour (must be a MOLMOL or X11 name). 
80          @type colour_start:     str 
81          @keyword colour_end:    The ending colour (must be a MOLMOL or X11 name). 
82          @type colour_end:       str 
83          @keyword colour_list:   The colour list used, either 'molmol' or 'x11'. 
84          @type colour_list:      str 
85          @keyword spin_id:       The spin identification string. 
86          @type spin_id:          str 
87          """ 
88   
89          self.create_macro(data_type, style=style, colour_start=colour_start, colour_end=colour_end, colour_list=colour_list, spin_id=spin_id) 
  90