Skip to content

Commit

Permalink
Use mean.fxn for FindMarkers.SCTAssay
Browse files Browse the repository at this point in the history
  • Loading branch information
saketkc committed Nov 7, 2022
1 parent 1174481 commit 6742903
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 4.2.0
Version: 4.2.0.9001
Date: 2022-09-21
Title: Tools for Single Cell Genomics
Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Expand Down
10 changes: 7 additions & 3 deletions R/differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,12 @@ FindMarkers.SCTAssay <- function(
'scale.data' = GetAssayData(object = object, slot = "counts"),
numeric()
)
if (is.null(x = mean.fxn)){
mean.fxn <- function(x) {
return(log(x = rowMeans(x = expm1(x = x)) + pseudocount.use, base = base))

}
}
fc.results <- FoldChange(
object = object,
slot = data.slot,
Expand All @@ -761,8 +767,7 @@ FindMarkers.SCTAssay <- function(
pseudocount.use = pseudocount.use,
mean.fxn = mean.fxn,
fc.name = fc.name,
base = base,
norm.method = 'LogNormalize' # do expm1 on data slot
base = base
)
de.results <- FindMarkers(
object = data.use,
Expand All @@ -785,7 +790,6 @@ FindMarkers.SCTAssay <- function(
pseudocount.use = pseudocount.use,
fc.results = fc.results,
densify = densify,
norm.method = 'LogNormalize', # do expm1 on data slot
...
)
return(de.results)
Expand Down

0 comments on commit 6742903

Please sign in to comment.