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) )
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, ...)
embedding to be used for projection
velocity result
neighborhood size (default=30)
pre-calculated kNN
named color vector for cell plotting
sigma to use in calculating transition probability from the eucledian distance (estimated automatically by default)
beta parameter used in calculation of transition probability (by default=1)
additional scaling factor for the arrows (default=1)
scale to use in calculating distances (default: 'log', also supported 'sqrt'
number of PCs to project the cells onto (to perform distance calculations in lower dimensions), default=NA which turns off PCA dimensional reduction
arrow line width
x axis label
y axis label
compensate for cell density variations in the embedding (default: TRUE)
number of top trajectories to trace back for a given cell (when show.trajectories=TRUE)
whether to reset plotting parameters (default=TRUE)
show detailed velocity projection for the specified cell
show trajectories for a specified cell
show top median diffusion trajectories
show all diffusion paths (messy)
show diffusion posterior of a given cell
show velocity projections on a grid
number of diffusion steps to take forward (default=10)
- optional custom distance (must include all of the cells that are intersecting between emb and vel)
shape parameter for smoothing median cell trajectories (default=1)
trasparency parameter to apply when showing cell colors
number of cores to use in calculations
number of trajectory clusters to show median paths for (when show.trajectories=TRUE)
extra parameters are passed to the plot() function
transition probability matrix