Skip to content

Harden bioenergetic space API + Bioconductor readiness - #78

Merged
vcjdeboer merged 17 commits into
develfrom
bioc-space-improvements
Sep 5, 2026
Merged

vcjdeboer merged 17 commits into
develfrom
bioc-space-improvements

Conversation

@vcjdeboer

Copy link
Copy Markdown
Owner

Summary

Hardens the bioenergetic space / trajectory feature and the surrounding package to a Bioconductor-shippable standard, so working scientists can install from Bioconductor and run it on their own data. Executed as a planned, task-by-task effort with per-task review plus a whole-branch review.

Design/plan: docs/superpowers/plans/2026-09-05-seahtrue-bioc-space-improvements.md.

What changed

Phase 1 — hygiene (no behavior change), takes R CMD check to Status: OK

  • Exclude prototype .qmd files and tooling dirs from the build; ASCII-only R source; remove hidden-file/.git bundling.
  • cat() → cli; ggplot2 size= → linewidth= on line geoms.
  • Register NSE column names via utils::globalVariables() — clears the "no visible binding" NOTEs (2 → 0).

Phase 2 — space API hardening

  • calculate_space() input validation with clear cli::cli_abort messages (bad param_set_* / malformed rate).
  • Documented + guarded the canonical injection-name contract: instead of silently returning NA metrics, calculate_space() now warns when it can't produce the columns the plot functions require.
  • Extracted the three space functions into R/space_xfplate.R.
  • Renamed args OCR_var/ECAR_var → ocr_var/ecar_var (snake_case).

Phase 3 — tests

  • Real testthat coverage for revive_xfplate(), calculate_space(), and both plot functions (suite: 20 → 33 checks).

Maintainer-gated decisions (now resolved)

  • Gate A — the metabolic-space plot width uses amrot_ecar by design; documented the distinction from the max_ecar (mon_ecar/om_ecar) used by the supply_index/glyco_index_max metrics. (docs-only)
  • Gate B — added an optional atp_factors argument to calculate_space() so users can supply custom ATP conversion factors (validated; presets unchanged when omitted).

Release prep

  • Version: → 1.7.1 (valid, odd-minor devel; > Bioconductor devel 1.7.0).
  • Removed the disallowed Remotes: field (BiocStyle stays in Suggests:). NEWS updated.

Verification

  • devtools::test(): FAIL 0 | PASS 33 (47 warnings are pre-existing tidyselect .data deprecations in R/assertions_read.R, unrelated to this branch).
  • R CMD check: Status: OK.
  • BiocCheck: version-format and Remotes ERRORs cleared. Two remaining ERRORs are environment artifacts only (worktree dir-name mismatch; BiocCheck's own scratch dir) and won't reproduce in a normal seahtrue-named checkout.

Deliberately NOT done here (maintainer follow-ups)

  • Bioconductor upstream sync — reconcile with upstream/devel and push to git.bioconductor.org (never automated in this work).
  • Merging to devel will trigger webr.yml and update what the book of seahtrue serves — merge deliberately.
  • Non-blocking BiocCheck NOTEs left for a future pass: 18 functions > 50 lines (e.g. get_xf_assayinfo()), 3× suppressWarnings(), line-length/indent style, and the pre-existing tidyselect deprecation warnings.

🤖 Generated with Claude Code

vcjdeboer and others added 17 commits September 5, 2026 08:55
Also excludes the .superpowers/ workspace at the package root
(docs/superpowers does not exist in this tree; the stray SDD
workspace lives at top level, so ^\.superpowers$ was added
alongside the four specified patterns to actually satisfy the
build-exclusion verification).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
- Replace em dash in glue::glue() strings (R/read_xfplate.R) with —
  unicode escapes so R/ is pure ASCII while the rendered message is
  byte-identical.
- Replace non-ASCII prose in roxygen comments (subscript O2, micro sign
  ug, right arrow) with plain ASCII equivalents in R/assertions_read.R
  and R/plot_xfplate.R, and regenerate the matching man/*.Rd pages.
  (Unicode escapes only apply inside R string literals, not comments,
  so ASCII substitution is used there instead to avoid corrupting
  generated Rd/help text.)
- Fix .gitignore case typo (.DS_store -> .DS_Store) and add
  ^.*\.DS_Store$ to .Rbuildignore. No .DS_Store files were actually
  present/tracked in this worktree.
- Add ^\.git$ to .Rbuildignore: R CMD check's "hidden files and
  directories" NOTE was actually caused by the .git entry being
  bundled into the source tarball, not .DS_Store.

Verified via R CMD build + R CMD check --no-manual: both the
non-ASCII WARNING and hidden-files NOTE are gone; overall check
Status: OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
Pure move of calculate_space, plot_bioenergetic_space, and
plot_bioenergetic_trajectory (with their roxygen docs) from
plot_xfplate.R into a new R/space_xfplate.R, separating the
bioenergetic-space feature from the QC/sketch plot functions.
No logic changes; NAMESPACE and DESCRIPTION are unchanged. The three
moved man/*.Rd files pick up an updated "edit documentation in" source
pointer reflecting the new file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
Rename calculate_space() function-local arguments OCR_var/ECAR_var to
ocr_var/ecar_var (signature defaults, body uses, roxygen @PARAM), and
update the corresponding generated man page. No exported column names
are affected: supply_index and all other output columns are unchanged.
SFI wording in comments/roxygen was already consistent
("Supply Flexibility Index (SFI)") - no change needed there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
Prepares the branch for a maintainer-run Bioconductor sync:
- Version 1.1.0.9001 -> 1.7.1 (valid x.y.z, > devel 1.7.0, keeps odd
  devel minor), fixing the BiocCheck invalid-version-format ERROR.
- Removed the Remotes: bioc::BiocStyle field (not allowed for
  Bioconductor packages); BiocStyle remains in Suggests.
- Replaced the temporary BiocCheck working checklist in NEWS.md with
  real user-facing release notes for the development version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
…settings dependency

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRiaazotsabW2TZ499LLr4
@vcjdeboer
vcjdeboer merged commit d574d78 into devel Sep 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant