cluster.sizestat: generate statistics on sizes of clusters

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/cluster.R

Description

'cluster.sizestat' is used to do simple statistics on sizes of clusters generated by 'cmp.cluster'. It will return a dataframe which maps a cluster size to the number of clusters with that size. It is often used along with 'cluster.visualize'.

Usage

1
cluster.sizestat(cls, cluster.result=1)

Arguments

cls

The clustering result returned by 'cmp.cluster'

cluster.result

If multiple cutoff values are used in clustering process, this argument tells which cutoff value is to be considered here.

Details

'cluster.sizestat' depends on the format that is returned by 'cmp.cluster' - it will treat the first column as the indecies, and the second column as the cluster sizes of effective clustering. Because of this, when multiple cutoffs are used when 'cmp.cluster' is called, 'cluster.sizestat' will only consider the clustering result of the first cutoff. If you want to work on an alternative cutoff, you have to manually reorder/remove columns.

Value

Returns a data frame of two columns.

cluster size

This column lists cluster sizes

count

This column lists number of clusters of a cluster size

Author(s)

Y. Eddie Cao

See Also

cmp.cluster, cluster.visualize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Load sample SD file
# data(sdfsample); sdfset <- sdfsample

## Generate atom pair descriptor database for searching
# apset <- sdf2ap(sdfset) 

## Loads same atom pair sample data set provided by library
data(apset) 

## Binning clustering using variable similarity cutoffs.
cluster <- cmp.cluster(db=apset, cutoff = c(0.65, 0.5))

## Statistics on sizes of clusters
cluster.sizestat(cluster[,c(1,2,3)])
cluster.sizestat(cluster[,c(1,4,5)])

Example output

 |
                                           
/ 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...
  cluster size count
1            1    90
2            2     5
  cluster size count
1            1    80
2            2    10

ChemmineR documentation built on Feb. 28, 2021, 2:02 a.m.