ChEMBL Web Service Update 3: Image Rendering Changes



If you are a follower of this blog you will have seen some earlier posts (here and here) providing details on changes we are making to our Web Services. I recommend reviewing the previous posts, but in summary we have setup a temporary base URL to allow existing ChEMBL Web Service users to test the new ChEMBL API powered Web Services. The new temporary base URL is:

https://www.ebi.ac.uk/chemblws2

As well as providing users with all existing functionality we have also added a couple of extra features, one of which is improved molecule rendering options. The current live Web Services provides the following REST call to allow you to get a molecule image: 


  

You are able to provide a dimension argument (pixels) to change the size of the image:


The image quality has deteriorated, this is because the image returned is simply re-sized version of the first image. The new ChEMBL API powered Web Services addresses this issue by dynamically generating the images, using either the RDKit or the Indgio chemistry toolkits (defaults to RDKit). So, to get an image using the new services, you just need to add '2' to the base URL:


When using the dimensions argument with the new Web Services you now get the following improved smaller image:

The coordinates used to generate the image are based on those found in the ChEMBL192 molfile. All current ChEMBL images are produced using Pipeline Pilot, which is currently setup to ignore the molfile coordinates and layout molecule how it sees best. This explains why the layout of the first two images are different to the second two. We can get the new Web Services to ignore coordinates and get the chemical toolkit to layout molecule coordinates how it sees best using the ignoreCoords=1 argument:

If you would prefer to use Indigo to generate your ChEMBL molecule images you can use the engine argument:

Finally, it is also possible to use any combination of the 3 arguments mentioned above:



In summary, the new Web Service base URL extends the the current image generating functionality, by improving the dimensions argument and introducing the ignoreCoords and engine arguments. More details in table below:

Argument Name Argument Description Argument Options Default
dimensions Size of image in pixels 1-500 500
ignoreCoords Choose to use or ignore coordinates in ChEMBL molfiles 1 or 0 0 (Use ChEMBL molfile coordinates)
engine Chemical toolkit used to generate image RDKit or indigo RDKit

We hope you find these image  rendering changes useful and if you have any questions please let us know via mail to "chembl-help at ebi.ac.uk" if you have any questions.

The ChEMBL Team