poolCells {cydar} | R Documentation

## Pool cells for pre-processing

### Description

Construct a flowFrame object by pooling cells from multiple (barcoded) samples, for use in common transformation and gating.

### Usage

    poolCells(x, equalize=TRUE, n=NULL)

### Arguments

`x` | A named list of numeric matrices, where each matrix corresponds to a sample and contains expression intensities for each cell (row) and each marker (column). Alternatively, a ncdfFlowSet object containing the same information.
`equalize` | A logical scalar specifying whether the same number of cells should be taken from each sample for pooling. If `FALSE`, all cells are used from all samples.
`n` | A numeric scalar specifying the number of cells to be used from each sample if `equalize=TRUE`. If `NULL`, this is set to the number of cells in the smallest sample.

### Details

The idea is to use the pooled set of cells to estimate common parameters such as transformation values and gating thresholds. Otherwise, if these parameters were estimated separately for each sample, they may distort the comparisons between samples. This function is typically used to generate an object for use in `estimateLogicle` or in various gating functions like `outlierGate`. This yields parameter values that can be applied to the full set of cells in the original `x` object.

### Value

A flowFrame object containing cells pooled from all samples.

### Author(s)

Aaron Lun

### See Also

`flowFrame`, `outlierGate`, `estimateLogicle`

### Examples

    ### Mocking up some data: ###
    set.seed(100)
    nmarkers <- 40
    marker.names <- paste0("X", seq_len(nmarkers))
    nsamples <- 10
    sample.names <- paste0("Y", seq_len(nsamples))

    x <- list()
    for (i in sample.names) {
        ex <- matrix(rexp(nmarkers*1000, 0.01), ncol=nmarkers, nrow=1000)
        colnames(ex) <- marker.names
        x[[i]] <- ex
    }

    ### Running the function: ###
    ff <- poolCells(x)
    ff

    ### Using for estimation: ###
    library(flowCore)
    trans <- estimateLogicle(ff, colnames(ff))
    ff <- transform(ff, trans) # or, apply to original data.

[Package cydar version 1.10.0 Index]