createCYT {CytoTree} | R Documentation

## create an CYT object

### Description

This function is about how to build an CYT object. An CYT object is the base for the whole analysizing workflow of flow and mass cytometry data.

### Usage

    createCYT(
      raw.data,
      markers,
      meta.data,
      batch = NULL,
      batch.correct = FALSE,
      normalization.method = "none",
      verbose = FALSE,
      ...
    )

### Arguments

`raw.data` | matrix. Raw data read from FCS file after perform preprocessing.
`markers` | vector. Detailed marker information in the gate of flow cytometer.
`meta.data` | data.frame. Raw metadata of each cell. Columns "cell" and "stage" are required.
`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 transforma 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 transformation of FCS data.
`verbose` | logical. Whether to print calculation progress.
`...` | paramters pass to `correctBatchCYT` function.

### Value

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

### Examples

    # 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]

    day.list <- c("D0", "D2", "D4", "D6", "D8", "D10")
    meta.data <- data.frame(cell = rownames(fcs.data),
                            stage = gsub(".FCS.+", "", rownames(fcs.data) ) )
    meta.data$stage <- factor(as.character(meta.data$stage), levels = day.list)

    markers <- c("CD43","CD34","CD90","CD45RA","CD31","CD49f","CD73","CD45","FLK1","CD38")

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

    # See information
    cyt

[Package CytoTree version 1.4.0 Index]