From 308bd208f9678307da5e105b5b82de34e52d243a Mon Sep 17 00:00:00 2001 From: Gesmira Date: Mon, 15 Apr 2024 11:58:37 -0400 Subject: [PATCH 1/3] move feature-level metadata subsetting --- R/assay5.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/R/assay5.R b/R/assay5.R index 3f54cf6b..f5652219 100644 --- a/R/assay5.R +++ b/R/assay5.R @@ -2411,6 +2411,12 @@ subset.StdAssay <- function( for (lyr in setdiff(x = layers.all, y = layers)) { LayerData(object = x, layer = lyr) <- NULL } + # Subset feature-level metadata + mfeatures <- MatchCells( + new = Features(x = x, layer = NA), + orig = features, + ordered = TRUE + ) # Perform the subsets for (l in layers) { lcells <- MatchCells( @@ -2442,12 +2448,6 @@ subset.StdAssay <- function( for (i in c('cells', 'features')) { slot(object = x, name = i) <- droplevels(x = slot(object = x, name = i)) } - # Subset feature-level metadata - mfeatures <- MatchCells( - new = Features(x = x, layer = NA), - orig = features, - ordered = TRUE - ) slot(object = x, name = 'meta.data') <- slot( object = x, name = 'meta.data' From 7625fecccf87209dafe75daba3a492ca8269cd24 Mon Sep 17 00:00:00 2001 From: Gesmira Date: Mon, 15 Apr 2024 12:07:11 -0400 Subject: [PATCH 2/3] bump version --- DESCRIPTION | 2 +- NEWS.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e5e06f7c..6ad3f4f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: SeuratObject Type: Package Title: Data Structures for Single Cell Data -Version: 5.0.1.9007 +Version: 5.0.1.9008 Authors@R: c( person(given = 'Paul', family = 'Hoffman', email = 'hoff0792@alumni.umn.edu', role = 'aut', comment = c(ORCID = '0000-0002-7693-8957')), person(given = 'Rahul', family = 'Satija', email = 'seurat@nygenome.org', role = c('aut', 'cre'), comment = c(ORCID = '0000-0001-9448-8833')), diff --git a/NEWS.md b/NEWS.md index deed03bc..5253600e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,7 @@ - Require R 4.1 (#180) - Fix errors in `UpdateSeuratObject` (@ddiez, #182) - Fix bug in `PolyVtx` (#194) +- Fix bug in feature-level subsetting # SeuratObject 5.0.1 From bad962698f0979d619548dfbd67f0ed0cad7c482 Mon Sep 17 00:00:00 2001 From: gesmira <59940281+Gesmira@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:01:55 -0400 Subject: [PATCH 3/3] Update NEWS.md Co-authored-by: Paul Hoffman --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 5253600e..6943faed 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,7 +7,7 @@ - Require R 4.1 (#180) - Fix errors in `UpdateSeuratObject` (@ddiez, #182) - Fix bug in `PolyVtx` (#194) -- Fix bug in feature-level subsetting +- Fix bug in feature-level subsetting (#200) # SeuratObject 5.0.1