getVennCounts: Obtain Venn Counts for Venn Diagram, internal function for...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getVennCounts.R

Description

Obtain Venn Counts for peak ranges using chromosome ranges or feature field, internal function for makeVennDigram

Usage

1
2
3
4
5
6
7
8
getVennCounts(
  ...,
  maxgap = -1L,
  minoverlap = 0L,
  by = c("region", "feature", "base"),
  ignore.strand = TRUE,
  connectedPeaks = c("min", "merge", "keepAll")
)

Arguments

...

Objects of GRanges. See example below.

maxgap, minoverlap

Used in the internal call to findOverlaps() to detect overlaps. See ?findOverlaps in the IRanges package for a description of these arguments.

by

region, feature or base, default region. feature means using feature field in the GRanges for calculating overlap, region means using chromosome range for calculating overlap, and base means using calculating overlap in nucleotide level.

ignore.strand

When set to TRUE, the strand information is ignored in the overlap calculations.

connectedPeaks

If multiple peaks involved in overlapping in several groups, set it to "merge" will count it as only 1, while set it to "min" will count it as the minimal involved peaks in any concered groups

Value

vennCounts

vennCounts objects containing counts for Venn Diagram generation, see details in limma package vennCounts

Author(s)

Jianhong Ou

See Also

makeVennDiagram, findOverlappingPeaks

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
if(interactive() || Sys.getenv("USER")=="jianhongou"){
peaks1 = GRanges(seqnames=c("1", "2", "3"), 
                 IRanges(start = c(967654, 2010897, 2496704), 
                            end = c(967754, 2010997, 2496804), 
                            names = c("Site1", "Site2", "Site3")),  
                   strand=as.integer(1), 
                   feature=c("a","b", "c"))
  peaks2 = 
      GRanges(seqnames= c("1", "2", "3", "1", "2"), 
                    IRanges(start=c(967659, 2010898, 2496700, 3075866, 3123260), 
                         end=c(967869, 2011108, 2496920, 3076166, 3123470), 
                         names = c("t1", "t2", "t3", "t4", "t5")), 
                    strand = c(1L, 1L, -1L,-1L,1L), 
                    feature=c("a","c","d","e", "a"))
    getVennCounts(peaks1,peaks2)
    getVennCounts(peaks1,peaks2, by="feature")
    getVennCounts(peaks1, peaks2, by="base")
}

ChIPpeakAnno documentation built on April 1, 2021, 6:01 p.m.