Queries the PubChem SDQ (Structured Data Query) agent to retrieve the full
biological test results table for a compound. Uses the download query
mode to return all available columns for each record. The number and names
of columns vary by compound depending on available data (e.g. baid, aid,
sid, cid, activityid, aidtypeid, aidname, targetname, cmpdname, acvalue,
geneid, etc.).
pc_sdq_bioactivity(
identifier = NULL,
namespace = "cid",
collection = "bioactivity",
limit = 10000000L,
order = "activity,asc",
rate_limit = TRUE,
cache = FALSE,
cache_dir = NULL,
cache_ttl = NULL,
force_refresh = FALSE,
timeout = NULL,
retries = NULL,
pause_base = NULL,
pause_cap = NULL,
user_agent = NULL,
offline = NULL,
error_mode = c("stop", "result")
)A tibble of class PubChemTable containing the full
bioactivity results.
A single compound identifier (CID, name, or InChIKey
depending on namespace).
Character. The namespace for identifier. Default
"cid". If not "cid", the identifier is first resolved to a
CID via pc_request.
Character. SDQ collection to query. Default
"bioactivity".
Integer. Maximum number of rows to return. Default
10000000L.
Character. Column and direction for sorting results. Default
"activity,asc".
Logical or numeric. If TRUE (default), applies
the global rate limit from pc_config. If numeric, uses that
value as requests per second.
Logical. If TRUE, cache results to disk. Default
FALSE.
Character. Directory for disk cache. Defaults to the value
from pc_config.
Numeric. Cache time-to-live in seconds. Defaults to the
value from pc_config.
Logical. If TRUE, bypass any cached result.
Default FALSE.
Timeout in seconds for SDQ HTTP calls. Defaults to
pc_config()$timeout.
Retry attempts for SDQ HTTP calls. Defaults to
pc_config()$retries.
Base retry pause in seconds. Defaults to
pc_config()$pause_base.
Maximum retry pause in seconds. Defaults to
pc_config()$pause_cap.
User-agent string. Defaults to pc_config()$user_agent.
Logical. If TRUE, use cache-only mode and never hit
the network.
Error behavior. "stop" (default) throws on failure.
"result" returns a typed PubChemResult failure object.
When namespace != "cid", the identifier is first resolved to CID via
pc_request before querying SDQ. Returned columns depend on
source availability for the requested compound.
names(formals(pc_sdq_bioactivity))
if (FALSE) {
# Retrieve bioactivity data for aspirin (CID 2244)
bio <- pc_sdq_bioactivity(2244)
head(bio)
}
Run the code above in your browser using DataLab