Remove failed samples identified during sample assessment and return the filtered RGChannelSet together with the aligned phenotype table.

filterSamplesMinfiEwasWater(
  RGSet,
  targets,
  failedSamples = character(0),
  SampleID = "Sample_Name",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_filterSamplesMinfiEwasWater.txt"
)

Arguments

RGSet

An RGChannelSet.

targets

Data frame containing phenotype information.

failedSamples

Character vector of sample identifiers to remove.

SampleID

Character. Name of the sample identifier column in targets.

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_samples" containing the filtered RGSet, aligned phenotype table, and failed sample identifiers.

Examples

ex <- dnaEPICO:::exampleMinfiBaseDataDnaEpico()
filtered_samples <- filterSamplesMinfiEwasWater(
  RGSet = ex$RGSet,
  targets = ex$targets,
  failedSamples = ex$targets$Sample_Name[1],
  SampleID = "Sample_Name",
  verbose = FALSE,
  logs = FALSE
)
nrow(filtered_samples$targets)
#> [1] 4