@Override public IBitFingerprint getBitFingerprint(IAtomContainer container) throws CDKException { BitSet fp = new BitSet(pathToBit.size()); List<String> paths = new ArrayList<>(); calculate(paths, container); for (String path : paths) fp.set(pathToBit.get(path)); return new BitSetFingerprint(fp); }
@Override public Map<String, Integer> getRawFingerprint(IAtomContainer mol) throws CDKException { Map<String,Integer> raw = new HashMap<>(); List<String> paths = new ArrayList<>(); calculate(paths, mol); Collections.sort(paths); int count = 0; String prev = null; for (String path : paths) { if (prev == null || !path.equals(prev)) { if (count > 0) raw.put(prev, count); count = 1; prev = path; } else { ++count; } } if (count > 0) raw.put(prev, count); return raw; }