cyto_sample allows restriction of a flowFrame or flowSet by indicating the percentage or number of events to retain.

cyto_sample(x, ...)

# S3 method for GatingHierarchy
cyto_sample(x, display = 1, seed = NULL, ...)

# S3 method for GatingSet
cyto_sample(x, display = 1, seed = NULL, ...)

# S3 method for flowFrame
cyto_sample(x, display = 1, seed = NULL, ...)

# S3 method for flowSet
cyto_sample(x, display = 1, seed = NULL, ...)

# S3 method for list
cyto_sample(x, display = 1, seed = NULL, plot = FALSE, ...)

Arguments

x

object of class flowFrame, flowSet, GatingHierarchy or GatingSet.

...

not in use.

display

can be either a numeric [0,1] or integer to indicate the percentage or number of events to keep respectively.

seed

value used to set.seed() internally. Setting a value for seed will return the same result with each run.

plot

logical required for lists to indicate whether sampling should be scaled per flowFrame to retain original ratios, as used in cyto_plot.

Value

object of class flowFrame, flowSet, GatingHierarchy or GatingSet sampled to display events.

Author

Dillon Hammill, Dillon.Hammill@anu.edu.au

Examples

# Load in CytoExploreRData to access files library(CytoExploreRData) # Load in samples fs <- Activation # Restrict first sample by 50% cyto_sample(fs[[1]], 0.5)
#> flowFrame object 'Activation_1.fcs' #> with 25000 cells and 18 observables: #> name desc range minRange maxRange #> $P1 FSC-A NA 262144 0 262144 #> $P2 FSC-H NA 262144 0 262144 #> $P3 FSC-W NA 262144 0 262144 #> $P4 SSC-A NA 262144 0 262144 #> $P5 SSC-H NA 262144 0 262144 #> ... ... ... ... ... ... #> $P14 Qdot 605-A NA 262144 -111 262144 #> $P15 Alexa Fluor 647-A CD44 262144 -111 262144 #> $P16 Alexa Fluor 700-A CD4 262144 -111 262144 #> $P17 APC-Cy7-A CD11c 262144 -111 262144 #> $P18 Time NA 262144 0 262144 #> 261 keywords are stored in the 'description' slot
# Restrict first sample to 10000 events cyto_sample(fs[[1]], 10000)
#> flowFrame object 'Activation_1.fcs' #> with 10000 cells and 18 observables: #> name desc range minRange maxRange #> $P1 FSC-A NA 262144 0 262144 #> $P2 FSC-H NA 262144 0 262144 #> $P3 FSC-W NA 262144 0 262144 #> $P4 SSC-A NA 262144 0 262144 #> $P5 SSC-H NA 262144 0 262144 #> ... ... ... ... ... ... #> $P14 Qdot 605-A NA 262144 -111 262144 #> $P15 Alexa Fluor 647-A CD44 262144 -111 262144 #> $P16 Alexa Fluor 700-A CD4 262144 -111 262144 #> $P17 APC-Cy7-A CD11c 262144 -111 262144 #> $P18 Time NA 262144 0 262144 #> 261 keywords are stored in the 'description' slot