add_heatmap_track: add heatmap to a new track

Description Usage Arguments Value Author(s) See Also Examples

View source: R/custimized_track.R

Description

add heatmap to a new track

Usage

1
add_heatmap_track(gr, mat, fill, border = NA, track = current_track() + 1, ...)

Arguments

gr

genomic regions, it can be a data frame or a GRanges object

mat

matrix in which rows correspond to intervals in gr

fill

a color mapping function which maps values to colors. Users can consider colorRamp2 to generate a color mapping function.

border

border of the grids in heatmap

track

which track the graphics will be added to. By default it is the next track. The value should only be a scalar.

...

other arguments passed to add_track

Value

No value is returned.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

add_rect_track, add_track

Examples

1
2
3
4
5
6
require(circlize)
bed = generateRandomBed(200)
col_fun = colorRamp2(c(-1, 0, 1), c("green", "black", "red"))
gtrellis_layout(nrow = 3, byrow = FALSE, track_axis = FALSE)
mat = matrix(rnorm(nrow(bed)*4), ncol = 4)
add_heatmap_track(bed, mat, fill = col_fun)

Example output

Loading required package: grid
Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
========================================
gtrellis version 1.22.0
Bioconductor page: http://bioconductor.org/packages/gtrellis/
Github page: https://github.com/jokergoo/gtrellis
Documentation: http://bioconductor.org/packages/gtrellis/

If you use it in published research, please cite:
Gu, Z. gtrellis: an R/Bioconductor package for making genome-level 
  Trellis graphics. BMC Bioinformatics 2016.

This message can be suppressed by:
  suppressPackageStartupMessages(library(gtrellis))
========================================

Loading required package: circlize
========================================
circlize version 0.4.11
CRAN page: https://cran.r-project.org/package=circlize
Github page: https://github.com/jokergoo/circlize
Documentation: https://jokergoo.github.io/circlize_book/book/

If you use it in published research, please cite:
Gu, Z. circlize implements and enhances circular visualization
  in R. Bioinformatics 2014.

This message can be suppressed by:
  suppressPackageStartupMessages(library(circlize))
========================================

gtrellis documentation built on Nov. 8, 2020, 7:50 p.m.