findOverlappingElements: Find overlaps between guides and annotated elements

View source: R/MAUDE.R

findOverlappingElementsR Documentation

Find overlaps between guides and annotated elements

Description

Finds guides that overlap the elements of a BED-like data.frame (e.g. open chromatin regions) and returns a new data.frame containing those overlaps

Usage

findOverlappingElements(
  guides,
  elements,
  guides.pos = "pos",
  guides.chr = "chr",
  elements.start = "st",
  elements.end = "en",
  elements.chr = "chr"
)

Arguments

guides

a data.frame containing guide information including the guides genomic position in a column named guides.pos

elements

a data.frame containing element information, as in a BED file, including the element's genomic start, end, and chromosome in columns named elements.start, elements.end, and elements.chr

guides.pos

the name of the column in guides that contains the genomic position targeted by the guide (defaults to "pos")

guides.chr

the name of the column in guides that contains the genomic chromosome targeted by the guide (defaults to "chr")

elements.start

the name of the column in elements that contains the start coordinate of the element (defaults to "st")

elements.end

the name of the column in elements that contains the start coordinate of the element (defaults to "en")

elements.chr

the name of the column in elements that contains the start coordinate of the element (defaults to "chr")

Value

Returns a new data.frame containing the intersection of elements and guides

Examples

set1 = data.frame(gid=1:10, chr=c(rep("chr1",5), rep("chr5",5)),
  pos= c(1:5,1:5)*10, stringsAsFactors = FALSE)
set2 = data.frame(eid=1:4, chr=c("chr1","chr1","chr4","chr5"), st=c(5,25,1,45),
    en=c(15,50,50,55), stringsAsFactors = FALSE)
findOverlappingElements(set1, set2)

Carldeboer/MAUDE documentation built on March 27, 2022, 8:50 p.m.