@Test public void testSFBug999330() throws Exception { String path = null; try { path = this.getClass().getClassLoader().getResource("").toURI().getPath(); } catch (URISyntaxException ex) { Logger.getLogger(SDFReaderTest.class.getName()).log(Level.SEVERE, null, ex); } String file1 = "data/mdl/5SD.mol"; String file2 = "data/mdl/ADN.mol"; AtomContainer mol1 = new AtomContainer(); AtomContainer mol2 = new AtomContainer(); InputStream ins1 = this.getClass().getClassLoader().getResourceAsStream(file1); new MDLV2000Reader(ins1, Mode.STRICT).read(mol1); InputStream ins2 = this.getClass().getClassLoader().getResourceAsStream(file2); new MDLV2000Reader(ins2, Mode.STRICT).read(mol2); AtomContainerAtomPermutor permutor = new AtomContainerAtomPermutor(mol2); mol2 = new AtomContainer((AtomContainer) permutor.next()); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol1); CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(mol1.getBuilder()); adder.addImplicitHydrogens(mol1); ExtAtomContainerManipulator.aromatizeDayLight(mol1); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol2); adder = CDKHydrogenAdder.getInstance(mol2.getBuilder()); adder.addImplicitHydrogens(mol2); ExtAtomContainerManipulator.aromatizeDayLight(mol2); List<IAtomContainer> list1 = CDKMCS.getOverlaps(mol1, mol2, true, true, false); List<IAtomContainer> list2 = CDKMCS.getOverlaps(mol2, mol1, true, true, false); Assert.assertEquals(1, list1.size()); Assert.assertEquals(1, list2.size()); Assert.assertEquals(((AtomContainer) list1.get(0)).getAtomCount(), ((AtomContainer) list2.get(0)).getAtomCount()); }
public static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType) throws CDKException { List<List<CDKRMap>> rMapsList = search(g1, g2, new BitSet(), new BitSet(), true, false, shouldMatchBonds, shouldMatchRings, matchAtomType); List<IAtomContainer> graphList = projectList(rMapsList, g1, ID1); return getMaximum(graphList, shouldMatchBonds, shouldMatchRings, matchAtomType); }
CDKMCS { public static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType) throws CDKException { List<List<CDKRMap>> rMapsList = search(g1, g2, new BitSet(), new BitSet(), true, false, shouldMatchBonds, shouldMatchRings, matchAtomType); List<IAtomContainer> graphList = projectList(rMapsList, g1, ID1); return getMaximum(graphList, shouldMatchBonds, shouldMatchRings, matchAtomType); } }
CDKMCS { public static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType) throws CDKException { List<List<CDKRMap>> rMapsList = search(g1, g2, new BitSet(), new BitSet(), true, false, shouldMatchBonds, shouldMatchRings, matchAtomType); List<IAtomContainer> graphList = projectList(rMapsList, g1, ID1); return getMaximum(graphList, shouldMatchBonds, shouldMatchRings, matchAtomType); }  }
CDKMCS { public static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType) throws CDKException { List<List<CDKRMap>> rMapsList = search(g1, g2, new BitSet(), new BitSet(), true, false, shouldMatchBonds, shouldMatchRings, matchAtomType); List<IAtomContainer> graphList = projectList(rMapsList, g1, ID1); return getMaximum(graphList, shouldMatchBonds, shouldMatchRings, matchAtomType); }  static boolean isIsomorph(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getIsomorphMaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getSubgraphMaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<CDKRMap> getSubgraphMap(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getSubgraphAtomsMaps(IAtomContainer g1,
            IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static boolean isSubgraph(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static BitSet getBitSet(IAtomContainer ac); static CDKRGraph buildRGraph(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> search(IAtomContainer g1, IAtomContainer g2, BitSet c1,
            BitSet c2, boolean findAllStructure, boolean findAllMap,
            boolean shouldMatchBonds, boolean shouldMatchRings,
            boolean matchAtomType); static boolean isTimeout(); }
CDKMCS { public static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType) throws CDKException { List<List<CDKRMap>> rMapsList = search(g1, g2, new BitSet(), new BitSet(), true, false, shouldMatchBonds, shouldMatchRings, matchAtomType); List<IAtomContainer> graphList = projectList(rMapsList, g1, ID1); return getMaximum(graphList, shouldMatchBonds, shouldMatchRings, matchAtomType); }  static boolean isIsomorph(IAtomContainer g1, IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getIsomorphMaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getSubgraphMaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<CDKRMap> getSubgraphMap(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> getSubgraphAtomsMaps(IAtomContainer g1,
            IAtomContainer g2, boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static boolean isSubgraph(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<IAtomContainer> getOverlaps(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static BitSet getBitSet(IAtomContainer ac); static CDKRGraph buildRGraph(IAtomContainer g1, IAtomContainer g2,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType); static List<List<CDKRMap>> search(IAtomContainer g1, IAtomContainer g2, BitSet c1,
            BitSet c2, boolean findAllStructure, boolean findAllMap,
            boolean shouldMatchBonds, boolean shouldMatchRings,
            boolean matchAtomType); static boolean isTimeout();  }