Skip to content

Commit 058d732

Browse files
committed
When subsetting, skip objects with just one cell
1 parent fc22aa5 commit 058d732

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

singlecell/resources/chunks/SubsetSeurat.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ for (datasetId in names(seuratObjects)) {
1212
<SUBSET_CODE>
1313

1414
if (!is.null(seuratObj)) {
15-
saveData(seuratObj, datasetId)
16-
totalPassed <- totalPassed + 1
15+
if (ncol(seuratObj) <= 1) {
16+
# NOTE: Seurat v5 assays do not perform well with one cell
17+
print(paste0('There is only one cell remaining, skipping'))
18+
} else {
19+
saveData(seuratObj, datasetId)
20+
totalPassed <- totalPassed + 1
21+
}
1722
}
1823

1924
# Cleanup

0 commit comments

Comments
 (0)