Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ProjectUMAP

Project query into UMAP coordinates of a reference


Description

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.

Usage

ProjectUMAP(query, ...)

## Default S3 method:
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 20,
  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 class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 20,
  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 class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 20,
  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_",
  ...
)

Arguments

query

Query dataset

...

Additional parameters to RunUMAP

query.dims

Dimensions (columns) to use from query

reference

Reference dataset

reference.dims

Dimensions (columns) to use from reference

k.param

Defines k for the k-nearest neighbor algorithm

nn.method

Method for nearest neighbor finding. Options include: rann, annoy

n.trees

More trees gives higher precision when using annoy approximate nearest neighbor search

annoy.metric

Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming

l2.norm

Take L2Norm of the data

cache.index

Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)

index

Precomputed index. Useful if querying new data against existing index to avoid recomputing.

neighbor.name

Name to store neighbor information in the query

reduction.model

DimReduc object that contains the umap model

query.reduction

Name of reduction to use from the query for neighbor finding

reference.reduction

Name of reduction to use from the reference for neighbor finding

reduction.name

Name of projected UMAP to store in the query

reduction.key

Value for the projected UMAP key


Seurat

Tools for Single Cell Genomics

v4.0.1
GPL-3 | file LICENSE
Authors
Andrew Butler [ctb] (<https://orcid.org/0000-0003-3608-0463>), Saket Choudhary [ctb] (<https://orcid.org/0000-0001-5202-7633>), Charlotte Darby [ctb] (<https://orcid.org/0000-0003-2195-5300>), Jeff Farrell [ctb], Christoph Hafemeister [ctb] (<https://orcid.org/0000-0001-6365-8254>), Yuhan Hao [ctb] (<https://orcid.org/0000-0002-1810-0822>), Paul Hoffman [aut, cre] (<https://orcid.org/0000-0002-7693-8957>), Jaison Jain [ctb] (<https://orcid.org/0000-0002-9478-5018>), Efthymia Papalexi [ctb] (<https://orcid.org/0000-0001-5898-694X>), Patrick Roelli [ctb], Rahul Satija [ctb] (<https://orcid.org/0000-0001-9448-8833>), Karthik Shekhar [ctb], Avi Srivastava [ctb] (<https://orcid.org/0000-0001-9798-2079>), Tim Stuart [ctb] (<https://orcid.org/0000-0002-3044-0897>), Kristof Torkenczy [ctb] (<https://orcid.org/0000-0002-4869-7957>), Shiwei Zheng [ctb] (<https://orcid.org/0000-0001-6682-6743>), Satija Lab and Collaborators [fnd]
Initial release
2021-03-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.