DefineBestPC: Identify your best principle component.

View source: R/DefineBestPC.R

DefineBestPCR Documentation

Identify your best principle component.

Description

Defines the best principle component to use for downstream analysis.

Usage

DefineBestPC(mat, IDs, filter_thresh, return.plot)

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

Value

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.

Examples

DefineBestPC(eigen, IDs = c("trt", "ctl"))

PCBS documentation built on Sept. 11, 2024, 6:11 p.m.

Related to DefineBestPC in PCBS...