plot_distribution: Plot distribution of expression values for each sample

View source: R/plot_distribution.R

plot_distributionR Documentation

Plot distribution of expression values for each sample

Description

Use boxplots, violin plots or quantile plots (in form of parallel coordinate plots of the quantiles) to compare the distribution of expression values for each sample.

Usage

plot_distribution(
  se,
  assay = 1,
  method = "quantileplot",
  coef = 5,
  label = "expression value",
  title = paste("Distribution of expression", "values in each sample")
)

Arguments

se

RangedSummarizedExperiment-class object

assay

Character or integer. Name or number of assay to be used for plotting.

method

Method to use for plotting: "quantileplot" (default), "boxplot", "violinplot".

coef

Numeric. Used in outlier definition (median +/- coef * IQR)

label

Character. Label of x or y axis (default: "expression value").

title

Character. Title of the plot.

Value

List with the following components:

  • info: data.frame with information about outlier samples or NULL

  • plot: plot as returned by ggparcoord (quantile plot), ggplot (boxplot) or ggviolin (violin plot)

Examples

data("se.gene")

## quantile plot
plot_distribution(se = se.gene,
                  method = "quantileplot")

## boxplot
plot_distribution(se = se.gene,
                  method = "boxplot")

## violinplot
library("ggpubr")
plot_distribution(se = se.gene,
                  method = "violinplot")

szymczak-lab/QCnormSE documentation built on March 25, 2023, 1:05 p.m.