Learn R Programming

PubChemR (version 3.0.0)

pc_identifier_map: Map Identifiers via the Next-Generation API

Description

Converts one identifier type to another (`CID`, `SID`, `AID`) using PubChem identifier mapping endpoints.

Usage

pc_identifier_map(
  identifier,
  namespace = "name",
  to = c("cids", "sids", "aids"),
  domain = "compound",
  searchtype = NULL,
  options = NULL,
  ...
)

Value

A typed `PubChemIdMap` object.

Arguments

identifier

Identifier(s).

namespace

PubChem namespace.

to

Operation target; usually one of `"cids"`, `"sids"`, or `"aids"`.

domain

PubChem domain.

searchtype

Search type.

options

Named list of query options.

...

Additional arguments forwarded to `httr::RETRY`.

Details

This is commonly used to bridge domains, for example mapping names to CIDs before downstream property or assay workflows.

Examples

Run this code
id_map <- pc_identifier_map("aspirin", namespace = "name", to = "cids", offline = TRUE)
inherits(id_map, "PubChemIdMap")

if (FALSE) {
pc_identifier_map("aspirin", namespace = "name", to = "cids")
}

Run the code above in your browser using DataLab