Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

675: Add DesignGrouped #677

Merged
merged 37 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7270a9a
add class with constructors
Sep 12, 2023
74ab101
add tests for model class
Sep 12, 2023
e297b77
add prob method
Sep 12, 2023
c4c2342
progress
Sep 12, 2023
697bb7b
dose and prob function generics result now pass through add. args
Sep 13, 2023
b871745
fit and plot method tests
Sep 13, 2023
f2cb21f
remove dummy tests because now we have the actual ones
Sep 13, 2023
fc5da18
Merge f2cb21fe05365df599408943434fa1b3a65adf2f into 8bb205e2a665c9caf…
danielinteractive Sep 13, 2023
7538012
[skip actions] Restyle files
github-actions[bot] Sep 13, 2023
d2eaa63
remove indentation linter because it is not in defaults to avoid warn
Sep 13, 2023
3a4fdf3
polishing
Sep 13, 2023
e43cbc0
add DesignGrouped class
Sep 14, 2023
33071f7
also test validation fun
Sep 14, 2023
88366e2
start simulate method
Sep 14, 2023
5931e40
add example
Sep 14, 2023
417c34f
add tests
Sep 14, 2023
e37fa92
Merge remote-tracking branch 'origin/main' into 675_DesignGrouped
Sep 14, 2023
ed686cf
forward ... from nextBest call to prob, dose, gain calls inside
Sep 14, 2023
4de7981
same for stopTrial methods
Sep 14, 2023
725edf9
remove helper NeedsExtraProbModel as it is no longer needed
Sep 14, 2023
ef7f82f
Merge remote-tracking branch 'origin/main' into 675_DesignGrouped
Sep 14, 2023
04e7f6a
add back indentation_linter because it is needed with 3.1 lintr pkg
Sep 14, 2023
76a05da
add missing assertion
Sep 14, 2023
ef01b23
add to pkgdown
Sep 14, 2023
864bd03
Merge ef01b23ae4d0b22f13ad7fca1aa4aa4d728af554 into 153a71a434809a3e3…
danielinteractive Sep 14, 2023
873bb0a
[skip actions] Restyle files
github-actions[bot] Sep 14, 2023
b5f7e34
trigger checks
Sep 14, 2023
3e958eb
avoid in_sim being passed to dose
Sep 14, 2023
4a48ee3
address review comments
Sep 15, 2023
7009236
Merge 4a48ee308171912eca1c6b5537cc5a017d6ad77c into 153a71a434809a3e3…
danielinteractive Sep 15, 2023
a9b80bb
[skip actions] Restyle files
github-actions[bot] Sep 15, 2023
4a4b897
few fixes
Sep 15, 2023
8405ef9
Merge branch 'main' into 675_DesignGrouped
danielinteractive Sep 15, 2023
692761f
amend news, move helpers to separate file, adapt to main changes,tests
Sep 15, 2023
daf83d2
fix line lengths
Sep 15, 2023
73b94f4
fix typo
Sep 15, 2023
ae051f4
fix warning and note
Sep 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
indentation_linter = NULL,
object_usage_linter = NULL,
object_length_linter = NULL,
object_name_linter = object_name_linter(c("CamelCase", "camelCase", "snake_case"))
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export(.DefaultCohortSizeParts)
export(.DefaultCohortSizeRange)
export(.DefaultDALogisticLogNormal)
export(.DefaultDataGrouped)
export(.DefaultDesignGrouped)
export(.DefaultDualEndpoint)
export(.DefaultDualEndpointBeta)
export(.DefaultDualEndpointEmax)
Expand Down Expand Up @@ -87,6 +88,7 @@ export(.DefaultStoppingTargetBiomarker)
export(.DefaultStoppingTargetProb)
export(.DefaultTITELogisticLogNormal)
export(.Design)
export(.DesignGrouped)
export(.DualDesign)
export(.DualEndpoint)
export(.DualEndpointBeta)
Expand Down Expand Up @@ -191,6 +193,7 @@ export(DataMixture)
export(DataOrdinal)
export(DataParts)
export(Design)
export(DesignGrouped)
export(DualDesign)
export(DualEndpoint)
export(DualEndpointBeta)
Expand Down Expand Up @@ -378,6 +381,7 @@ exportClasses(DataMixture)
exportClasses(DataOrdinal)
exportClasses(DataParts)
exportClasses(Design)
exportClasses(DesignGrouped)
exportClasses(DualDesign)
exportClasses(DualEndpoint)
exportClasses(DualEndpointBeta)
Expand Down
82 changes: 82 additions & 0 deletions R/Design-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,85 @@ DADesign <- function(model, data,
safetyWindow = safetyWindow
)
}

# DesignGrouped ----

## class ----

#' `DesignGrouped`
#'
#' @description `r lifecycle::badge("experimental")`
#'
#' [`DesignGrouped`] combines two [`Design`] objects: one for the mono and one
#' for the combo arm of a joint dose escalation design.
#'
#' @slot model (`LogisticLogNormalGrouped`)\cr the model to be used, currently only one
#' class is allowed.
#' @slot mono (`Design`)\cr including the rules to be followed for the mono arm, the
#' `model` slot will be ignored since the joint model is used instead.
#' @slot combo (`Design`)\cr including the rules to be followed for the combo arm, the
#' `model` slot will be ignored since the joint model is used instead.
danielinteractive marked this conversation as resolved.
Show resolved Hide resolved
#' @slot first_cohort_mono_only (`flag`)\cr whether first test one mono agent cohort, and then
#' once its DLT data has been collected, we proceed from the second cohort onwards with
#' concurrent mono and combo cohorts.
#' @slot same_dose (`flag`)\cr whether the lower dose of the separately determined mono and combo
#' doses should be used as the next dose for both mono and combo.
#'
#' @aliases DesignGrouped
#' @export
#'
.DesignGrouped <- setClass(
Class = "DesignGrouped",
slots = c(
model = "LogisticLogNormalGrouped",
mono = "Design",
combo = "Design",
first_cohort_mono_only = "logical",
same_dose = "logical"
),
prototype = prototype(
model = .DefaultLogisticLogNormalGrouped(),
mono = .Design(),
combo = .Design(),
first_cohort_mono_only = TRUE,
same_dose = TRUE
),
validity = v_design_grouped,
contains = "CrmPackClass"
)

## constructor ----

#' @rdname DesignGrouped-class
#'
#' @param model (`LogisticLogNormalGrouped`)\cr see slot definition.
#' @param mono (`Design`)\cr see slot definition.
#' @param combo (`Design`)\cr see slot definition.
#' @param first_cohort_mono_only (`flag`)\cr see slot definition.
#' @param same_dose (`flag`)\cr see slot definition.
#' @param ... not used.
#'
#' @export
#' @example examples/Design-class-DesignGrouped.R
#'
DesignGrouped <- function(model,
mono,
combo = mono,
first_cohort_mono_only = TRUE,
same_dose = TRUE,
...) {
.DesignGrouped(
model = model,
mono = mono,
combo = combo,
first_cohort_mono_only = first_cohort_mono_only,
same_dose = same_dose
)
}

## default constructor ----

#' @rdname DesignGrouped-class
#' @note Typically, end-users will not use the `.DefaultDesignGrouped()` function.
#' @export
.DefaultDesignGrouped <- .DesignGrouped
Loading