process_fcs_dir: Process .fcs files within a directory to remove debris and...

View source: R/flowCytometryFunctions.R

process_fcs_dirR Documentation

Process .fcs files within a directory to remove debris and doublets, and optionally calibrate

Description

process_fcs_dir uses mixture models to cluster bacteria from background debris and fits a linear model to SSC-H vs SSC-A to remove doublets.

Usage

process_fcs_dir(
  dir_path,
  pattern = "*.fcs",
  flu_channels = c("BL1-H"),
  do_plot = F,
  pre_cleaned = F,
  neg_fcs = NA,
  calibrate = F,
  mef_peaks = NA,
  bead_dens_bw = 0.025,
  manual_peaks = NA
)

Arguments

dir_path

a directory path containing the .fcs files to be parsed or folders to be recursed through.

pattern

a regex pattern to match particular .fcs files. Default is "*.fcs" matching all .fcs files.

flu_channels

a vector of strings of the fluorescence channels to keep in the processed data and plotting. Defaults to "BL1-H".

do_plot

a Boolean flag to determine whether to produce plots showing the trimming of each flowFrame. Defaults to FALSE.

pre_cleaned

have you pre removed background debris

neg_fcs

filename of .fcs file for a negative control used for fluorescence normalisation.

calibrate

a Boolean flag to determine whether to convert fluorescence to MEF values. Requires an .fcs file with named "*beads*.fcs". Defaults to FALSE.

mef_peaks

a list of lists in the form list(list(channel="BL1-H", peaks=c(0, 200, ...) of MEF fluorescence values for the calibration beads. Default values for BL1-H and YL2-H.

bead_dens_bw

the bandwidth for the kernel density of the bead peak data. Default = 0.025. Increase if erroneous peaks are being found, decrease if not enough peaks are found.

manual_peaks

if bead peaks are not being found by the EM algorithm, one can manually specify the positions of the bead peaks (on a log10 scale). A list of lists in the form list(list(channel="BL1-H", peaks=c(2.1, 2.8, ...) of log10 fluorescence values for the calibration beads.

Value

nothing is returned. A new folder is created with the processed .fcs files and plot if do_plot = TRUE.


ucl-cssb/flopr documentation built on Jan. 27, 2024, 11:49 a.m.