% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessingMinfiEwasWater_steps.R
\name{filterProbesMinfiEwasWater}
\alias{filterProbesMinfiEwasWater}
\title{Filter probes from a normalized methylation object}
\usage{
filterProbesMinfiEwasWater(
  normData,
  RGSet,
  pvalThreshold = 0.01,
  chrToRemove = "chrX,chrY",
  snpsToRemove = "SBE,CpG",
  mafThreshold = 0.1,
  probeExclusionPath,
  probeExclusionIdColumn = NULL,
  useEpicV2Manifest = FALSE,
  epicV2ManifestFlags = c(CH_WGBS_evidence = TRUE, CH_BLAT = TRUE, MissingPos = TRUE,
    MismatchPos = FALSE),
  detPtype = "m+u",
  verbose = FALSE,
  logs = FALSE,
  log_dir = NULL,
  log_file = "log_filterProbesMinfiEwasWater.txt",
  crossReactivePath = NULL,
  crossReactiveIdColumn = NULL
)
}
\arguments{
\item{normData}{Object returned by \code{normalizeMinfiEwasWater()}.}

\item{RGSet}{Filtered \code{RGChannelSet} aligned with \code{normData}.}

\item{pvalThreshold}{Numeric. Probes must have detection P values below this
threshold in all samples to be retained.}

\item{chrToRemove}{Character vector or comma-separated string of chromosome
names to remove, for example \code{'chrX,chrY'}.}

\item{snpsToRemove}{Character vector or comma-separated string of SNP probe
types to remove, for example \code{'SBE,CpG'}.}

\item{mafThreshold}{Numeric. Minor allele frequency threshold passed to
\code{minfi::dropLociWithSnps()}.}

\item{probeExclusionPath}{Character vector or semicolon-separated string of
CSV files containing probe IDs to remove.}

\item{probeExclusionIdColumn}{Character or \code{NULL}. Column containing probe
IDs. When \code{NULL} or \code{''}, each file is auto-detected using \code{ProbeID},
\code{TargetID}, \code{IlmnID}, or \code{Name}, then falling back to an unlabeled or
probe-like first column.}

\item{useEpicV2Manifest}{Logical. If \code{TRUE}, also remove EPICv2 probes
flagged in the Peters et al. expanded manifest from AnnotationHub resource
\code{AH116484}.}

\item{epicV2ManifestFlags}{Named logical vector controlling which EPICv2
manifest flags are removed. Defaults remove \code{CH_WGBS_evidence}, \code{CH_BLAT},
and \code{MissingPos}, but not \code{MismatchPos}.}

\item{detPtype}{Character. Detection P-value mode passed to
\code{minfi::detectionP()} for the probe filter. Common values in minfi
workflows are \code{'m+u'} and \code{'negative'}.}

\item{verbose}{Logical. If \code{TRUE}, emit progress messages with \code{message()}.}

\item{logs}{Logical. If \code{TRUE}, write the same messages to a log file.}

\item{log_dir}{Character or \code{NULL}. Directory used for the log file when
\code{logs = TRUE}.}

\item{log_file}{Character. File name used when \code{logs = TRUE}.}

\item{crossReactivePath}{Deprecated alias for \code{probeExclusionPath}.}

\item{crossReactiveIdColumn}{Deprecated alias for \code{probeExclusionIdColumn}.}
}
\value{
A list with class \code{'dnaEPICO_minfiEwasWater_filter'} containing the
filtered object and counts for each filtering stage.
}
\description{
Apply detection P-value, chromosome, SNP, and probe-exclusion filters to the
primary normalized object and return the filtered result.
}
\examples{
\dontshow{if (requireNamespace("minfiData", quietly = TRUE)) withAutoprint(\{ # examplesIf}
ex <- dnaEPICO:::exampleMinfiWorkflowStateDnaEpico()
filtered_data <- filterProbesMinfiEwasWater(
    normData = ex$normData,
    RGSet = ex$sampleData$RGSet,
    pvalThreshold = 1,
    chrToRemove = "chrY",
    snpsToRemove = "SBE",
    mafThreshold = 1,
    probeExclusionPath = ex$probeExclusionPath,
    detPtype = "m+u",
    verbose = FALSE,
    logs = FALSE
)
filtered_data$counts[["probeExclusion"]]
\dontshow{\}) # examplesIf}
}
