Skip to content

Commit

Permalink
Use get_nz_median2 across all methods
Browse files Browse the repository at this point in the history
  • Loading branch information
saketkc committed Jan 12, 2023
1 parent 24b4ce6 commit 2cf8c9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# News
All notable changes will be documented in this file.

## Unreleased

### Fixed
- Replaced `get_nz_median` with faster alternative `get_nz_median2'

## [0.3.5] - 2022-09-21

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ get_residuals <- function(vst_out, umi, residual_type = 'pearson',
# min_variance estimated using median umi
if (min_variance == "umi_median"){
# Maximum pearson residual for non-zero median UMI is 5
min_var <- (get_nz_median(umi) / 5)^2
min_var <- (get_nz_median2(umi) / 5)^2
if (verbosity > 0) {
message(paste("Setting min_variance based on median UMI: ", min_var))
}
Expand Down Expand Up @@ -359,7 +359,7 @@ get_residual_var <- function(vst_out, umi, residual_type = 'pearson',
# min_variance estimated using median umi
if (min_variance == "umi_median"){
# Maximum pearson residual for non-zero median UMI is 5
min_var <- (get_nz_median(umi, genes) / 5)^2
min_var <- (get_nz_median2(umi, genes) / 5)^2
if (verbosity > 0) {
message(paste("Setting min_variance based on median UMI: ", min_var))
}
Expand Down

0 comments on commit 2cf8c9a

Please sign in to comment.