txdb <- loadDb(system.file("extdata", "hg19_knownGene_sample.sqlite",
package="GenomicFeatures"))
gr <- GRanges(seqnames = rep("chr1",2),
ranges = IRanges(start=c(500,10500), end=c(10000,30000)),
strand = strand(rep("-",2)))
transcriptsByOverlaps(txdb, gr)
Run the code above in your browser using DataLab