Skip to content

Commit

Permalink
Merge branch 'main' into workflow_dispatch_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
bundfussr authored Dec 13, 2023
2 parents f524a7c + 7330713 commit bceb711
Show file tree
Hide file tree
Showing 39 changed files with 1,441 additions and 772 deletions.
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE/05_onboard.yml

This file was deleted.

12 changes: 5 additions & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Please add "Closes #<issue number>" to the title of the pull request. Then the
issue is closed automatically once it is merged to `main`.
Thank you for your Pull Request! We have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiral/CONTRIBUTING.html#detailed-development-process) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Thank you for your Pull Request! We have developed this task checklist from the [Development Process Guide](https://pharmaverse.github.io/admiraldev/main/articles/development_process.html) to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `main` branch until you have checked off each task.

- [ ] Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update). Then the issue is closed automatically once it is merged to `main`.
- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Run `styler::style_file()` to style R and Rmd files
- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/main/articles/unit_test_guidance.html#writing-unit-tests-in-admiral)
- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/main/articles/programming_strategy.html#deprecation)?
- [ ] Updated relevant unit tests or have written new unit tests - See [Unit Test Guide](https://pharmaverse.github.io/admiraldev/articles/unit_test_guidance.html#writing-unit-tests-in-admiral)
- [ ] If you removed/replaced any function and/or function parameters, did you fully follow the [deprecation guidance](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html#deprecation)?
- [ ] Update to all relevant roxygen headers and examples
- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately
- [ ] Address any updates needed for vignettes and/or templates
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ on:
# 'push' events are triggered when commits
# are pushed to one of these branches
push:
tags:
- "v*"
branches:
- main
- devel
- pre-release
- test
- patch
# 'pull_request' events are triggered when PRs are
# created against one of these target branches.
pull_request:
branches:
- main
- devel
- pre-release
- test
- patch
# 'release' events are triggered when...
# you guessed it - when releases are made.
release:
Expand All @@ -37,7 +35,7 @@ concurrency:

env:
R_VERSION: "4.1"

jobs:
get_r_version:
name: Get R version
Expand Down Expand Up @@ -86,19 +84,13 @@ jobs:
docs:
name: Documentation
uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main
if: github.event_name == 'push'
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
needs: get_r_version
with:
r-version: "${{ needs.get_r_version.outputs.r-version }}"
# Whether to skip multiversion docs
# Note that if you have multiple versions of docs,
# your URL links are likely to break due to path changes
skip-multiversion-docs: false
latest-tag-alt-name: main
multiversion-docs-landing-page: main
branches-or-tags-to-list: >-
^devel$|^main$|^v([0-9]+\\.)?([0-9]+\\.)?([0-9]+)$
r-version: "4.3"
skip-multiversion-docs: true
secrets:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
linter:
name: Lint
uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main
Expand Down
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ Suggests:
DT
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/Needs/website: gert
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export(bor_non_crpd)
export(bor_pd)
export(bor_pr)
export(bor_sd)
export(call_aval_fun)
export(cb_y)
export(cbor_cr)
export(cbor_pr)
Expand Down
28 changes: 28 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# admiralonco (development version)

## Updates of Existing Functions

- The `bor_ne` event object was updated such that `CR` and `PR` are additionally
considered as event. This ensures that the confirmed best overall response for a
patient with a single `CR` or `PR` assessment is derived as `"NE"` instead of
`"MISSING"`. (#253)

## Documentation

- New vignette "Creating ADRS with iRECIST endpoints". (#233)

- All vignettes and templates were updated to be in line with the changes in
`{admiral}` (see [Breaking
Changes](https://pharmaverse.github.io/admiral/news/index.html#breaking-changes-1-0-0)
for details)(#256).

## Breaking Changes

- The `derive_*()` functions were superseded in favor of
`derive_extreme_event()`. Any superseded functions can continue to be used as
demonstrated via the "Basic ADRS" vignette, as they will remain supported and
won't be deprecated in the near future. (#256)

- The `filter_pd()` function was superseded in favor of `filter_relative()`. (#256)

- The function `call_aval_fun()`, which was deprecated in admiralonco 0.4.0,
has been removed. (#256)

## Various

- Website now has button/links to Slack channel and GitHub Issues. (#262)
Expand Down
6 changes: 4 additions & 2 deletions R/check_crpr.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,23 @@ signal_crpr <- function(dataset,

crpr_data <- filter_joined(
dataset,
dataset_add = dataset,
by_vars = subject_keys,
order = order,
join_vars = exprs(AVALC),
join_type = "after",
filter = AVALC == "CR" & AVALC.join == "PR"
filter_join = AVALC == "CR" & AVALC.join == "PR"
)

if (nrow(crpr_data) > 0) {
pr_data <- filter_joined(
dataset,
dataset_add = dataset,
by_vars = subject_keys,
order = order,
join_vars = exprs(AVALC),
join_type = "before",
filter = AVALC == "PR" & AVALC.join == "CR"
filter_join = AVALC == "PR" & AVALC.join == "CR"
)

crpr_data <- bind_rows(crpr_data, pr_data) %>%
Expand Down
9 changes: 6 additions & 3 deletions R/derive_param_bor.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#' Adds a Parameter for Best Overall Response (without confirmation)
#'
#' @description
#' `r lifecycle::badge("superseded")` The `derive_param_bor()` function has been
#' superseded in favor of `derive_extreme_event()`.
#'
#' Adds a parameter for best overall response, without confirmation, optionally up to
#' first progressive disease
#'
Expand Down Expand Up @@ -252,9 +256,8 @@
#'
#' @author Stephen Gormley
#'
#' @family der_prm_adrs
#'
#' @keywords der_prm_adrs
#' @family superseded
#' @keywords superseded
#'
#' @return The dataframe passed in the `dataset` argument with additional columns and/or
#' rows as set in the `set_values_to` argument.
Expand Down
9 changes: 6 additions & 3 deletions R/derive_param_clinbenefit.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#' Adds a Parameter for Clinical Benefit
#'
#' @description
#' `r lifecycle::badge("superseded")` The `derive_param_clinbenefit()` function
#' has been superseded in favor of `derive_extreme_event()`.
#'
#' Adds a parameter for clinical benefit/disease control
#'
#' @details
Expand Down Expand Up @@ -114,9 +118,8 @@
#'
#' @return The input dataset with a new parameter for clinical benefit
#'
#' @family der_prm_adrs
#'
#' @keywords der_prm_adrs
#' @family superseded
#' @keywords superseded
#'
#' @export
#'
Expand Down
33 changes: 19 additions & 14 deletions R/derive_param_confirmed_bor.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#' Adds a Parameter for Confirmed Best Overall Response
#'
#' @description
#' `r lifecycle::badge("superseded")` The `derive_param_confirmed_bor()`
#' function has been superseded in favor of `derive_extreme_event()`.
#'
#' Adds a parameter for confirmed best overall response (BOR)
#'
#' @param dataset Input dataset
Expand Down Expand Up @@ -187,9 +191,8 @@
#' @return The input dataset with a new parameter for confirmed best overall
#' response
#'
#' @family der_prm_adrs
#'
#' @keywords der_prm_adrs
#' @family superseded
#' @keywords superseded
#'
#' @author Stefan Bundfuss
#'
Expand Down Expand Up @@ -410,15 +413,16 @@ derive_param_confirmed_bor <- function(dataset,
# Create observations for potential responses
cr_data <- filter_joined(
source_data,
dataset_add = source_data,
by_vars = subject_keys,
join_vars = exprs(AVALC, ADT),
join_type = "after",
order = exprs(ADT),
first_cond = AVALC.join == "CR" &
first_cond_upper = AVALC.join == "CR" &
ADT.join >= ADT + days(!!ref_confirm),
filter = AVALC == "CR" &
filter_join = AVALC == "CR" &
all(AVALC.join %in% c("CR", "NE")) &
count_vals(var = AVALC.join, val = "NE") <= !!max_nr_ne
{{ count_vals }}(var = AVALC.join, val = "NE") <= !!max_nr_ne
) %>%
mutate(tmp_order = 1)

Expand All @@ -429,23 +433,24 @@ derive_param_confirmed_bor <- function(dataset,
}
pr_data <- filter_joined(
source_data,
dataset_add = source_data,
by_vars = subject_keys,
join_vars = exprs(AVALC, ADT),
join_type = "after",
order = exprs(ADT),
first_cond = AVALC.join %in% c("CR", "PR") &
first_cond_upper = AVALC.join %in% c("CR", "PR") &
ADT.join >= ADT + days(!!ref_confirm),
filter = AVALC == "PR" &
filter_join = AVALC == "PR" &
all(AVALC.join %in% c("CR", "PR", "SD", "NE")) &
count_vals(var = AVALC.join, val = "NE") <= !!max_nr_ne &
count_vals(var = AVALC.join, val = "SD") <= !!max_nr_sd &
{{ count_vals }}(var = AVALC.join, val = "NE") <= !!max_nr_ne &
{{ count_vals }}(var = AVALC.join, val = "SD") <= !!max_nr_sd &
(
min_cond(
{{ min_cond }}(
var = ADT.join,
cond = AVALC.join == "CR"
) > max_cond(var = ADT.join, cond = AVALC.join == "PR") |
count_vals(var = AVALC.join, val = "CR") == 0 |
count_vals(var = AVALC.join, val = "PR") == 0
) > {{ max_cond }}(var = ADT.join, cond = AVALC.join == "PR") |
{{ count_vals }}(var = AVALC.join, val = "CR") == 0 |
{{ count_vals }}(var = AVALC.join, val = "PR") == 0
)
) %>%
mutate(tmp_order = 2)
Expand Down
33 changes: 19 additions & 14 deletions R/derive_param_confirmed_resp.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#' Adds a Parameter for Confirmed Response
#'
#' @description
#' `r lifecycle::badge("superseded")` The `derive_param_confirmed_resp()`
#' function has been superseded in favor of `derive_extreme_event()`.
#'
#' Adds a parameter for confirmed response
#'
#' @param dataset Input dataset
Expand Down Expand Up @@ -135,9 +139,8 @@
#'
#' @return The input dataset with a new parameter for confirmed response
#'
#' @family der_prm_adrs
#'
#' @keywords der_prm_adrs
#' @family superseded
#' @keywords superseded
#'
#' @author Stefan Bundfuss
#'
Expand Down Expand Up @@ -342,15 +345,16 @@ derive_param_confirmed_resp <- function(dataset,
# Create observations for potential responses
cr_data <- filter_joined(
source_data,
dataset_add = source_data,
by_vars = subject_keys,
join_vars = exprs(AVALC, ADT),
join_type = "after",
order = exprs(ADT),
first_cond = AVALC.join == "CR" &
first_cond_upper = AVALC.join == "CR" &
ADT.join >= ADT + days(!!ref_confirm),
filter = AVALC == "CR" &
filter_join = AVALC == "CR" &
all(AVALC.join %in% c("CR", "NE")) &
count_vals(var = AVALC.join, val = "NE") <= !!max_nr_ne
{{ count_vals }}(var = AVALC.join, val = "NE") <= !!max_nr_ne
) %>%
mutate(
AVALC = "Y"
Expand All @@ -363,23 +367,24 @@ derive_param_confirmed_resp <- function(dataset,
}
pr_data <- filter_joined(
source_data,
dataset_add = source_data,
by_vars = subject_keys,
join_vars = exprs(AVALC, ADT),
join_type = "after",
order = exprs(ADT),
first_cond = AVALC.join %in% c("CR", "PR") &
first_cond_upper = AVALC.join %in% c("CR", "PR") &
ADT.join >= ADT + days(!!ref_confirm),
filter = AVALC == "PR" &
filter_join = AVALC == "PR" &
all(AVALC.join %in% c("CR", "PR", "SD", "NE")) &
count_vals(var = AVALC.join, val = "NE") <= !!max_nr_ne &
count_vals(var = AVALC.join, val = "SD") <= !!max_nr_sd &
{{ count_vals }}(var = AVALC.join, val = "NE") <= !!max_nr_ne &
{{ count_vals }}(var = AVALC.join, val = "SD") <= !!max_nr_sd &
(
min_cond(
{{ min_cond }}(
var = ADT.join,
cond = AVALC.join == "CR"
) > max_cond(var = ADT.join, cond = AVALC.join == "PR") |
count_vals(var = AVALC.join, val = "CR") == 0 |
count_vals(var = AVALC.join, val = "PR") == 0
) > {{ max_cond }}(var = ADT.join, cond = AVALC.join == "PR") |
{{ count_vals }}(var = AVALC.join, val = "CR") == 0 |
{{ count_vals }}(var = AVALC.join, val = "PR") == 0
)
) %>%
mutate(
Expand Down
Loading

0 comments on commit bceb711

Please sign in to comment.