Skip to content

Commit

Permalink
Fix for Seurat updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mvfki committed Dec 7, 2023
1 parent cb45fcb commit be62a6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/normalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ colNormalize.Seurat <- function(
value <- .getSeuratData(x, assay = assay, layer = layer, clusterVar = NULL)
mat <- value[[1]]
norm <- colNormalize.default(mat, scaleFactor = scaleFactor, log = log)
x <- Seurat::SetAssayData(x, slot = "data", assay = assay, new.data = norm)
SeuratObject::LayerData(x, layer = "data", assay = assay) <- norm
return(x)
}

Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-objectS3.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ if (requireNamespace("Seurat", quietly = TRUE) &&

test_that("normalization", {
srt <- colNormalize(srt)
expect_equal(sum(colSums(srt@assays$RNA@data)), ncol(rnaRaw))
expect_equal(sum(colSums(LayerData(srt, layer = "data", assay = "RNA"))),
ncol(rnaRaw))

sce <- colNormalize(sce)
expect_true("normcounts" %in% assayNames(sce))
Expand Down

0 comments on commit be62a6d

Please sign in to comment.