Skip to content
Permalink
Browse files

Added explicit atom typing and aromaticity detection to several faili…

…ng fingerprinter tests.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
johnmay authored and egonw committed Dec 16, 2012
1 parent f37cfa7 commit ff8d3749a1d4feb491dd4536ec4ad1bb79d7f400
Showing with 28 additions and 0 deletions.
  1. +28 −0 src/test/org/openscience/cdk/fingerprint/AbstractFingerprinterTest.java
@@ -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
@@ -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);
@@ -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);
@@ -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);

0 comments on commit ff8d374

Please sign in to comment.
You can’t perform that action at this time.