R: Generates a heatmap and hierarchical clustering of the...
heatmap_GO
R Documentation
Generates a heatmap and hierarchical clustering of the samples and the genes
Description
Clusters the samples and the genes associated with a GO term using the
expression levels of genes related to a given ontology. Represents expression
levels of those genes in a heatmap.
The output of GO_analyse() or a subset of it obtained from
subset_scores().
eSet
ExpressionSet of the Biobase package including a
gene-by-sample expression matrix in the assayData slot, and a
phenotypic information data-frame in the phenodata slot. In the
expression matrix, row names are Ensembl gene identifiers or probeset
identifiers, and column names are sample identifiers. In the phentypic
data-frame, row names are sample idenfifiers, column names are grouping
factors and phenotypic traits usable for the one-way ANOVA.
f
The grouping factor in phenodata to label the samples by.
subset
A named list to subset eSet. Names must be column names existing
in colnames(pData(eSet)). Values must be vectors of values existing in
the corresponding column of pData(eSet).
gene_names
A boolean value. Default is TRUE, to label genes by their associated gene
name. If FALSE, labels the genes by their feature identifier in the
expression dataset (i.e. Ensembl gene identifier or microarray probeset).
NA.names
A boolean value. Default is TRUE. If labelling genes by their associated
gene name (see argument gene_names), whether to display the
gene feature identifier for gene features without associated gene name.
margins
A numeric vector of length 2 specifying the number of lines of margins to
apply for the bottom and right margins, respectively.
Defaults are 7 (bottom) and 5 (right). For Ensembl gene identifiers, we
suggest setting manually a bottom margin of 13. See heatmap.2().
scale
Character indicating if the values should be centered and scaled in either
the row direction or the column direction, or none. Default is "none".
See heatmap.2().
cexCol, cexRow
Positive numbers, used as cex.axis in for the row or column axis labeling.
Defaults are 1.2 and 1, respectively. See heatmap.2().
labRow
A character vector of names to re-label the rows (samples).
If vector of length 1, it is assumed to be a column name in the
phenoData slot. Default are the values of the factor f.
See heatmap.2().
cex.main
Scaling factor of the main title font size. Default is 1. We suggest to
use it in combination with the argument main.Lsplit for GO terms
with long names.
trace
Character string indicating whether a solid "trace" line should be drawn
across each 'row' or down each 'column', both' or 'none'. The distance of
the line from the center of each color-cell is proportional to the size of
the measurement. Defaults to 'none'.
expr.col
Character vector indicating the colors to represent the different levels
of gene expression. Defaults to a colormap of 75 shades ranging from blue
(low) to red (high) and centered around white. If using differential
expression data, you should probably use greenred(75) instead.
row.col.palette
A valid RColorBrewer palette name to fetch the colormap from, to
color-code the groups of samples.
row.col
A vector of color names or codes. The number of colors provided must match
the number of levels of the grouping factor. Default to an palette of up
to 9 colors marking the different levels of the predefined grouping factor
on the left side of the heatmap.
main
Main title of the figure. Default is paste(go_id, go_name).
main.Lsplit
Number of characters after which a new-line character will be inserted in
the main title. If this would occur within a word, the new-line character
will be inserted before this word. Default is NULL, leaving the title on a
single line.
...
Additional arguments passed on to heatmap.2().
Value
Returns the output of the heatmap.2() function.
Author(s)
Kevin Rue-Albrecht
See Also
Method heatmap.2,
GO_analyse,
and brewer.pal.info.
Examples
# load the sample output data
data(AlvMac_results)
# Heatmap the top-ranked GO term (toll-like receptor 4 signaling pathway) as
# example
heatmap_GO(go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac)
# Same with larger sample labels on the right hand side.
heatmap_GO(go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac, cexRow=1)
# Change the color-coding to green-black-red gradient (more appropriate for
# differential expression values)
library(gplots)
heatmap_GO(
go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac,
expr.col=greenred(75)
)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GOexpress)
Loading required package: grid
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: VennDiagram
Loading required package: futile.logger
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/GOexpress/heatmap_GO.Rd_%03d_medium.png", width=480, height=480)
> ### Name: heatmap_GO
> ### Title: Generates a heatmap and hierarchical clustering of the samples
> ### and the genes
> ### Aliases: heatmap_GO
> ### Keywords: GOexpress gene expression clustering ontology
>
> ### ** Examples
>
> # load the sample output data
> data(AlvMac_results)
>
> # Heatmap the top-ranked GO term (toll-like receptor 4 signaling pathway) as
> # example
> heatmap_GO(go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac)
>
> # Same with larger sample labels on the right hand side.
> heatmap_GO(go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac, cexRow=1)
>
> # Change the color-coding to green-black-red gradient (more appropriate for
> # differential expression values)
> library(gplots)
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
> heatmap_GO(
+ go_id="GO:0034142", result=AlvMac_results, eSet=AlvMac,
+ expr.col=greenred(75)
+ )
>
>
>
>
>
> dev.off()
null device
1
>