Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup smoke test for FindClusters #9641

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 5.2.0
Version: 5.2.0.9001
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.
Authors@R: c(
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Unreleased

## Changes
- Fixed `test_find_clusters.R` to accommodate variability in label assignments given by `FindClusters` across different systems ([#9641](https://github.com/satijalab/seurat/pull/9641))

# Seurat 5.2.0 (2024-12-20)

## Changes
Expand Down
16 changes: 10 additions & 6 deletions tests/testthat/test_find_clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ context("FindClusters")
test_that("Smoke test for `FindClusters`", {
test_case <- get_test_data()

# Spot check cluster assignments with using defaults.
# Validate cluster assignments using default parameters.
results <- FindClusters(test_case)$seurat_clusters
expect_equal(results[[1]], factor(3, levels=0:5))
expect_equal(results[[15]], factor(4, levels=0:5))
expect_equal(results[[24]], factor(0, levels=0:5))
expect_equal(results[[72]], factor(5, levels=0:5))
expect_equal(results[[length(results)]], factor(2, levels=0:5))
# Check that every cell was assigned to a cluster label.
expect_false(any(is.na(results)))
# Check that the expected cluster labels were assigned.
expect_equal(as.numeric(levels(results)), c(0, 1, 2, 3, 4, 5))
# Check that the cluster sizes match the expected distribution.
expect_equal(
as.numeric(sort(table(results))),
c(9, 10, 10, 11, 20, 20)
)

# Check that every clustering algorithm can be run without errors.
expect_no_error(FindClusters(test_case, algorithm = 1))
Expand Down
Loading