| get_chem_id | R Documentation |
Given one of chem.name, chem.cas (Chemical Abstract Service Registry Number), dtxsid (DSStox Substance Identifier), or cichem, this function checks if the chemical is available in the chem.physical_and_invitro.data normalized structure and returns matching chemical identifiers.
get_chem_id(
chem.cas = NULL,
chem.name = NULL,
dtxsid = NULL,
cichem = NULL,
internal.chem.id = FALSE
)
chem.cas |
CAS registry number (character, single value) |
chem.name |
Chemical name or synonym (character, single value) |
dtxsid |
DSSTox Substance identifier (character, single value) |
cichem |
Internal chemical ID code (character, single value) |
internal.chem.id |
If TRUE, returns the internal chemical ID (chem_id) instead of other identifiers |
The function accepts one chemical identifier.
Priority order for matching: 1. If chem.cas provided: matched against CASRN in chemicals table 2. If dtxsid provided: matched against DTXSID in chemicals table 3. If cichem provided: matched against cichem in chemicals table 4. If chem.name provided: matched via normalized synonyms table
When looking up by chem.name, the function searches the synonyms table in normalized form (lowercase, no spaces/hyphens), allowing flexible matching of different name formats for the same chemical.
An error is raised if: - Multiple chemicals match the provided identifier - No chemicals match any provided identifier
A tibble with a single row containing:
chem_id |
Internal chemical database ID |
chem.cas |
CAS registry number |
chem.name |
Primary compound name (from synonyms table) |
dtxsid |
DTXSID identifier |
cichem |
Internal chemical code |
match_type |
Which identifier was used for lookup (cas, dtxsid, cichem, or name) |
John Wambaugh and Robert Pearce
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.