gnomeR
gnomeR copied to clipboard
Add summarize by patient
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 ofsummarize_by_patient()
code is to avoid a warning that appears for genes not on any sample for a patient because formax(c(NA, NA), na.rm = TRUE)
the warningno 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 (seeNEWS.md
for examples). - [ ] Run
codemetar::write_codemeta()
- [ ] Run
usethis::use_spell_check()
again - [ ] Approve Pull Request
- [ ] Merge the PR