Skip to contents

Run PHATE (Potential of Heat-diffusion for Affinity-based Trajectory Embedding)

Usage

RunPHATE(object, ...)

# S3 method for class 'Seurat'
RunPHATE(
  object,
  reduction = "pca",
  dims = NULL,
  features = NULL,
  assay = NULL,
  layer = "data",
  n_components = 2,
  knn = 5,
  decay = 40,
  n_landmark = 2000,
  t = "auto",
  gamma = 1,
  n_pca = 100,
  knn_dist = "euclidean",
  knn_max = NULL,
  t_max = 100,
  do_cluster = FALSE,
  n_clusters = "auto",
  max_clusters = 100,
  reduction.name = "phate",
  reduction.key = "PHATE_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

# Default S3 method
RunPHATE(
  object,
  assay = NULL,
  n_components = 2,
  knn = 5,
  decay = 40,
  n_landmark = 2000,
  t = "auto",
  gamma = 1,
  n_pca = 100,
  knn_dist = "euclidean",
  knn_max = NULL,
  t_max = 100,
  do_cluster = FALSE,
  n_clusters = "auto",
  max_clusters = 100,
  reduction.key = "PHATE_",
  verbose = TRUE,
  seed.use = 11,
  ...
)

Arguments

object

An object. This can be a Seurat object or a matrix-like object.

...

Additional arguments to be passed to phate.PHATE.

reduction

The reduction to be used. Default is "pca".

dims

The dimensions to be used. Default is NULL.

features

The features to be used. Default is NULL.

assay

The assay to be used. Default is NULL.

layer

The layer to be used. Default is "data".

n_components

The number of PHATE components. Default is 2.

knn

A number of nearest neighbors on which to build kernel. Default is 5.

decay

The sets decay rate of kernel tails. Default is 40.

n_landmark

A number of landmarks to use in fast PHATE. Default is 2000.

t

The power to which the diffusion operator is powered. This sets the level of diffusion. If "auto", t is selected according to the knee point in the Von Neumann Entropy of the diffusion operator. Default is "auto".

gamma

The informational distance constant between -1 and 1. gamma=1 gives the PHATE log potential, gamma=0 gives a square root potential. Default is 1.

n_pca

A number of principal components to use for calculating neighborhoods. For extremely large datasets, using n_pca < 20 allows neighborhoods to be calculated in roughly log(n_samples) time. Default is 100.

knn_dist

The distance metric for k-nearest neighbors. Recommended values: "euclidean", "cosine", "precomputed". Default is "euclidean".

knn_max

The maximum number of neighbors for which alpha decaying kernel is computed for each point. For very large datasets, setting knn_max to a small multiple of knn can speed up computation significantly. Default is NULL.

t_max

The maximum t to test. Default is 100.

do_cluster

Whether to perform clustering on the PHATE embeddings. Default is FALSE.

n_clusters

A number of clusters to be identified. Default is "auto".

max_clusters

The maximum number of clusters to test. Default is 100.

reduction.name

The name of the reduction to be stored in the Seurat object. Default is "phate".

reduction.key

The prefix for the column names of the PHATE embeddings. Default is "PHATE_".

verbose

Whether to print the message. Default is TRUE.

seed.use

The random seed to be used. Default is 11.

Examples

pancreas_sub <- Seurat::FindVariableFeatures(
  pancreas_sub,
  verbose = FALSE
)
features <- SeuratObject::VariableFeatures(pancreas_sub)
pancreas_sub <- RunPHATE(
  pancreas_sub,
  features = features
)
#> Warning: Layer ‘data’ is empty
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 't': subscript out of bounds
CellDimPlot(
  pancreas_sub,
  group.by = "CellType",
  reduction = "phate"
)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.