try { IsotopeFactory ifac = Isotopes.getInstance(); ifac.configureAtoms(atomContainer); } catch (IOException e) { throw new CDKException("IO problem occurred when using the CDK atom config\n" + e.getMessage(), e);
try { IsotopeFactory ifac = Isotopes.getInstance(); ifac.configureAtoms(atomContainer); } catch (IOException e) { throw new CDKException("IO problem occurred when using the CDK atom config\n" + e.getMessage(), e);
/** * @cdk.bug 2898032 */ @Test public void testCanSmiWithConfiguredAtoms() throws CDKException, IOException { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); String s1 = "OC(=O)C(Br)(Cl)N"; String s2 = "ClC(Br)(N)C(=O)O"; IAtomContainer m1 = sp.parseSmiles(s1); IAtomContainer m2 = sp.parseSmiles(s2); IsotopeFactory fact = Isotopes.getInstance(); fact.configureAtoms(m1); fact.configureAtoms(m2); SmilesGenerator sg = SmilesGenerator.unique(); String o1 = sg.create(m1); String o2 = sg.create(m2); Assert.assertTrue("The two canonical SMILES should match", o1.equals(o2)); }
clone = (IAtomContainer) container.clone(); factory = Isotopes.getInstance(); factory.configureAtoms(clone); } catch (CloneNotSupportedException | IOException e) { logger.debug(e);
clone = (IAtomContainer) container.clone(); factory = Isotopes.getInstance(); factory.configureAtoms(clone); } catch (CloneNotSupportedException | IOException e) { logger.debug(e);
/** * @cdk.bug 3040273 */ @Test public void testBug3040273() throws Exception { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); String testSmiles = "C1(C(C(C(C(C1Br)Br)Br)Br)Br)Br"; IAtomContainer mol = sp.parseSmiles(testSmiles); IsotopeFactory fact = Isotopes.getInstance(); fact.configureAtoms(mol); SmilesGenerator sg = new SmilesGenerator(); String smiles = sg.create((IAtomContainer) mol); IAtomContainer mol2 = sp.parseSmiles(smiles); Assert.assertTrue(new UniversalIsomorphismTester().isIsomorph(mol, mol2)); }
ifac.configureAtoms(mol1);
ifac.configureAtoms(mol1);
addImplicitHydrogens(mol1); IsotopeFactory ifac = Isotopes.getInstance(); ifac.configureAtoms(mol1); define(mol1, clockwise(mol1, 1, 0, 2, 4, 8), clockwise(mol1, 2, 1, 3, 7, 1)); String smiles1 = sg.create(mol1);
IsotopeFactory ifac = Isotopes.getInstance(); ifac.configureAtoms(mol1); define(mol1, clockwise(mol1, 2, 0, 1, 3, 7), clockwise(mol1, 7, 2, 6, 8, 9)); String smiles1 = sg.create(mol1);