private synchronized boolean singleMapping() { SingleMappingHandler mcs; if (!(getQuery() instanceof IQueryAtomContainer) && !(getTarget() instanceof IQueryAtomContainer)) { mcs = new SingleMappingHandler(getQuery(), getTarget(), atomMatcher); } else { mcs = new SingleMappingHandler((IQueryAtomContainer) getQuery(), getTarget(), atomMatcher); } return mcs.getAllAtomMapping() != null && !mcs.getAllAtomMapping().isEmpty(); } }
private synchronized boolean singleMapping() { SingleMappingHandler mcs; if (!(getQuery() instanceof IQueryAtomContainer) && !(getTarget() instanceof IQueryAtomContainer)) { mcs = new SingleMappingHandler(getQuery(), getTarget(), isMatchRings()); } else { mcs = new SingleMappingHandler((IQueryAtomContainer) getQuery(), getTarget()); } return mcs.getAllAtomMapping() != null && !mcs.getAllAtomMapping().isEmpty(); } }
private synchronized boolean singleMapping() { SingleMappingHandler mcs; if (!(getQuery() instanceof IQueryAtomContainer) && !(getTarget() instanceof IQueryAtomContainer)) { mcs = new SingleMappingHandler(getQuery(), getTarget(), isMatchRings()); } else { mcs = new SingleMappingHandler((IQueryAtomContainer) getQuery(), getTarget()); } return mcs.getAllAtomMapping() != null && !mcs.getAllAtomMapping().isEmpty(); } }
boolean isSubgraph; if ((getTarget() == null) || (getQuery() == null)) { throw new CDKException("Query or Target molecule is not initialized (NULL)"); if (getQuery().getAtomCount() > getTarget().getAtomCount()) { return false; if (getQuery().getAtomCount() == 1 || getTarget().getAtomCount() == 1) { isSubgraph = singleMapping(); } else { List<AtomAtomMapping> mappingsVF2 = new ArrayList<>(); VF2Sub mapper; if (getQuery() instanceof IQueryAtomContainer) { mapper = new VF2Sub((IQueryAtomContainer) getQuery(), getTarget()); } else { mapper = new VF2Sub(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType());
boolean isSubgraph; if ((getTarget() == null) || (getQuery() == null)) { throw new CDKException("Query or Target molecule is not initialized (NULL)"); if (getQuery().getAtomCount() > getTarget().getAtomCount()) { return false; if (getQuery().getAtomCount() == 1 || getTarget().getAtomCount() == 1) { isSubgraph = singleMapping(); } else { if (getQuery() instanceof IQueryAtomContainer) { mapper = new VF2((IQueryAtomContainer) getQuery(), getTarget()); } else { mapper = new VF2(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType());
boolean isSubgraph; if ((getTarget() == null) || (getQuery() == null)) { throw new CDKException("Query or Target molecule is not initialized (NULL)"); if (getQuery().getAtomCount() > getTarget().getAtomCount()) { return false; int rBondCount = getQuery().getBondCount(); int pBondCount = getTarget().getBondCount(); int rAtomCount = getQuery().getAtomCount(); int pAtomCount = getTarget().getAtomCount(); int expectedMaxGraphmatch = expectedMaxGraphmatch(getQuery(), getTarget()); List<AtomAtomMapping> mappingsVF2 = new ArrayList<>(); VF2Substructure mapper; if (getQuery() instanceof IQueryAtomContainer) { mapper = new VF2Substructure((IQueryAtomContainer) getQuery(), getTarget(), findAllMatches, atomMatcher, bondMatcher); } else { if (DEBUG) { System.out.println("calling VF2Sub"); mapper = new VF2Substructure(getQuery(), getTarget(), atomMatcher, bondMatcher, findAllMatches); if (DEBUG) { System.out.println("done calling VF2Sub");
boolean isSubgraph; if ((getTarget() == null) || (getQuery() == null)) { throw new CDKException("Query or Target molecule is not initialized (NULL)"); if (getQuery().getAtomCount() > getTarget().getAtomCount()) { return false; if (getQuery().getAtomCount() == 1 || getTarget().getAtomCount() == 1) { isSubgraph = singleMapping(); } else { List<AtomAtomMapping> mappingsVF2 = new ArrayList<>(); VF2Sub mapper; if (getQuery() instanceof IQueryAtomContainer) { mapper = new VF2Sub((IQueryAtomContainer) getQuery(), getTarget()); } else { mapper = new VF2Sub(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType());
boolean isSubgraph; if ((getTarget() == null) || (getQuery() == null)) { throw new CDKException("Query or Target molecule is not initialized (NULL)"); if (getQuery().getAtomCount() > getTarget().getAtomCount()) { return false; if (getQuery().getAtomCount() == 1 || getTarget().getAtomCount() == 1) { isSubgraph = singleMapping(); } else { if (getQuery() instanceof IQueryAtomContainer) { mapper = new VF2((IQueryAtomContainer) getQuery(), getTarget()); } else { mapper = new VF2(getQuery(), getTarget(), isMatchBonds(), isMatchRings(), isMatchAtomType());
private synchronized void setVFMappings(List<AtomAtomMapping> mappingsVF2) { int counter = 0; for (AtomAtomMapping solution : mappingsVF2) { AtomAtomMapping atomatomMapping = new AtomAtomMapping(getQuery(), getTarget()); if (solution.getCount() > vfMappingSize) { this.vfMappingSize = solution.getCount(); counter = 0; } solution.getMappingsByAtoms().entrySet().stream().forEach((mapping) -> { IAtom qAtom; IAtom tAtom; qAtom = mapping.getKey(); tAtom = mapping.getValue(); if (qAtom != null && tAtom != null) { atomatomMapping.put(qAtom, tAtom); } else { try { throw new CDKException("Atom index pointing to NULL"); } catch (CDKException ex) { Logger.error(Level.SEVERE, null, ex); } } }); if (!atomatomMapping.isEmpty() && !hasMap(atomatomMapping, getMCSList()) && atomatomMapping.getCount() == vfMappingSize) { getMCSList().add(counter, atomatomMapping); counter++; } } }
private synchronized void setVFMappings(List<AtomAtomMapping> mappingsVF2) { int counter = 0; for (AtomAtomMapping solution : mappingsVF2) { AtomAtomMapping atomatomMapping = new AtomAtomMapping(getQuery(), getTarget()); if (solution.getCount() > vfMappingSize) { this.vfMappingSize = solution.getCount(); counter = 0; } for (Map.Entry<IAtom, IAtom> mapping : solution.getMappingsByAtoms().entrySet()) { IAtom qAtom; IAtom tAtom; qAtom = mapping.getKey(); tAtom = mapping.getValue(); if (qAtom != null && tAtom != null) { atomatomMapping.put(qAtom, tAtom); } else { try { throw new CDKException("Atom index pointing to NULL"); } catch (CDKException ex) { Logger.error(Level.SEVERE, null, ex); } } } if (!atomatomMapping.isEmpty() && !hasMap(atomatomMapping, getMCSList()) && atomatomMapping.getCount() == vfMappingSize) { getMCSList().add(counter, atomatomMapping); counter++; } } }
private synchronized void setVFMappings(List<AtomAtomMapping> mappingsVF2) { int counter = 0; for (AtomAtomMapping solution : mappingsVF2) { AtomAtomMapping atomatomMapping = new AtomAtomMapping(getQuery(), getTarget()); if (solution.getCount() > vfMappingSize) { this.vfMappingSize = solution.getCount(); counter = 0; } for (Map.Entry<IAtom, IAtom> mapping : solution.getMappingsByAtoms().entrySet()) { IAtom qAtom; IAtom tAtom; qAtom = mapping.getKey(); tAtom = mapping.getValue(); if (qAtom != null && tAtom != null) { atomatomMapping.put(qAtom, tAtom); } else { try { throw new CDKException("Atom index pointing to NULL"); } catch (CDKException ex) { Logger.error(Level.SEVERE, null, ex); } } } if (!atomatomMapping.isEmpty() && !hasMap(atomatomMapping, getMCSList()) && atomatomMapping.getCount() == vfMappingSize) { getMCSList().add(counter, atomatomMapping); counter++; } } }
if (isMatchRings()) { try { MoleculeInitializer.initializeMolecule(getQuery()); MoleculeInitializer.initializeMolecule(getTarget()); } catch (CDKException ex) {
if (isMatchRings()) { try { MoleculeInitializer.initializeMolecule(getQuery()); MoleculeInitializer.initializeMolecule(getTarget()); } catch (CDKException ex) {
substructure.getQuery(), substructure.getTarget(), substructure.getFirstAtomMapping()); mcs.setEnergy(substructure.getEnergyScore(0)); mcs.setFragmentSize(substructure.getFragmentSize(0)); System.out.println("Found Substructure 2"); AtomAtomMapping aam = new AtomAtomMapping(substructure.getTarget(), substructure.getQuery()); Map<IAtom, IAtom> mappings = substructure.getFirstAtomMapping().getMappingsByAtoms(); mappings.keySet().stream().forEach((atom1) -> { }); MCSSolution mcs = new MCSSolution(getQueryPosition(), getTargetPosition(), substructure.getTarget(), substructure.getQuery(), aam); mcs.setEnergy(substructure.getEnergyScore(0)); mcs.setFragmentSize(substructure.getFragmentSize(0));