Skip to content

Commit

Permalink
Fix FindMarkers for SCT
Browse files Browse the repository at this point in the history
  • Loading branch information
saketkc committed Nov 7, 2022
1 parent 691e31a commit 755a6bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,9 @@ FindMarkers.SCTAssay <- function(
pseudocount.use = pseudocount.use,
mean.fxn = mean.fxn,
fc.name = fc.name,
base = base
)
base = base,
norm.method = 'LogNormalize' # do expm1 on data slot
)
de.results <- FindMarkers(
object = data.use,
slot = data.slot,
Expand All @@ -784,7 +785,7 @@ FindMarkers.SCTAssay <- function(
pseudocount.use = pseudocount.use,
fc.results = fc.results,
densify = densify,
norm.method = 'LogNormalize' # do expm1 on data slot
norm.method = 'LogNormalize', # do expm1 on data slot
...
)
return(de.results)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test_differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ test_that("Default settings work as expected", {

# SCT normalization
expect_equal(results.sct[1, "p_val"], 6.225491e-11)
expect_equal(results.sct[1, "avg_logFC"], -0.6768721, tolerance = 1e-6)
expect_equal(results.sct[1, "avg_logFC"], -1.081321, tolerance = 1e-6)
expect_equal(results.sct[1, "pct.1"], 0.111)
expect_equal(results.sct[1, "pct.2"], 0.96)
expect_equal(results.sct[1, "p_val_adj"], 1.369608e-08)
expect_equal(nrow(x = results.sct), 92)
expect_equal(nrow(x = results.sct), 158)
expect_equal(rownames(x = results.sct)[1], "TYMP")
})

Expand Down

0 comments on commit 755a6bf

Please sign in to comment.