adata_to_srt: Convert an anndata object to a seurat object using reticulate

View source: R/SCP-analysis.R

adata_to_srtR Documentation

Convert an anndata object to a seurat object using reticulate

Description

Convert an anndata object to a seurat object using reticulate

Usage

adata_to_srt(adata)

Arguments

adata

a connected python anndata object.

Examples

data("pancreas_sub")
adata <- srt_to_adata(pancreas_sub)
adata <- RunPAGA(adata = adata, group_by = "SubCellType", linear_reduction = "PCA", nonlinear_reduction = "UMAP")
srt <- adata_to_srt(adata)
srt

### Or convert a h5ad file to Seurat object
# library(reticulate)
# check_Python("scanpy")
# sc <- import("scanpy")
# adata <- sc$read_h5ad("pancreas.h5ad")
# srt <- adata_to_srt(adata)
# srt

zh542370159/SCP documentation built on Nov. 22, 2023, 2:34 a.m.