peakPermTest: Permutation Test for two given peak lists

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/peakPermTest.R

Description

Performs a permutation test to seee if there is an association between two given peak lists.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
peakPermTest(
  peaks1,
  peaks2,
  ntimes = 100,
  seed = as.integer(Sys.time()),
  mc.cores = getOption("mc.cores", 2L),
  maxgap = -1L,
  pool,
  TxDb,
  bindingDistribution,
  bindingType = c("TSS", "geneEnd"),
  featureType = c("transcript", "exon"),
  seqn = NA,
  ...
)

Arguments

peaks1, peaks2

an object of GRanges

ntimes

number of permutations

seed

random seed

mc.cores

The number of cores to use. see mclapply.

maxgap

See findOverlaps in the IRanges package for a description of these arguments.

pool

an object of permPool

TxDb

an object of TxDb

bindingDistribution

an object of bindist

bindingType

where the peaks should bind, TSS or geneEnd

featureType

what annotation type should be used for detecting the binding distribution.

seqn

default is NA, which means not filter the universe pool for sampling. Otherwise the universe pool will be filtered by the seqnames in seqn.

...

further arguments to be passed to numOverlaps.

Value

A list of class permTestResults. See permTest

Author(s)

Jianhong Ou

References

Davison, A. C. and Hinkley, D. V. (1997) Bootstrap methods and their application, Cambridge University Press, United Kingdom, 156-160

See Also

preparePool, bindist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    path <- system.file("extdata", package="ChIPpeakAnno")
    #files <- dir(path, pattern="[12]_WS170.bed", full.names=TRUE)
    #peaks1 <- toGRanges(files[1], skip=5)
    #peaks2 <- toGRanges(files[2], skip=5)
    #peakPermTest(peaks1, peaks2, TxDb=TxDb.Celegans.UCSC.ce6.ensGene)
    if(interactive()){
        peaks1 <- toGRanges(file.path(path, "MACS2_peaks.xls"), 
                            format="MACS2")
        peaks2 <- toGRanges(file.path(path, "peaks.narrowPeak"), 
                            format="narrowPeak")
        library(TxDb.Hsapiens.UCSC.hg19.knownGene)
        peakPermTest(peaks1, peaks2, 
               TxDb=TxDb.Hsapiens.UCSC.hg19.knownGene, min.pctA=10)
    }

LihuaJulieZhu/ChIPpeakAnno documentation built on Aug. 5, 2020, 12:02 a.m.