Learn R Programming

APackOfTheClones (version 1.2.1)

getReductionCentroids: Calculate seurat cluster centroids based on a Dimensional reduction

Description

[Stable]

Utility function to calculate the physical xy coordinates of each seurat cluster based on a dimensional reduction already present in the object. The results are returned in a list with the length of the number of distinct seurat clusters based on the seurat_obj meta.data.

Usage

getReductionCentroids(seurat_obj, reduction)

Value

A list of the length of the number of distinct clusters in the seurat object metadata, where each element of the list is a numeric vector of length 2, with the numbers corresponding to the x and y coordinate respectively of the seurat cluster with the corresponding index.

Arguments

seurat_obj

input seurat object with the dimensional reduction of choice already present, and seurat clusters computed.

reduction

character. The reduction that the centroid calculation should be based on.

Examples

Run this code
data("combined_pbmc")
getReductionCentroids(combined_pbmc, reduction = "umap")

Run the code above in your browser using DataLab