{ "metadata": { "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.7-final" }, "orig_nbformat": 2, "kernelspec": { "name": "Python 3.7.7 64-bit ('venv')", "display_name": "Python 3.7.7 64-bit ('venv')", "metadata": { "interpreter": { "hash": "17bc9938523e8684804b5c9e437e56e3c7dc2f5e3e9877e0ef5d12cb8896b755" } } } }, "nbformat": 4, "nbformat_minor": 2, "cells": [ { "source": [], "cell_type": "markdown", "metadata": {} }, { "source": [ "# Predicted ligand binding sites in interaction interface\n", "\n", "If you have a protein of interest and want to know the predicted ligand binding sites of it which are also in a protein-protein interaction, you can first make use of the annotations API for a UniProt accession to get all annotations from PDBe-KB partners for the protein.\n", "\n", "The predicted ligand site annotations are provided by `p2rank` and `3dligandsite`. Post process this response to filter the `accession` field for these providers. This gives all UniProt residues which are annotated as a predicted ligand binding site. \n", "\n", "\n" ], "cell_type": "markdown", "metadata": {} }, { "source": [ "\n", "![alt](../images/web4_annotations.png)" ], "cell_type": "markdown", "metadata": {} }, { "source": [ "## 1) Get the annotations data for UniProt accession `P61626`" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 40, "metadata": { "tags": [] }, "outputs": [], "source": [ "import requests\n", "from pprint import pprint\n", "\n", "accession = \"P61626\"\n", "annotations_url = f\"https://www.ebi.ac.uk/pdbe/graph-api/uniprot/annotations/{accession}\"\n", "\n", "annotations_data = requests.get(annotations_url).json()\n", "\n" ] }, { "source": [ "## 2) Filter the data for providers `p2rank` and `3dligandsite`" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 41, "metadata": { "tags": [] }, "outputs": [], "source": [ "all_ligand_binding_residues = list()\n", "\n", "for provider_data in annotations_data[accession][\"data\"]:\n", " if provider_data[\"accession\"] in [\"p2rank\", \"3dligandsite\"]:\n", " residues = [x[\"startIndex\"] for x in provider_data[\"residues\"]]\n", " all_ligand_binding_residues.extend(residues)\n" ] }, { "source": [ "## 3) Get interacting residues for the UniProt accession\n", "\n", "Use the interface residues for a UniProt accession API call to get this data.\n", "\n", "![interface residues](../images/web4_interface_residues.png)\n" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [], "source": [ "interface_url = f\"https://www.ebi.ac.uk/pdbe/graph-api/uniprot/interface_residues/{accession}\"\n", "\n", "interface_data = requests.get(interface_url).json()\n" ] }, { "source": [ "## 4) Filter `interface_data` on common residues\n", "\n" ], "cell_type": "markdown", "metadata": {} }, { "cell_type": "code", "execution_count": 43, "metadata": { "tags": [] }, "outputs": [], "source": [ "all_interface_residues = list()\n", "\n", "for item in interface_data[accession][\"data\"]:\n", " interacting_residues = [x[\"startIndex\"] for x in item[\"residues\"] if x[\"startIndex\"] in all_ligand_binding_residues]\n", " all_interface_residues.extend(interacting_residues)" ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "tags": [] }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": "Residues of P61626 which is predicted ligand binding site and part of protein-protein interaction are [53, 64, 67, 71, 76, 78, 82, 122, 126, 128, 40, 42, 45, 96, 115, 53, 62, 96]\n" } ], "source": [ "print(f\"Residues of {accession} which is predicted ligand binding site and part of protein-protein interaction are {all_interface_residues}\")" ] } ] }