/** * * @param molecule * @throws CDKException */ public static void aromatizeDayLight(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.daylight(); CycleFinder cycles = Cycles.or(Cycles.all(), Cycles.relevant()); Aromaticity aromaticity = new Aromaticity(model, cycles); try { aromaticity.apply(molecule); } catch (CDKException e) { logger.log(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
/** * * @param molecule * @throws CDKException */ public static void aromatizeDayLight(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.daylight(); CycleFinder cycles = Cycles.or(Cycles.all(), Cycles.relevant()); Aromaticity aromaticity = new Aromaticity(model, cycles); try { aromaticity.apply(molecule); } catch (CDKException e) { logger.log(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
/** * * @param molecule * @throws CDKException */ public static void aromatizeDayLight(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.daylight(); CycleFinder cycles = Cycles.or(Cycles.all(), Cycles.relevant()); Aromaticity aromaticity = new Aromaticity(model, cycles); try { aromaticity.apply(molecule); } catch (CDKException e) { LOGGER.error(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
| SmiFlavor.Stereo); Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(),
Cycles.essential())); Aromaticity aromaticity = new Aromaticity(daylight(), cycles); if (DEBUG) { System.out.println("Done Finding cycles");
/** * Return SMILES * * @param ac * @return * @throws org.openscience.cdk.exception.CDKException */ public static String toSmiles(IAtomContainer ac) throws CDKException { Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(), Cycles.essential()))); SmilesGenerator g = new SmilesGenerator( SmiFlavor.Unique | SmiFlavor.UseAromaticSymbols | SmiFlavor.Stereo); aromaticity.apply(ac); return g.create(ac); } private final BitSet fingerprint;
/** * Return SMILES * * @param ac * @return * @throws org.openscience.cdk.exception.CDKException */ public synchronized String getMCSSSmiles(IAtomContainer ac) throws CDKException { Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(), Cycles.essential()))); SmilesGenerator g = new SmilesGenerator( SmiFlavor.Unique | SmiFlavor.UseAromaticSymbols | SmiFlavor.Stereo); aromaticity.apply(ac); return g.create(ac); }
/** * Returns Maximum Common Fragment between Query and Target as SMILES * * @return * @throws CloneNotSupportedException * @throws CDKException */ public synchronized String getCommonFragmentAsSMILES() throws CloneNotSupportedException, CDKException { SmilesGenerator smiles = new SmilesGenerator( // SmiFlavor.Unique| //SmiFlavor.UseAromaticSymbols| SmiFlavor.AtomAtomMap | SmiFlavor.Stereo); IAtomContainer commonFragment = getCommonFragment(); Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(), Cycles.essential()))); aromaticity.apply(commonFragment); return smiles.create(commonFragment); }
/** * @cdk.bug 736 */ @Test public void ensureConsistentRepresentation() throws Exception { IAtomContainer a = smiles("C1=CC2=CC3=CC4=C(C=CC=C4)C=C3C=C2C=C1"); IAtomContainer b = smiles("c1cc2cc3cc4c(cccc4)cc3cc2cc1"); Aromaticity arom = new Aromaticity(ElectronDonation.daylight(), Cycles.all()); arom.apply(a); arom.apply(b); assertTrue(AtomContainerDiff.diff(a, b).isEmpty()); }
private static void KekulizeReaction(IReaction r) throws CDKException { ElectronDonation model = ElectronDonation.daylight(); // CycleFinder cycles = Cycles.or(Cycles.all(), Cycles.all(6)); // Aromaticity aromaticity = new Aromaticity(model, cycles); Aromaticity aromaticity = new Aromaticity(model, Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(), Cycles.essential()))); // apply our configured model to each molecule for (IAtomContainer molecule : r.getReactants().atomContainers()) { aromaticity.apply(molecule); } for (IAtomContainer molecule : r.getProducts().atomContainers()) { aromaticity.apply(molecule); } }
static String canon(String smi) throws Exception { final IChemObjectBuilder bldr = SilentChemObjectBuilder.getInstance(); final SmilesParser smipar = new SmilesParser(bldr); final IAtomContainer container = smipar.parseSmiles(smi); AtomContainerManipulator.suppressHydrogens(container); Aromaticity arom = new Aromaticity(ElectronDonation.daylight(), Cycles.all()); arom.apply(container); return SmilesGenerator.unique().create(container); } }
@Test public void testAromaticBenzene() throws java.lang.Exception { Object[] params = {false, true}; descriptor.setParameters(params); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer mol = sp.parseSmiles("C1=CC=CC=C1"); // benzene Aromaticity aromaticity = new Aromaticity(ElectronDonation.daylight(), Cycles.all()); aromaticity.apply(mol); assertAtomTypesPerceived(mol); addExplicitHydrogens(mol); Assert.assertThat(((DoubleResult) descriptor.calculate(mol).getValue()).doubleValue(), closeTo(2.02, 0.01)); }
this.numberOfCyclesProduct = 0; Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(),