Convert distance matrix to similarity matrix?

Is there any easy way to convert a distance matrix to a similarity matrix (i.e. 1-value for each element of the matrix). 

Would be really useful for looking at molecular similarity.

Many thanks

Neil Berry

I don’t believe you can convert the distance matrix into a molecular similarity matrix. However you can generate one yourself.
Generate the fingerprints using rdkit etc.
Then use a chunk loop start set as 1.
Use the indigo fingerprint similarity node. To one port connect the data prior to the loop node. To the other port connect the data after the loop node.
If the column names are important to you, you could now insert a rename node and choose to name the column by the current variable. This step should be unnecessary however.
Now use the loop column append node.
This will give you a complete molecular similarity matrix.


Many thanks.

An alternative approach - I have used the distance matrix writer, followed by distance matrix reader using a linear transfomation (offset 1, scale -1) to get almost the desired result. The only thing lacking are the values on the diagonal which are still be reported as 0 (when they should be 1).