Hi !
I'm currently using this protocol in order to cluster a dataset of molecules !! The criteria is a Fingerprint who looks like ECFP, such as a column as below :
786456
56486
4564
8748974
...
The problem, is that the clustering didnt provides good results. Is there any possibility to make a cluster from a binary fingerprint ?
Or is it possible to cluster from a similarity matrix ?
Best regards
I'm currently using this protocol in order to cluster a dataset of molecules !! The criteria is a Fingerprint who looks like ECFP, such as a column as below :
786456
56486
4564
8748974
...
The problem, is that the clustering didnt provides good results. Is there any possibility to make a cluster from a binary fingerprint ?
Or is it possible to cluster from a similarity matrix ?
Best regards

Sylvain,
R does not directly handle the sparse binary fingerprints used in PP. As a result, fingerprints must be "folded" before sending them to R. See this posting for some of the details and consequences when building models.
By default, R Cluster Agnes folds fingerprints to a 256 element "Fixed-Length Array of Counts", which is an array of 256 integers, each from 0 to the number of bits folded to that location. You can try changing the Convert Fingerprints To and Fixed Length parameters to vary the way the folding is done. Note though that the R agnes() function only supports Euclidean and Manhattan distances, but not the Tanimoto distance that is more appropriate for fingerprints.
If adjusting the component parameters does not help, you can indeed pass a distance matrix into the clusterer (which is created by just taking 1 minus each element of the similarity matrix). To use this option, set DataIsDistanceMatix to True, and UseProperties to AllPropertiesOnFirstData. The simplest way to generate the required distance matrix is to use the Property Distance NxN component with the distance measure set to Tanimoto and your fingerprint as the property to use. Then send the output of this component directly into the clusterer.
One warning: R does not handle really large data sets very well, and it is easy for a distance matrix to become large. (E.g., for 1000 compounds, the distance matrix has a million elements.) Also, computation of the distance matrix is order(N^2) in time. So, realistically, this approach should work for up to a few thousand compounds, but probably no more. I ran a couple of benchmark calculations and found that clustering 1000 compounds with this approach takes about 40 seconds. But for 10000 compounds, it has taken 22 minutes so far, and I am only half-way through the calculation of the distance matrix.
UPDATE: After 56 minutes running the protocol, the distance matrix was completed and sent to R, but R crashed with an out-of-memory error. (On my Windows machine, I have limited R to a 1.5 GB memory footprint, but on Linux you can go larger if you want to push the limits.)