Skip to contents

Extract fluorescence distribution along a specified channel from the gating set as defined in the gating strategy file and re-calculate data to events per volume.

Usage

makefdmat(
  gs,
  name.dict = ".",
  foN.dict = ".",
  type.dict = ".",
  expo = TRUE,
  expo.gate = ".",
  expo.name = ".",
  expo.type = ".",
  expo.folder = ".",
  rcv = ".",
  verbose = ".",
  dev = FALSE
)

Arguments

gs

A gating set as produced by makeAddGatingSet.

name.dict

Character length one. The name of the dictionary. If left at the default '.', the value as defined in the settings file (key 'dD_dict_name') will be used.

foN.dict

Character length one. The name of the folder where the dictionary resides. If left at the default '.', the value as defined in the settings file (key 'foN_dictionary') will be used.

type.dict

Character length one. The filetype of the dictionary. Can be one of 'csv' or 'xlsx'. If left at the default '.', the value as defined in the settings file (key 'dD_dict_type') will be used.

expo

Logical, if extracted data should exported at all.

expo.gate

Which gate to export. NULL or numeric or character length one. Set to NULL to export data from all those gates defined in the gating strategy where 'keepData' is set to TRUE. Provide a character length one with a gate name or the number of that gate as defined in the gating strategy to export data from this gate only. If left at the default '.', the value as defined in the settings file (key 'dE_exportGate') will be used.

expo.name

Character length one. The name of the file holding the exported fluorescence distribution(s). If left at the default '.', the value as defined in the settings file (key 'fiN_dataExport') will be used.

expo.type

Character length one. The filetype of the data export. Possible values are 'csv' and 'xlsx'. If left at the default '.', the value as defined in the settings file (key 'dE_exportType') will be used.

expo.folder

Character length one. The name of the folder where exported data should reside. If left at the default '.', the value as defined in the settings file (key 'foN_rawData') will be used.

rcv

Logical. If the fluorescence distributions should be re-calculated to events per volume unit. If left at the default '.', the value as defined in the settings file (key 'dV_doRecalcToVolume') will be used.

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.

dev

Logical. If set to true, a histogram showing the bins and the smoothed mid-points is plotted. (Only intended for development.) Defaults to FALSE.

Value

An object of class-fdmat containing a list holding an object of class-fdmat_single in each list element, which in turn contains a matrix holding the fluorescence distribution of a single gate, and the overall data for events per volume unit in the slot eventsPerVol.

See also

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.
#
gs <- makeAddGatingSet()
#> Reading in fcs files... ok. 
#> Producing gating set... Applying fjbiexp transformation... ok. 
#> Gating: (1 gate) 
#> done!
fdmat <- makefdmat(gs, expo = FALSE) # to NOT export the data
#> DNA+: Extracting binned data on FITC.A (res=220) and recalc. to volume... ok. 
fdmat <- makefdmat(gs)
#> DNA+: Extracting binned data on FITC.A (res=220) and recalc. to volume... ok. 
#> Exporting data (1 gate) to xlsx...ok. 
#
setwd(old_wd)