Run svaEnmix.R

svaEnmix(
  phenoFile = "data/preprocessingMinfiEwasWater/phenoLC.csv",
  rgsetData = "rData/preprocessingMinfiEwasWater/objects/RGSet.RData",
  sepType = "",
  outputLogs = "logs",
  nSamples = NA,
  SampleID = "Sample_Name",
  arrayType = "IlluminaHumanMethylationEPICv2",
  annotationVersion = "20a1.hg38",
  SentrixIDColumn = "Sentrix_ID",
  SentrixPositionColumn = "Sentrix_Position",
  ctrlSvaPercVar = 0.9,
  ctrlSvaFlag = 1,
  scriptLabel = "svaEnmix",
  tiffWidth = 2000,
  tiffHeight = 1000,
  tiffRes = 150,
  figureBaseDir = "figures",
  dataBaseDir = "data",
  rBaseDir = "rData"
)

Arguments

phenoFile

Character. Path to phenotype file with cell composition data.

rgsetData

Character. Path to RGSet RData file.

sepType

Character. Field separator for phenotype file.

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.

SentrixIDColumn

Character. Sentrix ID column name.

SentrixPositionColumn

Character. Sentrix position column name.

ctrlSvaPercVar

Numeric. Proportion of variance explained by control probes.

ctrlSvaFlag

Integer. Flag indicating use of control probes.

scriptLabel

Character. Label used in output naming.

tiffWidth

Integer. Width of TIFF plots in pixels.

tiffHeight

Integer. Height of TIFF plots in pixels.

tiffRes

Integer. Resolution (DPI) for TIFF plots.

figureBaseDir

Character. Base directory for Figures outputs.

dataBaseDir

Character. Base directory for Data outputs.

rBaseDir

Character. Base directory for RData outputs.

Value

Invisibly returns NULL. This function is called for its side effects, executing the external svaEnmix.R script and writing results, figures, and logs to disk.

Examples

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

# \donttest{
svaEnmix(
  phenoFile = "data/preprocessingMinfiEwasWater/phenoLC.csv",
  rgsetData = "rData/preprocessingMinfiEwasWater/objects/RGSet.RData",
  sepType = "",
  outputLogs = "logs",
  nSamples = 5,
  SampleID = "Sample_Name",
  arrayType = "IlluminaHumanMethylationEPICv2",
  annotationVersion = "20a1.hg38",
  SentrixIDColumn = "Sentrix_ID",
  SentrixPositionColumn = "Sentrix_Position",
  ctrlSvaPercVar = 0.90,
  ctrlSvaFlag = 1,
  scriptLabel = "svaEnmix",
  tiffWidth = 2000,
  tiffHeight = 1000,
  tiffRes = 150,
  figureBaseDir = "figures",
  dataBaseDir = "data",
  rBaseDir = "rData"
)
#> ==== Starting SVA Estimation with Enmix ====
#> Start time:  2026-04-02 05:15:45 
#> 
#> Log file path:  logs/log_svaEnmix.txt 
#> 
#> Pheno file:  data/preprocessingMinfiEwasWater/phenoLC.csv 
#> Separator type:   
#> Log directory:  logs 
#> Sample limit:  5 
#> SampleID column:  Sample_Name 
#> Sentrix ID column:  Sentrix_ID 
#> Sentrix Position column:  Sentrix_Position 
#> Script label:  svaEnmix 
#> ctrlSva percvar:  0.9 
#> ctrlSva flag:  1 
#> TIFF dimensions (WxH):  2000 x 1000  at 150 dpi
#> =======================================================================
#> Warning: cannot open file 'data/preprocessingMinfiEwasWater/phenoLC.csv': No such file or directory
#> Error in file(file, "rt"): cannot open the connection
# }