plot_pca {NanoMethViz} | R Documentation

## Plot PCA

### Description

Plot multi-dimensional scaling plot using algorithm of BiocSingular::runPCA(). It is recommended this be done with the log-methylation-ratio matrix generated by bsseq_to_log_methy_ratio().

### Usage

    plot_pca(x, plot_dims = c(1, 2), labels = colnames(x), groups = NULL)

### Arguments

`x` | the log-methylation-ratio matrix.
`plot_dims` | the numeric vector of the two dimensions to be plotted.
`labels` | the character vector of labels for data points. By default uses column names of x, set to NULL to plot points.
`groups` | the character vector of groups the data points will be coloured by.

### Value

ggplot object of the MDS plot.

### Examples

    nmr <- load_example_nanomethresult()
    bss <- methy_to_bsseq(nmr)
    lmr <- bsseq_to_log_methy_ratio(bss)
    plot_pca(lmr)

[Package NanoMethViz version 2.0.0 Index]