plotScree | R Documentation |
plotScree
generates a scree plot to visualize the eigenvalues.
The eigenvalues can be provided either as a part of a
TreeSummarizedExperiment
object or as a separate vector
.
This plot illustrates the decline in eigenvalues across components,
helping to assess the importance of each component.
plotScree(x, ...)
## S4 method for signature 'SingleCellExperiment'
plotScree(x, dimred, ...)
## S4 method for signature 'ANY'
plotScree(x, ...)
x |
a
|
... |
additional parameters for plotting
|
dimred |
|
plotScree
generates a scree plot to visualize the relative importance
of components in dimensionality reduction techniques such as Principal
Component Analysis (PCA) or Principal Coordinate Analysis (PCoA). If the
input is a TreeSummarizedExperiment
object, the function extracts
eigenvalues from the specified reduced dimension slot, which requires that
dimensionality reduction has been performed beforehand using a dedicated
function. Alternatively, if the input is a vector
or an
eigenvals
object, these values are directly used as eigenvalues for
the plot.
The plot can include a combination of barplot, points, connecting lines,
and labels, which can be controlled using the show.*
parameters.
An option to show cumulative explained variance is also available by setting
add.cumulative = TRUE
.
A ggplot2
object
library(miaViz)
library(scater)
data("enterotype", package = "mia")
tse <- enterotype
# Run PCA and store results into TreeSE
tse <- transformAssay(tse, method = "clr", pseudocount = TRUE)
tse <- runPCA(tse, assay.type = "clr")
# Plot scree plot
plotScree(tse, "PCA", add.cumulative = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.