1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 from math import pi
25 from re import match
26 from types import DictType, ListType
27
28
29
30
31
34 """Class containing all the program data."""
35
36
37
38 self.h = 6.62606876e-34
39 self.h_bar = self.h / ( 2.0*pi )
40 self.mu0 = 4.0 * pi * 1e-7
41
42
43 self.pdb = SpecificData()
44
45
46 self.diff = SpecificData()
47
48
49 self.res = Residue()
50
51
52 self.run_names = []
53
54
55 self.run_types = []
56
57
58 self.chi2 = {}
59 self.iter = {}
60 self.f_count = {}
61 self.g_count = {}
62 self.h_count = {}
63 self.warning = {}
64
65
66
68 text = "The data class containing all permanent program data.\n"
69 text = text + "The class contains the following objects:\n"
70 for name in dir(self):
71 if match("^__", name):
72 continue
73 text = text + " " + name + ", " + `type(getattr(self, name))` + "\n"
74 return text
75
76
77
78
79
80
83 """Empty data container."""
84
85
87
88 text = "%-25s%-100s\n\n" % ("Data structure", "Value")
89
90
91 for name in dir(self):
92 if match("^__", name):
93 continue
94 text = text + "%-25s%-100s\n" % (name, `getattr(self, name)`)
95
96
97 return text
98
99
100
101
102
105 """Dictionary type class for specific data."""
106
107
109 text = "Data:\n"
110 if len(self) == 0:
111 text = text + " {}\n"
112 else:
113 i = 0
114 for key in self.keys():
115 if i == 0:
116 text = text + " { "
117 else:
118 text = text + " , "
119 text = text + "Key " + `key` + ":\n"
120 for name in dir(self[key]):
121 if match("^__", name):
122 continue
123 text = text + " " + name + ", " + `type(getattr(self[key], name))` + "\n"
124 i = i + 1
125 text = text + " }\n"
126
127 return text
128
129
131 """Function for adding an empty container to the dictionary."""
132
133 self[key] = Element()
134
135
136
137
138
139
142 """Class containing all the residue specific data."""
143
144
146 text = "Class containing all the residue specific data.\n\n"
147
148
149 if not len(self):
150 text = text + "The class contains no data.\n"
151
152
153 else:
154 text = text + "The residue container contains the following keys:\n"
155 for key in self:
156 text = text + " " + `key` + "\n"
157 text = text + "\nThese can be accessed by typing 'self.relax.data.res[key]'.\n"
158
159 return text
160
161
163 """Function for adding an empty container to the dictionary."""
164
165 self[key] = ResidueList()
166
167
170 """Empty data container for residue specific data."""
171
172
174 text = "Sequence data.\n\n"
175 text = text + "%-8s%-8s%-8s%-10s" % ("Index", "Number", "Name", "Selected") + "\n"
176 for i in xrange(len(self)):
177 text = text + "%-8i%-8i%-8s%-10i" % (i, self[i].num, self[i].name, self[i].select) + "\n"
178 text = text + "\nThese can be accessed by typing 'self.relax.data.res[key][index]'.\n"
179 return text
180
181
183 """Function for appending an empty container to the list."""
184
185 self.append(Element())
186