see post here:
http://davetang.org/muse/2013/01/18/exons-introns-and-intergenic-regions/
Exons, introns and intergenic regions
Posted on January 18, 2013 by Davo
I'm interested in defining the exons, introns and intergenic regions of the genome based on GENCODE. So I thought about a fuss free way to do this, and BEDTools would be perfect.
Download the latest GENCODE annotations (version 14):
| 1 | wgetftp://ftp.sanger.ac.uk/pub/gencode/release_14/gencode.v14.annotation.gtf.gz |
I will use mergeBed, subtractBed and complementBed. See here for usage examples.
The GTF file defines exons, so I will find all exons, output as a minimal bed file, sort the bed file and merge the overlapping exons:
1 |
|
To define intronic regions, we need to define the gene i.e. obtain the gene coordinates, and subtract the exons from this.
1 |
|
And finally to define intergenic regions, we use complementBed to find regions not covered by genes. To create a hg19_chrom_info.txt file, use the fetchChromSizes executable available at http://hgdownload.cse.ucsc.edu/admin/exe/ to create the hg19_chrom_info.txt file for hg19.
1 |
|
