Takes a vector of chemical names, CAS numbers, SMILES, or any identifier
and returns a tibble mapping each input to its DTXSID and preferred name.
Unmatched inputs are included with NA values.
Arguments
- query
A character vector of values to resolve.
- con
An optional
DBI::DBIConnection.- ignore_case
If
TRUE, names are matched without regard to case: preferred names, IUPAC names and synonyms. A synonym match is then always reported as"IDENTIFIER", never"ident_upper". CAS numbers, formulas, InChIKeys, SMILES and DTXSIDs are still matched exactly, because case carries meaning in a SMILES string (candC) and in a formula (CoandCO). DefaultFALSE.- fields
Optional character vector naming the fields that may match: any of
"PREFERRED_NAME","CASRN","MOLECULAR_FORMULA","INCHIKEY","IUPAC_NAME","SMILES","IDENTIFIER","ident_upper"and"DTXSID". An input that matches only other fields is returned as unmatched.NULL(default) allows every field. Synonyms include strings that look like formulas or SMILES, so usefields, notignore_case, to keep"CO"from matching as a formula. Withignore_case = FALSE, include"ident_upper"to keep the upper-case synonym matches; withignore_case = TRUEit means"IDENTIFIER".- best_match
If
TRUE, return one row per input and DTXSID. An input can match one substance under several fields (the synonym list repeats the preferred name, for example); only the first of these is kept, in the order"DTXSID","PREFERRED_NAME","CASRN","MOLECULAR_FORMULA","INCHIKEY","IUPAC_NAME","SMILES","ident_upper","IDENTIFIER".fieldsis applied first. An input that matches several substances still returns one row for each. DefaultFALSE.
Details
By default every field is matched exactly and case-sensitively. The table
also holds an upper-cased copy of each synonym (ident_upper), so an
upper-case input can match a synonym written in another case.
See also
Other dsstox:
dss_cas(),
dss_connect(),
dss_diag_freshness(),
dss_disconnect(),
dss_fuzzy(),
dss_install(),
dss_query(),
dss_search(),
dss_synonyms()
