Description Usage Arguments Value Examples
View source: R/plotStratifyBy.R
Plot gene expression stratified by another variable
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
geneExpr |
data.frame of gene expression values and another variable for each sample. If there are multiple columns, the user can specify which one to use |
xval |
name of column in geneExpr to be used along x-axis to stratify gene expression |
yval |
name of column in geneExpr indicating gene expression |
xlab |
label x-asis. Defaults to value of xval |
ylab |
label y-asis. Defaults to value of yval |
main |
main label |
sortBy |
name of column in geneExpr to sort samples by. Defaults to xval |
colorBy |
name of column in geneExpr to color box plots. Defaults to xval |
sort |
if TRUE, sort boxplots by median value, else use default ordering |
text |
plot text on the top left of the plot |
text.y |
indicate position of the text on the y-axis as a fraction of the y-axis range |
text.size |
size of text |
pts.cex |
size of points |
ylim |
specify range of y-axis |
legend |
show legend |
x.labels |
show x axis labels |
ggplot2 object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # load library
# library(variancePartition)
# load simulated data:
data(varPartData)
# Create data.frame with expression and Tissue information for each sample
GE = data.frame( Expression = geneExpr[1,], Tissue = info$Tissue)
# Plot expression stratified by Tissue
plotStratifyBy( GE, "Tissue", "Expression")
# Omit legend and color boxes grey
plotStratifyBy( GE, "Tissue", "Expression", colorBy = NULL)
# Specify colors
col = c( B="green", A="red", C="yellow")
plotStratifyBy( GE, "Tissue", "Expression", colorBy=col, sort=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.