forked from velocyto-team/velocyto.R
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow.velocity.on.embedding.eu.Rd
86 lines (58 loc) · 3.7 KB
/
show.velocity.on.embedding.eu.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/momentum_routines.R
\name{show.velocity.on.embedding.eu}
\alias{show.velocity.on.embedding.eu}
\title{Visualize RNA velocities on an existing embedding using Euclidean-based transition probability matrix within the kNN graph.}
\usage{
show.velocity.on.embedding.eu(emb, vel, n = 30, embedding.knn = TRUE,
cell.colors = NULL, sigma = NA, beta = 1, arrow.scale = 1,
scale = "log", nPcs = NA, arrow.lwd = 1, xlab = "", ylab = "",
control.for.neighborhood.density = TRUE, ntop.trajectories = 1,
do.par = T, show.cell.arrows = NULL, show.cell.trajectories = NULL,
show.trajectories = FALSE, show.all.trajectories = FALSE,
show.cell.diffusion.posterior = NULL, show.grid.flow = FALSE,
diffusion.steps = 10, cell.dist = NULL,
trajectory.spline.shape = 1, cell.color.alpha = 0.5,
n.cores = defaultNCores(), n.trajectory.clusters = 10, ...)
}
\arguments{
\item{emb}{embedding to be used for projection}
\item{vel}{velocity result}
\item{n}{neighborhood size (default=30)}
\item{embedding.knn}{pre-calculated kNN}
\item{cell.colors}{named color vector for cell plotting}
\item{sigma}{sigma to use in calculating transition probability from the eucledian distance (estimated automatically by default)}
\item{beta}{beta parameter used in calculation of transition probability (by default=1)}
\item{arrow.scale}{additional scaling factor for the arrows (default=1)}
\item{scale}{scale to use in calculating distances (default: 'log', also supported 'sqrt'}
\item{nPcs}{number of PCs to project the cells onto (to perform distance calculations in lower dimensions), default=NA which turns off PCA dimensional reduction}
\item{arrow.lwd}{arrow line width}
\item{xlab}{x axis label}
\item{ylab}{y axis label}
\item{control.for.neighborhood.density}{compensate for cell density variations in the embedding (default: TRUE)}
\item{ntop.trajectories}{number of top trajectories to trace back for a given cell (when show.trajectories=TRUE)}
\item{do.par}{whether to reset plotting parameters (default=TRUE)}
\item{show.cell.arrows}{show detailed velocity projection for the specified cell}
\item{show.cell.trajectories}{show trajectories for a specified cell}
\item{show.trajectories}{show top median diffusion trajectories}
\item{show.all.trajectories}{show all diffusion paths (messy)}
\item{show.cell.diffusion.posterior}{show diffusion posterior of a given cell}
\item{show.grid.flow}{show velocity projections on a grid}
\item{diffusion.steps}{number of diffusion steps to take forward (default=10)}
\item{cell.dist}{- optional custom distance (must include all of the cells that are intersecting between emb and vel)}
\item{trajectory.spline.shape}{shape parameter for smoothing median cell trajectories (default=1)}
\item{cell.color.alpha}{trasparency parameter to apply when showing cell colors}
\item{n.cores}{number of cores to use in calculations}
\item{n.trajectory.clusters}{number of trajectory clusters to show median paths for (when show.trajectories=TRUE)}
\item{...}{extra parameters are passed to the plot() function}
}
\value{
transition probability matrix
}
\description{
based on Euclidean distance of the extrapolated cell to others
The direction of the arrow is towards n closest neighbors. The magnitude of the arrow is determined by the cosine projection of the velocity on to the chosen direction
n=1 will only show arrows for cells that end up being projected closer to some other cell than to the original position
n=k (k>1) will show an average direction
Given an expression distance between cells d, and ratio of extrapolated to current expression distances between cells f, the transition probability is calculated as exp(- (d*(f^beta))^2/(2*sigma^2) )
}