exprmclust: exprmclust

exprmclustR Documentation

exprmclust

Description

Perform model-based clustering on expression values

Usage

exprmclust(
  data,
  clustermethod = "mclust",
  clusternum = 2:9,
  modelNames = "VVV",
  reduce = T,
  cluster = NULL
)

Arguments

data

The raw single_cell data, which is a numeric matrix or data.frame. Rows represent genes/features and columns represent single cells.

clustermethod

Either 'mclust' (model-based clustering) or 'kmeans' (k-means clustering). If 'kmeans', clusternum must be specified.

clusternum

For mclust, an integer vector specifying all possible cluster numbers. The best cluster number will be picked using BIC. The minimum value should be two. For kmeans, the number of clusters.

modelNames

model to be used in model-based clustering. By default "ellipsoidal, varying volume, shape, and orientation" is used.

reduce

Whether to perform the PCA on the expression data.

cluster

A vector of user specified clustering results. Must be integers starting from 1 with no gap. THe name of the vector should be the same as the column names of the data. If not null then clusternum and modelNames will both be ignored.

Details

By default, this function first uses principal component analysis (PCA) to reduce dimensionality of original data. It then performs model-based clustering on the transformed expression values. A minimum-spanning-tree is constructed to link the cluster centers. The clustering results will be used for TSCAN ordering.

Value

if more than one cluster detected, a list containing

  • pcareduceres Numeric matrix containing the transformed expression values after PCA.

  • MSTtree igraph object which is the result of constructing MST.

  • clusterid A named vector specifying which cluster the cells belong to.

  • clucenter Numeric matrix of the cluster centers.

if only one cluster detected, a list containing

  • pcareduceres Numeric matrix containing the transformed expression values after PCA.

Author(s)

Zhicheng Ji, Hongkai Ji <zji4@zji4.edu>

References

Fraley, C., & Raftery, A. E. (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association, 97(458), 611-631.

Examples

data(lpsdata)
procdata <- preprocess(lpsdata)
exprmclust(procdata)

userclust <- sample(1:2,ncol(lpsdata),replace = T)
names(userclust) <- colnames(procdata)
exprmclust(procdata,cluster=userclust)

zji90/TSCAN documentation built on Sept. 14, 2022, 10:56 a.m.