Description Usage Arguments Value
View source: R/cytofin_normalize_nrs.R
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.
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
)
|
metadata_path |
A filepath leading to an .xlsx or .csv file
containing a table of CyTOF file (.fcs file) names. Columns should include
See the vignette for details: |
panel_path |
A file path leading to an .xlsx or .csv file containing
a table of standardized antigen panel information. Columns should include
See the vignette for details: |
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 |
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 |
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 |
shift_factor |
The scalar value
Defaults to 0. |
scale_factor |
The scalar value
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. |
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:
All of the columns in the input metadata table (located at metadata_path
)
universal_mean: the universal mean vector to which all files are adjusted (will be identical for all input .fcs files)
universal_var: the universal mean vector to which all files are adjusted (will be identical for all input .fcs files)
anchor_mean: the mean (across all cells) vector for the anchor file associated with each input .fcs file (i.e. the anchor located on the same plate as the input .fcs file)
anchor_var: the variance (across all cells) vector for the anchor file associated with each input .fcs file (i.e. the anchor located on the same plate as the input .fcs file)
mean_b4norm: the mean (across all cells) vector of the input .fcs file before batch normalization.
var_b4norm: the variance (across all cells) vector of the input .fcs file before batch normalization.
mean_norm: the mean (across all cells) vector of the input .fcs file after batch normalization.
var_norm: the variance (across all cells) vector of the input .fcs file after batch normalization.
anchor_mean_norm: the mean (across all cells) vector for the anchor file associated with each input .fcs file (i.e. the anchor located on the same plate as the input .fcs file) after batch normalization.
anchor_var_norm: the variance (across all cells) vector for the anchor file associated with each input .fcs file (i.e. the anchor located on the same plate as the input .fcs file) after batch normalization.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.