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:
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/
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.