View source: R/geneAnnotation.R
geneAnnotation | R Documentation |
Annotates RLRanges with entrez ids for overlapping genes. See details.
geneAnnotation(object, txdb = NULL)
object |
An RLRanges object. |
txdb |
The TxDb or EnsDb object containing gene annotations. If not supplied, annotations will be automatically downloaded from AnnotationHub. See also GenomicFeatures::TxDb. |
The geneAnnotation
function provides a simple procedure for annotating
RLRanges with gene IDs by overlap.
First. gene annotations are automatically downloaded using AnnotationHub::query with the following pattern:
AnnotationHub::query( x = ah, pattern = c("TxDb", "UCSC", "knownGene", genome) )
Where genome
is the UCSC genome id for the RLRanges object. If these
annotations are unavailable, they should be provded using the txdb
parameter. See also GenomicFeatures::TxDb.
The annotations are subsequently overlapped with the ranges in the
supplied RLRanges object using valr::bed_intersect and saved in the
RLResults object as a tbl
with a mapping of peak names to gene_id
(entrez gene IDs).
An RLRanges object with gene overlaps included. The results
are available via rlresult(object, "geneAnnoRes")
. The result object
is a tbl
with a mapping of peak_name
(peak names from names(object)
)
to gene_id
(entrez gene IDs).
# Example RLRanges data rlr <- readRDS(system.file("extdata", "rlrsmall.rds", package = "RLSeq")) # Perform gene annotation rlr <- geneAnnotation(rlr) # Supply custom TxDb if needed if (GenomeInfoDb::genome(rlr)[1] == "hg19") { library(TxDb.Hsapiens.UCSC.hg19.knownGene) rlr <- geneAnnotation(rlr, txdb = TxDb.Hsapiens.UCSC.hg19.knownGene) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.