overlap_percent: Calculate percentage of overlapping peaks

View source: R/overlap_percent.R

overlap_percentR Documentation

Calculate percentage of overlapping peaks

Description

This function calculates the percentage of overlapping peaks and outputs a table or matrix of results.

Usage

overlap_percent(
  peaklist1,
  peaklist2,
  invert = FALSE,
  precision_recall = TRUE,
  suppress_messages = TRUE
)

Arguments

peaklist1

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.

peaklist2

peaklist1 A list of peak files as GRanges object. Files must be listed and named using list(). e.g. list("name1"=file1, "name2"=file2).

invert

If TRUE, keep only the ranges in x that do not overlap ranges.

precision_recall

Return percision-recall results for all combinations of peaklist1 (the "query") and peaklist2 (the "subject"). See subsetByOverlaps for more details on this terminology.

suppress_messages

Suppress messages.

Value

data frame

Examples

### 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 ###
peaks <- list("CnT"=CnT_H3K27ac, "CnR"=CnR_H3K27ac)
reference_peak <- list("ENCODE"=encode_H3K27ac)

### Run ###
overlap <- overlap_percent(peaklist1=peaks,
                           peaklist2=reference_peak)

neurogenomics/EpiCompare documentation built on April 30, 2024, 3:58 p.m.