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 static org.junit.Assert.assertEquals;
41
42 import ffx.algorithms.misc.AlgorithmsTest;
43 import org.junit.Test;
44
45
46
47
48
49
50 public class SuperposeCrystalsTest extends AlgorithmsTest {
51
52 private final double TOLERANCE = 0.005;
53
54
55
56
57 @Test
58 public void testBaseSingleSuperposeCrystals() {
59
60
61 String[] args = {"-l", "0", getResourcePath("C23.arc")};
62 binding.setVariable("args", args);
63 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
64
65
66 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
67 algorithmsScript = superposeCrystals;
68
69
70 assertEquals(6, superposeCrystals.runningStatistics.getCount());
71
72 assertEquals(0.087248318, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
73 assertEquals(0.226387, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
74 }
75
76
77
78
79 @Test
80 public void testBaseSingleAUSuperposeCrystals() {
81
82
83 String[] args = {"--na", "1", "-l", "0", getResourcePath("C23.arc")};
84 binding.setVariable("args", args);
85 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
86
87
88 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
89 algorithmsScript = superposeCrystals;
90
91
92 assertEquals(6, superposeCrystals.runningStatistics.getCount());
93
94 assertEquals(0.055486, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
95 assertEquals(0.161867, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
96 }
97
98
99
100
101 @Test
102 public void testBaseSingleMTSuperposeCrystals() {
103
104
105 String[] args = {"-l", "0",
106 getResourcePath("ace.arc_s"),
107 getResourcePath("ace.arc_sx")};
108 binding.setVariable("args", args);
109 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
110
111
112 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
113 algorithmsScript = superposeCrystals;
114
115
116 assertEquals(100, superposeCrystals.runningStatistics.getCount());
117
118 assertEquals(0.199630, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
119 assertEquals(0.199630, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
120 }
121
122
123
124
125 @Test
126 public void testBaseSingleMTSuperposeCrystals2() {
127
128
129 String[] args = {getResourcePath("ace.arc"), getResourcePath("ace.arc_x")};
130 binding.setVariable("args", args);
131 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
132
133
134 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
135 algorithmsScript = superposeCrystals;
136
137
138 assertEquals(4, superposeCrystals.runningStatistics.getCount());
139
140 assertEquals(0.224877, superposeCrystals.runningStatistics.getMin(), TOLERANCE);
141 assertEquals(0.224877, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
142 assertEquals(0.224877, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
143 }
144
145
146
147
148 @Test
149 public void testBaseAverageSuperposeCrystals() {
150
151
152 String[] args = {"-l", "1", getResourcePath("C23.arc")};
153 binding.setVariable("args", args);
154 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
155
156
157 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
158 algorithmsScript = superposeCrystals;
159
160
161 assertEquals(6, superposeCrystals.runningStatistics.getCount());
162
163 assertEquals(0.0830895, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
164 assertEquals(0.217224949, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
165 }
166
167
168
169
170 @Test
171 public void testBaseAverageSuperposeCrystalsHydrogen() {
172
173
174 String[] args = {"--ih", "-l", "1", getResourcePath("C23.arc")};
175 binding.setVariable("args", args);
176 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
177
178
179 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
180 algorithmsScript = superposeCrystals;
181
182
183 assertEquals(6, superposeCrystals.runningStatistics.getCount());
184
185 assertEquals(0.111014, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
186 assertEquals(0.297522, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
187 }
188
189
190
191
192 @Test
193 public void testBaseSingleSuperposeCrystalsHydrogen() {
194
195
196 String[] args = {"--ih", "-l", "0", getResourcePath("C23.arc")};
197 binding.setVariable("args", args);
198 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
199
200
201 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
202 algorithmsScript = superposeCrystals;
203
204
205 assertEquals(6, superposeCrystals.runningStatistics.getCount());
206
207 assertEquals(0.1125556, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
208 assertEquals(0.30190515, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
209 }
210
211
212
213
214 @Test
215 public void testBaseAverageSuperposeCrystalsSohnckeGroup() {
216
217
218 String[] args = {"-l", "1", getResourcePath("dap.xyz"), getResourcePath("dap.xyz_close")};
219 binding.setVariable("args", args);
220 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
221
222
223 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
224 algorithmsScript = superposeCrystals;
225
226 assertEquals(0.066569, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
227 }
228
229
230
231
232 @Test
233 public void testBaseSingleSuperposeCrystalsSohnckeGroup() {
234
235
236 String[] args = {"-l", "0", getResourcePath("dap.xyz"), getResourcePath("dap.xyz_close")};
237 binding.setVariable("args", args);
238 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
239
240
241 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
242 algorithmsScript = superposeCrystals;
243
244 assertEquals(0.073036, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
245 }
246
247
248
249
250 @Test
251 public void testBaseAverageSuperposeCrystalsHandedness() {
252
253
254 String[] args = {"-l", "1", getResourcePath("dap2.xyz"), getResourcePath("dap2.xyz_2")};
255 binding.setVariable("args", args);
256 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
257
258
259 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
260 algorithmsScript = superposeCrystals;
261
262 assertEquals(0.112274, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
263 }
264
265
266
267
268 @Test
269 public void testBaseSingleSuperposeCrystalsHandedness() {
270
271
272 String[] args = {"-l", "0", getResourcePath("dap2.xyz"), getResourcePath("dap2.xyz_2")};
273 binding.setVariable("args", args);
274 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
275
276
277 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
278 algorithmsScript = superposeCrystals;
279
280 assertEquals(0.098483, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
281 }
282
283
284
285
286 @Test
287 public void testBaseAverageSuperposeCrystalsZPrime2() {
288
289
290 String[] args = {"-l", "1", getResourcePath("XAFPAY02.arc")};
291 binding.setVariable("args", args);
292 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
293
294
295 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
296 algorithmsScript = superposeCrystals;
297
298 assertEquals(6, superposeCrystals.runningStatistics.getCount());
299
300
301 assertEquals(0.151675, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
302 assertEquals(0.375328, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
303 }
304
305
306
307
308 @Test
309 public void testBaseSingleSuperposeCrystalsZPrime2() {
310
311
312 String[] args = {"-l", "0", getResourcePath("XAFPAY02.arc")};
313 binding.setVariable("args", args);
314 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
315
316
317 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
318 algorithmsScript = superposeCrystals;
319
320 assertEquals(6, superposeCrystals.runningStatistics.getCount());
321
322
323 assertEquals(0.142474326, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
324 assertEquals(0.355770508, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
325 }
326
327
328
329
330 @Test
331 public void testBaseSingleSuperposeCrystalsSmallProtein() {
332
333
334 String[] args = {"-l", "0", getResourcePath("2olx.arc")};
335 binding.setVariable("args", args);
336 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
337
338
339 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
340 algorithmsScript = superposeCrystals;
341
342 assertEquals(6, superposeCrystals.runningStatistics.getCount());
343
344
345 assertEquals(0.478175, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
346 assertEquals(1.383652, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
347 }
348
349
350
351
352 @Test
353 public void testBaseAverageSuperposeCrystalsSmallProtein() {
354
355
356 String[] args = {"-l", "1", getResourcePath("2olx.arc")};
357 binding.setVariable("args", args);
358 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
359
360
361 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
362 algorithmsScript = superposeCrystals;
363
364 assertEquals(6, superposeCrystals.runningStatistics.getCount());
365
366
367 assertEquals(0.441851, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
368 assertEquals(1.269418376, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
369 }
370
371
372
373
374 @Test
375 public void testBaseAverageSuperposeCrystalsPrintSym() {
376
377
378 String[] args = {"--na", "1", "--ps", "1.0", getResourcePath("CBZ01_P1.xyz"), getResourcePath("cbz11.xyz")};
379 binding.setVariable("args", args);
380 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
381
382
383 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
384 algorithmsScript = superposeCrystals;
385
386 assertEquals(1, superposeCrystals.runningStatistics.getCount());
387
388
389 assertEquals(0.10510735, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
390 assertEquals(0.10510735, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
391 }
392
393
394
395
396 @Test
397 public void testBaseAverageSuperposeCrystalsAlchemicalAtoms() {
398
399
400 String[] args = {"--na", "1", "--ps", "1.0", "--ac", "4,7,9,11,13,15,17,19,21,23,25,27",
401 getResourcePath("ZEYBIO01.xyz_amoebax"),
402 getResourcePath("ZEYBIO04_zero.xyz_amoebax")};
403 binding.setVariable("args", args);
404 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
405
406
407 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
408 algorithmsScript = superposeCrystals;
409
410 assertEquals(1, superposeCrystals.runningStatistics.getCount());
411
412 assertEquals(0.14180274, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
413 assertEquals(0.14180274, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
414 }
415
416
417
418
419 @Test
420 public void testSuperposeCrystalsLongMolecule() {
421
422
423 String[] args = {getResourcePath("dameda.arc")};
424 binding.setVariable("args", args);
425 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
426
427
428 SuperposeCrystals superposeCrystals = new SuperposeCrystals(binding).run();
429 algorithmsScript = superposeCrystals;
430
431 assertEquals(3, superposeCrystals.runningStatistics.getCount());
432
433
434 assertEquals(0.200420, superposeCrystals.runningStatistics.getMean(), TOLERANCE);
435 assertEquals(0.601259, superposeCrystals.runningStatistics.getMax(), TOLERANCE);
436 }
437
438 @Test
439 public void testSuperposeCrystalsHelp() {
440
441 String[] args = {"-h"};
442 binding.setVariable("args", args);
443
444
445 SuperposeCrystals SuperposeCrystals = new SuperposeCrystals(binding).run();
446 algorithmsScript = SuperposeCrystals;
447 }
448 }