PDBe API webinar series Logo
1.0
  • Introduction to PDBe programmatic access
  • Searching with the PDBe API
    • PDB search
      • 1) Making imports and setting variables
      • 2) a function to get data from the search API
      • 3) formatting the search terms
      • 4) Getting useful data out of the search
      • 5) running a search
      • 6) Analysing and plotting the results
      • 7) searching for two terms at once
      • Questions to answer
    • PDB sequence search
      • 1) Making imports and setting variables
  • Creating complex PDBe API queries
  • Using the PDBe Graph API
    • Introduction
      • Using the documentation
    • Usecases
      • Predicted ligand binding sites in interaction interface
        • 1) Get the annotations data for UniProt accession P61626
        • 2) Filter the data for providers p2rank and 3dligandsite
        • 3) Get interacting residues for the UniProt accession
        • 4) Filter interface_data on common residues
      • Accessible residues for a PDB structure
        • 1) Get the 3Dcomplex annotations for PDB entry 3pxe
        • 2) Filter the data for ASA_alone label
        • 3) Filter site_residues on raw_score > 0
  • PDBe tools in GitHub
    • pdbecif
      • Structure reading
        • Dictionary output
        • CIFWrapper output
        • CifFile output
      • Structure writing
    • pdbeccdutils
      • Structure reading
      • Component object
        • Scaffolds
        • Fragments
        • Molecular depictions
      • Structure writing
      • Parity method
      • Scripts
    • arpeggio
      • Precomputed data
      • Example
      • arpeggio script
      • arpeggio API
      • Excercise
  • Data visualisation at PDBe
    • PDB Component Library
    • Example Links
PDBe API webinar series
  • »
  • Searching with the PDBe API »
  • PDB search
  • View page source

PDB search¶

This interactive Python notebook will guide you through various ways of programmatically accessing Protein Data Bank in Europe (PDBe) data using REST API

The REST API is a programmatic way to obtain information from the PDB and EMDB. You can access details about:

  • sample

  • experiment

  • models

  • compounds

  • cross-references

  • publications

  • quality

  • assemblies and more… For more information, visit https://www.ebi.ac.uk/pdbe/pdbe-rest-api

This notebook is a part of the training material series, and focuses on getting information from the PDBe search API. Retrieve this material and many more from GitHub

1) Making imports and setting variables¶

First, we import some packages that we will use, and set some variables.

Note: Full list of valid URLs is available from https://www.ebi.ac.uk/pdbe/api/doc/

[162]:
import requests # used for getting data from a URL
from pprint import pprint # pretty print
import pandas as pd # used for turning results into mini databases
from solrq import Q # used to turn result queries into the right format

import cufflinks as cf
import plotly.offline as py

cf.go_offline() # required to use plotly offline (no account required).
py.init_notebook_mode() # graphs charts inline (IPython).

search_url = "https://www.ebi.ac.uk/pdbe/search/pdb/select?" # the rest of the URL used for PDBe's search API.