Skip to contents

[Maturing]

Search the cheminformatics database using various search types including exact structure, substructure, similarity, mass, hazard, and feature searches.

Usage

chemi_search(
  query = NULL,
  search_type = c("exact", "substructure", "similar", "mass", "hazard", "features"),
  similarity_type = c("tanimoto", "euclid", "tversky"),
  min_similarity = 0.85,
  hazard_name = NULL,
  min_toxicity = c("VH", "H", "M", "L", "A"),
  min_authority = c("auth", "screen", "qsar"),
  mass_type = c("mono", "mw", "abu"),
  min_mass = NULL,
  max_mass = NULL,
  filter_features = FALSE,
  feature_filters = NULL,
  element_include = NULL,
  element_exclude = NULL,
  exclude_all_others = FALSE,
  limit = 50,
  all_pages = FALSE
)

Arguments

query

Chemical identifier (DTXSID), SMILES string, or MOL file string. Required for exact, substructure, and similar searches. Can be NULL for mass, hazard, and features searches.

search_type

Type of search to perform. One of:

  • "exact" - Exact structure match

  • "substructure" - Substructure search

  • "similar" - Similarity search

  • "mass" - Mass-based search

  • "hazard" - Hazard-based search

  • "features" - Feature-based search

similarity_type

Similarity metric for similar searches. One of "tanimoto" (default), "euclid", or "tversky".

min_similarity

Minimum similarity threshold (0-1). Defaults to 0.85.

hazard_name

Hazard endpoint name for hazard searches. Use short names: "acute_oral", "acute_inhal", "acute_dermal", "cancer", "geno", "endo", "reprod", "develop", "neuro_single", "neuro_repeat", "sys_single", "sys_repeat", "skin_sens", "skin_irr", "eye", "aq_acute", "aq_chron", "persis", "bioacc", "expo".

min_toxicity

Minimum toxicity level for hazard searches. One of "VH" (Very High), "H" (High), "M" (Medium), "L" (Low), or "A" (Any).

min_authority

Minimum data authority level for hazard searches. One of "auth" (Authoritative), "screen" (Screening), or "qsar" (QSAR).

mass_type

Type of mass for mass searches. One of "mono" (monoisotopic mass), "mw" (molecular weight), or "abu" (most abundant mass).

min_mass

Minimum mass value for mass searches.

max_mass

Maximum mass value for mass searches.

filter_features

Logical; whether to apply feature filters. Defaults to FALSE.

feature_filters

Named logical vector of feature filters to apply when filter_features = TRUE. Valid filter names: "stereo", "chiral", "isotopes", "charged", "multicomponent", "radicals", "salts", "polymers", "sgroups".

element_include

Character vector of element symbols to include in results.

element_exclude

Character vector of element symbols to exclude from results.

exclude_all_others

Logical; if TRUE, excludes all elements except those in element_include. Defaults to FALSE.

limit

Maximum number of results to return per page. Defaults to 50.

all_pages

Logical; if TRUE, automatically fetches all pages via offset/limit pagination. If FALSE (default), returns a single page.

Value

A tibble containing search results with columns depending on search type. For similarity searches, includes a relationship column indicating "parent" (query compound) or "child" (similar compound).

API stage

This wrapper was generated from the public API schema.

Examples

if (FALSE) { # \dontrun{
# Exact search by DTXSID
chemi_search("DTXSID7020182", "exact")

# Similarity search with custom threshold
chemi_search("DTXSID7020182", "similar", min_similarity = 0.9)

# Mass range search
chemi_search(
  query = NULL,
  search_type = "mass",
  mass_type = "mono",
  min_mass = 100,
  max_mass = 200
)

# Hazard search for carcinogenicity
chemi_search(
  query = NULL,
  search_type = "hazard",
  hazard_name = "cancer",
  min_toxicity = "H",
  min_authority = "auth"
)

# Feature search with element filtering
chemi_search(
  query = NULL,
  search_type = "features",
  element_include = c("C", "N", "O"),
  exclude_all_others = TRUE,
  limit = 100
)
} # }