Skip to contents

This function maps a drug compound to the Cancer Target Discovery (CTD) database. It retrieves information about the compound from the CTD database and returns the results as a data table.

Usage

mapCompound2CTD(
  compounds,
  base_url = "https://ctd2-dashboard.nci.nih.gov/dashboard/get",
  endpoint = "compound",
  nParallel = parallel::detectCores() - 1,
  raw = FALSE,
  query_only = FALSE
)

Arguments

compounds

A character vector of drug compounds to map to the CTD database.

base_url

The base URL of the CTD API. Default is "https://ctd2-dashboard.nci.nih.gov/dashboard/get".

endpoint

The API endpoint for the compound mapping. Default is "compound".

nParallel

The number of parallel processes to use. Default is one less than the number of available cores.

raw

Logical indicating whether to return the raw response from the API. Default is FALSE.

query_only

Logical indicating whether to only return the API request URL without making the actual request. Default is FALSE.

Value

A data table containing the mapped information for the drug compound. If the API request fails, a data table with the drug compound name will be returned. If raw is set to TRUE, the raw response from the API will be returned.

Examples

mapCompound2CTD("Bax channel blocker", nParallel = 1)
#>            displayName BROAD_COMPOUND CTRP ID           CTRP NAME
#>                 <char>         <char>  <char>              <char>
#> 1: Bax channel blocker          18311   18311 Bax channel blocker
#>        DepMap compound            IMAGE PUBCHEM
#>                 <char>           <char>  <char>
#> 1: BAX-channel-blocker struct_18311.png 2729027