Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
19698c3
WIP
keller-mark May 6, 2024
5100a40
More tests passing
keller-mark May 6, 2024
4c9d01f
Fix df read bug
keller-mark May 6, 2024
eb8b69c
More tests passing after fixing zero-dimensional get bug in pizzarr
keller-mark May 7, 2024
58f5ce4
WIP: writing
keller-mark May 7, 2024
a15513a
Fix more tests
keller-mark May 7, 2024
1ef1be6
Zarr df writing
keller-mark May 7, 2024
77a7ee2
WIP: ZarrAnnData class
keller-mark May 7, 2024
27ce6c1
Tests passing
keller-mark May 7, 2024
8790715
Tests that compare h5ad to zarr
keller-mark May 8, 2024
bb0c6c7
Use Rarr to read full numeric arrays
keller-mark May 17, 2024
0456ecd
Fix bugs. Add test for from_SingleCellExperiment with Zarr
keller-mark Jun 18, 2024
acac772
Add a to_dense param to ZarrAnnData constructor. Add overwrite params…
keller-mark Jun 20, 2024
30316ed
Update
keller-mark Jun 20, 2024
c6b4d89
Backwards dense/sparse
keller-mark Jun 20, 2024
9cadc26
Merge branch 'keller-mark/zarr' of https://github.com/keller-mark/ann…
Artur-man Nov 1, 2024
a40a618
Merge branch 'keller-mark/zarr' into zarr
Artur-man Nov 1, 2024
1afd6eb
Simplify how obs and var names handled in ZarrAnnData (similar to #171)
Artur-man Nov 1, 2024
7f53049
update extdata and documentation
Artur-man Nov 1, 2024
3800f38
fix set/get zarr _index, update text example.zarr and update tests si…
Artur-man Nov 2, 2024
4a7d4c2
Merge pull request #5 from Artur-man/zarr
keller-mark Nov 5, 2024
c881bb9
Merge
keller-mark Nov 5, 2024
4a1bbde
Fix test
keller-mark Nov 5, 2024
15dfbde
Revert unnecessary changes
keller-mark Nov 5, 2024
438809a
Formatting
keller-mark Nov 5, 2024
2215402
Merge pull request #6 from keller-mark/keller-mark/zarr-2
keller-mark Nov 5, 2024
087ffb7
Add comments
keller-mark Nov 5, 2024
37d1ae5
Merge pull request #7 from keller-mark/keller-mark/comments
keller-mark Nov 5, 2024
357a8d7
remove unnecessary example zarr store
Artur-man Nov 6, 2024
d192e68
lintr and R check for zarr related utilities and functions, updated s…
Artur-man Nov 6, 2024
1e0e868
add pizzarr to Suggests and README
Artur-man Nov 6, 2024
fe07028
proj
Artur-man Mar 10, 2025
7ef94f8
Merge branch 'main' into keller-mark/zarr
Artur-man Mar 10, 2025
bf8e797
add keller-mark/pizzarr to Remotes
Artur-man Mar 10, 2025
5abcc75
zip example.zarr
Artur-man Mar 14, 2025
c5ec1c0
Merge branch 'main' into keller-mark/zarr
Artur-man Apr 10, 2025
84ad61f
Merge branch 'main' into keller-mark/zarr
Artur-man Apr 12, 2025
c3cb8aa
adapt read_zarr to Rarr
Artur-man Apr 12, 2025
63f102c
adapt write_zarr to Rarr
Artur-man Apr 12, 2025
a31ff9b
update to most recent anndataR
Artur-man Nov 10, 2025
e98f877
remove old scripts
Artur-man Nov 23, 2025
b0bfad4
update write_zarr
Artur-man Nov 23, 2025
7ebe151
initial update to ZarrAnnData
Artur-man Nov 23, 2025
96c5824
update ZarrAnnData, documentation, and implement read_zarr_rec_array
Artur-man Nov 23, 2025
c41a042
review read zarr helpers, and update tests
Artur-man Nov 23, 2025
370ac17
update read_zarr, read tests pass
Artur-man Nov 23, 2025
ddb5271
some updates for writing zarr
Artur-man Nov 23, 2025
755904d
update write_empty_zarr
Artur-man Nov 24, 2025
4290aed
remove pizzarr, update documentation
Artur-man Nov 24, 2025
e43c819
remove pizzarr from tests
Artur-man Nov 24, 2025
a98b58f
fix test-ZarrAnnData
Artur-man Nov 24, 2025
2d551d8
update ZarrAnnData to imitate HDF5AnnData
Artur-man Nov 24, 2025
42fcbb1
check redundant files, correct lines
Artur-man Nov 24, 2025
205dee4
update example_h5ad.py, add zarr and change to example_files.py
Artur-man Nov 24, 2025
f7638eb
add new test example
Artur-man Nov 25, 2025
acede3c
some linting changes
Artur-man Nov 26, 2025
07c92f7
remove read/write_zattrs since implemented in Rarr
Artur-man Nov 26, 2025
2b672ab
access read/write_zarr_attr
Artur-man Nov 26, 2025
555a634
Merge branch 'main' into keller-mark/zarr
Artur-man Dec 1, 2025
dcaf157
add some missing tests
Artur-man Dec 1, 2025
b10faa5
Merge branch 'main' into keller-mark/zarr
Artur-man Dec 4, 2025
e3d08f8
update readers, update tests
Artur-man Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ vignettes/data/*.h5ad
/doc/
/Meta/
/data/
>>>>>>> main
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Suggests:
knitr,
processx,
rhdf5 (>= 2.52.1),
Rarr,
rmarkdown,
S4Vectors,
Seurat,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ S3method(r_to_py,AbstractAnnData)
export(AnnData)
export(AnnDataView)
export(as_AnnData)
export(create_zarr)
export(create_zarr_group)
export(generate_dataset)
export(get_generator_types)
export(read_h5ad)
export(read_zarr)
export(write_h5ad)
export(write_zarr)
importFrom(Matrix,as.matrix)
importFrom(Matrix,sparseMatrix)
importFrom(Matrix,t)
Expand Down
22 changes: 22 additions & 0 deletions R/AbstractAnnData.R
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,28 @@
)
},
#' @description
#' Convert to an [`ZarrAnnData`]
#'
#' See [as_ZarrAnnData()] for more details on the conversion
#'
#' @param file See [as_ZarrAnnData()]
#' @param compression See [as_ZarrAnnData()]
#' @param mode See [as_ZarrAnnData()]
#'
#' @return An [`ZarrAnnData`] object
as_ZarrAnnData = function(
file,
compression = c("none", "gzip", "lzf"),
mode = c("w-", "r", "r+", "a", "w", "x")
) {

Check warning on line 303 in R/AbstractAnnData.R

View workflow job for this annotation

GitHub Actions / lint

file=R/AbstractAnnData.R,line=303,col=6,[indentation_linter] Indentation should be 4 spaces but is 6 spaces.
as_ZarrAnnData(
adata = self,
file = file,
compression = compression,
mode = mode
)
},
#' @description
#' Write the `AnnData` object to an H5AD file
#'
#' See [write_h5ad()] for details
Expand Down
47 changes: 47 additions & 0 deletions R/Rarr_utils.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#' create_zarr_group
#'
#' create zarr groups
#'
#' @param store the location of (zarr) store
#' @param name name of the group
#' @param version zarr version
#' @export
create_zarr_group <- function(store, name, version = "v2") {
split.name <- strsplit(name, split = "\\/")[[1]]
if (length(split.name) > 1) {
split.name <- vapply(seq_len(length(split.name)),

Check warning on line 12 in R/Rarr_utils.R

View workflow job for this annotation

GitHub Actions / lint

file=R/Rarr_utils.R,line=12,col=26,[seq_linter] Use seq_along(x) instead of seq_len(length(x)).
function(x) paste(split.name[seq_len(x)], collapse = "/"),
FUN.VALUE = character(1))
split.name <- rev(tail(split.name, 2))
if (!dir.exists(file.path(store, split.name[2])))
create_zarr_group(store = store, name = split.name[2])
}
dir.create(file.path(store, split.name[1]), showWarnings = FALSE)
switch(version,
v2 = {

Check warning on line 21 in R/Rarr_utils.R

View workflow job for this annotation

GitHub Actions / lint

file=R/Rarr_utils.R,line=21,col=9,[indentation_linter] Indentation should be 4 spaces but is 9 spaces.
write("{\"zarr_format\":2}", file = file.path(store, split.name[1], ".zgroup"))},

Check warning on line 22 in R/Rarr_utils.R

View workflow job for this annotation

GitHub Actions / lint

file=R/Rarr_utils.R,line=22,col=11,[indentation_linter] Hanging indent should be 15 spaces but is 11 spaces.
v3 = {

Check warning on line 23 in R/Rarr_utils.R

View workflow job for this annotation

GitHub Actions / lint

file=R/Rarr_utils.R,line=23,col=9,[indentation_linter] Indentation should be 4 spaces but is 9 spaces.
stop("Currently only zarr v2 is supported!")
},
stop("only zarr v2 is supported. Use version = 'v2'")
)
}

#' create_zarr
#'
#' create zarr store
#'
#' @param dir the location of zarr store
#' @param prefix prefix of the zarr store
#' @param version zarr version
#' @examples
#' dir.create(td <- tempfile())
#' zarr_name <- "test"
#' create_zarr(dir = td, prefix = "test")
#' dir.exists(file.path(td, "test.zarr"))
#' @export
create_zarr <- function(store, version = "v2") {
prefix <- basename(store)
dir <- gsub(paste0(prefix, "$"), "", store)
create_zarr_group(store = dir, name = prefix, version = version)
}

Check warning on line 47 in R/Rarr_utils.R

View workflow job for this annotation

GitHub Actions / lint

file=R/Rarr_utils.R,line=47,col=2,[trailing_blank_lines_linter] Add a terminal newline.
Loading
Loading