Title: | Utilities for Interacting with the 'CTX' APIs |
---|---|
Description: | Access chemical, hazard, bioactivity, and exposure data from the Computational Toxicology and Exposure ('CTX') APIs <https://api-ccte.epa.gov/docs/>. 'ccdR' was developed to streamline the process of accessing the information available through the 'CTX' APIs without requiring prior knowledge of how to use APIs. Most data is also available on the CompTox Chemical Dashboard ('CCD') <https://comptox.epa.gov/dashboard/> and other resources found at the EPA Computational Toxicology and Exposure Online Resources <https://www.epa.gov/comptox-tools>. |
Authors: | Paul Kruse [aut, cre] , Caroline Ring [aut] , Madison Feshuk [ctb] , Carter Thunes [ctb], Jason Brown [ctb] |
Maintainer: | Paul Kruse <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.1.0 |
Built: | 2024-11-06 05:14:42 UTC |
Source: | https://github.com/usepa/ccdr |
A section of url used in Bioactivity API Endpoints
bioactivity_api_server
bioactivity_api_server
An object of class character
of length 1.
ccdr stores options as a named list in R's global options, i.e.
getOption('ccdr')
. It currently stores two such options, one for CCTE
credentialing and one to suppress private API information in the URLs printed
to the screen when web queries are placed. For both of those, see
register_ccdr()
.
set_ccdr_option(...) has_ccdr_options() has_ccdr_option(option)
set_ccdr_option(...) has_ccdr_options() has_ccdr_option(option)
... |
a named listing of options to set |
option |
a specific option to query, e.g. |
set_ccdr_option()
does not have a return value but has the side effect
of setting options used by other functions.
has_ccdr_option()
returns a Boolean.
has_ccdr_options()
returns a Boolean.
# Set ccdr options set_ccdr_option('display_api_key' = FALSE) # Check if there are options registered to 'ccdr' has_ccdr_options() # Check if a specific option is registered for 'ccdr' has_ccdr_option('display_api_key')
# Set ccdr options set_ccdr_option('display_api_key' = FALSE) # Check if there are options registered to 'ccdr' has_ccdr_options() # Check if a specific option is registered for 'ccdr' has_ccdr_option('display_api_key')
A section of url used in Chemical API Endpoints
chemical_api_server
chemical_api_server
An object of class character
of length 1.
Chemical contains
chemical_contains( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE, top = NULL )
chemical_contains( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE, top = NULL )
word |
A character string of a chemical name or portion of a chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
top |
The number of results to return if there are multiple results available |
A data.frame of chemicals and related values matching the query parameters
# Pull chemicals that contain substring substring_chemicals <- chemical_contains(word = 'TXSID702018')
# Pull chemicals that contain substring substring_chemicals <- chemical_contains(word = 'TXSID702018')
Chemical contains batch search
chemical_contains_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = verbose, top = NULL )
chemical_contains_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = verbose, top = NULL )
word_list |
A list of character strings of chemical names or portion of chemical names |
API_key |
User-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
top |
The number of results to return if there are multiple results available |
A named list of data.frames of chemicals and related values matching the query parameters
# Pull chemicals that contain substrings substring_chemicals <- chemical_contains_batch(word_list = c('TXDIS702018', 'DTXSID70201'))
# Pull chemicals that contain substrings substring_chemicals <- chemical_contains_batch(word_list = c('TXDIS702018', 'DTXSID70201'))
Chemical equal
chemical_equal( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
chemical_equal( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
word |
A character string of a chemical name or portion of a chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of chemicals and related values matching the query parameters
# Pull chemicals with matching DTXSID bpa_dtxsid <- chemical_equal(word = 'DTXSID7020182')
# Pull chemicals with matching DTXSID bpa_dtxsid <- chemical_equal(word = 'DTXSID7020182')
Chemical equal batch search
chemical_equal_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
chemical_equal_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
word_list |
A list of character strings of chemical names or portion of chemical names, DTXSIDs, CASRNs, InChIKeys. |
API_key |
User-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames of chemicals and related values matching the query parameters
# Pull chemicals that match input strings bpa <- chemical_equal_batch(word_list = c('DTXSID7020182', 'DTXCID30182'))
# Pull chemicals that match input strings bpa <- chemical_equal_batch(word_list = c('DTXSID7020182', 'DTXCID30182'))
Chemical starts with
chemical_starts_with( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE, top = NULL )
chemical_starts_with( word = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE, top = NULL )
word |
A character string of a chemical name or portion of a chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
top |
The number of results to return if there are multiple results available |
A data.frame of chemicals and related values matching the query parameters
# Pull chemicals that start with a fragment DTXSID dtxsid_fragment <- chemical_starts_with(word = 'DTXSID702018')
# Pull chemicals that start with a fragment DTXSID dtxsid_fragment <- chemical_starts_with(word = 'DTXSID702018')
Chemical starts with batch search
chemical_starts_with_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE, top = NULL )
chemical_starts_with_batch( word_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE, top = NULL )
word_list |
A list of character strings of chemical names or portion of chemical names |
API_key |
User-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
top |
The number of results to return if there are multiple results available |
A named list of data.frames of chemicals and related values matching the query parameters
# Pull chemicals that start with given substrings bpa_substrings <- chemical_starts_with_batch(word_list = c('DTXSID702018', 'DTXCID3018'))
# Pull chemicals that start with given substrings bpa_substrings <- chemical_starts_with_batch(word_list = c('DTXSID702018', 'DTXCID3018'))
Create chemical details data.table helper function
create_data.table_chemical_details(index = -1)
create_data.table_chemical_details(index = -1)
index |
Determine which format should be used. |
An empty data.table with columns matching the expected format of the get_chemical_details API call.
A section of url used in Exposure API Endpoints
exposure_api_server
exposure_api_server
An object of class character
of length 1.
Retrieve all assays
get_all_assays( API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
get_all_assays( API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing all the assays and associated information
# Retrieve all assays assays <- get_all_assays()
# Retrieve all assays assays <- get_all_assays()
Get all public chemical lists
get_all_public_chemical_lists( Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_all_public_chemical_lists( Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
Projection |
Optional parameter controlling return type. It takes values chemicallistall' and 'chemicallistname' with the former as the default value. |
API_key |
The user-specific api key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing information on all public chemical lists available from the CTX chemical api.
# Pull all chemical lists all_lists <- get_all_public_chemical_lists()
# Pull all chemical lists all_lists <- get_all_public_chemical_lists()
Retrieve annotations for AEID
get_annotation_by_aeid( AEID = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
get_annotation_by_aeid( AEID = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
AEID |
The assay endpoint identifier AEID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing the annotated assays corresponding to the input AEID parameter
# Retrieve annotation for an assay annotation <- get_annotation_by_aeid(AEID = 159)
# Retrieve annotation for an assay annotation <- get_annotation_by_aeid(AEID = 159)
Retrieve annotations for AEID batch
get_annotation_by_aeid_batch( AEID = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
get_annotation_by_aeid_batch( AEID = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
AEID |
A list of AEID identifiers |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing annotation information for the assays with AEID matching the input parameter.
# Get annotations for multiple aeids aeid_annotations <- get_annotation_by_aeid_batch(AEID = c(159, 160))
# Get annotations for multiple aeids aeid_annotations <- get_annotation_by_aeid_batch(AEID = c(159, 160))
Retrieve bioactivity data from DTXSID, AEID, SPID, or m4id
get_bioactivity_details( DTXSID = NULL, AEID = NULL, SPID = NULL, m4id = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
get_bioactivity_details( DTXSID = NULL, AEID = NULL, SPID = NULL, m4id = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
AEID |
The assay endpoint identifier AEID |
SPID |
The ChemSpider chemical input |
m4id |
The chemical identifier m4id |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing bioactivity information for the chemical or assay endpoint with identifier matching the input parameter.
# Pull BPA bioactivity details bpa <- get_bioactivity_details(DTXSID = 'DTXSID7020182') # Pull assay bioactivity details assay <- get_bioactivity_details(AEID = 159)
# Pull BPA bioactivity details bpa <- get_bioactivity_details(DTXSID = 'DTXSID7020182') # Pull assay bioactivity details assay <- get_bioactivity_details(AEID = 159)
Retrieve bioactivity data from DTXSID or AEID batch
get_bioactivity_details_batch( DTXSID = NULL, AEID = NULL, SPID = NULL, m4id = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
get_bioactivity_details_batch( DTXSID = NULL, AEID = NULL, SPID = NULL, m4id = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
AEID |
A list of assay endpoint identifiers AEIDs. |
SPID |
A list of ChemSpider chemical inputs |
m4id |
A list of chemical identifier m4ids |
API_key |
The user-specific API key. |
Server |
The root address for the API endpoint |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing bioactivity information for the chemicals with DTXSID or assays with AEID matching the input parameter.
# Pull bioactivity details for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_bioactivity <- get_bioactivity_details_batch(DTXSID = dtxsid) # Pull bioactivity details for multiple assays batch_bioactivity <- get_bioactivity_details_batch(AEID = c(159, 160))
# Pull bioactivity details for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_bioactivity <- get_bioactivity_details_batch(DTXSID = dtxsid) # Pull bioactivity details for multiple assays batch_bioactivity <- get_bioactivity_details_batch(AEID = c(159, 160))
Bioactivity API Endpoint status
get_bioactivity_endpoint_status()
get_bioactivity_endpoint_status()
Status of Bioactivity API Endpoints
status <- get_bioactivity_endpoint_status() print(status)
status <- get_bioactivity_endpoint_status() print(status)
Retrieve bioactivity summary for AEID
get_bioactivity_summary( AEID = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
get_bioactivity_summary( AEID = NULL, API_key = NULL, Server = bioactivity_api_server, verbose = FALSE )
AEID |
The assay endpoint indentifier AEID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing summary information corresponding to the input AEID
# Pull an assay bioactivity summary aeid_1386 <- get_bioactivity_summary(AEID = 1386)
# Pull an assay bioactivity summary aeid_1386 <- get_bioactivity_summary(AEID = 1386)
Retrieve bioactivity summary data from AEID batch
get_bioactivity_summary_batch( AEID = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
get_bioactivity_summary_batch( AEID = NULL, API_key = NULL, Server = NULL, rate_limit = 0L, verbose = FALSE )
AEID |
A list of AEID identifiers |
API_key |
The user-specific API key. |
Server |
The root address for the API endpoint |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing bioactivity summary information for the assays with AEID matching the input parameter.
# Get bioactivity summary for multiple aeids aeids <- get_bioactivity_summary_batch(AEID = c(159, 160))
# Get bioactivity summary for multiple aeids aeids <- get_bioactivity_summary_batch(AEID = c(159, 160))
Get cancer hazard
get_cancer_hazard( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_cancer_hazard( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of cancer hazard data related to the input DTXSID.
# Pull cancer hazard data for BPA bpa_cancer <- get_cancer_hazard(DTXSID = 'DTXSID7020182')
# Pull cancer hazard data for BPA bpa_cancer <- get_cancer_hazard(DTXSID = 'DTXSID7020182')
Get cancer hazard batch
get_cancer_hazard_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_cancer_hazard_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing cancer hazard and related data for each input DTXSID.
# Pull cancer hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_cancer_hazard <- get_cancer_hazard_batch(DTXSID = dtxsid)
# Pull cancer hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_cancer_hazard <- get_cancer_hazard_batch(DTXSID = dtxsid)
Get cancer hazard batch
get_cancer_hazard_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_cancer_hazard_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames, each containing cancer hazard and related data for each input DTXSID.
Retrieve chemical information
get_chem_info( DTXSID = NULL, type = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chem_info( DTXSID = NULL, type = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
type |
This specifies whether to only grab predicted or experimental results. If not specified, it will grab all details. The allowable input values are "predicted" or "experimental". |
API_key |
The user-specific API Key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing chemical information for the chemical with DTXSID matching the input parameter.
# Pull chemical information for BPA bpa <- get_chem_info(DTXSID = 'DTXSID7020182')
# Pull chemical information for BPA bpa <- get_chem_info(DTXSID = 'DTXSID7020182')
Retrieve chemical information in batch search
get_chem_info_batch( DTXSID = NULL, type = "", API_key = NULL, rate_limit = 0L, Server = chemical_api_server, verbose = FALSE )
get_chem_info_batch( DTXSID = NULL, type = "", API_key = NULL, rate_limit = 0L, Server = chemical_api_server, verbose = FALSE )
DTXSID |
A vector of chemical identifier DTXSIDs |
type |
A vector of type used in get_chem_info(). This specifies whether to only grab predicted or experimental results. If not specified, it will grab all details. The allowable input values are "", predicted", or "experimental". |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical information for the chemicals with DTXSID matching the input parameter.
# Pull chemical info for multiple chemicals chem_info <- get_chem_info_batch(DTXSID = c('DTXSID7020182', 'DTXSID2021315'))
# Pull chemical info for multiple chemicals chem_info <- get_chem_info_batch(DTXSID = c('DTXSID7020182', 'DTXSID2021315'))
Retrieve chemical information in batch search
get_chem_info_batch_old( DTXSID = NULL, type = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chem_info_batch_old( DTXSID = NULL, type = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A vector of chemical identifier DTXSIDs |
type |
A vector of type used in get_chem_info(). This specifies whether to only grab predicted or experimental results. If not specified, it will grab all details. The allowable input values are "", predicted", or "experimental". |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical information for the chemicals with DTXSID matching the input parameter.
Get chemicals by property and its value range
get_chemical_by_property_range( start = NULL, end = NULL, property = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_by_property_range( start = NULL, end = NULL, property = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
start |
A numeric value, the beginning of the range |
end |
A numeric value, the end of the range |
property |
A string, the property in question |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing chemical information for chemicals matching the search criteria.
# Pull chemicals with a given property in a set range density <- get_chemical_by_property_range(start = 1.311, end = 1.313, property = 'Density')
# Pull chemicals with a given property in a set range density <- get_chemical_by_property_range(start = 1.311, end = 1.313, property = 'Density')
Retrieve chemicals by property and value range in batch search
get_chemical_by_property_range_batch( start_list = NULL, end_list = NULL, property_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_by_property_range_batch( start_list = NULL, end_list = NULL, property_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
start_list |
Numeric values, the beginning of the range |
end_list |
Numeric values, the end of the range |
property_list |
Strings, the properties being queried |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical information for the chemicals matching the search criteria.
# Pull chemicals by property ranges prop_ranges <- get_chemical_by_property_range_batch(start_list = c(1.311, 211.99), end_list = c(1.313, 212.01), property_list = c('Density', 'Boiling Point'))
# Pull chemicals by property ranges prop_ranges <- get_chemical_by_property_range_batch(start_list = c(1.311, 211.99), end_list = c(1.313, 212.01), property_list = c('Density', 'Boiling Point'))
Retrieve chemical details from DTXSID of DTXCID
get_chemical_details( DTXSID = NULL, DTXCID = NULL, Projection = "chemicaldetailstandard", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_details( DTXSID = NULL, DTXCID = NULL, Projection = "chemicaldetailstandard", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
DTXCID |
The chemical identifier DTXCID |
Projection |
The format and chemical detail data returned. Allowed values are 'chemicaldetailall', 'chemicaldetailstandard', 'chemicalidentifier', 'chemicalstructure', 'ntatoolkit', 'ccdchemicaldetails'. If left empty or there is a mismatch, the default format will be 'chemicaldetailstandard'. |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical information for the chemical with DTXSID matching the input parameter.
# Pull chemical details for BPA bpa <- get_chemical_details(DTXSID = 'DTXSID7020182')
# Pull chemical details for BPA bpa <- get_chemical_details(DTXSID = 'DTXSID7020182')
Retrieve chemical details from DTXSID of DTXCID in batch search
get_chemical_details_batch( DTXSID = NULL, DTXCID = NULL, Projection = "chemicaldetailstandard", API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_details_batch( DTXSID = NULL, DTXCID = NULL, Projection = "chemicaldetailstandard", API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
DTXCID |
The chemical identifier DTXCID |
Projection |
The format and chemical detail data returned. Allowed values are 'chemicaldetailall', 'chemicaldetailstandard', chemicalidentifier', 'chemicalstructure', 'ntatoolkit', ccdchemicaldetails'. If left empty or there is a mismatch, the default format will be 'chemicaldetailstandard'. |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table (DTXSID) or a named list of data.tables (DTXCID) containing chemical information for the chemicals with DTXSID or DTXCID matching the input parameter.
# Pull chemical details for multiple chemicals by dtxsid dtxsids <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_details <- get_chemical_details_batch(DTXSID = dtxsid) # Pull chemical details for multiple chemicals by dtxcid dtxcids <- c('DTXCID30182', 'DTXCID001315') dtxcid_details <- get_chemical_details_batch(DTXCID = dtxcids)
# Pull chemical details for multiple chemicals by dtxsid dtxsids <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_details <- get_chemical_details_batch(DTXSID = dtxsid) # Pull chemical details for multiple chemicals by dtxcid dtxcids <- c('DTXCID30182', 'DTXCID001315') dtxcid_details <- get_chemical_details_batch(DTXCID = dtxcids)
Chemical API Endpoint status
get_chemical_endpoint_status()
get_chemical_endpoint_status()
Status of Chemical API Endpoints
status <- get_chemical_endpoint_status() print(status)
status <- get_chemical_endpoint_status() print(status)
Get image file by DTXSID or DTXCID
get_chemical_image( DTXSID = NULL, DTXCID = NULL, SMILES = NULL, format = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_image( DTXSID = NULL, DTXCID = NULL, SMILES = NULL, format = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
DTXCID |
Chemical identifier DTXCID |
SMILES |
Chemical identifier SMILES |
format |
The image type, either "png" or "svg". If left blank, will default to "png". |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A Large array of three dimensions representing an image. For
displaying this, one may use png::writePNG()
or
countcolors::plotArrayAsImage()
among many such functions.
# Pull chemical image for BPA by dtxsid bpa_image_matrix <- get_chemical_image(DTXSID = 'DTXSID7020182') if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(bpa_image_matrix) } # Pull chemical image for BPA by dtxcid bpa_image_matrix <- get_chemical_image(DTXCID = 'DTXCID30182') if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(bpa_image_matrix) }
# Pull chemical image for BPA by dtxsid bpa_image_matrix <- get_chemical_image(DTXSID = 'DTXSID7020182') if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(bpa_image_matrix) } # Pull chemical image for BPA by dtxcid bpa_image_matrix <- get_chemical_image(DTXCID = 'DTXCID30182') if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(bpa_image_matrix) }
Get image file by DTXSID or DTXCID batch
get_chemical_image_batch( DTXSID = NULL, DTXCID = NULL, SMILES = NULL, format = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_image_batch( DTXSID = NULL, DTXCID = NULL, SMILES = NULL, format = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
DTXCID |
A list of chemical identifier DTXCIDs. |
SMILES |
A list of chemical identifier SMILES. |
format |
The image type, either "png" or "svg". If left blank, will default to "png". |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of Large arrays of three dimensions representing an image. For
displaying an image, one may use png::writePNG()
or
countcolors::plotArrayAsImage()
among many such functions.
# Pull images for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') images <- get_chemical_image_batch(DTXSID = dtxsid) if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(images[[1]]) countcolors::plotArrayAsImage(images[[2]]) }
# Pull images for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') images <- get_chemical_image_batch(DTXSID = dtxsid) if (requireNamespace("countcolors", quietly = TRUE)){ countcolors::plotArrayAsImage(images[[1]]) countcolors::plotArrayAsImage(images[[2]]) }
Get chemical lists by type
get_chemical_lists_by_type( type = NULL, Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_lists_by_type( type = NULL, Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
type |
The type of list. This is a case sensitive parameter and returns lists only for values of "federal", "international", "state", and "other". |
Projection |
Optional parameter controlling return type. It takes values 'chemicallistall' and 'chemicallistname' with the former as the default value. |
API_key |
The user-specified API key. |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing information about lists that meet the search criteria.
# Pull chemical lists by type federal <- get_chemical_lists_by_type(type = 'Federal')
# Pull chemical lists by type federal <- get_chemical_lists_by_type(type = 'Federal')
Get chemical lists by type batch search
get_chemical_lists_by_type_batch( type_list = NULL, Projection = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_lists_by_type_batch( type_list = NULL, Projection = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
type_list |
A list of list types. This is a case sensitive parameter and returns lists only for values of "federal", "international", "state", and "other". |
Projection |
Optional parameter controlling return type. It takes values 'chemicallistall' and 'chemicallistname' with the former as the default value. |
API_key |
The user-specified API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing information about lists that meet the search criteria.
# Pull chemical lists by type federal_state <- get_chemical_lists_by_type_batch(type_list = c('Federal', 'State'))
# Pull chemical lists by type federal_state <- get_chemical_lists_by_type_batch(type_list = c('Federal', 'State'))
Get mol file by DTXSID or DTXCID
get_chemical_mol( DTXSID = NULL, DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_mol( DTXSID = NULL, DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
DTXCID |
Chemical identifier DTXCID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A character string giving a mol file representation
# Pull mol file for BPA by dtxsid bpa_mol <- get_chemical_mol(DTXSID = 'DTXSID7020182') # Pull mol file for BPA by dtxcid bpa_mol <- get_chemical_mol(DTXCID = 'DTXCID30182')
# Pull mol file for BPA by dtxsid bpa_mol <- get_chemical_mol(DTXSID = 'DTXSID7020182') # Pull mol file for BPA by dtxcid bpa_mol <- get_chemical_mol(DTXCID = 'DTXCID30182')
Get mol file by DTXSID or DTXCID batch
get_chemical_mol_batch( DTXSID = NULL, DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_mol_batch( DTXSID = NULL, DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of the chemical identifier DTXSIDs. |
DTXCID |
A list of the chemical identifier DTXCIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of character strings giving a mol file representations of the given input chemicals.
# Pull mol files for multiple chemicals by DTXSID dtxsid <- c('DTXSID7020182', 'DTXSID2021315') mol_files <- get_chemical_mol_batch(DTXSID = dtxsid) # Pull mol files for multiple chemicals by DTXCID dtxcid <- c('DTXCID30182', 'DTXCID001315') mol_files <- get_chemical_mol_batch(DTXCID = dtxcid)
# Pull mol files for multiple chemicals by DTXSID dtxsid <- c('DTXSID7020182', 'DTXSID2021315') mol_files <- get_chemical_mol_batch(DTXSID = dtxsid) # Pull mol files for multiple chemicals by DTXCID dtxcid <- c('DTXCID30182', 'DTXCID001315') mol_files <- get_chemical_mol_batch(DTXCID = dtxcid)
Get mrv file by DTXSID or DTXCID
get_chemical_mrv( DTXSID = NULL, DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_mrv( DTXSID = NULL, DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
DTXCID |
The chemical identifier DTXCID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
XML file format for representing a mrv file.
# Pull mrv file for BPA by dtxsid bpa_mrv <- get_chemical_mrv(DTXSID = 'DTXSID7020182') # Pull mrv file for BPA by dtxcid bpa_mrv <- getchemical_mrv(DTXCID = 'DTXCID30182')
# Pull mrv file for BPA by dtxsid bpa_mrv <- get_chemical_mrv(DTXSID = 'DTXSID7020182') # Pull mrv file for BPA by dtxcid bpa_mrv <- getchemical_mrv(DTXCID = 'DTXCID30182')
Ger mrv file by DTXSID or DTXCID batch
get_chemical_mrv_batch( DTXSID = NULL, DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_mrv_batch( DTXSID = NULL, DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of the chemical identifier DTXSIDs. |
DTXCID |
A list of the chemical identifier DTXCIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of XML file format for representing a mrv file for each chemicals.
# Pull mrv files for multiple chemicals by DTXSID dtxsid <- c('DTXSID7020182', 'DTXSID2021315') mrv_files <- get_chemical_mrv_batch(DTXSID = dtxsid) # Pull mrv files for multiple chemicals by DTXCID dtxcid <- c('DTXCID30182', 'DTXCID001315') mrv_files <- get_chemical_mrv_batch(DTXCID = dtxcid)
# Pull mrv files for multiple chemicals by DTXSID dtxsid <- c('DTXSID7020182', 'DTXSID2021315') mrv_files <- get_chemical_mrv_batch(DTXSID = dtxsid) # Pull mrv files for multiple chemicals by DTXCID dtxcid <- c('DTXCID30182', 'DTXCID001315') mrv_files <- get_chemical_mrv_batch(DTXCID = dtxcid)
Get chemical synonym
get_chemical_synonym( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemical_synonym( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of synonym information for the input DTXSID
# Pull synonyms for BPA bpa_synonym <- get_chemical_synonym(DTXSID = 'DTXSID7020182')
# Pull synonyms for BPA bpa_synonym <- get_chemical_synonym(DTXSID = 'DTXSID7020182')
Get chemical synonym batch
get_chemical_synonym_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemical_synonym_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
The number of seconds to wait between requests. |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of lists containing synonym information for each input DTXSID.
# Pull synonyms for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_synonyms <- get_chemical_synonym_batch(DTXSID = dtxsid)
# Pull synonyms for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_synonyms <- get_chemical_synonym_batch(DTXSID = dtxsid)
Get chemicals in a given chemical list
get_chemicals_in_list( list_name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_chemicals_in_list( list_name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
list_name |
The name of the list of chemicals |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of the chemical list
# Retrieve chemicals contained in chemical list 'CCL4' ccl4_chemicals <- get_chemicals_in_list(list_name = 'CCL4')
# Retrieve chemicals contained in chemical list 'CCL4' ccl4_chemicals <- get_chemicals_in_list(list_name = 'CCL4')
Get chemicals in a given chemical list batch
get_chemicals_in_list_batch( list_names = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_chemicals_in_list_batch( list_names = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
list_names |
A list of names of chemical lists. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames each containing chemicals in the corresponding chemical lists.
# Pull chemicals in lists for multiple lists chemicals_in_lists <- get_chemicals_in_list_batch(list_names = c('CCL4', 'NATADB'))
# Pull chemicals in lists for multiple lists chemicals_in_lists <- get_chemicals_in_list_batch(list_names = c('CCL4', 'NATADB'))
Get ecotox hazard data by DTXSID
get_ecotox_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_ecotox_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing chemical (ecotox) hazard data
# Pull ecotox hazard data for BPA bpa_ecotox <- get_ecotox_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
# Pull ecotox hazard data for BPA bpa_ecotox <- get_ecotox_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
Get ecotox hazard data by DTXSID batch
get_ecotox_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_ecotox_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical ecotox hazard data.
# Pull ecotox hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_ecotox_hazard <- get_ecotox_hazard_by_dtxsid_batch(DTXSID = dtxsid)
# Pull ecotox hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_ecotox_hazard <- get_ecotox_hazard_by_dtxsid_batch(DTXSID = dtxsid)
Get ecotox hazard data by DTXSID batch
get_ecotox_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_ecotox_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical ecotox hazard data.
Exposure API Endpoint status
get_exposure_endpoint_status()
get_exposure_endpoint_status()
Status of Exposure API Endpoints
status <- get_exposure_endpoint_status() print(status)
status <- get_exposure_endpoint_status() print(status)
Retrieve exposure related functional use data
get_exposure_functional_use( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_functional_use( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of functional use data.
# Pull functional use data for BPA bpa <- get_exposure_functional_use(DTXSID = 'DTXSID7020182')
# Pull functional use data for BPA bpa <- get_exposure_functional_use(DTXSID = 'DTXSID7020182')
Retrieve exposure related functional use data batch
get_exposure_functional_use_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
get_exposure_functional_use_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames, each containing exposure functional use data for each input DTXSID.
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_func_use <- get_exposure_functional_use_batch(DTXSID = dtxsid)
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_func_use <- get_exposure_functional_use_batch(DTXSID = dtxsid)
Retrieve functional use categories
get_exposure_functional_use_category( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_functional_use_category( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of functional use categories.
# Pull functional use category data for BPA functional_use_categories <- get_exposure_functional_use_category()
# Pull functional use category data for BPA functional_use_categories <- get_exposure_functional_use_category()
Retrieve probability of exposure for functional use category
get_exposure_functional_use_probability( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_functional_use_probability( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame with probabilities corresponding to various routes of exposure related to functional use.
# Pull functional use probability data for BPA bpa <- get_exposure_functional_use_probability(DTXSID = 'DTXSID7020182')
# Pull functional use probability data for BPA bpa <- get_exposure_functional_use_probability(DTXSID = 'DTXSID7020182')
Retrieve exposure functional use probability data batch
get_exposure_functional_use_probability_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
get_exposure_functional_use_probability_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table, with each row containing exposure functional use probability data for each input DTXSID. NA values are filled in for categories that have probability of 0
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use probability data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_func_use_prob <- get_exposure_functional_use_batch(DTXSID = dtxsid)
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use probability data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_func_use_prob <- get_exposure_functional_use_batch(DTXSID = dtxsid)
Retrieve list presence tags
get_exposure_list_presence_tags( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_list_presence_tags( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame with all the list presence tags and associated data.
# Pull list presence tags tags <- get_exposure_list_presence_tags()
# Pull list presence tags tags <- get_exposure_list_presence_tags()
Retrieve document data and list presence tags for a chemical
get_exposure_list_presence_tags_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_list_presence_tags_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of document information and list presence tags
# Pull list presence tags for BPA bpa <- get_exposure_list_presence_tags(DTXSID = 'DTXSID7020182')
# Pull list presence tags for BPA bpa <- get_exposure_list_presence_tags(DTXSID = 'DTXSID7020182')
Retrieve document data and list presence tags for chemicals batch
get_exposure_list_presence_tags_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
get_exposure_list_presence_tags_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames, each containing exposure list presence tags use data for each input DTXSID.
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') exp_list_tags <- get_exposure_list_presence_tags_by_dtxsid_batch(DTXSID = dtxsid)
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') exp_list_tags <- get_exposure_list_presence_tags_by_dtxsid_batch(DTXSID = dtxsid)
Retrieve product data for exposure purposes
get_exposure_product_data( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_product_data( DTXSID = NULL, API_key = NULL, Server = exposure_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame with product information relating to exposure to the given chemical
# Pull exposure product data for BPA bpa <- get_exposure_product_data(DTXSID = 'DTXSID7020182')
# Pull exposure product data for BPA bpa <- get_exposure_product_data(DTXSID = 'DTXSID7020182')
Retrieve product data for exposure purposes batch
get_exposure_product_data_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
get_exposure_product_data_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = exposure_api_server, verbose = FALSE )
DTXSID |
Chemical identifier DTXSID |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames, each containing exposure product data for each input DTXSID.
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_product_data <- get_exposure_product_data_batch(DTXSID = dtxsid)
has_ctx_key() & is.na(ctx_key() == 'FAKE_KEY') # Pull exposure functional use data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_product_data <- get_exposure_product_data_batch(DTXSID = dtxsid)
Retrieve product use categories related to exposure
get_exposure_product_data_puc( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
get_exposure_product_data_puc( API_key = NULL, Server = exposure_api_server, verbose = FALSE )
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame consisting of all the product use categories
# Pull product data use categories for BPA puc_categories <- get_exposure_product_data_puc()
# Pull product data use categories for BPA puc_categories <- get_exposure_product_data_puc()
Get fate by DTXSID
get_fate_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_fate_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
@return A data.frame containing chemical information for the chemical with DTXSID matching the input parameter.
# Pull chemical fate data for BPA bpa <- get_fate_by_dtxsid(DTXSID = 'DTXSID7020182')
# Pull chemical fate data for BPA bpa <- get_fate_by_dtxsid(DTXSID = 'DTXSID7020182')
Retrieve chemical fate data in batch search
get_fate_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = chemical_api_server, verbose = FALSE )
get_fate_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = chemical_api_server, verbose = FALSE )
DTXSID |
A vector of chemicals identifier DTXSIDs |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical fate information for the chemicals with DTXSID matching the input parameter.
# Pull chemical fate by dtxsids chemical_fates <- get_fate_by_dtxsid_batch(DTXSID = c('DTXSID7020182', 'DTXSID2021315'))
# Pull chemical fate by dtxsids chemical_fates <- get_fate_by_dtxsid_batch(DTXSID = c('DTXSID7020182', 'DTXSID2021315'))
Retrieve chemical fate data in batch search
get_fate_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_fate_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A vector of chemicals identifier DTXSIDs |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical fate information for the chemicals with DTXSID matching the input parameter.
Get genetox details
get_genetox_details( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_genetox_details( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of genetox detail data related to the input DTXSID.
# Pull genetox details for BPA bpa_genetox_details <- get_genetox_details(DTXSID = 'DTXSID7020182')
# Pull genetox details for BPA bpa_genetox_details <- get_genetox_details(DTXSID = 'DTXSID7020182')
Get genetox details batch
get_genetox_details_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_genetox_details_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table of genetox detail data for each input DTXSID.
# Pull genetox details data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_genetox_details_hazard <- get_genetox_details_batch(DTXSID = dtxsid)
# Pull genetox details data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_genetox_details_hazard <- get_genetox_details_batch(DTXSID = dtxsid)
Get genetox details batch
get_genetox_details_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_genetox_details_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames of genetox detail data for each input DTXSID.
Get genetox summary
get_genetox_summary( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_genetox_summary( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame of genetox summary data related to the input DTXSID.
# Pull genetox summary for BPA bpa_genetox_summary <- get_genetox_summary(DTXSID = 'DTXSID7020182')
# Pull genetox summary for BPA bpa_genetox_summary <- get_genetox_summary(DTXSID = 'DTXSID7020182')
Get genetox summary batch
get_genetox_summary_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_genetox_summary_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table of genetox summary data for each input DTXSID.
# Pull genetox summary data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_genetox_summary_hazard <- get_genetox_summary_batch(DTXSID = dtxsid)
# Pull genetox summary data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_genetox_summary_hazard <- get_genetox_summary_batch(DTXSID = dtxsid)
Get genetox summary batch
get_genetox_summary_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_genetox_summary_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between requests |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames of genetox summary data for each input DTXSID.
Get hazard data by DTXSID
get_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing chemical (human and eco) hazard data
# Pull hazard data for BPA bpa <- get_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
# Pull hazard data for BPA bpa <- get_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
Get hazard data by DTXSID batch
get_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical (human and eco) hazard data for each input chemical.
# Pull hazard data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_hazard <- get_hazard_by_dtxsid_batch(DTXSID = dtxsid)
# Pull hazard data for multiple chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') batch_hazard <- get_hazard_by_dtxsid_batch(DTXSID = dtxsid)
Get hazard data by DTXSID batch
get_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical (human and eco) hazard data for each input chemical.
Hazard API Endpoint status
get_hazard_endpoint_status()
get_hazard_endpoint_status()
Status of Hazard API Endpoints
status <- get_hazard_endpoint_status() print(status)
status <- get_hazard_endpoint_status() print(status)
Get human hazard data by DTXSID
get_human_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_human_hazard_by_dtxsid( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing chemical human hazard data
# Pull human hazard data for BPA bpa_human <- get_human_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
# Pull human hazard data for BPA bpa_human <- get_human_hazard_by_dtxsid(DTXSID = 'DTXSID7020182')
Get human hazard data by DTXSID batch
get_human_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_human_hazard_by_dtxsid_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.table containing chemical human hazard data.
# Pull human hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_human_hazard <- get_human_hazard_by_dtxsid_batch(DTXSID = dtxsid)
# Pull human hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_human_hazard <- get_human_hazard_by_dtxsid_batch(DTXSID = dtxsid)
Get human hazard data by DTXSID batch
get_human_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_human_hazard_by_dtxsid_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
A list of chemical identifier DTXSIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing chemical human hazard data.
Get InChI
get_inchi( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_inchi( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
name |
Chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A string giving the associated inchi string.
bpa_inchi <- get_inchi(name = "Bisphenol A")
bpa_inchi <- get_inchi(name = "Bisphenol A")
Get InChIKey
get_inchikey( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_inchikey( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
name |
Chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A string giving the associated InChIKey.
bpa_inchikey <- get_inchikey(name = "Bisphenol A")
bpa_inchikey <- get_inchikey(name = "Bisphenol A")
Get chemical lists containing given chemical
get_lists_containing_chemical( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_lists_containing_chemical( DTXSID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A list of names of chemical lists that contain the given chemical
# Pull chemical lists containing BPA bpa_lists <- get_lists_containing_chemical(DTXSID = 'DTXSID7020182')
# Pull chemical lists containing BPA bpa_lists <- get_lists_containing_chemical(DTXSID = 'DTXSID7020182')
Get chemical lists containing given chemical batch
get_lists_containing_chemical_batch( chemical_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_lists_containing_chemical_batch( chemical_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
chemical_list |
A list of the chemical identifier DTXSIDs. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of chemical lists that contain the given chemicals.
# Pull lists containing chemicals for multiple chemicals lists <- get_lists_containing_chemical_batch(chemical_list = c('DTXSID7020182', 'DTXSID2021315'))
# Pull lists containing chemicals for multiple chemicals lists <- get_lists_containing_chemical_batch(chemical_list = c('DTXSID7020182', 'DTXSID2021315'))
Get msready by DTXCID
get_msready_by_dtxcid( DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_msready_by_dtxcid( DTXCID = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
DTXCID |
The chemical identifier DTXCID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A character list of DTXSIDs with DTXCIDs matching the search criteria
# Pull chemicals with matching DTXCID dtxcid_msready <- get_msready_by_dtxcid(DTXSID = 'DTXCID30182')
# Pull chemicals with matching DTXCID dtxcid_msready <- get_msready_by_dtxcid(DTXSID = 'DTXCID30182')
Get msready by DTXCID batch search
get_msready_by_dtxcid_batch( DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_msready_by_dtxcid_batch( DTXCID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXCID |
A list of chemical identifier DTXCIDs |
API_key |
A user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of character lists of DTXSIDs with DTXCIDs matching the search criteria
# Pull msready chemicals matching specific DTXCID dtxcid_msready <- get_msready_by_dtxcid_batch(DTXCID = c('DTXCID30182', 'DTXCID001315'))
# Pull msready chemicals matching specific DTXCID dtxcid_msready <- get_msready_by_dtxcid_batch(DTXCID = c('DTXCID30182', 'DTXCID001315'))
Get msready by formula
get_msready_by_formula( formula = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_msready_by_formula( formula = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
formula |
A string denoting the input chemical formula |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A character list of DTXSIDs with chemical formulas matching the search criteria
# Pull chemicals that match input formula mass_formula <- get_msready_by_formula(formula = 'C16H24N2O5S')
# Pull chemicals that match input formula mass_formula <- get_msready_by_formula(formula = 'C16H24N2O5S')
Get msready by formula batch search
get_msready_by_formula_batch( formula_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_msready_by_formula_batch( formula_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
formula_list |
A list of strings denoting the input chemicals formulas |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of character lists of DTXSIDs with chemical formulas matching the search criteria
# Pull msready data for several chemical formulas msready_data <- get_msready_by_formula_batch(formula_list = c('C16H24N2O5S', 'C15H16O2'))
# Pull msready data for several chemical formulas msready_data <- get_msready_by_formula_batch(formula_list = c('C16H24N2O5S', 'C15H16O2'))
Get msready by mass
get_msready_by_mass( start = NULL, end = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_msready_by_mass( start = NULL, end = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
start |
The starting value for mass range |
end |
The ending value for mass range |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A list of DTXSIDs with msready mass falling within the given range.
# Pull chemicals with msready mass in given range mass_range <- get_msready_by_mass(start = 200.9, end = 200.95)
# Pull chemicals with msready mass in given range mass_range <- get_msready_by_mass(start = 200.9, end = 200.95)
Get ms ready by mass batch search
get_msready_by_mass_batch( start_list = NULL, end_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_msready_by_mass_batch( start_list = NULL, end_list = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
start_list |
A numeric list of starting values for mass range |
end_list |
A numeric list of ending values for mass range |
API_key |
The user-specific API key |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of character lists with DTXSIDs with msready masses falling within the given ranges.
# Pull msready chemicals by mass ranges msready_data <- get_msready_by_mass_batch(start_list = c(200.9, 200.95), end_list = c(200.95, 201.00))
# Pull msready chemicals by mass ranges msready_data <- get_msready_by_mass_batch(start_list = c(200.9, 200.95), end_list = c(200.95, 201.00))
Get msready by mass and error offset
get_msready_by_mass_with_error_batch( masses = NULL, error = NULL, API_key = NULL, rate_limit = 0, verbose = FALSE )
get_msready_by_mass_with_error_batch( masses = NULL, error = NULL, API_key = NULL, rate_limit = 0, verbose = FALSE )
masses |
A numeric list of masses. |
error |
The mass offset value. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some "progress report" should be given. |
A list (of lists) of DTXSIDs, with a list returned for each input mass value.
#Pull chemicals by msready mass and error offset msready_data <- get_msready_by_mass_with_error_batch(masses = c(226, 228), error = 4)
#Pull chemicals by msready mass and error offset msready_data <- get_msready_by_mass_with_error_batch(masses = c(226, 228), error = 4)
Get chemical list by name
get_public_chemical_list_by_name( list_name = NULL, Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_public_chemical_list_by_name( list_name = NULL, Projection = "", API_key = NULL, Server = chemical_api_server, verbose = FALSE )
list_name |
The name of the list of chemicals |
Projection |
Optional parameter controlling return type. It takes values chemicallistall' and 'chemicallistname' with the former as the default value. |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing information about the chemical list. Note,
this is not the chemical list itself. To access the chemicals in the list,
use get_chemicals_in_list
.
# Pull chemical list by list name ccl4 <- get_public_chemical_list_by_name(list_name = 'CCL4')
# Pull chemical list by list name ccl4 <- get_public_chemical_list_by_name(list_name = 'CCL4')
Get chemical list by name batch
get_public_chemical_list_by_name_batch( name_list = NULL, Projection = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_public_chemical_list_by_name_batch( name_list = NULL, Projection = "", API_key = NULL, rate_limit = 0L, verbose = FALSE )
name_list |
A list of chemical list names. |
Projection |
Optional parameter controlling return type. It takes values 'chemicallistall' and 'chemicallistname' with the former as the default value. |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing information about the chemical
lists. Note, these are not the chemical lists themselves. To access the
chemicals in a given list, use get_chemicals_in_list
.
# Pull chemical list information by list names list_info <- get_public_chemical_list_by_name_batch(name_list = c('CCL4', 'NATADB'))
# Pull chemical list information by list names list_info <- get_public_chemical_list_by_name_batch(name_list = c('CCL4', 'NATADB'))
Get skin and eye hazard
get_skin_eye_hazard( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
get_skin_eye_hazard( DTXSID = NULL, API_key = NULL, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSID |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A data.frame containing skin and eye hazard data.
# Pull skin and eye hazard data for BPA bpa_skin_eye <- get_skin_eye_hazard_batch(DTXSID = 'DTXSID7020182')
# Pull skin and eye hazard data for BPA bpa_skin_eye <- get_skin_eye_hazard_batch(DTXSID = 'DTXSID7020182')
Get skin and eye hazard batch
get_skin_eye_hazard_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
get_skin_eye_hazard_batch( DTXSID = NULL, API_key = NULL, rate_limit = 0L, Server = hazard_api_server, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing skin and eye hazard data for each input DTXSID.
# Pull skin eye hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_skin_eye_hazard <- get_skin_eye_hazard_batch(DTXSID = dtxsid)
# Pull skin eye hazard data for multiples chemicals dtxsid <- c('DTXSID7020182', 'DTXSID2021315') dtxsid_skin_eye_hazard <- get_skin_eye_hazard_batch(DTXSID = dtxsid)
Get skin and eye hazard batch
get_skin_eye_hazard_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
get_skin_eye_hazard_batch_old( DTXSID = NULL, API_key = NULL, rate_limit = 0L, verbose = FALSE )
DTXSID |
The chemical identifier DTXSIDs |
API_key |
The user-specific API key. |
rate_limit |
Number of seconds to wait between each request |
verbose |
A logical indicating if some “progress report” should be given. |
A named list of data.frames containing skin and eye hazard data for each input DTXSID.
Get Smiles
get_smiles( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
get_smiles( name = NULL, API_key = NULL, Server = chemical_api_server, verbose = FALSE )
name |
Chemical name |
API_key |
The user-specific API key |
Server |
The root address for the API endpoint |
verbose |
A logical indicating if some “progress report” should be given. |
A string giving a SMILES string for the input chemical.
bpa_smiles <- get_smiles(name = "Bisphenol A")
bpa_smiles <- get_smiles(name = "Bisphenol A")
A section of url used in Hazard API Endpoints
hazard_api_server
hazard_api_server
An object of class character
of length 1.
Prepare url helper function
prepare_word(word)
prepare_word(word)
word |
A character string |
A character string that is ready for use in http request
This page contains documentation tools related to enabling CTX API services in R.
showing_key() ccdr_show_api_key() ccdr_hide_api_key() register_ccdr(key, write = FALSE) ## S3 method for class 'ctx_credentials' print(...) ctx_key() has_ctx_key()
showing_key() ccdr_show_api_key() ccdr_hide_api_key() register_ccdr(key, write = FALSE) ## S3 method for class 'ctx_credentials' print(...) ctx_key() has_ctx_key()
key |
an API key |
write |
if TRUE, stores the secrets provided in the .Renviron file |
... |
a dumped formal argument to the generic print method |
To obtain an API key and enable services, go to https://www.epa.gov/comptox-tools/computational-toxicology-and-exposure-apis. This documentation shows you how to obtain an API key to allow access to the CTX APIs.
To tell ccdR about your API key, use register_ccdr()
, e.g.
register_ccdr(key = 'grbwigbwoginrowgbwibgdibdvinrginiwgo')
(that's a fake
key). This will set your API key for the current session, but if you restart
R, you'll need to do it again. You can set it permanently by setting write = TRUE
m see the examples. If you set it permanently it will be stored in a
local file, and that will be accessed by ccdR persistently across
sessions.
Users should be aware that the API key, a string of garbled characters/numbers/symbols, is a PRIVATE key - it uniquely identifies and authenticates you to CTX's services. If anyone gets your API key, they can use it to masquerade as you to CTX. To mitigate against users inadvertently sharing their keys, by default ccdR never displays a user's key in messages displayed to the console.
Users should be aware that ccdR has no mechanism with which to safeguard the private key once registered with R. That is to say, once you register your API key, any R function will have access to it. As a consequence, ccdR will not know if another function, potentially from a compromised package, accesses the key and uploads it to a third party. For this reason, when using ccdR we recommend a heightened sense of security and self-awareness: only use trusted packages, do not save the API keys in script files, etc.
showing_key
returns a Boolean.
ccdr_show_api_key()
has no return value but has the side effect of
changing the display settings of the API key.
ccdr_hide_api_key()
has no return value but has the side effect of
changing the display settings of the API key.
register_ccdr()
has no return value but has the side effect of
storing the API key.
print.ctx_credentials()
has no return value and is an S3 method for
printing the ctx_credentials
class.
ctx_key()
returns a string, either the stored API key or
NA_character_
.
has_ctx_key()
returns a Boolean.
# Check if API key is showing showing_key() # Toggle API key to display ccdr_show_api_key() # Toggle API key to be hidden ccdr_hide_api_key() # Register key for this session register_ccdr(key = 'YOUR API KEY') # Register key over sessions register_ccdr(key = 'YOUR API KEY', write = TRUE) # Print function for ctx_credentials class print.ctx_credentials() # Display ctx API key ctx_key() # Check whether API key is registered has_ctx_key()
# Check if API key is showing showing_key() # Toggle API key to display ccdr_show_api_key() # Toggle API key to be hidden ccdr_hide_api_key() # Register key for this session register_ccdr(key = 'YOUR API KEY') # Register key over sessions register_ccdr(key = 'YOUR API KEY', write = TRUE) # Print function for ctx_credentials class print.ctx_credentials() # Display ctx API key ctx_key() # Check whether API key is registered has_ctx_key()