Skip to content

Commit b43c7b9

Browse files
committed
NSCLC tutorial updated
1 parent d574a79 commit b43c7b9

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

docs/src/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ The researcher defines ranges and distributions for model parameters and perform
2121

2222
2. **Selection of a VPop from the plausible population**
2323
Although the plausible population satisfies biological constraints, it does not necessarily reproduce clinical trial outcomes. The goal of this step is therefore to select a subset of patients that matches reported clinical endpoints.
24-
This subset selection problem is formulated as a mixed-integer programming (MIP) problem. Binary variables 𝑥𝑖 ∈ {0,1} indicate whether a plausible patient is included in the VPop, subject to a constraint on the desired VPop size. The objective function minimizes the mismatch between simulated and experimental data across multiple clinical endpoints.
24+
This subset selection problem is formulated as a mixed-integer programming (MIP) problem. Binary variables xᵢ ∈ {0,1} indicate whether a plausible patient is included in the VPop, subject to a constraint on the desired VPop size. The objective function minimizes the mismatch between simulated and experimental data across multiple clinical endpoints.
2525
Since individual patient data are often unavailable, the method focuses on endpoints reported as cohort-level statistics, such as means, std, quantiles, and survival data.
2626

27-
Details on the mathematical formulation of the objective function terms, corresponding to different types of clinical data, can be found in DigiPopData package documentation:
28-
https://hetalang.github.io/DigiPopData.jl/dev/
27+
Details on the mathematical formulation of the objective function terms, corresponding to different types of clinical data, can be found in [DigiPopData package documentation](https://hetalang.github.io/DigiPopData.jl/dev/)
2928

3029
## Citation
3130

docs/src/tutorial/Braniff2024_NSCLC.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ In the original study, individual patient data were used for VPop selection, inc
1010
First, we load the simulated plausible population and use the `load_vpop` function to select the columns in the plausible patient table that correspond to clinically reported endpoints.
1111

1212
```julia
13-
using VPopMIP, CSV, DataFrames, Plots, StatsBase, StatsPlots
13+
using VPopMIP, CSV, DataFrames, Plots, StatsBase
1414

15-
ppopdf = CSV.read("../../../models/Braniff2024/ppopdf1000.csv", DataFrame)
16-
ppop = load_vpop(ppopdf1000; endpoints=["best_dSLD", "time_to_best", "time_to_pfs", "SLD_baseline"])
15+
ppopdf = CSV.read("./models/Braniff2024/ppopdf1000.csv", DataFrame)
16+
ppop = load_vpop(ppopdf; endpoints=["best_dSLD", "time_to_best", "time_to_pfs", "SLD_baseline"])
1717
```
1818

1919
Next, we load clinical data (individual patient data for the *drug* and *placebo* regimens) and convert it into summary statistics using predefined metrics available in [DigiPopData](https://hetalang.github.io/DigiPopData.jl/dev/), to represent a more realistic scenario.
2020

2121
```julia
2222
# Experimental cohort
23-
exp_placebo = CSV.read("../../../models/Braniff2024/synthetic_cohort_placebo.csv", DataFrame)
24-
exp_drug = CSV.read("../../../models/Braniff2024/synthetic_cohort_drug.csv", DataFrame)
23+
exp_placebo = CSV.read("./models/Braniff2024/synthetic_cohort_placebo.csv", DataFrame)
24+
exp_drug = CSV.read("./models/Braniff2024/synthetic_cohort_drug.csv", DataFrame)
2525
expdf = vcat(exp_placebo, exp_drug)
2626

2727
# size of cohort (assuming the same for drug and placebo)
@@ -77,12 +77,15 @@ vpnum = 112
7777
vpop = select_cohort(ppop, data, vpnum; scip_limits_gap = 0.01)
7878
```
7979

80-
We can also visualize the results and compare the plausible population with the selected cohort.
80+
We can also visualize the results and compare patients selected at random with those selected by the MIP algorithm.
8181

8282
```julia
8383
vpopdf = filter(:scenario => x -> x == "drug",DataFrame(vpop))
8484
ppopdf = filter(:scenario => x -> x == "drug",DataFrame(ppop))
8585

86+
rand_vpopdf = ppopdf[sample(1:nrow(ppopdf), vpnum; replace=false), :]
87+
rand_vpop = load_vpop(rand_vpopdf)
88+
8689
function SLD_base_sim_exp(
8790
df;
8891
exp_mean = mean(exp_drug.SLD_baseline),
@@ -198,11 +201,11 @@ function dSLD_sim_exp(
198201
return p
199202
end
200203

201-
p11 = SLD_base_sim_exp(ppopdf)
204+
p11 = SLD_base_sim_exp(rand_vpopdf)
202205
p12 = SLD_base_sim_exp(vpopdf)
203-
p21 = dSLD_sim_exp(ppopdf)
206+
p21 = dSLD_sim_exp(rand_vpopdf)
204207
p22 = dSLD_sim_exp(vpopdf)
205-
p31 = plot(ppop, pfs_drug_bind; dpi=400, xguide="Time (days)", yguide="PFS (%)")
208+
p31 = plot(rand_vpop, pfs_drug_bind; dpi=400, xguide="Time (days)", yguide="PFS (%)")
206209
p32 = plot(vpop, pfs_drug_bind; dpi=400, xguide="Time (days)", yguide="PFS (%)")
207210

208211
p = plot(
@@ -212,7 +215,7 @@ p = plot(
212215
layout = (3, 2),
213216
size = (1200, 1200),
214217
margins=5Plots.mm,
215-
plot_title = "Plausible Population vs Selected VPop (drug regimen)"
218+
plot_title = "Random Selection vs MIP-based Selected VPop (drug regimen)"
216219
)
217220
```
218221
![braniff2024plot](./Braniff2024plot.png)
-229 KB
Loading

0 commit comments

Comments
 (0)