Distances.tSNE: Calculation of cell-cell distances after t-SNE

View source: R/scDEED.R

Distances.tSNER Documentation

Calculation of cell-cell distances after t-SNE

Description

This function calculates the distances between cells in the post-embedding space for the original and permuted data

Usage

Distances.tSNE(pbmc,pbmc.permuted, K, perplexity_score = 40, pre_embedding = 'pca', check_duplicates = T, rerun = T)

Arguments

pbmc

The original Seurat object

pbmc_permuted

The permuted Seurat object, i.e. the output of Permuted.

K

The number of PCs to use

perplexity_score

The perplexity hyperparameter for t-SNE, default = 40.

pre_embedding

Which embedding use as input for t-SNE, default = 'pca'. If the user would like to use an alternate method, like ICA, they should perform that method for the original and permuted data, then specify the slot name here

check_duplicates

This is an argument to Seurat::RunTSNE. Default = T. If there are duplicates in the data, t-SNE will not proceed. If the user believes there are true biological duplicates in the data, they may change this setting to F.

rerun

This is a time-saving argument (default = T). If the user has already performed dimension reduction and would only like to check the results of that dimension reduction, then they can use rerun=F so scDEED does not re-run the embedding method on the data. In most cases, rerun=T because if you are optimizing hyperparameters, the function will need to rerun the embedding method.

Value

Returns a list with two distance matrices, (1) 'reduced_dim_distances': a matrix showing the distances between cells in the original post-embedding space (2) 'reduced_dim_distances_permuted': a matrix showing the distances between cells in the permuted post-embedding space


JSB-UCLA/scDED documentation built on Feb. 8, 2025, 11:12 a.m.