diff --git a/DESCRIPTION b/DESCRIPTION index 6aba6b5..ab3d932 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: zellkonverter Title: Conversion Between scRNA-seq Objects -Version: 1.11.3 -Date: 2023-10-02 +Version: 1.11.4 +Date: 2023-10-16 Authors@R: c(person(given = "Luke", family = "Zappia", diff --git a/NEWS.md b/NEWS.md index df726ea..e11b7ab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ * Bioconductor 3.18, October 2023 +## zellkonverter 1.11.4 (2023-10-16) + +* Add environment for **anndata** v0.10.2 + ## zellkonverter 1.11.3 (2023-10-2) * Add environment for **anndata** v0.9.2 diff --git a/R/basilisk.R b/R/basilisk.R index 808273c..eb43c9c 100644 --- a/R/basilisk.R +++ b/R/basilisk.R @@ -61,7 +61,7 @@ NULL #' version strings. #' #' @export -.AnnDataVersions <- c("0.9.2", "0.8.0", "0.7.6") +.AnnDataVersions <- c("0.10.2", "0.9.2", "0.8.0", "0.7.6") #' @rdname AnnData-Environment #' @@ -114,6 +114,17 @@ AnnDataDependencies <- function(version = .AnnDataVersions) { "pandas==2.1.1", "python==3.11.5", "scipy==1.11.3" + ), + "0.10.2" = c( + "anndata==0.10.2", + "h5py==3.10.0", + "hdf5==1.14.2", + "natsort==8.4.0", + "numpy==1.26.0", + "packaging==23.2", + "pandas==2.1.1", + "python==3.11.5", + "scipy==1.11.3" ) ) } @@ -143,3 +154,4 @@ zellkonverterAnnDataEnv <- function(version = .AnnDataVersions) { anndata_env_0.7.6 <- zellkonverterAnnDataEnv(version = "0.7.6") anndata_env_0.8.0 <- zellkonverterAnnDataEnv(version = "0.8.0") anndata_env_0.9.2 <- zellkonverterAnnDataEnv(version = "0.9.2") +anndata_env_0.9.2 <- zellkonverterAnnDataEnv(version = "0.10.2") diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 1d4e580..eb084c5 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -5,8 +5,8 @@ \subsection{Major changes}{ \itemize{ \item{ - Add an environment for \bold{anndata} v0.9.2. This is now the default - envrionment for the Python reader/writer. + Add environments for \bold{anndata} v0.9.2 and v0.10.2. Version 0.10.20 is + now the default envrionment for the Python reader/writer. } }} \subsection{Minor changes}{ diff --git a/tests/testthat/test-read.R b/tests/testthat/test-read.R index 8c77a05..a89f298 100644 --- a/tests/testthat/test-read.R +++ b/tests/testthat/test-read.R @@ -11,6 +11,14 @@ test_that("Reading H5AD works", { expect_identical(colnames(colData(sce)), "cell_type") }) +test_that("Reading H5AD works with version 0.9.2", { + sce <- readH5AD(file, version = "0.9.2") + expect_s4_class(sce, "SingleCellExperiment") + + expect_identical(assayNames(sce), "X") + expect_identical(colnames(colData(sce)), "cell_type") +}) + test_that("Reading H5AD works with version 0.8.0", { sce <- readH5AD(file, version = "0.8.0") expect_s4_class(sce, "SingleCellExperiment") diff --git a/tests/testthat/test-write.R b/tests/testthat/test-write.R index 3b3c606..7a8bec0 100644 --- a/tests/testthat/test-write.R +++ b/tests/testthat/test-write.R @@ -35,6 +35,37 @@ test_that("writeH5AD works as expected", { expect_identical(col_data, colData(sce)) }) +test_that("writeH5AD works as expected with version 0.9.2", { + temp <- tempfile(fileext = ".h5ad") + writeH5AD(sce, temp, version = "0.9.2") + expect_true(file.exists(temp)) + + # Reading it back out again. Hopefully we didn't lose anything important. + out <- readH5AD(temp, version = "0.9.2") + + expect_identical(dimnames(out), dimnames(sce)) + expect_equal(assay(out), assay(sce)) + expect_identical(reducedDims(out), reducedDims(sce)) + + # Need to coerce the factors back to strings. + row_data <- rowData(out) + for (i in seq_len(ncol(row_data))) { + if (is.factor(row_data[[i]])) { + row_data[[i]] <- as.character(row_data[[i]]) + } + } + expect_identical(row_data, rowData(sce)) + + col_data <- colData(out) + for (i in seq_len(ncol(col_data))) { + if (is.factor(col_data[[i]])) { + col_data[[i]] <- as.character(col_data[[i]]) + } + } + names(col_data) <- names(colData(sce)) + expect_identical(col_data, colData(sce)) +}) + test_that("writeH5AD works as expected with version 0.8.0", { temp <- tempfile(fileext = ".h5ad") writeH5AD(sce, temp, version = "0.8.0")