getPCproperty.IsoSMILES: Retrieve SMILES from Compound Name from PubChem

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ChemicalCuration.R

Description

Retrieves the Isomeric SMILES via name (synonyms) from PubChem using PUG REST. Note that more than one SMILES can be returned and the "best match" is usually at the top (i.e. n=1).

Usage

1
getPCproperty.IsoSMILES(query, from = "name", to = "isomericsmiles", n=1, timeout=30)

Arguments

query

string of the compound name for which you need SMILES

from

Type of input ID (default "name" should be kept for this function to work as expected).

to

Type of output desired (default "isomericsmiles" should be kept for this function to work as expected).

n

Default n=1. For some names, multiple matches will be returned and n>1 can be returned by defining n. n=1 is best match.

timeout

The timeout, in seconds.

Details

For this function to work as expected, only one search entry should be used with the default "name" and "isomericsmiles". n should only be adjusted if you know what you are doing (i.e. trust n=1 first). The URL can accept comma separated CIDs, but this is currently ignored downstream. Thanks to Paul Thiessen and Evan Bolton from PubChem team for assistance.

Value

A list containing the CID and the Isomeric SMILES

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

References

PubChem search: http://pubchem.ncbi.nlm.nih.gov/

PubChem PUG REST: https://pubchemdocs.ncbi.nlm.nih.gov/pug-rest

Examples

1
2
3
4
5
6
7
getPCproperty.IsoSMILES("aspirin")
#an example with multiple results available (up to 3)
getPCproperty.IsoSMILES("carnitine")
getPCproperty.IsoSMILES("carnitine",n=1)
getPCproperty.IsoSMILES("carnitine",n=3)
# a nonsense example
getPCproperty.IsoSMILES("blah")

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