|
7 | 7 | import casekit.nmr.utils.Utils;
|
8 | 8 | import org.openscience.cdk.exception.InvalidSmilesException;
|
9 | 9 | import org.openscience.cdk.interfaces.IAtomContainer;
|
10 |
| -import org.openscience.cdk.interfaces.IBond; |
11 | 10 | import org.openscience.cdk.layout.StructureDiagramGenerator;
|
12 | 11 | import org.openscience.cdk.silent.SilentChemObjectBuilder;
|
13 | 12 | import org.openscience.cdk.smiles.SmilesGenerator;
|
@@ -249,34 +248,8 @@ public DataSet predict(@RequestParam final String smiles, @RequestParam final St
|
249 | 248 | List<Double> medians;
|
250 | 249 |
|
251 | 250 | try {
|
252 |
| - // store stereo bond information |
253 |
| - final int[] ordinals = new int[structure.getBondCount()]; |
254 |
| - int k = 0; |
255 |
| - for (final IBond bond : structure.bonds()) { |
256 |
| - ordinals[k] = bond.getStereo() |
257 |
| - .ordinal(); |
258 |
| - k++; |
259 |
| - } |
260 |
| - // set 2D coordinates |
261 |
| - this.structureDiagramGenerator.setMolecule(structure); |
262 |
| - this.structureDiagramGenerator.generateCoordinates(structure); |
263 |
| - /* !!! No explicit H in mol !!! */ |
264 |
| - Utils.convertExplicitToImplicitHydrogens(structure); |
265 |
| - /* add explicit H atoms */ |
266 |
| - AtomUtils.addAndPlaceHydrogens(structure); |
267 |
| - /* detect aromaticity */ |
| 251 | + Utils.placeExplicitHydrogens(structure); |
268 | 252 | Utils.setAromaticityAndKekulize(structure);
|
269 |
| - // restore stereo bond information |
270 |
| - k = 0; |
271 |
| - for (final IBond bond : structure.bonds()) { |
272 |
| - bond.setStereo(IBond.Stereo.values()[ordinals[k]]); |
273 |
| - |
274 |
| - k++; |
275 |
| - if (k |
276 |
| - >= ordinals.length) { |
277 |
| - break; |
278 |
| - } |
279 |
| - } |
280 | 253 |
|
281 | 254 | final DataSet dataSet = Utils.atomContainerToDataSet(structure);
|
282 | 255 |
|
|
0 commit comments