getPopStats,GatingSet-method {flowWorkspace} | R Documentation

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

gs_pop_get_count_fast is more useful than getPop. Returns a table of population statistics for all populations in a `GatingHierarchy`/`GatingSet`. Includes the xml counts, openCyto counts and frequencies.

### Usage

    ## S4 method for signature 'GatingSet'
    getPopStats(x, statistic = c("freq", "count"),
      xml = FALSE, subpopulations = NULL, format = c("long", "wide"),
      path = "full", ...)

    gs_pop_get_count_fast(x, statistic = c("freq", "count"), xml = FALSE,
      subpopulations = NULL, format = c("long", "wide"), path = "full",
      ...)

    gs_pop_get_count_with_meta(x, ...)

### Arguments

`x` | A `GatingHierarchy` or `GatingSet`
`statistic` | `character` specifies the type of population statistics to extract.(only valid when format is "wide"). Either "freq" or "count" is currently supported.
`xml` | `logical` indicating whether the statistics come from xml (if parsed from xml workspace) or from openCyto.
`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
`path` | `character` see gs_get_pop_paths
`...` | Additional arguments passed to gs_get_pop_paths
`x` | a `GatingSet` or `GatingSetList`
`...` | additional arguments passed to `gs_pop_get_count_fast`

### Details

gs_pop_get_count_fast 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 xml and openCyto 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

### Value

gs_pop_get_count_fast returns a `data.frame` with columns for the population name, xml derived counts, openCyto derived counts, and the population proportions (relative to their parent pouplation).

a `data.table` of merged population statistics with sample metadata.

### See Also

`gs_get_pop_paths`

### Examples

            ## Not run:
            #gh is a GatingHierarchy
            gs_pop_get_count_fast(gh);
            gh_pop_get_stats(gh,gs_get_pop_paths(gh,tsort=T)[5])

            #gs is a GatingSet
            gs_pop_get_count_fast(gs)
            #optionally output in long format as a data.table
            gs_pop_get_count_fast(gs, format = "long", path = "auto")
            #only get stats for a subset of populations
            gs_pop_get_count_fast(gs, format = "long", subpopulations = gs_get_pop_paths(gs)[4:6])

    ## End(Not run)
     ## Not run:
        #G is a GatingSetList
        stats = gs_pop_get_count_with_meta(G)

    ## End(Not run)

[Package flowWorkspace version 3.34.1 Index]