embedCurves {slingshot} | R Documentation |
This function takes the output of slingshot
(or
getCurves
) and attempts to embed the curves in a different
coordinate space than the one in which they were constructed. This should
be considered as a visualization tool, only.
embedCurves(x, newDimRed, ...) ## S4 method for signature 'SlingshotDataSet,matrix' embedCurves( x, newDimRed, shrink = NULL, stretch = NULL, approx_points = NULL, smoother = NULL, shrink.method = NULL, ... ) ## S4 method for signature 'SingleCellExperiment,matrix' embedCurves( x, newDimRed, shrink = NULL, stretch = NULL, approx_points = NULL, smoother = NULL, shrink.method = NULL, ... ) ## S4 method for signature 'SingleCellExperiment,character' embedCurves( x, newDimRed, shrink = NULL, stretch = NULL, approx_points = NULL, smoother = NULL, shrink.method = NULL, ... )
x |
an object containing |
newDimRed |
a matrix representing the new coordinate space in which to
embed the |
... |
Additional parameters to pass to scatter plot smoothing function,
|
shrink |
logical or numeric between 0 and 1, determines whether and how much to shrink branching lineages toward their average prior to the split. |
stretch |
numeric factor by which curves can be extrapolated beyond
endpoints. Default is |
approx_points |
numeric, whether curves should be approximated by a
fixed number of points. If |
smoother, |
choice of scatter plot smoother. Same as
|
shrink.method |
character denoting how to determine the appropriate
amount of shrinkage for a branching lineage. Accepted values are the same
as for |
Many of the same parameters are used here as in getCurves
.
This function attempts to translate curves from one reduced dimensional
space to another by predicting each dimension as a function of pseudotime
(ie. the new curve is determined by a series of scatterplot smoothers
predicting the coordinates in the new space as a function of pseudotime).
Because the pseudotime values are not changed, this amounts to a single
iteration of the iterative curve-fitting process used by getCurves
.
Note that non-linear dimensionality reduction techniques (such as tSNE and UMAP) may produce discontinuities not observed in other spaces. Use caution when embedding curves in these spaces.
a SlingshotDataSet
containing curves in the new space.
data("slingshotExample") rd <- slingshotExample$rd cl <- slingshotExample$cl sds <- slingshot(rd, cl) rd2 <- cbind(rd[,2] + rnorm(nrow(rd)), -rd[,1] + rnorm(nrow(rd))) sds.new <- embedCurves(sds, rd2) sds.new plot(rd2, col = cl, asp = 1) lines(sds.new, lwd = 3)