Skip to content

Commit b52803a

Browse files
committed
Better handling of NAs
1 parent d974114 commit b52803a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

singlecell/resources/chunks/TcrFilter.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ for (datasetId in names(seuratObjects)) {
1818

1919
cdr3ForLocus <- gsub(cdr3ForLocus, pattern = paste0(fieldName, ':'), replacement = '')
2020
matchingCells <- sapply(seuratObj@meta.data[[fieldName]], function(x){
21+
if (is.na(x)) {
22+
return(FALSE)
23+
}
24+
2125
values <- unlist(strsplit(x, split = ','))
2226
return(length(intersect(values, cdr3ForLocus)) != 0)
2327
})

0 commit comments

Comments
 (0)