Skip to contents

Export fluorescence distributions contained in the 'fdmat' object to file.

Usage

exportFdmatData(
  fdmat,
  expo.gate = ".",
  expo.name = ".",
  expo.type = ".",
  expo.folder = ".",
  verbose = "."
)

Arguments

fdmat

An object of class-fdmat as produced by makefdmat.

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.

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.

Value

Invisible NULL; used for its side effects, i.e. to export the data contained in 'fdmat' to file.

Details

If data are exported to xlsx, additional data like the metadata describing the parameters that lead to the calculation of the fluorescence distribution, the cyTags and the gating strategy are saved in an extra sheet as well. If exporting to csv, only the fluorescence data from one single gate can be exported.

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.
#
fdmat <- flowdexit()
#> Reading in fcs files... ok. 
#> Producing gating set... Applying fjbiexp transformation... ok. 
#> Gating: (1 gate) 
#> done!
#> DNA+: Extracting binned data on FITC.A (res=220) and recalc. to volume... ok. 
#> Exporting data (1 gate) to xlsx...ok. 
#> fdmat-object saved.
exportFdmatData(fdmat)
#> Exporting data (1 gate) to xlsx...ok. 
#
fdmat <- flowdexit(gateStrat = "gateStrat_2")
#> Reading in fcs files... ok. 
#> Producing gating set... Applying fjbiexp transformation... ok. 
#> Gating: (6 gates)
#> done!
#> DNA+: Extracting binned data on FITC.A (res=220) and recalc. to volume... ok. 
#> HighSSC_ffif: Extracting binned data on FSC.A (res=220) and recalc. to volume... ok. 
#> Exporting data (2 gates) to xlsx...ok. 
#> fdmat-object saved.
exportFdmatData(fdmat, expo.gate = 2, expo.name="data_gate_highSSC_only")
#> Exporting data (1 gate) to xlsx...ok. 
#
setwd(old_wd)