This function computes the underlying matrix shown as a heatmap in Vplots. For each pair of coordinates (x: distance from fragment midpoint to center of GRanges of interest; y: fragment size), the function computes how many fragments there are.

computeVmat(
  bam_granges,
  granges,
  cores = 1,
  xlims = c(-250, 250),
  ylims = c(50, 300)
)

Arguments

bam_granges

GRanges, paired-end fragments

granges

GRanges, regions to map the fragments onto

cores

Integer, nb of threads to parallelize fragments subsetting

xlims

The x limits of the computed Vmat

ylims

The y limits of the computed Vmat

Value

A table object

Examples

data(bam_test)
data(ce11_all_REs)
Vmat <- computeVmat(bam_test, ce11_all_REs)
dim(Vmat)
#> [1] 501 251
Vmat[seq(1,5), seq(1,10)]
#>       
#>        50 51 52 53 54 55 56 57 58 59
#>   -250  0  0  0  0  0  0  0  0  0  0
#>   -249  0  0  0  0  0  0  0  0  0  0
#>   -248  0  0  0  0  0  0  0  0  0  0
#>   -247  0  0  0  0  0  0  0  0  0  0
#>   -246  0  0  0  0  0  0  0  0  0  0