November 2018
Intermediate to advanced
360 pages
9h 36m
English
Let's take a look at the following steps:
import gffutilsimport sqlite3try: db = gffutils.create_db('gambiae.gff.gz', 'ag.db')except sqlite3.OperationalError:db = gffutils.FeatureDB('ag.db')
The gffutils library creates a SQLite database to store annotations efficiently. Here, we will try to create the database, but if it already exists, we will use the existing one. This step can be time-consuming.
print(list(db.featuretypes()))for feat_type in db.featuretypes(): print(feat_type, db.count_features_of_type(feat_type))
These features will include contigs, genes, exons, transcripts, ...