test: add unit tests for seurat_clustering and cluster_metrics#52
test: add unit tests for seurat_clustering and cluster_metrics#52bianjh-cloud wants to merge 41 commits into
Conversation
- Add test-make_bubble_plot.R and test-make_volcano_plot.R - Update test-split_featurePlot.R - Remove source() calls from test-make_volcano_plot.R - Rename avg_log2FC to avg_log_2_fc in make_volcano_plot.R and tests - Hardcode fixed math expectations (log10 transforms) - Regenerate man/make_volcano_plot.Rd Generated using AI
Add missing test helper that defines selectData(), needed by test-make_bubble_plot.R and test-split_featurePlot.R at load time.
…n, seurat_clustering, and cluster_metrics
kelly-sovacool
left a comment
There was a problem hiding this comment.
Take a look at my review of #49 and apply those concepts here as well
|
@wong-nw do you have suggestions for new names to |
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
kelly-sovacool
left a comment
There was a problem hiding this comment.
Looks like you accidentally made a commit on this branch with changes that were supposed to be on the other branch: b6254bd
This PR should only contain changes related to seurat_clustering, cluster_metrics, and the BRCA dataset. Make sure you're aware of which branch you're on when you're making changes so you only work on what is relevant to that particular pull request.
Please revert that commit on this branch and push again:
git revert b6254bd
git push
Reverted, added changes made specifically to clustering functions, along with relevant fixtures and helper scripts. |
kelly-sovacool
left a comment
There was a problem hiding this comment.
this is an improvement! see my comments for more details on how to improve this
| # Load the current fixture | ||
| brca <- readRDS( | ||
| "tests/testthat/fixtures/BRCA_Combine_and_Renormalize_SO_downsample.rds" | ||
| ) |
There was a problem hiding this comment.
how did you generate the rds file in the first place? it needs to be documented from the very beginning, including where you downloaded it from.
also, use testthat::test_path() to build the path, i.e.
| # Load the current fixture | |
| brca <- readRDS( | |
| "tests/testthat/fixtures/BRCA_Combine_and_Renormalize_SO_downsample.rds" | |
| ) | |
| # Load the current fixture | |
| brca <- readRDS( | |
| test_path( | |
| "fixtures", "BRCA_Combine_and_Renormalize_SO_downsample.rds" | |
| ) | |
| ) |
There was a problem hiding this comment.
still not seeing any documentation or code explaining where the dataset originated from
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
for more information, see https://pre-commit.ci
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
for more information, see https://pre-commit.ci
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
| features = Seurat::VariableFeatures(ifnb)[1:500] | ||
| ) | ||
|
|
||
| saveRDS(ifnb_sub, file = "tests/testthat/fixtures/ifnb_sub.rds") |
| # Load the current fixture | ||
| brca <- readRDS( | ||
| "tests/testthat/fixtures/BRCA_Combine_and_Renormalize_SO_downsample.rds" | ||
| ) |
There was a problem hiding this comment.
still not seeing any documentation or code explaining where the dataset originated from
|
Changes
test-cluster_metrics.R
test-seurat_clustering.R
Issues
PR Checklist
(
Strikethroughany points that are not applicable.)- [ ] Update the docs if there are any API changes (roxygen2 comments, vignettes, readme, etc.).- [ ] UpdateNEWS.mdwith a short description of any user-facing changes and reference the PR number. Follow the style described in https://style.tidyverse.org/news.htmldevtools::check()locally and fix all notes, warnings, and errors.R-CMD-checksucceeds on the most recent user commit.