gnomeR icon indicating copy to clipboard operation
gnomeR copied to clipboard

Add summarize by patient

Open jalavery opened this issue 7 months ago • 2 comments

What changes are proposed in this pull request?

  • Copied function & tests from summarize_by_gene() and modified accordingly
  • If pt has alteration on any sample, it counts as an alteration. If gene included on the panel for each sample and no alteration, then no alteration. If gene missing from any panels for a sequenced sample for a patient, then overall alteration status is unknown.
  • Added a test to check this hierarchy
  • Also added a test to make sure results are the same as summarize_by_gene() when there is only 1 sample/patient
  • Note that the code max(c(.x, 0), na.rm = TRUE) on line 126 of summarize_by_patient() code is to avoid a warning that appears for genes not on any sample for a patient because for max(c(NA, NA), na.rm = TRUE) the warning no non-missing arguments to max; returning -Inf is returned

Let me know if there's anything you want me to add or modify once you have a chance to take a look!

If there is an GitHub issue associated with this pull request, please provide link. #345


Reviewer Checklist (if item does not apply, mark is as complete)

  • [ ] PR branch has pulled the most recent updates from main branch. Ensure the pull request branch and your local version match and both have the latest updates from the main branch.
  • [ ] If a new function was added, function included in _pkgdown.yml
  • [ ] If a bug was fixed, a unit test was added for the bug check
  • [ ] Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • [ ] Code coverage is suitable for any new functions/features. Review coverage with withr::with_envvar(new = c("NOT_CRAN" = "true"), covr::report()). Begin in a fresh R session without any packages loaded.
  • [ ] R CMD Check runs without errors, warnings, and notes
  • [ ] usethis::use_spell_check() runs with no spelling errors in documentation

When the branch is ready to be merged into master:

  • [ ] Update NEWS.md with the changes from this pull request under the heading "# cbioportalR (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • [ ] Run codemetar::write_codemeta()
  • [ ] Run usethis::use_spell_check() again
  • [ ] Approve Pull Request
  • [ ] Merge the PR

jalavery avatar Jul 17 '24 15:07 jalavery