Description Usage Arguments Value Examples
Bar plot of variance fractions for a subset of genes
1 | plotPercentBars(varPart, col = c(ggColorHue(ncol(varPart) - 1), "grey85"))
|
varPart |
object returned by extractVarPart() or fitExtractVarPartModel() |
col |
color of bars for each variable |
Returns ggplot2 barplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.