@Test public void testSearchMCS() { try { SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); IAtomContainer target; target = sp.parseSmiles("C\\C=C/Nc1cccc(c1)N(O)\\C=C\\C\\C=C\\C=C/C"); IAtomContainer queryac = null; queryac = sp.parseSmiles("Nc1ccccc1"); MCSPlusHandler smsd1 = new MCSPlusHandler(queryac, target, true, false, false); assertNotNull(smsd1.getFirstAtomMapping()); } catch (InvalidSmilesException ex) { Logger.getLogger(MCSPlusHandlerTest.class.getName()).log(Level.SEVERE, null, ex); } }
private synchronized boolean searchMCS() { List<List<Integer>> mappings; MCSPlus mcsplus; if (source instanceof IQueryAtomContainer) { mcsplus = new MCSPlus((IQueryAtomContainer) source, target); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else if (!(source instanceof IQueryAtomContainer) && source.getAtomCount() < target.getAtomCount()) { mcsplus = new MCSPlus(source, target, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else { flagExchange = true; mcsplus = new MCSPlus(target, source, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } List<Map<Integer, Integer>> solutions = PostFilter.filter(mappings); setAllMapping(solutions); setAllAtomMapping(); return mcsplus.isTimeout(); }
MCSPlusHandler implements IResults { private synchronized boolean searchMCS() { List<List<Integer>> mappings; MCSPlus mcsplus; if (source instanceof IQueryAtomContainer) { mcsplus = new MCSPlus((IQueryAtomContainer) source, target); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else if (!(source instanceof IQueryAtomContainer) && source.getAtomCount() < target.getAtomCount()) { mcsplus = new MCSPlus(source, target, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else { flagExchange = true; mcsplus = new MCSPlus(target, source, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } List<Map<Integer, Integer>> solutions = PostFilter.filter(mappings); setAllMapping(solutions); setAllAtomMapping(); return mcsplus.isTimeout(); } }
MCSPlusHandler implements IResults { private synchronized boolean searchMCS() { List<List<Integer>> mappings; MCSPlus mcsplus; if (source instanceof IQueryAtomContainer) { mcsplus = new MCSPlus((IQueryAtomContainer) source, target); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else if (!(source instanceof IQueryAtomContainer) && source.getAtomCount() < target.getAtomCount()) { mcsplus = new MCSPlus(source, target, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else { flagExchange = true; mcsplus = new MCSPlus(target, source, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } List<Map<Integer, Integer>> solutions = PostFilter.filter(mappings); setAllMapping(solutions); setAllAtomMapping(); return mcsplus.isTimeout(); } MCSPlusHandler(IAtomContainer source, IAtomContainer target,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType);  MCSPlusHandler(IQueryAtomContainer source, IAtomContainer target); }
MCSPlusHandler implements IResults { private synchronized boolean searchMCS() { List<List<Integer>> mappings; MCSPlus mcsplus; if (source instanceof IQueryAtomContainer) { mcsplus = new MCSPlus((IQueryAtomContainer) source, target); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else if (!(source instanceof IQueryAtomContainer) && source.getAtomCount() < target.getAtomCount()) { mcsplus = new MCSPlus(source, target, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else { flagExchange = true; mcsplus = new MCSPlus(target, source, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } List<Map<Integer, Integer>> solutions = PostFilter.filter(mappings); setAllMapping(solutions); setAllAtomMapping(); return mcsplus.isTimeout(); } MCSPlusHandler(IAtomContainer source, IAtomContainer target,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType);  MCSPlusHandler(IQueryAtomContainer source, IAtomContainer target); @Override synchronized List<AtomAtomMapping> getAllAtomMapping(); @Override synchronized AtomAtomMapping getFirstAtomMapping(); synchronized boolean isTimeout(); }
MCSPlusHandler implements IResults { private synchronized boolean searchMCS() { List<List<Integer>> mappings; MCSPlus mcsplus; if (source instanceof IQueryAtomContainer) { mcsplus = new MCSPlus((IQueryAtomContainer) source, target); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else if (!(source instanceof IQueryAtomContainer) && source.getAtomCount() < target.getAtomCount()) { mcsplus = new MCSPlus(source, target, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } else { flagExchange = true; mcsplus = new MCSPlus(target, source, shouldMatchBonds, shouldMatchRings, matchAtomType); List<List<Integer>> overlaps = mcsplus.getOverlaps(); mappings = Collections.synchronizedList(overlaps); } List<Map<Integer, Integer>> solutions = PostFilter.filter(mappings); setAllMapping(solutions); setAllAtomMapping(); return mcsplus.isTimeout(); } MCSPlusHandler(IAtomContainer source, IAtomContainer target,
            boolean shouldMatchBonds, boolean shouldMatchRings, boolean matchAtomType);  MCSPlusHandler(IQueryAtomContainer source, IAtomContainer target); @Override synchronized List<AtomAtomMapping> getAllAtomMapping(); @Override synchronized AtomAtomMapping getFirstAtomMapping(); synchronized boolean isTimeout();  }