View source: R/cyto_stats_compute.R
cyto_stats_compute | R Documentation |
Compute, export and save statistics
## S3 method for class 'GatingSet'
cyto_stats_compute(
x,
alias = NULL,
parent = NULL,
channels = NULL,
trans = NA,
stat = "median",
format = "long",
save_as = NULL,
select = NULL,
density_smooth = 0.6,
...
)
## S3 method for class 'GatingHierarchy'
cyto_stats_compute(
x,
alias = NULL,
parent = NULL,
channels = NULL,
trans = NA,
stat = "median",
format = "long",
save_as = NULL,
density_smooth = 0.6,
...
)
## S3 method for class 'flowSet'
cyto_stats_compute(
x,
channels = NULL,
trans = NA,
stat = "median",
gate = NA,
format = "long",
select = NULL,
density_smooth = 0.6,
...
)
## S3 method for class 'flowFrame'
cyto_stats_compute(
x,
channels = NULL,
trans = NA,
stat = "median",
gate = NA,
format = "long",
density_smooth = 0.6,
...
)
x |
object of class |
alias |
name(s) of the population(s) for which the statistic should be
calculated when a |
parent |
name(s) of the parent population(s) used calculate population
frequencies when a |
channels |
names of of channels for which statistic should be calculated, set to all channels by default. |
trans |
object of class
|
stat |
name of the statistic to calculate, options include
|
format |
indicates whether the data should be returned in the
|
save_as |
name of a csv file to which the statistical results should be saved. |
select |
named list containing experimental variables to be used to
select samples using |
density_smooth |
smoothing parameter passed to
|
... |
not in use. |
gate |
object of class |
a tibble containing the computed statistics in the wide or long format.
Dillon Hammill, Dillon.Hammill@anu.edu.au
library(CytoExploreRData)
# Load in samples
fs <- Activation
gs <- GatingSet(fs)
# Apply compensation
gs <- compensate(gs, fs[[1]]@description$SPILL)
# Transform fluorescent channels
trans <- estimateLogicle(gs[[32]], cyto_fluor_channels(gs))
gs <- transform(gs, trans)
# Gate using cyto_gate_draw
gt <- Activation_gatingTemplate
gt_gating(gt, gs)
# Compute statistics - median
cyto_stats_compute(gs,
alias = "T Cells",
channels = c("Alexa Fluor 488-A", "PE-A"),
stat = "median",
save = FALSE
)
# Compute statistics for experimental group
cyto_stats_compute(gs,
alias = "T Cells",
channels = c("Alexa Fluor 488-A", "PE-A"),
stat = "median",
save = FALSE,
select = list(Treatment = "Stim-A")
)
# Compute population frequencies and save to csv file
cyto_stats_compute(gs,
alias = c("CD4 T Cells", "CD8 T Cells"),
parent = c("Live Cells", "T Cells"),
stat = "freq",
save_as = "Population-Frequencies"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.