% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/network_utils.R
\name{findMappedNodes}
\alias{findMappedNodes}
\title{Map User-Supplied Nodes to a Network}
\usage{
findMappedNodes(nodes, network_table)
}
\arguments{
\item{nodes}{Character vector of node IDs (e.g. KEGG compounds, KO IDs,
reaction IDs) to check.}

\item{network_table}{Matrix or data frame (2 or 3 columns) representing a
network, typically generated by \code{\link{buildKeggNetwork}} or related
functions.}
}
\value{
A list with two components:
\describe{
\item{mapped_nodes}{Character vector of nodes found in the network.}
\item{unmapped_nodes}{Character vector of nodes not found in the network.}
}
}
\description{
Check which nodes from a user-supplied vector are present in a given
network edge list and which are absent.
}
\details{
This function is a small utility to verify that user-specified compounds,
genes/KOs, or reactions are present in a network before running downstream
analyses (e.g. distance calculations, shortest paths, ego networks).
}
\examples{
## Example — Check presence of Trp-pathway nodes in a MetaPathNet example network

## Load the precomputed example network; see buildKeggNetwork() for its construction
data(MetaPathNet_example_network)

## Define a small set of candidate nodes (compounds + KO + fake ID)
candidate_nodes <- c(
  "C00078",       # tryptophan      (will be normalised to "cpd:C00078")
  "cpd:C00328",   # L-kynurenine
  "K00463",       # tryptophan synthase beta chain
  "NotID"         # fake node, should be unmapped
)

## Check which of these nodes are present in the network
res <- findMappedNodes(
  nodes         = candidate_nodes,
  network_table = MetaPathNet_example_network
)

res$mapped_nodes    # present in MetaPathNet_example_network
res$unmapped_nodes  # absent from MetaPathNet_example_network

}
