do.align: do.align - Function to align multiple batches of a dataset.

View source: R/do.align.R

do.alignR Documentation

do.align - Function to align multiple batches of a dataset.

Description

This function allows you to align multiple batches of a dataset, using either a "Quantile" approach, or using "CytoNorm"

Usage

do.align(ref.dat, target.dat, batch.col, align.cols, method, goal, nQ, Qmin, Qmax, write.ref.fcs, write.target.fcs)

Arguments

ref.dat

NO DEFAULT. If using method = "CytoNorm", this must be a FlowSOM object created by Spectre::do.prep.fsom. If using "Quantiles", then this must be

target.dat

NO DEFAULT. A data.table of data you wish to align

batch.col

NO DEFAULT. Character, column that denotes batches

align.cols

NO DEFAULT. Character, a vector of columns that you wish to align.

method

DEFAULT = "CytoNorm". Character, can be "CytoNorm" or "Quantile".

goal

DEFAULT = "Mean". For method = "CytoNorm". Character, the goal to align to. Can either be "mean", or can be the name of one of the batches (e.g. "Batch1").

nQ

DEFAULT = 101. For method = "CytoNorm". Numeric, the number of quanitles to use.

Qmin

DEFAULT = 0.01. For method = "Quantiles". Numeric, the minimum valus for the lower threshold.

Qmax

DEFAULT = 0.99. For method = "Quantiles". Numeric, the maximum value for the upper threshold.

write.ref.fcs

DEFAULT = TRUE. Logical, do you want a quick copy of the reference sample FCS files.

write.target.fcs

DEFAULT = TRUE. Logical, do you want a quick copy of the ALIGNED target sample FCS files.

mem.ctrl

DEFAULT = TRUE. Runs gc() (garbage collection) after a number of steps to free up memory that hasn't been released quickly enough.

Value

Returns a data.table with selected columns (align.cols) replaced with aligned data.

Author(s)

Thomas M Ashhurst, thomas.ashhurst@sydney.edu.au

References

Ashhurst, T. M., et al. (2019). https://www.ncbi.nlm.nih.gov/pubmed/31077106

Examples

aligned.dat <- do.align()


ImmuneDynamics/Spectre documentation built on Nov. 12, 2023, 8:12 a.m.