Differential Expression Analysis with limma in R
John Blischak
Instructor
x_sub <- x[1000, 1:10]
f_sub <- f[1000, ]
p_sub <- p[1:10, ]
A single misplaced comma could become a debugging nightmare:
x_sub <- x[1000, 1:10]
f_sub <- f[1000, ]
p_sub <- p[, 1:10]
# Oh no! *
class - defines a structure to hold complex data
object - a specific instance of a class
methods - functions that work on a specific class
install.packages("BiocManager")
BiocManager::install("Biobase")
# Load package library(Biobase) # Create ExpressionSet object eset <- ExpressionSet(assayData = x, phenoData = AnnotatedDataFrame(p), featureData = AnnotatedDataFrame(f))
# View the number of features (rows) and samples (columns) dim(eset)
Features Samples
22283 344
?ExpressionSet
Expression matrix
x <- exprs(eset)
Feature data
f <- fData(eset)
Phenotype data
p <- pData(eset)
x_sub <- x[1000, 1:10]
f_sub <- f[1000, ]
p_sub <- p[1:10, ]
eset_sub <- eset[1000, 1:10]
nrow(exprs(eset_sub)) == nrow(fData(eset_sub))
TRUE
ncol(exprs(eset_sub)) == nrow(pData(eset_sub))
TRUE
boxplot(<y-axis> ~ <x-axis>, main = "<title>") boxplot(<gene expression> ~ <phenotype>, main = "<feature>")
boxplot(exprs(eset)[1, ] ~ pData(eset)[, "er"], main = fData(eset)[1, "symbol"])
Differential Expression Analysis with limma in R