Apply detection P-value, chromosome, SNP, and cross-reactive probe filters to the primary normalized object and return the filtered result.

filterProbesMinfiEwasWater(
  normData,
  RGSet,
  pvalThreshold = 0.01,
  chrToRemove = "chrX,chrY",
  snpsToRemove = "SBE,CpG",
  mafThreshold = 0.1,
  crossReactivePath,
  detPtype = "m+u",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_filterProbesMinfiEwasWater.txt"
)

Arguments

normData

Object returned by normalizeMinfiEwasWater().

RGSet

Filtered RGChannelSet aligned with normData.

pvalThreshold

Numeric. Probes must have detection P values below this threshold in all samples to be retained.

chrToRemove

Character vector or comma-separated string of chromosome names to remove, for example "chrX,chrY".

snpsToRemove

Character vector or comma-separated string of SNP probe types to remove, for example "SBE,CpG".

mafThreshold

Numeric. Minor allele frequency threshold passed to minfi::dropLociWithSnps().

crossReactivePath

Character. Path to a CSV file containing a ProbeID column of cross-reactive probes to remove.

detPtype

Character. Detection P-value mode passed to minfi::detectionP() for the probe filter. Common values in minfi workflows are "m+u" and "negative".

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_filter" containing the filtered object and counts for each filtering stage.

Examples

ex <- dnaEPICO:::exampleMinfiWorkflowStateDnaEpico()
#> [preprocessQuantile] Mapping to genome.
#> [preprocessQuantile] Fixing outliers.
#> [preprocessQuantile] Quantile normalizing.
filtered_data <- filterProbesMinfiEwasWater(
  normData = ex$normData,
  RGSet = ex$sampleData$RGSet,
  pvalThreshold = 1,
  chrToRemove = "chrY",
  snpsToRemove = "SBE",
  mafThreshold = 1,
  crossReactivePath = ex$crossReactivePath,
  detPtype = "m+u",
  verbose = FALSE,
  logs = FALSE
)
filtered_data$counts[["crossReactive"]]
#> [1] 485096