cellgeni / sceasy

A package to help convert different single-cell data formats to each other
GNU General Public License v3.0
374 stars 54 forks source link

Anndata to Seurat Object, Error in match #54

Open tomthun opened 2 years ago

tomthun commented 2 years ago

Hello,

i have a relativly big anndata Object (8gb, created with version 0.8.0). Which i want to convert with convertFormat("adata_complete_selfdefinedNA.h5ad", from="anndata", to="seurat", outFile='adata_complete.rds')

after several minutes i get following error:

X -> counts
Error in match(x, table, nomatch = 0L) : 
  'match' requires vector arguments

Is there any problem with the data so that the function cannot convert it?

YK0992 commented 2 years ago

Hi @tomthun

I encountered the same problem. But I got it fixed when I changed the compression format to gzip. You can try to convert them in scanpy:

import anndata
adata = anndata.read("deprez19_restricted.processed.h5ad")
adata.write("deprez19_restricted.processed.gzip.h5ad", compression="gzip")

Then convert this gzip h5ad file in sceasy.

Parul-Kudtarkar commented 2 years ago

@tomthun were you able to resolve the issue? I am getting same error. h5ad file compression is not resolving the error. Thanks!

tomthun commented 2 years ago

https://github.com/mojaveazure/seurat-disk/issues/109#issuecomment-1115959604 Have a look at that. This is how I currently transform my anndata to seurat object.

JasonLiZhou commented 1 year ago

Hi, I got the same issue, and after digging into the source code, I think there exists a bug in line 442 of the source code "functions.R" :

image

The code inside the highlight box should be py_to_r(ad$obsm)[[x]].

I hope this will help.