R/generics.R
, R/dimensional_reduction.R
ProjectUMAP.Rd
This function will take a query dataset and project it into the coordinates of a provided reference UMAP. This is essentially a wrapper around two steps:
FindNeighbors - Find the nearest reference cell neighbors and their distances for each query cell.
RunUMAP - Perform umap projection by providing the neighbor set calculated above and the umap model previously computed in the reference.
ProjectUMAP(query, ...)
# S3 method for default
ProjectUMAP(
query,
query.dims = NULL,
reference,
reference.dims = NULL,
k.param = 30,
nn.method = "annoy",
n.trees = 50,
annoy.metric = "cosine",
l2.norm = FALSE,
cache.index = TRUE,
index = NULL,
neighbor.name = "query_ref.nn",
reduction.model,
...
)
# S3 method for DimReduc
ProjectUMAP(
query,
query.dims = NULL,
reference,
reference.dims = NULL,
k.param = 30,
nn.method = "annoy",
n.trees = 50,
annoy.metric = "cosine",
l2.norm = FALSE,
cache.index = TRUE,
index = NULL,
neighbor.name = "query_ref.nn",
reduction.model,
...
)
# S3 method for Seurat
ProjectUMAP(
query,
query.reduction,
query.dims = NULL,
reference,
reference.reduction,
reference.dims = NULL,
k.param = 30,
nn.method = "annoy",
n.trees = 50,
annoy.metric = "cosine",
l2.norm = FALSE,
cache.index = TRUE,
index = NULL,
neighbor.name = "query_ref.nn",
reduction.model,
reduction.name = "ref.umap",
reduction.key = "refUMAP_",
...
)
Query dataset
Additional parameters to RunUMAP
Dimensions (columns) to use from query
Reference dataset
Dimensions (columns) to use from reference
Defines k for the k-nearest neighbor algorithm
Method for nearest neighbor finding. Options include: rann, annoy
More trees gives higher precision when using annoy approximate nearest neighbor search
Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming
Take L2Norm of the data
Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)
Precomputed index. Useful if querying new data against existing index to avoid recomputing.
Name to store neighbor information in the query
DimReduc
object that contains the umap model
Name of reduction to use from the query for neighbor finding
Name of reduction to use from the reference for neighbor finding
Name of projected UMAP to store in the query
Value for the projected UMAP key