cluster_set_from_seurat: Transform a Seurat objects / FindAllMarkers result into a...

View source: R/convert.R

cluster_set_from_seuratR Documentation

Transform a Seurat objects / FindAllMarkers result into a ClusterSet.

Description

Transform a Seurat objects into a ClusterSet.

Usage

cluster_set_from_seurat(
  object = NULL,
  markers = NULL,
  which_slot = c("data", "counts", "sct")
)

Arguments

object

A Seurat object.

markers

A Seurat::FindAllMarkers() result or a named vector (clusters with gene_names as named).

which_slot

One of 'data', 'counts' or 'sct'. The slot to extract from the seurat object to perform clustering analysis. SCT is the recommended method from Seurat package when working with spatial transcriptomics data.

Examples

## From a scRNA-seq/Seurat object
library(SeuratObject)
library(Seurat)
data("pbmc_small", package="SeuratObject")
cs <- cluster_set_from_seurat(pbmc_small, Seurat::FindAllMarkers(pbmc_small))
plot_heatmap(cs)
plot_heatmap(cs)
plot_heatmap(cs[1,])
plot_heatmap(cs, cell_clusters = Seurat::Idents(pbmc_small))
plot_heatmap(cs[1,Idents(pbmc_small) == "0"], 
             cell_clusters = Seurat::Idents(pbmc_small), label_size = 6)
plot_profiles(cs, ident = Seurat::Idents(pbmc_small))

dputhier/dbfmcl documentation built on May 31, 2024, 8:57 a.m.