John May
-
2014-01-13
- Group: cdk-1.0.x --> master
Example below shows it would be useful to turn this off. Also perhaps AtomContainerManipulator should have utility to add hydrogens?
IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance(); SmilesParser sp = new SmilesParser(builder); SmilesGenerator sg = new SmilesGenerator(); InChIGeneratorFactory igf = InChIGeneratorFactory.getInstance(); IAtomContainer m = sp.parseSmiles("[O]"); System.out.println(sg.create(m)); // [O] System.out.println(igf.getInChIGenerator(m).getInchi()); // InChI=1S/O // configure atom types AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(m); CDKHydrogenAdder.getInstance(builder).addImplicitHydrogens(m); System.out.println(sg.create(m)); // O ([OH2]) System.out.println(igf.getInChIGenerator(m).getInchi()); // InChI=1S/H2O/h1H2