I have a bed file that contains 'enhancer' regions based on histone marks obtained using PARE. The program uses nucleosome free regions to identify possible enhancer sites based on the histone mark H3K4me1. However, a small number of the regions in the bed file are located in introns / exons and I'd like to filter and keep only the rows that contain intergenic regions (defined as being 5k+ from the TSS / TSE).
I assumed that this could be done pretty easily using something like bedtools. Using slopBed
to window RefSeq TSS (from UCSC) 5k +/- and then using the intersectBed
option to keep only the regions in my 'enhancer' bed file that don't overlap with my TSS-windowed bed file via -v
parameter. But I am still getting a couple of regions that fall inside introns so that method isn't exactly working.
Does anyone know a relatively simple way to do this?
The first method seems to have worked well, thank you! I'll have to start working with bedops more often.