This function will get a supervised trajectory from an ArchRProject (see addTrajectory), get data from a desired matrix, and smooth each value across the input trajectory.

getTrajectory(
  ArchRProj = NULL,
  name = "Trajectory",
  useMatrix = "GeneScoreMatrix",
  groupEvery = 1,
  log2Norm = TRUE,
  scaleTo = 10000,
  smoothWindow = 11,
  threads = getArchRThreads()
)

Arguments

ArchRProj

An ArchRProject object.

name

A string indicating the name of the fitted trajectory in cellColData to retrieve from the given ArchRProject.

useMatrix

The name of the data matrix from the ArrowFiles to get numerical values for each cell from. Recommended matrices are "GeneScoreMatrix", "PeakMatrix", or "MotifMatrix".

groupEvery

The number of sequential percentiles to group together when generating a trajectory. This is similar to smoothing via a non-overlapping sliding window across pseudo-time. If groupEvery = 2, the values for percentiles 1 and 2, 3 and 4, 5 and 6, etc. will be grouped together.

log2Norm

A boolean value that indicates whether the summarized trajectory matrix should be log2 transformed. If you are using a "MotifMatrix" set to FALSE.

scaleTo

Once the sequential trajectory matrix is created, each column in that matrix will be normalized to a column sum indicated by scaleTo. Setting this to NULL will prevent any normalization and should be done in certain circumstances (for ex. if you are using a "MotifMatrix").

smoothWindow

An integer value indicating the smoothing window in size (relaive to groupEvery) for the sequential trajectory matrix to better reveal temporal dynamics.

threads

The number of threads to be used for parallel computing.