Skip to content

Commit 8902551

Browse files
committed
Skip objects with just one cell
1 parent 058d732 commit 8902551

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

singlecell/resources/chunks/CalculateGeneComponentScores.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ for (datasetId in names(seuratObjects)) {
22
printName(datasetId)
33
seuratObj <- readSeuratRDS(seuratObjects[[datasetId]])
44

5+
if (ncol(seuratObj) == 1) {
6+
print('Object has a single cell, skipping')
7+
rm(seuratObj)
8+
next
9+
}
10+
511
for (sc in savedComponent) {
612
logger::log_info(paste0('Processing ', datasetId, ' for ', sc))
713
seuratObj <- RIRA::ScoreUsingSavedComponent(seuratObj, componentOrName = sc, fieldName = sc)

0 commit comments

Comments
 (0)