Skip to content

test: add unit tests for seurat_clustering and cluster_metrics#52

Open
bianjh-cloud wants to merge 3 commits intomainfrom
51-seurat-clustering-unit-tests
Open

test: add unit tests for seurat_clustering and cluster_metrics#52
bianjh-cloud wants to merge 3 commits intomainfrom
51-seurat-clustering-unit-tests

Conversation

@bianjh-cloud
Copy link
Copy Markdown
Collaborator

Changes

test-cluster_metrics.R

  • imports BRCA fixture data, clustered by seurat_clustering
  • verifies output shape for silhouette parameter
  • checks numeric results, consistency across metadata variables
  • expect errors for missing cluster columns, invalid reduction

test-seurat_clustering.R

  • verifies default parameters
  • run function on BRCA fixture
  • checks that low / high resolution cluster(s) numbers are plotted correctly
  • checks errors for invalid npcs_in, resolution, and algorithm inputs

Issues

PR Checklist

(Strikethrough any points that are not applicable.)

  • This comment contains a description of changes with justifications, with any relevant issues linked.
  • Write unit tests for any new features, bug fixes, or other code changes.
  • Update the docs if there are any API changes (roxygen2 comments, vignettes, readme, etc.).
  • Update NEWS.md with a short description of any user-facing changes and reference the PR number. Follow the style described in https://style.tidyverse.org/news.html
  • Run devtools::check() locally and fix all notes, warnings, and errors.
  • R-CMD-check succeeds on the most recent user commit.

@bianjh-cloud bianjh-cloud linked an issue Apr 21, 2026 that may be closed by this pull request
@github-actions github-actions Bot added the SCOT RepoName label Apr 21, 2026
Copy link
Copy Markdown
Member

@kelly-sovacool kelly-sovacool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at my review of #49 and apply those concepts here as well

@kelly-sovacool
Copy link
Copy Markdown
Member

@wong-nw do you have suggestions for new names to seurat_clustering and cluster_metrics so they are verbs per the style guide? https://style.tidyverse.org/functions.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCOT RepoName

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seurat Clustering Unit Tests

2 participants