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

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 vaccines). 71 out of the 882 newly added EMA drugs are only authorised by EMA, rather than from other regulatory bodies e.g.

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

Accessing SureChEMBL data in bulk

It is the peak of the summer (at least in this hemisphere) and many of our readers/users will be on holiday, perhaps on an island enjoying the sea. Luckily, for the rest of us there is still the 'sea' of SureChEMBL data that awaits to be enjoyed and explored for hidden 'treasures' (let me know if I pushed this analogy too far). See here and  here for a reminder of SureChEMBL is and what it does.  This wealth of (big) data can be accessed via the SureChEMBL interface , where users can submit quite sophisticated and granular queries by combining: i) Lucene fields against full-text and bibliographic metadata and ii) advanced structure query features against the annotated compound corpus. Examples of such queries will be the topic of a future post. Once the search results are back, users can browse through and export the chemistry from the patent(s) of interest. In addition to this functionality, we've been receiving user requests for  local (behind the

New Drug Approvals - Pt. XVII - Telavancin (Vibativ)

The latest new drug approval, on 11th September 2009 was Telavancin - which was approved for the treatment of adults with complicated skin and skin structure infections (cSSSI) caused by susceptible Gram-positive bacteria , including Staphylococcus aureus , both methicillin-resistant (MRSA) and methicillin-susceptible (MSSA) strains. Telavancin is also active against Streptococcus pyogenes , Streptococcus agalactiae , Streptococcus anginosus group (includes S. anginosus, S. intermedius and S. constellatus ) and Enterococcus faecalis (vancomycin susceptible isolates only). Telavancin is a semisynthetic derivative of Vancomycin. Vancomycin itself is a natural product drug, isolated originally from soil samples in Borneo, and is produced by controlled fermentation of Amycolatopsis orientalis - a member of the Actinobacteria . Telavancin has a dual mechanism of action, firstly it inhibits bacterial cell wall synthesis by interfering with the polymerization and cross-linking of peptid

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