Skip to contents

Run WOT analysis

Usage

RunWOT(
  srt = NULL,
  assay_x = "RNA",
  layer_x = "counts",
  assay_y = c("spliced", "unspliced"),
  layer_y = "counts",
  adata = NULL,
  group_by = NULL,
  time_field = "Time",
  growth_iters = 3L,
  tmap_out = "tmaps/tmap_out",
  time_from = NULL,
  time_to = NULL,
  get_coupling = FALSE,
  recalculate = FALSE,
  palette = "Paired",
  palcolor = NULL,
  show_plot = TRUE,
  save = FALSE,
  dpi = 300,
  dirpath = "./",
  fileprefix = "",
  return_seurat = !is.null(srt)
)

Arguments

srt

A Seurat object.

assay_x

Assay to convert in the anndata object.

layer_x

Layer name for assay_x in the Seurat object.

assay_y

Assay to convert in the anndata object.

layer_y

Layer names for the assay_y in the Seurat object.

adata

An anndata object.

group_by

Variable to use for grouping cells in the Seurat object.

time_field

A character string specifying the column name in adata.obs or srt@meta.data that contains the time information.

growth_iters

A number of growth iterations to perform during the OT Model computation. Default is 3.

tmap_out

A character string specifying the path to store the computed transport maps.

time_from

The starting time point for trajectory and fate analysis.

time_to

The ending time point for trajectory and fate analysis. If not provided, only trajectory and fate analysis for the specified time_from will be performed.

get_coupling

Whether to compute and store the coupling matrix between the specified time_from and time_to. Default is FALSE.

recalculate

Whether to recalculate the transport maps even if they already exist at the specified tmap_out location. Default is FALSE.

palette

The palette to use for coloring cells.

palcolor

A vector of colors to use as the palette.

show_plot

Whether to show the plot.

save

Whether to save the plots.

dpi

The DPI (dots per inch) for saving the plot.

dirpath

The directory to save the plots.

fileprefix

The file prefix to use for the plots.

return_seurat

Whether to return a Seurat object instead of an anndata object. Default is TRUE.

See also

Examples

if (FALSE) { # \dontrun{
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
pancreas_sub <- RunSlingshot(
  pancreas_sub,
  group.by = "SubCellType",
  reduction = "UMAP"
)

print(range(pancreas_sub$Lineage1, na.rm = TRUE))

pancreas_sub <- RunWOT(
  pancreas_sub,
  group_by = "SubCellType",
  time_field = "Lineage1",
  time_from = min(pancreas_sub$Lineage1, na.rm = TRUE),
  time_to = max(pancreas_sub$Lineage1, na.rm = TRUE),
  get_coupling = TRUE,
  tmap_out = "tmaps/lineage_tmap"
)

pancreas_sub$Custom_Time <- sample(
  1:10,
  ncol(pancreas_sub),
  replace = TRUE
)
pancreas_sub <- RunWOT(
  pancreas_sub,
  group_by = "CellType",
  time_field = "Custom_Time",
  time_from = 1,
  time_to = 10,
  tmap_out = "tmaps/custom_tmap"
)
} # }