Implement trajectory inference based on low-dimensional embeddings and clusters using Slingshot or other methods.

AddTrajectory(
  spe,
  use_cluster = "clusters",
  reduction = NULL,
  name = NULL,
  traject.method = "Slingshot",
  target.clus = NULL,
  start.clus = NULL,
  seed = 1,
  return.all.branch = FALSE,
  ...
)

Arguments

spe

A SpatialExperiment object.

use_cluster

a string, the name of clusters in the colData of the SpatialExperiment object used for trajectory inference.

reduction

a string, the name of reduction slot used in trajectory inference.

name

a string, the name of inferrend pseudotime, default as "PT".

traject.method

a string, the method used to conduct trajectory inference, default as 'Slingshot'.

target.clus

a string, the cluster to be used as end point.

start.clus

a string, the cluster to be used as the start point.

seed

a positive integer, the random seed.

return.all.branch

a logical value, whether return all inferred braches, default as FALSE implies only the merged pseudotime is returned.

...

other arguments pass to other method.

Value

return a revised SpatialExperiment object. The colData of the SpatialExperiment object adds a column named name (PT).