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 os import sep
25
26
27 from base_classes import SystemTestCase
28 from data import Relax_data_store; ds = Relax_data_store()
29 from status import Status; status = Status()
30
31
33 """Class for testing the sequence functions."""
34
40
41
43 """Load all aspartic acid atoms from the single residue in a loaded protein PDB file."""
44
45
46 self.interpreter.structure.read_pdb(file='Ap4Aase_res1-12.pdb', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures', read_model=1)
47
48
49 self.interpreter.structure.load_spins(spin_id=':ASP')
50
51
52 self.assertEqual(len(cdp.mol), 1)
53 self.assertEqual(cdp.mol[0].name, 'Ap4Aase_res1-12_mol1')
54 self.assertEqual(len(cdp.mol[0].res), 1)
55
56
57 self.assertEqual(cdp.mol[0].res[0].num, 7)
58 self.assertEqual(cdp.mol[0].res[0].name, 'ASP')
59 self.assertEqual(len(cdp.mol[0].res[0].spin), 12)
60 self.assertEqual(cdp.mol[0].res[0].spin[0].num, 91)
61 self.assertEqual(cdp.mol[0].res[0].spin[0].name, 'N')
62 self.assertEqual(cdp.mol[0].res[0].spin[1].num, 92)
63 self.assertEqual(cdp.mol[0].res[0].spin[1].name, 'H')
64 self.assertEqual(cdp.mol[0].res[0].spin[2].num, 93)
65 self.assertEqual(cdp.mol[0].res[0].spin[2].name, 'CA')
66 self.assertEqual(cdp.mol[0].res[0].spin[3].num, 94)
67 self.assertEqual(cdp.mol[0].res[0].spin[3].name, 'HA')
68 self.assertEqual(cdp.mol[0].res[0].spin[4].num, 95)
69 self.assertEqual(cdp.mol[0].res[0].spin[4].name, 'CB')
70 self.assertEqual(cdp.mol[0].res[0].spin[5].num, 96)
71 self.assertEqual(cdp.mol[0].res[0].spin[5].name, '1HB')
72 self.assertEqual(cdp.mol[0].res[0].spin[6].num, 97)
73 self.assertEqual(cdp.mol[0].res[0].spin[6].name, '2HB')
74 self.assertEqual(cdp.mol[0].res[0].spin[7].num, 99)
75 self.assertEqual(cdp.mol[0].res[0].spin[7].name, 'CG')
76 self.assertEqual(cdp.mol[0].res[0].spin[8].num, 100)
77 self.assertEqual(cdp.mol[0].res[0].spin[8].name, 'OD1')
78 self.assertEqual(cdp.mol[0].res[0].spin[9].num, 101)
79 self.assertEqual(cdp.mol[0].res[0].spin[9].name, 'OD2')
80 self.assertEqual(cdp.mol[0].res[0].spin[10].num, 102)
81 self.assertEqual(cdp.mol[0].res[0].spin[10].name, 'C')
82 self.assertEqual(cdp.mol[0].res[0].spin[11].num, 103)
83 self.assertEqual(cdp.mol[0].res[0].spin[11].name, 'O')
84
85
87 """Load the glycine backbone amide N and Ca spins from a loaded protein PDB file."""
88
89
90 self.interpreter.structure.read_pdb(file='Ap4Aase_res1-12.pdb', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures', read_model=1)
91
92
93 self.interpreter.structure.load_spins(spin_id=':GLY@N')
94
95
96 self.interpreter.structure.load_spins(spin_id=':GLY@CA')
97
98
99 self.assertEqual(len(cdp.mol), 1)
100 self.assertEqual(cdp.mol[0].name, 'Ap4Aase_res1-12_mol1')
101 self.assertEqual(len(cdp.mol[0].res), 3)
102
103
104 self.assertEqual(cdp.mol[0].res[0].num, 1)
105 self.assertEqual(cdp.mol[0].res[0].name, 'GLY')
106 self.assertEqual(len(cdp.mol[0].res[0].spin), 2)
107 self.assertEqual(cdp.mol[0].res[0].spin[0].num, 1)
108 self.assertEqual(cdp.mol[0].res[0].spin[0].name, 'N')
109 self.assertEqual(cdp.mol[0].res[0].spin[1].num, 2)
110 self.assertEqual(cdp.mol[0].res[0].spin[1].name, 'CA')
111
112
113 self.assertEqual(cdp.mol[0].res[1].num, 4)
114 self.assertEqual(cdp.mol[0].res[1].name, 'GLY')
115 self.assertEqual(len(cdp.mol[0].res[1].spin), 2)
116 self.assertEqual(cdp.mol[0].res[1].spin[0].num, 51)
117 self.assertEqual(cdp.mol[0].res[1].spin[0].name, 'N')
118 self.assertEqual(cdp.mol[0].res[1].spin[1].num, 53)
119 self.assertEqual(cdp.mol[0].res[1].spin[1].name, 'CA')
120
121
122 self.assertEqual(cdp.mol[0].res[2].num, 12)
123 self.assertEqual(cdp.mol[0].res[2].name, 'GLY')
124 self.assertEqual(len(cdp.mol[0].res[2].spin), 2)
125 self.assertEqual(cdp.mol[0].res[2].spin[0].num, 167)
126 self.assertEqual(cdp.mol[0].res[2].spin[0].name, 'N')
127 self.assertEqual(cdp.mol[0].res[2].spin[1].num, 169)
128 self.assertEqual(cdp.mol[0].res[2].spin[1].name, 'CA')
129
130
132 """Load the glycine backbone amide N spins from a loaded protein PDB file."""
133
134
135 self.interpreter.structure.read_pdb(file='Ap4Aase_res1-12.pdb', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures', read_model=1)
136
137
138 self.interpreter.structure.load_spins(spin_id=':GLY@N')
139
140
141 self.assertEqual(len(cdp.mol), 1)
142 self.assertEqual(cdp.mol[0].name, 'Ap4Aase_res1-12_mol1')
143 self.assertEqual(len(cdp.mol[0].res), 3)
144
145
146 self.assertEqual(cdp.mol[0].res[0].num, 1)
147 self.assertEqual(cdp.mol[0].res[0].name, 'GLY')
148 self.assertEqual(len(cdp.mol[0].res[0].spin), 1)
149 self.assertEqual(cdp.mol[0].res[0].spin[0].num, 1)
150 self.assertEqual(cdp.mol[0].res[0].spin[0].name, 'N')
151
152
153 self.assertEqual(cdp.mol[0].res[1].num, 4)
154 self.assertEqual(cdp.mol[0].res[1].name, 'GLY')
155 self.assertEqual(len(cdp.mol[0].res[1].spin), 1)
156 self.assertEqual(cdp.mol[0].res[1].spin[0].num, 51)
157 self.assertEqual(cdp.mol[0].res[1].spin[0].name, 'N')
158
159
160 self.assertEqual(cdp.mol[0].res[2].num, 12)
161 self.assertEqual(cdp.mol[0].res[2].name, 'GLY')
162 self.assertEqual(len(cdp.mol[0].res[2].spin), 1)
163 self.assertEqual(cdp.mol[0].res[2].spin[0].num, 167)
164 self.assertEqual(cdp.mol[0].res[2].spin[0].name, 'N')
165
166
168 """Load the protein backbone amide N spins from a loaded PDB file."""
169
170
171 self.interpreter.structure.read_pdb(file='Ap4Aase_res1-12.pdb', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'structures', read_model=1)
172
173
174 self.interpreter.structure.load_spins(spin_id='@N')
175
176
177 self.assertEqual(len(cdp.mol), 1)
178 self.assertEqual(cdp.mol[0].name, 'Ap4Aase_res1-12_mol1')
179 self.assertEqual(len(cdp.mol[0].res), 12)
180
181
182 self.assertEqual(cdp.mol[0].res[0].num, 1)
183 self.assertEqual(cdp.mol[0].res[0].name, 'GLY')
184 self.assertEqual(len(cdp.mol[0].res[0].spin), 1)
185 self.assertEqual(cdp.mol[0].res[0].spin[0].num, 1)
186 self.assertEqual(cdp.mol[0].res[0].spin[0].name, 'N')
187
188
189 self.assertEqual(cdp.mol[0].res[1].num, 2)
190 self.assertEqual(cdp.mol[0].res[1].name, 'PRO')
191 self.assertEqual(len(cdp.mol[0].res[1].spin), 1)
192 self.assertEqual(cdp.mol[0].res[1].spin[0].num, 11)
193 self.assertEqual(cdp.mol[0].res[1].spin[0].name, 'N')
194
195
196 self.assertEqual(cdp.mol[0].res[2].num, 3)
197 self.assertEqual(cdp.mol[0].res[2].name, 'LEU')
198 self.assertEqual(len(cdp.mol[0].res[2].spin), 1)
199 self.assertEqual(cdp.mol[0].res[2].spin[0].num, 28)
200 self.assertEqual(cdp.mol[0].res[2].spin[0].name, 'N')
201
202
203 self.assertEqual(cdp.mol[0].res[3].num, 4)
204 self.assertEqual(cdp.mol[0].res[3].name, 'GLY')
205 self.assertEqual(len(cdp.mol[0].res[3].spin), 1)
206 self.assertEqual(cdp.mol[0].res[3].spin[0].num, 51)
207 self.assertEqual(cdp.mol[0].res[3].spin[0].name, 'N')
208
209
210 self.assertEqual(cdp.mol[0].res[4].num, 5)
211 self.assertEqual(cdp.mol[0].res[4].name, 'SER')
212 self.assertEqual(len(cdp.mol[0].res[4].spin), 1)
213 self.assertEqual(cdp.mol[0].res[4].spin[0].num, 59)
214 self.assertEqual(cdp.mol[0].res[4].spin[0].name, 'N')
215
216
217 self.assertEqual(cdp.mol[0].res[5].num, 6)
218 self.assertEqual(cdp.mol[0].res[5].name, 'MET')
219 self.assertEqual(len(cdp.mol[0].res[5].spin), 1)
220 self.assertEqual(cdp.mol[0].res[5].spin[0].num, 71)
221 self.assertEqual(cdp.mol[0].res[5].spin[0].name, 'N')
222
223
224 self.assertEqual(cdp.mol[0].res[6].num, 7)
225 self.assertEqual(cdp.mol[0].res[6].name, 'ASP')
226 self.assertEqual(len(cdp.mol[0].res[6].spin), 1)
227 self.assertEqual(cdp.mol[0].res[6].spin[0].num, 91)
228 self.assertEqual(cdp.mol[0].res[6].spin[0].name, 'N')
229
230
231 self.assertEqual(cdp.mol[0].res[7].num, 8)
232 self.assertEqual(cdp.mol[0].res[7].name, 'SER')
233 self.assertEqual(len(cdp.mol[0].res[7].spin), 1)
234 self.assertEqual(cdp.mol[0].res[7].spin[0].num, 104)
235 self.assertEqual(cdp.mol[0].res[7].spin[0].name, 'N')
236
237
238 self.assertEqual(cdp.mol[0].res[8].num, 9)
239 self.assertEqual(cdp.mol[0].res[8].name, 'PRO')
240 self.assertEqual(len(cdp.mol[0].res[8].spin), 1)
241 self.assertEqual(cdp.mol[0].res[8].spin[0].num, 116)
242 self.assertEqual(cdp.mol[0].res[8].spin[0].name, 'N')
243
244
245 self.assertEqual(cdp.mol[0].res[9].num, 10)
246 self.assertEqual(cdp.mol[0].res[9].name, 'PRO')
247 self.assertEqual(len(cdp.mol[0].res[9].spin), 1)
248 self.assertEqual(cdp.mol[0].res[9].spin[0].num, 133)
249 self.assertEqual(cdp.mol[0].res[9].spin[0].name, 'N')
250
251
252 self.assertEqual(cdp.mol[0].res[10].num, 11)
253 self.assertEqual(cdp.mol[0].res[10].name, 'GLU')
254 self.assertEqual(len(cdp.mol[0].res[10].spin), 1)
255 self.assertEqual(cdp.mol[0].res[10].spin[0].num, 150)
256 self.assertEqual(cdp.mol[0].res[10].spin[0].name, 'N')
257
258
259 self.assertEqual(cdp.mol[0].res[11].num, 12)
260 self.assertEqual(cdp.mol[0].res[11].name, 'GLY')
261 self.assertEqual(len(cdp.mol[0].res[11].spin), 1)
262 self.assertEqual(cdp.mol[0].res[11].spin[0].num, 167)
263 self.assertEqual(cdp.mol[0].res[11].spin[0].name, 'N')
264
265
267 """The sequence.read() test."""
268
269
270 self.interpreter.sequence.read(file='test_seq', dir=status.install_path + sep+'test_suite'+sep+'shared_data', res_num_col=1, res_name_col=2)
271