Calculate_StdNorm: Calculate Normalized Titers

View source: R/Calculate_padjMFC.R

Calculate_StdNormR Documentation

Calculate Normalized Titers

Description

Calculate_StdNorm calculates the standardized d0 or fc titers

Usage

Calculate_StdNorm(
  dat,
  type,
  fcToOne = FALSE,
  idCol = "SubjectID",
  cols = grep(paste0(type, "_[AB]"), colnames(dat), value = TRUE)
)

Arguments

dat

Data frame containing fcStdCols

type

What should be standarized. Either "d0", or "fc".

fcToOne

Logical. Are titer fold changes allowed to be less than 1 or should these be changed to 1 before standardization? Default is FALSE and no changes will be made. Only relevant when type == "fc"

idCol

Name of column containing subject IDs

cols

column names containing the titer measurements for each strain. Length must be > 1

Details

This must be run on only 1 cohort at a time because titers will be normalized across all subjects. The median is used but unlike the original reference, the standard deviation is calculated rather than the maximum absolute deviation.

Value

A data frame like dat but with standarized columns added

Author(s)

Stefan Avey

References

Tsang JS, et al. (2014) Global analyses of human immune variation reveal baseline predictors of postvaccination responses. Cell 157(2):499-513.

Examples

## First Example


stefanavey/titer documentation built on Jan. 27, 2023, 3:41 a.m.