From a flowjo workspace with gated populations and the respective fcs files flowframes are generated. Under the hood CytoML::flowjo_to_gatingset applies the geometric gate definitions and filters relevant rows (indices) of fcs files. The compensation matrix as defined in flowjo will be used to compensate fluorescence intensities.

wsp_get_ff(
  wsp,
  FCS.file.folder = NULL,
  groups = NULL,
  population,
  invert_groups = F,
  samples = NULL,
  invert_samples = F,
  inverse_transform = c(T, F),
  downsample = 1,
  remove_redundant_channels = F,
  lapply_fun = lapply,
  ...
)

Arguments

wsp

vector of paths to flowjo workspaces

FCS.file.folder

path to folder(s) of FCS files; may be one path for all wsp or a vector of paths, one for each wsp; if not provided fcs file paths are derived individually from the wsp (xml). If the workspace was generated and saved on another computer you will have to provide the path to FCS files on the current computer.

groups

vector or list of groups in flowjo to consider; if a list, each index corresponds to the same index in wsp; if NULL samples from all groups are read

population

which population (=node, =gate) to subset flowFrames on; use fcexpr::wsx_get_poppaths to get paths

invert_groups

logical whether to invert group selection

samples

vector or list of samples to select (names of FCS files), each index corresponds to the index in wsp; if NULL all samples (from selected groups) are read

invert_samples

logical whether to invert sample selection

inverse_transform

return inverse- (T) or logicle- (F) transform or both (c(T,F))

downsample

numeric, if < 0 then a fraction of events is sampled, if > 0 an absolute number of events is sampled; or set to "min" which will lead to downsampling each flowframe to the number of events in the flowframe with lowest number of events; can be a single value to treat all FCS files equally or can be a vector of same length as FCS files

remove_redundant_channels

remove channels that are not part of the gating tree, mainly to reduce memory load

lapply_fun

lapply function name, unquoted; lapply, pbapply::pblapply or parallel::mclapply are suggested

...

additional argument to the lapply function; mainly mc.cores when parallel::mclapply is chosen

Value

a list of (subsetted) flowframes with events that are within the gated population only

Details

If it is intended to pass flowframes to fcexpr::dr_to_fcs, inverse_transform has to contain 'F' which will return flowframes with logicle transformation. The logicle transformation is required for fcexpr::dr_to_fcs. The (default) inverse transformation is basically the one you see in flowjo.

Examples

if (FALSE) {
ff_list <- fcexpr::wsp_get_ff(wsp = "mypath/my.wsp", population = "CD8+")
# ff.list[[1]] may be passed to fcexpr::dr_to_fcs for instance
}