Skip to content

Commit c182cc9

Browse files
committed
Replace more 'class()' calls
1 parent 12b01a6 commit c182cc9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

R/utils.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ map.CellOntology <- function(object = NULL,
434434
dict <- get_CellOntology_dictionary(branch = branch,
435435
force_update = force_update)
436436

437-
# prepare for seurat objects
438437
if (inherits(object, "Seurat")){
439438
data <- object@meta.data
440439
} else if (inherits(object, "data.frame")){
@@ -461,10 +460,10 @@ map.CellOntology <- function(object = NULL,
461460
rownames(data) <- data$Row.names
462461
data$Row.names <- NULL
463462

464-
if(class(object) == "Seurat"){
463+
if (inherits(object, "Seurat")){
465464
object <- AddMetaData(object, metadata = data)
466465
return(object)
467-
} else if(class(object) == "data.frame"){
466+
} else if (inherits(object, "data.frame")){
468467
return(data)
469468
}
470469
}

0 commit comments

Comments
 (0)