# embedVelocity: Project velocities onto an embedding In velociraptor: Toolkit for Single-Cell Velocity

## Description

Project the velocity vector for each cell onto an existing low-dimensional embedding.

## Usage

 ```1 2 3 4 5 6 7``` ```embedVelocity(x, vobj, ...) ## S4 method for signature 'ANY' embedVelocity(x, vobj, ...) ## S4 method for signature 'SingleCellExperiment' embedVelocity(x, vobj, ..., use.dimred = 1) ```

## Arguments

 `x` A numeric matrix of low-dimensional coordinates, e.g., after t-SNE. Alternatively, a SingleCellExperiment containing such coordinates in its `reducedDims`. `vobj` A SingleCellExperiment containing the output of the velocity calculations, typically after running `scvelo`. `...` For the generic, further arguments to pass to specific methods. For the ANY method, further arguments to pass to the `velocity_embedding` Python function from scVelo. For the SingleCellExperiment method, further arguments to pass to the ANY method. `use.dimred` String or integer scalar specifying the reduced dimensions to retrieve from `x`.

## Details

This is a simple wrapper around the `scvelo.tools.velocity_embedding` function. Briefly, we construct a cell-cell transition matrix where a cell is more likely to transition to one of its neighbors if its velocity vector is pointing in the same direction as that neighbor. The resulting matrix is then used to compute a weighted average of the positions in `x`, allowing us to compute a velocity in the low-dimensional embedding.

## Value

A numeric matrix of the same dimensions as `x`, containing the projected velocity vectors in that embedding.

Aaron Lun

## Examples

 ```1 2 3 4 5 6 7``` ```example(scvelo, echo=FALSE) # recycling that example. # Making up a new embedding. tsne.results <- matrix(rnorm(2*ncol(out)), ncol=2) # Projecting the future state of each cell: projected <- embedVelocity(tsne.results, out) ```

velociraptor documentation built on Nov. 8, 2020, 4:58 p.m.