-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_enrichment.Rd
83 lines (72 loc) · 3.07 KB
/
test_enrichment.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/test_enrichment.R
\name{test_enrichment}
\alias{test_enrichment}
\title{Test enrichment}
\source{
\href{https://www.bioconductor.org/packages/devel/bioc/vignettes/regioneR/inst/doc/regioneR.html}{
See section "3.7A note on reproducibility" for info on setting the seed.}
}
\usage{
test_enrichment(
grlist1,
grlist2,
ntimes = 100,
genome = "hg19",
alternative = "auto",
min.parallel = 1000,
force.parallel = NULL,
seed = 2022,
mc.set.seed = FALSE,
save_path = tempfile(fileext = "_test_enrichment.rds"),
verbose = TRUE,
...
)
}
\arguments{
\item{grlist1}{First list of \link[GenomicRanges]{GRanges} objects.}
\item{grlist2}{Second list of \link[GenomicRanges]{GRanges} objects.}
\item{ntimes}{number of permutations}
\item{genome}{The reference genome to use. A valid genome object.
Either a GenomicRanges or data.frame containing one region per whole
chromosome or a character uniquely identifying a genome in
BSgenome (e.g. "hg19", "mm10" but not "hg").
Internally it uses getGenomeAndMask.}
\item{alternative}{the alternative hypothesis must be one of \code{"greater"}, \code{"less"} or \code{"auto"}. If \code{"auto"}, the alternative will be decided depending on the data.}
\item{min.parallel}{if force.parallel is not specified, this will be used to determine the threshold for parallel computation. If \code{length(A) * ntimes > min.parallel}, it will activate the parallel computation. Single threaded otherwise.}
\item{force.parallel}{logical indicating if the computation must be paralelized.}
\item{seed}{Set the seed for reproducibility.}
\item{mc.set.seed}{"In order to create reproducible code with functions that use random
numbers such as the permutation testing in \pkg{regioneR} ,
it is necessary to use set.seed.
However, since \pkg{regioneR} uses parallel to perform the test it is
also necessary to set the \code{mc.set.seed} parameter to FALSE
to ensure reproducibility."}
\item{save_path}{Path to save results to as an \emph{RDS} file.
Set to \code{NULL} to skip this step.}
\item{verbose}{Print messages.}
\item{...}{
Arguments passed on to \code{\link[regioneR:overlapPermTest]{regioneR::overlapPermTest}}
\describe{
\item{\code{A}}{a region set in any of the accepted formats by \code{\link[regioneR]{toGRanges}} (\code{\link{GenomicRanges}}, \code{\link{data.frame}}, etc...)}
\item{\code{B}}{a region set in any of the accepted formats by \code{\link[regioneR]{toGRanges}} (\code{\link{GenomicRanges}}, \code{\link{data.frame}}, etc...)}
}}
}
\value{
data.frame
}
\description{
Conduct permutation enrichment tests between all combinations of
two named lists,
each containing one or more \link[GenomicRanges]{GRanges} objects.
Permutation tests are run using \link[regioneR]{overlapPermTest}.
}
\examples{
dat <- echodata::get_Nalls2019_merged()
grlist1 <- dat[P<5e-8,]
grlist2 <- dat[Support>0,]
enrich <- test_enrichment(grlist1 = grlist1,
grlist2 = grlist2,
ntimes = 25,
force.parallel = FALSE)
}