Commit 19af83b
committed
Modernize ReactionDecoder: SMSD 3.0.0, CDK 2.12, optimize and clean
Major upgrade and optimization of ReactionDecoder:
Dependencies:
- Upgrade CDK from 2.4-SNAPSHOT to 2.12 (latest stable)
- Add SMSD 3.0.0 as external Maven dependency (com.bioinceptionlabs:smsd:3.0.0)
- Update JUnit 4.13.1→4.13.2, JGraphT 1.4.0→1.5.2, Commons CLI 1.4→1.9.0
- Fix commons-io groupId and update to 2.18.0
- Add Guava 33.4.0-jre (was transitive from old CDK)
SMSD 3.0.0 Migration:
- Delete ~70 embedded SMSD algorithm files (mcsplus, mcsplus1, mcsplus2,
mcgregor, rgraph, ventofoggia, vflib, single, graph, mcss packages)
- Rewrite Isomorphism.java to delegate MCS to SMSD 3.0.0 VF2++ engine
- Rewrite Substructure.java to delegate to SMSD 3.0.0 substructure search
- Keep local utilities (AtomAtomMapping, ChemicalFilters, BondEnergies,
ExtAtomContainerManipulator, MoleculeInitializer) needed by ReactionDecoder
- Delete unused helpers (Mappings, BinaryTree, LabelContainer, etc.)
Bug Fixes:
- Fix null bond NPE in BondChangeCalculator.getReactionFragmentCount()
(wrong bond type + missing null check for CDK 2.12 compatibility)
- Fix resource leak in ChemicalFormatParser.parseCML() (try-with-resources)
- Fix regex bugs: .split(".cml") → .split("\\.cml"), same for .rxn
- Fix bitwise AND→logical AND in 12 places across matrix and mechanism code
- Fix exception chain preservation in ReactionMechanismTool
- Add bounds checking in SMSD adapter atom index conversion
Performance:
- Remove ~70 unnecessary synchronized keywords from MCSThread, BaseMapping,
Isomorphism, Substructure, ChemicalFilters (single-threaded contexts)
- Replace Collections.synchronizedSortedMap with plain TreeMap in filters
- Replace System.out.println with LOGGER.debug across ~100 files
(eliminates I/O blocking in computation hot paths)
Code Quality:
- Replace all 27 printStackTrace() calls with proper LOGGER.error()
- Remove dead DEBUG flag fields and their conditional blocks
- Clean commented-out code blocks
- Add 4 new chemically relevant tests (Diels-Alder, ester hydrolysis,
identity reaction, amide bond formation)
- Update author/org to BioInception
All 7 tests pass. Fat JAR builds successfully.1 parent 21b99f8 commit 19af83b
145 files changed
Lines changed: 1192 additions & 24888 deletions
File tree
- src
- main/java
- org/openscience/smsd
- algorithm
- matchers
- mcgregor
- mcsplus1
- mcsplus2
- mcsplus
- rgraph
- single
- ventofoggia
- vflib/substructure
- filters
- graph
- algorithm
- helper
- interfaces
- mcss
- tools
- uk/ac/ebi
- aamtool
- rgroup
- centres
- cdk
- graph
- ligand
- priority
- reactionblast
- containers
- fingerprints
- graphics/direct
- layout
- mapping
- algorithm
- checks
- blocks
- container
- fixer
- graph
- mechanism
- helper
- signature
- stereo
- compare
- ebi
- tools
- inchi
- labelling
- matrix
- rxnfile
- test/java
- org/openscience/smsd/mcs
- uk/ac/ebi/aamtool
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 93 | + | |
| 94 | + | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
| 97 | + | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | | - | |
| 52 | + | |
47 | 53 | | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | | - | |
| 57 | + | |
52 | 58 | | |
53 | | - | |
| 59 | + | |
54 | 60 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
59 | | - | |
| 63 | + | |
60 | 64 | | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
101 | | - | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | | - | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | | - | |
| 114 | + | |
109 | 115 | | |
110 | | - | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
115 | 127 | | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
119 | 132 | | |
120 | | - | |
| 133 | + | |
121 | 134 | | |
122 | | - | |
| 135 | + | |
123 | 136 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
127 | 140 | | |
128 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
129 | 148 | | |
130 | 149 | | |
131 | 150 | | |
| |||
363 | 382 | | |
364 | 383 | | |
365 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
366 | 397 | | |
367 | 398 | | |
368 | 399 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
| |||
114 | 112 | | |
115 | 113 | | |
116 | 114 | | |
117 | | - | |
118 | 115 | | |
119 | 116 | | |
120 | 117 | | |
| |||
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | | - | |
| 123 | + | |
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
132 | | - | |
| 129 | + | |
133 | 130 | | |
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
137 | | - | |
| 134 | + | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
144 | 141 | | |
145 | | - | |
| 142 | + | |
146 | 143 | | |
147 | 144 | | |
148 | 145 | | |
| |||
171 | 168 | | |
172 | 169 | | |
173 | 170 | | |
174 | | - | |
| 171 | + | |
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
| |||
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
210 | | - | |
| 207 | + | |
211 | 208 | | |
212 | 209 | | |
213 | 210 | | |
214 | 211 | | |
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
218 | | - | |
| 215 | + | |
219 | 216 | | |
220 | 217 | | |
221 | 218 | | |
| |||
247 | 244 | | |
248 | 245 | | |
249 | 246 | | |
250 | | - | |
| 247 | + | |
251 | 248 | | |
252 | 249 | | |
253 | 250 | | |
| |||
257 | 254 | | |
258 | 255 | | |
259 | 256 | | |
260 | | - | |
| 257 | + | |
261 | 258 | | |
262 | 259 | | |
263 | 260 | | |
| |||
267 | 264 | | |
268 | 265 | | |
269 | 266 | | |
270 | | - | |
| 267 | + | |
271 | 268 | | |
272 | 269 | | |
273 | 270 | | |
274 | | - | |
| 271 | + | |
275 | 272 | | |
276 | 273 | | |
277 | 274 | | |
278 | 275 | | |
279 | 276 | | |
280 | 277 | | |
281 | | - | |
| 278 | + | |
282 | 279 | | |
283 | 280 | | |
284 | 281 | | |
| |||
288 | 285 | | |
289 | 286 | | |
290 | 287 | | |
291 | | - | |
| 288 | + | |
292 | 289 | | |
293 | 290 | | |
294 | 291 | | |
| |||
303 | 300 | | |
304 | 301 | | |
305 | 302 | | |
306 | | - | |
| 303 | + | |
307 | 304 | | |
308 | 305 | | |
309 | 306 | | |
| |||
324 | 321 | | |
325 | 322 | | |
326 | 323 | | |
327 | | - | |
| 324 | + | |
328 | 325 | | |
329 | 326 | | |
330 | 327 | | |
| |||
340 | 337 | | |
341 | 338 | | |
342 | 339 | | |
343 | | - | |
344 | 340 | | |
345 | 341 | | |
346 | 342 | | |
| |||
368 | 364 | | |
369 | 365 | | |
370 | 366 | | |
371 | | - | |
| 367 | + | |
372 | 368 | | |
373 | 369 | | |
374 | 370 | | |
| |||
403 | 399 | | |
404 | 400 | | |
405 | 401 | | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | 402 | | |
414 | 403 | | |
415 | 404 | | |
| |||
0 commit comments