extr_ctd: Extract Data from the CTD API

View source: R/extr_ctd.R

extr_ctdR Documentation

Extract Data from the CTD API

Description

This function queries the Comparative Toxicogenomics Database API to retrieve data related to chemicals, diseases, genes, or other categories.

Usage

extr_ctd(
  input_terms,
  category = "chem",
  report_type = "genes_curated",
  input_term_search_type = "directAssociations",
  action_types = NULL,
  ontology = NULL,
  verify_ssl = FALSE,
  verbose = TRUE,
  ...
)

Arguments

input_terms

A character vector of input terms such as CAS numbers or IUPAC names.

category

A string specifying the category of data to query. Valid options are "all", "chem", "disease", "gene", "go", "pathway", "reference", and "taxon". Default is "chem".

report_type

A string specifying the type of report to return. Default is "genes_curated". Valid options include:

"cgixns"

Curated chemical-gene interactions. Requires at least one action_types parameter.

"chems"

All chemical associations.

"chems_curated"

Curated chemical associations.

"chems_inferred"

Inferred chemical associations.

"genes"

All gene associations.

"genes_curated"

Curated gene associations.

"genes_inferred"

Inferred gene associations.

"diseases"

All disease associations.

"diseases_curated"

Curated disease associations.

"diseases_inferred"

Inferred disease associations.

"pathways_curated"

Curated pathway associations.

"pathways_inferred"

Inferred pathway associations.

"pathways_enriched"

Enriched pathway associations.

"phenotypes_curated"

Curated phenotype associations.

"phenotypes_inferred"

Inferred phenotype associations.

"go"

All Gene Ontology (GO) associations. Requires at least one ontology parameter.

"go_enriched"

Enriched GO associations. Requires at least one ontology parameter.

input_term_search_type

A string specifying the search method to use. Options are "hierarchicalAssociations" or "directAssociations". Default is "directAssociations".

action_types

An optional character vector specifying one or more interaction types for filtering results. Default is "ANY". Other acceptable inputs are "abundance", "activity", "binding", "cotreatment", "expression", "folding", "localization", "metabolic processing"... See https://ctdbase.org/tools/batchQuery.go for a full list.

ontology

An optional character vector specifying one or more ontologies for filtering GO reports. Default NULL.

verify_ssl

Boolean to control of SSL should be verified or not.

verbose

A logical value indicating whether to print detailed messages. Default is TRUE.

...

Any other arguments to be supplied to req_option and thus to libcurl.

Value

A data frame containing the queried data in CSV format.

References

  • Davis, A. P., Grondin, C. J., Johnson, R. J., Sciaky, D., McMorran, R., Wiegers, T. C., & Mattingly, C. J. (2019). The Comparative Toxicogenomics Database: update 2019. Nucleic acids research, 47(D1), D948–D954. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/nar/gky868")}

See Also

Comparative Toxicogenomics Database

Examples


input_terms <- c("50-00-0", "64-17-5", "methanal", "ethanol")
dat <- extr_ctd(
  input_terms = input_terms,
  category = "chem",
  report_type = "genes_curated",
  input_term_search_type = "directAssociations",
  action_types = "ANY",
  ontology = c("go_bp", "go_cc")
)
str(dat)

# Get expresssion data
dat2 <- extr_ctd(
  input_terms = input_terms,
  report_type = "cgixns",
  category = "chem",
  action_types = "expression"
)

str(dat2)


extractox documentation built on April 4, 2025, 2:30 a.m.