plotExplanatoryVariables: Plot explanatory variables ordered by percentage of variance...

Description Usage Arguments Details Value Examples

View source: R/plotExplanatoryVariables.R

Description

Plot explanatory variables ordered by percentage of variance explained

Usage

1
2
3
4
5
6
7
plotExplanatoryVariables(
  object,
  nvars_to_plot = 10,
  min_marginal_r2 = 0,
  theme_size = 10,
  ...
)

Arguments

object

A SingleCellExperiment object containing expression values and experimental information. Alternatively, a matrix containing the output of getVarianceExplained.

nvars_to_plot

Integer scalar specifying the number of variables with the greatest explanatory power to plot. This can be set to Inf to show all variables.

min_marginal_r2

Numeric scalar specifying the minimal value required for median marginal R-squared for a variable to be plotted. Only variables with a median marginal R-squared strictly larger than this value will be plotted.

theme_size

Numeric scalar specifying the font size to use for the plotting theme

...

Parameters to be passed to getVarianceExplained.

Details

A density plot is created for each variable, showing the distribution of R-squared across all genes. Only the nvars_to_plot variables with the largest median R-squared across genes are shown. Variables are also only shown if they have median R-squared values above min_marginal_r2.

If object is a SingleCellExperiment object, getVarianceExplained will be called to compute the variance in expression explained by each variable in each gene. Users may prefer to run getVarianceExplained manually and pass the resulting matrix as object, in which case the R-squared values are used directly.

Value

A ggplot object.

Examples

1
2
3
example_sce <- mockSCE()
example_sce <- logNormCounts(example_sce)
plotExplanatoryVariables(example_sce)

scater documentation built on Feb. 28, 2021, 2:01 a.m.