please would you advise about an efficient R code to solve the following problem :
-- given a BED file with the variant coordinates (> 10 000 entries) : let's call the file A
-- and a BED file with the gene coordinates (>50 000 genes) : let's call the file B
what is most efficient way to write the comparison in R, between file A and file B, and append the gene from file B to the file A, if there is an intersection of genomic coordinates ? thanks a lot !