arq5x / bedtools

A powerful toolset for genome arithmetic.
http://code.google.com/p/bedtools/
GNU General Public License v2.0
139 stars 86 forks source link

Extract all genes within 5 kb, 10 kb of a genomic range. #160

Open demis001 opened 4 years ago

demis001 commented 4 years ago

I have a genomic region that have chr, start and end as a bed format. I have a gene annotation in bed format too. What is the best way to extract all genes within 5 kb, 10 kb of a given genomic range from gene annotation bed file?

Chr1  125086657 125086787
ChrX  121333162  121334618

I was using bedtools closest to extract the nearest genes, but don't know how to achieve to extract all annotation within 10 kb.

splaisan commented 4 years ago

have a look to bedtools flank instead then bedtools intersect the result with your gene file (bed or even GFF does here)