Skip to contents

Generates violin plots with embedded boxplots showing the distribution of normalized or VST-transformed RNA-Seq counts for each sample in a geneda object. Optionally, plots can be faceted by a metadata variable.

Usage

PlotCountDist(object, split_by = NULL)

Arguments

object

A geneda object containing normalized expression values in @normalized and sample metadata in @metadata.

split_by

Character. Optional column name from object@metadata used for faceting (default: NULL, no faceting).

Value

A ggplot2 object displaying the distribution of counts per sample.

Examples

data(Snail1KO)
counts <- as.matrix(Snail1KO$rawCounts)
counts <- counts[rowSums(counts >= 10) >= 3, ]
meta <- Snail1KO$metadata
rownames(meta) <- meta$Sample
norm <- log2(t(t(counts) / colSums(counts)) * 1e6 + 1)
obj <- GenEDA(normalized = norm, metadata = meta, counts = counts)
PlotCountDist(obj)

PlotCountDist(obj, split_by = "Genotype")