annotateBedFromDb: Annotate .bed file to genes

Description Usage Arguments Value Examples

View source: R/fullPipeline.R

Description

Wrapper for transcriptsByOverlaps(). Returns a GRanges with the gene and transcript ids associated with the input .bed regions. Sometimes it is necessary to expand the search window a bit, because not all .bed regions directly overlap with a transcription start site, so the 'window' parameter is provided to accomplish this.

Usage

1
2
annotateBedFromDb(pathToBed = NULL, gRanges = NULL, db = NULL,
  window = 5000)

Arguments

pathToBed

The system path to a .bed file (directory + file name)

gRanges

If the user has a .bed file already loaded in R, they can supply it here as a GRanges object rather than re-importing it

db

A TxDb object containing the transcripts of the organism (required)

window

The window around a .bed region to search for genes, default 5kb

Value

A GRanges object with corresponding EntrezGene IDs in gene_id column, plus transcript IDs in tx_id

Examples

1
2
3
4
5
6
library(TxDb.Mmusculus.UCSC.mm9.knownGene)
txdb = TxDb.Mmusculus.UCSC.mm9.knownGene
data(bed.sample)
range = GRanges(seqnames=bed.sample$chr, IRanges(start=bed.sample$start, end=bed.sample$end))
x = annotateBedFromDb(gRanges = range, db = txdb)
x

CompGO documentation built on Nov. 8, 2020, 8:22 p.m.