/** * * @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()); } }
@Override public IBitFingerprint getBitFingerprint(IAtomContainer atomContainer) throws CDKException { int bitsetLength = queries.length; BitSet fingerPrint = new BitSet(bitsetLength); { SmartsMatchers.prepare(atomContainer, true); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(atomContainer); Aromaticity aroma = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()); aroma.apply(atomContainer); } for (int i = 0; i < queries.length; i++) { boolean status = queries[i].matches(atomContainer); if (status) fingerPrint.set(i, true); } return new BitSetFingerprint(fingerPrint); }
/** Check the electron contribution is the same as expected. */ static void test(IAtomContainer m, int... expected) throws CDKException { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(m); assertThat(model.contribution(m, new RingSearch(m)), is(expected)); } }
/** * * @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 aromatizeCDK(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.cdk(); CycleFinder cycles = Cycles.cdkAromaticSet(); Aromaticity aromaticity = new Aromaticity(model, cycles); ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); try { aromaticity.apply(molecule); } catch (CDKException e) { logger.log(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
/** Check the electron contribution is the same as expected. */ static void test(IAtomContainer m, int... expected) throws CDKException { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(m); assertThat(model.contribution(m, new RingSearch(m)), is(expected)); } }
/** * * @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()); } }
/** * * @param molecule * @throws CDKException */ public static void aromatizeCDK(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.cdk(); CycleFinder cycles = Cycles.cdkAromaticSet(); Aromaticity aromaticity = new Aromaticity(model, cycles); ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); try { aromaticity.apply(molecule); } catch (CDKException e) { logger.log(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
/** Check the electron contribution is the same as expected. */ static void test(IAtomContainer m, int... expected) throws CDKException { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(m); assertThat(model.contribution(m, new RingSearch(m)), is(expected)); } }
| SmiFlavor.Stereo); Aromaticity aromaticity = new Aromaticity(daylight(), Cycles.or(Cycles.all(), Cycles.or(Cycles.relevant(),
/** * * @param molecule * @throws CDKException */ public static void aromatizeCDK(IAtomContainer molecule) throws CDKException { ElectronDonation model = ElectronDonation.cdk(); CycleFinder cycles = Cycles.cdkAromaticSet(); Aromaticity aromaticity = new Aromaticity(model, cycles); ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule); try { aromaticity.apply(molecule); } catch (CDKException e) { LOGGER.error(Level.WARNING, "Aromaticity detection failed due to presence of unset " + "atom hybridisation", molecule.getID()); } }
/** Check the electron contribution is the same as expected. */ static void test(IAtomContainer m, int... expected) throws CDKException { AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(m); assertThat(model.contribution(m, new RingSearch(m)), is(expected)); } }
Cycles.essential())); Aromaticity aromaticity = new Aromaticity(daylight(), cycles); if (DEBUG) { System.out.println("Done Finding cycles");
SmartsMatchers.prepare(mol, true); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); Aromaticity aroma = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()); aroma.apply(mol); container.setProperty(PREPARED, mol);
final int[] electrons = model.contribution(molecule, ringSearch);
/** * 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); }
public AtomicDescriptor[] buildDescriptors(IAtomContainer molecule) throws CDKException { final Aromaticity aroma = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()); aroma.apply(molecule); final AtomHybridizationDescriptor dhybr = new AtomHybridizationDescriptor(); final AtomDegreeDescriptor ddegree = new AtomDegreeDescriptor(); final AtomicDescriptor[] descriptors = new AtomicDescriptor[molecule.getAtomCount()]; int k=0; for (IAtom atom : molecule.atoms()) { final DescriptorValue value = dhybr.calculate(atom, molecule); final int hybridization = ((IntegerResult)value.getValue()).intValue(); final int degree = ((IntegerResult)ddegree.calculate(atom, molecule).getValue()).intValue(); final AtomicDescriptor descriptor = new AtomicDescriptor( atom.getAtomicNumber(), atom.getFlag(CDKConstants.ISAROMATIC), hybridization, degree ); atom.setProperty(CSI_FINGER_ID_DESCRIPTOR, descriptor); descriptors[k++] = descriptor; } return descriptors; }
/** * 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;
/** * 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()); }