cytofin_make_plots: Make diagnostic plots to evaluate CytofIn batch normalization

Description Usage Arguments Value

View source: R/cytofin_make_plots.R

Description

When given the output data structure from cytofin_normalize or cytofin_normalize_nrs, this function plots mean and variance plots for all normalized .fcs files and their associated anchors.

Usage

1
2
3
4
5
cytofin_make_plots(
  normalization_result,
  which_rows = 1:nrow(normalization_result),
  val_path = "none"
)

Arguments

normalization_result

An output data.frame produced by the cytofin_normalize or cytofin_normalize_nrs function.

The following columns should be present: filename, cohort, plate_number, patient_id, condition, is_anchor, validation, universal_var, anchor_mean, anchor_var, mean_b4norm, var_b4norm, mean_norm, var_norm, mean_ctr_norm, var_ctr_norm.

which_rows

A numeric vector indicating which rows of normalization_result (i.e. which .fcs files in the combined dataset) should be used for plotting. Defaults to 1:nrow(normalization_result), which will make all possible plots.

val_path

The folder directory containing validation (i.e. bead-normalized) .fcs files corresponding to the input .fcs files in the metadata table. (Optional).

Value

8 diagnostic plots are made for each input .fcs file that was batch normalized (i.e. each .fcs file represented as a row in normalization_result). From left-to-right (and top-to-bottom), these plots represent the following:

  1. The entry in the universal mean vector corresponding to each antigen in the consensus antigen panel. X-axis: antigen index in the universal mean vector. Y-axis: Arcsinh-transformed entry in the universal mean vector corresponding to each antigen.

  2. The mean (across all cells) antigen expression vector for the anchor associated with each input .fcs file both before and after normalization. X-axis: antigen index (as in plot 1). Y-axis: Mean antigen expression in the anchor .fcs file.

  3. The mean (across all cells) antigen expression vector for each input .fcs file both before and after normalization. X-axis: antigen index (as in plot 1). Y-axis: Mean antigen expression in the input .fcs file.

  4. The mean (across all cells) antigen expression vector for each "validation" (i.e. bead-normalized) .fcs file both before and after bead-normalization. This plot can be used to compare CytofIn batch normalization with gold- standard approaches. If val_path is "none", this plot will be identical to plot 3 (see above). X-axis: antigen index (as in plot 1). Y-axis: Mean antigen expression in the validation .fcs file.

  5. The entry in the universal standard deviation vector corresponding to each antigen in the consensus antigen panel. X-axis: antigen index in the universal standard deviation vector. Y-axis: Arcsinh-transformed entry in the universal standard deviation vector corresponding to each antigen.

  6. The standard deviation (across all cells) antigen expression vector for the anchor associated with each input .fcs file both before and after normalization. X-axis: antigen index (as in plot 1). Y-axis: the standard deviation of all antigen expression values in the anchor .fcs file.

  7. The standard deviation (across all cells) antigen expression vector for each input .fcs file both before and after normalization. X-axis: antigen index (as in plot 1). Y-axis: the standard deviation of all antigen expression values in the input .fcs file.

  8. The standard deviation (across all cells) antigen expression vector for each "validation" (i.e. bead-normalized) .fcs file both before and after bead-normalization. This plot can be used to compare CytofIn batch normalization with gold- standard approaches. If val_path is "none", this plot will be identical to plot 3 (see above). X-axis: antigen index (as in plot 1). Y-axis: Standard deviation of all antigen expression values in the validation .fcs file.


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