This function calculates the statistical significance of overlapping/ non-overlapping peaks against a reference peak file. If the reference peak file has the BED6+4 format (peak called by MACS2), the function generates a series of box plots showing the distribution of q-values for sample peaks that are overlapping and non-overlapping with the reference. If the reference peak file does not have the BED6+4 format, the function uses enrichPeakOverlap from ChIPseeker package to calculate the statistical significance of overlapping peaks only. In this case, please provide an annotation file as a TxDb object.

  txdb = NULL,
  interact = FALSE,
  nShuffle = 50,
  digits = 4,
  workers = check_workers()



A reference peak file as GRanges object.


A list of peak files as GRanges object. Files must be listed and named using list(). E.g. list("name1"=file1, "name2"=file2). If not named, default file names will be assigned.


A TxDb annotation object from Bioconductor. This is required only if the reference file does not have BED6+4 format.


Default TRUE. By default, plots are interactive. If set FALSE, all plots in the report will be static.


shuffle numbers


integer indicating the number of decimal places (round) or significant digits (signif) to be used. For round, negative values are allowed (see ‘Details’).


Number of threads to parallelize across.


A named list.

  • "plot"boxplot/barplot showing the statistical significance of overlapping/non-overlapping peaks.

  • "data"Plot data.


### Load Data ###
data("encode_H3K27ac") # example peakfile GRanges object
data("CnT_H3K27ac") # example peakfile GRanges object
data("CnR_H3K27ac") # example peakfile GRanges object 
### Create Named Peaklist & Reference ###
peaklist <- list('CnT'=CnT_H3K27ac, "CnR"=CnR_H3K27ac)
reference <- list("ENCODE"=encode_H3K27ac) 
out <- overlap_stat_plot(reference = reference,
                         peaklist = peaklist,
                         workers = 1) 
#> --- Running overlap_stat_plot() ---
#> Preparing reference.
#> Extracting only the first GRanges object from list.
#> Done.