1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 from os import sep
26 import sys
27
28
29 from base_classes import SystemTestCase
30 from data import Relax_data_store; ds = Relax_data_store()
31 from generic_fns.mol_res_spin import residue_loop
32 from physical_constants import N15_CSA, NH_BOND_LENGTH
33 from status import Status; status = Status()
34
35
36 -class Jw(SystemTestCase):
37 """Class for testing various aspects specific to reduced spectral density mapping."""
38
44
45
47 """The spectral density calculation test."""
48
49
50 dir = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'jw_mapping'+sep
51
52
53 ri_ids = ['NOE_600', 'R1_600', 'R2_600']
54 ri_type = ['NOE', 'R1', 'R2']
55 frq = [600e6]*3
56 data_paths = [dir + 'noe.dat', dir + 'R1.dat', dir + 'R2.dat']
57
58
59 j0 = [4.0703318681008998e-09, 3.7739393907014834e-09]
60 jwx = [1.8456254300773903e-10, 1.6347516082378241e-10]
61 jwh = [1.5598167512718012e-12, 2.9480536599037041e-12]
62
63
64 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)
65
66
67 for i in xrange(len(ri_ids)):
68 self.interpreter.relax_data.read(ri_id=ri_ids[i], ri_type=ri_type[i], frq=frq[i], file=data_paths[i], res_num_col=1, res_name_col=2, data_col=3, error_col=4)
69
70
71 self.interpreter.value.set(NH_BOND_LENGTH, 'r')
72 self.interpreter.value.set(N15_CSA, 'csa')
73 self.interpreter.value.set('15N', 'heteronuc_type')
74 self.interpreter.value.set('1H', 'proton_type')
75
76
77 self.interpreter.jw_mapping.set_frq(frq=600.0 * 1e6)
78
79
80 self.interpreter.calc()
81
82
83 index = 0
84 for res in residue_loop():
85
86 if res.num == -2 or res.num == -1:
87 self.assert_(res.spin[0].select)
88 self.assertAlmostEqual(res.spin[0].j0, j0[index])
89 self.assertAlmostEqual(res.spin[0].jwh, jwh[index])
90 self.assertAlmostEqual(res.spin[0].jwx, jwx[index])
91 index = index + 1
92
93
94 else:
95 self.assert_(not res.spin[0].select)
96
97
114
115
117 """Test a complete jw mapping run using a script."""
118
119
120 self.interpreter.run(script_file=status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'jw_mapping.py')
121