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.
GRanges, paired-end fragments
GRanges, regions to map the fragments onto
Integer, nb of threads to parallelize fragments subsetting
The x limits of the computed Vmat
The y limits of the computed Vmat
A table object
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