Skip to content

Commit

Permalink
Be more careful with vignettes use of parallelization
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Dec 12, 2023
1 parent 0754605 commit 5accedf
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
^pkgdown$
^cran-comments\.md$
^CRAN-SUBMISSION$
^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ docs
/vignettes/articles/RUNN/
/vignettes/articles/mod-PowerPoint.pptx
/vignettes/articles/mod-Word.docx
/doc/
/Meta/
10 changes: 7 additions & 3 deletions vignettes/import-nonmem.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```

The goal of `nonmem2rx` is to convert a NONMEM control stream to
Expand Down Expand Up @@ -39,11 +44,11 @@ control stream are:
- The default NONMEM output extension; By default it is `.lst`. You
can set it to something else, like `.res`, using the following
option: `options(nonmem2rx.lst=".res")`.

- Turn on [extended control
stream](https://wfn.sourceforge.net/wfncs.htm#control_streams)
support. You can turn it on by `options(nonmem2rx.extended=TRUE)`

You probably also want to change the name of parameters and
compartments. The easiest way to name the parameters whatever you want
is to pre-specify the names. For example:
Expand Down Expand Up @@ -120,4 +125,3 @@ The import process steps are below:

- Replaces the compartment names with the defined compartment names in
the control stream (ie `COMP=(compartmenName)`)

14 changes: 9 additions & 5 deletions vignettes/rxode2-validate.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```


Expand All @@ -37,21 +41,21 @@ generated outputs for the following items:
- **Population Predictions:** this shows if the model translation is
adequate to simulate general trends; This will validate structural
model's population parameters coupled with the model structure.

- **Individual Predictions:** this shows if the model translation is
able to replicate the same values over all the subjects within the
modeling data-set. This validates the model can reproduce the
between subject variability observed in the study.
between subject variability observed in the study.

- **Individual Weighted Residuals:** this is one step further than the
individual parameter validation, it couples the individual
predictions, the observations and the residual specification to
generate the individual weighted residuals. Since you can [modify
the residual specification to create a nlmixr2-compatible
model](https://nlmixr2.github.io/nonmem2rx/articles/convert-nlmixr2.html), this step is important to make sure
the residual specification is the same.


**Note:** the only part that is not validated with these three metrics
is the between subject covariance matrix, `omega`. We assume this is
correct as long as it is read in correctly.
Expand Down
4 changes: 4 additions & 0 deletions vignettes/simulate-extra-items.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```

This page shows a simple work-flow for directly simulating a different
Expand Down
8 changes: 6 additions & 2 deletions vignettes/simulate-new-dosing-with-covs.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```

## Simulation with covariates or input parameters
Expand All @@ -31,7 +35,7 @@ In this case, we will use the Friberg myelosuppresion model originally
contributed as an example by Yuan Xiong.

With the simulated data in nlmixr2, babelmixr2, and some manual edits
to simplify the model we run NONMEM 7.4.3.
to simplify the model we run NONMEM 7.4.3.

Note in this case there are some PK parameters that are in the model
that require some special handling to simulate with uncertainty or
Expand Down Expand Up @@ -108,7 +112,7 @@ plot(ci)
```

This may be closer a constant theoretical dosing regimen you may wish
to explore.
to explore.

## Option 3: simulate a larger study with a different condition (resampled PK parameters/covariates)

Expand Down
4 changes: 4 additions & 0 deletions vignettes/simulate-new-dosing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```

This page shows a simple work-flow for directly simulating a different
Expand Down
6 changes: 5 additions & 1 deletion vignettes/simulate-uncertainty.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
library(rxode2)
setRxThreads(1L)
library(data.table)
setDTthreads(1L)
```

This page shows a simple work-flow for directly simulating a different
Expand Down Expand Up @@ -66,7 +70,7 @@ s

## Step 4: Summarize and plot

Since there is a bunch of data, a confidence band of the simulation with uncertainty would be helpful.
Since there is a bunch of data, a confidence band of the simulation with uncertainty would be helpful.

One way to do that is to select the interesting components, create a confidence interval and then plot the confidence bands:

Expand Down

0 comments on commit 5accedf

Please sign in to comment.