OpenCADD-KLIFS

Once you have installed the opencadd package, you will have access (among others) to the opencadd.databases.klifs module (OpenCADD-KLIFS). In case you wish to install only the dependencies relevant to OpenCADD-KLIFS, please follow the installation instructions here.

OpenCADD-KLIFS offers a simple API to interact with data from KLIFS remotely and locally.

Find a detailed tutorial at the TeachOpenCADD platform on the KLIFS database and on how to apply the module OpenCADD-KLIFS to an example research question.

What is KLIFS and who created it?

KLIFS is a kinase database that dissects experimental structures of catalytic kinase domains and the way kinase inhibitors interact with them. The KLIFS structural alignment enables the comparison of all structures and ligands to each other. Moreover, the KLIFS residue numbering scheme capturing the catalytic cleft with 85 residues enables the comparison of the interaction patterns of kinase-inhibitors, for example, to identify crucial interactions determining kinase-inhibitor selectivity.

What does opencadd.databases.klifs offer?

This module allows you to access KLIFS data such as information about kinases, structures, structural conformations, modified residues, ligands, drugs, interaction fingerprints, and bioactivities.

On the one hand, you can query the KLIFS webserver directly. On the other hand, you can query your local KLIFS download. We provide identical APIs for the remote and local queries and streamline all output into standardized pandas DataFrames for easy and quick downstream data analyses.

Work with KLIFS data from KLIFS server (remotely)

The opencadd.databases.klifs.remote submodule offers you to access KLIFS data from the KLIFS server.

Our API relies on the REST API and OpenAPI (formerly Swagger API) specification at https://dev.klifs.net/swagger_v2/ to dynamically generate a Python client with bravado.

Example for opencadd’s API to access remote data:

from opencadd.databases.klifs import setup_remote

# Set up remote session
session = setup_remote()

# Get all kinases that are available remotely
session.kinases.all_kinases()

# Get kinases by kinase name
session.kinases.by_kinase_name(["EGFR", "BRAF"])

Work with KLIFS data from disc (locally)

The opencadd.databases.klifs.local submodule offers you to access KLIFS data from your KLIFS download. In order to make use of the module’s functionality, you need a KLIFS download folder KLIFS_download with the following structure (files downloaded from KLIFS):

└── KLIFS_download
    ├── KLIFS_export.csv           # Metadata file
    ├── overview.csv               # Metadata file
    └── HUMAN                      # Species name
        ├── AAK1                   # Kinase name
        │   ├── 4wsq_altA_chainA   # PDB ID, alternate model ID, chain ID
        │   │   ├── complex.mol2
        │   │   ├── ligand.mol2
        │   │   ├── protein.mol2
        │   │   ├── pocket.mol2
        │   │   └── water.mol2
        │   └── ...
        └── ...

Example for opencadd’s API to access local data:

from opencadd.databases.klifs import setup_local

# Set up local session
session = setup_local("../../opencadd/tests/databases/data/KLIFS_download")

# Get all kinases that are available locally
session.kinases.all_kinases()

# Get kinases by kinase name
session.kinases.by_kinase_name(["EGFR", "BRAF"])

How is opencadd.databases.klifs structured?

The module’s structure looks like this, using the same API for both modules local and remote whenever possible:

opencadd/
    └── databases/
        └── klifs/
            ├── api.py         # Defines the main API for local and remote sessions.
            ├── session.py     # Defines a KLIFS session.
            ├── core.py        # Defines the parent classes used in the local and remote modules.
            ├── local.py       # Defines the API for local queries.
            ├── remote.py      # Defines the API for remote queries.
            ├── schema.py      # Defines the schema for class method return values.
            ├── fields.py      # Defines the different KLIFS data fields and their names/dtypes in ``opencadd``.
            ├── utils.py       # Defines utility functions.
            └── exceptions.py  # Defines exceptions.

This structure mirrors the KLIFS OpenAPI structure in the following way to access different kinds of information both remotely and locally: