cytof_clusterStat: Statistics of the cluster relusts

Description Usage Arguments Value Examples

View source: R/cytof_postProcess.R

Description

Calculate the mean or median expression level of each marker for each cluster, or percentage of cell numbers of each cluster for each sample.

Usage

1
2
cytof_clusterStat(data, markers, cluster = "cluster", sample,
  statMethod = c("mean", "median", "percentage", "NULL"))

Arguments

data

Input data frame.

markers

The names of markers used for calcualtion.

cluster

The column name contatining cluster labels.

sample

The samples used for calculation.

statMethod

Statistics contatining mean, median or percentage.

Value

A matrix of the satatistics results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
m1 <- c(rnorm(300, 10, 2), rnorm(400, 4, 2), rnorm(300, 7))
m2 <- c(rnorm(300, 4), rnorm(400, 16), rnorm(300, 10, 3))
m3 <- c(rnorm(300, 16), rnorm(400, 40, 3), rnorm(300, 10))
m4 <- c(rnorm(300, 7, 3), rnorm(400, 30, 2), rnorm(300, 10))
m5 <- c(rnorm(300, 27), rnorm(400, 40, 1),rnorm(300, 10))
c <- c(rep(1,300), rep(2,400), rep(3,300))
rnames <- paste(paste('sample_', c('A','B','C','D'), sep = ''), 
rep(1:250,each = 4), sep='_') 
exprs_cluster <- data.frame(cluster = c, m1 = m1, m2 = m2, m3 = m3, m4 = m4, m5 = m5)
row.names(exprs_cluster) <- rnames
cytof_clusterStat(data = exprs_cluster, cluster = "cluster", statMethod = "mean")

haoeric/cytofkit_devel documentation built on May 17, 2019, 2:29 p.m.