Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotPercentBars

Bar plot of variance fractions


Description

Bar plot of variance fractions for a subset of genes

Usage

plotPercentBars(varPart, col = c(ggColorHue(ncol(varPart) - 1), "grey85"))

Arguments

varPart

object returned by extractVarPart() or fitExtractVarPartModel()

col

color of bars for each variable

Value

Returns ggplot2 barplot

Examples

# library(variancePartition)

# Intialize parallel backend with 4 cores
library(BiocParallel)
register(SnowParam(4))

# load simulated data:
# geneExpr: matrix of gene expression values
# info: information/metadata about each sample
data(varPartData)

# Specify variables to consider
form <- ~ Age + (1|Individual) + (1|Tissue)

# Fit model
varPart <- fitExtractVarPartModel( geneExpr, form, info )

# Bar plot for a subset of genes showing variance fractions
plotPercentBars( varPart[1:5,] )

# Move the legend to the top
plotPercentBars( varPart[1:5,] ) + theme(legend.position="top")

variancePartition

Quantify and interpret divers of variation in multilevel gene expression experiments

v1.20.0
GPL (>= 2)
Authors
Gabriel E. Hoffman
Initial release
2020-10-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.