This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Quick way to find the nearest genes

Hi!

I have a bed file with coordinates of OCRs (open chromatin regions, ATAC-seq) for mm10 (mouse). My goal is to find for each region in my file the closest promoter with the respective distance. Can it be done quickly in python or R? And can it be generalizable? So I can use the same pipeline but for human regions?

Thanks

genes bed genome enhancers

1 answer

In R you can use the nearest() function from GenomicRanges. A standalone software would be bedtools closest. I would use a reference GTF file to run this against, which you can subset for transcription start sites or gene coordinates.

thanks for your reply, I will try to use bedtools command with the GTF file

Log in to answer this question.