This function will plot a trajectory that was created onto an embedding.

plotTrajectory(
  ArchRProj = NULL,
  embedding = "UMAP",
  trajectory = "Trajectory",
  colorBy = "colData",
  name = "Trajectory",
  log2Norm = NULL,
  imputeWeights = if (!grepl("coldata", tolower(colorBy[1])))
    getImputeWeights(ArchRProj),
  pal = NULL,
  size = 0.2,
  rastr = TRUE,
  quantCut = c(0.01, 0.99),
  quantHex = 0.5,
  discreteSet = NULL,
  continuousSet = NULL,
  randomize = TRUE,
  keepAxis = FALSE,
  baseSize = 6,
  addArrow = TRUE,
  plotAs = NULL,
  smoothWindow = 5,
  logFile = createLogFile("plotTrajectory"),
  ...
)

Arguments

ArchRProj

An ArchRProject object.

embedding

The name of the embedding to use to visualize the given trajectory. See addEmbedding() for more information.

trajectory

The column name in cellColData that refers the trajectory to be plotted. See addTrajectory() for more information.

colorBy

A string indicating whether points in the plot should be colored by a column in cellColData ("cellColData") or by a data matrix in the associated ArrowFiles (i.e. "GeneScoreMatrix", "MotifMatrix", "PeakMatrix").

name

The name of the column in cellColData or the featureName/rowname of the data matrix to be used for plotting. For example if colorBy is "cellColData" then name refers to a column name in the cellcoldata (see getCellcoldata()). If colorBy is "GeneScoreMatrix" then name refers to a gene name which can be listed by getFeatures(ArchRProj, useMatrix = "GeneScoreMatrix").

log2Norm

A boolean value indicating whether a log2 transformation should be performed on the values from colorBy.

imputeWeights

The weights to be used for imputing numerical values for each cell as a linear combination of other cells' values. See addImputationWeights() and getImutationWeights() for more information.

pal

The name of a custom palette from ArchRPalettes to use for coloring cells.

size

A number indicating the size of the points to plot if plotAs is set to "points".

rastr

A boolean value that indicates whether the plot should be rasterized. This does not rasterize lines and labels, just the internal portions of the plot.

quantCut

If this is not NULL, a quantile cut is performed to threshold the top and bottom of the distribution of numerical values. This prevents skewed color scales caused by strong outliers. The format of this should be c(x,y) where x is the lower threshold and y is the upper threshold. For example, quantileCut = c(0.025,0.975) will take the 2.5th percentile and 97.5 percentile of values and set values below/above to the value of the 2.5th and 97.5th percentile values respectively.

quantHex

The numeric xth quantile of all dots within each individual hexagon will determine the numerical value for coloring to be displayed. This occurs when (i) plotAs is set to "hex" or (ii) plotAs is set to NULL and the values of colorBy are numeric.

discreteSet

The name of a discrete palette from ArchRPalettes for visualizing colorBy in the embedding if a discrete color set is desired.

continuousSet

The name of a continuous palette from ArchRPalettes for visualizing colorBy in the embedding if a continuous color set is desired.

randomize

A boolean value that indicates whether to randomize points prior to plotting to prevent cells from one cluster being present at the front of the plot.

keepAxis

A boolean value that indicates whether the x and y axis ticks and labels should be plotted.

baseSize

The base font size to use in the plot.

addArrow

A boolean value that indicates whether to add a smoothed arrow in the embedding based on the aligned trajectory.

plotAs

A string that indicates whether points ("points") should be plotted or a hexplot ("hex") should be plotted. By default if colorBy is numeric, then plotAs is set to "hex".

smoothWindow

An integer value indicating the smoothing window for creating inferred Arrow overlay on to embedding.

logFile

The path to a file to be used for logging ArchR output.

...

Additional parameters to pass to ggPoint() or ggHex().