Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement zarr backend #91

Open
LouiseDck opened this issue Sep 15, 2023 · 7 comments · May be fixed by #190
Open

Implement zarr backend #91

LouiseDck opened this issue Sep 15, 2023 · 7 comments · May be fixed by #190
Milestone

Comments

@LouiseDck
Copy link
Collaborator

No description provided.

@ivirshup
Copy link
Member

ivirshup commented Sep 18, 2023

I think this will be blocked on R zarr libraries. AFAICT there isn't enough support in either pizzarr or rarr, as neither has string support last I checked.

@keller-mark
Copy link

I implemented the VLen-UTF8 support yesterday keller-mark/pizzarr#55 - Example with a remote anndata-zarr store here https://keller-mark.github.io/pizzarr/articles/remote-anndata.html - feel free to report any issues if you end up trying it out

@keller-mark
Copy link

keller-mark commented May 8, 2024

I have a preliminary implementation working on this branch (compare). Some of the functions emit warnings at the moment but most of the reading/writing tests are passing, as well as tests that compare values between h5ad and zarr

@Artur-man
Copy link

Artur-man commented Oct 31, 2024

Gave it a quick try, looks promising ... here

library(pizzarr)
library(Seurat)

adata <- AnnData(
  X = t(GetAssayData(object = pbmc_small, layer = "counts")),
  obs = [email protected],
  obs_names = colnames(pbmc_small),
  var_names = rownames(pbmc_small)
)
write_zarr(adata, store = "data/example.zarr", compression = "none")
> adata
[1] "layers" "obs"    "obsm"   "obsp"   "uns"    "var"    "varm"   "varp"   "X"  

Still has some problems reading though.

data <- read_zarr(path = "data/example.zarr/", to = "ZarrAnnData")
data$X
> data$X
80 x 230 sparse Matrix of class "dgCMatrix"
                                                                                                                                                   
[1,] . 1 . . . 1 . .  3 . . 1 . . . . . . . . . . 1 . . . 
> data
Error in if (!is.na(path)) { : argument is of length zero

@Artur-man
Copy link

Artur-man commented Nov 4, 2024

Are maintainers still interested in pushing ZarrAnnData to main ? We have a version where we test data types being properly wrote/read from/to zarr stores: keller-mark#5. (tests and functions updated to current version of anndataR)

This could be nice since some of us will be gathering to start building the R-native SpatialData package where Tables are still written using anndata and with reticulate/basilisk. https://github.com/HelenaLC/SpatialData/blob/45b166ac441933ff46432cd5f6a8368d041fffa7/R/read.R#L77-L92

@lazappi
Copy link
Collaborator

lazappi commented Nov 5, 2024

@rcannood can comment better on where things are currently at but I think in principal this is something we want. At the hackathon where we started {anndataR} we had discussed R {SpatialData} depending on it for AnnData related stuff and I think it's better for everyone to avoid duplicating work if possible.

@keller-mark keller-mark linked a pull request Nov 5, 2024 that will close this issue
@rcannood
Copy link
Collaborator

rcannood commented Nov 5, 2024

@keller-mark @Artur-man thanks for pinging me ! I'll take a look tonight 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants