hca: Hierarchical clustering analysis

Description Usage Arguments Details Value See Also Examples

View source: R/hca.R View source: R/hca2.R

Description

hca takes an expression matrix as input and works through sequentially-dependent computations to produce a list with the following objects:

  1. 'm': your input (expression) matrix

  2. 'cr': a correlation (or similarity) matrix

  3. 'dst': a distance matrix

  4. 'hc': a hierarchical clustering object

    • 'ord': the clustering order (only useful as output)

  5. 'clusters': a list of cluster groups

hca takes an expression matrix as input and works through sequentially-dependent computations to produce a list with the following objects:

  1. 'm': your input (expression) matrix

  2. 'cr': a correlation (or similarity) matrix

  3. 'dst': a distance matrix

  4. 'hc': a hierarchical clustering object

    • 'ord': the clustering order (only useful as output)

  5. 'clusters': a list of cluster groups

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
hca(m = NULL, cr = FALSE, dst = FALSE, hc = FALSE, ord = FALSE,
  clusters = FALSE, return.steps = FALSE, hc.method = "average",
  cor.method = "pearson", compute.dist = T,
  dist.method = "euclidean", ord.labels = T, h = NULL, k = NULL,
  min.cluster.size = 5, max.cluster.size = 0.8)

hca_cr(m, ...)

hca_dst(...)

hca_hc(...)

hca_ord(...)

hca_clusters(...)

hca(m = NULL, cr = FALSE, dst = FALSE, hc = FALSE, ord = FALSE,
  clusters = FALSE, return.steps = FALSE, hc.method = "average",
  cor.method = "pearson", compute.dist = T,
  dist.method = "euclidean", ord.labels = T, h = NULL, k = NULL,
  min.cluster.size = 5, max.cluster.size = 0.8)

hca_cr(m, ...)

hca_dst(...)

hca_hc(...)

hca_ord(...)

hca_clusters(...)

Arguments

m

input matrix or NULL. If NULL, an object must be provided to one of 'cr', 'dst' or 'hc'. Default: NULL

cr, dst, hc, ord, clusters

the relevant hca object (specifications below) or logical. If an object, hca() starts with this as input. Later inputs override earlier ones, except 'ord' and 'clusters' which are ignored. If TRUE, hca() stops after the object is generated. If FALSE, then the object is computed and the function proceeds, other arguments permitting. Default: FALSE

dst

distance matrix of class 'dist' or logical. Default: FALSE

hc

hierarchical clustering object of class 'hclust' or logical. Default: FALSE

ord

logical. An order vector will be ignored. Default: FALSE

clusters

logical. Default: FALSE

return.steps

logical indicating whether to return intermediary steps when a subset of the arguments are computed.. Default: FALSE

hc.method

linkage method. Default: 'average'

cor.method

correlation coefficient. Default: 'pearson'

compute.dist

logical. If FALSE, 'cr' is coerced to a distance matrix. If TRUE, distances are calculated from 'cr'. Default: T

dist.method

string specifying distance metric; ignored if compute.dist = F. Default: 'euclidean'

ord.labels

if FALSE, will return ordered indices rather than character vector. Default: T

...

see arguments in hca for details.

cr

correlation or similarity matrix or logical. Default: FALSE

m

input matrix or NULL. If NULL, an object must be provided to one of 'cr', 'dst' or 'hc'. Default: NULL

cr, dst, hc, ord, clusters

the relevant hca object (specifications below) or logical. If an object, hca() starts with this as input. Later inputs override earlier ones, except 'ord' and 'clusters' which are ignored. If TRUE, hca() stops after the object is generated. If FALSE, then the object is computed and the function proceeds, other arguments permitting. Default: FALSE

cr

correlation or similarity matrix or logical. Default: FALSE

dst

distance matrix of class 'dist' or logical. Default: FALSE

hc

hierarchical clustering object of class 'hclust' or logical. Default: FALSE

ord

logical. An order vector will be ignored. Default: FALSE

clusters

logical. Default: FALSE

return.steps

logical indicating whether to return intermediary steps when a subset of the arguments are computed.. Default: FALSE

hc.method

linkage method. Default: 'average'

cor.method

correlation coefficient. Default: 'pearson'

compute.dist

logical. If FALSE, 'cr' is coerced to a distance matrix. If TRUE, distances are calculated from 'cr'. Default: T

dist.method

string specifying distance metric; ignored if compute.dist = F. Default: 'euclidean'

ord.labels

if FALSE, will return ordered indices rather than character vector. Default: T

...

see arguments in hca for details.

Details

It is up to you to provide the correct argument(s) to the functions:

hca_cr must take <m>

hca_dst must take <m> or <cr>

hca_hc can take <m>, <cr> or <dst>

hca_ord can take <m>, <cr>, <dst> or <hc>

hca_clusters can take any of the above.

By default, hca returns a list containing all above mentioned objects.

To break from the function after your object of interest has been computed, set the corresponding argument to TRUE. Note that when an argument is set to TRUE, only that argument is returned unless return.steps = T.

To begin the function from a precomputed object, pass to the appropriate argument. This allows you to skip precomputed steps and provide custom objects – for example a similarity matrix (instead of the default correlation matrix computed in 'cr').

The hca_* wrapper functions act as a shorthand to retrieve specific objects (replace * with object name). hca_* wrappers have simpler syntax but always return one object.

It is up to you to provide the correct argument(s) to the functions:

hca_cr must take <m>

hca_dst must take <m> or <cr>

hca_hc can take <m>, <cr> or <dst>

hca_ord can take <m>, <cr>, <dst> or <hc>

hca_clusters can take any of the above.

By default, hca returns a list containing all above mentioned objects.

To break from the function after your object of interest has been computed, set the corresponding argument to TRUE. Note that when an argument is set to TRUE, only that argument is returned unless return.steps = T.

To begin the function from a precomputed object, pass to the appropriate argument. This allows you to skip precomputed steps and provide custom objects – for example a similarity matrix (instead of the default correlation matrix computed in 'cr').

The hca_* wrapper functions act as a shorthand to retrieve specific objects (replace * with object name). hca_* wrappers have simpler syntax but always return one object.

Value

object from hca call.

object or list of objects. If the latter, a full list contains m (input matrix to be clustered), cr (correlation matrix), dst (distance matrix), hc (hclust object), ord (char. vector), clusters (list of char. vectors).

object from hca call.

object or list of objects. If the latter, a full list contains m (input matrix to be clustered), cr (correlation matrix), dst (distance matrix), hc (hclust object), ord (char. vector), clusters (list of char. vectors).

See Also

cor,hclust,dist

cor,hclust,dist

Examples

1
2
3
4
hca_clusters(hc = hc)
hca_ord(m = m)
hca_clusters(hc = hc)
hca_ord(m = m)

jlaffy/scrabble documentation built on Nov. 16, 2019, 7:56 a.m.