baseline_file: Creates baseline file for bead normalization

View source: R/bead_normalize.R

baseline_fileR Documentation

Creates baseline file for bead normalization

Description

Creates the reference flow frame for which mean beads values will be computed and used during the normalization.

Usage

baseline_file(
  fcs_files,
  beads = "dvs",
  to_plot = FALSE,
  out_dir = getwd(),
  k = 80,
  ncells = 25000,
  ...
)

Arguments

fcs_files

Character, path to fcs files to be normalized.

beads

Character, as in CATALYST::normCytof, "dvs" (for bead masses 140, 151, 153 ,165, 175) or "beta" (for bead masses 139, 141, 159, 169, 175) or a numeric vector of masses. Default is set to "dvs".

to_plot

Logical, indicates if plots should be generated, default set to FALSE

out_dir

Character, pathway to where the plots should be saved, only if argument to_plot = TRUE, default is set to working directory.

k

The same as in CATALYST::normCytof, integer width of the median window used for bead smoothing (affects visualizations only).

ncells

number of cells to be aggregated per each file, defaults is set to 25000 per file.

...

Additional arguments to pass to CATALYST::normCytof.

Value

Returns reference, aggregated flow frame.

Examples

# set input directory (pathway to the files that are going to be normalized)
raw_data_dir <- file.path(dir, "RawFiles")

# set a directory where bead-normalized fcs files and plots will be saved
bead_norm_dir <- file.path(dir, "BeadNorm")

# define full pathway to the files that you want to normalize
files <- list.files(raw_data_dir,
                    pattern = ".FCS$",
                    full.names = TRUE)

# create baseline file to which all the files will be normalized
set.seed(2)
ref_sample <- baseline_file(fcs_files = files,
                            beads = "dvs",
                            out_dir = bead_norm_dir)

prybakowska/CytoQP documentation built on June 28, 2022, 12:36 a.m.