compute_stats {ggcyto}R Documentation

compute the statistics of the cell population defined by gates

Description

It calls the underlining stats routine and merge it with the label position calculated by stat_position as well as the pData of flowSet.

Usage

compute_stats(fs = NULL, gates, type = "percent", value = NULL,
  data_range = NULL, ...)

Arguments

fs

flowSet. can be NULL when precaculated 'value' is provided

gates

a list of filters

type

can be "percent", "count" or "MFI" (MFI is currently not supported yet).

value

the pre-calculated stats value. when supplied, the stats computing is skipped.

data_range

a data.frame that specifies the data range for each channels (see examples for its format.) Default is the instrument range extracted from fs object.

...

other arguments passed to stat_position function

Details

This function is usually not called directly by user but used by ggcyto when geom_stat layer is added.

Value

a data.table that contains percent and centroid locations as well as pData that used as data for geom_btext layer.

Examples

data(GvHD)
fs <- GvHD[1:4]
rect.g <- rectangleGate(list("FSC-H" =  c(300,500), "SSC-H" = c(50,200)))
rect.gates <- sapply(sampleNames(fs), function(sn)rect.g)
compute_stats(fs, rect.gates)
#overwrite the default data_range (that is instrument range by default, which could be inaccurate sometime)
compute_stats(fs, rect.gates, data_range = range(fs[[1]], type = "data"))

[Package ggcyto version 1.6.2 Index]