overlapPermTest: Permutation Test for Overlap

Description Usage Arguments Value Note See Also Examples

View source: R/overlapPermTest.R

Description

Performs a permutation test to see if the overlap between two sets of regions A and B is higher (or lower) than expected by chance. It will internally call permTest with the appropiate parameters to perform the permutation test. If B is a list or a GRangesList, it will perform one permutation test per element of the list, testing the overlap between A and each element of B independently.

Usage

1
overlapPermTest (A, B, alternative="auto", ...)

Arguments

A

a region set in any of the accepted formats by toGRanges (GenomicRanges, data.frame, etc...)

B

a region set in any of the accepted formats by toGRanges (GenomicRanges, data.frame, etc...)

alternative

the alternative hypothesis must be one of "greater", "less" or "auto". If "auto", the alternative will be decided depending on the data.

...

further arguments to be passed to or from methods.

Value

A list of class permTestResults containing the following components:

Note

IMPORTANT: Since it uses link{permTest} internally, it is possible to use most of the parameters of that function in overlapPermTest, including: ntimes, force.parallel, min.parallel and verbose. In addition, this function accepts most parameters of the randomizeRegions function including genome, mask, allow.overlaps and per.chromosome and the parameters of numOverlaps such as count.once.

See Also

overlapGraphicalSummary, overlapRegions, toDataframe, toGRanges, permTest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
genome <- filterChromosomes(getGenome("hg19"), keep.chr="chr1")
A <- createRandomRegions(nregions=20, length.mean=10000000, length.sd=20000, genome=genome, non.overlapping=FALSE) 
B <- c(A, createRandomRegions(nregions=10, length.mean=10000, length.sd=20000, genome=genome, non.overlapping=FALSE))

pt <- overlapPermTest(A=A, B=B, ntimes=10, genome=genome, non.overlapping=FALSE, verbose=TRUE)
summary(pt)
plot(pt)
plot(pt, plotType="Tailed")  
 
 
C <- c(B, createRandomRegions(nregions=10, length.mean=10000, length.sd=20000, genome=genome, non.overlapping=FALSE))
pt <- overlapPermTest(A=A, B=list(B=B, C=C), ntimes=10, genome=genome, non.overlapping=FALSE, verbose=TRUE)
summary(pt)
plot(pt)
 

regioneR documentation built on Nov. 8, 2020, 5 p.m.