Skip to content

Commit

Permalink
enable zarr backend, fix #20.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Dec 9, 2024
1 parent 39611b7 commit 329978a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions snapatac2-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ keywords = ["single-cell", "biology"]
snapatac2-core = { workspace = true }
anndata = "0.6.1"
anndata-hdf5 = "0.5"
anndata-zarr = "0.1"
pyanndata = "0.5.1"
anyhow = "1.0"
bed-utils = "0.7.1"
Expand Down
12 changes: 12 additions & 0 deletions snapatac2-python/src/utils/anndata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,18 @@ macro_rules! with_anndata {
H5::NAME => {
$fun!(x.inner_ref::<H5>().deref())
}
anndata_zarr::Zarr::NAME => {
$fun!(x.inner_ref::<anndata_zarr::Zarr>().deref())
}
x => panic!("Unsupported backend: {}", x),
},
AnnDataLike::AnnDataSet(x) => match x.backend().as_str() {
H5::NAME => {
$fun!(x.inner_ref::<H5>().deref())
}
anndata_zarr::Zarr::NAME => {
$fun!(x.inner_ref::<anndata_zarr::Zarr>().deref())
}
x => panic!("Unsupported backend: {}", x),
},
AnnDataLike::PyAnnData(x) => {
Expand Down Expand Up @@ -264,12 +270,18 @@ macro_rules! with_rs_anndata {
H5::NAME => {
$fun!(x.inner_ref::<H5>().deref())
}
anndata_zarr::Zarr::NAME => {
$fun!(x.inner_ref::<anndata_zarr::Zarr>().deref())
}
x => panic!("Unsupported backend: {}", x),
},
RustAnnDataLike::AnnDataSet(x) => match x.backend().as_str() {
H5::NAME => {
$fun!(x.inner_ref::<H5>().deref())
}
anndata_zarr::Zarr::NAME => {
$fun!(x.inner_ref::<anndata_zarr::Zarr>().deref())
}
x => panic!("Unsupported backend: {}", x),
},
}
Expand Down

0 comments on commit 329978a

Please sign in to comment.