predict.SlingshotDataSet: Predict from a Slingshot model

Description Usage Arguments Details Value See Also Examples

Description

Map new observations onto simultaneous principal curves fitted by slingshot.

Usage

1
2
## S4 method for signature 'SlingshotDataSet'
predict(object, newdata = NULL)

Arguments

object

a SlingshotDataSet containing simultaneous principal curves to use for prediction.

newdata

a matrix or data frame of new points in the same reduced-dimensional space as the original input to slingshot (or getLineages).

Details

This function is a method for the generic function predict with signature(object = "SlingshotDataSet"). If no newdata argument is provided, it will return the original results, given by object.

Value

A SlingshotDataSet object based on the input newdata. New cells are treated as "unclustered" and the lineages and adjacency slots are intentionally left blank, to distinguish these results from the original slingshot output. The curves slot represents the projections of each new cell onto the existing curves. As with standard slingshot output, the lineage-specific pseudotimes and assignment weights can be accessed via the functions slingPseudotime and slingCurveWeights.

See Also

slingshot, SlingshotDataSet

Examples

1
2
3
4
5
6
7
data("slingshotExample")
rd <- slingshotExample$rd
cl <- slingshotExample$cl
sds <- slingshot(rd, cl, start.clus = '1')

x <- cbind(runif(100, min = -5, max = 10), runif(100, min = -4, max = 4))
predict(sds, x)

slingshot documentation built on Nov. 8, 2020, 5:51 p.m.