Skip to main content

This Python InChI Key resolver will blow your mind



This scientific clickbait title introduces our promised blog post about the integration of UniChem into our ChEMBL python client. UniChem is a very important resource, as it contains information about 134 million (and counting) unique compound structures and cross references between various chemistry resources. Since UniChem is developed in-house and provides its own web services, we thought it would make sense to integrate it with our python client library. Before we present a systematic translation between raw HTTP calls described in the UniChem API documentation and client calls, let us provide some preliminary information:

In order to install the client, you should use pip:

pip install -U chembl_webresource_client

Once you have it installed, you can import the unichem module:

from chembl_webresource_client.unichem import unichem_client as unichem

OK, so how to resolve an InChI Key to InChI string? It's very simple:



Of course in order to resolve InChI Key to InChI, the client connects to the UniChem database via REST, retrieves the results and gives them to you. This is done in a very efficient way and abstracts away all network-related issues, such as setting the HTTP session, handling retries, caching results etc. From the user point of view, it looks like a standard function call, that is executed locally but in fact working internet connection is required to successfully fetch results (unless they are already cached). We've just heard that there is another InChi resolver written entirely in CSS3, click here to find out.

OK, we admit that resolving InChI key to InChI may not be the most important UniChem use case so we invite you to take a look at the Jupyter notebook providing examples of using all available methods:

Comments

Popular posts from this blog

ChEMBL 34 is out!

We are delighted to announce the release of ChEMBL 34, which includes a full update to drug and clinical candidate drug data. This version of the database, prepared on 28/03/2024 contains:         2,431,025 compounds (of which 2,409,270 have mol files)         3,106,257 compound records (non-unique compounds)         20,772,701 activities         1,644,390 assays         15,598 targets         89,892 documents Data can be downloaded from the ChEMBL FTP site:  https://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/releases/chembl_34/ Please see ChEMBL_34 release notes for full details of all changes in this release:  https://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/releases/chembl_34/chembl_34_release_notes.txt New Data Sources European Medicines Agency (src_id = 66): European Medicines Agency's data correspond to EMA drugs prior to 20 January 2023 (excluding ...

SureChEMBL gets a facelift

    Dear SureChEMBL users, Over the past year, we’ve introduced several updates to the SureChEMBL platform, focusing on improving functionality while maintaining a clean and intuitive design. Even small changes can have a big impact on your experience, and our goal remains the same: to provide high-quality patent annotation with a simple, effective way to find the data you need. What’s Changed? After careful consideration, we’ve redesigned the landing page to make your navigation smoother and more intuitive. From top to bottom: - Announcements Section: Stay up to date with the latest news and updates directly from this blog. Never miss any update! - Enhanced Search Bar: The main search bar is still your go-to for text searches, still with three pre-filter radio buttons to quickly narrow your results without hassle. - Improved Query Assistant: Our query assistant has been redesigned and upgraded to help you craft more precise queries. It now includes five operator options: E...

Improvements in SureChEMBL's chemistry search and adoption of RDKit

    Dear SureChEMBL users, If you frequently rely on our "chemistry search" feature, today brings great news! We’ve recently implemented a major update that makes your search experience faster than ever. What's New? Last week, we upgraded our structure search engine by aligning it with the core code base used in ChEMBL . This update allows SureChEMBL to leverage our FPSim2 Python package , returning results in approximately one second. The similarity search relies on 256-bit RDKit -calculated ECFP4 fingerprints, and a single instance requires approximately 1 GB of RAM to run. SureChEMBL’s FPSim2 file is not currently available for download, but we are considering generating it periodicaly and have created it once for you to try in Google Colab ! For substructure searches, we now also use an RDKit -based solution via SubstructLibrary , which returns results several times faster than our previous implementation. Additionally, structure search results are now sorted by...

ChEMBL webinar @ School of Chemoinformatics in Latin America

Recently, the ChEMBL team participated in the " School of Chemoinformatics in Latin America " which was kindly organized by José Medina-Franco and Karina Martinez-Mayorga (both at the National Autonomous University of Mexico). The event was very well attended with 1,181 registrants from 79 different countries. 57% of the participants attended from Latin America, 23% from Asia, and around 8% from Africa and Europe, respectively. 52% of the participants were students (undergraduate and graduate students). Distribution by country Distribution by role Participants could learn a bou t the ChEMBL database and UniChem. We covered different topics to answer these questions: • What is ChEMBL and how is it structured ? • Which data does ChEMBL contain ? • How is data extracted from scientic articles ? • How is the data in ChEMBL curated ? • How is drug ...

Here's a nice Christmas gift - ChEMBL 35 is out!

Use your well-deserved Christmas holidays to spend time with your loved ones and explore the new release of ChEMBL 35!            This fresh release comes with a wealth of new data sets and some new data sources as well. Examples include a total of 14 datasets deposited by by the ASAP ( AI-driven Structure-enabled Antiviral Platform) project, a new NTD data se t by Aberystwyth University on anti-schistosome activity, nine new chemical probe data sets, and seven new data sets for the Chemogenomic library of the EUbOPEN project. We also inlcuded a few new fields that do impr ove the provenance and FAIRness of the data we host in ChEMBL:  1) A CONTACT field has been added to the DOCs table which should contain a contact profile of someone willing to be contacted about details of the dataset (ideally an ORCID ID; up to 3 contacts can be provided). 2) In an effort to provide more detailed information about the source of a deposited dat...