Contribution of each reduced dimension component to explained variance. The reduced dimension should be stored in the reducedDim slot of a SingleSummarizedExperiment. This panel uses plotScree to generate the plot.

Value

The ScreePlot(...) constructor creates an instance of an ScreePlot class, where any slot and its value can be passed to ... as a named argument.

Slot overview

The following slots control the thresholds used in the visualisation:

  • dimred Character scalar or integer scalar. Determines the reduced dimension to plot. This is used when x is a TreeSummarizedExperiment to extract the eigenvalues from reducedDim(x, dimred).

  • show.barplot: Logical scalar. Whether to show a barplot. (Default: TRUE)

  • show.points: Logical scalar. Whether to show points. (Default: TRUE)

  • show.line: Logical scalar. Whether to show lines. (Default: TRUE)

  • show.labels: Logical scalar. Whether to show a label for each point. (Default: FALSE)

  • add.proportion: Logical scalar. Whether to show proportion of explained variance, i.e., raw eigenvalues. (Default: TRUE)

  • add.cumulative: Logical scalar. Whether to show cumulative explained variance calculated from eigenvalues. (Default: FALSE)

  • n: Integer scalar. Number of eigenvalues to plot. If unspecified, all eigenvalues are plotted. (Default: NULL)

  • show.names: Logical scalar. Whether to show names of the components on the x-axis. If FALSE, indices are shown instead. (Default: FALSE)

  • eig.name: Character scalar. The name of the attribute in reducedDim(x, dimred) that contains the eigenvalues. (Default: c("eig", "varExplained"))

In addition, this class inherits all slots from its parent Panel class.

See also

Author

Giulio Benedetti

Examples

# Import libraries
library(mia)
library(scater)

# Import TreeSE
data("Tengeler2020", package = "mia")
tse <- Tengeler2020

# Add relabundance assay
tse <- transformAssay(tse, method = "relabundance")

# Add reduced dimensions
tse <- runPCA(tse, assay.type = "relabundance")
#> Warning: more singular values/vectors requested than available
#> Warning: You're computing too large a percentage of total singular values, use a standard svd instead.

# Store panel into object
panel <- ScreePlot()
# View some adjustable parameters
head(slotNames(panel))
#> [1] "dimred"         "show.barplot"   "show.points"    "show.line"     
#> [5] "show.labels"    "add.proportion"

# Launch iSEE with custom initial panel
if (interactive()) {
  iSEE(tse, initial = c(panel))
}