TotalDistance: Calculates the total distance between groups for a list of...

Description Usage Arguments Details Value

View source: R/distance.R

Description

The total distance is the distance between every individual cell in each group. This includes every cell within it's own group.

Usage

1
2
3
TotalDistance(seurat_object, group, reduction = "pca", dims = 1:30,
  distance = "euclidian", split_by = NULL, output = "seurat",
  method = "all", parallel = FALSE)

Arguments

seurat_object

A seurat object

group

Seurat Categories or groups for which the distances between are calculated. Cell wise data.

reduction

Dimensionality reduction data to use

dims

Which dimensions to use

distance

Point to point distance to use. Options are "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski"

split_by

Second seurat category to split the calculations over.

output

Output type. Default is "seurat". Options are "seurat" (Seurat S4 object), "list" (List of tables by split_by), "seurat_list" (List of Seurat objects). Seurat objects returned have the distance data stored internally.

method

The number of cells in group 1 to test. This is done because calculating the total distance is often very computationally expensive. And by reducing the number of cells in group one can give an approximation of the final result without having to test all cells. Options are "one" ( calculate for one cell in group 1), "all" (calculate for all cells)

parallel

It is possible to run this process in parallel across multiple computers using BiocParallel. TRUE will use and FALSE will not. If this is set to TRUE then it will not be able to print out progress.

Details

The total distance calculates the distance to every other cell in group 1 to every other cell in group 1 as well as from every cell in group 1 to every other cell in group 2. Subsequently this creates a distribution of distances for both group 1 and group 2. This means that while this method cannot result in a single number distance result it is useful for plotting the distances between the two groups.

It is possible to change the method to only measure the linkage for one cell instead of all the cells. This could be chosen in order to speed up the calculation process. If "one" is chosen then only one cell in group 1 will be used. This cell is chosen because it is furthest away from the mean of group 2.

Value

List of data frames containing distances between groups per row


sbrn3/disscat documentation built on Dec. 12, 2019, 7:54 a.m.