If return.plot=T, a grob plotting a PCA of percent methylation of all samples is returned. Otherwise, a numeric representing the best principal component to use for PCBS analysis is returned.
Arguments
mat
Bismark2Matrix.R output file, or data frame object
IDs
A character vector of IDs containing the common names for compared conditions. E.g., for samples trt1, trt2 vs. ctl1, ctl2, IDs=c("trt", "ctl")
filter_thresh
A coverage threshold for filtering, where CpG coverage of all samples must be larger than this value
return.plot
T/F, whether to return a PCA plot or a numeric representing the best principle component for downstream analysis