extr_casrn_from_cid: Retrieve CASRN for PubChem CIDs

View source: R/extr_pubchem.R

extr_casrn_from_cidR 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

PubChem

Examples


# Example with formaldehyde and aflatoxin
cids <- c(712, 14434) # CID for formaldehyde and aflatoxin B1
extr_casrn_from_cid(cids)


extractox documentation built on April 4, 2025, 2:30 a.m.