Skip to content

Commit

Permalink
[r] update select_features_by_dispersion() to reflect archr defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
immanuelazn committed Jan 10, 2025
1 parent 8e80dc5 commit c50ead2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion r/R/singlecell_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ select_features_by_variance <- function(
#' 3. Find `num_feats` features with the highest dispersion.
select_features_by_dispersion <- function(
mat, num_feats = 25000,
normalize = normalize_log,
normalize = NULL,
threads = 1L
) {
assert_is(mat, "IterableMatrix")
Expand Down
2 changes: 1 addition & 1 deletion r/man/select_features_by_dispersion.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion r/tests/testthat/test-singlecell_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test_that("select_features works general case", {
res_more_feats_than_rows <- do.call(fn, list(m1, num_feats = 10000)) # more features than rows
res_feats_equal_rows <- do.call(fn, list(m1, num_feats = 100))
expect_identical(res_more_feats_than_rows, res_feats_equal_rows)
if (fn != "select_features_by_mean") {
if (fn == "select_features_by_variance") {
# Check that normalization actually does something
res_no_norm <- do.call(fn, list(m1, num_feats = 10, normalize = NULL))
expect_true(!all((res %>% dplyr::arrange(names))$score == (res_no_norm %>% dplyr::arrange(names))$score))
Expand Down

0 comments on commit c50ead2

Please sign in to comment.