scRNAseq analysis - h5ad file conversion to Seurat format
1
0
Entering edit mode
2.6 years ago
isd1989 • 0

Hi all. I have a single .h5ad file that contains scRNAseq data from several samples. I would like to convert it so that I can open it in Seurat (I am comfortable with R, but not with Python). I have found the following R package that is supposed to do it (SeuratDisk). The process is as follows:

library(SeuratDisk)
library(Seurat)

Convert("RNA_seq_dataset.h5ad", ".h5seurat", overwrite= TRUE)

The output from this chunk is:

Unknown file type: h5ad'assay' not set, setting to 'RNA'Creating h5Seurat file for version 3.1.5.9900
Adding X as scale.data
Adding raw/X as data
Adding raw/X as counts
Adding meta.features from raw/var
Adding X_pca as cell embeddings for pca
Adding X_umap as cell embeddings for umap

Then, when I try to read the converted file, things go wrong:

seuratObject <- LoadH5Seurat("RNA_seq_dataset.h5seurat")
Validating h5Seurat file
Error: Cannot find dataset with cell names

Has anyone else analysed a .h5ad file in Seurat, and if so, how did you do it? Thank you!

conversion scrnaseq scanpy seurat seuratdisk • 7.7k views
ADD COMMENT
0
Entering edit mode

Maybe try assays="SCT"? - here is the documentation for reference

ADD REPLY
0
Entering edit mode
2.3 years ago
ZhangHao ▴ 10

You can try to use the adata_to_srt function of SCP package (https://github.com/zhanghao-njmu/SCP)

library(SCP)
library(reticulate)
sc <- import("scanpy")
adata <- sc$read_h5ad("pancreas.h5ad")
srt <- adata_to_srt(adata)
srt
ADD COMMENT

Login before adding your answer.

Traffic: 1665 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6