plot_expression {ABAEnrichment} | R Documentation

## Plot a heatmap given expression data

### Description

The function produces a (`heatmap.2` from package `gplots`). To be used with gene-expression matrices obtained from `get_expression`.

### Usage

        plot_expression(expr_mat, dendro = TRUE, gene_vars = NULL, main = "")

### Arguments

`expr_mat` | matrix of expression values with genes in columns and brain regions in rows, like returned from `get_expression` (rownames are expected to be brain region identifiers, and their acronym is added automatically)
`dendro` | logical indicating whether rows and columns should be rearranged with a dendrogram based on row/column means (using `hclust`).
`gene_vars` | optional data.frame of gene-associated variables to be plotted as a colored sidebar. This can be the same input as for an enrichment analysis, i.e. a data.frame with genes in the first columns and with additional columns depending on the test used in `aba_enrich`. For a hypergeometric test the genes are grouped into candidate (red) and background genes (black); for the Wilcoxon rank-sum test, the side bar indicates the user-defined scores; for the binomial test the side bar shows *A/(A+B)* and for the 2x2 contingency table test *((A+1)/(B+1)) / ((C+1)/(D+1))* (+1 added to prevent division by 0).
`main` | optional character to use as a title for the heatmap.

### Value

Invisibly, a list with components

`rowInd` | row index permutation vector as returned by `order.dendrogram`
`colInd` | column index permutation vector.
`call` | the matched call
`carpet` | reordered 'x' values used to generate the main 'carpet'
`rowDendrogram` | row dendrogram, if present
`colDendrogram` | column dendrogram, if present
`breaks` | values used for color break points
`col` | colors used
`colorTable` | A three-column data frame providing the lower and upper bound and color for each bin

### Author(s)

Steffi Grote

### References

[1] Hawrylycz, M.J. et al. (2012) An anatomically comprehensive atlas of the adult human brain transcriptome, Nature 489: 391-399. doi: 10.1038/nature11405
[2] Miller, J.A. et al. (2014) Transcriptional landscape of the prenatal human brain, Nature 508: 199-206. doi: 10.1038/nature13185
[3] Allen Institute for Brain Science. Allen Human Brain Atlas. Available from: http://human.brain-map.org/
[4] Allen Institute for Brain Science. BrainSpan Atlas of the Developing Human Brain. Available from: http://brainspan.org/

### See Also

`browseVignettes("ABAEnrichment")`
`browseVignettes("ABAData")`
`get_expression`
`aba_enrich`
`get_name`
`get_id`
`get_sampled_substructures`
`get_annotated_genes`
`heatmap.2`
`hclust`

### Examples

    ## plot expression data of six genes in two brain regions
    ## from children (age_category 3)
    expr = get_expression(structure_ids=c("Allen:10657","Allen:10208"),
        gene_ids=c('RFFL', 'NTS', 'LIPE', 'GALNT6', 'GSN', 'BTBD16', 'CERS2'),
        dataset="5_stages")
    expr_age_3 = expr[[3]]
    plot_expression(expr_age_3)

    ## see the package vignette for more examples

[Package ABAEnrichment version 1.22.0 Index]