Skip to content

Commit

Permalink
Handle changes in r-devel to is.atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
saketkc committed Oct 24, 2023
1 parent 1bd7976 commit 5bcbf45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/assay5.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ CreateAssay5Object <- function(
if (!is_bare_integerish(x = dim(x = counts), n = 2L, finite = TRUE)) {
abort(message = "'counts' must be a two-dimensional object")
}
dnames <- dimnames(x = counts)
cls <- class(x = counts)
dnames <- dimnames(x = cls)

if (isTRUE(x = transpose)) {
csum <- .GetMethod(fxn = 'rowSums', cls = cls)
cells <- cells %||% dnames[[1L]]
Expand Down Expand Up @@ -318,14 +319,14 @@ CreateAssay5Object <- function(
return(x)
})
# Check cell/feature names for all layers
if (is.atomic(x = cells)) {
if (is.atomic(x = cells) || is.null(x = cells)) {
cells <- rep_len(x = list(cells), length.out = length(x = counts))
}
if (!is_bare_list(x = cells) || length(x = cells) != length(x = counts)) {
stop("Not enough cells for the counts matrices provided", call. = FALSE)
}
cells <- .CheckNames(x = cells, n = names(x = counts))
if (is.atomic(x = features)) {
if (is.atomic(x = features) || is.null(x = features)) {
features <- rep_len(x = list(features), length.out = length(x = counts))
}
if (!is_bare_list(x = features) || length(x = features) != length(x = counts)) {
Expand Down

0 comments on commit 5bcbf45

Please sign in to comment.