Traversing genome annotations
Having a genome sequence is interesting, but we will want to extract features from it, such as genes, exons, and coding sequences. This type of annotation information is made available in Generic Feature Format (GFF) and General Transfer Format (GTF) files. In this recipe, we will learn how to parse and analyze GFF files while using the annotation of the Anopheles gambiae genome as an example.
Getting ready
Use the Chapter05/Annotations.py
notebook file, which is provided in the code bundle for this book. The up-to-date location of the GFF file that we will be using can be found at the top of the notebook.
You will need to install gffutils
:
conda install -c bioconda gffutils
Now, we’re ready to start.
How to do it...
Follow these steps:
- Let’s start by creating an annotation database with
gffutils
, based on our GFF file:import gffutils import sqlite3 try: db = gffutils.create_db('gambiae...