Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rachmaninoffpk
Copy link
Collaborator

This closes #69 for Chemical, Bioactivity, and Hazard endpoints. PR 49 closes #69 for Exposure endpoints.

@madison-feshuk
Copy link
Collaborator

madison-feshuk commented Sep 26, 2025

@carolinering and I are both having issues with the following functions:

bpa_info <- get_chem_info(DTXSID = 'DTXSID7020182')

returns NULL

biosolids_info <- get_chem_info_batch(DTXSID = biosolids2021$dtxsid)

Warning message:
In get_chem_info_batch(DTXSID = biosolids2021$dtxsid) : Setting type to ''!

bpa_hazard <- get_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')

returns NULL

bpa_hhazard <- get_human_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')

returns NULL

@carolinering
Copy link
Collaborator

Possible reason for the failure of get_chem_info(): It looks like the schema has changed for chemical properties (which are fetched by get_chem_info()) , based on https://comptox.epa.gov/ctx-api/docs/chemical.html. Rather than having one API endpoint /property/search/by-dtxsid with optional different projections (experimental or predicted), it looks like there are now multiple different endpoints:

  • /chemical/property/summary/search/by-dtxsid/ -- for overall summaries (e.g. median/mean of experimental and predicted)
  • /chemical/property/predicted/search/by-dtxsid/ -- for predicted properties only
  • /chemical/property/experimental/search/by-dtxsid/ -- for experimental properties only

We will have to write new functions for each of these, and rewrite get_chem_info() for backwards compatibility -- if type = '', then get_chem_info() will have to pull both predicted and experimental properties.

(I suggest that the new functions be called something like get_chem_props_summary(), get_chem_props_pred(), and get_chem_props_exp() -- something that explicitly refers to "properties." I always get confused about the difference between get_chem_info() and get_chem_details(), because "info" is so non-specific.)

@carolinering
Copy link
Collaborator

The failure of get_chem_info_batch() is probably due to a similar problem. According to https://comptox.epa.gov/ctx-api/docs/chemical.html, we now have /chemical/property/predicted/search/by-dtxsid/ and /chemical/property/experimental/search/by-dtxsid/ as separate API endpoints for predicted and experimental properties, rather than having just one API endpoint with different projections.

@rachmaninoffpk
Copy link
Collaborator Author

These functions indeed have been affected by changes in the schema. We could deprecate the current affected functions and write functions for the new endpoints, with more descriptive names.

@rachmaninoffpk
Copy link
Collaborator Author

rachmaninoffpk commented Sep 30, 2025

I have updated the chemical endpoint functions (get_chem_info() and get_chem_info_batch()) that were affected and noted above. I have also deprecated the hazard endpoint functions that were affected (get_hazard_by_dtxsid(), get_human_hazard_by_dtxsid(), get_ecotox_hazard_by_dtxsid() and batch versions) and could not be pieced together using new endpoints.

@madison-feshuk
Copy link
Collaborator

The failure of get_chem_info_batch() is probably due to a similar problem. According to https://comptox.epa.gov/ctx-api/docs/chemical.html, we now have /chemical/property/predicted/search/by-dtxsid/ and /chemical/property/experimental/search/by-dtxsid/ as separate API endpoints for predicted and experimental properties, rather than having just one API endpoint with different projections.

Getting an error that the props functions do not exist for some reason:
bpa_props_pred <- get_chem_props_pred(DTXSID = 'DTXSID7020182')
Error in get_chem_props_pred(DTXSID = "DTXSID7020182") :
could not find function "get_chem_props_pred"
bpa_props_exp <- get_chem_props_exp(DTXSID = 'DTXSID7020182')
Error in get_chem_props_exp(DTXSID = "DTXSID7020182") :
could not find function "get_chem_props_exp"

@rachmaninoffpk
Copy link
Collaborator Author

Added function documentation, including export calls, so those new functions should now work as expected when called.

Copy link
Collaborator

@madison-feshuk madison-feshuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! All tested functions now work on the new server! New chem prop functions work as well.

@rachmaninoffpk rachmaninoffpk merged commit 8cb74f5 into dev Oct 2, 2025
1 check passed
This was referenced Oct 8, 2025
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.

Change API host from cloud.gov to new local host throughout ctxR

4 participants