Apply one or more supported normalization methods to a filtered RGSet and return all normalized objects together in a single result object.

normalizeMinfiEwasWater(
  sampleData,
  sexColumn = "Sex",
  normMethods = "adjustedfunnorm",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_normalizeMinfiEwasWater.txt"
)

Arguments

sampleData

Object returned by filterSamplesMinfiEwasWater().

sexColumn

Character. Name of the phenotype column used as the optional sex covariate for normalization methods that support it. Missing or unsupported values use PredSex when available, and each substitution is recorded in the returned sexResolution table.

normMethods

Character vector or semicolon-separated string of normalization methods. Supported values are 'adjustedfunnorm', 'funnorm', 'illumina', 'quantile', and 'swan'.

verbose

Logical. If TRUE, emit progress messages with message().

logs

Logical. If TRUE, write the same messages to a log file.

log_dir

Character or NULL. Directory used for the log file when logs = TRUE.

log_file

Character. File name used when logs = TRUE.

Value

A list with class 'dnaEPICO_minfiEwasWater_norm' containing the requested normalized objects, the first method as primary, and a sexResolution audit table describing reported-sex and PredSex use.

Examples

ex <- dnaEPICO:::exampleMinfiBaseDataDnaEpico()
sample_data <- filterSamplesMinfiEwasWater(
  RGSet = ex$RGSet,
  targets = ex$targets,
  failedSamples = character(0),
  SampleID = "Sample_Name",
  verbose = FALSE,
  logs = FALSE
)
norm_data <- normalizeMinfiEwasWater(
  sampleData = sample_data,
  sexColumn = "Sex",
  normMethods = "quantile",
  verbose = FALSE,
  logs = FALSE
)
#> [preprocessQuantile] Mapping to genome.
#> [preprocessQuantile] Fixing outliers.
#> [preprocessQuantile] Quantile normalizing.
names(norm_data$normalized)
#> [1] "quantile"