calcPairs | R Documentation |
calcPairs will calculate pairs of interactions within a rolling windowSize. By default, pairs of interactions are returned as StrictGInteractions where anchor1 <= anchor2 for all interactions (mode = 'strict'). For more information see (?InteractionSet::'GInteractions-class'). Self interactions (e.g. 1, 1 or 2, 2) and order (e.g. 1, 2 is the same as 2, 1) are ignored.
calcPairs(gr, windowSize, mode = "strict")
gr |
GRanges object |
windowSize |
integer defining the window |
mode |
If mode="strict", a StrictGInterctions object is returned with anchor indices swapped such that anchor1 <= anchor2 for all interactions. If mode="reverse", a ReverseStrictGInterctions object is returned with anchor indices swapped such that anchor1 >= anchor2. |
Returns a StrictGInterations object
## Load TxDb library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene ## Generate 50Kb bins across hg19 library(GenomicRanges) bins <- tileGenome(seqinfo(txdb), tilewidth = 50e3, cut.last.tile.in.chrom = TRUE) ## Calculate all 50Kb bin pairs within 1Mb calcPairs(gr = bins, windowSize = 1e6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.