getDIMPatGene {MethylIT}R Documentation

Count DMPs at gene-body

Description

The function counts DMPs overlapping with gene-body. In fact, this function also can be used to count DMPs overlapping with any set of regions given in a GRanges object.

Usage

getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

## Default S3 method:
getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

## S3 method for class 'GRanges'
getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

## S3 method for class 'pDMP'
getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

## S3 method for class 'InfDiv'
getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

## S3 method for class 'list'
getDIMPatGenes(GR, GENES, ignore.strand = TRUE)

Arguments

GR

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

GENES

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.

ignore.strand

When set to TRUE, the strand information is ignored in the calculations. Default value: TRUE

...

Not in use.

Value

A GRanges object

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 potential signals and the estimated cutpoint from the
## package
data(PS, cutpoint)

## The estimated cutpoints are used to discriminate signals from the noise.
## That is, DMPs are selected using the cupoints
DIMPs <- selectDIMP(PS, div.col = 9L, cutpoint = cutpoint$cutpoint)

## Finally DMPs found on genes
DIMR <- getDIMPatGenes(GR = DIMPs$T1, GENES = genes)


[Package MethylIT version 0.3.1 ]