Filter intergenic regions in a .bed file
2
0
Entering edit mode
2.8 years ago
paulklein05 ▴ 20

Hello everyone,

I am looking for a way to filter out intra-genic regions (thus exons + introns), to only keep inter-genic regions from a .bed file. My first guess was to use the intersect command from bedtools, by comparing my bed file with the human reference genome

bedtools intersect -a my_file.bed -b hg38_genome.bed  -v > out.bed

I extracted the hg38_genome.bed file from UCSC webpage (with default parameters) but I am unsure of its content: does this file give exons associated chromosome locations and coordinates ? Or does it give entire genes (exons + introns) boundaries, which is what I am looking for ?

I am very new to bioinformatics so do not hesitate to suggest a different approach.

Best,
Paul

ucsc bedtools • 1.9k views
ADD COMMENT
2
Entering edit mode
2.8 years ago

you can select a variety of bedfiles from UCSC according to your regions of interest. If you select the default "Whole Gene" you will get exons+introns.

ucsc dialog page

ADD COMMENT
0
Entering edit mode

Hello @kevin, thanks for you reply !

I think that is what I am looking for, but when I check the first few lines of the generated file, I do not understand why I get overlapping regions regarding the coordinates: enter image description here

Am I missing something ?

ADD REPLY
1
Entering edit mode

Overlapping features are usually different transcripts of the same gene. You can get a visual confirmation of this if you load the downloaded bed file as a custom track in the genome browser. You can also see the transcript id annotated in the fourth column of your screenshot.

ADD REPLY
1
Entering edit mode
2.8 years ago
ATpoint 86k

Use bedtools complement. Intergenic is the complement of the genome with everything that is annotated as "gene" (and its subsets like exon, intron, UTRs...) so just complement the genome with a GTF file, e.g. from GENCODE filtered for type gene and you have your intergenic regions

ADD COMMENT
0
Entering edit mode

I did not know this bedtools command, thanks for sharing :)

ADD REPLY

Login before adding your answer.

Traffic: 1573 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6