Skip to Content
Bioinformatics with Python Cookbook - Second Edition
book

Bioinformatics with Python Cookbook - Second Edition

by Tiago Antao
November 2018
Intermediate to advanced
360 pages
9h 36m
English
Packt Publishing
Content preview from Bioinformatics with Python Cookbook - Second Edition

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 requestsserver = '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 req
  1. We can now query all p53 genes that have been reviewed:
req = do_request(server, query='gene:p53 AND reviewed:yes', format='tab', columns='id,entry name,length,organism,organism-id,database(PDB),database(HGNC)', limit='50')

We will query the p53 gene and request all entries that are reviewed (manually curated). The output will be in a tabular format. We will request a maximum of 50 results, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

Tiago Antao

Publisher Resources

ISBN: 9781789344691Supplemental Content