post_mass_batch: Post a batch of monoisotopic masses and their ranges to...

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

View source: R/FILTERING-post_mass_batch.R

Description

Functionality to post up to 20 monoisotopic masses and their range to obtain a queryId for use in chemspiderapi::get_mass_batch_queryId_status() and chemspiderapi::get_mass_batch_queryId_results().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
post_mass_batch(
  mass,
  range,
  dataSources = NULL,
  orderBy = "recordId",
  orderDirection = "ascending",
  apikey,
  coerce = FALSE,
  simplify = FALSE
)

Arguments

mass

A vector of (double) numbers corresponding to the atomic (monoisotopic) masses you are inquiring. Has to be within the range of [1,11000].

range

A vector of (double) numbers corresponding to the ranges for the above masses. Has to be within the range of [0.0001,0.001].

dataSources

Optional: A character vector specifying which data source to use. Use chemspiderapi::get_datasources() for a complete list of data sources. If none are specified (the default), will search all data sources, which can take substantially longer time to complete.

orderBy

A character vector indicating by which parameter to order. Defaults to recordId; see Details for options.

orderDirection

A character vector indicating in which direction to order; either ascending (default) or descending.

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

"If dataSources is not specified, all known sources are searched. This will take longer.

Optionally, you can also submit orderBy and orderDirection to specify the sort order for the results. If you do not specify a value for orderBy, results are sorted by recordId by default.

Valid values for orderBy are recordId, massDefect, molecularWeight, referenceCount, dataSourceCount, pubMedCount, rscCount.

Valid values for orderDirection are ascending, descending."

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/mass/batch

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Post two atomic (monoisotopic) masses and their ranges
mass <- c(194, 303)
range <- c(0.0005, 0.001)
apikey <- "a valid 32-character ChemSpider apikey"
post_mass_batch(mass = mass, range = range, apikey = apikey)

## End(Not run)

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