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.potential.groovy;
39
40 import ffx.potential.utils.PotentialTest;
41 import org.junit.Test;
42
43 import static org.junit.Assert.assertEquals;
44 import static org.junit.Assert.assertTrue;
45
46
47
48
49
50
51
52 public class ImportCIFTest extends PotentialTest {
53
54
55
56
57 @Test
58 public void testImportCIF() {
59
60 String cifpath = getResourcePath("CBZ16.cif");
61 String xyzpath = getResourcePath("cbz.xyz");
62 String[] args = {cifpath, xyzpath};
63 binding.setVariable("args", args);
64 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
65
66
67
68 ImportCIF ImportCIF = new ImportCIF(binding).run();
69 potentialScript = ImportCIF;
70
71 assertEquals(1, ImportCIF.createdFiles.length);
72 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".XYZ"));
73 }
74
75
76
77
78 @Test
79 public void testImportCIFWriteAsCIF() {
80
81 String filepath = getResourcePath("paracetamol.xyz");
82 String[] args = {"--sc", filepath};
83 binding.setVariable("args", args);
84 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
85
86
87 ImportCIF ImportCIF = new ImportCIF(binding).run();
88 potentialScript = ImportCIF;
89
90 assertEquals(1, ImportCIF.createdFiles.length);
91 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".CIF"));
92 }
93
94
95
96
97 @Test
98 public void testImportCIFNoHydrogen() {
99
100 String cifpath = getResourcePath("CBZ03.cif");
101 String xyzpath = getResourcePath("cbz.xyz");
102 String[] args = {"--fl", cifpath, xyzpath};
103 binding.setVariable("args", args);
104 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
105
106
107 ImportCIF ImportCIF = new ImportCIF(binding).run();
108 potentialScript = ImportCIF;
109
110 assertEquals(1, ImportCIF.createdFiles.length);
111 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".XYZ"));
112 }
113
114
115
116
117 @Test
118 public void testImportCIFMultipleMolecules() {
119
120 String cifpath = getResourcePath("1183240.cif");
121 String xyzpath = getResourcePath("asplyswat.xyz");
122 String[] args = {cifpath, xyzpath};
123 binding.setVariable("args", args);
124 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
125
126
127 ImportCIF ImportCIF = new ImportCIF(binding).run();
128 potentialScript = ImportCIF;
129
130 assertEquals(1, ImportCIF.createdFiles.length);
131 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".XYZ"));
132 }
133
134
135
136
137 @Test
138 public void testImportCIFzPrimeChallenge() {
139
140 String cifpath = getResourcePath("1183241.cif");
141 String xyzpath = getResourcePath("glulys.xyz");
142 String[] args = {"--fl", cifpath, xyzpath};
143 binding.setVariable("args", args);
144 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
145
146
147 ImportCIF ImportCIF = new ImportCIF(binding).run();
148 potentialScript = ImportCIF;
149
150 assertEquals(1, ImportCIF.createdFiles.length);
151 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".XYZ"));
152 }
153
154
155
156
157 @Test
158 public void testImportCIFarc() {
159
160 String cifpath = getResourcePath("cbzs.cif");
161 String xyzpath = getResourcePath("cbz.xyz");
162 String[] args = {"--fl", cifpath, xyzpath};
163 binding.setVariable("args", args);
164 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
165
166
167 ImportCIF ImportCIF = new ImportCIF(binding).run();
168 potentialScript = ImportCIF;
169
170 assertEquals(3, ImportCIF.createdFiles.length);
171 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".ARC"));
172 }
173
174
175
176
177 @Test
178 public void testImportCIFdisulfide() {
179
180 String cifpath = getResourcePath("UFAGIS01.cif");
181 String xyzpath = getResourcePath("uf.xyz");
182 String[] args = {cifpath, xyzpath};
183 binding.setVariable("args", args);
184 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
185
186
187 ImportCIF ImportCIF = new ImportCIF(binding).run();
188 potentialScript = ImportCIF;
189
190 assertEquals(1, ImportCIF.createdFiles.length);
191 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".XYZ"));
192 }
193
194
195
196
197 @Test
198 public void testImportCIFpdb() {
199
200 String cifpath = getResourcePath("288726.cif");
201 String pdbpath = getResourcePath("ALA-HIE.pdb");
202 String[] args = {cifpath, pdbpath};
203 binding.setVariable("args", args);
204 binding.setVariable("baseDir", registerTemporaryDirectory().toFile());
205
206
207 ImportCIF ImportCIF = new ImportCIF(binding).run();
208 potentialScript = ImportCIF;
209
210 assertEquals(1, ImportCIF.createdFiles.length);
211 assertTrue(ImportCIF.createdFiles[0].toUpperCase().contains(".PDB"));
212 }
213
214
215
216
217 @Test
218 public void testImportCIFHelp() {
219
220 String[] args = {"-h"};
221 binding.setVariable("args", args);
222
223
224 potentialScript = new ImportCIF(binding).run();
225 }
226 }