DefineBestPC.Rd
Defines the best principle component to use for downstream analysis.
DefineBestPC(mat, IDs, filter_thresh, return.plot)
Bismark2Matrix.R output file, or data frame object
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")
A coverage threshold for filtering, where CpG coverage of all samples must be larger than this value
T/F, whether to return a PCA plot or a numeric representing the best principle component for downstream analysis
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.
DefineBestPC(eigen, IDs = c("trt", "ctl"))
#>
#> Best PC to use is PC1 with a sample distance of 45.4, representing 29.81% of the total variance.