Fix chembl_query() for the compound structural alerts resource#446
Merged
stitam merged 4 commits intoropensci:masterfrom Nov 3, 2025
Merged
Fix chembl_query() for the compound structural alerts resource#446stitam merged 4 commits intoropensci:masterfrom
stitam merged 4 commits intoropensci:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #443.
This PR fixes access to the ChEMBL compund structural alerts resource. I am unsure whether it was the implementation that was wrong or the webservice has changed. In the previous implementation the required input for these alerts was a compound structural alert ID (so the ID of the alert) but it doesn't work. Instead, the webservice requires a compound ChEMBL ID. This PR fixes this. Also the resource uses an URL that is different from most ChEMBL resource URLs. This PR updates the resource URL as well.
Note, when we query ChEMBL, most resources return a json which is parsed as a nested list. In most cases this can be simplified, e.g. when list elements are columns of a data frame, we can replace them with a data frame. We do these simplifications automatically, but I realised for the structural alerts resource the simplification strategy is not trivial. Because of this I decided to add a new argument
tidywhich is TRUE by default and governs whether we should attempt to simplify the output or just return the nested list. I hope this does not add to much complexity and will allow us to experiment with better tidying strategies later.PR task list:
devtools::document()