Description Usage Arguments Details Value Author(s) See Also Examples
'cmp.cluster' uses structural compound descriptors and clusters the
compounds based on their pairwise distances. cmp.cluster
uses
single linkage to measure distance between clusters when it
merges clusters. It accepts both a single cutoff and a
cutoff vector. By using a cutoff vector, it can generate results
similar to hierarchical clustering after tree cutting.
1 2 |
db |
The desciptor database, in the format returned by 'cmp.parse'. |
cutoff |
The clustering cutoff. Can be a single value or a vector. The cutoff gives the maximum distance between two compounds in order to group them in the same cluster. |
is.similarity |
Set when the cutoff supplied is a similarity cutoff. This cutoff is the minimum similarity value between two compounds such that they will be grouped in the same cluster. |
save.distances |
whether to save distance for future clustering. See details below. |
use.distances |
Supply pre-computed distance matrix. |
quiet |
Whether to suppress the progress information. |
... |
Further arguments to be passed to |
cmp.cluster
will compute distances on the fly if use.distances
is not set.
Furthermore, if save.distances
is not set, the distance values computed will never be
stored and any distance between two compounds is guaranteed not to be
computed twice. Using this method, cmp.cluster
can deal with large databases
when a distance matrix in memory is not feasible. The speed of the clustering
function should be slowed when using a transient distance calculation.
When save.distances
is set, cmp.cluster
will be forced to compute the
distance matrix and save it in memory before the clustering. This is
useful when additional clusterings are required in the future without re-computed
the distance matrix. Set save.distances
to TRUE if you
only want to force the clustering to use this 2-step approach; otherwise,
set it to the filename under which you want the distance matrix to be
saved. After you save it, when you need to reuse the distance matrix, you
can 'load' it, and supply it to cmp.cluster
via the use.distances
argument.
cmp.cluster
supports a vector of several cutoffs. When you have multiple cutoffs,
cmp.cluster
still guarantees that pairwise distances will never be
recomputed, and no copy of distances is kept in memory. It is guaranteed to
be as fast as calling cmp.cluster
with a single cutoff that results in the
longest processing time, plus some small overhead linear in processing
time.
Returns a data.frame
. Besides a variable giving compound ID, each of the
other variables in the data frame will either give the cluster IDs of
compounds under some clustering cutoff, or the size of clusters that the
compounds belong to. When N cutoffs are given, in total 2*N+1 variables
will be generated, with N of them giving the cluster ID of each compound
under each of the N cutoffs, and the other N of them giving the cluster
size under each of the N cutoffs. The rows are sorted by cluster sizes.
Y. Eddie Cao, Li-Chang Cheng
cmp.parse1
, cmp.parse
, cmp.search
, cmp.similarity
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Load sample SD file
# data(sdfsample); sdfset <- sdfsample
## Generate atom pair descriptor database for searching
# apset <- sdf2ap(sdfset)
## Loads atom pair and atom pair fingerprint samples provided by library
data(apset)
db <- apset
fpset <- desc2fp(apset)
## Clustering of 'APset' object with multiple cutoffs
clusters <- cmp.cluster(db=apset, cutoff=c(0.5, 0.85))
## Clustering of 'FPset' object with multiple cutoffs. This method allows to call
## various similarity methods provided by the fpSim function.
clusters2 <- cmp.cluster(fpset, cutoff=c(0.5, 0.7), method="Tversky")
## Saves the distance matrix before clustering:
clusters <- cmp.cluster(db, cutoff=0.65, save.distances="distmat.rda")
# Later one reload the matrix and pass it the clustering function.
load("distmat.rda")
clusters <- cmp.cluster(db, cutoff=0.60, use.distances=distmat)
|
|
/ 0 %
-
\ 1 %
|
/ 1 %
-
\ 2 %
|
/ 2 %
-
\ 3 %
|
/ 3 %
-
\ 4 %
|
/ 4 %
-
\ 5 %
|
/
- 6 %
\
| 6 %
/
- 7 %
\
| 7 %
/
-
\ 8 %
|
/
- 9 %
\
| 10 %
/
- 10 %
\
| 11 %
/
- 11 %
\
| 12 %
/
- 12 %
\
| 13 %
/
- 13 %
\
| 14 %
/
- 14 %
\
| 15 %
/
- 15 %
\
| 16 %
/
- 16 %
\
| 17 %
/
- 17 %
\
| 18 %
/
- 18 %
\
| 19 %
/
- 19 %
\
| 20 %
/
- 20 %
\
| 21 %
/
- 21 %
\
| 22 %
/
- 22 %
\
| 23 %
/
- 23 %
\
|
/ 24 %
-
\ 25 %
|
/ 25 %
-
\
| 26 %
/
- 27 %
\
| 27 %
/
- 28 %
\
|
/ 29 %
-
\
| 30 %
/
-
\ 31 %
|
/
- 32 %
\
| 32 %
/
- 33 %
\
| 33 %
/
- 34 %
\
| 34 %
/
- 35 %
\
|
/ 36 %
-
\ 36 %
|
/ 37 %
-
\ 37 %
|
/ 38 %
-
\ 38 %
|
/ 39 %
-
\ 39 %
|
/ 40 %
-
\ 40 %
|
/ 41 %
-
\ 41 %
|
/ 42 %
-
\ 42 %
|
/ 43 %
-
\ 43 %
|
/ 44 %
-
\ 44 %
|
/ 45 %
-
\ 45 %
|
/ 46 %
-
\ 46 %
|
/ 47 %
-
\ 47 %
|
/ 48 %
-
\ 48 %
|
/ 49 %
-
\ 49 %
| 50 %
sorting result...
/
- 0 %
\
| 1 %
/
- 1 %
\
|
/ 2 %
-
\ 3 %
|
/ 3 %
-
\ 4 %
|
/
-
\
| 6 %
/
- 6 %
\
| 7 %
/
-
\
|
/
-
\
|
/
-
\
|
/
-
\ 14 %
|
/
-
\ 15 %
|
/ 16 %
-
\ 16 %
|
/
- 17 %
\
| 18 %
/
- 18 %
\
| 19 %
/
- 19 %
\
| 20 %
/
- 20 %
\
| 21 %
/
- 21 %
\
| 22 %
/
- 22 %
\
| 23 %
/
- 23 %
\
| 24 %
/
- 24 %
\
| 25 %
/
- 25 %
\
| 26 %
/
- 26 %
\
| 27 %
/
- 27 %
\
| 28 %
/
- 28 %
\
| 29 %
/
- 29 %
\
| 30 %
/
- 30 %
\
|
/ 31 %
-
\ 32 %
|
/ 32 %
-
\
| 33 %
/
-
\ 34 %
|
/
- 35 %
\
|
/ 36 %
-
\ 37 %
|
/ 37 %
-
\ 38 %
|
/ 38 %
-
\ 39 %
|
/ 39 %
-
\ 40 %
|
/
- 41 %
\
| 41 %
/
- 42 %
\
| 42 %
/
- 43 %
\
| 43 %
/
- 44 %
\
| 44 %
/
- 45 %
\
| 45 %
/
- 46 %
\
| 46 %
/
- 47 %
\
| 47 %
/
- 48 %
\
| 48 %
/
- 49 %
\
| 49 %
/ 50 %
sorting result...
calculating distance matrix
- 2.00999897969595 %
\ 3.99959187837976 %
| 5.96877869605142 %
/ 7.91755943271095 %
- 9.84593408835833 %
\ 11.7539026629936 %
| 13.6414651566167 %
/ 15.5086215692276 %
- 17.3553719008264 %
\ 19.1817161514131 %
| 20.9876543209877 %
/ 22.77318640955 %
- 24.5383124171003 %
\ 26.2830323436384 %
| 28.0073461891644 %
/ 29.7112539536782 %
- 31.3947556371799 %
\ 33.0578512396694 %
| 34.7005407611468 %
/ 36.3228242016121 %
- 37.9247015610652 %
\ 39.5061728395062 %
| 41.067238036935 %
/ 42.6078971533517 %
- 44.1281501887563 %
\ 45.6279971431487 %
| 47.1074380165289 %
/ 48.566472808897 %
- 50.005101520253 %
\ 51.4233241505969 %
| 52.8211406999286 %
/ 54.1985511682481 %
- 55.5555555555556 %
\ 56.8921538618508 %
| 58.208346087134 %
/ 59.504132231405 %
- 60.7795122946638 %
\ 62.0344862769105 %
| 63.2690541781451 %
/ 64.4832159983675 %
- 65.6769717375778 %
\ 66.8503213957759 %
| 68.0032649729619 %
/ 69.1358024691358 %
- 70.2479338842975 %
\ 71.3396592184471 %
| 72.4109784715845 %
/ 73.4618916437098 %
- 74.492398734823 %
\ 75.502499744924 %
| 76.4921946740129 %
/ 77.4614835220896 %
- 78.4103662891542 %
\ 79.3388429752066 %
| 80.2469135802469 %
/ 81.1345781042751 %
- 82.0018365472911 %
\ 82.848688909295 %
| 83.6751351902867 %
/ 84.4811753902663 %
- 85.2668095092338 %
\ 86.0320375471891 %
| 86.7768595041322 %
/ 87.5012753800633 %
- 88.2052851749821 %
\ 88.8888888888889 %
| 89.5520865217835 %
/ 90.1948780736659 %
- 90.8172635445363 %
\ 91.4192429343944 %
| 92.0008162432405 %
/ 92.5619834710744 %
- 93.1027446178961 %
\ 93.6230996837057 %
| 94.1230486685032 %
/ 94.6025915722885 %
- 95.0617283950617 %
\ 95.5004591368228 %
| 95.9187837975717 %
/ 96.3167023773084 %
- 96.6942148760331 %
\ 97.0513212937455 %
| 97.3880216304459 %
/ 97.7043158861341 %
- 98.0002040608101 %
\ 98.275686154474 %
| 98.5307621671258 %
/ 98.7654320987654 %
- 98.9796959493929 %
\ 99.1735537190083 %
| 99.3470054076115 %
/ 99.5000510152025 %
- 99.6326905417815 %
\ 99.7449239873482 %
| 99.8367513519029 %
/ 99.9081726354454 %
- 99.9591878379757 %
\ 99.9897969594939 %
| 100 %distance matrix is successfully generated
/
- 0 %
\
| 1 %
/
- 1 %
\
| 2 %
/
- 2 %
\
| 3 %
/
- 3 %
\
| 4 %
/
- 4 %
\
| 5 %
/
- 5 %
\
| 6 %
/
- 6 %
\
| 7 %
/
- 7 %
\
| 8 %
/
- 8 %
\
| 9 %
/
- 9 %
\
| 10 %
/
- 10 %
\
| 11 %
/
- 11 %
\
| 12 %
/
- 12 %
\
| 13 %
/
- 13 %
\
| 14 %
/
- 14 %
\
| 15 %
/
- 15 %
\
| 16 %
/
- 16 %
\
| 17 %
/
- 17 %
\
| 18 %
/
- 18 %
\
| 19 %
/
- 19 %
\
| 20 %
/
- 20 %
\
| 21 %
/
- 21 %
\
| 22 %
/
- 22 %
\
| 23 %
/
- 23 %
\
|
/ 24 %
-
\ 25 %
|
/ 25 %
-
\ 26 %
|
/ 26 %
-
\
| 27 %
/
-
\ 28 %
|
/
- 29 %
\
|
/ 30 %
-
\ 31 %
|
/ 31 %
-
\ 32 %
|
/ 32 %
-
\ 33 %
|
/ 33 %
-
\ 34 %
|
/ 34 %
-
\ 35 %
|
/ 35 %
-
\ 36 %
|
/ 36 %
-
\ 37 %
|
/ 37 %
-
\ 38 %
|
/ 38 %
-
\ 39 %
|
/ 39 %
-
\ 40 %
|
/ 40 %
-
\ 41 %
|
/ 41 %
-
\ 42 %
|
/ 42 %
-
\ 43 %
|
/ 43 %
-
\ 44 %
|
/ 44 %
-
\ 45 %
|
/ 45 %
-
\ 46 %
|
/ 46 %
-
\ 47 %
|
/ 47 %
-
\ 48 %
|
/ 48 %
-
\ 49 %
|
/ 49 %
- 50 %
sorting result...
\
| 0 %
/
- 1 %
\
| 1 %
/
- 2 %
\
| 2 %
/
- 3 %
\
| 3 %
/
- 4 %
\
| 4 %
/
- 5 %
\
| 5 %
/
- 6 %
\
| 6 %
/
- 7 %
\
| 7 %
/
- 8 %
\
| 8 %
/
- 9 %
\
| 9 %
/
- 10 %
\
| 10 %
/
- 11 %
\
| 11 %
/
- 12 %
\
| 12 %
/
- 13 %
\
| 13 %
/
- 14 %
\
| 14 %
/
- 15 %
\
| 15 %
/
- 16 %
\
| 16 %
/
- 17 %
\
| 17 %
/
- 18 %
\
| 18 %
/
- 19 %
\
| 19 %
/
- 20 %
\
| 20 %
/
- 21 %
\
| 21 %
/
- 22 %
\
| 22 %
/
- 23 %
\
| 23 %
/
-
\ 24 %
|
/ 25 %
-
\ 25 %
|
/ 26 %
-
\ 26 %
|
/
- 27 %
\
|
/ 28 %
-
\
| 29 %
/
-
\ 30 %
|
/ 31 %
-
\ 31 %
|
/ 32 %
-
\ 32 %
|
/ 33 %
-
\ 33 %
|
/ 34 %
-
\ 34 %
|
/ 35 %
-
\ 35 %
|
/ 36 %
-
\ 36 %
|
/ 37 %
-
\ 37 %
|
/ 38 %
-
\ 38 %
|
/ 39 %
-
\ 39 %
|
/ 40 %
-
\ 40 %
|
/ 41 %
-
\ 41 %
|
/ 42 %
-
\ 42 %
|
/ 43 %
-
\ 43 %
|
/ 44 %
-
\ 44 %
|
/ 45 %
-
\ 45 %
|
/ 46 %
-
\ 46 %
|
/ 47 %
-
\ 47 %
|
/ 48 %
-
\ 48 %
|
/ 49 %
-
\ 49 %
| 50 %
sorting result...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.