get_assays: Retrieve Assays from PubChem

View source: R/get_assays.R

get_assaysR Documentation

Retrieve Assays from PubChem

Description

This function sends a request to PubChem to retrieve assay data based on the specified parameters.

Usage

get_assays(identifier, namespace = "aid", operation = NULL, options = NULL)

Arguments

identifier

A vector of positive integers (e.g., cid, sid, aid) or identifier strings (source, inchikey, formula). In some cases, only a single identifier string (e.g., name, smiles, xref; inchi, sdf by POST only) can be provided. Multiple elements can be included as a vector. See Notes for details.

namespace

A character string specifying the namespace of the identifier.

Possible values include:

- aid: PubChem Assay Identifier (default)

- listkey: A list key obtained from a previous query

- type/<assay type>: Specify the assay type

- sourceall/<source name>: Specify the source name

- target/<assay target>: Specify the assay target

- activity/<activity column name>: Specify the activity column name

For more details, see the Input section of the PUG REST API.

operation

A character string specifying the operation to perform.

Possible values include:

- record: Retrieve the full assay record

- concise: Retrieve a concise summary of the assay

- aids: Retrieve related Assay IDs

- sids: Retrieve related Substance IDs

- cids: Retrieve related Compound IDs

- description: Retrieve assay descriptions (default)

- targets/<target type>: Retrieve targets of the assay

- summary: Retrieve a summary of the assay

- classification: Retrieve assay classification

If NULL (default), the operation defaults to description.

For a full list of operations, see the Operations section of the PUG REST API.

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.

Value

An object of class 'PubChemInstanceList' containing the information retrieved from the PubChem database.

Note

To extract information about a specific assay from the returned list, use the instance function.

Each assay may include information on several properties. Specific information from the assay can be extracted using the retrieve function. See examples.

See Also

retrieve, instance

Examples

# Retrieve a list of assays from the PubChem database
assays <- get_assays(
  identifier = c(1234, 7815),
  namespace = 'aid'
)

# Return assay information for assay ID '1234'
assay1234 <- instance(assays, "1234")
print(assay1234)

# Retrieve specific elements from the assay output
retrieve(assay1234, "aid")


PubChemR documentation built on April 4, 2025, 2:18 a.m.