Skip to content

Expand ChEMBL resources and standardize webservice output - #455

Merged
stitam merged 47 commits into
ropensci:masterfrom
stitam:resources
May 4, 2026
Merged

Expand ChEMBL resources and standardize webservice output#455
stitam merged 47 commits into
ropensci:masterfrom
stitam:resources

Conversation

@stitam

@stitam stitam commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Related to issue #449.

  • Implemented several new ChEMBL resources: assay, drug_indication, drug_warning, go_slim.
  • Streamlined internal handling of resource schemas and their enforcement.
  • When using chembl_query() with mode = "ws" (web service), webchem retrieves and caches the schema for the requested ChEMBL resource during the session. The schema is then used to standardize the output. For example, if a field is defined as a "string", the returned value is converted to a character vector.
  • Schema enforcement also improves handling of missing values. The web service may return NULL or empty lists for missing fields, which complicates downstream processing. Using the schema, these are converted to schema-appropriate NA values. This behavior is now hard-coded and cannot be disabled.
  • Another benefit is improved comparison between online and offline results. We now use all.equal() to check whether web service and offline responses match.
  • In some cases, the web service response is slightly inconsistent with the schema (e.g., fields missing from the schema). When this occurs, chembl_query() issues warnings and leaves those fields unchanged.

Note, I disabled some CTS tests. It seems to be a webservice issue. I contacted the maintainers.

PR task list:

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

@stitam stitam added this to the 25-ISC-1-02-M1 milestone Apr 27, 2026
@stitam

stitam commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Some checks for pubchem (not chembl) kept failing on mac. It seemed this was related to timeout on queries, so I did some refactoring to make the requests more robust. These did not fix the issue at the time. However, the tests pass now, so I'll just merge. We may have to record more tests later.

@stitam
stitam merged commit 0ac6534 into ropensci:master May 4, 2026
9 checks passed
@stitam
stitam deleted the resources branch May 4, 2026 14:14
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