Replies: 5 comments 6 replies
-
Hi @rkulchar, Moving answer to your other question here in terms of how to transfer spatial assays to anndata. The best advice I can give is to try and understand the how spatial data is stored in anndata and how that is properly linked to gene expression data from spatial assays. If you (or someone else) can figure that out then we could probably modify scCustomize's Best, |
Beta Was this translation helpful? Give feedback.
-
Also as this isn't error/bug with Seurat (and SeuratDisk is no longer actively supported) I'm going to move this issue to discussion section. Best, |
Beta Was this translation helpful? Give feedback.
-
Thanks, Sam. I will try to figure this out... |
Beta Was this translation helpful? Give feedback.
-
No worries...was able to map the data for now by just extracting layers needed...but this still would be such a helpful tool if can do :) |
Beta Was this translation helpful? Give feedback.
-
I have used the latest version of scCustomize `> as.anndata(x = macs, file_path = "data/", file_name = "pbmc_anndata.h5ad", assay = "SCT", main_layer = "data", other_layers = c("counts"), transer_dimreduc = TRUE, verbose = TRUE) • Checking Seurat object validity `adata = sc.read("../data/pbmc_anndata.h5ad") TypeError: Cannot convert numpy.ndarray to numpy.ndarray orig.ident contains the mane of my samples and is a character. |
Beta Was this translation helpful? Give feedback.
-
Hi -- thanks for your help. I began this question on #8635 but am still having issues. I am currently working with single cell (scRNAseq) and spatial transcriptomics (Xenium) datasets in Seurat v5 and was running into some issues when I try to export the h5 object to perform further analyses in Python. I was wondering if you may have any suggestions in this regard.
I get this error when I try this: > as.anndata(x = st, file_path = "/home/ICI", file_name = "st_anndata.h5ad")
• Checking Seurat object validity & Extracting Data
Error in as.anndata():
! main_layer must be one of counts.1, counts.2, counts.3, counts.4, data.1, data.2, data.3, and data.4
Run rlang::last_trace() to see where the error occurred.
My st structure is this:
An object of class Seurat
541 features across 280758 samples within 4 assays
Active assay: Xenium (280 features, 280 variable features)
9 layers present: counts.1, counts.2, counts.3, counts.4, data.1, data.2, data.3, data.4, scale.data
3 other assays present: BlankCodeword, ControlCodeword, ControlProbe
2 dimensional reductions calculated: pca, umap
4 spatial fields of view present: fov fov.2 fov.3 fov.4
Beta Was this translation helpful? Give feedback.
All reactions