plot_kpca | R Documentation |
This function plots a low-dimensional projection of an omic data matrix using kernel principal component analysis.
plot_kpca( dat, group = NULL, covar = NULL, kernel = "rbfdot", kpar = list(sigma = 1e-04), top = NULL, dims = c(1L, 2L), label = FALSE, pal_group = "npg", pal_covar = "Blues", size = NULL, alpha = NULL, title = "Kernel PCA", legend = "right", hover = FALSE, D3 = FALSE )
dat |
Omic data matrix or matrix-like object with rows corresponding to
probes and columns to samples. It is strongly recommended that data be
filtered and normalized prior to plotting. Raw counts stored in |
group |
Optional character or factor vector of length equal to sample size, or up to two such vectors organized into a list or data frame. Supply legend title(s) by passing a named list or data frame. |
covar |
Optional continuous covariate. If non- |
kernel |
The kernel generating function, if using KPCA. Options include
|
kpar |
A named list of arguments setting parameters for the kernel
function. If |
top |
Optional number (if > 1) or proportion (if < 1) of most variable probes to be used for KPCA. |
dims |
Vector specifying which dimensions to plot. Must be of length
two unless |
label |
Label data points by sample name? Defaults to |
pal_group |
String specifying the color palette to use if |
pal_covar |
String specifying the color palette to use if |
size |
Point size. |
alpha |
Point transparency. |
title |
Optional plot title. |
legend |
Legend position. Must be one of |
hover |
Show sample name by hovering mouse over data point? If |
D3 |
Render plot in three dimensions? |
This function maps an omic data matrix into a Hilbert space with a user-selected kernel function. The resulting kernel matrix is then projected into a principal component subspace, which is visualized.
Kernel PCA is a nonlinear variant of traditional PCA. Kernel methods are
designed to uncover subtle structures in complex datasets, and are the basis
of many supervised and unsupervised learning techniques, including support
vector machines and spectral clustering. For more details on kernel functions
and their input parameters, see kernlab::dots
.
By default, plot_kpca
maps the entire dat
matrix into a
corresponding Hilbert space. Limit the analysis to only the most variable
probes by using the top
argument.
Schölkopf, B., Smola, A. & Müller, K. (1998). Nonlinear Component Analysis as a Kernel Eigenvalue Problem. Neural Computation, 10(5), 1299-1319.
plot_pca
, kernlab::dots
mat <- matrix(rnorm(1000 * 5), nrow = 1000, ncol = 5) plot_kpca(mat) library(DESeq2) dds <- makeExampleDESeqDataSet() dds <- rlog(dds) plot_kpca(dds, group = colData(dds)$condition)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.