Learn R Programming

flowWorkspace (version 3.16.0)

getProp,GatingHierarchy,character-method: Return a table of population statistics for all populations in a GatingHierarchy/GatingSet or the population proportions or the total number of events of a node (population) in a GatingHierarchy

Description

getProp calculates the population proportion (events in the gate / events in the parent population) associated with a node in the GatingHierarchy. getPopStats is more useful than getPop. Returns a table of population statistics for all populations in a GatingHierarchy/GatingSet. Includes the flowJo counts, flowCore counts and frequencies. getTotal returns the total number of events in the gate defined in the GatingHierarchy object

Usage

"getProp"(x, y, flowJo = FALSE)
"getTotal"(x, y, flowJo = FALSE)
"getPopStats"(x, path = "auto", ...)
"getPopStats"(x, statistic = c("freq", "count"), flowJo = FALSE, subpopulations = NULL, format = c("long", "wide"), path = "auto", ...)
"getPopStats"(x, format = c("long", "wide"), ...)

Arguments

x
A GatingHierarchy or GatingSet
y
character node name or path
flowJo
logical indicating whether the statistics come from FlowJo (if parsed from xml workspace) or from flowCore.
path
character see getNodes
...
Additional arguments passed to getNodes
statistic
character specifies the type of population statistics to extract.(only valid when format is "wide"). Either "freq" or "count" is currently supported.
subpopulations
character vector to specify a subset of populations to return. (only valid when format is "long")
format
character value of c("wide", "long") specifing whether to origanize the output in long or wide format

Value

getPopStats returns a data.frame with columns for the population name, flowJo derived counts, flowCore derived counts, and the population proportions (relative to their parent pouplation). getProp returns a population frequency numeric. getTotal returns a numeric value of the total number of elements in the population.

Details

getPopStats returns a table population statistics for all populations in the gating hierarchy. The output is useful for verifying that the import was successful, if the flowJo and flowCore derived counts don't differ much (i.e. if they have a small coefficient of variation.) for a GatingSet, returns a matrix of proportions for all populations and all samples getProp returns the proportion of cells in the gate, relative to its parent. getTotal returns the total number of events included in this gate. The contents of "thisTot" variable in the "metadata" environment of the nodeData element associated with the gating tree and gate / population.

See Also

getNodes

Examples

Run this code
## Not run: 
#         #gh is a GatingHierarchy
#         getPopStats(gh);
#         #proportion for the fifth population
#         getProp(gh,getNodes(gh)[5])
#         getTotal(gh,getNodes(gh,tsort=T)[5])
# 
#         #gs is a GatingSet
#         getPopStats(gs)
#         #optionally output in long format as a data.table
#         getPopStats(gs, format = "long", path = "auto")
#         #only get stats for a subset of populations
#         getPopStats(gs, format = "long", subpopulations = getNodes(gs)[4:6])
#         ## End(Not run)

Run the code above in your browser using DataLab