Skip to content

Fix chembl_query() for the compound structural alerts resource#446

Merged
stitam merged 4 commits intoropensci:masterfrom
stitam:stralerts
Nov 3, 2025
Merged

Fix chembl_query() for the compound structural alerts resource#446
stitam merged 4 commits intoropensci:masterfrom
stitam:stralerts

Conversation

@stitam
Copy link
Contributor

@stitam stitam commented Oct 31, 2025

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 tidy which 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:

  • Update NEWS
  • Add tests (if appropriate)
  • Update documentation with devtools::document()
  • Check package passed

@stitam stitam merged commit 692909d into ropensci:master Nov 3, 2025
7 checks passed
@stitam stitam deleted the stralerts branch November 3, 2025 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant