makeAddGatingSet: Make Gating Set and Add Gates

View source: R/gen-functions.R

makeAddGatingSetR Documentation

Make Gating Set and Add Gates

Description

Read in FCS files, put them together in a gating set and apply the gating strategy as previously defined.

Usage

makeAddGatingSet(
  patt = NULL,
  fn = ".",
  gateStrat = ".",
  foN.gateStrat = ".",
  type.gateStrat = ".",
  comp = ".",
  tx = ".",
  channel = ".",
  fcsRepair = FALSE,
  verbose = "."
)

Arguments

patt

A regular expression defining a possible subset of FCS files residing in the directory specified by fn to read in. Only matching patterns will be included.

fn

Character length one. The name of the folder where FCS files should be read from. If left at the default '.', the folder name as defined in the settings file (key: 'foN_fcsFiles') will be used.

gateStrat

Character length one. The name of the file defining the gating strategy. If left at the default '.', the name as defined in the settings file (key: 'fiN_gateStrat') will be used.

foN.gateStrat

Character length one. The name of the folder where the file defining the gating strategy and the gate definitions reside. If left at the default '.', the name as defined in the settings file (key: 'foN_gating') will be used.

type.gateStrat

Character length one, can be either 'csv' or 'xlsx'. The type of file defining the gating strategy. Currently, csv and xlsx files are supported. If left at the default '.', the filetype as defined in the settings (key: 'dV_gateStratInputType') file will be used.

comp

Logical. If compensation should be applied or not. If left at the default '.', the value as defined in the settings file (key 'dV_comp') will be used.

tx

Character length one. The transformation applied to *all* channels within the individual flow sets. If left at the default '.', the value as defined in the settings file (key 'dV_tx') will be used. (Currently only 'fjbiex' is implemented.)

channel

A regular expression indicating which channels, i.e. which columns to keep from the original flowFrames; is passed down to argument column.pattern of read.flowSet. Set to NULL to read data from all channels. If left at the default '.', the value as defined in the settings file (key 'dV_channel') will be used.

fcsRepair

Logical. If set to TRUE, fcs-files in the folder specified at argument 'fn' will be checked for multiplied entries in the keywords, as after some testing the author came to the humble conclusion that these multiplied keywords can be the reason for the error message:
"The HEADER and the TEXT segment define different starting point ... to read the data".
If 'fcsRepair' is set to TRUE, all except the last of each multiplied keyword will be removed and the fcs file will be saved to disc, overwriting the original fcs file without further warning.
Use the function checkRepairFcsFiles which does offer more options to manually check and repair afflicted fcs files. There, it is possible to display multiplied keywords and to select which one to keep.

verbose

Logical. If status messages should be displayed. If left at the default '.', the value as defined in the settings file (key 'dV_verbose') will be used.

Details

This is a convenience wrapper for the two functions makeGatingSet and addGates. In order to see a schematic representation of 'parent' and 'child' gates, simply use 'plot'.

Value

An object of class-GatingSet_fd with added and recomputed gates.

See Also

Other Extraction functions: addGates(), makeGatingSet(), makefdmat()

Examples

td <- tempdir()
data_source <- "https://github.com/bpollner/data/raw/main/flowdex_examples/flowdex_examples.zip"
check_download_data(td, data_source)
exp_home <- paste0(td, "/flowdex_examples")
old_wd <- getwd()
setwd(exp_home)
#
assign("get_settings_from_flowdex_package_root", TRUE, pos=.GlobalEnv)
# only required to make the examples run automatically
# you should not call 'assign' if you run the examples manually
# the effect of setting 'get_settings_from_flowdex_package_root' to TRUE
# is that the file 'flowdex_settings.R' in 'root' of the installed package
# 'flowdex' will be sourced instead of the one in the user-defined location.
#
gs1 <- makeAddGatingSet()
gs2 <- makeAddGatingSet(patt = "T4")
gs3 <- makeAddGatingSet(gateStrat = "gateStrat_2")
gs3
#
setwd(old_wd)

bpollner/flowdex documentation built on March 31, 2022, 3:21 a.m.