Skip to content

Commit

Permalink
Fix minor check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Aug 2, 2023
1 parent 6a68e23 commit 930d517
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Authors@R: c(
person("Leo", "Lahti", role=c("ctb"), email="[email protected]",
comment = c(ORCID = "0000-0001-5537-637X"))
)
Version: 1.29.2
Version: 1.29.3
Date: 2023-07-06
License: GPL-3
Title: Single-Cell Analysis Toolkit for Gene Expression Data in R
Expand Down
4 changes: 2 additions & 2 deletions R/plotHeatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ plotHeatmap <- function(object, features, columns = NULL,
x <- x - rowMeans(x)
}
if (scale) {
if (!center & any(rowSums(x, useNames = TRUE) == 0)) {
if (!center & any(rowSums(x) == 0)) {
stop("Cannot include non-expressed genes when scale=TRUE.")
}
x <- x / sqrt(rowSums(x^2, useNames = TRUE) / (ncol(x) - 1))
x <- x / sqrt(rowSums(x^2) / (ncol(x) - 1))
}
if (is.null(zlim)) {
if (center) {
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-nexprs.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ test_that("nexprs responds to other options", {

# Handles parallelization.
expect_equal(nexprs(original), nexprs(original, BPPARAM=safeBPParam(2)))
expect_equal(nexprs(original), nexprs(original, BPPARAM=SnowParam(3)))
expect_equal(nexprs(original), nexprs(original, BPPARAM=SnowParam(2)))
expect_equal(nexprs(original, byrow=TRUE), nexprs(original, byrow=TRUE, BPPARAM=safeBPParam(2)))
expect_equal(nexprs(original, byrow=TRUE), nexprs(original, byrow=TRUE, BPPARAM=SnowParam(3)))
expect_equal(nexprs(original, byrow=TRUE), nexprs(original, byrow=TRUE, BPPARAM=SnowParam(2)))
})

test_that("nexprs works on a sparse matrix", {
Expand Down

0 comments on commit 930d517

Please sign in to comment.