Read methylation-array IDAT files with minfi::read.metharray.exp(), set sample names from the phenotype table, apply the requested annotation, and return the resulting RGChannelSet.

readRGSetMinfiEwasWater(
  idatFolder,
  targets,
  SampleID = "Sample_Name",
  arrayType = "IlluminaHumanMethylationEPICv2",
  annotationVersion = "20a1.hg38",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_readRGSetMinfiEwasWater.txt"
)

Arguments

idatFolder

Character. Directory containing the IDAT files.

targets

Data frame returned by readPhenotypeTargets() or an equivalent phenotype table.

SampleID

Character. Name of the phenotype column containing sample identifiers used to label the RGChannelSet.

arrayType

Character. Array name passed to Biobase::annotation(RGSet), for example "IlluminaHumanMethylationEPICv2".

annotationVersion

Character. Annotation build passed to Biobase::annotation(RGSet), for example "20a1.hg38" for EPIC v2 hg38 annotations or "ilmn12.hg19" for 450K hg19 annotations.

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

An annotated RGChannelSet.

Examples

if (requireNamespace("minfiData", quietly = TRUE) &&
    requireNamespace("IlluminaHumanMethylation450kmanifest", quietly = TRUE) &&
    requireNamespace("IlluminaHumanMethylation450kanno.ilmn12.hg19", quietly = TRUE)) {
  ex <- dnaEPICO:::exampleMinfiIdatInputsDnaEpico(n = 4)
  rgset <- readRGSetMinfiEwasWater(
    idatFolder = ex$idatFolder,
    targets = ex$targets,
    SampleID = "Sample_Name",
    arrayType = ex$arrayType,
    annotationVersion = ex$annotationVersion
  )
  class(rgset)
}
#> [1] "RGChannelSet"
#> attr(,"package")
#> [1] "minfi"