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.

Note

This function is deprecated. Use `convert_metabolite_id()` instead.

Examples

trans_ID(
    query = "C00001",
    from = "KEGG",
    to = "PubChem SID",
    top = 1,
    server = "cts.fiehnlab"
)
#> Warning: Please check you query, from and to again.
#>         You can use trans_id_database() function to
#>         check the databases this package support.
#>     KEGG PubChem SID
#> 1 C00001          NA

trans_ID(
    query = "C00001",
    to = "Human Metabolome Database",
    server = "cts.fiehnlab"
)
#> Warning: Please check you query, from and to again.
#>         You can use trans_id_database() function to
#>         check the databases this package support.
#>     KEGG Human Metabolome Database
#> 1 C00001                        NA