This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get the no-overlapping exome region (.bed file)?

I want to get the hg38 whole exome regions (.bed) for the downstream analysis. However, some regions in the .bed file browsed from the UCSC table are overlapped. How to get the no-overlapping exome region .bed file?

My settings for the UCSC table browser as follows:

  • clade: mammal
  • genome: human
  • assembly: Dec.2013 (GRCh38/hg38)
  • group: Genes and Gens Predictions
  • track: GENCODE v24
  • table: knownGene
  • position: chr22:1-50818468
  • output format: BED

Click "Get Output", select “Exons plus 0 bases at each end”, and get the .bed file.

In this .bed file, the regions from row 29:15690025-15690709 and row 40:15690077-15690314 are overlapped. There are some other overlapped regions in this file. How to get the .bed file with no-overlapping exome regions? BEDtools?

Thank you!!!

exome exon bed ucsc hg38

1 answer

With BEDOPS bedops -n:

$ bedops -n 1 regions.bed regions.bed > non-overlapping-regions.bed

What comes out of UCSC is sorted correctly, usually, so I think you can skip presorting.

Log in to answer this question.