Learn R Programming

diffloop (version 1.0.2)

annotateLoops: Annotate loops as Enhancer-Promoter or CTCF-CTCF

Description

annotateLoops adds a column to the rowData slot of a loops object categorizing loops as either e-p (enhancer-promoter), ctcf (CTCF-CTCF) or none (no biological annotation). If both ctcf and e-p, then categorized as e-p.

Usage

annotateLoops(lto, ctcf, enhancer, promoter)

## S3 method for class 'loops,GRanges,GRanges,GRanges': annotateLoops(lto, ctcf, enhancer, promoter)

Arguments

lto
A loops object whose loops will be annotated
ctcf
GRanges object corresponding to locations of CTCF peaks
enhancer
GRanges object corresponding to locations of enhancer peaks
promoter
GRanges object corresponding to locations of promoter regions

Value

  • A loops object with an additional row 'loop.type' in the rowData slot

Details

Function annotates loops where both anchors are near CTCF peaks or where one anchor is near an enhancer and the other near a promoter. Consider using functions addchr, rmchr, bedToGRanges, and padGRanges when setting up the 3 GRanges inputs. Provide a blank GRanges objects to ignore classification for one set.

Examples

Run this code
rda<-paste(system.file('rda',package='diffloop'),'loops.small.rda',sep='/')
load(rda)
ctcf_j <- system.file('extdata','Jurkat_CTCF_chr1.narrowPeak',package='diffloop')
ctcf <- rmchr(padGRanges(bedToGRanges(ctcf_j), pad = 1000))
h3k27ac_j <- system.file('extdata','Jurkat_H3K27ac_chr1.narrowPeak',package='diffloop')
h3k27ac <- rmchr(padGRanges(bedToGRanges(h3k27ac_j), pad = 1000))
promoter <- padGRanges(getHumanTSS(c('1')), pad = 1000)
jn <- loops.small[,c(1,2,5,6)]
assoc_jn <- quickAssoc(jn)
assoc_jn <- removeSelfLoops(assoc_jn)
annotated_jn <- annotateLoops(assoc_jn, ctcf, h3k27ac, promoter)

Run the code above in your browser using DataLab