scverse / anndataR

AnnData interoperability in R
https://anndatar.data-intuitive.com
Other
58 stars 11 forks source link

An error when reading the data #195

Open HelloWorldLTY opened 4 days ago

HelloWorldLTY commented 4 days ago

Hi, I intend to convert a h5ad file to seurat data. The code is:

library(anndataR)

adata <- read_h5ad("./adata_net_cells.h5ad", to = "Seurat")

The bug is:

Warning message in .toseurat_check_obsvar_names(obj$obs_names, "obs_names"): “'obsnames' cannot have underscores ('') when converting to Seurat, replacing with dashes ('-')” Warning message in Matrix::sparseMatrix(j = indices, p = indptr, x = data, dims = shape, : “NAs introduced by coercion to integer range” Warning message in value[3L]: “Error reading element 'X' of type 'csr_matrix': 'p' must be a nondecreasing vector c(0, ...)”

And my current adata$X is null. I used the up-to-date version of anndataR. Thanks a lot.

lazappi commented 2 days ago

We are currently updating the Seurat conversion but it's still a work in progress https://github.com/scverse/anndataR/pull/183. If you are up for testing this more you could try using the branch from the PR. It would also be helpful if you could supply a test file for this issue (a small subset of the data that causes the error would be great).

rcannood commented 2 days ago

Hey Tianyu!

Indeed; the updated Seurat converter should be merged soon.

Could you install anndataR from this branch to see if that solves your issue?

install.packages("remotes")
remotes::install_github("scverse/anndataR@new_seurat")

Let me know whether the new approach works better for you.

rcannood commented 1 day ago

183 has been merged, so you can now also try installing the latest version of anndataR to see whether it solves your problem.