Add Contact Map to Coverage Plot.

geom_tad2(
  matrix,
  granges,
  zlim = NULL,
  color.bias = 1,
  color.ramp = "YlOrRd",
  color.palette = NULL,
  smooth.func = NULL,
  plot.space = 0.1,
  plot.height = 1,
  top = TRUE,
  show.rect = FALSE
)

Arguments

matrix

Matrix (n x n) contains contact map information.

granges

The rownames and colnames information of matrix.

zlim

The maximum value of color to plot. Larger values will be truncated to this value.

color.bias

Bias parameter for color palette, it is the same as bias parameter of colorRampPalette. Default: 1.

color.ramp

A name of a color palette, choose from rownames of brewer.pal.info. Default: YlOrRd.

color.palette

A vector of colors. Overwrites the palette for color.ramp. Default: NULL.

smooth.func

An optional smoothing function for the matrix. Default: NULL.

plot.space

Top and bottom margin. Default: 0.1.

plot.height

The relative height of contact map to coverage plot. Default: 1.

top

Logical value, whether to place this plot on the coverage plot. Default: TRUE.

show.rect

Logical value, whether to add rect border to the plot. Default: FALSE.

Value

Plot.

Examples

library(ggcoverage) library(HiCDataHumanIMR90) data(Dixon2012_IMR90, package = "HiCDataHumanIMR90") mat <- as.matrix(hic_imr90_40@.Data[[1]]@intdata)
#> 载入需要的程辑包:HiTC
#> 载入需要的程辑包:IRanges
#> 载入需要的程辑包:BiocGenerics
#> #> 载入程辑包:'BiocGenerics'
#> The following objects are masked from 'package:stats': #> #> IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package: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
#> 载入需要的程辑包:S4Vectors
#> 载入需要的程辑包:stats4
#> #> 载入程辑包:'S4Vectors'
#> The following object is masked from 'package:base': #> #> expand.grid
#> 载入需要的程辑包:GenomicRanges
#> 载入需要的程辑包:GenomeInfoDb
granges <- hic_imr90_40@.Data[[1]]@xgi # prepare coverage dataframe df <- data.frame( seqnames = "chr1", start = seq(from = 50000000, to = 59999000, by = 1000), end = seq(from = 50001000, to = 60000000, by = 1000), score = sample(1:100, 10000, replace = TRUE), Type = "Example", Group = "Example" ) # create plot ggcoverage( data = df, color = "grey", region = "chr1:50000000-56000000", mark.region = NULL, range.position = "out" ) + geom_tad2(matrix = log2(mat + 1), granges = granges, zlim = 5, color.palette = c("blue", "red"))
#> Error in ggcoverage(data = df, color = "grey", region = "chr1:50000000-56000000", mark.region = NULL, range.position = "out"): 参数没有用(region = "chr1:50000000-56000000")