add_heatmap_track.rd
add heatmap to a new track
add_heatmap_track(gr, mat, fill, border = NA, track = current_track() + 1, ...)
genomic regions, it can be a data frame or a GRanges
object
matrix in which rows correspond to intervals in gr
a color mapping function which maps values to colors. Users can consider colorRamp2
to generate a color mapping function.
border of the grids in heatmap
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
No value is returned.
require(circlize)
#> Loading required package: circlize
#> ========================================
#> circlize version 0.4.15
#> 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))
#> ========================================
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)