theislab / zellkonverter

Conversion between scRNA-seq objects
https://theislab.github.io/zellkonverter/
Other
145 stars 27 forks source link

Anndata read error: Converting layers #68

Closed AkilaRanjith closed 2 years ago

AkilaRanjith commented 2 years ago

Hello All, I am trying to convert h5ad file to sce object but i am ended up with the error message Here is my code library('reticulate') library('zellkonverter') sce <- readH5AD("C:/Users/akila20/Documents/Endothelial.h5ad")

ad <- anndata::read_h5ad('C:/Users/akila20/Documents/Endothelial.h5ad')

In both the ways i am not able to read the file. How to do this? Error message: Error in py_call_impl(callable, dots$args, dots$keywords) : AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /.

Thanks Akila

lazappi commented 2 years ago

Hi @AkilaRanjith

Can you please give some more details about the file you are trying to read and the version of {zellkonverter}? The error message above suggests that the version of Python anndata used to write the file is different to the version you are using to try and read it.

AkilaRanjith commented 2 years ago

Hi @AkilaRanjith

Can you please give some more details about the file you are trying to read and the version of {zellkonverter}? The error message above suggests that the version of Python anndata used to write the file is different to the version you are using to try and read it.

python anndata :0.8.0 zellkonverter version: 1.0.3

`Error in py_call_impl(callable, dots$args, dots$keywords) : 
  anndata._io.utils.AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /. 
11.
stop(structure(list(message = "anndata._io.utils.AnnDataReadError: Above error raised while reading key '/layers' of type <class 'h5py._hl.group.Group'> from /.\n", 
    call = py_call_impl(callable, dots$args, dots$keywords), 
    cppstack = structure(list(file = "", line = -1L, stack = c("/home/users/akila20/R/x86_64-pc-linux-gnu-library/4.0/reticulate/libs/reticulate.so(Rcpp::exception::exception(char const*, bool)+0x8b) [0x7f2b8394a3fb]", 
    "/home/users/akila20/R/x86_64-pc-linux-gnu-library/4.0/reticulate/libs/reticulate.so(Rcpp::stop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x25) [0x7f2b8393a152]",  ... 
10.
func_wrapper at utils.py#163
9.
wrapper at functools.py#840
8.
read_h5ad at h5ad.py#413
7.
anndata$read_h5ad(file, backed = if (backed) "r" else FALSE) 
6.
(function (file, backed = FALSE) 
{
    anndata <- import("anndata")
    adata <- anndata$read_h5ad(file, backed = if (backed)  ... 
5.
do.call(.basilisk.fun, .basilisk.args) 
4.
evalq(do.call(.basilisk.fun, .basilisk.args), envir = proc, enclos = proc) 
3.
evalq(do.call(.basilisk.fun, .basilisk.args), envir = proc, enclos = proc) 
2.
basiliskRun(env = anndata_env, fun = .H5ADreader, file = file, 
    backed = use_hdf5) 
1.
readH5AD("/scratch/groups/icobos/Akila/integration/harmony/subset/celltype/Endothelial.h5ad") 
lazappi commented 2 years ago

The version of {zellkonverter} you are using is several releases old. Please try with the latest release version (v1.6.3) or development version (v1.7.3).

lazappi commented 2 years ago

@AkilaRanjith Were you able to get this to work with a newer version?

AkilaRanjith commented 2 years ago

Yes, I am able to resolve the issue after installing the latest version. (check the image)

Thanks for following up.

On Wed, Aug 10, 2022 at 12:54 AM Luke Zappia @.***> wrote:

@AkilaRanjith https://github.com/AkilaRanjith Were you able to get this to work with a newer version?

— Reply to this email directly, view it on GitHub https://github.com/theislab/zellkonverter/issues/68#issuecomment-1210299287, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF6ZH3OQ4XPWDEM6E7P2YNDVYNN3JANCNFSM5ZSFQXUQ . You are receiving this because you were mentioned.Message ID: @.***>

-- Thanks with Regards S.Akila Parvathy Dharshini, Post-doctoral Research Fellow, Department of Pathology, Stanford School of Medicine