Skip to content

Commit 786bf87

Browse files
authored
Merge pull request #265 from longmanz/fix_subset_assay5_bug
make tryCatch in subset.Seurat() handles more error messages from subset.Assay5()
2 parents 144d90a + 89c5ba0 commit 786bf87

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: SeuratObject
22
Title: Data Structures for Single Cell Data
3-
Version: 5.3.0.9001
3+
Version: 5.3.0.9002
44
Authors@R: c(
55
person(given = 'Paul', family = 'Hoffman', email = 'hoff0792@alumni.umn.edu', role = 'aut', comment = c(ORCID = '0000-0002-7693-8957')),
66
person(given = 'Rahul', family = 'Satija', email = 'seurat@nygenome.org', role = c('aut', 'cre'), comment = c(ORCID = '0000-0001-9448-8833')),

R/seurat.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,7 +3782,9 @@ subset.Seurat <- function(
37823782
classes = 'validationWarning'
37833783
),
37843784
error = function(e) {
3785-
if (e$message == "Cannot find features provided") {
3785+
if (e$message %in% c("Cannot find features provided",
3786+
"None of the features provided found in this assay")
3787+
) {
37863788
return(NULL)
37873789
} else {
37883790
stop(e)
@@ -3796,9 +3798,11 @@ subset.Seurat <- function(
37963798
f = Negate(f = is.null),
37973799
x = slot(object = x, name = 'assays')
37983800
)
3799-
if (length(x = .FilterObjects(object = x, classes.keep = c('Assay', 'StdAssay'))) == 0 || is.null(x = x[[DefaultAssay(object = x)]])) {
3801+
if (length(x = .FilterObjects(object = x, classes.keep = c('Assay', 'StdAssay'))) == 0 ||
3802+
!DefaultAssay(object = x) %in% names(slot(object = x, name = 'assays'))) {
38003803
abort(message = "Under current subsetting parameters, the default assay will be removed. Please adjust subsetting parameters or change default assay")
38013804
}
3805+
38023806
# Filter DimReduc objects
38033807
for (dimreduc in .FilterObjects(object = x, classes.keep = 'DimReduc')) {
38043808
suppressWarnings(

0 commit comments

Comments
 (0)