Learn R Programming

methyAnalysis (version 1.14.0)

annotateGRanges: Annotate a GRanges object

Description

Annotate a GRanges object based on a transcription database

Usage

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

Value

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

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.

See Also

See Also annotateDMRInfo

Examples

Run this code
	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')
	}

Run the code above in your browser using DataLab