Skip to content

Commit

Permalink
Merge branch '860-create-an-increments-rule-based-on-limiting-the-pro…
Browse files Browse the repository at this point in the history
…bability-of-toxicity' of github.com:openpharma/crmPack into 860-create-an-increments-rule-based-on-limiting-the-probability-of-toxicity
  • Loading branch information
Puzzled-Face committed Sep 30, 2024
2 parents d52edc2 + 3aa8100 commit f4c8e03
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 28 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ TODO
^Meta$
Rplots.pdf
^pkgdown$
⁠pkgdown/⁠
^data-raw$
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: crmPack
Title: Object-Oriented Implementation of CRM Designs
Version: 2.0.0.9158
Version: 2.0.0.9000
Authors@R: c(
person("Daniel", "Sabanes Bove", , "daniel.sabanes_bove@rconis.com", role = c("aut", "cre")),
person("Wai", "Yin Yeung", , "winnie.yeung@roche.com", role = "aut"),
Expand Down Expand Up @@ -33,7 +33,8 @@ Description: Implements a wide range of model-based dose escalation
new models, escalation or stopping rules. Further details are
presented in Sabanes Bove et al. (2019) <doi:10.18637/jss.v089.i10>.
License: GPL (>= 2)
URL: https://github.com/openpharma/crmPack
URL: https://github.com/openpharma/crmPack,
https://openpharma.github.io/crmPack/
BugReports: https://github.com/openpharma/crmPack/issues
Depends:
ggplot2 (>= 2.0.0),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Version 2.0.0.9158
# Version 2.0.0.9000
* **Note: This release (1.0 -> 2.0) signifies a major breaking revamp of the package.** Users are advised to carefully review the release notes and documentation for detailed information on the changes and any necessary updates to their existing code.
* Implemented the `IncrementsMaxToxProb` class
* Implemented `knit_print` methods for almost all `crmPack` classes to improve rendering in Markdown and Quarto documents. See the vignette for more details.
Expand Down
4 changes: 2 additions & 2 deletions R/Data-validity.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ v_data_da <- function(object) {
}
v$check(
test_numeric(object@u, upper = object@Tmax, len = object@nObs, any.missing = FALSE) &&
all(object@u > 0),
"u must be of type double, nObs length, non-negative and not greater than Tmax"
all(object@u >= 0),
"u must be of type double, nObs length, non-negative, not missing and not greater than Tmax"
)
v$check(
test_numeric(object@t0, lower = 0, len = object@nObs, any.missing = FALSE, sorted = TRUE),
Expand Down
32 changes: 16 additions & 16 deletions tests/testthat/_snaps/Design-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
result
Output
An object of class "PseudoDualSimulations"
Slot "fitEff":
Slot "fit_eff":
[[1]]
[[1]]$theta1
[1] -4.20662
Expand All @@ -619,13 +619,13 @@
Slot "FinalGstarEstimates":
Slot "final_gstar_estimates":
[1] 146.2479
Slot "FinalGstarAtDoseGrid":
Slot "final_gstar_at_dose_grid":
[1] 125
Slot "FinalGstarCIs":
Slot "final_gstar_cis":
[[1]]
[[1]]$lower
[1] 75.03531
Expand All @@ -635,16 +635,16 @@
Slot "FinalGstarRatios":
Slot "final_gstar_ratios":
[1] 3.798815
Slot "FinalOptimalDose":
Slot "final_optimal_dose":
[1] 137.5996
Slot "FinalOptimalDoseAtDoseGrid":
Slot "final_optimal_dose_at_dose_grid":
[1] 125
Slot "sigma2est":
Slot "sigma2_est":
[1] 0.1616952
Slot "fit":
Expand Down Expand Up @@ -765,7 +765,7 @@
result
Output
An object of class "PseudoDualSimulations"
Slot "fitEff":
Slot "fit_eff":
[[1]]
middle lower upper
1 -0.3079474 -0.8521410 0.08196096
Expand All @@ -782,13 +782,13 @@
12 1.6915134 1.2623492 2.22318756
Slot "FinalGstarEstimates":
Slot "final_gstar_estimates":
[1] 300
Slot "FinalGstarAtDoseGrid":
Slot "final_gstar_at_dose_grid":
[1] 225
Slot "FinalGstarCIs":
Slot "final_gstar_cis":
[[1]]
[[1]]$lower
[1] 300
Expand All @@ -798,16 +798,16 @@
Slot "FinalGstarRatios":
Slot "final_gstar_ratios":
[1] 1
Slot "FinalOptimalDose":
Slot "final_optimal_dose":
[1] 62.78087
Slot "FinalOptimalDoseAtDoseGrid":
Slot "final_optimal_dose_at_dose_grid":
[1] 50
Slot "sigma2est":
Slot "sigma2_est":
[1] 0.2648646
Slot "fit":
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-Data-validity.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ test_that("v_data_da: error for u of wrong length and values", {

expect_equal(
v_data_da(object),
"u must be of type double, nObs length, non-negative and not greater than Tmax" # nolintr
"u must be of type double, nObs length, non-negative, not missing and not greater than Tmax" # nolintr
)
})

Expand Down
2 changes: 1 addition & 1 deletion vignettes/example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ All of the stopping rules classes inherit directly from the `Stopping` class. Th

From the names of these stopping rules, we can have an idea of what criteria have been used for stopping decisions and we will explain briefly here what are these criteria. For further details please refer to examples presented later in this vignette or examples given in the help pages. You can find a link to all implemented stopping rule parts in the help page `Stopping-class`.

For example, `StoppingCohortNearDose` class objects can be used to stop the dose escalation based on the numbers of cohorts treated near to the next best dose (where the required proximity is given as the percentage of relative deviation from the next best dose). Similarly, for `StoppingPatientsNearDose`, stopping is based on the number of patients treated near the next best dose. `StoppingMinCohorts` and `StoppingMinPatients` rules can be used to stop the dose escalation if a minimum overall number of patients or cohorts have been enrolled. We have also other stopping rules such that a trial will be stopped either based on the MTD distribution (`StoppingMTDdistribution`), or reached a pre-specified probability of the next dose being in the target toxicity interval (`StoppingTargetProb`) or or target biomarker interval (`StoppingTargetBiomarker`) or when the current estimate of the quantity of interest is 'accurate' enough (`StoppingTDCIRatio` and `StoppingMaxGainCIRatio`)
For example, `StoppingCohortNearDose` class objects can be used to stop the dose escalation based on the numbers of cohorts treated near to the next best dose (where the required proximity is given as the percentage of relative deviation from the next best dose). Similarly, for `StoppingPatientsNearDose`, stopping is based on the number of patients treated near the next best dose. `StoppingMinCohorts` and `StoppingMinPatients` rules can be used to stop the dose escalation if a minimum overall number of patients or cohorts have been enrolled. We have also other stopping rules such that a trial will be stopped either based on the MTD distribution (`StoppingMTDdistribution`), or reached a pre-specified probability of the next dose being in the target toxicity interval (`StoppingTargetProb`) or target biomarker interval (`StoppingTargetBiomarker`) or when the current estimate of the quantity of interest is 'accurate' enough (`StoppingTDCIRatio` and `StoppingMaxGainCIRatio`)

Stopping rules are often quite complex, because they are built from "and/or" combinations of multiple parts. Therefore the `crmPack` implementation mirrors this, and
multiple atomic stopping rules can be combined easily. For example, let's assume
Expand Down
12 changes: 7 additions & 5 deletions vignettes/knit_print.qmd → vignettes/knit_print.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ citation-location: margin
bibliography: vignettes.bib
vignette: >
%\VignetteIndexEntry{demo}
%\VignetteEngine{quarto::html}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r}
```{r, label = "setup"}
#| label: setup
#| echo: FALSE
Expand Down Expand Up @@ -61,7 +61,7 @@ cs

> The `knit_print`methods provided by `crmPack` are not intended to be fully customisable or
> comprehensive. We do believe, however, that they cover the vast majority of use-cases and are
> easily extended using the techniques described in @sec-override of this vignette.
> easily extended using the techniques described later in this vignette.
> Formatting of these objects currently only works for HMTL output. If another format - such as PDF
> or Microsoft Word - is required, our suggested workaround is to create the HTML output and then
Expand Down Expand Up @@ -216,7 +216,7 @@ knit_print(
)
```

\[Output not shown.\]
$$Output not shown.$$

> It is not possible to omit slots from the rendition of a `crmPack` object. If you need to do this,
> you can either render the required slots individually, or override the definition of `knit_print`
Expand Down Expand Up @@ -286,7 +286,9 @@ As an example, consider `knit_print.NextBestNCRM`, which currently returns a par

You might feel this is better presented as a bulleted list. You can achieve this as follows[^3]:

[^3]: For simplicity, the `tox_label` and `asis` parameters, which are defined in the current implementation of the function, are omitted in this custom implementation. They should be preserved in any "real world" customisation.
[^3]: For simplicity, the `tox_label` and `asis` parameters, which are defined in the current
implementation of the function, are omitted in this custom implementation. They should be
preserved in any "real world" customisation.

```{r}
#| label: override-2
Expand Down

0 comments on commit f4c8e03

Please sign in to comment.