extr_casrn_from_cid {extractox} | R Documentation |
Retrieve CASRN for PubChem CIDs
Description
This function retrieves the CASRN for a given set of PubChem Compound Identifiers (CID).
It queries PubChem through the webchem
package and extracts the CASRN from
the depositor-supplied synonyms.
Usage
extr_casrn_from_cid(pubchem_ids, verbose = TRUE)
Arguments
pubchem_ids |
A numeric vector of PubChem CIDs. These are unique identifiers for chemical compounds in the PubChem database. |
verbose |
A logical value indicating whether to print detailed messages. Default is TRUE. |
Value
A data frame containing the CID, CASRN, and IUPAC name of the compound. The returned data frame includes three columns:
- CID
The PubChem Compound Identifier.
- casrn
The corresponding CASRN of the compound.
- iupac_name
The IUPAC name of the compound.
- query
The pubchem_id queried.
See Also
Examples
# Example with formaldehyde and aflatoxin
cids <- c(712, 14434) # CID for formaldehyde and aflatoxin B1
extr_casrn_from_cid(cids)
[Package extractox version 1.0.0 Index]