R/preprocessingMinfiEwasWater_steps.R
filterProbesMinfiEwasWater.RdApply detection P-value, chromosome, SNP, and probe-exclusion 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,
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
)Object returned by normalizeMinfiEwasWater().
Filtered RGChannelSet aligned with normData.
Numeric. Probes must have detection P values below this threshold in all samples to be retained.
Character vector or comma-separated string of chromosome
names to remove, for example "chrX,chrY".
Character vector or comma-separated string of SNP probe
types to remove, for example "SBE,CpG".
Numeric. Minor allele frequency threshold passed to
minfi::dropLociWithSnps().
Character vector or semicolon-separated string of CSV files containing probe IDs to remove.
Character or NULL. Column containing probe
IDs. When NULL or "", each file is auto-detected using ProbeID,
TargetID, IlmnID, or Name, then falling back to an unlabeled or
probe-like first column.
Logical. If TRUE, also remove EPICv2 probes
flagged in the Peters et al. expanded manifest from AnnotationHub resource
AH116484.
Named logical vector controlling which EPICv2
manifest flags are removed. Defaults remove CH_WGBS_evidence, CH_BLAT,
and MissingPos, but not MismatchPos.
Character. Detection P-value mode passed to
minfi::detectionP() for the probe filter. Common values in minfi
workflows are "m+u" and "negative".
Logical. If TRUE, emit progress messages with message().
Logical. If TRUE, write the same messages to a log file.
Character or NULL. Directory used for the log file when
logs = TRUE.
Character. File name used when logs = TRUE.
Deprecated alias for probeExclusionPath.
Deprecated alias for probeExclusionIdColumn.
A list with class "dnaEPICO_minfiEwasWater_filter" containing the
filtered object and counts for each filtering stage.
ex <- dnaEPICO:::exampleMinfiWorkflowStateDnaEpico()
#> [preprocessQuantile] Mapping to genome.
#> [preprocessQuantile] Fixing outliers.
#> [preprocessQuantile] Quantile normalizing.
#> Warning: No probe-exclusion IDs overlap the filtered array feature names. Check that probeExclusionPath, probeExclusionIdColumn, and manifest settings match the array platform.
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
)
#> Warning: No probe-exclusion IDs overlap the filtered array feature names. Check that probeExclusionPath, probeExclusionIdColumn, and manifest settings match the array platform.
filtered_data$counts[["probeExclusion"]]
#> [1] 485096