% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/findKeggIDs.R
\name{findKeggIDs}
\alias{findKeggIDs}
\title{Find KEGG Identifiers for Compounds, Organisms, and KO Terms}
\usage{
findKeggIDs(
  KEGG_database = c("compound", "organism", "ko"),
  searchBy = NULL,
  query = NULL
)
}
\arguments{
\item{KEGG_database}{Character string specifying the KEGG entry type:
\code{"compound"}, \code{"organism"}, or \code{"ko"}.}

\item{searchBy}{Character string specifying the query type.
For \code{KEGG_database = "compound"}: one of \code{"name"},
\code{"sid"}, \code{"cid"}, \code{"SMILES"}, \code{"InChI"},
or \code{"InChIKey"}.
For \code{KEGG_database = "organism"}: one of \code{"name"} or
\code{"taxon_id"}, where \code{"taxon_id"} refers to the KEGG genome
T number.
For \code{KEGG_database = "ko"}: one of \code{"name"},
\code{"symbol"}, or \code{"ECnumber"}.}

\item{query}{Vector of queries to be matched. Non-character input is
coerced to \code{character}.}
}
\value{
A \code{data.frame} with the input values and matched KEGG
identifiers:
\itemize{
\item for \code{KEGG_database = "compound"}: columns
\code{Input}, \code{KEGG_ID};
\item for \code{KEGG_database = "organism"}: columns
\code{Input}, \code{Organism_Code};
\item for \code{KEGG_database = "ko"}: columns
\code{Input}, \code{KO_ID}.
}
If no match is found, the corresponding identifier is \code{NA}.
Some inputs may return multiple rows when multiple matches are found.
}
\description{
Map user-supplied compound, organism, or KO queries to KEGG
identifiers.
}
\details{
For compounds, name queries are first matched against the live KEGG
compound table. Unresolved names and structure-based inputs are queried
through PubChem, and supported PubChem identifiers are converted to KEGG
compound IDs when possible.

For organisms, matching is performed against the live KEGG genome table.
Scientific and common names are matched exactly without regard to case.

For KO terms, the current KEGG KO table is retrieved through the KEGG
REST API. Symbol queries may return multiple KO IDs combined with
\code{"/"}.
}
\examples{
## 1) Map compounds to KEGG compound IDs
findKeggIDs(
  KEGG_database = "compound",
  searchBy      = "name",
  query         = c("tryptophan", "indole", "serotonin")
)

## 2) Map organisms to KEGG organism codes by name
## This example requires live KEGG genome access.
\donttest{
findKeggIDs(
  KEGG_database = "organism",
  searchBy      = "name",
  query         = c("human", "horse", "dragon", "Escherichia coli W")
)
}

## 3) Map enzyme EC numbers to KEGG KO identifiers
findKeggIDs(
  KEGG_database = "ko",
  searchBy      = "ECnumber",
  query         = c("4.1.99.1", "1.13.11.27")
)

}
