private synchronized void vfLibMCSAlgorithm() { VF2MCS mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new VF2MCS((IQueryAtomContainer) getQuery(), getTarget(), atomMatcher, bondMatcher); } else { mcs = new VF2MCS(getQuery(), getTarget(), atomMatcher, bondMatcher); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
private synchronized void singleMapping() { SingleMappingHandler mcs; mcs = new SingleMappingHandler(getQuery(), getTarget(), atomMatcher); clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
private synchronized boolean cdkMCSAlgorithm() { CDKMCSHandler mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new CDKMCSHandler(getQuery(), getTarget(), atomMatcher, bondMatcher); } else { mcs = new CDKMCSHandler(getQuery(), getTarget(), atomMatcher, bondMatcher); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); return mcs.isTimeout(); }
private synchronized void singleMapping() { SingleMappingHandler mcs; mcs = new SingleMappingHandler(getQuery(), getTarget(), isMatchRings()); clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
private synchronized void singleMapping() { SingleMappingHandler mcs; mcs = new SingleMappingHandler(getQuery(), getTarget(), isMatchRings()); clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
/** * * @return true if query is a subgraph of the target */ @Override public synchronized boolean isSubgraph() { float mappingSize; if (getMappingCount() > 0) { mappingSize = getAllAtomMapping().iterator().next().getCount(); } else { return false; } int sourceAtomCount = getQuery().getAtomCount(); int targetAtomCount = getTarget().getAtomCount(); if (mappingSize == sourceAtomCount && mappingSize <= targetAtomCount) { if (mappingSize == 1) { return true; } else if (!getAllBondMaps().isEmpty() && getAllBondMaps().iterator().next().size() == getQuery().getBondCount()) { return true; } } return false; }
private synchronized void vfLibMCSAlgorithm() { VF2MCS mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new VF2MCS((IQueryAtomContainer) getQuery(), getTarget()); } else { mcs = new VF2MCS(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
/** * * @return true if query is a subgraph of the target */ @Override public synchronized boolean isSubgraph() { float mappingSize; if (getMappingCount() > 0) { mappingSize = getAllAtomMapping().iterator().next().getCount(); } else { return false; } int sourceAtomCount = getQuery().getAtomCount(); int targetAtomCount = getTarget().getAtomCount(); if (mappingSize == sourceAtomCount && mappingSize <= targetAtomCount) { if (mappingSize == 1) { return true; } else if (!getAllBondMaps().isEmpty() && getAllBondMaps().iterator().next().size() == getQuery().getBondCount()) { return true; } } return false; }
/** * * @return true if query is a subgraph of the target */ @Override public synchronized boolean isSubgraph() { float mappingSize; if (getMappingCount() > 0) { mappingSize = getAllAtomMapping().iterator().next().getCount(); } else { return false; } int sourceAtomCount = getQuery().getAtomCount(); int targetAtomCount = getTarget().getAtomCount(); if (mappingSize == sourceAtomCount && mappingSize <= targetAtomCount) { if (mappingSize == 1) { return true; } else if (!getAllBondMaps().isEmpty() && getAllBondMaps().iterator().next().size() == getQuery().getBondCount()) { return true; } } return false; }
private synchronized void vfLibMCSAlgorithm() { VF2MCS mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new VF2MCS((IQueryAtomContainer) getQuery(), getTarget()); } else { mcs = new VF2MCS(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); }
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(); }
private synchronized boolean cdkMCSAlgorithm() { CDKMCSHandler mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new CDKMCSHandler(getQuery(), getTarget()); } else { mcs = new CDKMCSHandler(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); return mcs.isTimeout(); }
private synchronized boolean cdkMCSAlgorithm() { CDKMCSHandler mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new CDKMCSHandler(getQuery(), getTarget()); } else { mcs = new CDKMCSHandler(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); return mcs.isTimeout(); }
private synchronized boolean mcsPlusAlgorithm() { MCSPlusHandler mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new MCSPlusHandler((IQueryAtomContainer) getQuery(), getTarget()); } else { mcs = new MCSPlusHandler(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); return mcs.isTimeout(); }
private synchronized boolean mcsPlusAlgorithm() { MCSPlusHandler mcs; if (getQuery() instanceof IQueryAtomContainer) { mcs = new MCSPlusHandler((IQueryAtomContainer) getQuery(), getTarget()); } else { mcs = new MCSPlusHandler(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType()); } clearMaps(); getMCSList().addAll(mcs.getAllAtomMapping()); return mcs.isTimeout(); }
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(); }
synchronized MCSSolution addMCSSolution(int queryPosition, int targetPosition, String key, ThreadSafeCache<String, MCSSolution> mappingcache, Isomorphism isomorphism) { isomorphism.setChemFilters(true, true, true); /* * In case of Complete subgraph, don't use Energy filter * */ MCSSolution mcs = new MCSSolution(queryPosition, targetPosition, isomorphism.getQuery(), isomorphism.getTarget(), isomorphism.getFirstAtomMapping()); mcs.setEnergy(isomorphism.getEnergyScore(0)); mcs.setFragmentSize(isomorphism.getFragmentSize(0)); mcs.setStereoScore(isomorphism.getStereoScore(0)); if (!mappingcache.containsKey(key)) { mappingcache.put(key, mcs); } return mcs; } }
private synchronized void defaultMCSAlgorithm() { try { boolean substructureAlgorithm = substructureAlgorithm(); if (!substructureAlgorithm) { boolean timeoutMCS1 = cdkMCSAlgorithm(); if ((getMappingCount() == 0 && timeoutMCS1) || (timeoutMCS1 && getMappingCount() > 0 && (getFirstAtomMapping().getCount() != getQuery().getAtomCount() || getFirstAtomMapping().getCount() != getTarget().getAtomCount()))) { vfLibMCSAlgorithm(); } } } catch (CDKException e) { logger.error(Level.SEVERE, null, e); } }
private synchronized void defaultMCSAlgorithm() { try { boolean substructureAlgorithm = substructureAlgorithm(); if (!substructureAlgorithm) { boolean timeoutMCS1 = cdkMCSAlgorithm(); if ((getMappingCount() == 0 && timeoutMCS1) || (timeoutMCS1 && getMappingCount() > 0 && (getFirstAtomMapping().getCount() != getQuery().getAtomCount() || getFirstAtomMapping().getCount() != getTarget().getAtomCount()))) { vfLibMCSAlgorithm(); } } } catch (CDKException e) { logger.error(Level.SEVERE, null, e); } }