Retrieve Substance IDs (SIDs) from PubChem
get_sids.Rd
This function sends a request to PubChem to retrieve Substance IDs (SIDs) for a given identifier. It returns a tibble (data frame) with the provided identifier and the corresponding SIDs.
Usage
get_sids(
identifier,
namespace = "cid",
domain = "compound",
searchtype = NULL,
options = NULL
)
Arguments
- identifier
A numeric or character vector specifying the identifiers for the request.
- namespace
A character string specifying the namespace for the request. Default is 'cid'.
- domain
A character string specifying the domain for the request. Default is 'compound'.
- searchtype
A character string specifying the search type. Default is NULL.
- options
Additional arguments passed to
get_json
.
Value
A tibble (data frame) where each row corresponds to a provided identifier and its SID. The tibble has columns 'CID' and 'SID'.
Examples
get_sids(
identifier = "aspirin",
namespace = "name"
)
#> # A tibble: 386 × 3
#> Compound CID SID
#> <chr> <dbl> <dbl>
#> 1 aspirin 2244 4594
#> 2 aspirin 2244 87798
#> 3 aspirin 2244 476106
#> 4 aspirin 2244 602429
#> 5 aspirin 2244 829042
#> 6 aspirin 2244 832958
#> 7 aspirin 2244 840714
#> 8 aspirin 2244 3135921
#> 9 aspirin 2244 5261264
#> 10 aspirin 2244 7847177
#> # ℹ 376 more rows