Skip to content

Commit

Permalink
fix vignette on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy00000000000 committed Jun 10, 2024
1 parent 39ad158 commit 17123be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ Three case study models are provided within the vignette folder. The following s

Within the vignette >> models directory, you should find three folders:

![](./readme_images/vignette_01.png){width=40%}
![](./readme_images/vignette_01.PNG){width=40%}

This first example is drugx-oral-1cmt-101, in which you will find the NONMEM control stream (.ctl) and output files (.ext and .lst). The nonmem2mrgsolve package does not require the .lst file, it is provided solely for user reference. The nonmem2mrgsolve-translated mrgsolve code, along with the mrgsolve code following any necessary user modifications, are provided as well for reference, but could be deleted at this step and recreated during the vignette. The run_nonmem2mrgsolve_drugx.R file contains all the code presented for this example of the vignette.

![](./readme_images/vignette_02.png){width=40%}
![](./readme_images/vignette_02.PNG){width=40%}


Now that the directory structure is clear, start R, load the nonmem2mrgsolve package, and set the working directory to immediately before entering the vignette folder:
Expand All @@ -95,8 +95,8 @@ During the translation, the final parameter estimates (thetas and omegas) are ob

When the translation is finished, the mrgsolve code will print to the R console and will also be written to a .R file:

![](./readme_images/vignette_03.png){width=100%}
![](./readme_images/vignette_04.png){width=40%}
![](./readme_images/vignette_03.PNG){width=100%}
![](./readme_images/vignette_04.PNG){width=40%}


Now is a good time to check whether the nonmem2mrgsolve-translated mrgsolve code requires any user modifications in order to compile:
Expand All @@ -107,7 +107,7 @@ mrgsolve::mcode("Test_Unmodified_Translation",code)

In this example manual user changes to the mrgsolve code are not needed, since the model successfully compiled:

![](./readme_images/vignette_05.png){width=50%}
![](./readme_images/vignette_05.PNG){width=50%}


If certain model complexities are present (such as time-varying covariates), the nonmem2mrgsolve-translated mrgsolve code may fail to compile into an mrgsolve model object. The compilation failure will provide informative error messages for locating the line of code that needs attention. The compilation failure will also prevent the user from running simulations without first addressing problems in the code.
Expand All @@ -123,14 +123,14 @@ Attempting to compile the nonmem2mrgsolve-translated mrgsolve code results in a
source("./vignette/models/evolocumab-tmdd-qss-pkpd-101/mrgsolve_code_evolocumab-tmdd.R")
mrgsolve::mcode("Test_Unmodified_Translation",code)
```
![](./readme_images/vignette_06.png){width=100%}
![](./readme_images/vignette_06.PNG){width=100%}


From the error message it is clear that the issue occurred when the NONMEM dataset column "TIME" was being used in the differential equation code block ($DES). Mrgsolve syntax requires this to be labeled as "SOLVERTIME".

The user can manually make this single change while leaving the rest of the nonmem2mrgsolve code unmodified:

![](./readme_images/vignette_07.png){width=100%}
![](./readme_images/vignette_07.PNG){width=100%}


Compiling the corrected mrgsolve code is successful:
Expand All @@ -139,7 +139,7 @@ source("./vignette/models/evolocumab-tmdd-qss-pkpd-101/mrgsolve_code_evolocumab-
mrgsolve::mcode("Test_Modified_Translation",code)
```

![](./readme_images/vignette_08.png){width=50%}
![](./readme_images/vignette_08.PNG){width=50%}

### Example 3: A Whole-body Physiologically-based Pharmacokinetic (PBPK) Model

Expand All @@ -151,15 +151,15 @@ source("./vignette/models/mavoglurant-pbpk-101/mrgsolve_code_mavoglurant-pbpk.R"
mrgsolve::mcode("Test_Unmodified_Translation",code)
```

![](./readme_images/vignette_09.png){width=80%}
![](./readme_images/vignette_09.PNG){width=80%}


From the error message it is clear that the issue occurred because "RATE" was not declared in the parameter block ($PARAM). Additionally, this should be renamed since "RATE" is a reserved term.

The user can manually make these two changes while leaving the rest of the nonmem2mrgsolve code unmodified:

![](./readme_images/vignette_10.png){width=100%}
![](./readme_images/vignette_11.png){width=100%}
![](./readme_images/vignette_10.PNG){width=100%}
![](./readme_images/vignette_11.PNG){width=100%}


Compiling the corrected mrgsolve code is successful:
Expand All @@ -168,4 +168,4 @@ source("./vignette/models/mavoglurant-pbpk-101/mrgsolve_code_mavoglurant-pbpk_us
mrgsolve::mcode("Test_Modified_Translation",code)
```

![](./readme_images/vignette_12.png){width=50%}
![](./readme_images/vignette_12.PNG){width=50%}
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ the vignette folder to a convenient file location.
Within the vignette >> models directory, you should find three
folders:

<img src="./readme_images/vignette_01.png" style="width:40.0%" />
<img src="./readme_images/vignette_01.PNG" style="width:40.0%" />

This first example is drugx-oral-1cmt-101, in which you will find the
NONMEM control stream (.ctl) and output files (.ext and .lst). The
Expand All @@ -115,7 +115,7 @@ are provided as well for reference, but could be deleted at this step
and recreated during the vignette. The run\_nonmem2mrgsolve\_drugx.R
file contains all the code presented for this example of the vignette.

<img src="./readme_images/vignette_02.png" style="width:40.0%" />
<img src="./readme_images/vignette_02.PNG" style="width:40.0%" />

Now that the directory structure is clear, start R, load the
nonmem2mrgsolve package, and set the working directory to immediately
Expand Down Expand Up @@ -147,8 +147,8 @@ the [usage statement](#link_1).
When the translation is finished, the mrgsolve code will print to the R
console and will also be written to a .R file:

<img src="./readme_images/vignette_03.png" style="width:100.0%" />
<img src="./readme_images/vignette_04.png" style="width:40.0%" />
<img src="./readme_images/vignette_03.PNG" style="width:100.0%" />
<img src="./readme_images/vignette_04.PNG" style="width:40.0%" />

Now is a good time to check whether the nonmem2mrgsolve-translated
mrgsolve code requires any user modifications in order to compile:
Expand All @@ -161,7 +161,7 @@ mrgsolve::mcode("Test_Unmodified_Translation",code)
In this example manual user changes to the mrgsolve code are not needed,
since the model successfully compiled:

<img src="./readme_images/vignette_05.png" style="width:50.0%" />
<img src="./readme_images/vignette_05.PNG" style="width:50.0%" />

If certain model complexities are present (such as time-varying
covariates), the nonmem2mrgsolve-translated mrgsolve code may fail to
Expand Down Expand Up @@ -195,7 +195,7 @@ source("./vignette/models/evolocumab-tmdd-qss-pkpd-101/mrgsolve_code_evolocumab-
mrgsolve::mcode("Test_Unmodified_Translation",code)
```

<img src="./readme_images/vignette_06.png" style="width:100.0%" />
<img src="./readme_images/vignette_06.PNG" style="width:100.0%" />

From the error message it is clear that the issue occurred when the
NONMEM dataset column “TIME” was being used in the differential equation
Expand All @@ -205,7 +205,7 @@ code block ($DES). Mrgsolve syntax requires this to be labeled as
The user can manually make this single change while leaving the rest of
the nonmem2mrgsolve code unmodified:

<img src="./readme_images/vignette_07.png" style="width:100.0%" />
<img src="./readme_images/vignette_07.PNG" style="width:100.0%" />

Compiling the corrected mrgsolve code is successful:

Expand All @@ -214,7 +214,7 @@ source("./vignette/models/evolocumab-tmdd-qss-pkpd-101/mrgsolve_code_evolocumab-
mrgsolve::mcode("Test_Modified_Translation",code)
```

<img src="./readme_images/vignette_08.png" style="width:50.0%" />
<img src="./readme_images/vignette_08.PNG" style="width:50.0%" />

### Example 3: A Whole-body Physiologically-based Pharmacokinetic (PBPK) Model

Expand All @@ -234,7 +234,7 @@ source("./vignette/models/mavoglurant-pbpk-101/mrgsolve_code_mavoglurant-pbpk.R"
mrgsolve::mcode("Test_Unmodified_Translation",code)
```

<img src="./readme_images/vignette_09.png" style="width:80.0%" />
<img src="./readme_images/vignette_09.PNG" style="width:80.0%" />

From the error message it is clear that the issue occurred because
“RATE” was not declared in the parameter block ($PARAM). Additionally,
Expand All @@ -243,8 +243,8 @@ this should be renamed since “RATE” is a reserved term.
The user can manually make these two changes while leaving the rest of
the nonmem2mrgsolve code unmodified:

<img src="./readme_images/vignette_10.png" style="width:100.0%" />
<img src="./readme_images/vignette_11.png" style="width:100.0%" />
<img src="./readme_images/vignette_10.PNG" style="width:100.0%" />
<img src="./readme_images/vignette_11.PNG" style="width:100.0%" />

Compiling the corrected mrgsolve code is successful:

Expand All @@ -253,4 +253,4 @@ source("./vignette/models/mavoglurant-pbpk-101/mrgsolve_code_mavoglurant-pbpk_us
mrgsolve::mcode("Test_Modified_Translation",code)
```

<img src="./readme_images/vignette_12.png" style="width:50.0%" />
<img src="./readme_images/vignette_12.PNG" style="width:50.0%" />

0 comments on commit 17123be

Please sign in to comment.