private static int getSMSDSolutionCount(IAtomContainer queryMol, IAtomContainer target) throws CDKException { Substructure substructure = new Substructure(queryMol, target, true, true, true, false); if (substructure.isSubgraph()) { return 1; } else { return 0; } }
private synchronized boolean substructureAlgorithm() throws CDKException { if (DEBUG) { System.out.println("Check substructureAlgorithm"); } Substructure mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new Substructure((IQueryAtomContainer) getQuery(), getTarget(), atomMatcher, bondMatcher, true); } else { mcs = new Substructure(getQuery(), getTarget(), atomMatcher, bondMatcher, true); } clearMaps(); if (mcs.isSubgraph()) { getMCSList().addAll(mcs.getAllAtomMapping()); } return mcs.isSubgraph(); }
/** * If either is a subgraph * * @param ac1 * @param ac2 * @return * @throws CDKException */ public static boolean isMatch(IAtomContainer ac1, IAtomContainer ac2, boolean either) throws CDKException { AtomMatcher atomMatcher = AtomBondMatcher.atomMatcher(false, true); BondMatcher bondMatcher = AtomBondMatcher.bondMatcher(true, true); if (ac1.getAtomCount() <= ac2.getAtomCount()) { Substructure pattern = new Substructure(ac1, ac2, atomMatcher, bondMatcher, false); // create pattern return pattern.isSubgraph(); } if (either && ac1.getAtomCount() >= ac2.getAtomCount()) { Substructure pattern = new Substructure(ac2, ac1, atomMatcher, bondMatcher, false); // create pattern return pattern.isSubgraph(); } return false; }
private synchronized boolean substructureAlgorithm() throws CDKException { Substructure mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new Substructure((IQueryAtomContainer) getQuery(), getTarget(), true); } else { mcs = new Substructure(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType(), true); } clearMaps(); if (mcs.isSubgraph()) { getMCSList().addAll(mcs.getAllAtomMapping()); } return mcs.isSubgraph(); }
private synchronized boolean substructureAlgorithm() throws CDKException { Substructure mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new Substructure((IQueryAtomContainer) getQuery(), getTarget(), true); } else { mcs = new Substructure(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType(), true); } clearMaps(); if (mcs.isSubgraph()) { getMCSList().addAll(mcs.getAllAtomMapping()); } return mcs.isSubgraph(); }
private synchronized boolean isSubgraphIdentical(IAtomContainer _mol, IAtomContainer _rMol, boolean removeHydrogen) throws CDKException, IOException { // System.out.println("Graph matching"); IAtomContainer mol1 = _mol; IAtomContainer mol2 = _rMol; AtomMatcher atomMatcher = AtomBondMatcher.atomMatcher(true, true); BondMatcher bondMatcher = AtomBondMatcher.bondMatcher(true, true); Substructure mcs = new Substructure(mol1, mol2, atomMatcher, bondMatcher, false); mcs.setChemFilters(false, false, false); return mcs.isSubgraph() && !mcs.isStereoMisMatch() && mol1.getAtomCount() == mol2.getAtomCount(); }
if (!substructure.isSubgraph() && !theory.equals(IMappingAlgorithm.RINGS)) { am = AtomBondMatcher.atomMatcher(false, ringFlag); bm = AtomBondMatcher.bondMatcher(false, isHasPerfectRings()); } else if (moleculeConnected && !substructure.isSubgraph()) { am = AtomBondMatcher.atomMatcher(false, false); bm = AtomBondMatcher.bondMatcher(false, isHasPerfectRings()); if (substructure.isSubgraph() && substructure.getFirstAtomMapping().getCount() == ac1.getAtomCount()) { if (DEBUG1) { if (!substructure.isSubgraph() && !theory.equals(IMappingAlgorithm.RINGS)) { am = AtomBondMatcher.atomMatcher(false, ringFlag); bm = AtomBondMatcher.bondMatcher(false, isHasPerfectRings()); } else if (moleculeConnected && !substructure.isSubgraph()) { am = AtomBondMatcher.atomMatcher(false, false); bm = AtomBondMatcher.bondMatcher(false, isHasPerfectRings()); if (substructure.isSubgraph() && substructure.getFirstAtomMapping().getCount() == ac2.getAtomCount()) {
private boolean isSubgraphIdentical(IAtomContainer qMol, IAtomContainer tMol, boolean removeHydrogen) throws CDKException, IOException, CloneNotSupportedException { // System.out.println("Graph matching"); IAtomContainer mol1 = qMol.clone(); IAtomContainer mol2 = tMol.clone(); if (removeHydrogen) { mol1 = removeHydrogens(mol1); percieveAtomTypesAndConfigureAtoms(mol1); aromatizeMolecule(mol1); mol2 = removeHydrogens(mol2); percieveAtomTypesAndConfigureAtoms(mol2); aromatizeMolecule(mol2); } if (mol1.getAtomCount() != mol2.getAtomCount()) { return false; } AtomMatcher atomMatcher = AtomBondMatcher.atomMatcher(true, true); BondMatcher bondMatcher = AtomBondMatcher.bondMatcher(true, true); Substructure mcs = new Substructure(mol1, mol2, atomMatcher, bondMatcher, false); mcs.setChemFilters(true, true, true); return mcs.isSubgraph() && !mcs.isStereoMisMatch(); } }
if (isomorphism.isSubgraph()) { isomorphism.setChemFilters(true, true, true);