cyto_merge_by makes a call to cyto_group_by to split samples into groups based on experiment variables. The resulting groups are then converted to flowFrames using cyto_convert. cyto_merge_by is the preferred way to merge samples in CytoExploreR as it will ensure appropriate sampling in cyto_plot.

# S3 method for GatingSet
cyto_merge_by(
  x,
  parent = "root",
  merge_by = "all",
  select = NULL,
  barcode = TRUE,
  ...
)

# S3 method for flowSet
cyto_merge_by(x, merge_by = "all", select = NULL, barcode = TRUE, ...)

Arguments

x

object of class flowSet.

parent

name of the parent population to merge when a GatingSet object is supplied, set to the "root" node by default.

merge_by

vector of cyto_details column names (e.g. c("Treatment","Concentration") indicating how the samples should be grouped prior to merging.

select

selection critieria passed to cyto_select which indicates which samples in each group to retain prior to merging, set to NULL by default to merge all samples in each group. Filtering steps should be comma separated and wrapped in a list. Refer to cyto_select for more details.

barcode

logical indicating whether a call should be made to cyto_barcode prior to grouping and merging samples, set to TRUE by default. Barcoding helps cyto_sample to appropriately sample events based on the number of merged samples.

...

additional arguments passed to cyto_barcode.

Value

list of flowFrames merged by the grouping variables specified by merge_by.

See also

Author

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

Examples

# Load CytoExploreRData to access data library(CytoExploreRData) # Activation flowSet fs <- Activation # Activation GatingSet gs <- GatingSet(fs) # Experiment details cyto_details(fs)
#> name OVAConc Treatment #> Activation_1.fcs Activation_1.fcs 0 Stim-A #> Activation_2.fcs Activation_2.fcs 0 Stim-A #> Activation_3.fcs Activation_3.fcs 5 Stim-A #> Activation_4.fcs Activation_4.fcs 5 Stim-A #> Activation_5.fcs Activation_5.fcs 50 Stim-A #> Activation_6.fcs Activation_6.fcs 50 Stim-A #> Activation_7.fcs Activation_7.fcs 500 Stim-A #> Activation_8.fcs Activation_8.fcs 500 Stim-A #> Activation_9.fcs Activation_9.fcs 0 Stim-B #> Activation_10.fcs Activation_10.fcs 0 Stim-B #> Activation_11.fcs Activation_11.fcs 5 Stim-B #> Activation_12.fcs Activation_12.fcs 5 Stim-B #> Activation_13.fcs Activation_13.fcs 50 Stim-B #> Activation_14.fcs Activation_14.fcs 50 Stim-B #> Activation_15.fcs Activation_15.fcs 500 Stim-B #> Activation_16.fcs Activation_16.fcs 500 Stim-B #> Activation_17.fcs Activation_17.fcs 0 Stim-C #> Activation_18.fcs Activation_18.fcs 0 Stim-C #> Activation_19.fcs Activation_19.fcs 5 Stim-C #> Activation_20.fcs Activation_20.fcs 5 Stim-C #> Activation_21.fcs Activation_21.fcs 50 Stim-C #> Activation_22.fcs Activation_22.fcs 50 Stim-C #> Activation_23.fcs Activation_23.fcs 500 Stim-C #> Activation_24.fcs Activation_24.fcs 500 Stim-C #> Activation_25.fcs Activation_25.fcs 0 Stim-D #> Activation_26.fcs Activation_26.fcs 0 Stim-D #> Activation_27.fcs Activation_27.fcs 5 Stim-D #> Activation_28.fcs Activation_28.fcs 5 Stim-D #> Activation_29.fcs Activation_29.fcs 50 Stim-D #> Activation_30.fcs Activation_30.fcs 50 Stim-D #> Activation_31.fcs Activation_31.fcs 500 Stim-D #> Activation_32.fcs Activation_32.fcs 500 Stim-D #> Activation_33.fcs Activation_33.fcs 0 NA
# Merge samples by 'Treatment' fr_list <- cyto_merge_by(fs, "Treatment") # Merge samples by 'OVAConc' fr_list <- cyto_merge_by(fs, "OVAConc")