Skip to content

docs(man): runnable examples for ms_tally/ms_extract/ms_fit/ms_compare - #91

Merged
ShixiangWang merged 1 commit into
mainfrom
docs/man-examples
Nov 8, 2026
Merged

ShixiangWang merged 1 commit into
mainfrom
docs/man-examples

Conversation

@ShixiangWang

Copy link
Copy Markdown
Contributor

What

Adds @examples roxygen blocks to the four flagship faces — ms_tally, ms_extract, ms_fit, ms_compare — the working grammar's entry points, which were the only four of the twelve example-bearing-candidate man pages without runnable examples (12/97 pages had \examples{} before; this takes the flagship four off the lacking list).

Each example is standalone, tempfile-based, and verified by direct execution against load_all() before this commit (every block ran end-to-end with no error).

Why

The flagship man pages are a new user's first landing spots; ?ms_tally through ?ms_compare had no executable usage. Per the docs remediation roster (MEDIUM-1).

Notes for reviewers

  • ms_tally's example builds a minimal little-endian 2bit genome inline (16-byte header, one 9-byte index entry, one 8 bp chromosome record, packed 0x19 0xE7 = TCACGACG). The two VCF records sit at positions 3 and 6, inside the SBS96 context window, so the tally is exercised end-to-end with n_skipped = 0.
  • ms_extract/ms_fit/ms_compare share one scenario: bundled COSMIC SBS96 reference subset to three signatures, 24 samples with fixed activity shares, ms_simulate(burden = 4000, seed = 7), then extract → refit → compare. ms_compare passes null_n = 200, null_n_draws = 500 — example-sized while honoring the >= 200 draw floor the Jiang protocol enforces.
  • devtools::document() regenerated the four .Rd files; a pre-existing drift in man/plot_catalog_profile.Rd (source fixed in daf7020, Rd lagging) surfaced during regen and was reverted out of this PR — it is doc-sync debt from docs(site): professional README, tiered pkgdown user site, docs/ corpus converted to site articles #75/fix(ci): publish the Pages site instead of only storing its artifact #79, not this change's concern.

Test plan

  • Extracted each @examples block verbatim and ran it via Rscript against load_all() — all four OK
  • devtools::document() — clean, only the four intended .Rd files written
  • Local tests: catalog-tally, ffi-tally, docs-bridge green (1 sanctioned skip: lane-site 404 census in R CMD check context)
  • CI fanout arms green (check-run level)
  • Post-merge push run attested

ms_tally/ms_extract/ms_fit/ms_compare carried the only four man pages of
the flagship grammar without an \examples{} block (12 of 97 pages had
one). Each example is standalone and tempfile-based, verified by direct
execution against load_all before this commit:

- ms_tally: a 2-record VCF tallied against a minimal in-memory 2bit
  genome (little-endian 2bit serialization written inline; variants sit
  inside the SBS96 context window so nothing is ledgered as skipped).
- ms_extract/ms_fit/ms_compare: one shared scenario over the bundled
  COSMIC SBS96 reference -- simulate three signatures with fixed
  activity shares, extract with the default pipeline, refit exposures,
  compare against truth under the Jiang protocol with a small null MC
  (null_n=200/null_n_draws=500 to stay example-sized while honoring the
  >=200 floor).
@ShixiangWang
ShixiangWang merged commit 3598425 into main Nov 8, 2026
9 checks passed
@ShixiangWang
ShixiangWang deleted the docs/man-examples branch November 8, 2026 18:18
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