post_inchi: POST an InChI string

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/FILTERING-post_inchi.R

Description

Functionality to POST an InChI string to obtain a queryId for use in chemspiderapi::get_queryID_status() and chemspiderapi::get_queryId_results().

Usage

1
post_inchi(inchi, apikey, coerce = FALSE, simplify = FALSE)

Arguments

inchi

A valid InChI string; see Details.

apikey

A 32-character string with a valid key for ChemSpider's API services.

coerce

logical: should the list be coerced to a data.frame? Defaults to FALSE.

simplify

logical: should the results be simplified to a vector? Defaults to FALSE.

Details

The validity criteria for InChI strings are outlined here: https://www.inchi-trust.org/technical-faq/#2.8. If certain criteria are not met by the input inchi, chemspiderapi::post_inchi() returns an error message and does not perform an API query.

Value

Returns the queryId string as (named) character vector.

Author(s)

Raoul Wolf (https://github.com/RaoulWolf/)

See Also

https://developer.rsc.org/compounds-v1/apis/post/filter/inchi

Examples

1
2
3
4
5
6
## Not run: 
## Post the InChI string of caffeine to get a queryId
inchi <- "InChI=1S/C8H10N4O2/c1-10-4-9-6-5(10)7(13)12(3)8(14)11(6)2/h4H,1-3H3"
apikey <- "a valid 32-character ChemSpider apikey"
post_inchi(inchi = inchi, apikey = apikey)
## End(Not run)

NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.