A function to compute nucleosome enrichment over a Vmat

# S3 method for Vmat
nucleosomeEnrichment(x, background, plus1_nuc_only = FALSE, ...)

Arguments

x

a computed Vmat. Should be un-normalized.

background

a background Vmat. Should be un-normalized.

plus1_nuc_only

Boolean, should compute nucleosome enrichment only for +1 nucleosome?

...

additional parameters

Value

list

Examples

data(bam_test)
data(ce11_proms)
V <- plotVmat(
    bam_test,
    ce11_proms,
    normFun = '',
    return_Vmat = TRUE
)
#> Computing V-mat
#> Normalizing the matrix
#> No normalization applied
#> Smoothing the matrix
V_bg <- plotVmat(
    bam_test,
    sampleGRanges(ce11_proms),
    normFun = '',
    return_Vmat = TRUE
)
#> Computing V-mat
#> Normalizing the matrix
#> No normalization applied
#> Smoothing the matrix
n <- nucleosomeEnrichment(V, V_bg)
#> Warning: 'x' has been rounded to integer: Mean relative difference: 0.0002458412
n$fisher_test
#> 
#> 	Fisher's Exact Test for Count Data
#> 
#> data:  matrix(vec, ncol = 2)
#> p-value = 0.1392
#> alternative hypothesis: true odds ratio is not equal to 1
#> 95 percent confidence interval:
#>   0.6624351 16.2053490
#> sample estimates:
#> odds ratio 
#>   2.765101 
#> 
n$plot