buildCompToxURL: Build URL for CompTox Chemistry Dashboard

Description Usage Arguments Details Value Author(s) Examples

View source: R/CompTox.R

Description

This builds a URL for searching the US EPA CompTox Chemistry Dashboard, optionally sending this direct to the default browser.

Usage

1
2
buildCompToxURL(search_string, type="simple", add_utf8=FALSE, browse=FALSE,
mass_entry="", single_component=TRUE, no_isotopes=TRUE)

Arguments

search_string

A string to search CompTox. Must be compatible with one of the type entries to perform a valid search.

type

Type of search to perform, one of ("simple", "name", "cas","DTXSID","InChIKey", "skeleton", "similarity","mass_ppm", "mass_Da", "mass_range", "formula"). See Details.

add_utf8

If TRUE, adds utf8 character into the URL for compatability with IE8. If this is added, it is preferable to copy/paste the link into the browser rather than use browse=TRUE to avoid encoding issues.

browse

Default FALSE returns just a URL for this function, if TRUE, the URL is opened in the default browser as well.

mass_entry

This must be non-empty for all mass searches; for mass_ppm it is the ppm value to use, for mass_Da the absolute mass error and for mass_range it is the higher mass entry in the range (and search_string must be the lower entry).

single_component

Default TRUE means only single component records are searched; FALSE includes mixtures. Only used in combination with mass and formula searches.

no_isotopes

Default TRUE eliminates non-standard isotope species. FALSE includes these. Used only in mass searches.

Details

Currently the CompTox Dashboard supports name, CAS, DTXSID, InChIKey and InChIKey skeleton searches as a simple text-based search requiring only search_string.

The type="simple" covers all these categories, alternatively the respective type can be used as follows:

name = "name", CAS reference number = "cas", DSSToxID (Dashboard identifier) = "DTXSID" (including the letters DTXSID!), InChIKey = InChIKey and InChIKey skeleton (first block) search = "skeleton".

The similarity search (type="similarity") requires a DTXSID as search_string. Mass-based searches are a combination of search_string and mass_entry (see above).

Formula searches require a molecular formula as search_string and type="formula". Note that a SMILES search is not yet supported in the Dashboard.

Value

Returns a URL for direct use in a browser, optionally opening it in the default browser

Author(s)

Emma Schymanski (R wrapper, <emma.schymanski@uni.lu>), Antony Williams (CompTox Dashboard)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
buildCompToxURL("benzene")
buildCompToxURL("nicotine", browse=TRUE)

# if you add utf8, better to copy and paste link into browswer rather than use browse=TRUE.
buildCompToxURL("1912-24-9", type = "cas", add_utf8 = TRUE)

buildCompToxURL("MXWJVTOOROXGIU-UHFFFAOYSA-N", browse=TRUE)
buildCompToxURL("SNICXCGAKADSCV", type="skeleton", browse=TRUE)

# this searches just for the exact ID
buildCompToxURL("DTXSID9020112", browse=TRUE)
# this searches for similar substances, appearing lower down in the record
buildCompToxURL("DTXSID9020112", type="similarity", browse=TRUE)

# Molecular formula search: (default with single component)
buildCompToxURL("C8H14ClN5", type="formula", browse=TRUE)
buildCompToxURL("C8H14ClN5", type="formula", browse=TRUE, single_component = FALSE)
# These two links return the same result, this shouldn't be the case.
# Single component part does not seem to be working (also in web interface). Comment submitted.
buildCompToxURL("C8H15Cl2N5", type="formula", browse=TRUE, single_component = TRUE)
buildCompToxURL("C8H15Cl2N5", type="formula", browse=TRUE, single_component = FALSE)

# Mass search with ppm and Da
buildCompToxURL("162.115698", type="mass_ppm", browse=TRUE, mass_entry="5")
buildCompToxURL("162.115698", type="mass_ppm", browse=TRUE, mass_entry="5", single_component = FALSE,
                no_isotopes = FALSE)
buildCompToxURL("162.115698", type="mass_ppm", browse=TRUE, mass_entry="100")
buildCompToxURL("162.115698", type="mass_Da", browse=TRUE, mass_entry="0.01")
buildCompToxURL("162.115698", type="mass_Da", browse=TRUE, mass_entry="0.1")
buildCompToxURL("162.115698", type="mass_Da", browse=TRUE, mass_entry="0.1",
                single_component = FALSE, no_isotopes = FALSE)
# Search by mass range
buildCompToxURL("162.115", type="mass_range", browse=TRUE, mass_entry="162.116",
                single_component = FALSE, no_isotopes = FALSE)

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.