R/CloseBySingleRegion.R
CloseBySingleRegion.Rd
Extract clusters of CpGs located closely in a genomic region.
a list of CpG IDs
Human genome of reference hg19 or hg38
Type of array, 450k or EPIC
A GRanges object with the genome manifest (as returned by
ExperimentHub
or by
ImportSesameData
). This function by default ignores this
argument in favour of the genome
and arrayType
arguments.
an integer, genomic locations within maxGap from each other are placed into the same cluster
an integer, minimum number of CpGs for the resulting CpG cluster
a list, each item in the list is a character vector of CpG IDs located closely (i.e. in the same cluster)
Note that this function depends only on CpG locations, and not on
any methylation data. The algorithm is based on the
clusterMaker
function in the bumphunter
R package. Each cluster is essentially a group of CpG locations such that
two consecutive locations in the cluster are separated by less than
maxGap
.
CpGs_char <- c(
"cg02505293", "cg03618257", "cg04421269", "cg17885402", "cg19890033",
"cg20566587", "cg27505880"
)
cluster_ls <- CloseBySingleRegion(
CpGs_char,
genome = "hg19",
arrayType = "450k",
maxGap = 100,
minCpGs = 3
)
#> snapshotDate(): 2021-05-18
#> see ?sesameData and browseVignettes('sesameData') for documentation