Description Usage Arguments Value Author(s) Examples
View source: R/functions.public.R
Plots the expression profiles of the given genes.
1 2 3 4 |
eset |
ExpressionSet or Matrix. Gene expression of the samples. |
genes |
Vector or Matrix. IDs of the genes to plot. |
fileName |
Character. File name to save the plots. If not provided, up to 20 genes will be shown on screen. |
geneLabels |
Vector or Matrix. Gene name, ID or label which should be shown in the returned results and plots. |
type |
Character. Plot type: "lines" or "boxplot". |
sampleLabels |
Character. PhenoData variable (column name) containing the train samples class labels. |
sampleColors |
Character. Colors for the lines of the samples. |
labelsOrder |
Vector or Factor. Order in which the labels should be shown in the returned results and plots. |
classColors |
Character. Colors for each of the classes or samples of the class. Provide either sampleColors or classColors, not both. |
sameScale |
Logical. If TRUE, plots all the genes in the same expression scale. |
showSampleNames |
Logical. If TRUE, the sample names are shown in the plot. Not recommended for big datasets. |
showMean |
Logical. If TRUE, plots the class expression mean. |
identify |
Logical. If TRUE and supported (X11 or quartz devices), the plot will be interactive and clicking on a point will identify the sample the point represents. Press ESC or right-click on the plot screen to exit. |
verbose |
Logical. If TRUE, a message indicating where the pdf is saved will be printed on screen. |
The expression profiles plot, saved in the working directory as 'fileName.pdf'.
Bioinformatics and Functional Genomics Group. Centro de Investigacion del Cancer (CIC-IBMCC, USAL-CSIC). Salamanca. Spain
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ######
# 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.