The function counts DMPs overlapping with genomic regions.
In fact, this function operates as getDIMPatGenes
function,
but without the restrictions set for GRanges objects derived from MethylIT
pipeline.
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
# S3 method for default
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
# S3 method for GRanges
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
# S3 method for pDMP
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
# S3 method for InfDiv
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
# S3 method for list
getDMPatRegions(
GR,
regions,
only.hypo = FALSE,
only.hyper = FALSE,
type = "within",
ignore.strand = TRUE,
gene_id_col = NULL,
gene_name_col = NULL,
...
)
An objects object from the any of the classes: 'pDMP', 'InfDiv', GRangesList, GRanges or a list of GRanges.
A GRanges object with gene coordinates and gene IDs. A meta-column named 'gene_id' carying the gene ids should be included. If the meta-column named 'gene_id' is not provided, then gene (region) ids will be created using the gene (region) coordinates.
logical(1). Whether to select only hypo-methylated or hyper-methylated cytosine sites.
Same as for
findOverlaps-methods
optional arguments for
findOverlaps-methods
. Users must evaluate
whether specific setting makes sense on each particular context.
A GRanges object
## Gene annotation
genes <- GRanges(seqnames = '1',
ranges = IRanges(start = c(3631, 6788, 11649),
end = c(5899, 9130, 13714)),
strand = c('+', '-', '-'))
mcols(genes) <- data.frame(gene_id = c('AT1G01010', 'AT1G01020',
'AT1G01030'))
## Get a dataset of dmps from the package
data(dmps)
## Finally DMPs found on genes
dmrs <- getDMPatRegions(GR = dmps, regions = genes)