Run preprocessingMinfiEwasWater.R

preprocessingMinfiEwasWater(
  phenoFile = "data/preprocessingMinfiEwasWater/pheno.csv",
  idatFolder = "data/preprocessingMinfiEwasWater/idats",
  outputLogs = "logs",
  nSamples = NA,
  SampleID = "Sample_Name",
  arrayType = "IlluminaHumanMethylationEPICv2",
  annotationVersion = "20a1.hg38",
  scriptLabel = "preprocessingMinfiEwasWater",
  baseDataFolder = "rData",
  figureBaseDir = "figures",
  sepType = "",
  tiffWidth = 2000,
  tiffHeight = 1000,
  tiffRes = 150,
  qcCutoff = 10.5,
  detPtype = "m+u",
  detPThreshold = 0.05,
  normMethods = "adjustedfunnorm",
  sexColumn = "Sex",
  pvalThreshold = 0.01,
  chrToRemove = "chrX,chrY",
  snpsToRemove = "SBE,CpG",
  mafThreshold = 0.1,
  crossReactivePath = "data/preprocessingMinfiEwasWater/12864_2024_10027_MOESM8_ESM.csv",
  plotGroupVar = "Sex",
  lcRef = "salivaEPIC",
  phenoOrder = "Sample_Name;Timepoint;Sex;PredSex;Basename;Sentrix_ID;Sentrix_Position",
  lcPhenoDir = "data/preprocessingMinfiEwasWater"
)

Arguments

phenoFile

Character. Path to phenotype CSV file.

idatFolder

Character. Path to IDAT files directory.

outputLogs

Character. Directory for log files.

nSamples

Integer or NA. Number of samples to subset for testing.

SampleID

Character. Sample identifier column name.

arrayType

Character. Illumina array type.

annotationVersion

Character. Annotation version.

scriptLabel

Character. Label used in output naming.

baseDataFolder

Character. Base directory for RData outputs.

figureBaseDir

Character. Base directory for Figures outputs.

sepType

Character. Field separator for phenotype file.

tiffWidth

Integer. Width of TIFF plots in pixels.

tiffHeight

Integer. Height of TIFF plots in pixels.

tiffRes

Integer. Resolution (DPI) for TIFF plots.

qcCutoff

Numeric. Quality-control cutoff threshold.

detPtype

Character. Detection p-value calculation type.

detPThreshold

Numeric. Detection p-value threshold.

normMethods

Character. Normalization method(s).

sexColumn

Character. Sex column name in phenotype data.

pvalThreshold

Numeric. Probe-level p-value threshold.

chrToRemove

Character. Chromosomes to remove.

snpsToRemove

Character. SNP probe types to remove.

mafThreshold

Numeric. Minor allele frequency threshold.

crossReactivePath

Character. Path to cross-reactive probe file.

plotGroupVar

Character. Variable used for grouping plots.

lcRef

Character. Reference panel for cell composition.

phenoOrder

Character. Semicolon-separated phenotype column order.

lcPhenoDir

Character. Output directory for cell composition phenotype.

Value

Invisibly returns NULL. This function is called for its side effects, performing Illumina EPICv2 preprocessing, quality control, normalisation, probe filtering, cell composition estimation, and writing plots, logs, and RData objects to disk.

Examples

tmp <- tempdir()
stopifnot(dir.exists(tmp))

# \donttest{
preprocessingMinfiEwasWater(
  phenoFile = "data/preprocessingMinfiEwasWater/pheno.csv",
  idatFolder = "data/preprocessingMinfiEwasWater/idats",
  outputLogs = "logs",
  nSamples = NA,
  SampleID = "Sample_Name",
  arrayType = "IlluminaHumanMethylationEPICv2",
  annotationVersion = "20a1.hg38",
  scriptLabel = "preprocessingMinfiEwasWater",
  baseDataFolder = "rData",
  figureBaseDir = "figures",
  sepType = "",
  tiffWidth = 2000,
  tiffHeight = 1000,
  tiffRes = 150,
  qcCutoff = 10.5,
  detPtype = "m+u",
  detPThreshold = 0.05,
  normMethods = "adjustedfunnorm",
  sexColumn = "Sex",
  pvalThreshold = 0.01,
  chrToRemove = "chrX,chrY",
  snpsToRemove = "SBE,CpG",
  mafThreshold = 0.1,
  crossReactivePath = "data/preprocessingMinfiEwasWater/12864_2024_10027_MOESM8_ESM.csv",
  plotGroupVar = "Sex",
  lcRef = "salivaEPIC",
  phenoOrder = "Sample_Name;Timepoint;Sex;PredSex;Basename;Sentrix_ID;Sentrix_Position",
  lcPhenoDir = "data/preprocessingMinfiEwasWater"
)
#> ==== Starting preprocessingMinfiEwasWater ====
#> Start Time:                2026-04-02 05:15:45 
#> Log file path:             logs/log_preprocessingMinfiEwasWater.txt 
#> 
#> Phenotype file:            data/preprocessingMinfiEwasWater/pheno.csv 
#> Separator type:   
#> IDAT folder:               data/preprocessingMinfiEwasWater/idats 
#> nSamples limit:            all 
#> SampleID column:           Sample_Name 
#> Array type:                IlluminaHumanMethylationEPICv2 
#> Annotation version:        20a1.hg38 
#> Base RData folder:         rData 
#> Base Figure folder:         figures 
#> TIFF size (w x h @ dpi):   2000  x  1000  @  150 
#> QC cutoff (median):        10.5 
#> Detection P-value type:    m+u 
#> 
#> Detection p-value threshold: 0.05 
#> Normalization methods:     adjustedfunnorm 
#> Sex column:                Sex 
#> Plot grouping variable:    Sex 
#> 
#> Probe filtering:
#>   P-value threshold:       0.01 
#>   Chromosomes to remove:   chrX,chrY 
#>   SNP positions filter:    SBE,CpG 
#>   MAF threshold:           0.1 
#>   Cross-reactive file:     data/preprocessingMinfiEwasWater/12864_2024_10027_MOESM8_ESM.csv 
#> 
#> Cell composition (estimateLC):
#>   Reference:               salivaEPIC 
#>   Leading pheno order:     Sample_Name;Timepoint;Sex;PredSex;Basename;Sentrix_ID;Sentrix_Position 
#> =======================================================================
#> Warning: cannot open file 'data/preprocessingMinfiEwasWater/pheno.csv': No such file or directory
#> Error in file(file, "rt"): cannot open the connection
# }