Skip to content

Commit

Permalink
Merge pull request #8197 from ddiez/fix_DietSeuratV5
Browse files Browse the repository at this point in the history
Fix access to layer data for DietSeurat in V5.
  • Loading branch information
dcollins15 authored Dec 17, 2024
2 parents d752a89 + 28ad870 commit af3cbc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 5.1.0.9008
Version: 5.1.0.9009
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Authors@R: c(
Expand Down
8 changes: 4 additions & 4 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,13 @@ DietSeurat <- function(
}
for (lyr in layers.rm) {
suppressWarnings(object <- tryCatch(expr = {
object[[assay]][[lyr]] <- NULL
object[[assay]][lyr] <- NULL
object
}, error = function(e) {
if (lyr == "data"){
object[[assay]][[lyr]] <- sparseMatrix(i = 1, j = 1, x = 1,
dims = dim(object[[assay]][[lyr]]),
dimnames = dimnames(object[[assay]][[lyr]]))
object[[assay]][lyr] <- sparseMatrix(i = 1, j = 1, x = 1,
dims = dim(object[[assay]][lyr]),
dimnames = dimnames(object[[assay]][lyr]))
} else{
slot(object = object[[assay]], name = lyr) <- new(Class = "dgCMatrix")
}
Expand Down

0 comments on commit af3cbc2

Please sign in to comment.