Skip to content

Extract 3'UTR, 5'UTR, CDS, Promoter, Genes, Introns, Exons from GTF files

License

Notifications You must be signed in to change notification settings

mksamur/gencode_regions

 
 

Repository files navigation

gencode_regions

Extract 3'UTR, 5'UTR, CDS, Promoter, Genes from Gencode files

Depedencies

Run

./create_regions_from_gencode.R <path_to_GFF/GTF> <path_to_output_dir>

Will create exons.bed, 3UTR.bed, 5UTR.bed, genes.bed, cds.bed in <output_dir>

Example

  • Download GFF/GTF(GRCh37, v25, comprehensive, CHR) from gencodegenes.org:
   wget ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_25/gencode.v25.annotation.gff3.gz \
   && gunzip gencode.v25.annotation.gff3.gz
  • Create regions:
./create_regions_from_gencode.R gencode.v25.annotation.gff3 /path/to/GRCh37/annotation

First exons, Last exons

We use GenePred format to make the process a bit simple.

  • Download gtfToGenePred

  • Convert gtf to GenePred:

    gtfToGenePred gencode.v25.annotation.gtf gencode.v25.annotation.genepred
    
  • Extract first exons:

    python genepred_to_bed.py --first_exon gencode.v25.annotation.genepred
    
  • Extract last exons:

    python genepred_to_bed.py --last_exon gencode.v25.annotation.genepred
    

Size distribution

Human

img

Mouse

img

Confused about exons and UTRs?

This should be helpful: img

Source: Wikipedia

or probably this:

img

Source: Biostar

About

Extract 3'UTR, 5'UTR, CDS, Promoter, Genes, Introns, Exons from GTF files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.3%
  • Python 1.2%
  • Other 0.5%