Skip to content

Commit be19eab

Browse files
committed
fix(MarkersPlot): handle errors when subsetting object features
1 parent 6c05712 commit be19eab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/markersplot.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,12 @@ MarkersPlot <- function(
387387
}
388388
genes <- unique(genes)
389389
# subset the object to only include the selected genes
390-
object <- subset(object, features = genes)
390+
object <- tryCatch({
391+
# In case the features do not exist in some assays
392+
subset(object, features = genes)
393+
}, error = function(e) {
394+
object
395+
})
391396

392397
args <- list(
393398
object,

0 commit comments

Comments
 (0)