createCYT: create a CYT object

Description Usage Arguments Value Examples

View source: R/AllClasses.R

Description

This function is about how to build a CYT object. A CYT object is the base for the whole analyzing workflow of flow and mass cytometry data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
createCYT(
  raw.data,
  markers = NULL,
  meta.data = NULL,
  batch = NULL,
  batch.correct = FALSE,
  normalization.method = "none",
  verbose = FALSE,
  ...
)

Arguments

raw.data

matrix. Raw data read from FCS file after performing preprocessing.

markers

vector. Detailed marker information in the gate of flow cytometer. The default value is the colnames of 'raw.data'

meta.data

data.frame. Raw metadata of each cell. Columns "cell" and "stage" are required. If not input, the meta.data will be generated with default the name of FCS data.

batch

vector. Batch covariate (only one batch allowed). Method to correct batch effect function is refered to ComBat.

batch.correct

logical. Whether to correct batch effect. If TRUE, batch must be provided.

normalization.method

character. Normalization and transformation method. Whether to normalize and log transformed of raw.data. In CytoTree workflow, it's better to perform transformation of FCS data using runExprsExtract or runExprsMerge before creating an CYT object. CytoTree only provide log transform method. If you need to using truncateTransform, scaleTransform, linearTransform, quadraticTransform and lnTransform, see flowCore for more information. And runExprsExtract in CytoTree, autoLgcl, cytofAsinh, logicle, arcsinh, and logAbs can be used to perform the transformation of FCS data.

verbose

logical. Whether to print calculation progress.

...

paramters pass to correctBatchCYT function.

Value

A CYT object with raw.data and markers and meta.data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Read fcs files
fcs.path <- system.file("extdata", package = "CytoTree")
fcs.files <- list.files(fcs.path, pattern = '.FCS$', full = TRUE)

fcs.data <- runExprsMerge(fcs.files, comp = FALSE, transformMethod = "none")

# Refine colnames of fcs data
recol <- c(`FITC-A<CD43>` = "CD43", `APC-A<CD34>` = "CD34", 
           `BV421-A<CD90>` = "CD90", `BV510-A<CD45RA>` = "CD45RA", 
           `BV605-A<CD31>` = "CD31", `BV650-A<CD49f>` = "CD49f",
           `BV 735-A<CD73>` = "CD73", `BV786-A<CD45>` = "CD45", 
           `PE-A<FLK1>` = "FLK1", `PE-Cy7-A<CD38>` = "CD38")
colnames(fcs.data)[match(names(recol), colnames(fcs.data))] = recol
fcs.data <- fcs.data[, recol]

# Build the CYT object
cyt <- createCYT(raw.data = fcs.data,
                 normalization.method = "log",
                 verbose = TRUE)

# See information
cyt

CytoTree documentation built on Nov. 10, 2020, 2 a.m.