plot_trajectory: Visualize pseudotimes on locations.

View source: R/SpatialPCA_utilties.R

plot_trajectoryR Documentation

Visualize pseudotimes on locations.

Description

This function visualizes pseudotimes on locations.

Usage

plot_trajectory(
  pseudotime,
  location,
  clusterlabels,
  gridnum,
  color_in,
  pointsize = 5,
  arrowlength = 0.2,
  arrowsize = 1,
  textsize = 22
)

Arguments

pseudotime

A length n vector of pseudotime inferred from Slingshot.

location

A n by 2 data frame of spot locations.

clusterlabels

A vector of integers, the cluster labels for each spot

gridnum

Number of grids that evenly segment the whole tissue section.

color_in

A vector of character strings representing colors for each cluster.

pointsize

An integer, the point size of each spot

arrowlength

An integer, the length of arrows inside a grid between one spot with smallest pseudotime and largest pseudotime.

arrowsize

An integer, the size of arrows inside a grid between one spot with smallest pseudotime and largest pseudotime.

textsize

An integer, the size of text in the figure.

Value

A ggplot object.

Pseudotime

A ggplot object visualizing pseudotime on locations.

Arrowplot1

A ggplot object for arrows pointing from smallest pseudotime and largest pseudotime in each grid.

Arrowplot2

A ggplot object for arrows pointing from largest pseudotime and smallest pseudotime in each grid.

Arrowoverlay1

A ggplot object for arrows pointing from smallest pseudotime and largest pseudotime in each grid, overlayed on clustering plot.

Arrowoverlay2

A ggplot object for arrows pointing from largest pseudotime and smallest pseudotime in each grid, overlayed on clustering plot.


shangll123/SpatialPCA documentation built on April 17, 2024, 3:15 a.m.