getStats {flowWorkspace} | R Documentation

## Exact MFI from populations(or nodes) for all the markers

### Description

It calculates the MFI for each marker.

### Usage

    getStats(x, ...)

    ## S3 method for class 'GatingSetList'
    getStats(x, ...)

    ## S3 method for class 'GatingSet'
    getStats(x, ...)

    ## S3 method for class 'GatingHierarchy'
    getStats(x, nodes = NULL, type = "count",
      inverse.transform = FALSE, stats.fun.arg = list(), ...)

### Arguments

`x` | a GatingSet or GatingHierarchy
`...` | arguments passed to getNodes method.
`nodes` | the character vector specifies the populations of interest. default is all available nodes
`type` | the character vector specifies the type of pop stats or a function used to compute population stats. when character, it is expected to be either "count" or "percent". Default is "count" (total number of events in the populations). when a function, it takes a flowFrame object through 'fr' argument and return the stats as a named vector.
`inverse.transform` | logical flag . Whether inverse transform the data before computing the stats.
`stats.fun.arg` | a list of arguments passed to ‘type' when ’type' is a function.

### Value

a data.table that contains MFI values for each marker per column along with 'pop' column and 'sample' column (when used on a 'GatingSet')

### Examples

    ## Not run:
    dataDir <- system.file("extdata",package="flowWorkspaceData")
    suppressMessages(gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE)))

    # get stats all nodes
    dt <- getStats(gs) #default is "count"

    nodes <- c("CD4", "CD8")
    getStats(gs, nodes, "percent")

    # pass a build-in function
    getStats(gs, nodes, type = pop.MFI)

    # compute the stats based on the raw data scale
    getStats(gs, nodes, type = pop.MFI, inverse.transform = TRUE)

    # supply user-defined stats fun
    pop.quantiles <- function(fr){
       chnls <- colnames(fr)
       res <- matrixStats::colQuantiles(exprs(fr), probs = 0.75)
       names(res) <- chnls
       res
       }
    getStats(gs, nodes, type = pop.quantiles)

    ## End(Not run)

[Package flowWorkspace version 3.32.0 Index]