Learn R Programming

PubChemR (version 2.1.3)

get_aids: Retrieve Assay IDs (AIDs) from PubChem

Description

This function queries the PubChem database to retrieve Assay IDs (AIDs) based on a given identifier.

Usage

get_aids(
  identifier,
  namespace = "cid",
  domain = "compound",
  searchtype = NULL,
  options = NULL
)

Value

An object of class 'PubChemInstance_AIDs', which is a list containing information retrieved from the PubChem database. Assay IDs can be extracted from the returned object using the getter function AIDs.

Arguments

identifier

A vector of identifiers, either numeric or character. The type of identifier depends on the namespace and domain parameters. **Note**: identifier must be provided; it cannot be NULL.

namespace

A character string specifying the namespace of the identifier.

Possible values depend on the domain parameter and include:

- For domain = 'compound': cid, name, smiles, inchi, sdf, inchikey, formula, etc.

- For domain = 'substance': sid, sourceid/<source id>, sourceall/<source name>, name, etc.

- For domain = 'assay': aid, listkey, type/<assay type>, sourceall/<source name>, etc.

For more details, see the Input section.

domain

A character string specifying the domain of the query.

Possible values are:

- compound (default)

- substance

- assay

- Other domains as specified in the API documentation.

searchtype

An optional character string specifying the search type.

Possible values depend on the namespace and domain.

Examples include:

- substructure, superstructure, similarity, identity for structure searches.

- fastidentity, fastsimilarity_2d, fastsimilarity_3d, etc. for fast searches.

If NULL (default), no search type is specified.

options

A list of additional options for the request.

Available options depend on the specific request and the API.

Examples include:

- For similarity searches: list(Threshold = 95)

- For substructure searches: list(MaxRecords = 100)

If NULL (default), no additional options are included.

For more details, see the Structure Search Operations section of the PUG REST API.

Details

For more detailed information, please refer to the PubChem PUG REST API documentation.

See Also

AIDs, get_pug_rest

Examples

Run this code
# Request for multiple assays
# If assay identifier is unknown or incorrect, an error returns from PubChem Database
aids <- get_aids(
  identifier = c("aspirin", "ibuprofen", "rstudio"),
  namespace = "name"
)

print(aids)

# Return all Assay IDs.
AIDs(aids)

Run the code above in your browser using DataLab