Hi,

I'm trying to annotate genomic intervals with their corresponding genes in R.
My code:
```
  db = TxDb.Hsapiens.UCSC.hg38.knownGene
  bed = import.bed(bed_path)
  genes = transcriptsByOverlaps(ranges = bed, x = db, maxgap=0, columns='gene_id')
```
I get for each interval the overlapping part to each gene.
I want to get the original interval and the corresponding genes. 

For example if my BED file look like this:
```
chr1	152078793	156262976
```
I want to get:
```
chr1	152078793	156262976  gene1
chr1	152078793	156262976  gene2
chr1	152078793	156262976  gene3
```
and not:
```
chr1    152079557    152080903  gene1
chr1    152084141    152089064  gene2
```

Like bedtools intersect with the `-wo` parameter.

Thank you!
My bad. I misinterpreted. U can try below thing.

    mergeByOverlaps(bed, genes)