This function takes an identifier from a given database (`from`) and converts it to the desired database (`to`). It uses either the `cts.fiehnlab` or `chemspider` services for conversion.

trans_ID(
  query = "C00001",
  from = "KEGG",
  to = "PubChem SID",
  top = 1,
  server = c("cts.fiehnlab", "chemspider")
)

Arguments

query

A character string of the chemical identifier to be converted.

from

A character string of the database from which the query is.

to

A character string of the desired database to which the identifier should be converted.

top

Numeric value indicating the top results to be returned.

server

A character string indicating which server to use. Possible values are "cts.fiehnlab" or "chemspider".

Value

A character string of the converted identifier, or `NA` if the conversion was unsuccessful.

Examples

if (FALSE) {
trans_ID(
    query = "C00001",
    from = "KEGG",
    to = "PubChem SID",
    top = 1,
    server = "cts.fiehnlab"
)

trans_ID(
    query = "C00001",
    to = "Human Metabolome Database",
    server = "cts.fiehnlab"
)
}