Skip to content

Commit ad655b7

Browse files
committed
Skip NAs when plotting
1 parent c60126b commit ad655b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

singlecell/resources/chunks/DimPlots.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ for (datasetId in names(seuratObjects)) {
88
next
99
}
1010

11-
if (length((unique(seuratObj@meta.data))) <= 1) {
11+
if (length(unique(na.omit(seuratObj@meta.data[[field]]))) == 0) {
1212
next
1313
} else {
14-
print(paste0('Object has one or fewer values, skipping: ', field))
14+
print(paste0('Object has no non-NA values, skipping: ', field))
1515
}
1616

1717
P1 <- Seurat::DimPlot(seuratObj, group.by = field, reduction = 'tsne')

0 commit comments

Comments
 (0)