GetClusters: Over-Partition a (p x n) Data Matrix using 'kmeans'

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

View source: R/GetClusters.r

Description

'GetClusters' uses an overly large k with the 'kmeans' function to over-partition p variables (rows = genes) from n objects (cols = samples) from a given data matrix 'x.data'

Usage

1
GetClusters(x.data, num.k, num.iters)

Arguments

x.data

p x n data matrix of numeric values

num.k

number of k partitions desired

num.iters

number of iterations - recommend >= 100

Value

'GetClusters' returns a list with the following components:

clusters

cluster assignment from 'kmeans'

cluster.sizes

size of each cluster k from 'kmeans'

Note

The input data matrix, x.data, must be numeric (e.g., gene-expression values). We recommend using 'num.k' = one-half the number of genes and 'num.iters' greater than 50

Author(s)

Brian Steinmeyer

See Also

'kmeans'

Examples

1
2
3
4
5
6
7
8
# simulate a p x n microarray expression dataset, where p = genes and n = samples
data.sep <- rbind(matrix(rnorm(1000), ncol=50), matrix(rnorm(1000, mean=5), ncol=50))
noise <- matrix(runif(40000), ncol=1000)
data <- t(cbind(data.sep, noise))
data <- data[1:200, ]
# data has p = 1,050 genes and n = 40 samples

clusters.result <- GetClusters(data, 100, 100)

MantelCorr documentation built on Nov. 1, 2018, 2:36 a.m.