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

Description Usage Arguments Value

View source: R/cytofin_normalize.R

Description

This function batch normalizes CyTOF data from multiple plates (from one or more experimental cohorts) using external (i.e. "generalized") anchors.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cytofin_normalize(
  metadata_path,
  panel_path,
  anchor_statistics,
  input_data_path,
  output_data_path,
  mode = c("meanshift", "meanshift_bulk", "variance", "z_score", "beadlike"),
  input_prefix = "homogenized_",
  output_prefix = "normalized_",
  shift_factor = 0,
  scale_factor = 0.2
)

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")

anchor_statistics

a list produced by the cytofin_prep_anchors function or the file path to an .rds object containing anchor reference statistics.

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.

mode

A string indicating which transformation function should be used for batch normalization ("meanshift", "meanshift_bulk", "variance", "z_score", or "beadlike").

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 arc-sine 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 arc-sine function:

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

Defaults to 0.2.

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.