Skip to content

Commit

Permalink
Changed to British Spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
gowerc committed Feb 20, 2024
1 parent 337a6d7 commit f1377e2
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 53 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Description: Implements joint models combining a non-linear mixed effects model
In phase 1 studies patients are followed until progression only.
Thus, reliable overall survival data and hence estimates are not available.
However, we can use additional information from previous clinical trials
or real-world data - we can correlate the tumor response data, that are
or real-world data - we can correlate the tumour response data, that are
longitudinal measurements, with the overall survival of the patients or their
hazard ratios. Thereby we can predict the overall survival from our phase 1 study
data and therefore make better decisions.
Expand Down
6 changes: 3 additions & 3 deletions R/DataLongitudinal.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ as_stan_list.DataLongitudinal <- function(object, subject_var, ...) {
model_data <- list(
Nta_total = nrow(df),

# Number of individuals and tumor assessments.
# Number of individuals and tumour assessments.
Nta_obs_y = length(index_obs),
Nta_cens_y = length(index_cen),

Expand All @@ -204,7 +204,7 @@ as_stan_list.DataLongitudinal <- function(object, subject_var, ...) {
Ythreshold = adj_threshold,

# Sparse matrix parameters
# Matrix of individuals x observed tumor assessments.
# Matrix of individuals x observed tumour assessments.
n_mat_inds_obs_y = c(
length(sparse_mat_inds_obs_y$w),
length(sparse_mat_inds_obs_y$v),
Expand All @@ -214,7 +214,7 @@ as_stan_list.DataLongitudinal <- function(object, subject_var, ...) {
v_mat_inds_obs_y = sparse_mat_inds_obs_y$v,
u_mat_inds_obs_y = sparse_mat_inds_obs_y$u,

# Matrix of individuals x censored tumor assessments.
# Matrix of individuals x censored tumour assessments.
n_mat_inds_cens_y = c(
length(sparse_mat_inds_cens_y$w),
length(sparse_mat_inds_cens_y$v),
Expand Down
10 changes: 5 additions & 5 deletions R/LongitudinalGSF.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NULL
#' @param a_phi (`Prior`)\cr for the alpha parameter for the fraction of cells that respond to treatment.
#' @param b_phi (`Prior`)\cr for the beta parameter for the fraction of cells that respond to treatment.
#'
#' @param centered (`logical`)\cr whether to use the centered parameterization.
#' @param centred (`logical`)\cr whether to use the centred parameterization.
#'
#' @export
LongitudinalGSF <- function(
Expand All @@ -54,12 +54,12 @@ LongitudinalGSF <- function(

sigma = prior_lognormal(log(0.1), 1),

centered = FALSE
centred = FALSE
) {

gsf_model <- StanModule(decorated_render(
.x = paste0(read_stan("lm-gsf/model.stan"), collapse = "\n"),
centered = centered
centred = centred
))

parameters <- list(
Expand All @@ -82,8 +82,8 @@ LongitudinalGSF <- function(
Parameter(name = "lm_gsf_sigma", prior = sigma, size = 1)
)

assert_flag(centered)
parameters_extra <- if (centered) {
assert_flag(centred)
parameters_extra <- if (centred) {
list(
Parameter(
name = "lm_gsf_psi_bsld",
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ The goal of the `jmpost` package is to fit joint models involving:
1. a nonlinear (or linear) mixed-effect sub-model, describing individual time profiles (_i.e._ trajectories) for a continuous marker,
1. a link function (_a.k.a._ association term).

More specifically, the model implemented in this package utilizes a modeling framework described previously **[1-3]** to link overall survival to tumor size data in oncology clinical trials.
More specifically, the model implemented in this package utilizes a modelling framework described previously **[1-3]** to link overall survival to tumour size data in oncology clinical trials.

**[1]** [Tardivon _et al._ Association between tumor size kinetics and survival in patients with urothelial carcinoma treated with atezolizumab: Implications for patient follow-up. _Clin Pharm Ther_, 2019](https://doi.org/10.1002/cpt.1450).
**[2]** [Kerioui _et al._ Bayesian inference using Hamiltonian Monte-Carlo algorithm for nonlinear joint modeling in the context of cancer immunotherapy. _Stat in Med_, 2020](https://doi.org/10.1002/sim.8756).
**[1]** [Tardivon _et al._ Association between tumour size kinetics and survival in patients with urothelial carcinoma treated with atezolizumab: Implications for patient follow-up. _Clin Pharm Ther_, 2019](https://doi.org/10.1002/cpt.1450).
**[2]** [Kerioui _et al._ Bayesian inference using Hamiltonian Monte-Carlo algorithm for nonlinear joint modelling in the context of cancer immunotherapy. _Stat in Med_, 2020](https://doi.org/10.1002/sim.8756).
**[3]** [Kerioui _et al._ Modelling the association between biomarkers and clinical outcome: An introduction to nonlinear joint models. _Br J Clin Pharm_, 2022](https://doi.org/10.1111/bcp.15200).

The models are implemented in [STAN](https://mc-stan.org/), and the package provides a flexible user interface.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ The goal of the `jmpost` package is to fit joint models involving:
3. a link function (*a.k.a.* association term).

More specifically, the model implemented in this package utilizes a
modeling framework described previously **\[1-3\]** to link overall
survival to tumor size data in oncology clinical trials.
modelling framework described previously **\[1-3\]** to link overall
survival to tumour size data in oncology clinical trials.

**\[1\]** [Tardivon *et al.* Association between tumor size kinetics and
**\[1\]** [Tardivon *et al.* Association between tumour size kinetics and
survival in patients with urothelial carcinoma treated with
atezolizumab: Implications for patient follow-up. *Clin Pharm Ther*,
2019](https://doi.org/10.1002/cpt.1450).
**\[2\]** [Kerioui *et al.* Bayesian inference using Hamiltonian
Monte-Carlo algorithm for nonlinear joint modeling in the context of
Monte-Carlo algorithm for nonlinear joint modelling in the context of
cancer immunotherapy. *Stat in Med*,
2020](https://doi.org/10.1002/sim.8756).
**\[3\]** [Kerioui *et al.* Modelling the association between biomarkers
Expand Down
18 changes: 9 additions & 9 deletions design/Intro_to_jmpost.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ In clinical development of new cancer medicines a key challenge is to decide on
In phase 1 studies patients are followed until the cancer is growing again (progression event).
Thus, reliable overall survival data are not available.
However, we can use additional information from previous clinical trials or real-world data to understand the time between progression and death.
Specifically, we can correlate the tumor response data, that are longitudinal measurements, (i.e. the shrinkage and growth of tumor lesions over time) with the overall survival of the patients or their hazard ratios [@beyer2020multistate].
Specifically, we can correlate the tumour response data, that are longitudinal measurements, (i.e. the shrinkage and growth of tumour lesions over time) with the overall survival of the patients or their hazard ratios [@beyer2020multistate].
Thereby we can predict the overall survival in our Phase 1 studies and therefore make better decisions [@kerioui2020bayesian].

The sum of the longest diameters (SLD) of the cancer lesions provides an effective and representative biomarker for longitudinal measurements in solid cancer.
SLD is relatively easy to measure with reasonable accuracy while also being a good representative of the development of cancer.

The association between the longitudinal data and the overall survival can be achieved in different ways.
The predicted SLD value or its first derivative over time can be directly treated as the linking factor in the hazard model for survival.
Other factors such as the time to growth, the tumor shrinkage rate or the tumor growth rate can also be used to associate longitudinal outcomes with overall survival.
Other factors such as the time to growth, the tumour shrinkage rate or the tumour growth rate can also be used to associate longitudinal outcomes with overall survival.

Bayesian methodology provides an important tool for the analysis of similar data.
Firstly, the use of historical data from previous trials is improving the performance of the models.
Secondly, prior definition allows the adjustment of the models according to the specific factors of each analysis.

Although these statistical methods provide significant advantages in decision making processes in cancer drug development, their implementation is relatively intricate and time consuming.
Compared to other R-packages such as `joineR` and `jmbayes`, `jmpost` provides the flexibility of non-linear mixed effects modeling for the longitudinal part of the joint model.
Non-linear parametrization respects the biological implications of clinical trials in oncology where the observed tumor response usually follows non-linear patterns.
Compared to other R-packages such as `joineR` and `jmbayes`, `jmpost` provides the flexibility of non-linear mixed effects modelling for the longitudinal part of the joint model.
Non-linear parametrization respects the biological implications of clinical trials in oncology where the observed tumour response usually follows non-linear patterns.

# Minimal usage

Expand All @@ -79,7 +79,7 @@ Secondly, the summary report of the model run.
# Customizing the analysis

`jmpost` is a package aiming to optimize the procedure of developing a new Bayesian joint model.
The package provides complete examples of joint modeling code.
The package provides complete examples of joint modelling code.
Here we explain the workflow of the package `jmpost` using `stan` libraries as an example.

\begin{figure}[!]
Expand Down Expand Up @@ -116,7 +116,7 @@ Here we explain the workflow of the package `jmpost` using `stan` libraries as a

Figure~1 illustrates the main workflow of the `jmpost` package.
Three objects need to be combined for the construction of the full Bayesian joint model.
The longitudinal sub-model, including all the required information for the modeling of the longitudinal measurements, the survival sub-model, including information of for the time to event data and the link or association factor, containing information for the conection of the two sub-models.
The longitudinal sub-model, including all the required information for the modelling of the longitudinal measurements, the survival sub-model, including information of for the time to event data and the link or association factor, containing information for the conection of the two sub-models.

```{r Longitudinal model}
Long_mod <- LongModel(
Expand Down Expand Up @@ -296,7 +296,7 @@ y_{ij} \sim N(SLD_{ij}, SLD^2_{ij}\sigma^2)

Where:
\begin{itemize}
\item $y_{ij}$ is the observed tumor mesasurements
\item $y_{ij}$ is the observed tumour mesasurements
\item $SLD_{ij}$ is the expected sum of longest diameter for subject $i$ at time point $j$
\end{itemize}
### Expected SLD
Expand All @@ -314,7 +314,7 @@ Where:
\item $SLD_{ij}$ is the observed SLD measurement for subject $i$ at visit $j$
\item $b_i$ is the Baseline sld measurement
\item $s_i$ is the kinetics shrinkage parameter
\item $g_i$ is the kinetics tumor growth parameter
\item $g_i$ is the kinetics tumour growth parameter
\item $\phi_i$ is the proportion of cells affected by the treatment
\end{itemize}

Expand Down Expand Up @@ -405,7 +405,7 @@ Where:
\item $G_i$ is the time to growth for subject $i$
\item $b_i$ is the baseline SLD measurement
\item $s_i$ is the kinetics shrinkage parameter
\item $g_i$ is is the kinetics tumor growth parameter
\item $g_i$ is is the kinetics tumour growth parameter
\item $\phi_i$ is the proportion of cells affected by the treatment
\end{itemize}

Expand Down
2 changes: 1 addition & 1 deletion design/bibliography.bib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@article{kerioui2020bayesian,
title={Bayesian inference using Hamiltonian Monte-Carlo algorithm for nonlinear joint modeling in the context of cancer immunotherapy},
title={Bayesian inference using Hamiltonian Monte-Carlo algorithm for nonlinear joint modelling in the context of cancer immunotherapy},
author={Kerioui, Marion and Mercier, Francois and Bertrand, Julie and Tardivon, Coralie and Bruno, Ren{\'e} and Guedj, J{\'e}r{\'e}mie and Desm{\'e}e, Sol{\`e}ne},
journal={Statistics in Medicine},
volume={39},
Expand Down
10 changes: 5 additions & 5 deletions design/compare_sim_gsf.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ knitr::opts_chunk$set(echo = TRUE)
#'
#' Simulation code slightly adapted from supplementary materials from
#' Kerioui, M, Mercier, F, Bertrand, J, et al. Bayesian inference using Hamiltonian
#' Monte-Carlo algorithm for nonlinear joint modeling in the context of cancer immunotherapy.
#' Monte-Carlo algorithm for nonlinear joint modelling in the context of cancer immunotherapy.
#' Statistics in Medicine. 2020; 39: 4853– 4868. https://doi.org/10.1002/sim.8756
#'
#' @param N number of patients
#' @param BSLD baseline sum of longest diameters (SLD)
#' @param s exponential tumor shrinkage rate
#' @param g exponential tumor growth rate
#' @param s exponential tumour shrinkage rate
#' @param g exponential tumour growth rate
#' @param phi proportion of cells responding to treatment
#' @param omega_BSLD standard deviation of random effects for `BSLD`
#' @param omega_s standard deviation of random effects for `s`
#' @param omega_g standard deviation of random effects for `g`
#' @param omega_phi standard deviation of random effects for `phi`
#' @param sigma standard deviation of of tumor size
#' @param sigma standard deviation of of tumour size
#' @param lambda scale parameter for Weibull survival distribution
#' @param beta coefficient of link of SLD in proportional hazards
#' @param times observation times for tumor size. Should not exceed 693.
#' @param times observation times for tumour size. Should not exceed 693.
#'
#' @return A data.frame with columns
#' ID: patient id
Expand Down
2 changes: 1 addition & 1 deletion design/tests/gsf-no-link.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jm <- JointModel(
a_phi = prior_lognormal(log(6), 1),
b_phi = prior_lognormal(log(8), 1),
sigma = prior_lognormal(log(0.01), 1),
centered = FALSE
centred = FALSE
),
survival = SurvivalExponential(
lambda = prior_lognormal(log(1 / (400 / 365)), 1)
Expand Down
10 changes: 10 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,13 @@ behaviour
initialise
customisation
dSLD
prior's
R's
Stat
etc
bl
Br
BS
nonlinear
sim
u
18 changes: 9 additions & 9 deletions inst/stan/base/longitudinal.stan
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@ data{
//

// Longitudinal data
int<lower=1> Nta_total; // Total number of tumor assessments.
int<lower=1> Nta_obs_y; // Number of observed tumor assessments (not censored).
int<lower=0> Nta_cens_y; // Number of censored tumor assessments (below threshold).
int<lower=1> Nta_total; // Total number of tumour assessments.
int<lower=1> Nta_obs_y; // Number of observed tumour assessments (not censored).
int<lower=0> Nta_cens_y; // Number of censored tumour assessments (below threshold).

array[Nta_total] int ind_index; // Index of individuals for each tumor assessment.
array[Nta_obs_y] int obs_y_index; // Index of observed tumor assessments (not censored).
array[Nta_cens_y] int cens_y_index; // Index of censored tumor assessments.
array[Nta_total] int ind_index; // Index of individuals for each tumour assessment.
array[Nta_obs_y] int obs_y_index; // Index of observed tumour assessments (not censored).
array[Nta_cens_y] int cens_y_index; // Index of censored tumour assessments.

vector[Nta_total] Yobs; // Array of individual responses.
vector[Nta_total] Tobs; // Individual timepoints.
real Ythreshold; // Censoring threshold.

// Matrix of individuals x observed tumor assessments (sparse matrix of 0s and 1s),
// Matrix of individuals x observed tumour assessments (sparse matrix of 0s and 1s),
// so the dimension is Nind x Nta_obs_y.
array [3] int<lower=1> n_mat_inds_obs_y;
vector[n_mat_inds_obs_y[1]] w_mat_inds_obs_y;
array[n_mat_inds_obs_y[2]] int v_mat_inds_obs_y;
array[n_mat_inds_obs_y[3]] int u_mat_inds_obs_y;

// Matrix of individuals x censored tumor assessments (sparse matrix of 0s and 1s).
// Matrix of individuals x censored tumour assessments (sparse matrix of 0s and 1s).
// so the dimension is Nind x Nta_cens_y.
array [3] int<lower=0> n_mat_inds_cens_y;
vector[n_mat_inds_cens_y[1]] w_mat_inds_cens_y;
array[n_mat_inds_cens_y[2]] int v_mat_inds_cens_y;
array[n_mat_inds_cens_y[3]] int u_mat_inds_cens_y;

// Matrix of all individuals x tumor assessments (sparse matrix of 0s and 1s).
// Matrix of all individuals x tumour assessments (sparse matrix of 0s and 1s).
// so the dimension is Nind x Nta_total.
array [3] int<lower=0> n_mat_inds_all_y;
vector[n_mat_inds_all_y[1]] w_mat_inds_all_y;
Expand Down
6 changes: 3 additions & 3 deletions inst/stan/lm-gsf/model.stan
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ parameters{
real<lower={{ machine_double_eps }}> lm_gsf_omega_ks;
real<lower={{ machine_double_eps }}> lm_gsf_omega_kg;

{% if centered -%}
{% if centred -%}
vector<lower={{ machine_double_eps }}>[Nind] lm_gsf_psi_bsld;
vector<lower={{ machine_double_eps }}>[Nind] lm_gsf_psi_ks;
vector<lower={{ machine_double_eps }}>[Nind] lm_gsf_psi_kg;
Expand Down Expand Up @@ -44,7 +44,7 @@ transformed parameters{
// Source - lm-gsf/model.stan
//

{% if not centered -%}
{% if not centred -%}
vector<lower={{ machine_double_eps }}>[Nind] lm_gsf_psi_bsld = exp(
lm_gsf_mu_bsld[pt_study_index] + (lm_gsf_eta_tilde_bsld * lm_gsf_omega_bsld)
);
Expand Down Expand Up @@ -100,7 +100,7 @@ model {
//
// Source - lm-gsf/model.stan
//
{% if centered %}
{% if centred %}
lm_gsf_psi_bsld ~ lognormal(lm_gsf_mu_bsld[pt_study_index], lm_gsf_omega_bsld);
lm_gsf_psi_ks ~ lognormal(lm_gsf_mu_ks[pt_arm_index], lm_gsf_omega_ks);
lm_gsf_psi_kg ~ lognormal(lm_gsf_mu_kg[pt_arm_index], lm_gsf_omega_kg);
Expand Down
4 changes: 2 additions & 2 deletions man/LongitudinalGSF-class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/jmpost-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f1377e2

Please sign in to comment.