Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Bioinformatics with Python Cookbook

You're reading from   Bioinformatics with Python Cookbook Learn how to use modern Python bioinformatics libraries and applications to do cutting-edge research in computational biology

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781782175117
Length 306 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Python and the Surrounding Software Ecology 2. Next-generation Sequencing FREE CHAPTER 3. Working with Genomes 4. Population Genetics 5. Population Genetics Simulation 6. Phylogenetics 7. Using the Protein Data Bank 8. Other Topics in Bioinformatics 9. Python for Big Genomics Datasets Index

Finding a protein in multiple databases


Before we start performing some more structural biology, we will see how to access existing proteomic databases such as UniProt. We will query UniProt for our gene of interest: TP53 and take it from there.

Getting ready

To access data, we will use Biopython and the REST API (we used a similar approach in Chapter 3, Working with Genomes) with the requests library to access web APIs. The requests API is an easy-to-use wrapper for web requests that can be installed using standard Python mechanisms (for example, pip and conda).

You can find this content in the 06_Prot/Intro.ipynb notebook.

How to do it...

Take a look at the following steps:

  1. First, let's define a function to perform REST queries on UniProt as follows:

    import requests
    server = 'http://www.uniprot.org/uniprot'
    def do_request(server, ID='', **kwargs):
        params = ''
        req = requests.get('%s/%s%s' % (server, ID, params),params=kwargs)
        if not req.ok:
            req.raise_for_status()
        return...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image