######
# Load libraries and expression data
######
# Load an expressionSet:
library(leukemiasEset)
data(leukemiasEset)
######
# Generic expression profile plot
######
# Plot expression of specific genes:
selectedGenes <- c("ENSG00000169575","ENSG00000078399","ENSG00000005381","ENSG00000154511")
plotExpressionProfiles(leukemiasEset, genes=selectedGenes, sampleLabels="LeukemiaType", type="boxplot")
# Color samples:
plotExpressionProfiles(leukemiasEset, genes="ENSG00000078399",
sampleLabels="LeukemiaType",
showMean=TRUE, identify=FALSE,
sampleColors=c("grey","red")
[(sampleNames(leukemiasEset) %in% c("GSM331386.CEL","GSM331392.CEL"))+1])
# Color classes:
plotExpressionProfiles(leukemiasEset, genes="ENSG00000078399",
sampleLabels="LeukemiaType",
showMean=TRUE, identify=TRUE,
classColors=c("red", "blue", "red", "red","red"))
######
# Expression profiles related to a classifier
######
# Train a classifier or load a trained one:
trainSamples<- c(1:10, 13:22, 25:34, 37:46, 49:58)
# summary(leukemiasEset$LeukemiaType[trainSamples])
# leukemiasClassifier <- geNetClassifier(leukemiasEset[,trainSamples],
# sampleLabels="LeukemiaType", plotsName="leukemiasClassifier")
data(leukemiasClassifier) # Sample trained classifier
# Plot expression of the selected genes in the train samples:
plotExpressionProfiles(leukemiasEset[,trainSamples], leukemiasClassifier,
sampleLabels="LeukemiaType", fileName="leukExprs.pdf")
# Plot expression of all the genes of specific classes:
classGenes <- getRanking(leukemiasClassifier@classificationGenes,
showGeneID=TRUE)$geneID[,c("CLL"), drop=FALSE] # Feel free to modify
plotExpressionProfiles(leukemiasEset, genes=classGenes, sampleLabels="LeukemiaType",
type="boxplot")
# Plot (on screen) the expression of the top ranked genes of each class
plotExpressionProfiles(leukemiasEset, leukemiasClassifier, sampleLabels="LeukemiaType")
Run the code above in your browser using DataLab