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 from tempfile import mkdtemp
28
29
30 from base_classes import SystemTestCase
31 from data import Relax_data_store; ds = Relax_data_store()
32 from generic_fns.mol_res_spin import spin_loop
33 from relax_io import test_binary
34 from status import Status; status = Status()
35
36
37 -class Dasha(SystemTestCase):
38 """Class for testing various aspects specific to model-free analysis using the program 'Dasha'."""
39
41 """Set up for all the functional tests."""
42
43
44 self.interpreter.pipe.create('dasha', 'mf')
45
46
47 ds.tmpdir = mkdtemp()
48
49
51 """Test a complete model-free analysis using the program 'Dasha'."""
52
53
54 try:
55 test_binary('dasha')
56 except:
57 return
58
59
60 self.script_exec(status.install_path + sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'dasha.py')
61
62
63 self.assertEqual(len(cdp.ri_ids), 3)
64 for ri_id in cdp.ri_ids:
65 self.assertEqual(cdp.frq[ri_id], 600000000.0)
66 self.assertEqual(cdp.ri_type['R1_600'], 'R1')
67 self.assertEqual(cdp.ri_type['R2_600'], 'R2')
68 self.assertEqual(cdp.ri_type['NOE_600'], 'NOE')
69
70
71 select = [True, True, False, False]
72 fixed = [None, None, None, None]
73 proton_type = [None, None, None, None]
74 heteronuc_type = ['15N', '15N', '15N', '15N']
75 attached_proton = [None, None, None, None]
76 model = ['m3', 'm3', 'm3', 'm3']
77 equation = ['mf_orig', 'mf_orig', 'mf_orig', 'mf_orig']
78 params = [['s2', 'rex'], ['s2', 'rex'], ['s2', 'rex'], ['s2', 'rex']]
79 xh_vect = [None, None, None, None]
80 s2 = [0.71510, 0.64359, None, None]
81 s2f = [None, None, None, None]
82 s2s = [None, None, None, None]
83 local_tm = [None, None, None, None]
84 te = [None, None, None, None]
85 tf = [None, None, None, None]
86 ts = [None, None, None, None]
87 rex = [4.32701, 4.29432, None, None]
88 r = [1.02e-10, 1.02e-10, 1.02e-10, 1.02e-10]
89 csa = [-172e-6, -172e-6, -172e-6, -172e-6]
90 chi2 = [1.9657, 0.63673, None, None]
91 ri_data = [{'R1_600': 1.0, 'R2_600': 15.0, 'NOE_600': 0.9},
92 {'R1_600': 0.9, 'R2_600': 13.9, 'NOE_600': 0.79},
93 {'R2_600': 12.0, 'NOE_600': 0.6},
94 {'R1_600': None, 'R2_600': None, 'NOE_600': None}]
95 ri_data_err = [{'R1_600': 0.05, 'R2_600': 0.5, 'NOE_600': 0.05},
96 {'R1_600': 0.05, 'R2_600': 0.8, 'NOE_600': 0.05},
97 {'R2_600': 0.5, 'NOE_600': 0.05},
98 {'R1_600': None, 'R2_600': None, 'NOE_600': None}]
99
100
101 i = 0
102 for spin in spin_loop():
103
104 self.assertEqual(spin.select, select[i])
105 self.assertEqual(spin.fixed, fixed[i])
106 self.assertEqual(spin.proton_type, proton_type[i])
107 self.assertEqual(spin.heteronuc_type, heteronuc_type[i])
108 self.assertEqual(spin.attached_proton, attached_proton[i])
109 self.assertEqual(spin.model, model[i])
110 self.assertEqual(spin.equation, equation[i])
111 self.assertEqual(spin.params, params[i])
112 self.assertEqual(spin.xh_vect, xh_vect[i])
113 self.assertEqual(spin.s2, s2[i])
114 self.assertEqual(spin.s2f, s2f[i])
115 self.assertEqual(spin.s2s, s2s[i])
116 self.assertEqual(spin.local_tm, local_tm[i])
117 self.assertEqual(spin.te, te[i])
118 self.assertEqual(spin.tf, tf[i])
119 self.assertEqual(spin.ts, ts[i])
120 self.assertEqual(spin.rex, rex[i])
121 self.assertAlmostEqual(spin.r, r[i])
122 self.assertAlmostEqual(spin.csa, csa[i])
123 self.assertEqual(spin.chi2, chi2[i])
124 for ri_id in cdp.ri_ids:
125 if ri_id in ri_data[i].keys():
126 self.assertEqual(spin.ri_data[ri_id], ri_data[i][ri_id])
127
128
129 i += 1
130