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 generic_fns.mol_res_spin import create_molecule, create_residue, create_spin
30 from status import Status; status = Status()
31
32
34 """Class for testing various aspects specific to NOE restraints."""
35
41
42
44 """Generate the RNA sequence of the noe_rna_hbond.dat restraint file."""
45
46
47 mol_names = ['A', 'B']
48 res_nums = [
49 [1, 2, 3, 4],
50 [4, 3, 2, 1]
51 ]
52 spin_names = [
53 [['N1', 'N6', 'H62'],
54 ['H3', 'N3', 'O4'],
55 ['H1', 'N1', 'H22', 'N2', 'O6'],
56 ['N3', 'O2', 'H42', 'N4']],
57 [['H3', 'N3', 'O4'],
58 ['N1', 'N6', 'H62'],
59 ['N3', 'O2', 'H42', 'N4'],
60 ['H1', 'N1', 'H22', 'N2', 'O6']]
61 ]
62
63
64 for i in range(len(mol_names)):
65
66 create_molecule(mol_names[i])
67
68
69 for j in range(len(res_nums[i])):
70
71 create_residue(res_nums[i][j], mol_name=mol_names[i])
72
73
74 for k in range(len(spin_names[i][j])):
75
76 create_spin(spin_names[i][j][k], res_num=res_nums[i][j], mol_name=mol_names[i])
77
78
79 self.interpreter.sequence.display()
80
81
83 """Test the reading of phthalic acid NOE restraints in generic format."""
84
85
86 ds.file_name = 'phthalic_acid'
87
88
89 self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'phthalic_acid_noes.py')
90
91
92 restraints = [
93 ['@H1', '@H6', 3.0, 5.0],
94 ['@H3', '@H9', 3.0, 5.0],
95 ['@H3', '@H10', 3.0, 5.0],
96 ['@H3', '@H11', 3.0, 5.0],
97 ['@H3', '@H19', 3.0, 5.0],
98 ['@H3', '@Q9', 3.0, 6.0],
99 ['@H4', '@H8', 3.0, 5.0],
100 ['@H4', '@H9', 3.0, 5.0],
101 ['@H4', '@H10', 3.0, 5.0],
102 ['@H4', '@H11', 3.0, 5.0],
103 ['@H4', '@H15', 3.0, 5.0],
104 ['@H4', '@H19', 3.0, 5.0],
105 ['@H4', '@Q9', 3.0, 6.0],
106 ['@H5', '@H9', 3.0, 5.0],
107 ['@H5', '@Q7', 3.0, 6.0],
108 ['@H5', '@Q9', 3.0, 6.0],
109 ['@H6', '@H8', 3.0, 5.0],
110 ['@H6', '@H9', 3.0, 5.0],
111 ['@H6', '@H10', 3.0, 5.0],
112 ['@H6', '@H11', 3.0, 5.0],
113 ['@H6', '@H15', 3.0, 5.0],
114 ['@H6', '@Q7', 3.0, 6.0],
115 ['@H6', '@H19', 3.0, 5.0],
116 ['@H6', '@Q9', 3.0, 6.0],
117 ['@H26', '@H1', 3.0, 5.0],
118 ['@H26', '@H8', 3.0, 5.0],
119 ['@H26', '@H9', 3.0, 5.0],
120 ['@H26', '@H10', 3.0, 5.0],
121 ['@H26', '@H11', 3.0, 5.0],
122 ['@H26', '@H15', 3.0, 5.0],
123 ['@H26', '@Q7', 3.0, 6.0],
124 ['@H26', '@H19', 3.0, 5.0],
125 ['@H26', '@Q9', 3.0, 6.0],
126 ['@H27', '@H1', 3.0, 5.0],
127 ['@H27', '@H8', 3.0, 5.0],
128 ['@H27', '@H9', 3.0, 5.0],
129 ['@H27', '@H11', 3.0, 5.0],
130 ['@H27', '@H13', 3.0, 5.0],
131 ['@H27', '@H15', 3.0, 5.0],
132 ['@H27', '@Q7', 3.0, 6.0],
133 ['@H27', '@H19', 3.0, 5.0],
134 ['@H27', '@Q9', 3.0, 6.0],
135 ['@H28', '@H1', 3.0, 5.0],
136 ['@H28', '@H8', 3.0, 5.0],
137 ['@H28', '@H9', 3.0, 5.0],
138 ['@H28', '@H11', 3.0, 5.0],
139 ['@H28', '@H15', 3.0, 5.0],
140 ['@H28', '@Q7', 3.0, 6.0],
141 ['@H28', '@H19', 3.0, 5.0],
142 ['@H28', '@Q9', 3.0, 6.0]
143 ]
144
145
146 for i in range(len(restraints)):
147
148 self.assertEqual(cdp.noe_restraints[i][0], restraints[i][0])
149 self.assertEqual(cdp.noe_restraints[i][1], restraints[i][1])
150
151
152 self.assertEqual(cdp.noe_restraints[i][2], restraints[i][2])
153 self.assertEqual(cdp.noe_restraints[i][3], restraints[i][3])
154
155
157 """Test the reading of an Xplor NOE restraints file fragment with a methyl group."""
158
159
160 ds.file_name = 'pseudo_atoms.dat'
161
162
163 self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'n_state_model'+sep+'phthalic_acid_noes.py')
164
165
166 restraints = [
167 ['@H28', '@H9', 3.0, 5.0],
168 ['@H28', '@Q9', 3.0, 6.0]
169 ]
170
171
172 for i in range(len(restraints)):
173
174 self.assertEqual(cdp.noe_restraints[i][0], restraints[i][0])
175 self.assertEqual(cdp.noe_restraints[i][1], restraints[i][1])
176
177
178 self.assertEqual(cdp.noe_restraints[i][2], restraints[i][2])
179 self.assertEqual(cdp.noe_restraints[i][3], restraints[i][3])
180
181
183 """Test the reading of RNA H-bond restraints in Xplor format."""
184
185
186 self.rna_seq()
187
188
189 self.interpreter.noe.read_restraints(file='noe_rna_hbond.dat', dir=status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'noe_restraints')
190
191
192 restraints = [
193 ['#A:1@N1', '#B:4@H3', 1.93, 0.20, 0.20],
194 ['#A:1@N1', '#B:4@N3', 2.95, 0.20, 0.20],
195 ['#A:1@N6', '#B:4@O4', 2.83, 0.20, 0.20],
196 ['#A:1@H62', '#B:4@O4', 1.82, 0.20, 0.20],
197 ['#A:2@H3', '#B:3@N1', 1.93, 0.20, 0.20],
198 ['#A:2@N3', '#B:3@N1', 2.95, 0.20, 0.20],
199 ['#A:2@O4', '#B:3@N6', 2.83, 0.20, 0.20],
200 ['#A:2@O4', '#B:3@H62', 1.82, 0.20, 0.20],
201 ['#A:3@H1', '#B:2@N3', 1.89, 0.20, 0.20],
202 ['#A:3@N1', '#B:2@N3', 2.91, 0.20, 0.20],
203 ['#A:3@H22', '#B:2@O2', 2.08, 0.20, 0.20],
204 ['#A:3@N2', '#B:2@O2', 3.08, 0.20, 0.20],
205 ['#A:3@O6', '#B:2@H42', 1.71, 0.20, 0.20],
206 ['#A:3@O6', '#B:2@N4', 2.72, 0.20, 0.20],
207 ['#A:4@N3', '#B:1@H1', 1.89, 0.20, 0.20],
208 ['#A:4@N3', '#B:1@N1', 2.91, 0.20, 0.20],
209 ['#A:4@O2', '#B:1@H22', 2.08, 0.20, 0.20],
210 ['#A:4@O2', '#B:1@N2', 3.08, 0.20, 0.20],
211 ['#A:4@H42', '#B:1@O6', 1.71, 0.20, 0.20],
212 ['#A:4@N4', '#B:1@O6', 2.72, 0.20, 0.20]
213 ]
214
215
216 for i in range(len(restraints)):
217
218 self.assertEqual(cdp.noe_restraints[i][0], restraints[i][0])
219 self.assertEqual(cdp.noe_restraints[i][1], restraints[i][1])
220
221
222 self.assertEqual(cdp.noe_restraints[i][2], restraints[i][2]-restraints[i][3])
223 self.assertEqual(cdp.noe_restraints[i][3], restraints[i][2]+restraints[i][4])
224