Skip to content

Standardize output figures across MOSuite function calls#223

Open
phoman14 wants to merge 13 commits into
mainfrom
FigOutSync
Open

Standardize output figures across MOSuite function calls#223
phoman14 wants to merge 13 commits into
mainfrom
FigOutSync

Conversation

@phoman14

@phoman14 phoman14 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR standardizes the appearance of MOSuite output figures across direct plotting calls, workflow calls, and the matching Code Ocean capsules. The intent is that the same data and grouping metadata produce consistent colors, category order, point sizing, and readable legends whether a figure is created by plot_pca_2d(), plot_pca_3d(), plot_histogram(), filter_counts(), normalize_counts(), or an affected capsule.

Changes

  • Set the user-facing MOSuite plot color defaults to match the current capsule defaults, while keeping get_mosuite_colors() available for later use.
  • Preserve random color generation only as a fallback when a selected or provided palette has too few colors for the observed groups or samples.
  • Resolve group color order from factor levels for factor columns, and from first appearance in metadata for non-factor columns.
  • Share PCA and histogram legend layout behavior so top and bottom legends wrap and scale text for many or long labels instead of clipping.
  • Align PCA and histogram defaults used by filter_counts() and normalize_counts() with the defaults exposed by the affected capsules.
  • Add focused tests for color resolution, PCA legends, histogram legends, filter defaults, and normalize defaults.
  • Update documentation and NEWS.md for the user-facing figure default changes.

Affected capsule repos from these package changes:

Validation:

  • test-plot_pca.R: PASS 21
  • test-plot_histogram.R: PASS 14
  • test-filter.R: PASS 27
  • test-normalize.R: PASS 22
  • Rd syntax validations passed for updated PCA/histogram docs.

Issues

No linked issue.

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. Focused package tests passed; full devtools::check() was not run in this session.

phoman14 added 10 commits June 29, 2026 19:58
Use the MOSuite palette as the hardcoded filter and normalize plot color default, extend short explicit palettes through the selected palette path, and keep random colors as the get_colors_vctr fallback. Update docs, JSON defaults, and focused color/filter/normalize tests.
@github-actions github-actions Bot added the MOSuite RepoName label Jul 2, 2026
@phoman14 phoman14 requested a review from kelly-sovacool July 2, 2026 19:52
@phoman14 phoman14 changed the title Align plot defaults with capsule behavior Standardize output figures across MOSuite function calls Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.73469% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.71%. Comparing base (ce1865a) to head (42c8cb3).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
R/plot_heatmap.R 57.14% 9 Missing ⚠️
R/filter.R 62.50% 6 Missing ⚠️
R/plot_pca.R 80.64% 6 Missing ⚠️
R/plots.R 90.90% 4 Missing ⚠️
R/colors.R 97.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   79.66%   79.71%   +0.04%     
==========================================
  Files          22       22              
  Lines        3398     3534     +136     
==========================================
+ Hits         2707     2817     +110     
- Misses        691      717      +26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

MOSuite RepoName

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant