/** * * @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()); } }
@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); }
/** * * @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()); } }
/** * * @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()); } }
SmartsMatchers.prepare(mol, true); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol); Aromaticity aroma = new Aromaticity(ElectronDonation.cdk(), Cycles.cdkAromaticSet()); aroma.apply(mol); container.setProperty(PREPARED, mol);
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; }