Icon

20230105 Pikairos How to Calculate Hamming Distances from Tanimoto Distances

This workflow provides a possible solution to question asked by BenJones in KNIME Forum post #58381:

Does anyone know of a Hamming distance node that is available?

The example is appropriate to the comparison of Bit Vectors, i.e. fingerprints from SMILES


Moleculesdefined as SMILESPartition Setinto Two SubsetsCompute Tanimoto FirstInter subsetsCalculateMorgan Fingerprint(Bit Vector Type)Cardinality ofBit VectorsConvert intoHamming Distance:|A and B| = T( A, B) * (|A| + |B|) / ( 1 + T( A, B)) Recover Cardinalityfrom 2nd subsetAll Against AllCompute Tanimoto FirstIntra subsetConvert intoHamming Distance:|A and B| = T( A, B) * (|A| + |B|) / ( 1 + T( A, B)) Recover Cardinalityfrom Initial subsetTable Creator Molecule Type Cast Partitioning Similarity Search RDKit Fingerprint Cardinality Math Formula Joiner Similarity Search Math Formula Joiner Moleculesdefined as SMILESPartition Setinto Two SubsetsCompute Tanimoto FirstInter subsetsCalculateMorgan Fingerprint(Bit Vector Type)Cardinality ofBit VectorsConvert intoHamming Distance:|A and B| = T( A, B) * (|A| + |B|) / ( 1 + T( A, B)) Recover Cardinalityfrom 2nd subsetAll Against AllCompute Tanimoto FirstIntra subsetConvert intoHamming Distance:|A and B| = T( A, B) * (|A| + |B|) / ( 1 + T( A, B)) Recover Cardinalityfrom Initial subsetTable Creator Molecule Type Cast Partitioning Similarity Search RDKit Fingerprint Cardinality Math Formula Joiner Similarity Search Math Formula Joiner

Nodes

Extensions

Links