Skip to content

Commit

Permalink
Correctly assign levels to factors in R reader
Browse files Browse the repository at this point in the history
Fixes #122
  • Loading branch information
lazappi committed Oct 4, 2024
1 parent f348c5d commit 03c28f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-7744-8565")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 03c28f8

Please sign in to comment.