cytof_cluster: Subset detection by clustering

View source: R/cytof_cluster.R

cytof_clusterR Documentation

Subset detection by clustering

Description

Apply clustering algorithms to detect cell subsets. DensVM and ClusterX clustering is based on the transformed ydata and uses xdata to train the model. Rphenograph directly works on high dimensional xdata. FlowSOM is integrated from FlowSOM pacakge (https://bioconductor.org/packages/release/bioc/html/FlowSOM.html).

Usage

cytof_cluster(
  ydata = NULL,
  xdata = NULL,
  method = c("Rphenograph", "ClusterX", "DensVM", "FlowSOM", "NULL"),
  Rphenograph_k = 30,
  FlowSOM_k = 40,
  flowSeed = NULL
)

Arguments

ydata

A matrix of the dimension reduced data.

xdata

A matrix of the expression data.

method

Cluster method including DensVM, densityClustX, Rphenograph and FlowSOM.

Rphenograph_k

Integer number of nearest neighbours to pass to Rphenograph.

FlowSOM_k

Number of clusters for meta clustering in FlowSOM.

flowSeed

Integer to set a seed for FlowSOM for reproducible results.

Value

a vector of the clusters assigned for each row of the ydata

Examples

d<-system.file('extdata', package='cytofkit2')
fcsFile <- list.files(d, pattern='.fcs$', full=TRUE)
parameters <- list.files(d, pattern='.txt$', full=TRUE)
markers <- as.character(read.table(parameters, header = FALSE)[, 1])
xdata <- cytof_exprsMerge(fcsFile, mergeMethod = 'fixed', fixedNum = 100)
ydata <- cytof_dimReduction(xdata, markers = markers, method = "tsne")
clusters <- cytof_cluster(ydata, xdata, method = "ClusterX")

JinmiaoChenLab/cytofkit2 documentation built on May 12, 2022, 8:09 a.m.