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
Run the code above in your browser using DataLab