getDMPatRegions: Count DMPs at Genomic Regions

getDMPatRegionsR Documentation

Count DMPs at Genomic Regions

Description

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.

Usage

getDMPatRegions(
  GR,
  regions,
  only.hypo = FALSE,
  only.hyper = FALSE,
  type = "within",
  ignore.strand = TRUE,
  gene_id_col = NULL,
  gene_name_col = NULL,
  ...
)

## Default S3 method:
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 class '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 class '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 class '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 class 'list'
getDMPatRegions(
  GR,
  regions,
  only.hypo = FALSE,
  only.hyper = FALSE,
  type = "within",
  ignore.strand = TRUE,
  gene_id_col = NULL,
  gene_name_col = NULL,
  ...
)

Arguments

GR

An objects object from the any of the classes: 'pDMP', 'InfDiv', GRangesList, GRanges or a list of GRanges.

regions

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.

only.hypo, only.hyper

logical(1). Whether to select only hypo-methylated or hyper-methylated cytosine sites.

ignore.strand, type

Same as for findOverlaps-methods

...

optional arguments for findOverlaps-methods. Users must evaluate whether specific setting makes sense on each particular context.

Value

A GRanges object

See Also

getDIMPatGenes

Examples

## 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)


genomaths/MethylIT documentation built on Feb. 3, 2024, 1:24 a.m.