-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·301 lines (252 loc) · 10.4 KB
/
test.sh
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#!/bin/sh
# runtest.sh (main driver script)
# babel round trips (too many levels!)
popdir=`pwd`
cd ../../tools
unset BABEL
export BABEL="`pwd`/babel"
cd ../src
unset BABEL_LIBDIR
export BABEL_LIBDIR="`pwd`/formats/.libs:`pwd`/formats/xml/.libs"
# roundtrip formats (for looping in runtest0.sh and runtest1.sh)
cd ../test
unset ROUNTRIP
export ROUNDTRIP="`pwd`/roundtrip"
cd $popdir
# roundtrip formats (for looping in runtest0.sh and runtest1.sh)
export roundformats="alc bgf box bs c3d1 c3d2 caccrt cml crk2d crk3d"
export roundformats="${roundformats} ct dmol feat fract gpr hin mmd mol"
export roundformats="${roundformats} mol2 mopcrt pdb pqs pcm smi tmol"
export roundformats="${roundformats} unixyz vmol yob xyz cdxml mopin"
export roundformats="${roundformats} gzmat mcif"
# ideally, make sure there's a test file for each format
# also used for invalid file testing in runtest2.sh
export informats="car ccc cdx g03 g98 gamout ins jout mopout mpqc nwo prep"
export informats="${informats} pc qcout"
# output-only formats (for looping in runtest0.sh and runtest1.sh)
export outformats="cache cacint cht cif com copy csr cssr fh fix fs gamin gr96"
export outformats="${outformats} inchi jin mpqcin mpd nw pov qcin"
export outformats="${outformats} report txyz xed zin"
export outformats="${outformats} fasta fpt can molreport"
export outformats="${outformats} msms adf"
# Delete old data in subdirectories
# (One for each actual input file)
cd files/
rm -f car/* cml/* crk2d/* crk3d/* dmol/* g03/* g98/* gamout/* 2>/dev/null
rm -f gpr/* ins/* jout/* mmod/* mol/* mol2/* mopout/* mpqc/* 2>/dev/null
rm -f pdb/* qcout/* smi/* xyz/* invalid/* fract/* yob/* pcm/* 2>/dev/null
rm -f sdf/* hin/* gal/* res/* cdx/* 2>/dev/null
cd $popdir
#
# Now start the tests!
# We're going to create a "results-${DATE}.txt" file with some header info.
# and all the results will go in there
#
# First off, let's get some ID information for this test box
DATE=`date "+%Y-%m-%d"`
FILE="results-${DATE}.txt"
echo "Open Babel roundtrip test results" >${FILE}
${BABEL} -v >>${FILE} 2>/dev/null
echo >>${FILE}
date >>${FILE}
echo >>${FILE}
uname -a >>${FILE}
echo >>${FILE}
echo >>${FILE}
# runtest.0 will:
# * create a fresh new subdirectory
# * copy in the original test file
# then go to work
# **************************
# *** ROUNDTRIP testing ***
# **************************
# Z-Matrix CML
sh scripts/runtest0.sh cml ascorbic1.cml >>${FILE} 2>&1
# From Jmol
sh scripts/runtest0.sh cml acetate.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml aceticacid.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml benzene.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml estron.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml list.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml list2.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml long4lines.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml methanol1.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml methanol2.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc202.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc244.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc244a.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc2582.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc300.cml >>${FILE} 2>&1
sh scripts/runtest0.sh cml nsc484.cml >>${FILE} 2>&1
# Chemical Resource Kit (CRK)
sh scripts/runtest0.sh crk2d test.crk2d >>${FILE} 2>&1
sh scripts/runtest0.sh crk3d test.crk3d >>${FILE} 2>&1
# DMol3 with unit cell (silicon bulk)
sh scripts/runtest0.sh dmol si.dmol >>${FILE} 2>&1
# Ghemical Project
sh scripts/runtest0.sh gpr estradiol.gpr >>${FILE} 2>&1
# MacroModel
sh scripts/runtest0.sh mmod Model1-1142.mmod >>${FILE} 2>&1
# 2D MDL Molfile
sh scripts/runtest0.sh mol yohimbine.mol >>${FILE} 2>&1
# 2D MDL Molfile with radical and implicit H's
sh scripts/runtest0.sh mol EthylISIS.mol >>${FILE} 2>&1
# 2D MDL Molfile with radical
sh scripts/runtest0.sh mol phenyl.mol >>${FILE} 2>&1
# 3D MDL Molfile
sh scripts/runtest0.sh mol 3d-head.mol >>${FILE} 2>&1
# InChI test set (wicked!)
# sh scripts/runtest0.sh sdf InChI_TestSet.sdf >>${FILE} 2>&1
# Sybyl Mol2 (created via Ghemical)
sh scripts/runtest0.sh mol2 aromtest.mol2 >>${FILE} 2>&1
# Sybyl Mol2 (created/used with Dock)
sh scripts/runtest0.sh mol2 dock_nrg.mol2 >>${FILE} 2>&1
# Small PDB (one TRP residue)
sh scripts/runtest0.sh pdb TRP.pdb >>${FILE} 2>&1
# Small PDB (several amino acid residues via Open Babel / Ghemical)
sh scripts/runtest0.sh pdb random.pdb >>${FILE} 2>&1
# Small PDB (crambin) 327 atoms
sh scripts/runtest0.sh pdb 1crn.pdb >>${FILE} 2>&1
# Small PDB (carbon nanotube) 316 atoms
sh scripts/runtest0.sh pdb nanotube.pdb >>${FILE} 2>&1
# "Big" PDB (HIV-1 Protease) 3491 atoms
# sh scripts/runtest0.sh pdb 1hvc.pdb >>${FILE} 2>&1
# SMILES (multiple lines)
sh scripts/runtest0.sh smi test.smi >>${FILE} 2>&1
# SMILES with radicals
sh scripts/runtest0.sh smi RadIn1.smi >>${FILE} 2>&1
# SMILES with DOS line endings (aromatics and pseudo-aromatics)
sh scripts/runtest0.sh smi aromatic.smi >>${FILE} 2>&1
# SMILES with Mac line endings
sh scripts/runtest0.sh smi test-mac.smi >>${FILE} 2>&1
# c60 (XYZ)
# Plays havoc with bond typing
sh scripts/runtest0.sh xyz buckyball.xyz >>${FILE} 2>&1
# Periodic Table (XYZ) Elements 1-109 H-Mt
# Plays havoc on some formats w/o esoteric atom typing
sh scripts/runtest0.sh xyz table.xyz >>${FILE} 2>&1
# Partial Aromatic NTCDI (XYZ)
sh scripts/runtest0.sh xyz ntcdi.xyz >>${FILE} 2>&1
# Multi-molecule XYZ file
sh scripts/runtest0.sh xyz met-enkaphalin_movie.xyz >>${FILE} 2>&1
# HMX (lots o' nitro-groups)
sh scripts/runtest0.sh xyz hmx.xyz >>${FILE} 2>&1
# single He atom (check atom typing and z-matrix tranforms work)
sh scripts/runtest0.sh xyz He.xyz >>${FILE} 2>&1
# "Free Form Fractional"
sh scripts/runtest0.sh fract ZnO.fract >>${FILE} 2>&1
# PCModel
sh scripts/runtest0.sh pcm example.pcm >>${FILE} 2>&1
# Yasara .yob
sh scripts/runtest0.sh yob yami.yob >>${FILE} 2>&1
# HyperChem .hin
sh scripts/runtest0.sh hin dan002.hin >>${FILE} 2>&1
sh scripts/runtest0.sh hin dan031.hin >>${FILE} 2>&1
sh scripts/runtest0.sh hin twoModels.hin >>${FILE} 2>&1
# **************************
# *** INPUT-ONLY testing ***
# runtest1.sh does the same for runtest0.sh except for an input-only format
# (i.e. no roundtrip testing, but validation can occur)
# **************************
# MSI Biosym/Insight II CAR
sh scripts/runtest1.sh car benzene.car >>${FILE} 2>&1
# GAMESS-US Output
sh scripts/runtest1.sh gamout benzenesulfonamide.gamout >>${FILE} 2>&1
sh scripts/runtest1.sh gamout ch3oh.gamout >>${FILE} 2>&1
sh scripts/runtest1.sh gamout Cl2O.gamout >>${FILE} 2>&1
sh scripts/runtest1.sh gamout substrate.gamout >>${FILE} 2>&1
sh scripts/runtest1.sh gamout water.gamout >>${FILE} 2>&1
# Cr inorganic complex (Gaussian98 Output)
sh scripts/runtest1.sh g98 cotton.g98 >>${FILE} 2>&1
# Graphite 2D sheet (with periodic boundary conditions) Gaussian03 Output
sh scripts/runtest1.sh g03 graphite.g03 >>${FILE} 2>&1
sh scripts/runtest1.sh gal 4-cyanophenylnitrene-Benzazirine-TS.g94.gal >>${FILE} 2>&1
sh scripts/runtest1.sh gal H2O.gal >>${FILE} 2>&1
sh scripts/runtest1.sh gal ch2chfme_reagent.gal >>${FILE} 2>&1
sh scripts/runtest1.sh gal cyanine_PM3.gal >>${FILE} 2>&1
sh scripts/runtest1.sh gal phenylnitrene.g94.gal >>${FILE} 2>&1
sh scripts/runtest1.sh gal tms.gal >>${FILE} 2>&1
# ShelX INS
sh scripts/runtest1.sh ins vinigrol.ins >>${FILE} 2>&1
sh scripts/runtest1.sh ins pli222.ins >>${FILE} 2>&1
sh scripts/runtest1.sh res 6063.res >>${FILE} 2>&1
sh scripts/runtest1.sh res complexSFAC.res >>${FILE} 2>&1
sh scripts/runtest1.sh res first100.res >>${FILE} 2>&1
sh scripts/runtest1.sh res frame_1.res >>${FILE} 2>&1
sh scripts/runtest1.sh res k04041.res >>${FILE} 2>&1
sh scripts/runtest1.sh res vmdtest.res >>${FILE} 2>&1
# Jaguar Output
sh scripts/runtest1.sh jout 3-pyrrole.jout >>${FILE} 2>&1
# MPQC Output (borane and h2o)
sh scripts/runtest1.sh mpqc b2h6.mpqc >>${FILE} 2>&1
sh scripts/runtest1.sh mpqc h2o.mpqc >>${FILE} 2>&1
# Ethanol (MOPAC 7 Output)
sh scripts/runtest1.sh mopout Ethanol.mopout >>${FILE} 2>&1
# Q-Chem Output
sh scripts/runtest1.sh qcout 3-thio.qcout >>${FILE} 2>&1
# Pubchem ID 837481
sh scripts/runtest1.sh pc pubchem-837481.pc >>${FILE} 2>&1
sh scripts/runtest1.sh pc CID_6013.pc >>${FILE} 2>&1
# ChemDraw CDX
sh scripts/runtest1.sh cdx largertest.cdx >>${FILE} 2>&1
sh scripts/runtest1.sh cdx testosterone.cdx >>${FILE} 2>&1
# We currently need example files for the following input-only format testing
# Amber PREP
# CCC
# NWChem Output
# **************************
# *** OUTPUT-ONLY testing **
# **************************
# We currently need some sample output-only formats for common molecules
# (for preliminary work, let's use Babel 1.6)
# Then we output and run "diff" to ensure no problems
# Cacao Internal
# CAChe MolStruct
# ChemDraw connection table
# Chemtool
# CSD CSSR
# Fenske-Hall Z-Matrix
# GAMESS Input
# Gaussian Cartesian / Input
# GROMOS96
# Jaguar Input
# MSI Quanta CSR
# NWChem Input
# POV-Ray Output
# Report
# Q-Chem Input
# SMILES Fix
# Tinker XYZ
# Titles
# XED
# ZINDO Input
# ****************************
# *** NASTY FAILURE testing **
# ****************************
# These are intended to all fail. Several are generic tests that will be run
# over all formats via runtest2.sh and invalid.sh
# Others are specific to a format (e.g., negative # of atoms, etc.)
# These use runtest3.sh and invalid2.sh (and don't loop at all)
# Random (piped from /dev/random one day. Not really a molecule at all)
# Used to make sure we don't crash when given nasty stuff
sh scripts/runtest2.sh random >>${FILE} 2>&1
sh scripts/runtest2.sh random2 >>${FILE} 2>&1
sh scripts/runtest2.sh random3 >>${FILE} 2>&1
# Random (piped from /dev/random one day. Not really a molecule at all)
# Run through gzip -- to challenge the gzip encoding/decoding procedures
sh scripts/runtest2.sh random4 >>${FILE} 2>&1
sh scripts/runtest2.sh random5 >>${FILE} 2>&1
# A completely empty file
# Some formats have crashed when encountering such a file
sh scripts/runtest2.sh empty >>${FILE} 2>&1
# Invalid XYZ files
sh scripts/runtest3.sh xyz invalid.xyz >>${FILE} 2>&1
sh scripts/runtest3.sh xyz invalid2.xyz >>${FILE} 2>&1
sh scripts/runtest3.sh xyz invalid3.xyz >>${FILE} 2>&1
# Invalid MDL Molfiles
sh scripts/runtest3.sh mol hmx.mol >>${FILE} 2>&1
sh scripts/runtest3.sh mol hmx2.mol >>${FILE} 2>&1
sh scripts/runtest3.sh mol hmx3.mol >>${FILE} 2>&1
sh scripts/runtest3.sh mol hmx4.mol >>${FILE} 2>&1
sh scripts/runtest3.sh mol hmx5.mol >>${FILE} 2>&1
sh scripts/runtest3.sh mol hmx6.mol >>${FILE} 2>&1