cytofin_normalize_nrs: Batch normalize CyTOF plates from heterogeneous sources using...

Description Usage Arguments Value

View source: R/cytofin_normalize_nrs.R

Description

This function batch normalizes CyTOF data from multiple plates (from one or more experimental cohorts) by computing the non-redundancy score (NRS) for each channel in the dataset, then using the most redundant (i.e. the "most stable") channels as a reference for batch normalization.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cytofin_normalize_nrs(
  metadata_path,
  panel_path,
  input_data_path,
  output_data_path,
  input_prefix = "homogenized_",
  output_prefix = "normalized_",
  shift_factor = 0,
  scale_factor = 0.2,
  nchannels = 3,
  make_plot = FALSE
)

Arguments

metadata_path

A filepath leading to an .xlsx or .csv file containing a table of CyTOF file (.fcs file) names. Columns should include filename, cohort, plate_number, patient_id, condition, is_anchor, and validation.

See the vignette for details: vignette("help", package = "cytofin")

panel_path

A file path leading to an .xlsx or .csv file containing a table of standardized antigen panel information. Columns should include metal_name, antigen_name, antigen_pattern, lineage, functional, and general.

See the vignette for details: vignette("help", package = "cytofin")

input_data_path

A folder directory containing the input CyTOF files to be normalized. In most cases, this will be the directory to which the output .fcs files from cytofin_homogenize were written.

output_data_path

A folder directory to which the output (i.e. batch normalized/batch corrected) .fcs files should be written.

input_prefix

The string that was appended to the name of the input files of cytofin_homogenize to create their corresponding output file names. Defaults to "homogenized_".

output_prefix

A string to be appended to the name of each input file to create the name of the corresponding output file (post-homogenization). Defaults to "normalized_" (e.g. an input file named "file1.fcs" will correspond to the output file "normalized_file1.fcs" saved in output_data_path).

shift_factor

The scalar value a in the following equation used to transform CyTOF raw data ion counts using the hyperbolic arcsinh function:

new_x <- asinh(a + b * x).

Defaults to 0.

scale_factor

The scalar value b in the following equation used to transform CyTOF raw data ion counts using the hyperbolic arcsinh function:

new_x <- asinh(a + b * x).

Defaults to 0.2.

nchannels

An integer representing the number of most stable channels to use during batch normalization. Defaults to 3.

make_plot

A boolean value indicating if a plot depicting the non- redundancy scores of each marker in each .fcs file being batch normalized should be plotted as a side-effect of the function call. Defaults to FALSE.

Value

Batch-normalized .fcs files are saved in the directory specified by output_data_path.

In addition, a data.frame containing information about each input .fcs file (that can be used for plotting with cytofin_make_plots) is returned with the following columns:


bennyyclo/Cytofin documentation built on July 18, 2021, 8:16 a.m.