Skip to main content

ChEMBL release 23, technical aspects.

ChEMBL release 23, technical aspects.


MV5BNDkwNzQ3Nzk4Nl5BMl5BanBnXkFtZTYwMjM0OTU5._V1_UX182_CR0,0,182,268_AL_.jpg

In this blog post, we would like to highlight some important technical improvements we've deployed as a part of the ChEMBL 23 release. You may find them useful if you work with ChEMBL data using FTP downloads and API.

1. FPS format support.


Many users download our SDF file containing all ChEMBL structures in order to compute fingerprints as an immediate next step. We decided to help them and publish precomputed fingerprints in a FPS text fingerprint format. The FPS format was developed by Andrew Dalke to "define and promote common file formats for storing and exchanging cheminformatics fingerprint data sets". It is used by chemfp, RDKit, OpenBabel and CACTVS and we believe it deserves promotion. The computed fingerprints are 2048 bit radius 2 morgan FPs, which we think is the most popular and generic type but please let us know in comments if other type can serve better. We are fully aware that fingerprint type can heavily depend on the specific application but it can be helpful for educational purposes and prototyping.

2. SQLite dump improvements.


As of release 21 we publish a SQLite dump which is an embedded file-based database. This proved to be very useful but as Andrew Dalke noticed on his blog, this dump wasn't optimised. We decided to follow Andrew's advice and pre-analyze tables during dump creation. We hope this will save you a few hours of computing. This is also a first ChEMBL release built with the support of our new Luigi-based pipelines. All the FTP files, including the schema image, SQL dumps and RDF data has been generated automatically using our python workflows. We are hoping to automate more and more parts of the release process, which should result in more frequent data releases and increased reproducibility in the long run.

3. API software updates


ChEMBL API is an open source project. This means that combining it with SQL dumps we provide, everyone can use it to create their own API instance. So far the biggest obstacle with integrating ChEMBL API software with other libraries was the fact, that the API was built on top of very old dependencies. For example, we were using Django 1.5, which was released about 5 years ago. We decided to upgrade the software making it compatible with the latest versions of most critical dependencies. After this change, the ChEMBL API software stack is now compatible with Django 1.11(.2) (which is the LTS edition), haystack 2.6.0, tastypie 0.13.3 and others. As a part of the upgrade process we also switched from virtualenv to conda as a default deployment environment which allowed us to easily install latest RDKit (2017.03.2 at the time of writing) and upgrade the Python interpreter itself (2.7.13). Using conda should make it easier to keep up with a future software updates as well, so from now on our software stack should always be using the latest stable dependencies.

All those changes should have a positive impact on the performance (more about that in the next paragraph), increase the security as well as compatibility with modern software stacks so it should be easier to integrate our software with your existing applications. Also, since all the dependencies are Python3-ready we are much closer to making a switch to Python 3.x. So far we migrated our API client library, which is compatible with both Python 2 and 3.

4. API performance improvements


The main reason to upgrade our software stack was improving the performance of our API. We decided to use Django Prefetch object (introduced in Django 1.7) to fine-tune SQL queries containing joins. We carefully analyzed all SQL queries generated by Django ORM when using the API. Introducing miniconda, which comes with precompiled binaries for python interpreter and libraries like numpy also had a positive impact on the performance, especially molecule images generation. We also added a full text search index on Assay description so now you can perform sophisticated full text queries. For example, searching for Activities, that have related assays with description containing 'TG-GATES', would look like this:


5. Extending Solr-based search


The above query can be rewritten to use Solr:


This query should be much faster than the one from the previous paragraph. We extended Solr indexes so now they cover 6 ChEMBL entities:


In total we have now indexed 17793020 solr documents. Some more example queries are:

A much more sophisticated query would be one that involves Solr-based search combined with DB-based filtering. For example, getting all assays that match 'inhibitor' in description and have assay type equal to 'A':


Such a "federated" query is quite heavy but we managed to optimise this use case. Still, please bear in mind that chaining search with too many filters may cause a timeout if the query is extremely complex.

6. Faster substructure search.


Our API provides the functionality to perform molecule substructure and similarity search. We noticed, that substructure search with the query being a small compound like benzene can lead to timeouts. We decided to enumerate all chemically important small structures and precache the results, which should improve substructure search performance. Please note, that this will have no impact on the speed of substructure search on our main web interface. This is because the interface is not using the API at the moment. We are developing a new API-based interface which should address this problem.

6. New API endpoints


Following new endpoints have been added to the API:

  • compound_record - records an occurrence of a molecule in a document
  • drug - provides information about approved drugs
  • organism - simple organism classification
  • target_prediction - target prediction results for clinical compounds, currently used on chembl user interface

7. Better API documentation


We updated the main API web page to reflect recent changes and we added a section with examples. GitHub repository has a new readme file as well and our PyPi packages point to the GitHub repo.

We also recently published a review paper, titled "Using ChEMBL web services for building applications and data processing workflows relevant to drug discovery". The document should be open and deposited into PubMedCentral (https://www.ncbi.nlm.nih.gov/pubmed/28602100) after six months.

8. Training


Please don't forget that we are organising a webinar on the 12th July about the API. More details will be announced soon.

9. Future plans


Our immediate future plans regarding the API are:
  • providing a Swagger-based documentation that can be used to generate a client code in any language
  • developing a better KNIME node
  • publishing a collection of reusable web components that consume the API





Comments

Popular posts from this blog

New SureChEMBL announcement

(Generated with DALL-E 3 ∙ 30 October 2023 at 1:48 pm) We have some very exciting news to report: the new SureChEMBL is now available! Hooray! What is SureChEMBL, you may ask. Good question! In our portfolio of chemical biology services, alongside our established database of bioactivity data for drug-like molecules ChEMBL , our dictionary of annotated small molecule entities ChEBI , and our compound cross-referencing system UniChem , we also deliver a database of annotated patents! Almost 10 years ago , EMBL-EBI acquired the SureChem system of chemically annotated patents and made this freely accessible in the public domain as SureChEMBL. Since then, our team has continued to maintain and deliver SureChEMBL. However, this has become increasingly challenging due to the complexities of the underlying codebase. We were awarded a Wellcome Trust grant in 2021 to completely overhaul SureChEMBL, with a new UI, backend infrastructure, and new f

A python client for accessing ChEMBL web services

Motivation The CheMBL Web Services provide simple reliable programmatic access to the data stored in ChEMBL database. RESTful API approaches are quite easy to master in most languages but still require writing a few lines of code. Additionally, it can be a challenging task to write a nontrivial application using REST without any examples. These factors were the motivation for us to write a small client library for accessing web services from Python. Why Python? We choose this language because Python has become extremely popular (and still growing in use) in scientific applications; there are several Open Source chemical toolkits available in this language, and so the wealth of ChEMBL resources and functionality of those toolkits can be easily combined. Moreover, Python is a very web-friendly language and we wanted to show how easy complex resource acquisition can be expressed in Python. Reinventing the wheel? There are already some libraries providing access to ChEMBL d

Multi-task neural network on ChEMBL with PyTorch 1.0 and RDKit

  Update: KNIME protocol with the model available thanks to Greg Landrum. Update: New code to train the model and ONNX exported trained models available in github . The use and application of multi-task neural networks is growing rapidly in cheminformatics and drug discovery. Examples can be found in the following publications: - Deep Learning as an Opportunity in VirtualScreening - Massively Multitask Networks for Drug Discovery - Beyond the hype: deep neural networks outperform established methods using a ChEMBL bioactivity benchmark set But what is a multi-task neural network? In short, it's a kind of neural network architecture that can optimise multiple classification/regression problems at the same time while taking advantage of their shared description. This blogpost gives a great overview of their architecture. All networks in references above implement the hard parameter sharing approach. So, having a set of activities relating targets and molecules we can tra

LSH-based similarity search in MongoDB is faster than postgres cartridge.

TL;DR: In his excellent blog post , Matt Swain described the implementation of compound similarity searches in MongoDB . Unfortunately, Matt's approach had suboptimal ( polynomial ) time complexity with respect to decreasing similarity thresholds, which renders unsuitable for production environments. In this article, we improve on the method by enhancing it with Locality Sensitive Hashing algorithm, which significantly reduces query time and outperforms RDKit PostgreSQL cartridge . myChEMBL 21 - NoSQL edition    Given that NoSQL technologies applied to computational chemistry and cheminformatics are gaining traction and popularity, we decided to include a taster in future myChEMBL releases. Two especially appealing technologies are Neo4j and MongoDB . The former is a graph database and the latter is a BSON document storage. We would like to provide IPython notebook -based tutorials explaining how to use this software to deal with common cheminformatics p

ChEMBL 26 Released

We are pleased to announce the release of ChEMBL_26 This version of the database, prepared on 10/01/2020 contains: 2,425,876 compound records 1,950,765 compounds (of which 1,940,733 have mol files) 15,996,368 activities 1,221,311 assays 13,377 targets 76,076 documents You can query the ChEMBL 26 data online via the ChEMBL Interface and you can also download the data from the ChEMBL FTP site . Please see ChEMBL_26 release notes for full details of all changes in this release. Changes since the last release: * Deposited Data Sets: CO-ADD antimicrobial screening data: Two new data sets have been included from the Community for Open Access Drug Discovery (CO-ADD). These data sets are screening of the NIH NCI Natural Product Set III in the CO-ADD assays (src_id = 40, Document ChEMBL_ID = CHEMBL4296183, DOI = 10.6019/CHEMBL4296183) and screening of the NIH NCI Diversity Set V in the CO-ADD assays (src_id = 40, Document ChEMBL_ID = CHEMBL4296182, DOI = 10.601