Skip to content

Commit

Permalink
Added explicit atom typing and aromaticity detection to several faili…
Browse files Browse the repository at this point in the history
…ng fingerprinter tests.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Dec 17, 2012
1 parent f37cfa7 commit ff8d374
Showing 1 changed file with 28 additions and 0 deletions.
Expand Up @@ -29,9 +29,11 @@
import org.junit.Test;
import org.openscience.cdk.CDKTestCase;
import org.openscience.cdk.Molecule;
import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector;
import org.openscience.cdk.interfaces.IMolecule;
import org.openscience.cdk.io.MDLV2000Reader;
import org.openscience.cdk.io.IChemObjectReader.Mode;
import org.openscience.cdk.tools.manipulator.AtomContainerManipulator;

/**
* @cdk.module test-standard
Expand All @@ -58,6 +60,16 @@ public IFingerprinter getFingerprinter() {
reader = new MDLV2000Reader(ins, Mode.STRICT);
IMolecule substructure = (IMolecule)reader.read(new Molecule());

// these molecules are different resonance forms of the same molecule
// make sure aromaticity is detected. although some fingerprinters do this
// one should not expected all implementations to do so.
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(superstructure);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(substructure);
CDKHueckelAromaticityDetector.detectAromaticity(superstructure);
CDKHueckelAromaticityDetector.detectAromaticity(substructure);



IFingerprinter fingerprinter = getFingerprinter();
BitSet superBS = fingerprinter.getFingerprint(superstructure);
BitSet subBS = fingerprinter.getFingerprint(substructure);
Expand All @@ -80,6 +92,14 @@ public IFingerprinter getFingerprinter() {
reader = new MDLV2000Reader(ins, Mode.STRICT);
IMolecule substructure = (IMolecule)reader.read(new Molecule());

// these molecules are different resonance forms of the same molecule
// make sure aromaticity is detected. although some fingerprinters do this
// one should not expected all implementations to do so.
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(superstructure);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(substructure);
CDKHueckelAromaticityDetector.detectAromaticity(superstructure);
CDKHueckelAromaticityDetector.detectAromaticity(substructure);

IFingerprinter fingerprinter = getFingerprinter();
BitSet superBS = fingerprinter.getFingerprint(superstructure);
BitSet subBS = fingerprinter.getFingerprint(substructure);
Expand Down Expand Up @@ -128,6 +148,14 @@ public IFingerprinter getFingerprinter() {
reader = new MDLV2000Reader(ins, Mode.STRICT);
IMolecule structure2 = (IMolecule)reader.read(new Molecule());

// these molecules are different resonance forms of the same molecule
// make sure aromaticity is detected. although some fingerprinters do this
// one should not expected all implementations to do so.
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(structure2);
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(structure1);
CDKHueckelAromaticityDetector.detectAromaticity(structure2);
CDKHueckelAromaticityDetector.detectAromaticity(structure1);

IFingerprinter fingerprinter = getFingerprinter();
BitSet superBS = fingerprinter.getFingerprint(structure2);
BitSet subBS = fingerprinter.getFingerprint(structure1);
Expand Down

0 comments on commit ff8d374

Please sign in to comment.