diff --git a/DESCRIPTION b/DESCRIPTION index bb1da00..7c64d10 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: zellkonverter Title: Conversion Between scRNA-seq Objects -Version: 1.15.2 -Date: 2024-10-02 +Version: 1.15.3 +Date: 2024-10-04 Authors@R: c( person("Luke", "Zappia", , "luke@lazappi.id.au", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-7744-8565")), diff --git a/NEWS.md b/NEWS.md index 4731c10..2a428d9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,10 @@ * Bioconductor 3.20, October 2024 +## zellkonverter 1.15.3 (2024-10-04) + +* Correctly assign levels to factors in R reader (Fixes #122) + ## zellkonverter 1.15.2 (2024-10-02) * Correctly set `filepath` in the R reader with reading `adata.raw` with `use_hdf5 = TRUE` (PR #124 @GabrielHoffman, Fixes #123) diff --git a/R/read.R b/R/read.R index 217216e..36537b7 100644 --- a/R/read.R +++ b/R/read.R @@ -368,8 +368,7 @@ readH5AD <- function(file, X_name = NULL, use_hdf5 = FALSE, levels <- as.vector( rhdf5::h5read(file, file.path(path, "__categories", cat_name)) ) - out_cols[[cat_name]] <- factor(out_cols[[cat_name]]) - levels(out_cols[[cat_name]]) <- levels + out_cols[[cat_name]] <- factor(out_cols[[cat_name]], levels = levels) } ## rhdf5::h5readAttributes(file, "var") |> str()