annotateGRanges: Annotate a GRanges object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/methyAnalysis.R

Description

Annotate a GRanges object based on a transcription database

Usage

1
annotateGRanges(grange, annotationDatabase, CpGInfo = NULL, exons = FALSE, flankRange = 0, promoterRange = 2000, checkGeneBody = FALSE, EntrezDB = "org.Hs.eg.db")

Arguments

grange

A GRanges object

annotationDatabase

Annotation database: a TxDb package, TxDb object or GRanges object.

CpGInfo

A Bed file or GRanges object, which keeps the CpG-island information

exons

Whether to annotate at the exon level. exons can be either TRUE/FALSE or a GRanges object represent the exon annotation.

flankRange

The flank range to be added to the input GRanges object

promoterRange

Define the size of promoter range at the upstream of TSS. Users can also directly provide the GRanges object

checkGeneBody

Determine whether to check the overlapping with gene body or just check the promoter region

EntrezDB

The Entrez database for mapping from Entrez ID to gene symbols

Details

This function is to annotate a GRanges object to the gene promoters or bodies. The annotation information is attached as additional columns of the GRanges object values.

Value

Return an annotated GRanges object with the annotation information attached as additional columns.

Author(s)

Pan Du

See Also

See Also annotateDMRInfo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
	data(exampleMethyGenoSet)
	## get sample type information
	sampleType <- colData(exampleMethyGenoSet)$SampleType
	
	## Do differential test
	allResult <- detectDMR.slideWin(exampleMethyGenoSet, sampleType=sampleType, testMethod='ttest')

	## Identify the DMR (Differentially Methylated Region) by setting proper parameters.
	## Here we just use default ones
	allDMRInfo <- identifySigDMR(allResult)
	sigDMRInfo <- allDMRInfo$sigDMRInfo
	class(sigDMRInfo)
	
	## Annotate significant DMR info
	if (require(TxDb.Hsapiens.UCSC.hg19.knownGene)) {
		sigDMRInfo.ann <- annotateDMRInfo(sigDMRInfo, 'TxDb.Hsapiens.UCSC.hg19.knownGene')
	}

methyAnalysis documentation built on Nov. 8, 2020, 8:09 p.m.