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 package ffx.algorithms.groovy;
39
40 import ffx.algorithms.misc.AlgorithmsTest;
41 import ffx.numerics.estimator.FreeEnergyDifferenceReporter;
42 import org.junit.Assert;
43 import org.junit.Test;
44
45 public class BARFilesTest extends AlgorithmsTest {
46
47
48
49
50
51
52 public void testBARFiles() {
53
54 if (!ffxOpenMM) {
55 return;
56 }
57
58
59 String filepath = getResourcePath("testBar/singleTopology/dimethylphosphate.100.xyz");
60 String[] args = {"-t", "298", "--nw", "8", "--ac", "1-13", "--utb", filepath};
61 binding.setVariable("args", args);
62
63 BAR bar = new BAR(binding).run();
64 algorithmsScript = bar;
65
66 FreeEnergyDifferenceReporter reporter = bar.getReporter();
67
68 double expectedFepFor = -115.4001;
69 double actualFepFor = reporter.getForwardTotalFEDifference();
70 Assert.assertEquals(expectedFepFor, actualFepFor, 0.5);
71
72 double expectedFepBack = -118.6607;
73 double actualFepBack = reporter.getBackwardTotalFEDifference();
74 Assert.assertEquals(expectedFepBack, actualFepBack, 0.5);
75
76 double expectedhFor = -157.1466;
77 double actualhFor = reporter.getForwardTotalEnthalpyChange();
78 Assert.assertEquals(expectedhFor, actualhFor, 50);
79
80 double expectedhBack = 123.5150;
81 double actualhBack = reporter.getBackwardTotalEnthalpyChange();
82 Assert.assertEquals(expectedhBack, actualhBack, 90);
83
84 double expectedhBAR = -29.0062;
85 double actualhBAR = reporter.getBarBSTotalEnthalpyChange();
86 Assert.assertEquals(expectedhBAR, actualhBAR, 4);
87
88 double expectedBARIteration = -117.1754;
89 double actualBARIteration = reporter.getBarIterTotalFEDiff();
90 Assert.assertEquals(expectedBARIteration, actualBARIteration, 0.5);
91
92 double expectedBARBootstrap = -117.1464;
93 double actualBARBootstrap = reporter.getBarBSTotalFEDiff();
94 Assert.assertEquals(expectedBARBootstrap, actualBARBootstrap, 0.3);
95 }
96
97 @Test
98 public void testBARHelp() {
99 String[] args = {"-h"};
100 binding.setVariable("args", args);
101
102
103 BAR bar = new BAR(binding).run();
104 algorithmsScript = bar;
105 }
106
107 }