methrix_pca: Principal Component Analysis

View source: R/methrix_plot.R

methrix_pcaR Documentation

Principal Component Analysis

Description

Principal Component Analysis

Usage

methrix_pca(
  m,
  var = "top",
  top_var = 1000,
  ranges = NULL,
  pheno = NULL,
  do_plot = TRUE,
  n_pc = 2
)

Arguments

m

Input methrix object

var

Choose between random CpG sites ('rand') or most variable CpGs ('top').

top_var

Number of variable CpGs to use. Default 1000 Set it to NULL to use all CpGs (which is not recommended due to memory requirements). This option is mutually exclusive with ranges.

ranges

genomic regions to be summarized. Could be a data.table with 3 columns (chr, start, end) or a GenomicRanges object

pheno

Column name of colData(m). Default NULL. Will be used as a factor to color different groups

do_plot

Should a plot be generated?

n_pc

Default 2.

Value

PCA results

Examples

data('methrix_data')
methrix_pca(methrix_data, do_plot = FALSE)

CompEpigen/methrix documentation built on Sept. 23, 2023, 7:14 p.m.