addEmbedding: addEmbedding

Description Usage Arguments Author(s) Examples

View source: R/utils.R

Description

Given a Seurat seurat and a data frame where the rows correspond to cells, in the same order as in the Seurat seurat, add two columns giving coordinates in a dimensionality reduced space.

Usage

1
addEmbedding(seurat, df, reduction = "tsne", dim1 = 1, dim2 = 2)

Arguments

seurat

Seurat object, where dimensionality reduction has been applied, i.e. (after applying Seurat::RunPCA() or Seurat::RunTSNE() to the object).

df

Data frame with at least one column, "Cell", giving the cell ID

reduction

String specifying the dimensionality reduction to use, retrieves t-SNE by default. This should match the names of the elements of the list seurat@dr, so it will typically be one of "pca" or "tsne". Default: "tsne"

Author(s)

Selin Jessa

Examples

1
2
3
4
df <- data.frame(Cell = rownames(pbmc@meta.data),
                 Cluster = pbmc@meta.data$res.1)

addEmbedding(pbmc, df, reduction = "tsne")

fungenomics/cytobox documentation built on Feb. 13, 2020, 10:51 a.m.