Bioinformatics with Python Cookbook
Learn how to use modern Python bioinformatics libraries and applications to do cutting-edge research in computational biology, 2nd Edition
Tiago Antao
- 360 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Bioinformatics with Python Cookbook
Learn how to use modern Python bioinformatics libraries and applications to do cutting-edge research in computational biology, 2nd Edition
Tiago Antao
About This Book
Discover modern, next-generation sequencing libraries from Python ecosystem to analyze large amounts of biological data
Key Features
- Perform complex bioinformatics analysis using the most important Python libraries and applications
- Implement next-generation sequencing, metagenomics, automating analysis, population genetics, and more
- Explore various statistical and machine learning techniques for bioinformatics data analysis
Book Description
Bioinformatics is an active research field that uses a range of simple-to-advanced computations to extract valuable information from biological data.
This book covers next-generation sequencing, genomics, metagenomics, population genetics, phylogenetics, and proteomics. You'll learn modern programming techniques to analyze large amounts of biological data. With the help of real-world examples, you'll convert, analyze, and visualize datasets using various Python tools and libraries.
This book will help you get a better understanding of working with a Galaxy server, which is the most widely used bioinformatics web-based pipeline system. This updated edition also includes advanced next-generation sequencing filtering techniques. You'll also explore topics such as SNP discovery using statistical approaches under high-performance computing frameworks such as Dask and Spark.
By the end of this book, you'll be able to use and implement modern programming techniques and frameworks to deal with the ever-increasing deluge of bioinformatics data.
What you will learn
- Learn how to process large next-generation sequencing (NGS) datasets
- Work with genomic dataset using the FASTQ, BAM, and VCF formats
- Learn to perform sequence comparison and phylogenetic reconstruction
- Perform complex analysis with protemics data
- Use Python to interact with Galaxy servers
- Use High-performance computing techniques with Dask and Spark
- Visualize protein dataset interactions using Cytoscape
- Use PCA and Decision Trees, two machine learning techniques, with biological datasets
Who this book is for
This book is for Data data Scientistsscientists, Bioinformatics bioinformatics analysts, researchers, and Python developers who want to address intermediate-to-advanced biological and bioinformatics problems using a recipe-based approach. Working knowledge of the Python programming language is expected.
Frequently asked questions
Information
Next-Generation Sequencing
- Accessing GenBank and moving around NCBI databases
- Performing basic sequence analysis
- Working with modern sequence formats
- Working with alignment data
- Analyzing data in VCF
- Studying genome accessibility and filtering SNP data
- Processing NGS data with HTSeq
Introduction
Accessing GenBank and moving around NCBI databases
Getting ready
How to do it...
- We will start by importing the relevant module and configuring the email address:
from Bio import Entrez, SeqIO
Entrez.email = '[email protected]'
- 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 Name] AND "Plasmodium falciparum"[Organism]', retmax=rec_list['Count'])
rec_list = Entrez.read(handle)
- Now, let's try to retrieve all of these records. The following query will download all matching nucleotide sequences from GenBank, which is 481, at the time of writing this book. You probably won't want to do this all the time:
id_list = rec_list['IdList']
hdl = Entrez.efetch(db='nucleotide', id=id_list, rettype='gb')
any case, we will retrieve a list of records in the GenBank format (which includes sequences, plus a lot of interesting metadata).
- Let's read and parse the result:
recs = list(SeqIO.parse(hdl, 'gb'))
- We will now just concentrate on a single record. This will only work if you used the exact same preceding query:
for rec in recs:
if rec.name == 'KM288867':
break
print(rec.name) print(rec.description)
- Now, let's extract some sequence features, which contain information such as gene products and exon positions on the sequence:
for feature in rec.features:
if feature.type == 'gene':
print(feature.qualifiers['gene'])
elif feature.type == 'exon':
loc = feature.location
print(loc.start, loc.end, loc.strand)
else:
print('not processed:\n%s' % feature)