You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extended implementation of SeuratDisk for Seurat v5 with enhanced
support for HDF5-based single cell file formats. The h5Seurat file
format is specifically designed for the storage and analysis of
multi-modal single-cell and spatially-resolved expression experiments,
for example, from CITE-seq or 10X Visium technologies. It holds all
molecular information and associated metadata, including (for example)
nearest-neighbor graphs, dimensional reduction information, spatial
coordinates and image data, and cluster labels. We also support rapid
and on-disk conversion between h5Seurat and AnnData objects, with the
goal of enhancing interoperability between Seurat and Scanpy. This
version includes Seurat v5 Assay5 compatibility and improved spatial
data handling.
Installation
srtdisk is not currently available on CRAN. You can install it from
GitHub with:
if (!requireNamespace("remotes", quietly=TRUE)) {
install.packages("remotes")
}
remotes::install_github("mianaz/srtdisk")
What’s New in srtdisk (vs SeuratDisk)
Feature
SeuratDisk
srtdisk
Seurat v5 Assay5
Not supported
Full support
Visium Spatial
Not supported
Full support
Metadata
Partial
Numeric, categorical, boolean preserved
Direct Conversion
Two-step only
SeuratToH5AD() wrapper
h5ad Compatibility
Basic
Improved scanpy conventions
Quick Start
Seurat to h5ad (Recommended)
library(Seurat)
library(srtdisk)
library(SeuratData)
data("pbmc3k.final", package="pbmc3k.SeuratData")
pbmc<- UpdateSeuratObject(pbmc3k.final)
# One-step conversion using Convert()
Convert(pbmc, dest="pbmc3k.h5ad", overwrite=TRUE)
# Or use the convenience wrapper
SeuratToH5AD(pbmc, filename="pbmc3k.h5ad", overwrite=TRUE)
Seurat to Loom
Convert(pbmc, dest="pbmc3k.loom", overwrite=TRUE)
Seurat to h5Seurat
# Save as h5Seurat (can also use SaveH5Seurat() directly)
Convert(pbmc, dest="pbmc3k.h5Seurat", overwrite=TRUE)
# Note: Converts one assay at a time
library(SeuratData)
InstallData("cbmc")
data("cbmc", package="cbmc.SeuratData")
SeuratToH5AD(cbmc, filename="cbmc_rna.h5ad", assay="RNA", overwrite=TRUE)
SeuratToH5AD(cbmc, filename="cbmc_adt.h5ad", assay="ADT", overwrite=TRUE)
Visium Spatial Data Conversion
# Seurat Visium to h5ad
library(SeuratData)
InstallData("stxBrain")
brain<- UpdateSeuratObject(LoadData("stxBrain", type="anterior1"))
SeuratToH5AD(brain, filename="brain_spatial.h5ad", overwrite=TRUE)
# h5ad to Seurat (preserves spatial coordinates and images)
Convert("brain_spatial.h5ad", dest="h5seurat", overwrite=TRUE)
brain_rt<- LoadH5Seurat("brain_spatial.h5seurat")