% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/build.graph.R
\name{build.graph}
\alias{build.graph}
\title{Build Graph Based on Principal Components and K-Nearest Neighbors}
\usage{
build.graph(pcs, knn = 30)
}
\arguments{
\item{pcs}{A numeric matrix of principal components (cells x PCs).}

\item{knn}{Number of nearest neighbors to consider for each cell. Default is 30.}
}
\value{
A list containing:
\item{p}{A sparse symmetric affinity matrix representing transition probability.}
\item{nn.idx}{Matrix of nearest neighbor indices for each cell.}
\item{nn.w}{Matrix of normalized affinity weights for the nearest neighbors.}
}
\description{
Constructs an affinity graph from principal components using adaptive kernel scaling approach
adapted from Uniform Manifold Approximation and Projection (UMAP) (Becht et al. 2019).
}
\references{
Becht, E., McInnes, L., Healy, J., Dutertre, C.-A., Kwok, I. W. H., Ng, L. G., Ginhoux, F., & Newell, E. W. (2019).
Dimensionality reduction for visualizing single-cell data using UMAP.
\emph{Nature Biotechnology}, 37(1), 38--44. \doi{10.1038/nbt.4314}
}
