clusterStats: Derive summary statistics for clusters

Description Usage Arguments Value Examples

View source: R/clusterStats.R

Description

A function that derives summary statistics for clusters.

Usage

1
clusterStats(fcsFrame, clusterList, fcsNames)

Arguments

fcsFrame

A flow Frame object returned from preprocessing function. Must contain a parameter called "sample_id" that specify the origin of each cell using integer IDs.

clusterList

A list, each element should be a vector containing the IDs of all cells that belong to a cluster.

fcsNames

A vector of fcs file names. Each element corresponds to an integer ID in the "sample_id" parameter in fcsFrame.

Value

Returns a data frame, rows correspond to each fcs file, columns correspond to MFI of markers or fractions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Find fcs files
files=system.file("extdata","SDY420/ResultFiles/CyTOF_result",
                  package="MetaCyto")
files=list.files(files,pattern="fcs$",full.names=TRUE)
# Preprocess
fcs = preprocessing(fcsFiles=files,assay ="CyTOF",b=1/8)
# Search clusters
cluster_list=searchCluster(fcsFrame=fcs,
                           clusterLabel=c("CD3+|CD8+","CD3-|CD19+"))
# derive summary statistics
cluster_stats=clusterStats(fcsFrame=fcs,
                           clusterList=cluster_list$clusterList,
                           fcsNames=files)

MetaCyto documentation built on Nov. 8, 2020, 7:50 p.m.