File: RandomCoilShiftProcessor_test.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 239,924 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; javascript: 164; makefile: 88
file content (112 lines) | stat: -rw-r--r-- 3,015 bytes parent folder | download | duplicates (8)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#include <BALL/CONCEPT/classTest.h>
#include <BALLTestConfig.h>

///////////////////////////

#include <BALL/NMR/randomCoilShiftProcessor.h>
#include <BALL/FORMAT/HINFile.h>
#include <BALL/FORMAT/PDBFile.h>
#include <BALL/STRUCTURE/defaultProcessors.h>

///////////////////////////

START_TEST(RandomCoilShiftProcessor)

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

using namespace BALL;

RandomCoilShiftProcessor* sp = 0;
CHECK(RandomCoilShiftProcessor::RandomCoilShiftProcessor() throw())
	sp = new RandomCoilShiftProcessor;
	TEST_NOT_EQUAL(sp, 0)
RESULT


CHECK(RandomCoilShiftProcessor::~RandomCoilShiftProcessor() throw())
  delete sp;
RESULT


CHECK(RandomCoilShiftProcessor::RandomCoilShiftProcessor(const RandomCoilShiftProcessor& processor) throw())
  //?????
RESULT


CHECK(RandomCoilShiftProcessor::init() throw())
  //?????
RESULT


CHECK(RandomCoilShiftProcessor::start() throw())
  //?????
RESULT


CHECK(RandomCoilShiftProcessor::Processor::Result operator () (Composite& composite) throw())
  //?????
RESULT


CHECK(RandomCoilShiftProcessor::finish() throw())
  //?????
RESULT

HINFile f(BALL_TEST_DATA_PATH(RandomCoilShiftProcessor_test.hin));
System S;
f >> S;

Parameters parameters(BALL_TEST_DATA_PATH(RandomCoilShiftProcessor_test.ini));

CHECK(chemical shifts)
	PRECISION(0.0001)
	RandomCoilShiftProcessor sp;
	sp.setParameters(parameters);
	sp.init();
	TEST_EQUAL(S.countAtoms(), 31)

	
	if (S.countAtoms() == 31)
	{
		S.apply(sp);

		AtomIterator atom_it = S.beginAtom();
		Position i = 0;
		for (; +atom_it; ++atom_it)
		{
			if (atom_it->hasProperty(RandomCoilShiftProcessor::PROPERTY__RANDOM_COIL_SHIFT))
			{
				float shift = atom_it->getProperty(RandomCoilShiftProcessor::PROPERTY__RANDOM_COIL_SHIFT).getFloat();
				STATUS("shift #" << i << " of " << atom_it->getFullName() << ": " << shift)
				switch (i)
				{
					case  0: TEST_REAL_EQUAL(shift, 8.04) break; // ALA:1H
					case  1: TEST_REAL_EQUAL(shift, 8.04) break; // ALA:2H
					case  2: TEST_REAL_EQUAL(shift, 8.04) break; // ALA:3H
					case  3: TEST_REAL_EQUAL(shift, 3.67) break; // ALA:HA
					case  4: TEST_REAL_EQUAL(shift, 1.40) break; // ALA:1HB
					case  5: TEST_REAL_EQUAL(shift, 1.40) break; // ALA:2HB
					case  6: TEST_REAL_EQUAL(shift, 1.40) break; // ALA:3HB
					case  7: TEST_REAL_EQUAL(shift, 8.35) break; // GLY:H
					case  8: TEST_REAL_EQUAL(shift, 3.53) break; // GLY:2HA
					case  9: TEST_REAL_EQUAL(shift, 3.53) break; // GLY:1HA
					case 10: TEST_REAL_EQUAL(shift, 8.11) break; // SER:H
					case 11: TEST_REAL_EQUAL(shift, 3.82) break; // SER:HA
					case 12: TEST_REAL_EQUAL(shift, 3.89) break; // SER:2HB
					case 13: TEST_REAL_EQUAL(shift, 3.89) break; // SER:1HB
				}
				i++;
			}
		}
		TEST_EQUAL(i, 14)
	}	
RESULT

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
END_TEST