How to do it...

Now, let's look at how we can search and fetch data from NCBI databases:

  1. We will start by importing the relevant module and configuring the email address:
from Bio import Entrez, SeqIOEntrez.email = 'put@your.email.here'

We will also import the module to process sequences. Do not forget to put in the correct email address.

  1. We will now try to find the chloroquine resistance transporter (CRT) gene in Plasmodium falciparum (the parasite that causes the deadliest form of malaria) on the nucleotide database:
handle = Entrez.esearch(db='nucleotide', term='CRT[Gene Name] AND "Plasmodium falciparum"[Organism]')rec_list = Entrez.read(handle)if rec_list['RetMax'] < rec_list['Count']: handle = Entrez.esearch(db='nucleotide', term='CRT[Gene ...

Get Bioinformatics with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.