RunPHATE: Run PHATE

View source: R/Phate.R

RunPHATER Documentation

Run PHATE

Description

PHATE is a data reduction method specifically designed for visualizing **high** dimensional data in **low** dimensional spaces. To run, you must first install the 'phate' python package (e.g. via pip install phate). Details on this package can be found here: https://github.com/KrishnaswamyLab/PHATE. For a more in depth discussion of the mathematics underlying PHATE, see the bioRxiv paper here: https://www.biorxiv.org/content/early/2017/12/01/120378.

Usage

RunPHATE(
  object,
  dims = NULL,
  source = "pca",
  features = NULL,
  assay = "RNA",
  n.components = 2L,
  knn = 5L,
  decay = 40L,
  n.landmark = 2000L,
  gamma = 1,
  t = "auto",
  mds.solver = "sgd",
  knn.dist.method = "euclidean",
  mds.method = "metric",
  mds.dist.method = "euclidean",
  t.max = 100,
  npca = 100,
  plot.optimal.t = FALSE,
  verbose = 1,
  n.jobs = 1,
  seed.use = NA,
  reduction.name = "phate",
  reduction.key = "PHATE_",
  k = NULL,
  alpha = NULL,
  ...
)

Arguments

object

The seurat object

dims

Which dimensions to use as input features, used only if features is NULL

source

This can either be PCA or counts (meaning it will be run on the raw counts)

features

If set, run PHATE on this subset of features (instead of running on a set of reduced dimensions). Not set (NULL) by default; dims must be NULL to run on features

assay

Assay to pull data for when using features

n.components

Total number of dimensions to embed in PHATE.

knn

int, optional, default: 5 number of nearest neighbors on which to build kernel

decay

int, optional, default: 40 sets decay rate of kernel tails. If NA, alpha decaying kernel is not used

n.landmark

int, optional, default: 2000 number of landmarks to use in fast PHATE

gamma

float, optional, default: 1 Informational distance constant between -1 and 1. 'gamma=1' gives the PHATE log potential, 'gamma=0' gives a square root potential.

t

int, optional, default: 'auto' power to which the diffusion operator is powered sets the level of diffusion

mds.solver

'sgd', 'smacof', optional, default: 'sgd' which solver to use for metric MDS. SGD is substantially faster, but produces slightly less optimal results. Note that SMACOF was used for all figures in the PHATE paper.

knn.dist.method

string, optional, default: 'euclidean'. recommended values: 'euclidean', 'cosine', 'precomputed' Any metric from 'scipy.spatial.distance' can be used distance metric for building kNN graph. If 'precomputed', 'data' should be an n_samples x n_samples distance or affinity matrix. Distance matrices are assumed to have zeros down the diagonal, while affinity matrices are assumed to have non-zero values down the diagonal. This is detected automatically using 'data[0,0]'. You can override this detection with ‘knn.dist.method=’precomputed_distance'' or ‘knn.dist.method=’precomputed_affinity''.

mds.method

string, optional, default: 'metric' choose from 'classic', 'metric', and 'nonmetric' which MDS algorithm is used for dimensionality reduction

mds.dist.method

string, optional, default: 'euclidean' recommended values: 'euclidean' and 'cosine'

t.max

int, optional, default: 100. Maximum value of t to test for automatic t selection.

npca

int, optional, default: 100 Number of principal components to use for calculating neighborhoods. For extremely large datasets, using n_pca < 20 allows neighborhoods to be calculated in log(n_samples) time.

plot.optimal.t

boolean, optional, default: FALSE If TRUE, produce a plot showing the Von Neumann Entropy curve for automatic t selection.

verbose

'int' or 'boolean', optional (default : 1) If 'TRUE' or '> 0', print verbose updates.

n.jobs

'int', optional (default: 1) The number of jobs to use for the computation. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n.cpus + 1 + n.jobs) are used. Thus for n_jobs = -2, all CPUs but one are used

seed.use

int or 'NA', random state (default: 'NA')

reduction.name

dimensional reduction name, specifies the position in the object$dr list. phate by default

reduction.key

dimensional reduction key, specifies the string before the number for the dimension names. PHATE_ by default

k

Deprecated. Use 'knn'.

alpha

Deprecated. Use 'decay'.

...

Extra parameters passed to phateR::phate

Value

Returns a Seurat object containing a PHATE representation

References

Moon K, van Dijk D, Wang Z, Gigante S, Burkhardt D, Chen W, van den Elzen A, Hirn M, Coifman R, Ivanova N, Wolf G and Krishnaswamy S (2017). "Visualizing Transitions and Structure for High Dimensional Data Exploration." _bioRxiv_, pp. 120378. doi: 10.1101/120378 (URL: http://doi.org/10.1101/120378), <URL: https://www.biorxiv.org/content/early/2017/12/01/120378>.


bimberlabinternal/CellMembrane documentation built on Dec. 25, 2024, 8:10 a.m.