Skip to content

Document utils_/plots_ helpers and simplify code#34

Merged
eboyer221 merged 2 commits into
mainfrom
dev-roxygen-utils-docs
Jun 23, 2026
Merged

Document utils_/plots_ helpers and simplify code#34
eboyer221 merged 2 commits into
mainfrom
dev-roxygen-utils-docs

Conversation

@eboyer221

Copy link
Copy Markdown
Contributor

Documentation + simplification pass on core helpers

Adds roxygen documentation and simplifications to the code across the core utils_* and plots_* helper files.
These changes intentionally do not touch app.R (separate app.R refactor in progress) or the export feature (PR #32).

Documentation

  • Every internal function now has a roxygen block (@param / @return +
    @keywords internal + @noRd).
  • @noRd means no man pages are generated and no new R CMD check
    obligations
    - NAMESPACE is unchanged (only launchAMRDashboard exported).

Simplifications

  • utils_data.R: collapsed the near-identical loadMLResults / loadTopFeat bodies into a shared .load_species_results(); extracted the duplicated subdir search into .find_file_in_subdirs().
  • utils_annotation.R: both annotation lookups now reuse .find_file_in_subdirs(); removed dead cwd/commented code in loadDrugClassMap().
  • plots_modelperf.R: duplicated scale-label/color block → .scale_label_map().
  • plots_featureimportance.R: two identical rank-and-matrix blocks → .vi_matrix(); the two link-builders → .link_ids(); removed dead max_val/min_val.
  • plots_crossmodel.R: removed two more dead max_val/min_val pairs.
  • Fixed the tidyselect .data$ deprecation (the 5 select() warnings are gone) by switching to quoted column names.
  • Wrapped over-length lines in the touched files.

Testing

  • R CMD INSTALL clean; roxygen regen produces no NAMESPACE/man changes.
  • Unit: FAIL 0 | WARN 0 | PASS 168
  • App (shinytest2): FAIL 0 | WARN 0 | PASS 20

Notes for reviewer

  • Left for the app.R/structural pass: the VI heatmap-render block is identical in plots_crossmodel.R and plots_featureimportance.R - a clean .vi_heatmap() extraction, but it adds cross-file coupling so I left it.
  • plots_metadata.R has a few plots with very similar (but not identical) theme styling. I left them as separate copies rather than merging into one helper, since the small differences would make a shared version messier.
  • Possible latent issues, documented honestly rather than silently changed: species_code is accepted but unused in load_feature_name_map and load_feature_annotations; annotated_diris unused inmakeCrossModelFeatureImportancePlot; styledBox()computes and discards adiv`. Flagging in case these are real bugs.

@amcim amcim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great. Especially great job with the simplifications. Approved for merge if CI passes

@eboyer221
eboyer221 merged commit c31cd8d into main Jun 23, 2026
8 checks passed
@eboyer221
eboyer221 deleted the dev-roxygen-utils-docs branch June 23, 2026 16:57
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.

2 participants