private static Map<Integer, Integer> getIndexMapping(AtomAtomMapping aam) { return aam.isEmpty() ? new TreeMap<>() : aam.getMappingsByIndex(); } }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + (this.getQuery() != null ? this.getQuery().hashCode() : 0); hash = 67 * hash + (this.getTarget() != null ? this.getTarget().hashCode() : 0); hash = 67 * hash + (this.mapping != null ? this.getMappingsByAtoms().hashCode() : 0); hash = 67 * hash + (this.mappingIndex != null ? this.getMappingsByIndex().hashCode() : 0); return hash; }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + (this.getQuery() != null ? this.getQuery().hashCode() : 0); hash = 67 * hash + (this.getTarget() != null ? this.getTarget().hashCode() : 0); hash = 67 * hash + (this.mapping != null ? this.getMappingsByAtoms().hashCode() : 0); hash = 67 * hash + (this.mappingIndex != null ? this.getMappingsByIndex().hashCode() : 0); return hash; }
@Override public int hashCode() { int hash = 7; hash = 67 * hash + (this.getQuery() != null ? this.getQuery().hashCode() : 0); hash = 67 * hash + (this.getTarget() != null ? this.getTarget().hashCode() : 0); hash = 67 * hash + (this.mapping != null ? this.getMappingsByAtoms().hashCode() : 0); hash = 67 * hash + (this.mappingIndex != null ? this.getMappingsByIndex().hashCode() : 0); return hash; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AtomAtomMapping other = (AtomAtomMapping) obj; if (this.getQuery() != other.getQuery() && (this.getQuery() == null || !this.query.equals(other.query))) { return false; } if (this.getTarget() != other.getTarget() && (this.getTarget() == null || !this.target.equals(other.target))) { return false; } if (this.mapping != other.getMappingsByAtoms() && (this.mapping == null || !this.mapping.equals(other.mapping))) { return false; } return this.mappingIndex == other.getMappingsByIndex() || (this.mappingIndex != null && this.mappingIndex.equals(other.mappingIndex)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AtomAtomMapping other = (AtomAtomMapping) obj; if (this.getQuery() != other.getQuery() && (this.getQuery() == null || !this.query.equals(other.query))) { return false; } if (this.getTarget() != other.getTarget() && (this.getTarget() == null || !this.target.equals(other.target))) { return false; } if (this.mapping != other.getMappingsByAtoms() && (this.mapping == null || !this.mapping.equals(other.mapping))) { return false; } return this.mappingIndex == other.getMappingsByIndex() || (this.mappingIndex != null && this.mappingIndex.equals(other.mappingIndex)); }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AtomAtomMapping other = (AtomAtomMapping) obj; if (this.getQuery() != other.getQuery() && (this.getQuery() == null || !this.query.equals(other.query))) { return false; } if (this.getTarget() != other.getTarget() && (this.getTarget() == null || !this.target.equals(other.target))) { return false; } if (this.mapping != other.getMappingsByAtoms() && (this.mapping == null || !this.mapping.equals(other.mapping))) { return false; } return this.mappingIndex == other.getMappingsByIndex() || (this.mappingIndex != null && this.mappingIndex.equals(other.mappingIndex)); }
synchronized MCSSolution copyOldSolutionToNew(int queryPosition, int targetPosition, IAtomContainer compound1, IAtomContainer compound2, MCSSolution oldSolution) { AtomAtomMapping atomAtomMapping = oldSolution.getAtomAtomMapping(); Map<Integer, Integer> mappingsByIndex = atomAtomMapping.getMappingsByIndex(); AtomAtomMapping atomAtomMappingNew = new AtomAtomMapping(compound1, compound2); mappingsByIndex.entrySet().forEach((m) -> { atomAtomMappingNew.put(compound1.getAtom(m.getKey()), compound2.getAtom(m.getValue())); }); MCSSolution mcsSolution = new MCSSolution(queryPosition, targetPosition, compound1, compound2, atomAtomMappingNew); mcsSolution.setEnergy(oldSolution.getEnergy()); mcsSolution.setFragmentSize(oldSolution.getFragmentSize()); mcsSolution.setStereoScore(oldSolution.getStereoScore()); return mcsSolution; }
synchronized MCSSolution copyOldSolutionToNew(int queryPosition, int targetPosition, IAtomContainer compound1, IAtomContainer compound2, MCSSolution oldSolution) { AtomAtomMapping atomAtomMapping = oldSolution.getAtomAtomMapping(); Map<Integer, Integer> mappingsByIndex = atomAtomMapping.getMappingsByIndex(); AtomAtomMapping atomAtomMappingNew = new AtomAtomMapping(compound1, compound2); mappingsByIndex.entrySet().forEach((m) -> { atomAtomMappingNew.put(compound1.getAtom(m.getKey()), compound2.getAtom(m.getValue())); }); MCSSolution mcsSolution = new MCSSolution(queryPosition, targetPosition, compound1, compound2, atomAtomMappingNew); mcsSolution.setEnergy(oldSolution.getEnergy()); mcsSolution.setFragmentSize(oldSolution.getFragmentSize()); mcsSolution.setStereoScore(oldSolution.getStereoScore()); return mcsSolution; }
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
chosen.stream().map((mapping) -> { Map<Integer, Integer> map = new TreeMap<>(); map.putAll(mapping.getMappingsByIndex()); return map; }).forEach((map) -> {
try { System.out.println("mcs size " + mcs.getAtomAtomMapping().getCount()); System.out.println("mcs map " + mcs.getAtomAtomMapping().getMappingsByIndex()); System.out.println("mcs " + mcs.getAtomAtomMapping().getCommonFragmentAsSMILES()); System.out.println("\n\n\n ");
int counter = 0; for (AtomAtomMapping aam : smsd.getAllAtomMapping()) { Map<Integer, Integer> mapping = aam.getMappingsByIndex(); if (argumentHandler.isImage() && !mapping.isEmpty()) { double stereoScore = smsd.getStereoScore(counter); Map<Integer, Integer> mcsNumber = smsd.getFirstAtomMapping().getMappingsByIndex(); double stereoScore = smsd.getStereoScore(0); outputHandler.printHeader(queryPath, targetPath, nAtomsMatched);
int counter = 0; for (AtomAtomMapping aam : smsd.getAllAtomMapping()) { Map<Integer, Integer> mapping = aam.getMappingsByIndex(); if (argumentHandler.isImage() && !mapping.isEmpty()) { double stereoScore = smsd.getStereoScore(counter); Map<Integer, Integer> mcsNumber = smsd.getFirstAtomMapping().getMappingsByIndex(); double stereoScore = smsd.getStereoScore(0); outputHandler.printHeader(queryPath, targetPath, nAtomsMatched);