diff --git a/R/ubiquity.r b/R/ubiquity.r index 22de9bb..c5b39af 100644 --- a/R/ubiquity.r +++ b/R/ubiquity.r @@ -758,6 +758,8 @@ system_fetch_template <- function(cfg, template="Simulation", overwrite=FALSE, write_file = c(TRUE) } if(template == "NONMEM" || template == "Monolix" ){ + # Needed because capture is created in an eval + capture = NULL deps_found = TRUE # Walking through the dependencies to make sure everything is needed if(system.file(package="rxode2") == ""){ diff --git a/docs/articles/Howto.html b/docs/articles/Howto.html index a1b548e..1c6904d 100644 --- a/docs/articles/Howto.html +++ b/docs/articles/Howto.html @@ -319,7 +319,7 @@

Models in different formats< # Outputs and error models Cc_mg_ml = Cc - Cc_mg_ml ~ prop(prop_err) + add(add_err) + Cc_mg_ml ~ add(add_err) + prop(prop_err) }) } @@ -372,7 +372,7 @@

Models in different formats< Cp)/Vc + Dinf/Vc) d/dt(Cp) = (+Q * (Cc - Cp)/Vt) Cc_mg_ml = Cc - Cc_mg_ml ~ prop(prop_err) + add(add_err) + Cc_mg_ml ~ add(add_err) + prop(prop_err) }) } diff --git a/docs/articles/In_Vitro.html b/docs/articles/In_Vitro.html index 3f2d2ca..f019cfe 100644 --- a/docs/articles/In_Vitro.html +++ b/docs/articles/In_Vitro.html @@ -193,85 +193,85 @@

The dataset: in_vitro_er_data.cs

This table contains a snapshot of the relevant columns of the dataset:

- - + +
- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +

C_A0

C_B0

Effect

treat

samp_time

C_A0

C_B0

Effect

treat

samp_time

0.001

0.1

102.15401

A_0_001_B_0_1

1

0.001

0.1

102.15401

A_0_001_B_0_1

1

0.001

0.1

100.78589

A_0_001_B_0_1

1

0.001

0.1

100.78589

A_0_001_B_0_1

1

0.001

0.1

91.14621

A_0_001_B_0_1

1

0.001

0.1

91.14621

A_0_001_B_0_1

1

0.001

100

93.38012

A_0_001_B_100

1

0.001

100

93.38012

A_0_001_B_100

1

0.001

100

91.03467

A_0_001_B_100

1

0.001

100

91.03467

A_0_001_B_100

1

0.001

100

86.20118

A_0_001_B_100

1

0.001

100

86.20118

A_0_001_B_100

1

0.001

500

51.76744

A_0_001_B_500

1

0.001

500

51.76744

A_0_001_B_500

1

0.001

500

48.95016

A_0_001_B_500

1

0.001

500

48.95016

A_0_001_B_500

1

0.001

500

52.68611

A_0_001_B_500

1

0.001

500

52.68611

A_0_001_B_500

1

0.001

1000

28.46122

A_0_001_B_1000

1

0.001

1000

28.46122

A_0_001_B_1000

1

diff --git a/docs/articles/NCA.html b/docs/articles/NCA.html index 8d5feaa..b6ab656 100644 --- a/docs/articles/NCA.html +++ b/docs/articles/NCA.html @@ -451,166 +451,166 @@

Summarizing Datacomponents field.

- - + +
- - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +

ID

Cmax

Tmax

Half-life

AUC last

ID

Cmax

Tmax

Half-life

AUC last

(ng/ml)

(ng/ml)

1

9,950

1

423

1,760,000

1

9,950

1

423

1,760,000

2

11,300

1

477

2,510,000

2

11,300

1

477

2,510,000

3

7,420

1

500

2,320,000

3

7,420

1

500

2,320,000

4

5,760

1

589

1,650,000

4

5,760

1

589

1,650,000

5

6,460

1

574

1,890,000

5

6,460

1

574

1,890,000

6

9,460

1

526

2,450,000

6

9,460

1

526

2,450,000

7

13,800

1

627

3,230,000

7

13,800

1

627

3,230,000

8

7,160

1

567

1,970,000

8

7,160

1

567

1,970,000

9

9,180

1

561

2,180,000

9

9,180

1

561

2,180,000

10

4,760

1

500

1,250,000

10

4,760

1

500

1,250,000

11

4,670

1

599

1,630,000

11

4,670

1

599

1,630,000

12

12,100

1

546

2,620,000

12

12,100

1

546

2,620,000

13

6,380

1

581

2,010,000

13

6,380

1

581

2,010,000

14

5,130

1

549

1,620,000

14

5,130

1

549

1,620,000

15

4,910

1

751

1,890,000

15

4,910

1

751

1,890,000

16

7,580

1

619

1,640,000

16

7,580

1

619

1,640,000

17

10,200

1

507

2,500,000

17

10,200

1

507

2,500,000

18

10,600

1

639

2,900,000

18

10,600

1

639

2,900,000

Mean (Std Dev)

563 (73.1)

2110000 (517000)

Mean (Std Dev)

563 (73.1)

2110000 (517000)

Median

1

Median

1

diff --git a/docs/articles/Reporting.html b/docs/articles/Reporting.html index ec082fd..d715c00 100644 --- a/docs/articles/Reporting.html +++ b/docs/articles/Reporting.html @@ -650,153 +650,153 @@

PowerPoint - - + +
- - - + + + - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + +

Master/Template

onbrand

Content

Master/Template

onbrand

Content

Name

Placeholder

Type

Name

Placeholder

Type

title_slide

title

text

title_slide

title

text

sub_title

text

sub_title

text

section_slide

title

text

section_slide

title

text

sub_title

text

sub_title

text

title_only

title

text

title_only

title

text

content_text

title

text

content_text

title

text

sub_title

text

sub_title

text

content_body

text

content_body

text

content_list

title

text

content_list

title

text

sub_title

text

sub_title

text

content_body

list

content_body

list

two_content_header_list

title

text

two_content_header_list

title

text

sub_title

text

sub_title

text

content_left_header

text

content_left_header

text

content_left

list

content_left

list

content_right_header

text

content_right_header

text

content_right

list

content_right

list

two_content_header_text

title

text

two_content_header_text

title

text

sub_title

text

sub_title

text

content_left_header

text

content_left_header

text

content_left

text

content_left

text

content_right_header

text

content_right_header

text

content_right

text

content_right

text

two_content_list

title

text

two_content_list

title

text

sub_title

text

sub_title

text

content_left

list

content_left

list

content_right

list

content_right

list

two_content_text

title

text

two_content_text

title

text

sub_title

text

sub_title

text

content_left

text

content_left

text

content_right

text

content_right

text

@@ -809,70 +809,70 @@

Word following styles defined. When you create the onbrand mapping file you will need to use the onbrand Style name listed.

- - + +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + +

onbrand

Word

Style

onbrand

Word

Style

Style

Style

Type

Style

Style

Type

Code

Code

paragraph

Code

Code

paragraph

Figure_Caption

graphic title

paragraph

Figure_Caption

graphic title

paragraph

Heading_1

heading 1

paragraph

Heading_1

heading 1

paragraph

Heading_2

heading 2

paragraph

Heading_2

heading 2

paragraph

Heading_3

heading 3

paragraph

Heading_3

heading 3

paragraph

Normal

Normal

paragraph

Normal

Normal

paragraph

Notes

Notes

paragraph

Notes

Notes

paragraph

TOC

toc 1

paragraph

TOC

toc 1

paragraph

Table_Caption

table title

paragraph

Table_Caption

table title

paragraph

Table

Table Grid

table

Table

Table Grid

table

diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 3d416d9..d676481 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -11,7 +11,7 @@ articles: Reporting: Reporting.html Simulation: Simulation.html Titration: Titration.html -last_built: 2025-01-01T04:46Z +last_built: 2025-01-01T05:14Z urls: reference: https://r.ubiquity.tools/reference article: https://r.ubiquity.tools/articles diff --git a/docs/reference/build_system.html b/docs/reference/build_system.html index 3678442..51e45fe 100644 --- a/docs/reference/build_system.html +++ b/docs/reference/build_system.html @@ -134,7 +134,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Creating output directory diff --git a/docs/reference/system_fetch_iiv.html b/docs/reference/system_fetch_iiv.html index 9267e93..9648c8a 100644 --- a/docs/reference/system_fetch_iiv.html +++ b/docs/reference/system_fetch_iiv.html @@ -112,7 +112,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_fetch_parameters.html b/docs/reference/system_fetch_parameters.html index ebed4cf..3e83d00 100644 --- a/docs/reference/system_fetch_parameters.html +++ b/docs/reference/system_fetch_parameters.html @@ -100,7 +100,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_fetch_set.html b/docs/reference/system_fetch_set.html index 54252ef..c868b2b 100644 --- a/docs/reference/system_fetch_set.html +++ b/docs/reference/system_fetch_set.html @@ -101,7 +101,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_fetch_template.html b/docs/reference/system_fetch_template.html index 190b2a0..366522b 100644 --- a/docs/reference/system_fetch_template.html +++ b/docs/reference/system_fetch_template.html @@ -137,7 +137,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system @@ -152,7 +152,7 @@

Examplesfr = system_fetch_template(cfg, template = "Simulation", output_directory = tempdir()) -#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_simulate.R +#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_simulate.R # }

diff --git a/docs/reference/system_log_debug_save.html b/docs/reference/system_log_debug_save.html index 9de7eea..cee7a0b 100644 --- a/docs/reference/system_log_debug_save.html +++ b/docs/reference/system_log_debug_save.html @@ -111,7 +111,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_log_entry.html b/docs/reference/system_log_entry.html index bcd893d..f8e3932 100644 --- a/docs/reference/system_log_entry.html +++ b/docs/reference/system_log_entry.html @@ -101,7 +101,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_log_init.html b/docs/reference/system_log_init.html index ba4ccb6..2e724de 100644 --- a/docs/reference/system_log_init.html +++ b/docs/reference/system_log_init.html @@ -97,7 +97,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_select_set.html b/docs/reference/system_select_set.html index 71643e9..9acc133 100644 --- a/docs/reference/system_select_set.html +++ b/docs/reference/system_select_set.html @@ -114,7 +114,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_set_bolus.html b/docs/reference/system_set_bolus.html index 484d161..f898db8 100644 --- a/docs/reference/system_set_bolus.html +++ b/docs/reference/system_set_bolus.html @@ -113,7 +113,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_set_covariate.html b/docs/reference/system_set_covariate.html index 69afb45..14b17cc 100644 --- a/docs/reference/system_set_covariate.html +++ b/docs/reference/system_set_covariate.html @@ -115,7 +115,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_set_iiv.html b/docs/reference/system_set_iiv.html index 1ad643f..f7e4a00 100644 --- a/docs/reference/system_set_iiv.html +++ b/docs/reference/system_set_iiv.html @@ -116,7 +116,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_set_rate.html b/docs/reference/system_set_rate.html index 8b50f93..d746b79 100644 --- a/docs/reference/system_set_rate.html +++ b/docs/reference/system_set_rate.html @@ -113,7 +113,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/system_view.html b/docs/reference/system_view.html index 6d9f65d..9ef70e3 100644 --- a/docs/reference/system_view.html +++ b/docs/reference/system_view.html @@ -119,7 +119,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system @@ -192,10 +192,10 @@

Examples#>#> → On parameters #> → ka, ETAka(LN) -#> → Vp, ETAVp(LN) -#> → Vc, ETAVc(LN) -#> → Q, ETAQ(LN) #> → CL, ETACL(LN) +#> → Q, ETAQ(LN) +#> → Vc, ETAVc(LN) +#> → Vp, ETAVp(LN) #> #> → integrate_with c-file #> → output_times min = 0; max = 10.0; length = 101 diff --git a/docs/reference/system_zero_inputs.html b/docs/reference/system_zero_inputs.html index c8d4640..2999687 100644 --- a/docs/reference/system_zero_inputs.html +++ b/docs/reference/system_zero_inputs.html @@ -115,7 +115,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/vp.html b/docs/reference/vp.html index 551c182..d99ffee 100644 --- a/docs/reference/vp.html +++ b/docs/reference/vp.html @@ -107,7 +107,7 @@

Examples output_directory = file.path(tempdir(), "output"), temporary_directory = tempdir()) #> -#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY +#> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system diff --git a/docs/reference/workshop_fetch.html b/docs/reference/workshop_fetch.html index 47b5160..51059cd 100644 --- a/docs/reference/workshop_fetch.html +++ b/docs/reference/workshop_fetch.html @@ -111,21 +111,21 @@

DetailsExamples

# \donttest{
 workshop_fetch("Estimation", output_directory=tempdir(), overwrite=TRUE)
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent.r
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite.r
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite_global.r
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite_nm_data.r
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/system.txt
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/pm_data.csv
-#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/nm_data.csv
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent.r
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite.r
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite_global.r
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite_nm_data.r
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/system.txt
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/pm_data.csv
+#> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/nm_data.csv
 #> $sources
-#> [1] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent.r"                   
-#> [2] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite.r"        
-#> [3] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite_global.r" 
-#> [4] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite_nm_data.r"
-#> [5] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/systems/system-adapt.txt"                    
-#> [6] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/csv/pm_data.csv"                             
-#> [7] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/csv/nm_data.csv"                             
+#> [1] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent.r"                   
+#> [2] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite.r"        
+#> [3] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite_global.r" 
+#> [4] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite_nm_data.r"
+#> [5] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/systems/system-adapt.txt"                    
+#> [6] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/csv/pm_data.csv"                             
+#> [7] "/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/csv/nm_data.csv"                             
 #> 
 #> $destinations
 #> [1] "analysis_parent.r"                   
diff --git a/docs/search.json b/docs/search.json
index 13a20b2..52fec60 100644
--- a/docs/search.json
+++ b/docs/search.json
@@ -1 +1 @@
-[{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Model Deployment","text":"model developed may useful provide easy way run simulations automate specific analyses. , ubiquity provides ShinyApp allows model run easy use interface highly customizable. App can run locally (useful meetings answer quick questions) deployed Shiny server allow others access model. demonstrate interface can begin PK model mAbs humans (Davda etal. mAbs, 6(4), 1094-1102) : Use ?system_new see list available system file examples. building system can create ShinyApp template: create following three files: ubiquity_app.R - Script run control ubiquity ShinyApp server.R - Server script ui.R- UI script","code":"library(ubiquity) system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE) cfg = build_system(system_file = \"system.txt\") system_fetch_template(cfg, template = \"ShinyApp\", overwrite = TRUE)"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"running-the-model","dir":"Articles","previous_headings":"","what":"Running the model","title":"Model Deployment","text":"Next simply open ubiquity_app.R RStudio source , RStudio open window associated application. ShinyApp tends work better run within browser. starting App load default dosing file run model. first model output plotted. make changes App, changes reflected user log bottom screen. can change outputs plotted, axis limits, aspects plot using plot controls figure. intent provide quick method get model running default behaviors provide users need. behavior ShinyApp can customized (described ). First discuss default interface:","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"altering-dosing","dir":"Articles","previous_headings":"Running the model","what":"Altering dosing","title":"Model Deployment","text":"list bolus times values can specified comma-separated values. dose repeated fashion check ``Repeat last dose’’ box, provide dosing interval (units dosing times), give number doses administer. example repeat 400 mg dose every two weeks two doses. Rates infusion specified set switching times corresponding infusion rates (separated commas). infusion rates held constant next switching time. example infuse drug 800mg/min starting time 0, infusion turned (set 0) 30 minutes.","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"population-simulations","dir":"Articles","previous_headings":"Running the model","what":"Population simulations","title":"Model Deployment","text":"variability system parameters specified (? ?) “Variability” tab visible. Simply check “Simulate variability” box, alter number subjects, prediction interval, elements variance-covariance matrix simulate desired population response. select “Update Plot”, selected output plotted (mean – solid line, selected confidence interval – shaded region).","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"saving-model-results","dir":"Articles","previous_headings":"","what":"Saving model results","title":"Model Deployment","text":"save model results need provide descriptive name analysis, push save button, click link generated. select time stamp, appended name zip file. default following files saved: analysis_single_dose_400_mg_lib.r, analysis_single_dose_400_mg.r - two files can used recreate results ShinyApp. analysis_single_dose_400_mg_timecourse.png - Time-course simulation results analysis_single_dose_400_mg.csv - Predictions containing timescale model, every state, output analysis_single_dose_400_mg_RX.html - file report (X) specified ubiquity_app.R (See ) system.txt - system file describing model ubiquity_log.txt - log file user done","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-scripts","dir":"Articles","previous_headings":"Saving model results","what":"Model scripts","title":"Model Deployment","text":"files analysis_NAME.r analysis_NAME_lib.r can used two ways. First, two files can used stand-alone files recreate simulation results ShinyApp. Creating Simulation Scripts main script (analysis_NAME.r) can used starting point create simulation scripts. necessary modify First comment sourcing standalone library: Next (script system.txt file) uncommenting following lines force system rebuilt changes system file loaded.","code":"#source(\"analysis_NAME_lib.r\"); if(!require(ubiquity)){   source(file.path('library', 'r_general', 'ubiquity.R')) } cfg = build_system(system_file=\"system.txt\")"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"controlling-what-is-saved","dir":"Articles","previous_headings":"Saving model results","what":"Controlling what is saved","title":"Model Deployment","text":"certain instances may want allow user access everything saved default. edit ubiquity_app.R can alter pushed user setting relevant fields FALSE.","code":"cfg$gui$save$system_txt = TRUE cfg$gui$save$user_log   = TRUE"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-diagram","dir":"Articles","previous_headings":"Model documentation","what":"Model diagram","title":"Model Deployment","text":"can difficult user look set parameters, dosing inputs, outputs determine model works. aid user can useful create model diagram. utilize majority screen space, image roughly twice wide tall. can create image favorite drawing program. Inkscape free vector drawing program available inkscape.org. run following: create file system.svg. can edit save portable network graphics (png) file named system.png directory ubiquity_app.R file. start ShinyApp find file create tab plotting area App.","code":"system_fetch_template(cfg, template=\"Model Diagram\")"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-reports","dir":"Articles","previous_headings":"Model documentation","what":"Model reports","title":"Model Deployment","text":"Sometimes need detail annotated model diagram. may need perform calculations based results simulation. may better present information tabulated format. scenarios can create RMarkdown file. Create copy report template (system_report.Rmd) script test (test_system_report.r): called ’ll access ubiquity model object (cfg) simulation results som. simulation results take form deterministic simulation (see output ?run_simulation_ubiquity) , variability checked, stochastic simulation (see output ?simulate_subjects) tell ShinyApp load report (named system_report.Rmd), following lines need added ubiquity_app.R. title field title tab ShinyApp file name file created. can create five reports way, differentiated list name (R1, R2, … R5). file test_system_report.r can used debug model report file. First run model ShinyApp reports disabled. App runs stores state (cfg) current simulation results (som) following data files: cfg \\rightarrow transient/rgui/default/gui_state.RData som \\rightarrow transient/rgui/default/gui_som.RData Next load test script, modify report name accordingly, run : generate report HTML format. can insert debugging commands report test add information. working, can enable report described appear tab viewable user. reports may depend user input. example, RMarkdown file documents modeling assumptions model construction process content change user interacts App. use pre-rendered report simply replace .Rmd .html: tell App read html, prevent rendering report, speed things user.","code":"system_fetch_template(cfg, template=\"Shiny Rmd Report\") cfg$gui$modelreport_files$R1$title = \"Tab Title\" cfg$gui$modelreport_files$R1$file  = \"system_report.Rmd\" load(\"transient/rgui/default/gui_som.RData\") load(\"transient/rgui/default/gui_state.RData\") params = list() params$cfg = cfg params$som = som rmarkdown::render(\"system_report.Rmd\",                    params = params,                    output_format = \"html_document\") cfg$gui$modelreport_files$R1$title = \"Tab Title\" cfg$gui$modelreport_files$R1$file  = \"system_report.html\""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"user-definable-functions","dir":"Articles","previous_headings":"","what":"User definable functions","title":"Model Deployment","text":"customize simulation plotting within ShinyApp necessary create custom functions. need placed file. example placed mylibs.r main template directory. Lastly, need tell ShinyApp load file. need edit ubiquity_app.R add following line:","code":"cfg$gui$functions$user_def = 'mylibs.r'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"custom-simulation-commands","dir":"Articles","previous_headings":"User definable functions","what":"Custom simulation commands","title":"Model Deployment","text":"default ShinyApp run simulations using run_simulation_ubiquity (individual) simulate_subjects (population). take inputs parameters vector containing current parameter set changes made interface cfg data structure. can create functions overwrite defining following: Individual Simulations Population Simulations Note order use default plotting functionality functions need return values format default functions individual (run_simulation_ubiquity) population (simulate_subjects) simulations.","code":"cfg$gui$functions$sim_ind = 'function_name(parameters, cfg)' cfg$gui$functions$sim_var = 'function_name(parameters, cfg)'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"custom-plotting-commands","dir":"Articles","previous_headings":"User definable functions","what":"Custom plotting commands","title":"Model Deployment","text":"customize plotting output need create functions can utilize simulation output som. individual population simulations output run_simulation_ubiquity simulate_subjects, respectively. Unless user-specified simulation functions used. case som can format needed. possible also access parameters vector containing current parameter set changes made interface cfg data structure. can create plotting functions overwrite defining following ubiquity_app.R: Indiviudal Plot Population Plot","code":"cfg$gui$functions$plot_ind =  'function_name(cfg, parameters,som)' cfg$gui$functions$plot_var =  'function_name(cfg, parameters,som)'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"deployment-on-a-shiny-server","dir":"Articles","previous_headings":"","what":"Deployment on a Shiny Server","title":"Model Deployment","text":"deploy ShinyApp shiny server need indicate modifying ubiquity_app.R changing deploying variable TRUE: ShinyApp needs initialized server. can two ways. First can create empty file called REBUILD needs deployed along side app files. can touch command nat.utils package: force initialization first time app loaded. works well using rsconnect deploy app. Alternatively, can manually sync files run following shiny user server. App fails run Shiny Server check following: Make sure correct packages installed available user Shiny Server running . Make sure ownership permissions server files correct. test deployment can install shinyVM","code":"deploying = TRUE nat.utils::touch(\"REBUILD\") R -e \"source('ubiquity_app.R')\""},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Naive-Pooled Parameter Estimation","text":"workshop (workshop.ubiquity.tools) provides several examples performing parameter estimation ubiquity. make copy scripts supporting files current working directory run following: analysis_parent.r - Least squares estimation single output analysis_parent_metabolite.r - Maximum likelihood estimation two outputs analysis_parent_metabolite_global.r - Using global optimization packages analysis_parent_metabolite_nm_data.r - Reading cohorts NONMEM file scripts build previous one demonstrate different features ubiquity parameter estimation routines. examples use system (shown figure ) contains three differential equations tracking mass parent drug blood (Mpb) tissue space (Mpt). blood parent can form (fmKp) metabolite (Mmb) subsequent elimination (Km). parent/metabolite model adapted ADAPT5 Users Manual (https://bmsr.usc.edu/files/2013/02/ADAPT5-User-Guide.pdf). Using system_new (use ?system_new see list available system file examples) can copy template file current directory build system: system built, can create local copy estimation template system: create file: analysis_estimate.R working directory. beginning script three variables created control script format output. variable analysis_name defines prefix prepended output generated script. Archiving analysis results controlled Boolean variable archive_results. Lastly, script controlled using flowctl variable (possible options listed commented ). estimation script following main components: Select parameter set subset parameters estimate Set options (simulation, estimation, etc) Load datasets Define cohorts Estimate parameters Plot results explored using scripts .","code":"library(ubiquity) fr = workshop_fetch(section=\"Estimation\", overwrite=TRUE) library(ubiquity) system_new(file_name=\"system.txt\", system_file=\"adapt\", overwrite = TRUE) cfg = build_system(system_file = \"system.txt\") system_fetch_template(cfg, template=\"Estimation\")"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"least-squares-estimationsingle-output-analysis_parent-r","dir":"Articles","previous_headings":"","what":"Least squares estimation/single output (analysis_parent.r)","title":"Naive-Pooled Parameter Estimation","text":"first example (analysis_parent.r) begins specifying want perform parameter estimation archive results using name1 parent_d1030 indicate analyzing parent PK 10 30 mg dosing cohorts: Next select parameters estimate. ’re estimating parent data, names parameters relevant parent PK (pnames) selected. estimate parameters simply exclude third argument. system parameters estimated weighted least squares objective used2. Next set options relevant estimation underlying simulation routines. example simulation output times specified, relevant parameters can set. template generated several common options commented . can uncommented modified needed. dataset (shown table ) included ubiquity package accessed using system.file. example script referenced explicitly. format requirements datasets flat files header row. format flexible requires time/observation information columns required filter data isolate cohorts received treatment. inputs defined cohorts defined. Data files loaded using system_load_data() name3 assigned dataset. Data can read files (csv, xls, xlsx, tab) existing data frame. name (pm_data ) used reference dataset later script. dataset column observation time (TIME), subject id (ID), concentrations parent (PT) metabolite (MT), BLQ flag nominal dose (DOSE). columns used (TIME, PT, MT DOSE), others (BQL) ignored. intended example general guide dataset format. necessary different outputs different columns (wide format). dataset loaded tall skinny format well. example going analyze parent data individuals given 10 30 mg using least squares objective. Next need identify data inputs associated data. done defining cohorts, groups data receive treatment model inputs (bolus dosing, infusion rates, covariates) associated cohorts. example define cohort dosing group. make sure starting blank slate can use system_clear_cohorts() remove previously defined information. cohort define list information cohort. cohort unique name field4 dataset field pointing dataset (pm_data) loaded . optional cohort filter (cf) field used reduce entire dataset records associated cohort. See help system_define_cohort() information construct cohort filters. Next necessary define inputs cohort. inputs refers model inputs may include dosing well covariates, estimation template (generated using system_fetch_template() ) contain placeholders defined system file. Note: bolus infusion inputs, necessary define inputs nonzero, covariates necessary define differ definitions system file. input AMT field TIME field units specified system file (AMT TIME internal indentifiers taken dataset). Next need match outputs model outputs dataset. cohort$outputs field used group output. cohort output mapping blood PK parent output Parent. times observations dataset found 'TIME’ column ’PT’ column (missing data specified -1 dropped). mapped model timescale ('hours', specified ) model output (’Cpblood’, specified ). Note units dataset must model: output grouping cohort marker color, shape line type can specified (controlling plotted output). Finally cohort defined using system_define_cohort(): thing 30 mg dose group: cohorts defined call estimation function (system_estimate_parameters()). flowctl set 'plot previous estimate' 'plot guess' values just returned. one estimation options selected flowctl several files generated output folder analysis_name prefix: output/parent_d1030-report.txt - Text file summary estimation results. output/parent_d1030-parameters_all.csv - Summary table parameters (estimated fixed) output/parent_d1030-parameters_est.csv - Summary table estimated parameters output/parent_d1030-system_update.txt - Text update system.txt file new parameter estimates output/parent_d1030-sessionInfo.RData - output sessionInfo() stored SI object data file Next system simulated estimate data stored erp. information variable used generate standard plots , may desirable save information generate figures. necessary understand structure erp. list two different fields. TIME - Time units data OBS - Observations (SMOOTH = FALSE), -1 (SMOOTH=TRUE) PRED - Predictions (SMOOTH = FALSE) VAR - Variance (SMOOTH = FALSE), -1 (SMOOTH=TRUE) SMOOTH - FALSE observation times, TRUE observations OUTPUT - name output COHORT - name cohort ts.time - Simulation time scale ts.TS - entry timescale TS pred - Simulated predictions name - State model output cohort - Cohort name Lastly predictions overlaying data observed vs predicted plots generated using system_plot_cohorts(). Basic formatting figures controlled using plot_opts list (see ?system_plot_cohorts details). called, system_plot_cohorts() write png pdf output time course observed vs predicted files. also return list ggplot objects relative paths files well. example following generated: output/parent_d1030_time course_Parent.pdf output/parent_d1030_time course_Parent.png output/parent_d1030_obs_pred_Parent.pdf output/parent_d1030_obs_pred_Parent.png","code":"flowctl = 'estimate' archive_results = TRUE analysis_name = 'parent_d1030' pnames = c('Vp', 'Vt', 'CLp', 'Q') cfg = system_select_set(cfg, \"default\", pnames) cfg=system_set_option(cfg, group  = \"simulation\",                             option = \"output_times\",                             seq(0,100,1)) cfg = system_load_data(cfg, dsname     = \"pm_data\",                              data_file  = system.file(\"ubinc\", \"csv\",                                                      \"pm_data.csv\",                                                       package = \"ubiquity\")) cfg = system_clear_cohorts(cfg) cohort = list(   name         = \"dose_10\",   cf           = list(DOSE      = c(10)),   inputs       = NULL,   outputs      = NULL,   dataset      = \"pm_data\") cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours  cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]]  = c(10) # mpk cohort[[\"outputs\"]][[\"Parent\"]] = list()  # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list(          time           = \"TIME\",          value          = \"PT\",          missing        = -1)  # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list(          time           = \"hours\",                 value          = \"Cpblood\",             variance       = \"1\")  # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list(          marker_color   = \"black\",          marker_shape   = 1,          marker_line    = 2 ) cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list(          marker_color   = \"black\",          marker_shape   = 1,          marker_line    = 2 ) cfg = system_define_cohort(cfg, cohort) cohort = list(   name         = \"dose_30\",   cf           = list(DOSE      = c(30)),   dataset      = \"pm_data\",   inputs       = NULL,   outputs      = NULL)  # Bolus inputs for the cohort cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours  cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]]  = c(30) # mpk    # Defining Parent output cohort[[\"outputs\"]][[\"Parent\"]] = list()  # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list(          time           = \"TIME\",          value          = \"PT\",          missing        = -1)  # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list(          time           = \"hours\",                 value          = \"Cpblood\",             variance       = \"1\")  # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list(          marker_color   = \"red\",          marker_shape   = 2,          marker_line    = 2 ) cfg = system_define_cohort(cfg, cohort) pest = system_estimate_parameters(cfg,                                    flowctl         = flowctl,                                    analysis_name   = analysis_name,                                    archive_results = archive_results) cfg=system_set_option(cfg, group  = \"simulation\",                             option = \"output_times\",                             seq(0,100,5)) erp = system_simulate_estimation_results(pest = pest, cfg = cfg) plot_opts = c() plot_opts$outputs$Parent$yscale       = 'log' plinfo = system_plot_cohorts(erp, plot_opts, cfg, analysis_name=analysis_name)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"automated-reporting","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r)","what":"Automated Reporting","title":"Naive-Pooled Parameter Estimation","text":"outputs provide components generating presentations documents. Coping pasting figures tables documents can tedious. can convenient automate process accomplished function system_rpt_estimation().","code":""},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"powerpoint","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r) > Automated Reporting","what":"PowerPoint","title":"Naive-Pooled Parameter Estimation","text":"append results analysis PowerPoint document simply initialize new report (template=\"PowerPoint\"), call system_rpt_estimation() appropriate analysis_name, results analysis attached slides. save analysis results output directory.","code":"cfg = system_rpt_read_template(cfg, template=\"PowerPoint\") cfg = system_rpt_estimation(cfg=cfg, analysis_name=analysis_name) system_rpt_save_report(cfg=cfg,  output_file=file.path(\"output\",paste(analysis_name, \"-report.pptx\", sep=\"\")))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"word","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r) > Automated Reporting","what":"Word","title":"Naive-Pooled Parameter Estimation","text":"process Word document . Just make sure template set \"Word\" report initialized: information integrated report generation see Reporting vignette.","code":"cfg = system_rpt_read_template(cfg, template=\"Word\") cfg = system_rpt_estimation(cfg=cfg, analysis_name=analysis_name) system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",paste(analysis_name, \"-report.docx\", sep=\"\")))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"maximum-likelihoodtwo-outputs-analysis_parent_metabolite-r","dir":"Articles","previous_headings":"","what":"Maximum likelihood/two outputs (analysis_parent_metabolite.r)","title":"Naive-Pooled Parameter Estimation","text":"example similar last except analyzing two different outputs (parent metabolite) proportional variance model. now can estimate parameters associated outputs well variance parameters: parameters estimated contain variance parameters (slope_parent slope_metabolite) maximum likelihood objective used. cohort definitions look much except variance model defined 'slope_parent*PRED^2', separate output named Metabolite. Similar modifications made 30 mg dosing cohort. Note: variance model can speified system.txt file using  descriptor. specify variance cohort definition value system file used. specified either location default value (PRED^2) used.","code":"pnames = c('Vp',            'Vt',            'Vm',            'CLp',            'Q',            'CLm',            'slope_parent',            'slope_metabolite');  cfg = system_select_set(cfg, \"default\", pnames) cohort = list(   name         = \"dose_10\",   cf           = list(DOSE      = c(10)),   inputs       = NULL,   outputs      = NULL,   dataset      = \"pm_data\")   # Bolus inputs for the cohort cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours  cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]]  = c(10) # mpk    # Defining Parent output cohort[[\"outputs\"]][[\"Parent\"]] = list()  # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list(          time           = \"TIME\",          value          = \"PT\",          missing        = -1)  # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list(          time           = \"hours\",                 value          = \"Cpblood\",             variance       = \"slope_parent*PRED^2\")  # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list(          marker_color   = \"black\",          marker_shape   = 1,          marker_line    = 1 )  # Defining Metabolite output cohort[[\"outputs\"]][[\"Metabolite\"]] = list()  # Mapping to data set cohort[[\"outputs\"]][[\"Metabolite\"]][[\"obs\"]] = list(          time           = \"TIME\",          value          = \"MT\",          missing        = -1)  # Mapping to system file cohort[[\"outputs\"]][[\"Metabolite\"]][[\"model\"]] = list(          time           = \"hours\",                 value          = \"Cmblood\",             variance       = \"slope_metabolite*PRED^2\")  # Plot formatting cohort[[\"outputs\"]][[\"Metabolite\"]][[\"options\"]] = list(          marker_color   = \"blue\",          marker_shape   = 1,          marker_line    = 1 )  cfg = system_define_cohort(cfg, cohort)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"global-estimation-routines-analysis_parent_metabolite_global-r","dir":"Articles","previous_headings":"","what":"Global estimation routines (analysis_parent_metabolite_global.r)","title":"Naive-Pooled Parameter Estimation","text":"Now build previous example demonstrate select different optimization routines. default, parameter estimation carried using Nelder-Mead optimization method optim library. can specify different functions library. See documentation optim (?optim) valid values method elements control. example, use simulated annealing change method SANN. also global optimization libraries R, two can readily used ubiquity: Particle Swarm Optimizer (pso package) Genetic Algorithms (GA package). use pso package set following options: use GA package set following options: Note: Optimizers like SANN global optimizers (pso GA) good identifying parameter sets outside region initial guess. However, one consequence algorithms can quickly approach bounds. Consequently important provide realistic upper lower bounds parameters (

descriptor system file using system_set_guess() scripting level). use default value machine precision (eps) lower bound infinity (Inf) upper bound optimization routines can choose parameter values can cause internal simulations fail.","code":"cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"SANN\") library(pso) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"pso\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"psoptim\") library(GA) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(maxiter = 10000, optimArgs = list(method = \"Nelder-Mead\", maxiter = 1000)))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"cohorts-from-nonmem-dataset-analysis_parent_metabolite_nm_data-r","dir":"Articles","previous_headings":"","what":"Cohorts from NONMEM dataset (analysis_parent_metabolite_nm_data.r)","title":"Naive-Pooled Parameter Estimation","text":"examples , cohorts defined manually. Sometimes may data NONMEM dataset dosing information located dataset. may convenient simply define cohort subject dataset. function system_define_cohorts_nm can used. differences script analysis_parent_metabolite.r now highlighted: First load NONMEM dataset clear cohorts: Next define filter use dataset (include 10 30 mg doses): information filtering datasets see help nm_select_records(). Now define maps different outputs. output specify variance, compartment (CMT) number, model output missing number flag: Lastly define map model inputs. case bolus Mpb compartment: Unused columns dataset ignored. filter, input observation maps defined, now add cohorts","code":"cfg = system_load_data(cfg, dsname = \"nm_pm_data\", data_file = system.file(\"ubinc\", \"csv\", \"nm_data.csv\", package = \"ubiquity\")) cfg = system_clear_cohorts(cfg); filter = list() filter$DOSE = c(10, 30) OBSMAP = list() OBSMAP$PT = list(variance = 'slope_parent*PRED^2', CMT = 1, output = 'Cpblood', missing = -1 ) OBSMAP$MT = list(variance = 'slope_metabolite*PRED^2', CMT = 2, output = 'Cmblood', missing = -1 ) INPUTMAP = list() INPUTMAP$bolus$Mpb$CMT_NUM = 1 cfg = system_define_cohorts_nm(cfg, DS = 'nm_pm_data', col_ID = 'ID', col_CMT = 'CMT', col_DV = 'DV', col_TIME = 'TIME', col_AMT = 'AMT', col_RATE = 'RATE', col_EVID = 'EVID', col_GROUP= 'DOSE', filter = filter, INPUTS = INPUTMAP, OBS = OBSMAP, group = FALSE)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"contents-of-system-txt","dir":"Articles","previous_headings":"","what":"Contents of system.txt","title":"Naive-Pooled Parameter Estimation","text":"","code":"# # Parent/Metabolite example taken from Section 9.3 of the ADAPT5 Users Manual # # https://bmsr.usc.edu/files/2013/02/ADAPT5-User-Guide.pdf #

Vp 10.0 1e-5 100 L yes System

Vt 10.0 1e-5 100 L yes System

Vm 30.0 1e-5 100 L yes System

CLp 1.0 1e-5 100 L/hr yes System

CLm 1.0 1e-5 100 L/hr yes System

Q 0.3 1e-5 100 L/hr yes System Original Estimates slope_parent 0.1 1e-9 10 -- no Variance slope_metabolite 0.1 1e-9 10 -- no Variance ; [ 0 ]; 1; hours ; Mpb; [ 0 ]; 70; mpk -(CLp/Vp + Q/Vp)*Mpb + Q/Vt*Mpt Q/Vp*Mpb - Q/Vt*Mpt CLp/Vp*Mpb - CLm/Vm*Mmb Cpblood = Mpb/Vp Cmblood = Mmb/Vm 1.0 1.0/24.0 0.08 Vp 0.08 Vt 0.08 CLp 0.08 CLm SIMINT_SEQ[0][100][1] "},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"working-with-rxode2-nlmixr2-nonmem-and-monolix","dir":"Articles","previous_headings":"","what":"Working with rxode2, nlmixr2, NONMEM, and Monolix","title":"Howtos","text":"Say model ubiquity want use nlmixr2. perhaps want try simulation engine rxode2, want hand model someone using Monolix. provide way easily convert model different formats automated fashion.","code":""},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-rxode2-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in rxode2 format","title":"Howtos","text":"example consider system file two compartment model (system_2cmt.txt ). build system rxode2 output target created. can use system_fetch_template() function access file. ’m placing script temporary directory. script generate rxode2 model function store function object my_model. default input nlmixr2. can use function piping methodology things like add IIV terms parameters. can use ubiquity build structural model piping, rxode2, nlmixr2 analysis. can see contents system_nlmixr2.R my_model object looks like . Note include output ubiquity need error model. along Descriptor need define variance parameters () also output error model ().","code":"cfg = build_system(system_file = sf_2cmt_full, temporary_directory = file.path(tempdir(), \"transient\")) fr = system_fetch_template(cfg, template = \"nlmixr2\", output_directory = tempdir(), overwrite = TRUE) library(rxode2) source(file.path(tempdir(), \"system_nlmixr2.R\"))"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-nonmem-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in NONMEM format","title":"Howtos","text":"model rxode2 format can convert NONMEM format babelmixr2 package (via ruminate package). need least one inter-individual variability term. can system file delimiter. example using model piping. specify typical value Vc, parameter TV_Vc, error lognormally distributed. add IIV term eta_Vc. Next just need load ruminate package (>=0.2.4) use rx2other() function create NONMEM control stream:","code":"my_model = my_model |> model({Vc = exp(TV_Vc + eta_Vc)}) library(ruminate) my_model_nm = rx2other(my_model, out_type=\"nonmem\")"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-monolix-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in Monolix format","title":"Howtos","text":"can also get model Monolix specifying monolix output type:","code":"my_model_mlx = rx2other(my_model, out_type=\"monolix\")"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"further-reading","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Further reading","title":"Howtos","text":"discussion topic see following: https://github.com/nlmixr2/babelmixr2/issues/107","code":""},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"models-in-different-formats","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Models in different formats","title":"Howtos","text":"ubiquity rxode2 script rxode2 object NONMEM Monolix Contents system_2cmt.txt file: Contents system_nlmixr2.R file produced system_fetch_template(): my_model object: file containing control stream found : my_model_nm$files$ctl$fn_full. file containing mlxtran output found : my_model_mlx$files$mlxtran$fn_full","code":"# Two compartment model with absorption compartment (At). The central # compartment (Cc) had a volume (Vc), and the tissue compartment (Cp) has a # volume (Vt). The system is parameterized in terms of macro constants (Q and # CL) # # While the the default dosing is a 1 mg IV dose into the central compartment, # the model is written to accept dosing into an absorption compartment and # through continuous IV infusion. # _________ # | | # | At | # | | # |_________| # | # | ka, fb # | # V # _________ _________ # | | Q | | # | Cc |------>| Cp | # | Vc |<------| Vt | # |_________| |_________| # | # | CL # | # V # # System Units: # # mass [=] mg # volume [=] ml # concentration [=] mg/ml # time [=] hr # #-------------# # | Parameters | # #-------------# # # System parameters # name value lower upper units editable grouping # bound bound

Vc 1.0 eps Inf ml yes System

Vt 1.0 eps Inf ml yes System

CL 1.0 eps Inf ml/hr yes System

Q 1.0 eps Inf ml/hr yes System

ka 1.0 eps Inf 1/hr yes System

fb 1.0 eps Inf -- yes System # Bolus Events # ------------ # times/events state values scale units ; [ 0 ]; 1; hours ; Cc; [1.0 ]; 1/Vc; mg ; At; [0.0 ]; 1; mg # Infusion Rates # ------------ # name time/levels values scale units ; times; [0]; 1; hours ; levels; [0]; 1; mg/hour -ka*At ka*At*fb/Vc - CL/Vc*Cc -Q*(Cc-Cp)/Vc + Dinf/Vc +Q*(Cc-Cp)/Vt Cc_mg_ml = Cc prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance add=add_err; prop=prop_err 1.0 1.0/24 # # # my_model <- function() { ini({ # Typical Value of System Parameters TV_Vc = c(.Machine$double.eps, 1.0, Inf) TV_Vt = c(.Machine$double.eps, 1.0, Inf) TV_CL = c(.Machine$double.eps, 1.0, Inf) TV_Q = c(.Machine$double.eps, 1.0, Inf) TV_ka = c(.Machine$double.eps, 1.0, Inf) TV_fb = c(.Machine$double.eps, 1.0, Inf) # Between-subject variability: # Error model parameters prop_err = c(.Machine$double.eps, 0.1, .Machine$double.xmax) add_err = c(.Machine$double.eps, 0.1, .Machine$double.xmax) }) model({ # System Parameters Vc = TV_Vc Vt = TV_Vt CL = TV_CL Q = TV_Q ka = TV_ka fb = TV_fb # Placeholders for infusion rates. # These should be defined in the dataset. # time scale: 1 units: (hours) # mass scale: 1 units: (mg/hour) Dinf = 0.0 # Defining ODEs d/dt(At) = (-ka*At) d/dt(Cc) = (ka*At*fb/Vc - CL/Vc*Cc -Q*(Cc-Cp)/Vc + Dinf/Vc) d/dt(Cp) = (+Q*(Cc-Cp)/Vt) # Outputs and error models Cc_mg_ml = Cc Cc_mg_ml ~ prop(prop_err) + add(add_err) }) } 
[36m──
[39m 
[1mrxode2-based free-form 3-cmt ODE model
[22m 
[36m──────────────────────────────────────
[39m ── 
[1m
[1mInitalization:
[1m
[22m ── 
[1mFixed Effects
[22m (
[1m
[34m$theta
[39m
[22m): TV_Vc TV_Vt TV_CL TV_Q TV_ka TV_fb prop_err add_err 1.0 1.0 1.0 1.0 1.0 1.0 0.1 0.1 
[1mOmega
[22m (
[1m
[34m$omega
[39m
[22m): eta_Vc eta_Vc 1 
[1m States
[22m (
[1m
[34m$state
[39m
[22m or 
[1m
[34m$stateDf
[39m
[22m): Compartment Number Compartment Name 1 1 At 2 2 Cc 3 3 Cp ── 
[1m
[1m
[1m
[1mμ-referencing
[1m
[1m (
[1m
[1m
[34m$muRefTable
[39m
[1m
[1m):
[1m
[22m ── theta eta level 1 TV_Vc eta_Vc id ── 
[1m
[1mModel (Normalized Syntax):
[1m
[22m ── function() { ini({ TV_Vc <- c(2.22044604925031e-16, 1) TV_Vt <- c(2.22044604925031e-16, 1) TV_CL <- c(2.22044604925031e-16, 1) TV_Q <- c(2.22044604925031e-16, 1) TV_ka <- c(2.22044604925031e-16, 1) TV_fb <- c(2.22044604925031e-16, 1) prop_err <- c(2.22044604925031e-16, 0.1) add_err <- c(2.22044604925031e-16, 0.1) eta_Vc ~ 1 }) model({ Vc <- exp(TV_Vc + eta_Vc) Vt = TV_Vt CL = TV_CL Q = TV_Q ka = TV_ka fb = TV_fb Dinf = 0 d/dt(At) = (-ka * At) d/dt(Cc) = (ka * At * fb/Vc - CL/Vc * Cc - Q * (Cc - Cp)/Vc + Dinf/Vc) d/dt(Cp) = (+Q * (Cc - Cp)/Vt) Cc_mg_ml = Cc Cc_mg_ml ~ prop(prop_err) + add(add_err) }) } $PROBLEM translated from babelmixr2 ; comments show mu referenced model in ui$getSplitMuModel $DATA my_model.csv IGNORE=@ $INPUT ID TIME EVID AMT DV CMT RXROW $SUBROUTINES ADVAN13 TOL=6 ATOL=12 SSTOL=6 SSATOL=12 $MODEL NCOMPARTMENTS=3 COMP(AT, DEFDOSE) ; At COMP(CC) ; Cc COMP(CP) ; Cp $PK MU_1=THETA(1) VC=DEXP(MU_1+ETA(1)) ; Vc <- exp(TV_Vc) VT=THETA(2) ; Vt <- TV_Vt CL=THETA(3) ; CL <- TV_CL RXR1=THETA(4) ; Q <- TV_Q KA=THETA(5) ; ka <- TV_ka FB=THETA(6) ; fb <- TV_fb $DES DINF=0 ; Dinf = 0 DADT(1) = (- KA*A(1)) ; d/dt(At) = (-ka * At) DADT(2) = (KA*A(1)*FB/VC-CL/VC*A(2)-RXR1*(A(2)-A(3))/VC+DINF/VC) ; d/dt(Cc) = (ka * At * fb/Vc - CL/Vc * Cc - Q * (Cc - Cp)/Vc + Dinf/Vc) DADT(3) = (RXR1*(A(2)-A(3))/VT) ; d/dt(Cp) = (Q * (Cc - Cp)/Vt) CC_MG_ML=A(2) ; Cc_mg_ml = Cc $ERROR ;Redefine LHS in $DES by prefixing with on RXE_ for $ERROR RXE_DINF=0 ; Dinf = 0 RXE_CC_MG_ML=A(2) ; Cc_mg_ml = Cc RX_PF1=RXE_CC_MG_ML ; rx_pf1 ~ Cc_mg_ml ; Write out expressions for ipred and w RX_IP1 = RX_PF1 RX_P1 = RX_IP1 W1=DSQRT((THETA(8))**2+(RX_PF1)**2*(THETA(7))**2) ; W1 ~ sqrt((add_err)^2 + (rx_pred_f_)^2 * (prop_err)^2) IF (W1 .EQ. 0.0) W1 = 1 IPRED = RX_IP1 W = W1 Y = IPRED + W*EPS(1) $THETA (2.2204e-16, 1 ) ; 1 - TV_Vc (2.2204e-16, 1 ) ; 2 - TV_Vt (2.2204e-16, 1 ) ; 3 - TV_CL (2.2204e-16, 1 ) ; 4 - TV_Q (2.2204e-16, 1 ) ; 5 - TV_ka (2.2204e-16, 1 ) ; 6 - TV_fb (2.2204e-16, 0.1) ; 7 - prop_err (2.2204e-16, 0.1) ; 8 - add_err $OMEGA 1 ; eta_Vc $SIGMA 1 FIX $ESTIMATION METHOD=1 INTER MAXEVALS=100000 SIGDIG=3 SIGL=12 PRINT=1 NOABORT $COVARIANCE $TABLE ID ETAS(1:LAST) OBJI FIRSTONLY ONEHEADER NOPRINT FORMAT=s1PE17.9 NOAPPEND FILE=my_model.eta $TABLE ID TIME IPRED PRED RXROW ONEHEADER NOPRINT FORMAT=s1PE17.9 NOAPPEND FILE=my_model.pred [FILEINFO] file='my_model-monolix.csv' delimiter = comma header = {ID, TIME, EVID, AMT, DV, ADM, nlmixrRowNums} [CONTENT] ID = {use=identifier} TIME = {use=time} EVID = {use=eventidentifier} AMT = {use=amount} DV = {use=observation, name=rx_prd_Cc_mg_ml, type=continuous} ADM = {use=administration} [INDIVIDUAL] input={Vc_pop, omega_Vc, Vt_pop, CL_pop, Q_pop, ka_pop, fb_pop} DEFINITION: Vc = {distribution=logNormal, typical=Vc_pop, sd=omega_Vc} Vt = {distribution=normal, typical=Vt_pop, no-variability} CL = {distribution=normal, typical=CL_pop, no-variability} Q = {distribution=normal, typical=Q_pop, no-variability} ka = {distribution=normal, typical=ka_pop, no-variability} fb = {distribution=normal, typical=fb_pop, no-variability} [LONGITUDINAL] input={add_err, prop_err} file='my_model-monolix.txt' DEFINITION: rx_prd_Cc_mg_ml={distribution = normal, prediction = rx_pred_Cc_mg_ml, errorModel=combined2(add_err,prop_err)} data={rx_prd_Cc_mg_ml} model={rx_prd_Cc_mg_ml} Vc_pop={value=2.71828182845905, method=MLE} Vt_pop={value=1, method=MLE} CL_pop={value=1, method=MLE} Q_pop={value=1, method=MLE} ka_pop={value=1, method=MLE} fb_pop={value=1, method=MLE} prop_err={value=0.1, method=MLE} add_err={value=0.1, method=MLE} omega_Vc={value=1, method=MLE} [TASKS] populationParameters() individualParameters(method = {conditionalMode}) fim(method = StochasticApproximation) logLikelihood(method = ImportanceSampling) plotResult(method = {outputplot, indfits, obspred, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) [SETTINGS] GLOBAL: exportpath = 'my_model-monolix' POPULATION: exploratoryautostop = no smoothingautostop = no burniniterations = 5 exploratoryiterations = 250 simulatedannealingiterations = 250 smoothingiterations = 200 exploratoryalpha = 0 exploratoryinterval = 200 omegatau = 0.95 errormodeltau = 0.95"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Analysis of Static Systems, an In Vitro Example","text":"tutorial requires ubiquity 2.04 greater. Currently available using development version github Sometimes need analyze data independent variable time. can ubiquity tutorial highlight done. done already, please review naive-pooled parameter estimation tutorial build concepts covered . workshop (workshop.ubiquity.tools) provides example analyize static vitro data. make copy scripts supporting files current working directory run following: create following files current working direcotry: system-in_vitro.txt - System file can run vivo vitro in_vitro_er_data.csv- vitro data file mk_data_in_vitro.R- Script generate vitro data analysis_in_vitro.R- Script perform parameter estimation using vitro data example uses system Chakraborty Jusko. J Pharm Sci 91(5), 1334-1342. Specifically equation 5 article effect two drugs, B, driven concentrations (C_A, C_B): E = 100 \\left( 1- \\frac{ \\frac{I_{max,}(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} + \\frac{I_{max,B}(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ + (I_{max,} + I_{max,B} + I_{max,} I_{max,B}) \\\\ \\times \\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} \\times \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ }{ \\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} + \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ +\\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} \\times \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} +1 } \\right) \\xi = \\frac{IC_{50,}}{IC_{50,B}} implemented PKPD system file (system-in_vitro.txt) shown bottom. implementation dynamic meaning effect changes PK drug. However effect considered instantaneous typically analyzed vitro data using algebraic relationships. system consider following data: concentrations drug B altered (independent variable) Effect measured (dependent variable).","code":"library(ubiquity) fr = workshop_fetch(section=\"In Vitro\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-sysem-file-system-in_vitro-txt","dir":"Articles","previous_headings":"","what":"The sysem file: system-in_vitro.txt","title":"Analysis of Static Systems, an In Vitro Example","text":"First lets discuss way system file structured. bolus dosing PK specified, initial conditions effect compartments also defined terms system parameters: system parameters (C_A0 C_B0) default value zero. default system run like vivo PKPD system. initial condition placeholders used performing vitro analyses. allows use system file vitro vivo analyses. useful static vitro analysis one system file copy paste vivo dynamic system.","code":" Cp_A = C_A0 Cp_B = C_B0"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-dataset-in_vitro_er_data-csv","dir":"Articles","previous_headings":"","what":"The dataset: in_vitro_er_data.csv","title":"Analysis of Static Systems, an In Vitro Example","text":"table contains snapshot relevant columns dataset: C_A0 C_B0 Effect treat samp_time 0.001 0.1 102.15401 A_0_001_B_0_1 1 0.001 0.1 100.78589 A_0_001_B_0_1 1 0.001 0.1 91.14621 A_0_001_B_0_1 1 0.001 100 93.38012 A_0_001_B_100 1 0.001 100 91.03467 A_0_001_B_100 1 0.001 100 86.20118 A_0_001_B_100 1 0.001 500 51.76744 A_0_001_B_500 1 0.001 500 48.95016 A_0_001_B_500 1 0.001 500 52.68611 A_0_001_B_500 1 0.001 1000 28.46122 A_0_001_B_1000 1 C_A0 C_B0 columns correspond concentrations elicit Effect. treat column unique name combination two drug concentrations. letters numbers underscores. intentional can use cohort name ’m constructing estimation script . samp_time column set 1. arbitrary mapping cohort definitions requires time column. ’ll see arbitrary .","code":""},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-analysis-script-analysis_in_vitro-r","dir":"Articles","previous_headings":"","what":"The analysis script: analysis_in_vitro.R","title":"Analysis of Static Systems, an In Vitro Example","text":"analysis scripts aspects unique vitro analysis performed.","code":""},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"output-times","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Output times","title":"Analysis of Static Systems, an In Vitro Example","text":"First output times. run simulations (happens performing parameter estimation) output times results slower simulations. important include ncesssary output times. case two output times (0 1): final value 1 chosen corresponds time column (samp_time) analysis dataset.","code":"cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,1,1))"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"making-a-dynamic-simulation-static","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Making a dynamic simulation static:","title":"Analysis of Static Systems, an In Vitro Example","text":"Next set simulation option dynamic FALSE: fix values differential equations 0 purposes subsequent simulations. available ubiquity version \\ge 2.04.","code":"cfg=system_set_option(cfg, group = \"simulation\", option = \"dynamic\", value = FALSE)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"datasets","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Datasets","title":"Analysis of Static Systems, an In Vitro Example","text":"dataset reading dataframe loading way. done dataset used internally ubiqiuty also construct analysis :","code":"er_data = readr::read_csv(\"in_vitro_er_data.csv\") cfg = system_load_data(cfg, dsname = \"er_data\", data_file = er_data)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"defining-cohorts","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Defining cohorts","title":"Analysis of Static Systems, an In Vitro Example","text":"estimation tutorial cohorts defined individually. rather tedious. See need cohort every unique combination C_A0 C_B0 dataset. going loop unique value treat column create cohort. variable tmp_treat contains value current treatment first thing get records current treatment: subset data used define initial condition parameters current cohort using cp field (see help system_define_cohort() information option). way treat column constructed can use cohort name. allow us link simulated output original dataset post processing section . inputs set NULL change dosing. set simulation option dynamic FALSE, initial condition set values current treatment, inputs, system effectively behaving like vitro system.","code":"treat_recs = dplyr::filter(er_data, treat == tmp_treat) cohort = list( name = tmp_treat, cf = list( treat = c(tmp_treat)), cp = list( C_A0 = treat_recs$C_A0[1], C_B0 = treat_recs$C_B0[1]), inputs = NULL, outputs = NULL, dataset = \"er_data\")"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"postprocessing","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Postprocessing","title":"Analysis of Static Systems, an In Vitro Example","text":"rely normal figure generation reporting elements. example can take simulated output estimation erp original data dataset er_data create meaningful diagnostic plots. can link two datasets using treat column original dataset COHORT column erp$pred:","code":"df_orig = er_data |> dplyr::select(C_A0, C_B0, ave_eff, treat) |> dplyr::distinct() df_est = erp$pred |> dplyr::filter(!SMOOTH) |> dplyr::rename(treat = COHORT) df_plot = dplyr::full_join(df_est, df_orig, by=\"treat\") |> dplyr::mutate(C_B0 = as.factor(C_B0)) library(ggplot2) p = ggplot(data=df_plot) + geom_point(aes(x=C_A0, y=OBS, group=C_B0, color=C_B0)) + geom_line(aes(x=C_A0, y=PRED, group=C_B0, color=C_B0)) + scale_x_log10()"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"contents-of-system-in_vitro-txt","dir":"Articles","previous_headings":"","what":"Contents of system-in_vitro.txt","title":"Analysis of Static Systems, an In Vitro Example","text":"","code":"# Author: John Harrold # # Analysis of an in vitro system. The system below was taken from: # # Chakraborty A, Jusko WJ. Pharmacodynamic interaction of recombinant human # interleukin-10 and prednisolone using in vitro whole blood lymphocyte # proliferation. J Pharm Sci. 2002 May;91(5):1334-42. doi: 10.1002/jps.3000. # PMID: 11977109. # # #-------------# # | Parameters | # #-------------# # # System parameters # name value lower upper units editable grouping # bound bound

IC50_A 1.0 eps Inf ----- yes Efficacy

IC50_B 50.0 eps Inf ----- yes Efficacy

Imax_A 1.0 eps Inf ----- yes Efficacy

Imax_B 1.0 eps Inf ----- yes Efficacy

PSI 10.0 eps Inf ----- yes Efficacy

G_A 0.6 eps Inf ----- yes Efficacy

G_B 1.4 eps Inf ----- yes Efficacy

Vp_A 1.0 eps Inf ml yes PK

CL_A 1.0 eps Inf ml/hr yes PK

Vp_B 1.0 eps Inf ml yes PK

CL_B 1.0 eps Inf ml/hr yes PK

C_A0 0.0 eps Inf ----- yes IC

C_B0 0.0 eps Inf ----- yes IC # #-------------------# # |Input Information | # #-------------------# # # Bolus Events # ------------ # times/events state values scale units ; [ 0 ]; 1.0; hours ; Cp_A; [1.0 ]; 1.0/Vp_A; mg ; Cp_B; [1.0 ]; 1.0/Vp_B; mg # By default these values are zero but can be overwritten when # doing analysis of in vitro data. Cp_A = C_A0 Cp_B = C_B0 XI = IC50_A/IC50_B COMP_A = SIMINT_POWER[Cp_A][G_A]/(SIMINT_POWER[PSI*IC50_A][G_A]) COMP_B = SIMINT_POWER[XI*Cp_B][G_B]/(SIMINT_POWER[PSI*IC50_A][G_B]) COMP_Imax = Imax_A + Imax_B - Imax_A*Imax_B EFF_num = Imax_A*COMP_A + Imax_B*COMP_B + COMP_Imax*COMP_A*COMP_B EFF_den = COMP_A + COMP_B + COMP_A*COMP_B + 1.0 EFF = 100.0*(1.0-EFF_num/EFF_den) # #-----------------------------# # | ODEs, and State Information | # #-----------------------------# CL_A/Vp_A*Cp_A CL_B/Vp_B*Cp_B # #---------# # | Outputs | # #---------# Cp_A_mg_ml = Cp_A Cp_B_mg_ml = Cp_B Effect = EFF # prop_err 1.0 eps Inf ----- yes IC # prop=prop_err # #---------# # | Options # # #---------# # specify different time scales 1.0"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Modeling Language","text":"core, ubiquity modeling language set scripts meant facilitate model development deployment. focus document model description language. plain text file, referred system file. line contains descriptor (e.g. 

) defines aspect model, comments made hash sign (#). follows overview different components language can used create system file.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"system-parameters-p","dir":"Articles","previous_headings":"Parameters","what":"System parameters

","title":"Modeling Language","text":"system parameter specified name, value, lower bound, upper bound, units, whether editable ShinyApp ‘type’ parameter (grouping ShinyApp). values eps (machine precision, smallest value zero) inf (infinity) can used. example specify parameter koffR value .1 positive parameter KDR value .04 also positive following used:","code":"# name value lb ub units editable type

koffR 0.1 eps inf 1/hr yes Target

KDR 0.04 eps inf nM yes Target"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"parameter-sets","dir":"Articles","previous_headings":"Parameters","what":"Parameter sets","title":"Modeling Language","text":"Often model developed incorporate different situations scenarios. example, model may used describe healthy diseased individuals. differences simply parametric nature, can cumbersome code model multiple times (parameterization). framework provides mechanism including multiple parameterizations withing system file. Consider system want describe antibody disposition. humans described two compartment model, mice single compartment needed. First create set parameters describing human scenario. mean parameters taken literature [DM]: parameter created using

descriptor part default parameter set. short name1 parameter set. longer verbose name can given well, seen ShinyApp. human parameter set can labeled using PSET descriptor following way: default parameter set short name name, “mAb Human” value shown user ShinyApp. Next, add parameterization mice simply create new set following way: alone create new parameter set short name mouse, exact copy default parameter set. identify parametric differences mouse human use PSET following way: Consider clearance parameter entry want murine half-life antibody [VR]: use set name (mouse) parameter name (CL) overwrite default specified value 7.71e-6. aspects parameter (bounds, edit flag, etc.) default value.","code":"

Weight 70.0 eps inf kg yes System # Organism weight

CL 0.0129 eps inf L/hr yes System # Systemic Clearance

Q 0.0329 eps inf L/hr yes System # Inter-compartmental clearance

Vp 3.1 eps inf L yes System # Vol. central compartment

Vt 2.8 eps inf L yes System # Vol. peripheral compartment mAb in Human mAb in Mouse 0.020 # 20 gram mouse 7.71e-6 0.0 1.6e-3 1 # arbitrary 7.71e-6"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"secondary-parameters-as-and-ad","dir":"Articles","previous_headings":"Parameters","what":"Secondary parameters and ","title":"Modeling Language","text":"static secondary parameter refers parameter change simulation. specified using <> descriptor can written terms system parameters previously defined static secondary parameters. can used differential equations, defining initial conditions, input scaling model outputs. similar secondary parameters defined $PK block NONMEM. example, wanted define rate elimination terms system parameters clearance CL volume distribution Vp following used: dynamic secondary parameters refers parameter can change simulation. typically means defined, using descriptor, terms state another dynamic secondary parameter. can used differential equations model outputs. similar parameters defined $DES block NONMEM. example wanted use concentration central compartment Cp dependent amount compartment Ap volume compartment Vp following used:","code":" kel = CL/Vp Cp = Ap/Vp"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"variance-parameters-vp","dir":"Articles","previous_headings":"Parameters","what":"Variance parameters ","title":"Modeling Language","text":"Variance parameters specified using format system parameters (

) : difference descriptor used grouping set Variance. used performing parameter estimation simulating residual variability.","code":"# name value lower_bound upper_bound units editable grouping SLOPE 0.01 eps inf 1/hr yes Variance"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"parameter-estimation-information-est","dir":"Articles","previous_headings":"Parameters","what":"Parameter estimation information ?","title":"Modeling Language","text":"Currently applies nlmixr2/rxode . Essentially parameters listed fixed. descriptor specifies information parameters estimation. Sometimes necessary estimate parameters log space. can specify parmaeters log transform (LT). wanted log transform parameters P1, P2, P3 following: NOTE Monolix outputs work correctly need logtransform parameters log-normal IIV assigned. default parameters specified estimation. want estimate subset parameters (P), say P1 P2, can use following:","code":" P1; P2; P3 P1; P2"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"variability-defining-the-variancecovariance-matrix-iiv-iivcor","dir":"Articles","previous_headings":"Parameters","what":"Variability: defining the variance/covariance Matrix ? & ?","title":"Modeling Language","text":"variable name assigned inter-individual variability (IIV) correlation/covariance (IIVCOR) term makes sense user may used. following sample codes variable names (eg: ETACL) likely make sense population modeler NONMEM user. define IIV term named ETACL variance 0.15 use following: next need associate IIV term system parameter. associate IIV term clearance (system parameter CL) specify log normal distribution (LN) simply write: Alternatively normal (N) distribution can used. Next specify IIV term ETAV variance 0.1. IIV term also log normal distribution applied parameter V: Now can define covariance (-diagonal elements) CL V 0.01 using: order isn’t important IIV terms can reversed","code":" 0.15 CL 0.10 V 0.01"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"iiv-and-parameter-sets-iivset-iivcorset","dir":"Articles","previous_headings":"Parameters","what":"IIV and parameter sets ? & ?","title":"Modeling Language","text":"default parameter sets inter individual variability specified using descriptors. associate specific set IIVs parameter set use descriptors. set descriptors operate differently parameter set descriptors (). just overwrites default values inherits default variance/covariance information. alter IIV information parameter set reset IIV information parameter set. entire variance covariance matrix need specified parameter set. parameter set MYPSET defined following used define IIV parameters Q CL: system parameters IIV information parameter set.","code":" 0.05 Q 0.25 CL 0.01"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"differential-equations","dir":"Articles","previous_headings":"","what":"Differential equations","title":"Modeling Language","text":"differential equations system can defined simply writing . Alternative can ‘built’ using different descriptors provided . Part flexibility ubiquity lies ability combine different notations. construct model (see section : Bringing together) combination five following methods can used: Differential equations Reaction rates =?=> Equilibrium relationships <=kforward:kreverse=> Sources sinks Movement compartments ","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"writing-odes-ode","dir":"Articles","previous_headings":"Differential equations","what":"Writing ODEs ","title":"Modeling Language","text":"Portions differential equations can specified ? state compartment. define dA/dT koffR*C - konR**B write: might convenient specify ODE across several lines, making things readable. Just use multiple statements appended together. give result example :","code":" koffR*C - konR*A*B koffR*C - konR*A*B"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"rate-equations","dir":"Articles","previous_headings":"Differential equations","what":"Rate equations =?=>","title":"Modeling Language","text":"may convenient write chemical reactions rather differential equations. can done using general form: stoichiometric coefficients, beginning CR CP , brackets need specified one. reaction order assumed equal stoichiometric coefficient reactant. specific example Consider decomposition hydrogen peroxide water oxygen: H_2O_2 \\xrightarrow{k_{deg}} H_2O + \\frac{1}{2}O_2 system format written following manner: translated following differential equations: \\frac{dH_2O_2}{dt}=-k_{deg}H_2O_2 \\\\ \\frac{dH_2O}{dt}= k_{deg}H_2O_2 \\\\ \\frac{dO_2}{dt}= 0.5k_{deg}H_2O_2 also defined differential equations using ?. equivalent: rates (e.g. kdeg) need defined either system secondary parameter. can put saturable terms, Michaelis-Menten kinetics.","code":"[CR1]Reactant1 + [CR2]Reactant2 + ... =kf=> [CP1]Product1 + [CP2]Product2 + ... H2O2 =kdeg=> H2O + [0.5]O2 - kdeg*H2O2 kdeg*H2O2 0.5*kdeg*H2O2"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"equilibrium-relationships-kforwardkreverse","dir":"Articles","previous_headings":"Differential equations","what":"Equilibrium relationships <=kforward:kreverse=>","title":"Modeling Language","text":"Forward reverse reaction rates can written separately: can written equilibrium equations forward (konR) reverse (koffR) rates specified : specify reaction differential equations, following also used: stoichiometric coefficients also define reaction order . example, create following equilibrium reaction: 2A + 3B \\mathop{\\rightleftarrows}^{\\mathrm{k_f}}_{\\mathrm{k_r}} 4C rate notation used system file: produce following terms differential equations: \\frac{dA}{dt} = 2k_rC^4 - 2k_fA^2B^3 \\\\ \\frac{dB}{dt} = 3k_rC^4 - 3k_fA^2B^3 \\\\ \\frac{dC}{dt} =-4k_rC^4 + 4k_fA^2B^3 write equilibrium reaction differential equations following used: See generic functions SIMINT_POWER[][].","code":"A + B =konR=> C C =koffR=> A + B A + B <=konR:koffR=> C koffR*C - konR*A*B koffR*C - konR*A*B -koffR*C + konR*A*B [2]A + [3]B <=kf:kr=> [4]C = 2*kr*SIMINT_POWER[C][4] - 2*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3] = 3*kr*SIMINT_POWER[C][4] - 3*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3] = -4*kr*SIMINT_POWER[C][4] + 4*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"sources-and-sinks-s","dir":"Articles","previous_headings":"Differential equations","what":"Sources and sinks ","title":"Modeling Language","text":"method allows turnover described terms synthesis degradation terms. produced rate ksynA (mass quantities), degraded rate kdegA, modeled concentration units sources specified left hand side sinks (elimination) specified left hand side . Multiple sources sinks can separated semicolons. example compartment volume V writing differential equation:","code":"ksynA/V kdeg*A koffR*C - konR*A*B + ksynA/V - kdeg*A"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"movement-between-compartments-c","dir":"Articles","previous_headings":"Differential equations","what":"Movement between compartments ","title":"Modeling Language","text":"mass moves two physical spaces different volumes need specify, compartment, species, volume rate transport. descriptor allows us just identify compartment information separated semicolons (order important) movement central compartment volume V tissue space volume Vt rates kps ksp respectively specified following manner: equivalent following differential equation:","code":"Species; Volume; Rate Species; Volume; Rate A; V; kps At; Vt; ksp -kps*A + ksp*At*Vt/V +kps*A*V/Vt - ksp*At"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"bringing-it-all-together","dir":"Articles","previous_headings":"","what":"Bringing it all together","title":"Modeling Language","text":"final example consider target-mediated drug disposition system . system can defined set ODES: simply defined terms underlying processes:","code":" Cp*kpt*Vp/Vt - Ct*ktp -Cp*kpt + Ct*ktp*Vt/Vp - kel*Cp + koff*CpTp - kon*Cp*Tp + ksyn/Vp - kint*Tp + koff*CpTp - kon*Cp*Tp - kint*CpTp - koff*CpTp + kon*Cp*Tp # tissue distribution Ct; Vt; ktp Cp; Vp; kpt # equilibrium Cp + Tp <=kon:koff=> CpTp # Turnover ksyn/Vp kint*Tp kel*Cp kint*CpTp"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"initial-conditions-i","dir":"Articles","previous_headings":"Bringing it all together","what":"Initial conditions ","title":"Modeling Language","text":"default initial conditions zero. can specify non-zero initial condition using <> string set ‘state’ ‘value’ Value can combination numbers, system parameters

static secondary parameters <. Consider turnover system value ksyn kdeg specified parameters: can calculate initial value target : can specify initial value target :","code":" state = value

ksyn 0.1 eps inf 1/hr yes Target

kdeg 0.04 eps inf nM yes Target T_IC = ksyn/kdeg T = T_IC"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"model-inputs","dir":"Articles","previous_headings":"","what":"Model inputs","title":"Modeling Language","text":"Inputs model include typical interventions bolus dosing continuous infusions. However inputs refers mathematical inputs. Typically covariates may attributes system (gender, specific genotype), treated inputs. defining inputs necessary provide typical/placeholder values. provide default values ShinyApp interface well scripting level (Matlab R) can overwritten user.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"bolus-dosing-btimes-bevents","dir":"Articles","previous_headings":"Model inputs","what":"Bolus dosing , ","title":"Modeling Language","text":" descriptor used define bolus dosing. Dosing information broken list times bolus injections occur list events containing amount specified compartment receive. scale used convert bolus dosing information proscribed units (mg daily) units system coded (mg/mL hours). dosing done days 0, 1, 2… simulation time hours, scale dosing times 24.events contain magnitude bolus given time. want dose central compartment Cp mg/kg central compartment mg/mL need scale body weight (e.g. 70 kg) volume central compartment (system static secondary parameter Vp) scale 70/Vp. just want create palceholder can following: want setup default dosing shiny app scripts, can somethign complicated. multiple compartments receiving bolus, times must include times bolus may applied system. state receive bolus particular time, magnitude time 0. illustrate consider following dosing schedule: example want dose two different drugs two different states/compartments. Drug 1 (D1) dosed Cp1 drug 2 (D2) Cp2. Dosing mg/kg concentrations mg/ml. dosing time days, simulation time units hours. dosing D1 8 & 2 mpk days 0 & 6. D2 dosed 5 mpk day 9. Assume V1 V2 compartmental volumes D1 D2 ml, subject body weight 70 kg. convert doses mpk mg/ml. default doses can overwritten ShinyApp within scripts.","code":"# type state values scale units ; [0]; 24; days ; Cp; [0]; 70/Vc; mpk # type state values scale units ; [0 6 9]; 24; days ; Cp1; [8 2 0]; 70/V1; mpk ; Cp2; [0 0 5]; 70/V2; mpk"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"continuous-infusions-r","dir":"Articles","previous_headings":"Model inputs","what":"Continuous infusions ","title":"Modeling Language","text":"Rates infusion defined using descriptor. Like bolus values, infusion rates two components. component specifies switching times (e.g. switching 10 mg/hr 0). switching time corresponding rate infusion. infusion rate held constant next time. Also like bolus specification scale associated infusion times levels converts proscriptive units units simulation. Consider following example: two entries create infusion rate called myrate. can used system specifications (e.g., myrate/Vp). first row specifies times rate changed (0 30 minutes). system coded terms hours, scale 1/60 must used. levels indicate rate 1 mg/min switched 30 minutes. converted mg/hr using scale 60. can add many paired rate entries need describe many infusion interventions necessary. Note: just want placeholder can just set values [0].","code":"# name time/levels values scale units ; times; [0 30]; 1/60; min ; levels; [1 0]; 60; mg/min"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"simple-covariates","dir":"Articles","previous_headings":"Model inputs","what":"Simple covariates","title":"Modeling Language","text":"simulation purposes covariates (normally found dataset) need defined. Covariates can either constant change time. times values must scale system. following defines value covariate RACE: Covariates can also change time. case consider subject weight (WGT). begins 70 measurements made several time points. Next can alter simulations interpret values setting type covariate. default weight linearly interpolated (type = linear), however can hold weight constant next measurement encountered (last value carried forward) declaring type step Now model parameterized male female subjects can define two parameter sets (described ) account : values covariate can changed set ‘female’:","code":"; times; [0]; hours ; values; [1]; ethnicity ; times; [ 0 1680 3360 5040 10080]; hours ; values; [70 65 60 58 56]; kg step Male Female ; times; [ 0 1680 3360 10080] ; values; [60 55 52 50]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"complicated-covariates","dir":"Articles","previous_headings":"Model inputs","what":"Complicated covariates","title":"Modeling Language","text":"Detailed time course profiles can created well. example, create covariate profile zero time 0-1 time 1 jumps 8 decreases rate 1 per unit time time 5 stays value 4 time 12. might profile like following:","code":"# name time/values values units ; times; [0 .999 1 5 12]; hours ; values; [0 0 8 4 4 ]; -- linear"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"model-outputs","dir":"Articles","previous_headings":"","what":"Model outputs","title":"Modeling Language","text":"Outputs defined terms states, parameters, secondary parameters, input rates, covariates listed . format used : example: Outputs begin QC, like QC_CLtot , displayed ShinyApp. intended make available scripting level quality control (QC) purposes.","code":" name = expression A_obs = A Coverage = A/(KD + A) QC_CLtot = Cp*CL/Vp + Cp*Vmax/(Km+Cp)"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"output-error-model-oe","dir":"Articles","previous_headings":"Model outputs","what":"Output error model ?","title":"Modeling Language","text":"links parameters defined using specific outputs defined using . can define either add additive /prop proportional error: OUTPUT can name output defined . expression model type (add additive, prop proportional) equal sign name variance paramter () use. use one error model type separate statments ; example define variance parameters add_err prop_err want use proportional error model output Cp use: use additive proportional error following work: certain target-specific considerations. example using Matlab R just wanted weighted least squares estimation proportional prediction squared use following fix prop_err 1. least squares estimation following fix add_err 1. represent default values though ’s possible overwrite . Matlab R workflows define variance cohort level, error models system file overwritten. ## Functions operators standard operators behave expected (+, -, *, & /) languages use consistently. however certain operators functions differ languages. example, consider power function (^b). FORTRAN **b, Matlab ^b, C pow(,b). Given objectives (write create multiple formats), can quite challenging. solution used convert language specific functions operators generic functions. power operator : converted appropriate output format depending output target. following generic functions can used:","code":"` expression` prop=prop_err add=add_err; prop=prop_err prop=prop_err add=add_err SIMINT_POWER[a][b]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"current-simulation-time","dir":"Articles","previous_headings":"Model outputs","what":"Current simulation time","title":"Modeling Language","text":"systems want access simulation time. can use internal variable SIMINT_TIME.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"modeling-quasi-equilibrium-of-target-mediated-drugs","dir":"Articles","previous_headings":"Model outputs","what":"Modeling quasi-equilibrium of target-mediated drugs","title":"Modeling Language","text":"free amount drug Cfree binding receptor affinity KD given total values Ctot Rtot following can calculated using following equation: C_{free}=\\frac{1}{2} \\left[ (C_{tot}-R_{tot}-K_D) + \\sqrt{(C_{tot}-R_{tot}-K_D)^2 + 4K_DC_{tot}} \\right] can tedious, especially using generic functions . make easier can use following generic function: get Rfree, just switch first two arguments:","code":" Cfree = SIMINT_QEQ[Ctot][Rtot][KD] Rfree = SIMINT_QEQ[Rtot][Ctot][KD]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"timescales","dir":"Articles","previous_headings":"","what":"Timescales","title":"Modeling Language","text":"system default units constructed, indicated comments model. can useful (generating figures example) show simulations different time scales. Now can achieved multiplying time outputs correct scaling factor. However requires end user (1) remember original timescale (2) correctly scale value. Now particularly challenging mathematical perspective, introduces chance error. possible, instead, specify time scale information using descriptor. system coded hours, following define timescales default (hours), days, weeks months: used ShinyApp command line Matlab R","code":" 1.0 1.0/24.0 1.0/24.0/7.0 1.0/24.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"mathematical-sets","dir":"Articles","previous_headings":"","what":"Mathematical sets","title":"Modeling Language","text":"Consider following systems: PBPK: organs systems mathematically identical, variations parameters. However coding organs modifying existing system (say incorporate presences target organ) can become tedious. Anti-drug antibody generation: consider ADAs generated response therapeutic proteins, response consist distribution ADAs terms concentration separate distribution terms affinity. Modeling maturation process interactions ADAs, therapeutic protein, drug targets becomes unmanageable quickly. question : can make difficult problems easy intractable problems possible? solution implemented allows system defined terms mathematical sets","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-notation-set","dir":"Articles","previous_headings":"Mathematical sets","what":"Set notation ?","title":"Modeling Language","text":"Consider interactions occurring assay designed detect drug (D) present serum. assay biotinylated target (TB) used pull drug labeled target (TL) signaling molecule used. assay provide signal complex containing TB TL present (TB:D:TL TL:D:TB). Samples can contain soluble target well (TS) can interfere assay. model assay, following interactions considered: Several options available construct system. ODEs simply typed every possible combination. ’s also possible use equilibrium <=kon:koff=> interactions well. However, another option handle enumeration easily. First define two mathematical sets TSi TSk: defined can use curly brace notation ({ }) descriptors used construct system. example, initial conditions target states defined parameters (T0_TL, T0_TS, T0_TB) model. identified initial conditions using <> notation, can done single statement. line: Expands : Similar initial condition, equilibrium monomeric drug different targets can defined using single statement: uses one sets (TSi) expanded element set. account formation complexes contain drug molecule two different target molecules, following statement used: statement contains two different sets (TSi TSk). multiple sets encountered, every possible combination evaluated","code":" TL; TB; TS TL; TB; TS {TSi} = T0_{TSi} TL = T0_TL TB = T0_TB TS = T0_TS D + {TSi} <=kon:koff=> D_{TSi} D_{TSi} + {TSk} <=kon:koff=> {TSk}_D_{TSi}"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"aligning-sets","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Aligning Sets","title":"Modeling Language","text":"default sets interpreted evaluating every possible permutation shown . However, may desirable pair align sets. Take example transit compartments implemented Lobo Balthasar delay onset drug effect cancer cells [LB]. transit compartment implemented using series differential equations: \\frac{dK1}{dt} = (K-K1)\\frac{1}{\\tau} \\\\ \\frac{dK2}{dt} = (K1-K2)\\frac{1}{\\tau} \\\\ \\frac{dK3}{dt} = (K2-K3)\\frac{1}{\\tau} \\\\ \\frac{dK4}{dt} = (K3-K4)\\frac{1}{\\tau} ’s possible code individually, ’s also possible define using mathematical set notation. see first equation K paired aligned K1, second ’s K1 K2, etc. first define two sets equal length whose elements aligned: Next write ? statement terms sets, use SIMINT_SET_ALIGN function: first argument names sets align separated semicolon ; second argument system file descriptor written terms sets. expanded internally :","code":" K; K1; K2; K3 K1; K2; K3; K4 SIMINT_SET_ALIGN[TRIN;TROUT][ 1.0/tau*({TRIN}-{TROUT})] 1.0/tau*(K-K1) 1.0/tau*(K1-K2) 1.0/tau*(K2-K3) 1.0/tau*(K3-K4)"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-functions","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Set Functions","title":"Modeling Language","text":"can useful perform operations sets. can use following functions: SIMINT_SET_SUM mathematical equivalent \\sum_{SET} SIMINT_SET_PRODUCT mathematical equivalent \\prod_{SET} functions take two bracketed arguments. first argument set name second argument mathematical relationship expanded. example, consider system parameterized several species. variable EN_Mouse 1 species mouse 0 otherwise. Similarly EN_Human, EN_Monkey, etc. also defined body weights system parameters: BW_Mouse mouse, BW_Human human, etc. Now want assign BW value currently selected species (EN species 1). First define species parameter set: Next define secondary parameter BW summing product Boolean species parameter body weight species:","code":" Mouse; Rat; Monkey; Human BW = SIMINT_SET_SUM[SP][EN_{SP}*BW_{SP}]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-evaluation","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Set Evaluation","title":"Modeling Language","text":"Sets evaluated following order: First set functions (SIMINT_SET_SUM SIMINT_SET_PRODUCT) evaluated. Next aligned sets applied (SIMINT_SET_ALIGN) Lastly, remaining sets evaluated every permutation","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"piecewise-continuous-functionsparameters-if","dir":"Articles","previous_headings":"","what":"Piecewise-continuous functions/parameters ","title":"Modeling Language","text":"specify conditional assignment use statement: name name secondary parameter defined COND indicates Boolean condition needs satisfied. condition (boolean) can , , greater , etc. relationships. parameter assigned value Boolean relationship true. conditions can function different elements system depending whether name refers static dynamic secondary parameter: <> function system parameters, previously defined static secondary parameters covariates change given subject. function system parameters, static secondary parameters, states, previously defined dynamic secondary parameters covariates. important include default ELSE condition:","code":" boolean; value value"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"constructing-a-piece-wise-continuous-functionparameter","dir":"Articles","previous_headings":"Piecewise-continuous functions/parameters ","what":"Constructing a piece-wise continuous function/parameter","title":"Modeling Language","text":"see example use following command (use ?system_new see list available system file examples): system_new(system_file=\"pwc\", file_name=\"system-pwc.txt\") example specify fast (kelf) slow (kels) rates elimination. want fast rate active drug concentration Cth time Tf. system parameters look like: Now need define rate elimination constraints followed. First define kel dynamic secondary parameter value 0.0. define different conditions relevant values:","code":"

kelf 1.0 eps inf 1/time yes System

kels 0.01 eps inf 1/time yes System

Cth 10 eps inf conc yes System

Tf 10 eps inf time yes System kel = 0.0 SIMINT_AND[SIMINT_LT[SIMINT_TIME][Tf]][ SIMINT_GT[Cp][Cth]]; kelf kels"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"controlling-indices","dir":"Articles","previous_headings":"","what":"Controlling indices","title":"Modeling Language","text":"default, build script construct odes, parameter sets, etc. automatically. means order states/compartments going arbitrary. Sometimes necessary specify order states outputs. example using NONMEM order control stream must correlate values dataset. specify state Cp compartment 3, following used: general notation output state name assigned number :","code":" 3 number number"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"concentrations-vs-amounts","dir":"Articles","previous_headings":"","what":"Concentrations vs amounts","title":"Modeling Language","text":"’s convenient model systems terms concentrations. However software allow scaling inputs. inputs provided mass units, need differential equation also mass units. can use descriptor system.txt tell ubiquity generate perform conversion differential equations. example, defined state Cc want Ac within nlmixr2 model target. related Cc = Ac/Vc Vc parameter following used:","code":" Cc; Ac; Vc"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"options","dir":"Articles","previous_headings":"","what":"Options","title":"Modeling Language","text":"Several options can specified using ? can used timescale plotting ShinyApp using: define default output times ShinyApp simulation scripts use following:","code":" days SIMINT_SEQ[0][100][1]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"example-system-files","dir":"Articles","previous_headings":"","what":"Example system files","title":"Modeling Language","text":"example system files can found examples directory stand-alone analysis template (ubiquity_template.zip). can also loaded form R package (see help ?system_new). system-adapt.txt - Parent/metabolite structural model taken ADAPT5 Users Manual [ADAPT]. system used estimation examples ubiquity workshop. system-glp_study.txt - PK model parameterized humans NHPs, used example GLP tox study design. system-mab_pk.txt - Linear model mAb PK humans taken [DM]. model used simulation examples ubiquity workshop. system-one_cmt_cl.txt - One compartment model parameterized terms clearances volumes. system-one_cmt_micro.txt - One compartment model parameterized micro constants (rates). system-pbpk.txt - Implementation large molecule PBPK model Shah Betts [SB]. model provides good examples use mathematical set notation. system-pbpk_template.txt - Template containing species parameter [SB]. can used construct systems parameterized multiple species. system-pwc.txt - Example construct piece-wise secondary parameters (.e. using //else statements). system-sets.txt - Example parameterized systems multiple parameter sets. system-tmdd.txt - Example code TMDD model using either ODEs process descriptors. system-tumor.txt - Implementation transit effect model cancer cell inhibition [LB]. demonstrates use aligned mathematical sets. system-two_cmt_cl.txt - Two compartment model parameterized terms clearances volumes system-two_cmt_micro.txt - Two compartment model parameterized terms micro constants (rates)","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"templates","dir":"Articles","previous_headings":"","what":"Templates","title":"Modeling Language","text":"system built, multiple files generated temporary directory (transient) support different software. R package can access templates programatically (see help ?system_fetch_template). list supporting software generated.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"r-workflow","dir":"Articles","previous_headings":"Templates","what":"R workflow","title":"Modeling Language","text":"auto_simulation_driver.R: R-Script named placeholders used run simulations. auto_analysis_estimation.R: R-Script named placeholders used perform naive-pooled parameter estimation.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"matlab-workflow","dir":"Articles","previous_headings":"Templates","what":"Matlab workflow","title":"Modeling Language","text":"auto_simulation_driver.m: M-file named placeholders used run simulations. auto_analysis_estimation.m: M-file named placeholders used perform naive-pooled parameter estimation.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"other-software-targets","dir":"Articles","previous_headings":"Templates","what":"Other Software Targets","title":"Modeling Language","text":"target_adapt_5.target_adapt_5-PSET.prm: system defined Adapt Fortran parameter (prm) file parameter set PSET. target_berkely_madonna-PSET.txt: text file containing system parameter set PSET run Berkeley Madonna. target_mrgsolve-PSET.cpp: C++ file containing system parameter set PSET run using mrgsolve package R. target_nlmixr-PSET.R: R script defines system analysis nlmixr2 parameter set PSET. Note: nlmixr2 target can used create input model files NONMEM Monolix","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Modeling Language","text":"[ADAPT] Adapt 5 Users Guide [DM] Dirks & Meibohm Clin. PK (2010) Oct 1;49(10):633-59 [LB] Lobo, E.D. & Balthasar, J.P. AAPS J (2002) 4, 212-222 [MK] Mager, D.E. & Krzyzanski, W. Pharm Res (2005) 22: 1589. [SB] Shah, D.K. & Betts, .M. JPKPD (2012) 39 (1), 67-86 [VR] Vieira & Rajewsky Eur J Immunol. (1988) Feb;18(2):313-6","code":""},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Noncompartmental Analysis","text":"Non-compartmental analysis (NCA) simple quick method evaluating exposure drug. allows evaluate things like linearity vivo exposure. illustrate consider antibody given subcutaneous injection. actual profile patient might experience given solid black line. don’t yet ability sample continuous fashion. might observer given blue points. Generally NCA determine following directly data: Cmax - Maximum observed concentration (units=concentration) Tmax - time maximum concentration observed (units=time) AUC - area curve (units=time \\times concentration) AUMC - area first moment curve (units=time^2 \\times concentration) properties based observational data. Cmax Tmax certainly actual maximum concentration long sample judiciously give us good approximation. Similarly, calculated AUC AUMC different actual values. calculate areas need dig back calculus text books trapezoid method. Basically sampling interval trapezoid area calculated added n samples: AUC = \\int_0^{t_f} Cdt \\approx \\sum_{=1}^{n-1}{\\frac{C_i+C_{+1}}{2}\\times (t_{+1}-t_{})} AUMC = \\int_0^{t_f} t\\times Cdt \\approx \\sum_{=1}^{n-1}{\\frac{t_iC_i+t_{+1}C_{+1}}{2}\\times (t_{+1}-t_{})} can done Excel pretty easily. Depending data analysis properties can calculated. example can calculate clearance, steady-state volume distribution terminal half-life: Clearance: CL = \\frac{Dose}{AUC} Mean residence time: MRT = \\frac{AUMC}{AUC} Steady state volume distribution: V_{ss} = MRT \\times CL Half-life: Terminal slope natural log data Properties like AUC AUMC can also calculated using extrapolation last time point infinity account data beyond observations hand. subsequent values clearance, volumes distribution, etc can also change extrapolation. lot nuance associated calculations, good rely software focuses type analysis. PKNCA package developed mind. Ubiquity provides set functions automate NCA reporting preclinical data. functions act wrapper PKNCA package heavy lifting. small subset PKNCA functionality used . extensive analysis necessary PKNCA can used directly. vignette contains series examples perform NCA ubiquity. make copy scripts supporting files current working directory run following: creates several files working directory. First data sets: pk_all_sd.csv - PK data multiple subjects dosed either IV SC different levels pk_all_md.csv - Multiple dose data intensive sampling first last dose pk_sparse_sd.csv - Single dose data sparse sampling Next following scripts demonstrate perform NCA: analysis_nca_sd.R - Single dose data individuals analysis_nca_md.R - Multiple dose data individuals analysis_nca_sparse.R- Average NCA analyzing sparsely sampled data","code":"library(ubiquity) fr = workshop_fetch(section=\"NCA\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"quick-template-for-running-nca","dir":"Articles","previous_headings":"","what":"Quick Template for Running NCA","title":"Noncompartmental Analysis","text":"read rest vignette understand required data format functions work. returning just want template running NCA can use following: create file analysis_nca.R current working directory. can just uncomment/edit script get started.","code":"library(ubiquity) cfg = build_system() fr = system_fetch_template(cfg, template = \"NCA\")"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"single-dose-data","dir":"Articles","previous_headings":"","what":"Single Dose Data","title":"Noncompartmental Analysis","text":"example follows script analysis_nca_sd.R, uses dataset pk_all_sd.csv.","code":""},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"expected-format-of-data","dir":"Articles","previous_headings":"Single Dose Data","what":"Expected Format of Data","title":"Noncompartmental Analysis","text":"First build system load dataset. NCA functions ubiquity expect data certain format. columns required, optional depend kind analysis performed columns can also present. context consider following dataset: required columns names dataset provided parenthesis : ID - Unique subject identifier (ID) TIME - Time since first dose (TIME_HR) NTIME - Nominal time since last recent dose (since dealing single dose data also TIME_HR) CONC - Observed concentration record (C_ng_ml ng/ml) DOSE - Dose given (DOSE mg) ROUTE - Route administration (ROUTE); can either: iv bolus, iv infusion extra-vascular Optional columns include: DOSENUM - analyzing multiple dose data (example ), column used associate records doses BACKEXTRAP - Back-extrapolation IV data can done generally entire dataset column can used specify number points use individual basis SPARSEGROUP - Grouping sparse sampling data want average data time point","code":"cfg = build_system(system_file=\"system.txt\") cfg = system_load_data(cfg, dsname = \"PKDATA\", data_file = \"pk_all_sd.csv\")"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"nca-and-outputs","dir":"Articles","previous_headings":"Single Dose Data","what":"NCA and Outputs","title":"Noncompartmental Analysis","text":"Next perform NCA using system_nca_run: link analysis dataset specifying dataset name (dsname) used load dataset. Data can filtered either ’s loaded using optional dsfilter input (used ). dosing dataset mg (.e. 30 mg dose), mass units concentration values ng (.e. ng/ml). dscale input converts mass units dose mass units observed concentration. analysis_name 1 used refer analysis reporting function well files generated analysis. default initial concentration (nominal time zero) back-extrapolated can disabled setting extrap_C0 FALSE. Next map columns dataset names used analysis (dsmap). Note actual time (TIME) nominal time (NTIME) use column dataset (TIME_HR). Lastly, NCA_options can used specify analysis options used PKNCA. example maximum percent AUCinf extrapolation specified 10%. change option remaining defaults PKCNA used. Either omit argument set NULL use PKNCA defaults. Running function produce following files: output/pk_single_dose-nca_summary-pknca.csv Summary level output analysis (see table ) output/pk_single_dose-nca_data.RData R objects used downstream reporting output/pk_single_dose-pknca_raw.csv Raw output PKNCA may useful carry forward values certain columns PK dataset output. can use dsinc argument provide list columns input dataset appended summary table. can access summary table using function system_fetch_nca analysis_name: get explanation columns NCA output can use system_fetch_nca_columns function passing NCA analysis name function. list output contains data frame NCA_col_summary outputs description meaning:","code":"cfg = system_nca_run(cfg, dsname = \"PKDATA\", dscale = 1e6, analysis_name = \"pk_single_dose\", extrap_C0 = FALSE, dsmap = list(TIME = \"TIME_HR\", NTIME = \"TIME_HR\", CONC = \"C_ng_ml\", DOSE = \"DOSE\", ROUTE = \"ROUTE\", ID = \"ID\"), NCA_options = list(max.aucinf.pext = 10) ) NCA_results = system_fetch_nca(cfg, analysis_name = \"pk_single_dose\") nca_cols = system_fetch_nca_columns(cfg, \"pk_single_dose\") rhandsontable(nca_cols[[\"NCA_col_summary\"]], width=\"100%\", height=200)"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"powerpoint","dir":"Articles","previous_headings":"Single Dose Data > Automated Reporting","what":"PowerPoint","title":"Noncompartmental Analysis","text":"NCA run, results can appended open PowerPoint report. initialize empty report use function system_rpt_nca() analysis name assigned analysis (pk_single_dose) attach results. can write file: dose summary slide produced full timecourse created showing data subject/group dataset: Actual data gray Data used NCA green Initial extrapolated concentrations orange (solid) Points used extrapolating “iv bolus” data shown orange open circles shows slides generated individual subject first set summary slides analysis. Notice extrap_C0 set FALSE C0 calculated (-1). individual received SC dose estimate Vp also calculated (-1). Also note data individual allow extrapolation AUC infinity (NA). result parameters depend value also resulted (NA). timecourse figure shows data dataset (gray closed symbols, solid line) data used NCA (green open symbols, dashed line). way can visually confirm subject level data used.","code":"cfg = system_rpt_read_template(cfg, template=\"PowerPoint\") cfg = system_rpt_add_slide(cfg, template = \"title_slide\", elements = list( title= list(content = \"NCA Single Dose PK\", type = \"text\"))) cfg = system_rpt_nca(cfg=cfg, analysis_name=\"pk_single_dose\") system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",\"pk_single_dose-report.pptx\"))"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"word","dir":"Articles","previous_headings":"Single Dose Data > Automated Reporting","what":"Word","title":"Noncompartmental Analysis","text":"Similarly, Word report can generated appending results already initialized Word report. done setting template \"Word\" calling system_rpt_read_template(). attach content report PowerPoint report . information integrated report generation see Reporting vignette.","code":"cfg = system_rpt_read_template(cfg, template=\"Word\") cfg = system_rpt_nca(cfg=cfg, analysis_name=\"pk_single_dose\") system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",\"pk_single_dose-report.docx\"))"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"summarizing-data","dir":"Articles","previous_headings":"Single Dose Data","what":"Summarizing Data","title":"Noncompartmental Analysis","text":"automated reporting intended generate results quickly easily digestible way (Word PowerPoint). may decided need control presented. function system_fetch_nca() mentioned give access NCA output. want filter, select columns summarize results function system_nca_summary() can used. first argument (analysis_name) indicates NCA analysis want summarize. parameters summarized order table specified params_include. default internal headers used, can overwrite alter defaults optional params_header input. cmax overwritten internally predefined label (\"

F1 0.744 eps inf --- yes System

ka 0.282 eps inf 1/day yes System

CL 0.200 eps inf L/day yes System

Vc 3.61 eps inf L yes System

Vp 2.75 eps inf L yes System

Q 0.747 eps inf L/day yes System

MW 140 eps inf kD yes System mAb in Humans # Interindividual Variability # Taken from Table 3 0.416 ka 0.09875 CL 0.116 Vc 0.0789 Vp 0.699 Q 0.0786 0.0619 0.0377 # Covariates ; times; [ 0 ]; day ; values; [400]; mg step ; times; [ 0 ]; day ; values; [ 60]; kg step # static secondary parameters kel = CL/Vc kcp = Q/Vc kpc = Q/Vp # #-------------------# # |Input Information | # #-------------------# # # 1e6 ng 1 nmole 1 # X mg x ------ x ----------------- x --- => X*1e3/MW/Vc # 1 mg MW (KDA) * 1000 V(L) # # Bolus Events # times/events state values scale units ; [ 0.0, 7, 14 ]; 1; days ; At; [400.0, 0, 0 ]; 1e3/MW; mg ; Cc; [ 0.0, 0, 0 ]; 1e3/MW/Vc; mg ; times; [0, 30]; 1/60/24; min ; levels; [0, 0]; 60*24*1e3/MW; mg/min # ODEs -ka*At ka*At*F1/Vc -kel*Cc - kcp*Cc + kpc*Cp*Vp/Vc + Dinf/Vc kcp*Cc*Vc/Vp - kpc*Cp # #---------# # | Outputs | # #---------# # Outputs that begin with QC will not be displayed in the GUI # Convert nM to ng/ml # # X nM ===> X*MW(KDA) # # Convert nM to ug/ml/mg(dose) # # X nM ===> X*MW(KDA)/1000/dose # C_ng_ml = Cc*MW C_DOSE = Cc*MW/DOSE/1000 prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance Vp; Vc; CL; Q; ka Vp; Vc; CL; Q; ka; add_err; prop_err add=add_err; prop=prop_err Cp; Ap; Vp # #---------# # | Options # # #---------# # General Options: # specify different time scales 24.0*60.0 1.0 24.0 1.0/7.0 1.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Titration/Rule-Based Simulations","text":"Simulation vignette several examples provided using fixed dosing regimens. works well compounds relatively safe, PK consistent time, drug concentrations required achieve efficacy consistent. fact restrictions apply many different compounds. However, many scenarios necessary adjust dosing based periodic clinical visits: compounds narrow therapeutic index, disease progression alters drug PK requires increases dose amount, etc. possible manually current simulation tools provided, section outlines generalized framework make easier users. workshop provides several examples running titration rule-based simulations. make copy scripts supporting files current working directory run following: provide following scripts: analysis_repeat_dosing.r - Implement fixed bolus dosing using titration framework analysis_repeat_infusion.r - Implement fixed infusion rates using titration framework analysis_visit_dosing_titration.r - Alter dosing based predictions specified time points (individual) analysis_visit_dosing_titration_stochastic.r - Alter dosing based predictions specified time points (population) analysis_state_reset.r - Combine multiple rules dose drug perform state reset Titration rule-based simulations run using following functions: system_new_tt_rule() - Defines new rule times evaluated system_set_tt_cond() - Adds condition rule associated action perform condition true run_simulation_titrate() - Runs individual simulation using titration rules","code":"library(ubiquity) fr = workshop_fetch(section=\"Titration\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"repeated-bolus-dosing-analysis_repeat_dosing-r","dir":"Articles","previous_headings":"","what":"Repeated Bolus Dosing (analysis_repeat_dosing.r)","title":"Titration/Rule-Based Simulations","text":"example shows implement dosing regimen using fixed-dosing methodologies titration functions . meant means bridge two concepts. First use model Simulation vignette (Davda etal. mAbs, 6(4), 1094-1102), simulate five doses 500 mg IV given every two weeks: use rule-based control simulation enable titration option: Next need define rule using system_new_tt_rule(). rule contains set times (timescale) want evaluate rule. create rule called \"ivdose\" evaluate rule weeks 0, 2, 4, 6 8. timescale defined using system file can used: rule created can attach conditions rule using system_set_tt_cond(). name passed function name rule condition applies. cond argument string evaluated internally. put kind Boolean argument want , even create user definable function returns Boolean argument (eg, 'myfunction(arguments)'). condition evaluates true string action evaluated. string SI_TT_BOLUS prototype function used modify dosing titration points. See help (?system_set_tt_cond) details prototype functions variables available titration environment. action define dosing specified state (defined system file) values times shown. units specified system file times relative titration time point. Next simulate system using titration function: Now can overlay predictions using methods show produce result: output run_simulation_titrate() similar run_simulation_ubiquity() two extra elements list returned: tt.tname.value - Value rule active condition -1 triggered tt.tname.simtime - Simulation time last condition became active tt.tname.timescale - Simulation time time scale rule specified fields tname - Titration rule name value - Value rule active condition simtime - Simulation time last condition became active timescale - Simulation time time scale rule specified ","code":"cfg = build_system() cfg = system_select_set(cfg, \"default\") parameters = system_fetch_parameters(cfg) cfg=system_set_option(cfg,group = \"simulation\", option = \"solver\", value = \"lsoda\") cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,10*7,1)) cfg = system_zero_inputs(cfg) cfg = system_set_bolus(cfg, state = \"Cc\", times = c(0, 14, 28, 42, 56), values = c(500, 500, 500, 500, 500)) som_fix = run_simulation_ubiquity(parameters, cfg) cfg=system_set_option(cfg, group = \"titration\", option = \"titrate\", value = TRUE) cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"TRUE\", action = \"SI_TT_BOLUS[state='Cc', values=500, times=0]\", value = \"1\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_fix$simout, aes(x=ts.days, y=Cc, color=\"Fixed Dosing\"), linetype=1) + geom_line(data=som_tt$simout, aes(x=ts.days, y=Cc, color=\"Titration\" ), linetype=2) + scale_colour_manual(values=c(\"Fixed Dosing\"=\"darkblue\", \"Titration\"=\"firebrick3\")) + theme(legend.title = element_blank()) + theme(legend.position = 'bottom') myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"repeated-infusions-analysis_repeat_infusion-r","dir":"Articles","previous_headings":"","what":"Repeated Infusions (analysis_repeat_infusion.r)","title":"Titration/Rule-Based Simulations","text":"example want give 30 minute infusion 15 mg/min every two weeks. Similar previous example first using fixed dosing methods: Now use rule-based dosing enable titration, create rule (\"ivdose\") hold dosing times, create conditions resulting dosing. similar previous example except use SI_TT_RATE prototype function. rate units times levels specified system file (). times also relative titration time.","code":"cfg = system_zero_inputs(cfg) cfg = system_set_rate(cfg, rate = \"Dinf\", times = c( 0, 30, 20160, 20190, 40320, 40350, 60480, 60510, 80640, 80670), levels = c(15 , 0, 15, 0, 15, 0, 15, 0, 15, 0)) som_fix = run_simulation_ubiquity(parameters, cfg) cfg=system_set_option(cfg, group = \"titration\", option = \"titrate\", value = TRUE) cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"TRUE\", action = \"SI_TT_RATE[rate='Dinf', times=c(0,30), levels=c(15,0)]\", value = \"1\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_fix$simout, aes(x=ts.days, y=Cc, color=\"Fixed Dosing\"), linetype=1) + geom_line(data=som_tt$simout, aes(x=ts.days, y=Cc, color=\"Titration\" ), linetype=2) + scale_colour_manual(values=c(\"Fixed Dosing\"=\"darkblue\", \"Titration\"=\"firebrick3\")) + theme(legend.title = element_blank()) + theme(legend.position = 'bottom') myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"titrated-dosing-analysis_visit_dosing_titration-r","dir":"Articles","previous_headings":"","what":"Titrated Dosing (analysis_visit_dosing_titration.r)","title":"Titration/Rule-Based Simulations","text":"following example want administer subcutaneous dose () every two weeks (interval=14) 12 weeks. dose level evaluated every 6 months. serum concentration (Cc) less 900, dose 700 mg. Cc greater 900 dose 600 mg. relevant code implement shown : Initially concentration serum 0 (Cc < 900), dosing starts 700. six months titration rule triggered . point serum concentration greater greater 900 dose level reduced 600. subsequent measurements greater 900 dose remains 600. Titration output: som_tt$titration Titration output: som_tt$titration_history","code":"cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 6, 12, 18, 24), timescale = \"months\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"Cc < 900\", action = \"SI_TT_BOLUS[state='At', values=700, times=0, repdose='last', number=11, interval=14]\", value = \"700\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"Cc > 900\", action = \"SI_TT_BOLUS[state='At', values=600, times=0, repdose='last', number=11, interval=14]\", value = \"600\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_tt$simout, aes(x=ts.weeks, y=Cc), color=\"blue\") myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"monte-carlo-simulations-analysis_visit_dosing_titration_stochastic-r","dir":"Articles","previous_headings":"","what":"Monte Carlo Simulations (analysis_visit_dosing_titration_stochastic.r)","title":"Titration/Rule-Based Simulations","text":"example similar last except performing population simulations (20 subjects). function (simulate_subjects()) used setting 'titrate' option TRUE tells function use rule-based dosing. add data list element called som$titration three fields titration rule (tname): tt.tname.value - Value rule active condition tt.tname.simtime - Simulation time last condition became active tt.tname.timescale - Simulation time time scale rule specified fields matrix entry simulation time (column) subject (row). example accessed following list elements: som$titration$tt.ivdose.simtime som$titration$tt.ivdose.value som$titration$tt.ivdose.timescaletimescale data structure (som) can collapsed data frame using som_to_df function. titration simulations column added rule giving value rule indicated time (first 100 rows shown):","code":"cfg = system_set_option(cfg, group=\"stochastic\", option=\"nsub\", value=20) som= simulate_subjects(parameters, cfg) sdf = som_to_df(cfg, som)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"performing-statecompartment-resets-analysis_state_reset-r","dir":"Articles","previous_headings":"","what":"Performing State/Compartment Resets (analysis_state_reset.r)","title":"Titration/Rule-Based Simulations","text":"Along changing dosing titration time points, may also necessary directly alter state compartment values. last example dose every two weeks week 3 drop total drug system 1/2. portion covers IV dosing component: portion reduces amount drug Cc Cp 1/2 week 3:","code":"cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = 'TRUE', action = \"SI_TT_BOLUS[state='Cc', values=500, times=0]\", value = \"5\") cfg=system_new_tt_rule(cfg, name = \"state_reset\", times = c(3), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"state_reset\", cond = 'TRUE', action = \"SI_TT_STATE[Cc][0.5*Cc]\", value = \"0\") cfg=system_set_tt_cond(cfg, name = \"state_reset\", cond = 'TRUE', action = \"SI_TT_STATE[Cp][0.5*Cp]\", value = \"0\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_tt$simout, aes(x=ts.weeks, y=Cc), color=\"red\") myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"contents-of-system-txt","dir":"Articles","previous_headings":"","what":"Contents of system.txt","title":"Titration/Rule-Based Simulations","text":"","code":"# Implementation of the two compartment model from Davda 2014 # # Davda, J. P., Dodds, M. G., Gibbs, M. A., Wisdom, W., & Gibbs, J. (2014). A # model-based meta-analysis of monoclonal antibody pharmacokinetics to guide # optimal first-in-human study design. mAbs, 6(4), 1094-1102. # http://doi.org/10.4161/mabs.29095 # # System Units: # mass [=] nmoles # volume [=] L # concentration [=] nM # time [=] day # # #-------------# # | Parameters | # #-------------# # System parameters #name value lower upper units editable grouping # bound bound

F1 0.744 eps inf --- yes System

ka 0.282 eps inf 1/day yes System

CL 0.200 eps inf L/day yes System

Vc 3.61 eps inf L yes System

Vp 2.75 eps inf L yes System

Q 0.747 eps inf L/day yes System

MW 140 eps inf kD yes System mAb in Humans # Interindividual Variability # Taken from Table 3 0.416 ka 0.09875 CL 0.116 Vc 0.0789 Vp 0.699 Q 0.0786 0.0619 0.0377 # Covariates ; times; [ 0 ]; day ; values; [400]; mg step ; times; [ 0 ]; day ; values; [ 60]; kg step # static secondary parameters kel = CL/Vc kcp = Q/Vc kpc = Q/Vp # #-------------------# # |Input Information | # #-------------------# # # 1e6 ng 1 nmole 1 # X mg x ------ x ----------------- x --- => X*1e3/MW/Vc # 1 mg MW (KDA) * 1000 V(L) # # Bolus Events # times/events state values scale units ; [ 0.0, 7, 14 ]; 1; days ; At; [400.0, 0, 0 ]; 1e3/MW; mg ; Cc; [ 0.0, 0, 0 ]; 1e3/MW/Vc; mg ; times; [0, 30]; 1/60/24; min ; levels; [0, 0]; 60*24*1e3/MW; mg/min # ODEs -ka*At ka*At*F1/Vc -kel*Cc - kcp*Cc + kpc*Cp*Vp/Vc + Dinf/Vc kcp*Cc*Vc/Vp - kpc*Cp # #---------# # | Outputs | # #---------# # Outputs that begin with QC will not be displayed in the GUI # Convert nM to ng/ml # # X nM ===> X*MW(KDA) # # Convert nM to ug/ml/mg(dose) # # X nM ===> X*MW(KDA)/1000/dose # C_ng_ml = Cc*MW C_DOSE = Cc*MW/DOSE/1000 prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance Vp; Vc; CL; Q; ka Vp; Vc; CL; Q; ka; add_err; prop_err add=add_err; prop=prop_err Cp; Ap; Vp # #---------# # | Options # # #---------# # General Options: # specify different time scales 24.0*60.0 1.0 24.0 1.0/7.0 1.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John Harrold. Author, maintainer.","code":""},{"path":"https://r.ubiquity.tools/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Harrold, J.M., Abraham, .K. Ubiquity: framework physiological/mechanism-based pharmacokinetic/pharmacodynamic model development deployment. J Pharmacokinet Pharmacodyn 41, 141–151 (2014). https://doi.org/10.1007/s10928-014-9352-6","code":"@Article{, title = {Ubiquity: a framework for physiological/mechanism-based pharmacokinetic/pharmacodynamic model development and deployment}, author = {J.M. Harrold and A.K. Abraham}, journal = {Journal of Pharmacokinetics and Pharmacodynamics}, year = {2014}, volume = {41}, number = {2}, pages = {141-151}, url = {https://doi.org/10.1007/s10928-014-9352-6}, }"},{"path":[]},{"path":"https://r.ubiquity.tools/index.html","id":"overview","dir":"","previous_headings":"ubiquity R Workflow","what":"Overview","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"Provides interface R workflow ubiquity: set modeling tools created accelerate development deployment models drug disposition efficacy within organization institution. designed make model development easier, reduce pain moving modeling software, provide simple customizable interface allow scientists interrogate models. provide free BSD license source code available GitHub (R-package, ubiquity project).","code":""},{"path":"https://r.ubiquity.tools/index.html","id":"installing-ubiquity","dir":"","previous_headings":"ubiquity R Workflow","what":"Installing ubiquity","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"detailed software requirements installation instructions see page: (https://ubiquity.tools/rworkflow) Briefly, install following: R RStudio Perl (Windows) Rtools (Windows) can install ubiquity CRAN install development version GitHub: Note may need install development version onbrand GitHub well","code":"install.packages(\"ubiquity\", dependencies=TRUE) # Installing devtools if it's not already installed if(system.file(package=\"devtools\") == \"\"){ install.packages(\"devtools\") } devtools::install_github(\"john-harrold/ubiquity\", dependencies=TRUE)"},{"path":"https://r.ubiquity.tools/index.html","id":"getting-started","dir":"","previous_headings":"ubiquity R Workflow","what":"Getting started","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"full documentation ubiquity vignettes manuals available. information specific tasks see following vignettes: Language: Constructing ODE-based systems using ubiquity language Simulation: Running individual population simulations Estimation: Naive-pooled parameter estimation Titration: Rule-based/titration simulations Deployment: ShinyApp running deploying models Reporting: Inline generation PowerPoint Word reports NCA: Automated non-compartmental analysis PKNCA","code":""},{"path":"https://r.ubiquity.tools/index.html","id":"changes-and-updates","dir":"","previous_headings":"ubiquity R Workflow","what":"Changes and Updates","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"See NEWS.md details differences updates.","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate AUC for Sparse Data — AUC_Bailers_method","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"implementation Bailors method calculating AUCs sparse sampling. taken following publication: Nedelman, J. R., Gibiansky, E., & Lau, D. T. (1995). Applying Bailer's method AUC confidence intervals sparse sampling Pharmaceutical Research, 12(1), 124-128.","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"","code":"AUC_Bailers_method( conc_data = NULL, dsmap = list(NTIME = \"NTIME\", CONC = \"CONC\", ID = \"ID\") )"},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"conc_data data frame containing sparse data dsmap list names specifying columns: NTIME Nominal time since last dose; \"NTIME\" (default) CONC Concentration data; \"CONC\" (default) ID Subject ID; (\"ID\" (default)","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"list following elements isgood Boolean value indicating result function call AUC Mean AUC var_AUC Variance AUC msgs Sequence strings contianing description problems obss Internal observations times Sequence time corresponding rows obs r number observations time point (rows correspond rows obs)","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"Called ShinyApp add log entry \"App\" prepended log entry","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"","code":"GUI_log_entry(cfg, text)"},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"cfg ubiquity system object text string print/log","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"function used stochastic simulations performed using data file subject level information. data file contains covariate information, function update system subjects covariates.","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"","code":"apply_sub_file_COV( tmpcfg, cov_found, sub_dataset, sub_ID_col, sub_TIME_col, file_ID )"},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"tmpcfg ubiquity system object cov_found list covariates found dataset sub_dataset name dataset subject parameters sub_ID_col name column dataset subject IDs sub_TIME_col name column dataset simulation time file_ID subject ID extract covariates ","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"ubiquity system object covariates set current subject","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":null,"dir":"Reference","previous_headings":"","what":"Archive Estimation Results — archive_estimation","title":"Archive Estimation Results — archive_estimation","text":"Archives estimation results moving output files file names 'name' prepended . prevents overwritten different analysis script following files archived: output/parameters_all.csv output/parameters_est.csv output/report.txt Example: archive_estimation('mysoln', cfg) rename files output/mysoln-parameters_all.csv output/mysoln-parameters_est.csv output/mysoln-report.txt","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Archive Estimation Results — archive_estimation","text":"","code":"archive_estimation(name, cfg)"},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Archive Estimation Results — archive_estimation","text":"name analysis name cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Archive Estimation Results — archive_estimation","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":null,"dir":"Reference","previous_headings":"","what":"Build the System File — build_system","title":"Build the System File — build_system","text":"Builds specified system file creating targets R languages well templates performing simulations estimations.","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build the System File — build_system","text":"","code":"build_system( system_file = \"system.txt\", distribution = \"automatic\", perlcmd = \"perl\", output_directory = file.path(\".\", \"output\"), temporary_directory = file.path(\".\", \"transient\"), verbose = TRUE, ubiquity_app = FALSE, debug = TRUE )"},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build the System File — build_system","text":"system_file name file defining system ubiquity format (default = 'system.txt'), file exist template created compiled. distribution indicates weather using 'package' 'stand alone' distribution ubiquity. set 'automatic' build script first look see ubiquity R package installed. installed use package. Otherwise, assume \"sand alone\" distribution. perlcmd system command run perl (\"perl\") output_directory location store analysis outputs (file.path(\".\", \"output\")) temporary_directory location templates otehr files building system (file.path(\".\", \"transient\")) verbose enable verbose messaging (TRUE) ubiquity_app set TRUE building system used ubiquty App (FALSE) debug Boolean variable indicating debugging information displayed (TRUE)","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build the System File — build_system","text":"initialized ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build the System File — build_system","text":"","code":"# \\donttest{ fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Creating output directory #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # }"},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the halflife of data — calculate_halflife","title":"Calculate the halflife of data — calculate_halflife","text":"Determines terminal halflife sequence corresponding times values optional minimum maximum times censor data.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the halflife of data — calculate_halflife","text":"","code":"calculate_halflife(times = NULL, values = NULL, tmin = NULL, tmax = NULL)"},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the halflife of data — calculate_halflife","text":"times - sequence times values - corresponding sequence values tmin - minimum time include (NULL) tmax - maximum time include (NULL)","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the halflife of data — calculate_halflife","text":"List following names thalf Halflife units times mod Result lm used fit log transformed data df Dataframe data predicted values time within tmin tmax","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the halflife of data — calculate_halflife","text":"","code":"x = c(0:100) y = exp(-.1*x) th = calculate_halflife(times=x, values=y) #> Warning: essentially perfect fit: summary may be unreliable #> Warning: essentially perfect fit: summary may be unreliable thalf = th$thalf"},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the Value of the Specified Objective Function — calculate_objective","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"given set system parameters objective function calculated based defined cohorts variance models.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"","code":"calculate_objective(parameters, cfg, estimation = TRUE)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"parameters system parameters cfg ubiquity system object estimation boolean variable indicate objective function called parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"estimation TRUE return objective function value, FALSE return list element value containing objective function value element named isgood TRUE objective function successful.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":null,"dir":"Reference","previous_headings":"","what":"GA Wrapper for calculate_objective — calculate_objective_ga","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"Converts parameter vector named list returns negative objective (turning maximization minimization)","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"","code":"calculate_objective_ga(pvect, cfg)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"pvect system parameters cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"objective function value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":null,"dir":"Reference","previous_headings":"","what":"pso Wrapper for calculate_objective — calculate_objective_pso","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"psoptim objective function assumes parameters vector function converts named list consistent ubiquity optmization routines.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"","code":"calculate_objective_pso(pvect, cfg)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"pvect system parameters cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"objective function value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the Variance in od_general — calculate_variance","title":"Calculates the Variance in od_general — calculate_variance","text":"Takes variance specified string evaluates locally, returns value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the Variance in od_general — calculate_variance","text":"","code":"calculate_variance( SIMINT_parameters, SIMINT_varstr, SIMINT_odchunk, SIMINT_cfg )"},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the Variance in od_general — calculate_variance","text":"SIMINT_parameters system parameters SIMINT_varstr string containing variance calculation SIMINT_odchunk chunk observation details containing predictions, observations time SIMINT_cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the Variance in od_general — calculate_variance","text":"Variance calculated given set parameters model","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify System Steady State — check_steady_state","title":"Verify System Steady State — check_steady_state","text":"Takes output run_simulation_ubiquity verifies system running steady state analyzing timecourse states system","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify System Steady State — check_steady_state","text":"","code":"check_steady_state(cfg, som)"},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify System Steady State — check_steady_state","text":"cfg ubiquity system object som output run_simulation_ubiquity","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify System Steady State — check_steady_state","text":"list name steady_state (boolean indicating weather system steady state) states vector states steady state offset.","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares Estimate to Bounds — compare_estimate","title":"Compares Estimate to Bounds — compare_estimate","text":"Compares parameter estimate bounds indicates estimate near bound.","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares Estimate to Bounds — compare_estimate","text":"","code":"compare_estimate(cfg, parameters, pname)"},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares Estimate to Bounds — compare_estimate","text":"cfg ubiquity system object parameters list parameter estimates pname name parameter compare","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares Estimate to Bounds — compare_estimate","text":"L - near lower bound, U - near upper bound","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs parameter estimation — estimate_parameters","title":"Performs parameter estimation — estimate_parameters","text":"Performs actual parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs parameter estimation — estimate_parameters","text":"","code":"estimate_parameters(cfg)"},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs parameter estimation — estimate_parameters","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs parameter estimation — estimate_parameters","text":"list elements: estimate - vector parameter estimates raw - raw output underlying optimization routine conv - list convergence criteria keys num (numeric) text (text description) obj - objective function value statistics_est - solution statistics sysup - Text update system file parameter estimates estimate - Names list parameter estiamtes report - Named list elements reporting cohorts - Cohort elements cfg file cohort_view - Cohort view system_view() system_file - Contents system file estimation run","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"Can used take subset parameters (estimated returned ' system_estimate_parameters) full list system parameters.","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"","code":"fetch_full_parameters(pest, cfg)"},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"pest list containing subset parameters estimated cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"Full list parameters default values currently selected parameter set values pest merged","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"function used build full parameter set subset, normally used parameter estimation observation details function entire parameter vector needed simulate system. function select_set pulls parameter set can optionally select subset estimation: default values subset can accessed following way: estimation routines work reduced parameter set, run simulations full set needed. full values can retrieved using following:","code":"pnames = c('Vp', 'CL') cfg = system_select_set(cfg, \"default\", pnames) pest = system_fetch_guess(cfg) parameters = fetch_full_parameters(pest, cfg)"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse Prototype Functions for Arguments — find_bracketed_arguments","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"Parses strings find abstract functions (format SIFUNC[ARG1][ARG2][ARG3] extract arguments function replace actual functions additional arguments needed","code":""},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"","code":"find_bracketed_arguments(str, pattern, replace = \"\", narg, op = \"[\", cp = \"]\")"},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"str string containing prototype function call pattern string indicating start function eg. \"SI_TT_BOLUS[\" replace string replace pattern narg number arguments prototype function op string used indicating open parenthesis cp string used indicating close parenthesis","code":""},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"string containing actual function call/code built prototype function","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":null,"dir":"Reference","previous_headings":"","what":"Generates a Parameter Based on in the System File — generate_parameter","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"Internal function used generate parameters based IIV information","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"","code":"generate_parameter( SIMINT_parameters, SIMINT_cfg, SIMINT_PARAMETER_TV, SIMINT_IIV_VALUE, SIMINT_equation )"},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"SIMINT_parameters parameters vector containing typical values SIMINT_cfg ubiquity system object SIMINT_PARAMETER_TV Typical value parameter question SIMINT_IIV_VALUE sample mvr distribution SIMINT_equation equation relating IIV typical value parameter value variability","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"parameter value variability applied","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Text Report with Estimation Results — generate_report","title":"Generate Text Report with Estimation Results — generate_report","text":"Internal function used generate report estimation results","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Text Report with Estimation Results — generate_report","text":"","code":"generate_report(parameters, ss, cfg, conv_desc)"},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Text Report with Estimation Results — generate_report","text":"parameters list parameter estimates ss output solution_statistics cfg ubiquity system object conv_desc description convergence criteria","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Text Report with Estimation Results — generate_report","text":"List following elements: report_file name report file report_file_contents contents report file parameters_all_file name CSV file parameters parameters_est_file name CSV file estimates","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Subject — generate_subject","title":"Generate Subject — generate_subject","text":"Generates subject variability specified using descriptor system file","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Subject — generate_subject","text":"","code":"generate_subject(parameters, cfg)"},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Subject — generate_subject","text":"parameters vector nominal parameter values cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Subject — generate_subject","text":"List field named parameters containing sample representing subject","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"used convert x y-axis ggplot log 10 scale visually satisfying ggplot default.","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"","code":"gg_axis( fo, yaxis_scale = TRUE, xaxis_scale = TRUE, ylim_min = NULL, ylim_max = NULL, xlim_min = NULL, xlim_max = NULL, x_tick_label = TRUE, y_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"fo ggplot figure object yaxis_scale TRUE indicates y-axis log10 scaled xaxis_scale TRUE indicates x-axis log10 scaled ylim_min set number define lower bound y-axis ylim_max set number define upper bound y-axis xlim_min set number define lower bound x-axis xlim_max set number define upper bound x-axis x_tick_label TRUE show x tick labels, FALSE hide x tick labels y_tick_label TRUE show y tick labels, FALSE hide y tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"Wrapper gg_axis create log 10 x-axis","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"","code":"gg_log10_xaxis( fo, xlim_min = NULL, xlim_max = NULL, y_tick_label = TRUE, x_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"fo ggplot figure object xlim_min set number define lower bound x-axis xlim_max set number define upper bound x-axis y_tick_label TRUE show y tick labels, FALSE hide y tick labels x_tick_label TRUE show x tick labels, FALSE hide x tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"Wrapper gg_axis create log 10 y-axis","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"","code":"gg_log10_yaxis( fo, ylim_min = NULL, ylim_max = NULL, y_tick_label = TRUE, x_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"fo ggplot figure object ylim_min set number define lower bound y-axis ylim_max set number define upper bound y-axis y_tick_label TRUE show y tick labels, FALSE hide y tick labels x_tick_label TRUE show x tick labels, FALSE hide x tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of the linspace Function from Matlab — linspace","title":"Implementation of the linspace Function from Matlab — linspace","text":"Creates vector n elements equally spaced apart.","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of the linspace Function from Matlab — linspace","text":"","code":"linspace(a, b, n = 100)"},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of the linspace Function from Matlab — linspace","text":"initial number b final number n number elements (integer >= 2)","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of the linspace Function from Matlab — linspace","text":"vector numbers b n linearly spaced apart","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of the linspace Function from Matlab — linspace","text":"","code":"linspace(0,100, 20) #> [1] 0.000000 5.263158 10.526316 15.789474 21.052632 26.315789 #> [7] 31.578947 36.842105 42.105263 47.368421 52.631579 57.894737 #> [13] 63.157895 68.421053 73.684211 78.947368 84.210526 89.473684 #> [19] 94.736842 100.000000"},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of the logspace Function from Matlab — logspace","title":"Implementation of the logspace Function from Matlab — logspace","text":"Creates vector n elements logarithmically spaced apart.","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of the logspace Function from Matlab — logspace","text":"","code":"logspace(a, b, n = 100)"},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of the logspace Function from Matlab — logspace","text":"initial number b final number n number elements (integer >=2)","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of the logspace Function from Matlab — logspace","text":"vector numbers b n logarithmically (base 10) spaced apart","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of the logspace Function from Matlab — logspace","text":"","code":"logspace(-2, 3,20) #> [1] 1.000000e-02 1.832981e-02 3.359818e-02 6.158482e-02 1.128838e-01 #> [6] 2.069138e-01 3.792690e-01 6.951928e-01 1.274275e+00 2.335721e+00 #> [11] 4.281332e+00 7.847600e+00 1.438450e+01 2.636651e+01 4.832930e+01 #> [16] 8.858668e+01 1.623777e+02 2.976351e+02 5.455595e+02 1.000000e+03"},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Makes Forcing Function From Times and Values — make_forcing_function","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"Takes list times, values, interpolation method","code":""},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"","code":"make_forcing_function( times, values, type, output_times, sample_delta_mult = 0.001 )"},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"times time values forcing function values magnitude time (length time) type string indicating type forcing function can one following: \"step\" constant values switch new values times \"linear\" linearly interpolate points output_times vector simulation output times sample_delta_mult multiplier used control magnitude spacing around event times","code":""},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"matrix two columns: first column vector times second column vector values","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":null,"dir":"Reference","previous_headings":"","what":"Select Records from NONMEM-ish Data Set — nm_select_records","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"Retrieves subset NONMEM-ish data set based list containing filtering information.","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"","code":"nm_select_records(cfg, values, filter)"},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"cfg ubiquity system object values dataframe containing dataset column headers filter list element names headers values values header 'd values across headers 'd","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"subset dataset","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"dataset headings ID, DOSE SEX filter following format: translated boolean filter:","code":"filter = list() filter$ID = c(1:4) filter$DOSE = c(5,10) filter$SEX = c(1) ((ID==1) | (ID==2) | (ID==3) | (ID==4)) & ((DOSE == 5) | (DOSE==10)) & (SEX == 1)"},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Pad String with Spaces — pad_string","title":"Pad String with Spaces — pad_string","text":"Adds spaces beginning end strings reaches maxlength. Used aligning text.","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pad String with Spaces — pad_string","text":"","code":"pad_string(str, maxlength = 1, location = \"beginning\")"},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pad String with Spaces — pad_string","text":"str string maxlength length pad location either \"beginning\" pad left \"end\" pad right","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pad String with Spaces — pad_string","text":"Padded string","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pad String with Spaces — pad_string","text":"","code":"pad_string(\"bob\", maxlength=10) #> [1] \" bob\" pad_string(\"bob\", maxlength=10, location=\"end\") #> [1] \"bob \""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse String for Prototype Functions — parse_patterns","title":"Parse String for Prototype Functions — parse_patterns","text":"string can contain number prototype functions, function find replace actual R code.","code":""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse String for Prototype Functions — parse_patterns","text":"","code":"parse_patterns(cfg, str)"},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse String for Prototype Functions — parse_patterns","text":"cfg ubiquity system object str string","code":""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse String for Prototype Functions — parse_patterns","text":"String prototype functions replaced","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":null,"dir":"Reference","previous_headings":"","what":"Make ggplot Figure Pretty — prepare_figure","title":"Make ggplot Figure Pretty — prepare_figure","text":"Takes ggplot object alters line thicknesses makes cosmetic changes make appropriate exporting.","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make ggplot Figure Pretty — prepare_figure","text":"","code":"prepare_figure( purpose = \"present\", fo, y_tick_minor = FALSE, y_tick_major = FALSE, x_tick_minor = FALSE, x_tick_major = FALSE )"},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make ggplot Figure Pretty — prepare_figure","text":"purpose either \"present\" (default), \"print\" \"shiny\" fo ggplot figure object y_tick_minor Boolean value control grid lines y_tick_major Boolean value control grid lines x_tick_minor Boolean value control grid lines x_tick_major Boolean value control grid lines","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make ggplot Figure Pretty — prepare_figure","text":"ggplot object","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make ggplot Figure Pretty — prepare_figure","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"Provides interface run_simulation_ubiquity start stop simulations apply rules control dosing state-resets.","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"","code":"run_simulation_titrate(SIMINT_p, SIMINT_cfg, SIMINT_dropfirst = TRUE)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"SIMINT_p list system parameters SIMINT_cfg ubiquity system object SIMINT_dropfirst TRUE drop first sample point (prevents bolus doses starting 0)","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"som","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Individual Response — run_simulation_ubiquity","title":"Simulate Individual Response — run_simulation_ubiquity","text":"Controls execution individual simulations deSolve using either R scripts loadable C libraries.","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Individual Response — run_simulation_ubiquity","text":"","code":"run_simulation_ubiquity(SIMINT_parameters, SIMINT_cfg, SIMINT_dropfirst = TRUE)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Individual Response — run_simulation_ubiquity","text":"SIMINT_parameters vector parameters SIMINT_cfg ubiquity system object SIMINT_dropfirst TRUE drop first sample point (prevents bolus doses starting 0)","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Individual Response — run_simulation_ubiquity","text":"simulation output mapped (som) list. time-course stored simout element. first column (time) contains simulation time units simulation. Next column : State, output system parameter Models covariate contain initial value (prefix: SIMINT_CVIC_) well values time point static dynamic system parameter also passed column timescale returned \"ts.\" prefix.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Sample Times Around Events — sample_around","title":"Define Sample Times Around Events — sample_around","text":"events, bolus doses, applied system rapid changes can occur. system sampled heavily around times, changes may missed output profiles. Based total duration sample times, extra samples can added near events.","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Sample Times Around Events — sample_around","text":"","code":"sample_around(tvals, ot, sample_delta_mult = 1e-06)"},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Sample Times Around Events — sample_around","text":"tvals vector event times ot simualtion output times sample_delta_mult multiplier used control magnitude spacing around following event times","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Sample Times Around Events — sample_around","text":"vector event times added samples","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Sample Times Around Events — sample_around","text":"information setting options population simulation see stochastic section system_set_option help file.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Population Simulations — simulate_subjects","title":"Run Population Simulations — simulate_subjects","text":"Used run Population/Monte Carlo simulations subjects generated either provided variance/covariance information dataset.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Population Simulations — simulate_subjects","text":"","code":"simulate_subjects( parameters, cfg, show_progress = TRUE, progress_message = \"Simulating Subjects:\" )"},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Population Simulations — simulate_subjects","text":"parameters list containing typical value parameters cfg ubiquity system object show_progress Boolean value controlling display progress indicator (TRUE) progress_message text string prepend called ShinyApp","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run Population Simulations — simulate_subjects","text":"Mapped simulation output individual predictions, individual parameters, summary statistics parameters. Vignettes details format output.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run Population Simulations — simulate_subjects","text":"Failures due numerical instability integration errors captured within function. Data subjects removed output. IDs displayed messages stored output. information setting options population simulation see stochastic section system_set_option help file.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Solution Statistics — solution_statistics","title":"Calculate Solution Statistics — solution_statistics","text":"Attempts determine variance/covariance matrix, confidence intervals CV percent list parameter estimates parameters. method taken ADAPT 5 User's Guide chapter 3.","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Solution Statistics — solution_statistics","text":"","code":"solution_statistics(parameters, cfg)"},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Solution Statistics — solution_statistics","text":"parameters list parameter estimates cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Solution Statistics — solution_statistics","text":"list containing information provided estimates","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Solution Statistics — solution_statistics","text":"returned list following format: objective - objective function value num_observations - number observations degrees_of_freedom - degrees freedom aic - Akaike information criterion bic - Bayesian (Schwarz) information criterion covariance - variance covariance matrix wls - defined weighted least squares objective following elements: jacobian - Jacobian matrix weights - diagonal matrix weights error_variance - diagonal matrix variances ml - defined maximum likelihood objective following elements: M - Jacobian matrix block variance parameters coefficient_of_variation$pname - CV percent parameter pname confidence_interval$lower_bound$pname - Lower bound confidence interval pname confidence_interval$upper_bound$pname - Upper bound confidence interval pname","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"functions run_simulation_ubiquity, simulate_subjects, run_simulation_titrate provide outputs structured format, may useful convert \"wide\" format tall/skinny format.","code":""},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"","code":"som_to_df(cfg, som)"},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"cfg ubiquity system object som simulation output run_simulation_ubiquity, simulate_subjects, run_simulation_titrate","code":""},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"Data frame format: applied output run_simulation_ubiquity run_simulation_titrate ts.time - timescale system ts.ts1, ... ts.tsn - timescales defined system () pred - predicted/simulated response tt.ti1.x - titration event information (*) name - state output () name corresponding prediction applied output simulate_subjects ID - subject ID ts.time - timescale system ts.ts1, ... ts.tsn - timescales defined system () pred - predicted/simulated response tt.ti1.x - titration event information (*) P1, P2, ... Pn - system parameters subject (

) name - state output () name corresponding prediction (* - field present titration enabled)","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":null,"dir":"Reference","previous_headings":"","what":"Check For Perl and C Tools — system_check_requirements","title":"Check For Perl and C Tools — system_check_requirements","text":"Check local installation perl verify C compiler installed working.","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check For Perl and C Tools — system_check_requirements","text":"","code":"system_check_requirements( checklist = list(perl = list(check = TRUE, perlcmd = \"perl\"), C = list(check = TRUE)), verbose = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check For Perl and C Tools — system_check_requirements","text":"checklist list names corresponding elements system check. verbose enable verbose messaging","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check For Perl and C Tools — system_check_requirements","text":"List fn result packages","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check For Perl and C Tools — system_check_requirements","text":"","code":"# \\donttest{ invisible(system_check_requirements()) #> #> system_check_requirements() #> #> Testing perl, looking for a perl interpreter #> #> Perl interpreter found, now testing it #> #> > Success: Perl runs, everything should be good #> #> Attempting to compile C file #> #> > Success: C file compiled #> #> Loading the library #> #> > Success: C library loaded # }"},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify System Steady State — system_check_steady_state","title":"Verify System Steady State — system_check_steady_state","text":"Takes ubiquity system object optional inputs verify system running steady state. also provides information can helpful debugging systems running steady state.","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify System Steady State — system_check_steady_state","text":"","code":"system_check_steady_state( cfg, parameters = NULL, zero_rates = TRUE, zero_bolus = TRUE, output_times = seq(0, 100, 1), offset_tol = .Machine$double.eps * 100, derivative_tol = .Machine$double.eps * 100, derivative_time = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify System Steady State — system_check_steady_state","text":"cfg ubiquity system object parameters optional set parameters (NULL) check steady state (set NULL parameters currently selected parameter set used) zero_rates Boolean value control removing rate inputs (TRUE) zero_bolus Boolean value control removing bolus inputs (TRUE) output_times sequence output times simulate offset determination (seq(0,100,1)) offset_tol maximum percent offset considered zero (.Machine$double.eps*100) derivative_tol maximum derivative value considered zero (.Machine$double.eps*100) derivative_time time evaluate derivatives identify deviations (0), set NULL skip derivative evaluation","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify System Steady State — system_check_steady_state","text":"List following names steady_state Boolean indicating weather system steady state states_derivative Derivatives values greater derivative_tol states_simulation States values greater offset_tol som Simulated output derivatives Derivatives states_derivative_NA_NaN States derivatives evaluated either NA NaN states_simulation_NA_NaN States simulation values either NA NaN derivative_tc Data frame timecourse states derivative found greater tolerance (states_derivative)","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear all Cohorts — system_clear_cohorts","title":"Clear all Cohorts — system_clear_cohorts","text":"Clear previously defined cohorts","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear all Cohorts — system_clear_cohorts","text":"","code":"system_clear_cohorts(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear all Cohorts — system_clear_cohorts","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clear all Cohorts — system_clear_cohorts","text":"ubiquity system object cohorts defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Estimation Cohort — system_define_cohort","title":"Define Estimation Cohort — system_define_cohort","text":"Define cohort include parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Estimation Cohort — system_define_cohort","text":"","code":"system_define_cohort(cfg, cohort)"},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Estimation Cohort — system_define_cohort","text":"cfg ubiquity system object cohort list cohort information","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Estimation Cohort — system_define_cohort","text":"ubiquity system object cohort defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Estimation Cohort — system_define_cohort","text":"cohort name (eg d5mpk), dataset containing information cohort identified (name defined system_load_data) Next portion dataset applies current cohort, can define filter (cf field). applied dataset return values relevant cohort. example, want records column DOSE 5 (5 mpk cohort). can use following: dataset headings ID, DOSE SEX cohort filter following format: translated boolean filter: Optionally may want fix system parameter different value given cohort. can done using cohort parameter (cp) field. example body weight defined system parameter (BW), wanted fix body weight 70 current cohort following: Note can fix parameters estimated. default underlying simulation output times taken general output_times option (see system_set_option). However may also necessary specify simulation output times specific cohort. output_times field can used . Simply provide vector output times: Next define dosing cohort. necessary define inputs non-zero. data generated animals given single 5 mpk IV time 0. Bolus dosing defined using . Cp central compartment, pass information cohort following manner: Inputs can also include infusion rates (infusion_rates) covariates (covariates). Covariates default value specified system file unless overwritten . units system file Next need map outputs model observation data dataset. outputs field field output. field ONAME can replaced something useful (like PK). want filter dataset. Say example two outputs cf applied reduces dataset outputs. can use \"\" field apply \"output filter\" filter records apply current output ONAME. need filtering data, can can just omit field. Next need identify columns dataset contain times observations. found obs field current observation: times observations dataset found ’TIMECOL’ column ’OBSCOL’ column (optional missing data option specified -1). observations dataset need mapped appropriate elements model defined system file. done model field: First system time scale indicated TS placeholder must specfied. time scale must correspond data found TIMECOL . Next model output indicated MODOUTPUT placeholder needs specified. defined system file using correspond OBSCOL dataset. Lastly variance field specifies variance model. can use keyword PRED (model predicted output) variance parameters. examples include: variance = \"1\" - Least squares variance = \"PRED^2\" - Weighted least squares proportional prediction squared variance = \"(SLOPE*PRED)^2\" Maximum likelihood estimation SLOPE defined variance parameter () following controls plotting aspects associated output. color, shape line values values used ggplot functions. cohort multiple outputs, simply repeat process . additional cohorts. estimation vignettes contains examples . Note: Output names consistent cohorts grouped together plotting results.","code":"cohort = list( name = \"d5mpk\", dataset = \"pm_data\", inputs = NULL, outputs = NULL) cohort[[\"cf\"]] = list(DOSE = c(5)) cohort[[\"cf\"]] = list(ID = c(1:4), DOSE = c(5,10), SEX = c(1)) (ID==1) | (ID==2) | (ID==3) | (ID==4)) & ((DOSE == 5) | (DOSE==10)) & (SEX == 1) cohort[[\"cp\"]] = list(BW = c(70)) cohort[[\"output_times\"]] = seq(0,100,2) cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]][[\"TIME\"]] = c( 0) cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]][[\"AMT\"]] = c( 5) cohort[[\"outputs\"]][[\"ONAME\"]] = list() cohort[[\"outputs\"]][[\"ONAME\"]][[\"of\"]] = list( COLNAME = c(), COLNAME = c()) cohort[[\"outputs\"]][[\"ONAME\"]][[\"obs\"]] = list( time = \"TIMECOL\", value = \"OBSCOL\", missing = -1) cohort[[\"outputs\"]][[\"ONAME\"]][[\"model\"]] = list( time = \"TS\", value = \"MODOUTPUT\", variance = \"PRED^2\") cohort[[\"outputs\"]][[\"ONAME\"]][[\"options\"]] = list( marker_color = \"black\", marker_shape = 16, marker_line = 1 )"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"function allows user define cohorts automatically NONMEM dataset","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"","code":"system_define_cohorts_nm( cfg, DS = \"DSNAME\", col_ID = \"ID\", col_CMT = \"CMT\", col_DV = \"DV\", col_TIME = \"TIME\", col_AMT = \"AMT\", col_RATE = \"RATE\", col_EVID = \"EVID\", col_GROUP = NULL, filter = NULL, INPUTS = NULL, OBS = NULL )"},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"cfg ubiquity system object DS Name dataset loaded using system_load_data col_ID Column unique subject identifier col_CMT Compartment column col_DV Column observations ’.’ input col_TIME Column system time record col_AMT Infusion/dose amounts (need units specified system.txt file) col_RATE Rate infusion ’.’ bolus col_EVID EVID (0 - observation, 1 dose) col_GROUP Column name use defining similar cohorts generating figures. filter List used filter dataset NULL whole dataset used (see filter rules nm_select_records description use option) INPUTS List mapping input information dataset names used system.txt file OBS List mapping obseravation information dataset nams used system.txt file","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"ubiquity system object cohorts defined.","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"NOTE: use function necessary timescale define system time scale. example, system time scale days, something like following needed: Include records dataset Include records matching following filter Mapping information: inputs mapping information (INPUTMAP) alist field type input: input: bolus List name bolus state dataset (): bolus name CMT_NUM field indicating compartment number state infusion_rates List name rate dataset (): rate name CMT_NUM field indicating compartment number state covariates List covariate dataset (): covariate name col_COV indicating column database contains covariate coding perspective looks like : observation mapping information (OBSMAP) list elements output described system_define_cohort. output list following names: variance Variance model output CMT Compartment number mapping observations output output Name output () corresponding observations missing Value indicating missing observation NULL coding perspective looks like :","code":" 1 filter = NULL filter = list() filter$COLNAME = c() INPUTMAP = list() INPUTMAP$bolus$SPECIES$CMT_NUM = 1 INPUTMAP$infusion_rates$RATE$CMT_NUM = 1 INPUTMAP$covariates$CVNAME$col_COV = 'CNAME' OBSMAP = list() OBSMAP$ONAME=list(variance = 'PRED^2', CMT = 1, output = '', missing = NULL )"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Control Estimation Process — system_estimate_parameters","title":"Control Estimation Process — system_estimate_parameters","text":"Manages flow parameter estimation using data specified system_define_cohort.","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Control Estimation Process — system_estimate_parameters","text":"","code":"system_estimate_parameters( cfg, flowctl = \"plot guess\", analysis_name = \"my_analysis\", archive_results = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Control Estimation Process — system_estimate_parameters","text":"cfg ubiquity system object flowctl string control flow function analysis_name string containing name analysis archive_results boolean variable control whether results archived","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Control Estimation Process — system_estimate_parameters","text":"parameter estimates","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Control Estimation Process — system_estimate_parameters","text":"flowctl argument can following values \"plot guess\" return initial guess \"estimate\" perform estimation \"previous estimate guess\" load previous estimate analysis_name use initial guess \"plot previous estimate\" return previous estimate analysis_name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch System Timescale — system_fetch_TSsys","title":"Fetch System Timescale — system_fetch_TSsys","text":"Reads system information tries determine system time scale (timescale value 1)","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch System Timescale — system_fetch_TSsys","text":"","code":"system_fetch_TSsys(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch System Timescale — system_fetch_TSsys","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch System Timescale — system_fetch_TSsys","text":"Name system timescale NULL found","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Current Parameter Guesses — system_fetch_guess","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"Fetch list guesses current parameter set parameters selected estimation","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"","code":"system_fetch_guess(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"list current parameter gauesses","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Variability Terms — system_fetch_iiv","title":"Fetch Variability Terms — system_fetch_iiv","text":"Extract elements current variance/covariance matrix specified system file ?, ?, ?, ?","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Variability Terms — system_fetch_iiv","text":"","code":"system_fetch_iiv(cfg, IIV1, IIV2)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Variability Terms — system_fetch_iiv","text":"cfg ubiquity system object IIV1 row name variance/covariance matrix IIV2 column name variance/covariance matrix","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Variability Terms — system_fetch_iiv","text":"Value variance/covariance matrix","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Variability Terms — system_fetch_iiv","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Covariance term for ETACL and ETAVc val = system_fetch_iiv(cfg, IIV1=\"ETACL\", IIV2=\"ETAVc\") # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch NCA Results — system_fetch_nca","title":"Fetch NCA Results — system_fetch_nca","text":"Fetches NCA summary ubiquity system object.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch NCA Results — system_fetch_nca","text":"","code":"system_fetch_nca(cfg, analysis_name = \"analysis\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch NCA Results — system_fetch_nca","text":"cfg ubiquity system object analysis_name string containing name NCA analysis (default 'analysis')","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch NCA Results — system_fetch_nca","text":"List data frame NCA results (NCA_summary), raw output PKNCA (PKNCA_results), also list element indicating overall success function call (isgood)","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns in NCA Analysis — system_fetch_nca_columns","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"Show columns available given NCA analysis","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"","code":"system_fetch_nca_columns(cfg, analysis_name = \"analysis\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"cfg ubiquity system object analysis_name string containing name NCA analysis (default 'analysis')","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"list following elements: isgood Boolean variable identify function executed properly (TRUE) errors (FALSE) NCA_col_summary dataframe columns analysis analysis_name (col_name - NCA short name, - parameter derived , label - verbose text label column, description, verbose text description parameter. len_NCA_col maximum length col_name column len_from maximum length column len_label maximum length label column len_description maximum length description column","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch System Parameters — system_fetch_parameters","title":"Fetch System Parameters — system_fetch_parameters","text":"Fetch parameters currently selected parameter set. switch parameter sets use system_select_set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch System Parameters — system_fetch_parameters","text":"","code":"system_fetch_parameters(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch System Parameters — system_fetch_parameters","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch System Parameters — system_fetch_parameters","text":"List parameters selected parameter set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch System Parameters — system_fetch_parameters","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Fetching the default parameter set parameters = system_fetch_parameters(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"extract officer object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"","code":"system_fetch_rpt_officer_object(cfg, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"cfg ubiquity system object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"officer report object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"extract onbrand object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"","code":"system_fetch_rpt_onbrand_object(cfg, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"cfg ubiquity system object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"onbrand report object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Mathematical Set — system_fetch_set","title":"Fetch Mathematical Set — system_fetch_set","text":"Fetch elements specified mathematical set defined system file.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Mathematical Set — system_fetch_set","text":"","code":"system_fetch_set(cfg, set_name = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Mathematical Set — system_fetch_set","text":"cfg ubiquity system object set_name name mathematical set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Mathematical Set — system_fetch_set","text":"sequence containing elements parameter set NULL problem.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Mathematical Set — system_fetch_set","text":"","code":"# \\donttest{ # Creating a system file from the pbpk example fr = system_new(file_name = \"system.txt\", system_file = \"pbpk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Fetching the contents of the ORG mathematical set ORG_elements = system_fetch_set(cfg, \"ORG\") # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":null,"dir":"Reference","previous_headings":"","what":"Create New Analysis Template — system_fetch_template","title":"Create New Analysis Template — system_fetch_template","text":"Building system file produce templates R languages. function provides method make local copies templates.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create New Analysis Template — system_fetch_template","text":"","code":"system_fetch_template( cfg, template = \"Simulation\", overwrite = FALSE, output_directory = getwd() )"},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create New Analysis Template — system_fetch_template","text":"cfg ubiquity system object template template type overwrite TRUE new system file overwrite existing files present output_directory directory workshop files placed (getwd())","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create New Analysis Template — system_fetch_template","text":"List vectors template sources, destinations corresponding write success (write_file), also list element indicating overall success function call (isgood)","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create New Analysis Template — system_fetch_template","text":"template argument can following values R workflow: \"Simulation\" produces analysis_simulate.R: R-Script named placeholders used run simulations \"Estimation\" produces analysis_estimate.R: R-Script named placeholders used perform naive-pooled parameter estimation \"NCA\" produces analysis_nca.R: R-Script perform non-compartmental analysis (NCA) report results \"ShinyApp\" produces ubiquity_app.R, server.R ui.R: files needed run model Shiny App either locally Shiny Server \"Model Diagram\" produces system.svg: SVG template producing model diagram (Goto https://inkscape.org free SVG editor) \"Shiny Rmd Report\" produces system_report.Rmd test_system_report.R: R-Markdown file used generate report tabs Shiny App script test create files use software: \"Adapt\" produces system_adapt.system_adapt.prm: Fortran parameter files currently selected parameter set Adapt format. \"Berkeley Madonna\" produces system_berkeley_madonna.txt: text file model currently selected parameter set Berkeley Madonna format \"nlmixr\" produces system_nlmixr.R currently selected parameter set define system `nlmixr` format. \"NONMEM\" produces system_nonmem.ctl currently selected parameter set NONMEM conntrol stream. \"Monolix\" produces system_monolix.txt system_monolix.mlxtran currently selected parameter set. \"mrgsolve\" produces system_mrgsolve.cpp: text file model currently selected parameter set mrgsolve format","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create New Analysis Template — system_fetch_template","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Creating a simulation template fr = system_fetch_template(cfg, template = \"Simulation\", output_directory = tempdir()) #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_simulate.R # }"},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialize GLP study design — system_glp_init","title":"Initialize GLP study design — system_glp_init","text":"Creates new GLP study design","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialize GLP study design — system_glp_init","text":"","code":"system_glp_init(cfg, study_title = \"Study Title\", study_name = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialize GLP study design — system_glp_init","text":"cfg ubiquity system object study_title String containing descriptive information study study_name short name used identify study functions (\"default\")","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialize GLP study design — system_glp_init","text":"cfg ubiquity system object study initialized","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":null,"dir":"Reference","previous_headings":"","what":"Design GLP Study For a Scenario — system_glp_scenario","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"Identifies top dose required GLP tox study order match human metrics (Cmax AUCs) within specified multiplier. given set human parameters human doses required hit target Cmin AUC (one) identified. Cmax AUC associated largest doses determined corresponding doses tox species (provided parameters) determined specific tox multipliers. Optionally, simulations can run specifying doses either/human tox species. Sample times can also specified generate annotated figures tables given analysts facilitate assay design. system file requires following components: - Output drug concentration - Output cumulative AUC - Bolus dosing defined specific compartment - Timescale specified system timescale (e.g. timescale hours need hours = 1.0)","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"","code":"system_glp_scenario( cfg, output_Conc = NULL, output_AUC = NULL, timescale = NULL, units_Conc = \"\", units_AUC = \"\", study_scenario = \"Tox Study\", human_sim_times = NULL, study_name = \"default\", human_parameters = NULL, human_bolus = NULL, human_ndose = 1, human_dose_interval = 1, human_Cmin = NULL, human_AUC = NULL, human_sample_interval = NULL, human_sim_doses = NULL, human_sim_samples = NULL, tox_species = \"Tox\", tox_sim_times = NULL, tox_parameters = NULL, tox_bolus = NULL, tox_ndose = 1, tox_dose_interval = 1, tox_Cmax_multiple = 10, tox_AUC_multiple = 10, tox_sample_interval = NULL, tox_sim_doses = NULL, tox_sim_samples = NULL, annotate_plots = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"cfg ubiquity system object output_Conc model output specified containing concentration associated drug exposure. output_AUC model output specified containing cumulative exposure timescale system timescale specified used AUC comparisons plotting units_Conc units concentration ('') units_AUC units AUC ('') study_scenario string containing descriptive name tox study human_sim_times user-specified simulation output times humans (timescale system) study_name name study append scenario set 'system_glp_init()' ('default'): report initialized using system_rpt_read_template report name 'default' unless otherwise specified. disable reporting set NULL, use different report specify name . human_parameters list containing human parameters human_bolus string containing dosing state human doses (specified ) human_ndose number human doses simulate human_dose_interval dosing interval humans (time units specified ) human_Cmin target Cmin humans (corresponding output_Conc ) human_AUC target AUC humans (corresponding output_AUC ) human_sample_interval time interval units specified timescale evaluate trough concentration AUC (e.g c(1.99, 4.001) consider interval 2 4) human_sim_doses optional list doses human_bolus simulate (see Details ) human_sim_samples optional list sample times units specified timescale label plots simulated doses (default NULL disable labels) tox_species optional name tox species (\"Tox\") tox_sim_times user-specified simulation output times tox species (timescale system) tox_parameters list containing parameters tox species tox_bolus string containing dosing state tox species doses (specified ) tox_ndose number tox doses simulate tox_dose_interval dosing interval tox species (time units specified ) tox_Cmax_multiple target (Cmin AUC) dose tox species found cover multiple projected Cmax humans (10) tox_AUC_multiple target (Cmin AUC) dose tox species found cover multiple projected AUC humans (10) tox_sample_interval interval consider AUC Cmax comparing human prediction tox multiple tox_sim_doses optional list doses tox_bolus simulate (see Details ) tox_sim_samples optional list sample times units specified timescale label plots simulated doses (default NULL disable labels) annotate_plots Boolean switch indicate human_sim_samples tox_sim_samples labeled respective plots (TRUE)","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"cfg ubiquity system object scenario added successful","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"human_sim_doses tox_sim_doses lists names corresponding label dose. element AMT TIME element corresponds dosing times amounts units specified system file. example wanted simulate four weekly doses 20 mg 70 kg person units bolus doses days mg/kg times amounts following:","code":"human_sim_doses = list() human_sim_doses[[\"20 mg QW\"]]$TIME = c( 0, 7, 14, 21) human_sim_doses[[\"20 mg QW\"]]$AMT = c(0.2857, 0.2857, 0.2857, 0.2857)"},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Loading Datasets — system_load_data","title":"Loading Datasets — system_load_data","text":"Loads datasets scripting level variable data_file data.frame following formats (based file extension) csv - comma delimited tab - tab delimited xls xlsx - excel spread sheet Multiple datasets can loaded long given different names. Datasets NONMEM-ish format first row containing column header names.","code":""},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Loading Datasets — system_load_data","text":"","code":"system_load_data(cfg, dsname, data_file, data_sheet)"},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Loading Datasets — system_load_data","text":"cfg ubiquity system object dsname short name dataset used link dataset different operations data_file file name dataset data frame containing data data_sheet argument identifying name sheet excel file","code":""},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Loading Datasets — system_load_data","text":"Ubiquity system object dataset loaded","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":null,"dir":"Reference","previous_headings":"","what":"Save variables to files — system_log_debug_save","title":"Save variables to files — system_log_debug_save","text":"Triggered debugging enabled, function save contents values specified file name ubiquity temporary directory.","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save variables to files — system_log_debug_save","text":"","code":"system_log_debug_save(cfg, file_name = \"my_file\", values = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save variables to files — system_log_debug_save","text":"cfg ubiquity system object file_name name save file without \".RData\" extension values named list variables save","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save variables to files — system_log_debug_save","text":"Boolean variable indicating success","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save variables to files — system_log_debug_save","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # enable debugging: cfg=system_set_option(cfg,group = \"logging\", option = \"debug\", value = TRUE) # Saving the cfg variable system_log_debug_save(cfg, file_name = 'my_file', values = list(cfg=cfg)) #> [1] TRUE # }"},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Log Entry — system_log_entry","title":"Add Log Entry — system_log_entry","text":"Appends specified line analysis log","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Log Entry — system_log_entry","text":"","code":"system_log_entry(cfg, entry)"},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Log Entry — system_log_entry","text":"cfg ubiquity system object entry string containing log entry","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Log Entry — system_log_entry","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Log Entry — system_log_entry","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file system_log_entry(cfg, \"Text of log entry\") #> NULL # }"},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialize System Log File — system_log_init","title":"Initialize System Log File — system_log_init","text":"Initializes currently specified system log file.","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialize System Log File — system_log_init","text":"","code":"system_log_init(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialize System Log File — system_log_init","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialize System Log File — system_log_init","text":"ubiquity system object logging enabled","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initialize System Log File — system_log_init","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file cfg = system_log_init(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":null,"dir":"Reference","previous_headings":"","what":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"Provides verbose information NCA parameters","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"","code":"system_nca_parameters_meta(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"List following elements: isgood Boolean value indicating success function call. parameters List element names standard column header NCA output. element name list following elements: label Textual descriptor parameter. description Verbose description parameter. Text indicating source parameter (either PKNCA ubiquity).","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic NCA — system_nca_run","title":"Automatic NCA — system_nca_run","text":"Performs NCA automated fashion","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic NCA — system_nca_run","text":"","code":"system_nca_run( cfg, dsname = \"PKDS\", dscale = 1, NCA_options = NULL, NCA_min = 4, analysis_name = \"analysis\", dsfilter = NULL, extrap_C0 = TRUE, extrap_N = 2, sparse = FALSE, dsmap = list(TIME = \"TIME\", NTIME = \"NTIME\", CONC = \"CONC\", DOSE = \"DOSE\", ID = \"ID\", ROUTE = \"ROUTE\", DOSENUM = NULL, BACKEXTRAP = NULL, SPARSEGROUP = NULL), dsinc = NULL )"},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic NCA — system_nca_run","text":"cfg ubiquity system object dsname name dataset loaded (system_load_data) dscale factor multiply dose get units concentration (default 1): dosing mg/kg concentrations ng/ml, dscale = 1e6 NCA_options specify list options PKNCA overwrite defaults (default NULL use defaults). example want set maximum extrapolation AUCinf 10 half-life half-life 0.8 use: list(max.aucinf.pext=10, min.hl.r.squared=.9) NCA_min minimum number points required perform NCA given subset (default 4) analysis_name string containing name analysis (default 'analysis') archive files reference results later dsfilter list names corresponding column names dataset values sequence indicating values keep (default NULL. Multiple names -ed together. example following keep records dose 1, 2, 5 dose_number 1 extrap_C0 Boolean variable enable automatic determination initial drug concentration value specified; rules used WinNonlin used: route \"iv infusion\" \"extra-vascular\" data single dose data, concentration zero used. repeat dosing used, minimum value previous dosing interval used. route \"iv bolus\" log-linear regression number observations specified extrap_N used. slope points positive first positive observation used estimate C0 extrap_N number points use back extrapolation (default 2); number can overwritten subject using BACKEXTRAP column dataset sparse Boolean variable used indicate data used sparse sampling analysis use average time point (SPARSEGROUP column must specified dsmap ) dsmap list names specifying columns dataset (* required): TIME* Time since first dose; \"TIME\" (default) NTIME* Nominal time since last dose; \"NTIME\" (default) CONC* Concentration data; \"CONC\" (default) DOSE* Dose given; (\"DOSE\" (default) ID* Subject ID; (\"ID\" (default) ROUTE* Route administration; \"ROUTE\" (default), can either \"iv bolus\", \"iv infusion\" \"extra-vascular\". Variants \"IV_bolus\" \"extravascular\" work well. DOSENUM Numeric dose (starting 1) used grouping multiple dose data; optional, NULL (default) single dose data) BACKEXTRAP Specifying number points use extrapolate initial concentration \"iv bolus\" dosing; optoinal f NULL (default) use value defined extrap_N (note value must <= NCA_min) SPARSEGROUP Column containing unique value grouping cohorts pooling data. Needed sparse set TRUE; optional, NULL (default) dsinc (CURRENTLY IMPLEMENTED) optional character vector columns dataset include output summary (default NULL)","code":"dsfilter = list(dose=c(1,2,5), dose_number = c(1))"},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic NCA — system_nca_run","text":"cfg ubiquity system object NCA results analysis name specified: output/analysis_name-nca_summary-pknca.csv NCA summary output/analysis_name-pknca_summary.csv Raw output PKNCA subject dose number columns appended output/analysis_name-nca_data.RData objects containing NCA summary list ggplot grobs","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize NCA Results in Tabular Format — system_nca_summary","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"Creates tabular summaries NCA results","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"","code":"system_nca_summary( cfg, analysis_name = \"analysis\", treat_as_factor = c(\"ID\", \"Dose_Number\", \"Dose\"), params_include = c(\"ID\", \"cmax\", \"tmax\", \"auclast\"), params_header = NULL, rptname = \"default\", label_format = NULL, summary_stats = NULL, summary_labels = list(MEAN = \"Mean\", STD = \"Std Dev\", MEDIAN = \"Median\", N = \"N obs\", SE = \"Std Err.\"), summary_location = NULL, ds_wrangle = NULL, digits = 3, table_theme = \"theme_zebra\" )"},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"cfg ubiquity system object analysis_name string containing name analysis (default 'analysis') previously run treat_as_factor sequence column names treated factors (default c(\"ID\", \"Dose_Number\", \"Dose\")). Use report values without added decimals. params_include vector names parameters include (default c(\"ID\", \"cmax\", \"tmax\", \"auclast\")) params_header list names parameters followed vector headers. can use placeholder \"

) reassigned parameter set (?). can altered scripting level using function.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"","code":"system_set_guess(cfg, pname, value, lb = NULL, ub = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"cfg ubiquity system object pname name parameter set value value assign lb optionally change lower bound (NULL) ub optionally change upper bound (NULL)","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"cfg ubiquity system object guess bounds assigned","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"performing parameter estimation, initial guess value specified system.txt file currently selected parameter set. following command can used parameter set selected specify value (VALUE) parameter PNAME optionally lower (lb) upper (ub) bounds: set initial guess parameter Vc value 3, following used: specify guess overwrite upper bound Vc set 5","code":"cfg = system_set_guess(cfg, pname=\"PNAME\", value=VALUE, lb=NULL, ub=NULL) cfg = system_set_guess(cfg, \"Vc\", value=3) cfg = system_set_guess(cfg, \"Vc\", value=3, ub=5)"},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Variability Terms — system_set_iiv","title":"Set Variability Terms — system_set_iiv","text":"Set elements current variance covariance matrix specified system file ?, ?, ?, ?","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Variability Terms — system_set_iiv","text":"","code":"system_set_iiv(cfg, IIV1, IIV2, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Variability Terms — system_set_iiv","text":"cfg ubiquity system object IIV1 row name variance/covariance matrix IIV2 column name variance/covariance matrix element value value assign variance/covariance matrix element","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Variability Terms — system_set_iiv","text":"Ubiquity system object IIV information set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Variability Terms — system_set_iiv","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clearing all inputs cfg = system_zero_inputs(cfg) # Setting the covariance element for CL and Vc to 0.03 cfg = system_set_iiv(cfg, IIV1 = \"ETACL\", IIV2 = \"ETAVc\", value=0.03) # }"},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":null,"dir":"Reference","previous_headings":"","what":"Setting Analysis Options — system_set_option","title":"Setting Analysis Options — system_set_option","text":"Different options associated performing analyses (e.g running simulations, performing parameter estimation, logging, etc.) can set function","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setting Analysis Options — system_set_option","text":"","code":"system_set_option(cfg, group, option, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setting Analysis Options — system_set_option","text":"cfg ubiquity system object group options grouped together underlying activity performed: \"estimation\", \"general\", \"logging\", \"simulation\", \"solver\", \"stochastic\", \"titration\" option group set options value corresponding value option","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Setting Analysis Options — system_set_option","text":"Ubiquity system object option set","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Setting Analysis Options — system_set_option","text":"group=\"estimation\" default estimation R performed using either optim optimx libraries. selected setting optimizer option: optimization routine specified using method. default option set Nelder-Mead. different attributes selected using control. different methods control options, see documentation optim optimx libraries. perform global optimization can install either particle swarm (pso) genetic algorithm (GA) libraries. use particle swarm set optimizer method: control option list described pso documentation. use genetic algorithm set optimizer method: control option list list elements named options GA documentation. Use following example: alter initial guesses see: system_set_guess performing parameter estimation, internal function system_od_general used. function simulates system conditions defined different cohorts. pretty flexible want go beyond can set observation_function option: instruct optimziation routines use user defined function my_od. need construct function input/output format system_od_general. group=general \"output_directory\" = String analysis outputs placed. Generally wont want change , can useful Shiny apps need shiny user generate output users directory : file.path(\".\", \"output\") group=logging default ubiquity prints different information console logs information log file. following options can used control behavior: \"enabled\" = Boolean variable control logging: TRUE \"file\" = String containing name log file: file.path(\"transient\", \"ubiquity_log.txt\") \"timestamp\" = Boolean switch control appending time stamp log entries: TRUE \"ts_str\" = String format timestamp: \" \"debug\" = Boolean switch control debugging (see ): FALSE \"verbose\" = Boolean switch control printing console FALSE enable debugging different functions (like performing esitmation), set debug option TRUE. Important function calls trapped information logged reported console. group=\"simulation\" \"dynamic\" - Set TRUE (default) simulations behave normally. Set FALSE ODES evaulate zero. useful steady-state anslysis. \"include_important_output_times\" - Automatically add bolus, infusion rate switching times, etc: \"yes\"(default), \"\". \"integrate_with\" - Specify ODE solver use Rscript (\"r-file\") compiled C (\"c-file\"), build process can compile load C version default otherwise switch R script. \"output_times\" - Vector times evaulate simulation (default seq(0,100,1)). \"solver\" - Selects ODE solver: \"lsoda\" (default), \"lsode\", \"vode\", etc.; see documentation deSolve exhaustive list. \"sample_bolus_delta\" - Spacing used sampling around bolus events (default 1e-6). \"sample_forcing_delta\" - Spacing used sampling around forcing functions (infusion rates, covariates, etc) (default 1e-3). group=solver Depending solver, different options can set. documentation deSolve lists different solvers. full list options, see documentation specific solver (e.g. ?lsoda). common options consider : \"atol\" - Relative error tolerance \"rtol\" - Absolute error tolerance \"hmin\" - Minimum integration step size \"hmax\" - Maximum integration step size select vode solver set maximum step size 0.01, following used: group=\"stochastic\" running stochastic simulations (inter-individual variability applied system parameters) can useful specify following: \"ci\" - Confidence interval (default 95) \"nsub\" - Number subjects (default 100) \"seed\" - Seed random numebr generator (default 8675309) \"ponly\" - generate subject parameters run simulations (default FALSE) \"ssp\" - list calculated static secondary parameters include (default parameters defined <>) \"outputs\" - list predicted outputs include (default outputs defined ) \"states\" - list predicted states include(default states) \"sub_file\" - Name data set loaded (system_load_data) containing subject level parameters coviariates \"sub_file_sample\" - Controls subjects sampled dataset wanted generate 1000 subjects wanted parameters, use following: wanted exclude states secondary parameters, including output Cp_nM, following: pull subject information data file instead generating subject parameters IIV information sub_file option can used. value SUBFILE_NAME name given dataset loaded (system_load_data): Sampling dataset can controlled using sub_file_sample option: Sampling can done sequentially (\"sequential\"), replacement (\"replacement\"), without replacement (\"without replacement\") group=\"titration\" \"titrate\" - default titration disable (set FALSE). going use titration, enable setting option TRUE. force #' simulate_subjects use run_simulation_titrate internally running simulations.","code":"cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"optim\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"Nelder-Mead\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(trace = TRUE, maxit = 500, REPORT = 10)) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"pso\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"psoptim\") cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(maxiter = 10000, optimArgs = list( method = \"Nelder-Mead\", maxiter = 1000))) cfg = system_set_option(cfg, group = \"estimation\", option = \"observation_function\", value = \"my_od\") cfg = system_set_option(cfg, group = \"estimation\", option = \"debug\", value = FALSE) cfg=system_set_option(cfg, group = \"simulation\", option = \"solver\", value = \"vode\") cfg=system_set_option(cfg, group = \"solver\", option = \"hmax\", value = 0.01) cfg = system_set_option(cfg, group = \"stochastic\", option = \"nsub \", value = 1000) cfg = system_set_option(cfg, group = \"stochastic\", option = \"ponly\", value = TRUE ) cfg = system_set_option (cfg, group = \"stochastic\", option = \"ssp\", value = list()) cfg = system_set_option (cfg, group = \"stochastic\", option = \"states\", value = list()) cfg = system_set_option (cfg, group = \"stochastic\", option = \"outputs\", value = c(\"Cp_nM\")) cfg=system_set_option(cfg, group = \"stochastic\", option = \"sub_file\", value = \"SUBFILE_NAME\") cfg=system_set_option(cfg, group = \"stochastic\", option = \"sub_file_sample\", value = \"with replacement\")"},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Value for Parameter — system_set_parameter","title":"Set Value for Parameter — system_set_parameter","text":"Assigns value named parameter parameter list.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Value for Parameter — system_set_parameter","text":"","code":"system_set_parameter(cfg, parameters, pname, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Value for Parameter — system_set_parameter","text":"cfg ubiquity system object parameters vector parameters pname parameter name value value","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Value for Parameter — system_set_parameter","text":"parameters vector pname set value","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Value for Parameter — system_set_parameter","text":"set parameter Vc value 3, following used:","code":"parameters = system_fetch_parameters(cfg) parameters = system_set_parameter(cfg, parameters, pname = 'Vc', value = 3)"},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Infusion Rate Inputs — system_set_rate","title":"Set Infusion Rate Inputs — system_set_rate","text":"Defines infusion rates specified system file using ","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Infusion Rate Inputs — system_set_rate","text":"","code":"system_set_rate(cfg, rate, times, levels)"},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Infusion Rate Inputs — system_set_rate","text":"cfg ubiquity system object rate name infusion rate times list time values levels corresponding list infusion values","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Infusion Rate Inputs — system_set_rate","text":"Ubiquity system object infusion rate set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Infusion Rate Inputs — system_set_rate","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clearing all inputs cfg = system_zero_inputs(cfg) # 5 minute infusion at 10 mg/min cfg = system_set_rate(cfg, rate = \"Dinf\", times = c(0, 5), levels = c(10, 0)) # }"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"replace officer object ubiqiuty system object specified report name value supplied.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"","code":"system_set_rpt_officer_object(cfg, rpt = NULL, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"cfg ubiquity system object rpt officer report object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"ubiquity system object replaced officer object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"reset onbrand object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"","code":"system_set_rpt_onbrand_object(cfg, obnd = NULL, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"cfg ubiquity system object obnd onbrand report object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"ubiquity system object onbrand report set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":null,"dir":"Reference","previous_headings":"","what":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"prototype function SI_TT_BOLUS provides interface function. Based input SI_TT_BOLUS bolus inputs updated current titration time.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"","code":"system_set_tt_bolus( cfg, state, values, times, tt_ts, tsinfo, repdose = \"none\", interval = 1, number = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"cfg ubiquity system object state dosing state/compartment (Defined ) values vector dosing amounts (dosing units defined ) times vector dosing times relative current titration time (# time units defiend ) tt_ts list timescale values current titration time tsinfo list timescale information inputs (bolus, rates, etc) repdose \"none\", \"last\", \"\" interval interval repeat units defined number number times repeat","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"ubiquity system object bolus dosing updated.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Titration Triggers and Actions — system_set_tt_cond","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"rule defined using system_new_tt_rule, can used specifying checks titration time points , true, perform actions.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"","code":"system_set_tt_cond(cfg, name, cond, action, value = \"-1\")"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"cfg ubiquity system object name string containing name titration rule condition applies cond string evaluates boolean value TRUE action triggered action stringing evaluates done condition met (e.g. changing dose, state change, etc) value code stored titration history track condition triggered","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"Ubiquity system object titration condition defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"general syntax setting new condition : name input associate condition previously defined rule. time defined rule created, condition (cond) evaluated. condition evaluates TRUE action evaluated. Lastly, condition action evaluated, value stored titration history. Multiple conditions can associated rule. internal titration history track one condition evaluated true, simulation output show last condition evaluated true. cond field string , evaluated, produce boolean value (TRUE FALSE). simply want force action times given rule can use: cond = \"TRUE\". Alternatively can provide mathematical expressions even complicated user defined functions. action field evaluated cond true. modify simulation going performed, want modify SIMINT_cfgtt variable using different system commands. Certain common tasks prototype functions created make easier user: SI_TT_BOLUS - Set bolus dosing SI_TT_RATE - Set infusion inputs SI_TT_STATE - Reset system states Note: Protype functions strings sometimes necessary specify strings within string. main string use double quotes (\") internal strings use single quotes (') SI_TT_BOLUS simplest way apply bolus condition true use following: values times vectors numbers equal length. dosing time units specified system.txt file delimiter. times relative titration time. 0 means titration time. ’s possible specify interval number times repeat last dose using following: give dose 5 titration point 2 time units later. dose 10 time 4 repeated 7 times every 4 time units. total 8 (7 + 1) doses 10 administered. Remember time units defined . input repdose can either ’last’ ’none’. Note: main string double quotes \" \" strings protype argument (e.g. ’last’) single quotes ’ ’. SI_TT_RATE created infusion named Dinf using infusion units min (times) mg/min (rates). 60 minute infusion 20 mg/min following: wanted every day 9 days (total 10 days) can repeat sequence: input repdose can either ’sequence’ ’none’. Note: time units dosing rate specified using . SI_TT_STATE provide fine control states titration points state reset prototype provided. example, modeling assay wash step want drop concentration zero. state named Cc defined system.txt want set 0.0 condition following action work. value number can use mathematical combination variables available titration environment. Also can create user function place function call within brackets . Titration Environment cond, action, value statements can use variables available titration environment. want perform complicated actions, can simply create user defined functions pass variables titration environment need. include named variables model well internal variables used control titration. States Parameters System parameters (

), static secondary parameters (<>) initial value covariates available. Also state values (current titration time) can used. available names specified system.txt file. Since system resets (SI_TT_STATE) processed first, changes made states values active actions. Internal Simulation Variables Internal variables used control titration activities. variables can also used conditions actions. SIMINT_p - list system parameters SIMINT_cfg - system configuration sent titration routine SIMINT_cfgtt- system configuration current titration event time SIMINT_ttimes - vector titration times (simulation units) SIMINT_ttime - current titration time (simulation units) SIMINT_tt_ts - list time scales current titration SIMINT_history - data frame tracking history conditions evaluated true following structure: tname - name titration rule value - value indicating condition satisfied simtime - simulation time rule/value triggered timescale - time rule timescale rule/value triggered Individual Simulations run individual titration simulation use following: provides output run_simulation_ubiquity two extra fields. first, som$titration, contains three columns titration rule. columns length equal corresponding simulation times. rule name rname, column headers following names meanings: tt.rname.value - Value rule active condition -1 triggered tt.rname.simtime - Simulation time last condition became active tt.rname.timescale - Simulation time time scale rule specified second field som$titration_history contains summary list titration events triggered. tname - Titration rule name value - Value rule active condition -1 triggered simtime - Simulation time last condition became active timescale - Simulation time time scale rule specified convert structured list data frame som_to_df command can used: run stochastic titration simulations, function used: add data list element called som$titration three fields titration rule: tt.rname.value - Value rule active condition -1 triggered tt.rname.simtime - Simulation time last condition became active tt.rname.timescale - Simulation time time scale rule specified fields matrix entry simulation time (column) subject (row). data structure can also converted data frame using som_to_df.","code":"cfg = system_new_tt_cond(cfg, name = \"rname\", cond = \"BOOLEAN EXPRESSION\", action = \"EXPRESSION\", value = \"VALUE\") action = \"SI_TT_BOLUS[state=’At’, values=c(10, 10, 10), times=c(0, 1, 2)]\" action = \"SI_TT_BOLUS[state = ’At’, values = c(5, 5, 10), times = c(0, 2, 4), repdose = ’last’, number = 7, interval = 4]\" action = \"SI_TT_RATE[rate=’Dinf’, times=c(0, 60), levels=c(20.0, 0)]\" action = \"SI_TT_RATE[rate = ’Dinf’, times = c(0, 60), levels = c(20, 0), repdose = ’sequence’, number = 9, interval = 24*60]\" action = \"SI_TT_STATE[Cc][0.0]\" som = run_simulation_titrate(parameters, cfg) sdf = som_to_df(cfg, som) som = simulate_subjects(parameters, cfg)"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"prototype function SI_TT_RATE provides abstract interface function. Based input SI_TT_RATE infusion rate inputs updated current titration time.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"","code":"system_set_tt_rate( cfg, rate, times, levels, tt_ts, tsinfo, repdose = \"none\", interval = 1, number = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"cfg ubiquity system object rate name infusion rate update(Defined ) times vector switching times relative current titration time (time units defined ) levels vector infusion rates (dosing units defined ) tt_ts list timescale values current titration time tsinfo list timescale information inputs (bolus, rates, etc) repdose \"none\" \"sequence\" interval interval repeat units defined number number times repeat","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"ubiquity system object infusion rates updated.","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Results at Estimates — system_simulate_estimation_results","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"Simulates system parameter estimates pest creating diagnostic plots","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"","code":"system_simulate_estimation_results(pest, cfg, details = FALSE)"},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"pest vector parameters cfg ubiquity system object details set TRUE display information cohorts simulated (useful debugging)","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"observations list, see system_od_general estimation=FALSE","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"converts time specified defined timescale (say weeks) timescale simulation (say hours rates 1/hr units)","code":""},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"","code":"system_ts_to_simtime(cfg, tstime, ts)"},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"cfg ubiquity system object tstime numeric time timescale ts string containing timescale","code":""},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"tstime system timescale units","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":null,"dir":"Reference","previous_headings":"","what":"View Information About the System — system_view","title":"View Information About the System — system_view","text":"Displays information (dosing, simulation options, covariates, etc) system.","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"View Information About the System — system_view","text":"","code":"system_view(cfg, field = \"all\", verbose = FALSE)"},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"View Information About the System — system_view","text":"cfg ubiquity system object field string indicating aspect system display verbose Boolean variable set true echo information screen","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"View Information About the System — system_view","text":"sequence strings system formation (one line per element) field \"\" show information system \"parameters\" summary parameter information \"bolus\" currently set bolus dosing \"rate\" infusion rate dosing \"covariate\" covariates \"iiv\" variance/covariance information \"datasets\" loaded datasets \"simulation\" simulation options \"estimation\" estimation options \"nca\" non-compartmental analyses performed","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"View Information About the System — system_view","text":"","code":"# To log and display the current system information: # \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") msgs = system_view(cfg, verbose=TRUE) #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' ' #> → Parameter Information #> → Parameter set selected: #> → Short Name: default #> → Description: mAb in Humans #> → Default parameters for current set: #> → name | value | units #> → ---------------------------------------------------- #> → F1 | 0.7440 | --- #> → ka | 0.2820 | 1/day #> → CL | 0.2000 | L/day #> → Vc | 3.6100 | L #> → Vp | 2.7500 | L #> → Q | 0.7470 | L/day #> → MW | 140.0000 | kD #> → prop_err | 0.1000 | -- #> → add_err | 0.1000 | ng/ml #> → ---------------------------------------------------- #> → #> → Bolus dosing details #> → field | values | scaling | units #> → -------------------------------------------------- #> → times | 0 7 14 | 1 | days #> → Cc | 0 0 0 | 1e3/MW/Vc | mg #> → At | 400 0 0 | 1e3/MW | mg #> → -------------------------------------------------- #> → Infusion rate details #> → Rate | field | values | scaling | units #> → ----------------------------------------------------------------- #> → Dinf | time | 0 30 | 1/60/24 | min #> → | levels | 0 0 | 60*24*1e3/MW | mg/min #> → ----------------------------------------------------------------- #> → #> → Covariate details #> → Covariate | field | values | units #> → -------------------------------------------------- #> → DOSE | time | 0 | day #> → (step) | levels | 400 | mg #> → WT | time | 0 | day #> → (step) | levels | 60 | kg #> → -------------------------------------------------- #> → #> → IIV details #> → IIV/Parameter set: #> → Short Name: default #> → Variance/covariance matrix #> → #> → ETAka ETACL ETAVc ETAVp ETAQ #> → ETAka 0.4160 0 0 0 0 #> → ETACL 0 0.0988 0.0786 0.0619 0 #> → ETAVc 0 0.0786 0.1160 0.0377 0 #> → ETAVp 0 0.0619 0.0377 0.0789 0 #> → ETAQ 0 0 0 0 0.6990 #> → #> → On parameters #> → ka, ETAka(LN) #> → Vp, ETAVp(LN) #> → Vc, ETAVc(LN) #> → Q, ETAQ(LN) #> → CL, ETACL(LN) #> → #> → integrate_with c-file #> → output_times min = 0; max = 10.0; length = 101 #> → No datasets loaded #> → #> → Estimation details #> → Parameter set: default #> → Parameters estimated: F1, ka, CL, Vc, Vp, Q, MW, prop_err, add_err #> → objective_type ml #> → observation_function system_od_general #> → No cohort information found #> → No NCA has been performed # }"},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":null,"dir":"Reference","previous_headings":"","what":"Zero All Model Inputs — system_zero_inputs","title":"Zero All Model Inputs — system_zero_inputs","text":"Multiple default inputs can specified system file. scripting level function can used set inputs zero. subsequently specified inputs applied.","code":""},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Zero All Model Inputs — system_zero_inputs","text":"","code":"system_zero_inputs(cfg, bolus = TRUE, rates = TRUE)"},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Zero All Model Inputs — system_zero_inputs","text":"cfg ubiquity system object bolus Boolean value indicating weather bolus inputs set zero rates Boolean value indicating weather infusion rate inputs set zero","code":""},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Zero All Model Inputs — system_zero_inputs","text":"Ubiquity system object specified inputs set zero","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Zero All Model Inputs — system_zero_inputs","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clear only infusion rates cfg = system_zero_inputs(cfg, bolus=TRUE, rates=FALSE) # Clear all inputs: cfg = system_zero_inputs(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/tic.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of Matlab tic() command — tic","title":"Implementation of Matlab tic() command — tic","text":"Used conjunction toc() find elapsed time code executed.","code":""},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of Matlab tic() command — tic","text":"","code":"tic(type = c(\"elapsed\", \"user.self\", \"sys.self\"))"},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of Matlab tic() command — tic","text":"type can either \"elapsed\" \"user.self\" \"sys.self\"","code":""},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of Matlab tic() command — tic","text":"time tic called","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of Matlab tic() command — tic","text":"","code":"tic() Sys.sleep(3) toc() #> elapsed #> 3.011"},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"Given matrix (d) time courses (row individual column time point) confidence interval (ci) calculate mean, median, confidence intervals vector values creating patches.","code":""},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"","code":"timecourse_stats(d, ci)"},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"d matrix responses (row individual column time point) ci confidence interval percent (eg, 95)","code":""},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"List following elements: stats$ub_ci vector confidence interval upper bound stats$lb_ci vector confidence interval lower bound stats$mean vector mean values stats$median vector median values","code":""},{"path":"https://r.ubiquity.tools/reference/toc.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of Matlab toc() command — toc","title":"Implementation of Matlab toc() command — toc","text":"Used conjunction tic() find elapsed time code executed.","code":""},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of Matlab toc() command — toc","text":"","code":"toc()"},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of Matlab toc() command — toc","text":"time seconds since tic() called","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of Matlab toc() command — toc","text":"","code":"tic() Sys.sleep(3) toc() #> elapsed #> 3.01"},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"Checks names specified different analysis aspects (cohorts, analyses, reports, etc.) make sure start letter contain letters, numbers _","code":""},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"","code":"ubiquity_name_check(test_name)"},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"test_name string containing name tested","code":""},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"List Boolean element isgood TRUE name tests correct, FALSE fails. element msgs contains verbose message fails.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts Numeric Variables into Padded Strings — var2string","title":"Converts Numeric Variables into Padded Strings — var2string","text":"Mechanism converting numeric variables strings reporting.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts Numeric Variables into Padded Strings — var2string","text":"","code":"var2string(vars, maxlength = 0, nsig_e = 3, nsig_f = 4)"},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts Numeric Variables into Padded Strings — var2string","text":"vars numeric variable vector numeric variables maxlength value greater zero spaces added beginning string total length equal maxlength nsig_e number significant figures scientific notation nsig_f number significant figures numbers (2.123)","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts Numeric Variables into Padded Strings — var2string","text":"Number string padded","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Converts Numeric Variables into Padded Strings — var2string","text":"","code":"var2string(pi, nsig_f=20) #> [1] \"3.14159265358979311600\" var2string(.0001121, nsig_e=2, maxlength=10) #> [1] \" 1.12e-04\""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert R Objects to Strings — var2string_gen","title":"Convert R Objects to Strings — var2string_gen","text":"Mechanism converting R objects strings reporting.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert R Objects to Strings — var2string_gen","text":"","code":"var2string_gen(var)"},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert R Objects to Strings — var2string_gen","text":"var R variable","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert R Objects to Strings — var2string_gen","text":"Variable string form","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert R Objects to Strings — var2string_gen","text":"","code":"var2string_gen(c(1,2,3)) #> [1] \"min = 1.0; max = 3.0; length = 3 \""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":null,"dir":"Reference","previous_headings":"","what":"Print and Log Messages — vp","title":"Print and Log Messages — vp","text":"Used print messages screen log file.","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print and Log Messages — vp","text":"","code":"vp(cfg, str, fmt = \"alert\")"},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print and Log Messages — vp","text":"cfg ubiquity system object str sequence strings print fmt string format one following: \"h1\", \"h2\", \"h3\", \"verbatim\", \"alert\" (default), \"warning\", \"danger\".","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print and Log Messages — vp","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print and Log Messages — vp","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSY #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file vp(cfg, \"Message that will be logged\") #> → Message that will be logged #> [1] TRUE # }"},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Ubiquity Workshop Sections — workshop_fetch","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"ubiquity package function can used fetch example files different sections workshop.","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"","code":"workshop_fetch( section = \"Simulation\", overwrite = FALSE, copy_files = TRUE, output_directory = getwd() )"},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"section Name section workshop retrieve (\"Simulation\") overwrite TRUE new workshop files overwrite existing files present (FALSE) copy_files TRUE files written output_directory, FALSE names locations files returned (TRUE) output_directory directory workshop files placed (getwd())","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"list","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"Valid sections \"Simulation\", \"Estimation\", \"Vitro\", \"Titration\" \"Reporting\", \"NCA\"","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"","code":"# \\donttest{ workshop_fetch(\"Estimation\", output_directory=tempdir(), overwrite=TRUE) #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite_global.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/analysis_parent_metabolite_nm_data.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/system.txt #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/pm_data.csv #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//RtmpSYVZMR/nm_data.csv #> $sources #> [1] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent.r\" #> [2] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite.r\" #> [3] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite_global.r\" #> [4] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/scripts/analysis_parent_metabolite_nm_data.r\" #> [5] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/systems/system-adapt.txt\" #> [6] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/csv/pm_data.csv\" #> [7] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4164f85580/ubiquity/ubinc/csv/nm_data.csv\" #> #> $destinations #> [1] \"analysis_parent.r\" #> [2] \"analysis_parent_metabolite.r\" #> [3] \"analysis_parent_metabolite_global.r\" #> [4] \"analysis_parent_metabolite_nm_data.r\" #> [5] \"system.txt\" #> [6] \"pm_data.csv\" #> [7] \"nm_data.csv\" #> #> $write_file #> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE #> #> $isgood #> [1] TRUE #> # }"},{"path":[]},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-1-0","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.1.0 (development version)","text":"Removed NONMEM Monolix outputs Added translation nlmixr2 output NONMEM Monolix outputs Added simulation option dynamic set TRUE default set FALSE fix ODEs 0 allow vitro analysis. Applying variance models cohort definitions. Fixed issue initial conditions passed nlmixr2 output.","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-203","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.3","title":"ubiquity 2.0.3","text":"CRAN release: 2024-03-08","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-3","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.3","text":"Fixed IIV comments breaking nlmixr2 output Fixed bug spaces breaking compilation C output Fixed bug CRAN flextable/officer update broke saved values vignettes","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-201","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.1","title":"ubiquity 2.0.1","text":"CRAN release: 2023-10-29","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-1","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.1","text":"Removed internal files longer used Added documentation creating user defined observation functions running parameter estimation Updated reporting template work development version onbrand Changed terminal messaging use cli Added termination criteria estimation output Fixed wrapping issue Fortran output unwrappable strings resulted infinite loop Added system-testing.txt example Added nlmxir output target Added template creation NONMEM, Monolix, nlmixr Fixed R command compilation use R.home() Fixed broken tests Updated CITATION use bibentry Fixing error building systems windows","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-200","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.0","title":"ubiquity 2.0.0","text":"CRAN release: 2021-09-03","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-0","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.0","text":"Lots small updates function documentation vignettes Completely replaced reporting functionality. Now using onbrand package templated reporting. Note: break reporting version 1 R package. Old Word PowerPoint templates work, need create yaml mapping file. detailed Reporting vignette. Reporting changes added following functions system_rpt_add_slide() system_rpt_add_doc_content() system_rpt_read_template() system_rpt_save_report() system_rpt_template_details() system_fetch_rpt_officer_object() system_fetch_rpt_onbrand_object() system_set_rpt_officer_object() system_set_rpt_onbrand_object() Reporting changes removed following functions: system_report_doc_add_content() system_report_doc_format_section() system_report_doc_set_ph() system_report_estimation() system_report_glp() system_report_init() system_report_nca() system_report_ph_content() system_report_save() system_report_set() system_report_slide_content() system_report_slide_section() system_report_slide_title() system_report_slide_two_col() system_report_view_layout() system_fetch_report() system_fetch_report_format() md_to_officer() md_to_oo() Reporting changes updated vignettes, example scripts function templates","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-104","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.4","title":"ubiquity 1.0.4","text":"CRAN release: 2021-04-18","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-1-0-4","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 1.0.4","text":"Renamed system_report_fetch system_fetch_report Added reporting scripts unit tests Added import officer functions starting body_end_ Changed table figure captions numbered Word reporting Created testthat scripts run workshop functions","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"new-features-1-0-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"ubiquity 1.0.4","text":"Added shaded region observed AUC NCA reporting Added cohort-specific output times option estimation workflow Updated references documentation templates point r.ubiquity.tools Added checks estimation routines check reasonable bounds global optimizer notify users estimates near bounds Added sessionInfo() estimation Word reporting Added system_fetch_report_format Integrated markdown (md) header format option flextable outputs Added default cfg$reporting$enabled (FALSE) Added ability use markdown NCA summary tables generated system_nca_summary Fixed placeholder text, now delimiters ===either side text Added system_set_option general group output_directory option markdown Word reporting, default font properties defined ability specify org_functions.R template added. Moved annotated layout generation PowerPoint files system_report_view_layout() annotate_base() command officer Added optional key fields tables figures Word reporting Added ability pass PKNCA.options system_nca_run Added verbose option system_view command Allowing pass dataset columns summary NCA output Updated system_report_ph_content system_report_doc_add_content allow inclusion flextable objects Updated system_view include nca results system_fetch_nca - function fetch NCA results system_fetch_nca_columns - function fetch column descriptors specific analysis system_nca_parameters_meta - list standard NCA parameters system_nca_summary - creates summary tables NCA results Adding checks simulate_subjects ensure required columns present Added ability read xlsx data sets system_load_data","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-4","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.4","text":"CRAN erroring tic() function. Removed tic() toc() functions Fixed bug dataset given system_run_nca enough valid data actually run NCA Fixed “Coordinate system already present…” warning gg_axis Fixed location table generation example script analysis_nca_md.R table styles picked properly Added scales package requirement Fixed missing rptname inputs system_report_ph_content Fixed Bug system view cohort-specific parameters defined Fixed figure generation errors estimation workflow Fixed bug system_report_save() Removed aberrant gdata require calls templates Fixed bug system_nca_run DOSE factor Fixed bug system_nca_run back extrapolation done doses skipped due insufficient points. causing error. Removed coercion warnings: tmpsumhalflife = NCA.resresult[NCA.resresultPPTESTCD == “half.life”, : Coercing LHS list Removed digits input system_nca_run (now handled system_nca_summary ) Fixed coercion warnings covariates building system Using explicit declaration officer functions specifying importFrom prevent namespace issues readxl allow function readxl::read_xlsx","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-103","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.3","title":"ubiquity 1.0.3","text":"CRAN release: 2020-09-13","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-1-0-3","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 1.0.3","text":"Removed gdata dependency Removed URL redirects documentation resolve CRAN submission warnings","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"new-features-1-0-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"ubiquity 1.0.3","text":"Added option simulate subjects specify secondary parameters saved","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-3","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.3","text":"Converted system_nca_run() using $ mostly using [[“”]] Fixed NCA template Fixed bug ShinyApp template iiv tab displayed even system iiv elements","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-102","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.2","title":"ubiquity 1.0.2","text":"CRAN release: 2020-07-05","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-2","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.2","text":"Updated components fix issues encountered R 4.0","code":""}] +[{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Model Deployment","text":"model developed may useful provide easy way run simulations automate specific analyses. , ubiquity provides ShinyApp allows model run easy use interface highly customizable. App can run locally (useful meetings answer quick questions) deployed Shiny server allow others access model. demonstrate interface can begin PK model mAbs humans (Davda etal. mAbs, 6(4), 1094-1102) : Use ?system_new see list available system file examples. building system can create ShinyApp template: create following three files: ubiquity_app.R - Script run control ubiquity ShinyApp server.R - Server script ui.R- UI script","code":"library(ubiquity) system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE) cfg = build_system(system_file = \"system.txt\") system_fetch_template(cfg, template = \"ShinyApp\", overwrite = TRUE)"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"running-the-model","dir":"Articles","previous_headings":"","what":"Running the model","title":"Model Deployment","text":"Next simply open ubiquity_app.R RStudio source , RStudio open window associated application. ShinyApp tends work better run within browser. starting App load default dosing file run model. first model output plotted. make changes App, changes reflected user log bottom screen. can change outputs plotted, axis limits, aspects plot using plot controls figure. intent provide quick method get model running default behaviors provide users need. behavior ShinyApp can customized (described ). First discuss default interface:","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"altering-dosing","dir":"Articles","previous_headings":"Running the model","what":"Altering dosing","title":"Model Deployment","text":"list bolus times values can specified comma-separated values. dose repeated fashion check ``Repeat last dose’’ box, provide dosing interval (units dosing times), give number doses administer. example repeat 400 mg dose every two weeks two doses. Rates infusion specified set switching times corresponding infusion rates (separated commas). infusion rates held constant next switching time. example infuse drug 800mg/min starting time 0, infusion turned (set 0) 30 minutes.","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"population-simulations","dir":"Articles","previous_headings":"Running the model","what":"Population simulations","title":"Model Deployment","text":"variability system parameters specified (? ?) “Variability” tab visible. Simply check “Simulate variability” box, alter number subjects, prediction interval, elements variance-covariance matrix simulate desired population response. select “Update Plot”, selected output plotted (mean – solid line, selected confidence interval – shaded region).","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"saving-model-results","dir":"Articles","previous_headings":"","what":"Saving model results","title":"Model Deployment","text":"save model results need provide descriptive name analysis, push save button, click link generated. select time stamp, appended name zip file. default following files saved: analysis_single_dose_400_mg_lib.r, analysis_single_dose_400_mg.r - two files can used recreate results ShinyApp. analysis_single_dose_400_mg_timecourse.png - Time-course simulation results analysis_single_dose_400_mg.csv - Predictions containing timescale model, every state, output analysis_single_dose_400_mg_RX.html - file report (X) specified ubiquity_app.R (See ) system.txt - system file describing model ubiquity_log.txt - log file user done","code":""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-scripts","dir":"Articles","previous_headings":"Saving model results","what":"Model scripts","title":"Model Deployment","text":"files analysis_NAME.r analysis_NAME_lib.r can used two ways. First, two files can used stand-alone files recreate simulation results ShinyApp. Creating Simulation Scripts main script (analysis_NAME.r) can used starting point create simulation scripts. necessary modify First comment sourcing standalone library: Next (script system.txt file) uncommenting following lines force system rebuilt changes system file loaded.","code":"#source(\"analysis_NAME_lib.r\"); if(!require(ubiquity)){ source(file.path('library', 'r_general', 'ubiquity.R')) } cfg = build_system(system_file=\"system.txt\")"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"controlling-what-is-saved","dir":"Articles","previous_headings":"Saving model results","what":"Controlling what is saved","title":"Model Deployment","text":"certain instances may want allow user access everything saved default. edit ubiquity_app.R can alter pushed user setting relevant fields FALSE.","code":"cfg$gui$save$system_txt = TRUE cfg$gui$save$user_log = TRUE"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-diagram","dir":"Articles","previous_headings":"Model documentation","what":"Model diagram","title":"Model Deployment","text":"can difficult user look set parameters, dosing inputs, outputs determine model works. aid user can useful create model diagram. utilize majority screen space, image roughly twice wide tall. can create image favorite drawing program. Inkscape free vector drawing program available inkscape.org. run following: create file system.svg. can edit save portable network graphics (png) file named system.png directory ubiquity_app.R file. start ShinyApp find file create tab plotting area App.","code":"system_fetch_template(cfg, template=\"Model Diagram\")"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"model-reports","dir":"Articles","previous_headings":"Model documentation","what":"Model reports","title":"Model Deployment","text":"Sometimes need detail annotated model diagram. may need perform calculations based results simulation. may better present information tabulated format. scenarios can create RMarkdown file. Create copy report template (system_report.Rmd) script test (test_system_report.r): called ’ll access ubiquity model object (cfg) simulation results som. simulation results take form deterministic simulation (see output ?run_simulation_ubiquity) , variability checked, stochastic simulation (see output ?simulate_subjects) tell ShinyApp load report (named system_report.Rmd), following lines need added ubiquity_app.R. title field title tab ShinyApp file name file created. can create five reports way, differentiated list name (R1, R2, … R5). file test_system_report.r can used debug model report file. First run model ShinyApp reports disabled. App runs stores state (cfg) current simulation results (som) following data files: cfg \\rightarrow transient/rgui/default/gui_state.RData som \\rightarrow transient/rgui/default/gui_som.RData Next load test script, modify report name accordingly, run : generate report HTML format. can insert debugging commands report test add information. working, can enable report described appear tab viewable user. reports may depend user input. example, RMarkdown file documents modeling assumptions model construction process content change user interacts App. use pre-rendered report simply replace .Rmd .html: tell App read html, prevent rendering report, speed things user.","code":"system_fetch_template(cfg, template=\"Shiny Rmd Report\") cfg$gui$modelreport_files$R1$title = \"Tab Title\" cfg$gui$modelreport_files$R1$file = \"system_report.Rmd\" load(\"transient/rgui/default/gui_som.RData\") load(\"transient/rgui/default/gui_state.RData\") params = list() params$cfg = cfg params$som = som rmarkdown::render(\"system_report.Rmd\", params = params, output_format = \"html_document\") cfg$gui$modelreport_files$R1$title = \"Tab Title\" cfg$gui$modelreport_files$R1$file = \"system_report.html\""},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"user-definable-functions","dir":"Articles","previous_headings":"","what":"User definable functions","title":"Model Deployment","text":"customize simulation plotting within ShinyApp necessary create custom functions. need placed file. example placed mylibs.r main template directory. Lastly, need tell ShinyApp load file. need edit ubiquity_app.R add following line:","code":"cfg$gui$functions$user_def = 'mylibs.r'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"custom-simulation-commands","dir":"Articles","previous_headings":"User definable functions","what":"Custom simulation commands","title":"Model Deployment","text":"default ShinyApp run simulations using run_simulation_ubiquity (individual) simulate_subjects (population). take inputs parameters vector containing current parameter set changes made interface cfg data structure. can create functions overwrite defining following: Individual Simulations Population Simulations Note order use default plotting functionality functions need return values format default functions individual (run_simulation_ubiquity) population (simulate_subjects) simulations.","code":"cfg$gui$functions$sim_ind = 'function_name(parameters, cfg)' cfg$gui$functions$sim_var = 'function_name(parameters, cfg)'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"custom-plotting-commands","dir":"Articles","previous_headings":"User definable functions","what":"Custom plotting commands","title":"Model Deployment","text":"customize plotting output need create functions can utilize simulation output som. individual population simulations output run_simulation_ubiquity simulate_subjects, respectively. Unless user-specified simulation functions used. case som can format needed. possible also access parameters vector containing current parameter set changes made interface cfg data structure. can create plotting functions overwrite defining following ubiquity_app.R: Indiviudal Plot Population Plot","code":"cfg$gui$functions$plot_ind = 'function_name(cfg, parameters,som)' cfg$gui$functions$plot_var = 'function_name(cfg, parameters,som)'"},{"path":"https://r.ubiquity.tools/articles/Deployment.html","id":"deployment-on-a-shiny-server","dir":"Articles","previous_headings":"","what":"Deployment on a Shiny Server","title":"Model Deployment","text":"deploy ShinyApp shiny server need indicate modifying ubiquity_app.R changing deploying variable TRUE: ShinyApp needs initialized server. can two ways. First can create empty file called REBUILD needs deployed along side app files. can touch command nat.utils package: force initialization first time app loaded. works well using rsconnect deploy app. Alternatively, can manually sync files run following shiny user server. App fails run Shiny Server check following: Make sure correct packages installed available user Shiny Server running . Make sure ownership permissions server files correct. test deployment can install shinyVM","code":"deploying = TRUE nat.utils::touch(\"REBUILD\") R -e \"source('ubiquity_app.R')\""},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Naive-Pooled Parameter Estimation","text":"workshop (workshop.ubiquity.tools) provides several examples performing parameter estimation ubiquity. make copy scripts supporting files current working directory run following: analysis_parent.r - Least squares estimation single output analysis_parent_metabolite.r - Maximum likelihood estimation two outputs analysis_parent_metabolite_global.r - Using global optimization packages analysis_parent_metabolite_nm_data.r - Reading cohorts NONMEM file scripts build previous one demonstrate different features ubiquity parameter estimation routines. examples use system (shown figure ) contains three differential equations tracking mass parent drug blood (Mpb) tissue space (Mpt). blood parent can form (fmKp) metabolite (Mmb) subsequent elimination (Km). parent/metabolite model adapted ADAPT5 Users Manual (https://bmsr.usc.edu/files/2013/02/ADAPT5-User-Guide.pdf). Using system_new (use ?system_new see list available system file examples) can copy template file current directory build system: system built, can create local copy estimation template system: create file: analysis_estimate.R working directory. beginning script three variables created control script format output. variable analysis_name defines prefix prepended output generated script. Archiving analysis results controlled Boolean variable archive_results. Lastly, script controlled using flowctl variable (possible options listed commented ). estimation script following main components: Select parameter set subset parameters estimate Set options (simulation, estimation, etc) Load datasets Define cohorts Estimate parameters Plot results explored using scripts .","code":"library(ubiquity) fr = workshop_fetch(section=\"Estimation\", overwrite=TRUE) library(ubiquity) system_new(file_name=\"system.txt\", system_file=\"adapt\", overwrite = TRUE) cfg = build_system(system_file = \"system.txt\") system_fetch_template(cfg, template=\"Estimation\")"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"least-squares-estimationsingle-output-analysis_parent-r","dir":"Articles","previous_headings":"","what":"Least squares estimation/single output (analysis_parent.r)","title":"Naive-Pooled Parameter Estimation","text":"first example (analysis_parent.r) begins specifying want perform parameter estimation archive results using name1 parent_d1030 indicate analyzing parent PK 10 30 mg dosing cohorts: Next select parameters estimate. ’re estimating parent data, names parameters relevant parent PK (pnames) selected. estimate parameters simply exclude third argument. system parameters estimated weighted least squares objective used2. Next set options relevant estimation underlying simulation routines. example simulation output times specified, relevant parameters can set. template generated several common options commented . can uncommented modified needed. dataset (shown table ) included ubiquity package accessed using system.file. example script referenced explicitly. format requirements datasets flat files header row. format flexible requires time/observation information columns required filter data isolate cohorts received treatment. inputs defined cohorts defined. Data files loaded using system_load_data() name3 assigned dataset. Data can read files (csv, xls, xlsx, tab) existing data frame. name (pm_data ) used reference dataset later script. dataset column observation time (TIME), subject id (ID), concentrations parent (PT) metabolite (MT), BLQ flag nominal dose (DOSE). columns used (TIME, PT, MT DOSE), others (BQL) ignored. intended example general guide dataset format. necessary different outputs different columns (wide format). dataset loaded tall skinny format well. example going analyze parent data individuals given 10 30 mg using least squares objective. Next need identify data inputs associated data. done defining cohorts, groups data receive treatment model inputs (bolus dosing, infusion rates, covariates) associated cohorts. example define cohort dosing group. make sure starting blank slate can use system_clear_cohorts() remove previously defined information. cohort define list information cohort. cohort unique name field4 dataset field pointing dataset (pm_data) loaded . optional cohort filter (cf) field used reduce entire dataset records associated cohort. See help system_define_cohort() information construct cohort filters. Next necessary define inputs cohort. inputs refers model inputs may include dosing well covariates, estimation template (generated using system_fetch_template() ) contain placeholders defined system file. Note: bolus infusion inputs, necessary define inputs nonzero, covariates necessary define differ definitions system file. input AMT field TIME field units specified system file (AMT TIME internal indentifiers taken dataset). Next need match outputs model outputs dataset. cohort$outputs field used group output. cohort output mapping blood PK parent output Parent. times observations dataset found 'TIME’ column ’PT’ column (missing data specified -1 dropped). mapped model timescale ('hours', specified ) model output (’Cpblood’, specified ). Note units dataset must model: output grouping cohort marker color, shape line type can specified (controlling plotted output). Finally cohort defined using system_define_cohort(): thing 30 mg dose group: cohorts defined call estimation function (system_estimate_parameters()). flowctl set 'plot previous estimate' 'plot guess' values just returned. one estimation options selected flowctl several files generated output folder analysis_name prefix: output/parent_d1030-report.txt - Text file summary estimation results. output/parent_d1030-parameters_all.csv - Summary table parameters (estimated fixed) output/parent_d1030-parameters_est.csv - Summary table estimated parameters output/parent_d1030-system_update.txt - Text update system.txt file new parameter estimates output/parent_d1030-sessionInfo.RData - output sessionInfo() stored SI object data file Next system simulated estimate data stored erp. information variable used generate standard plots , may desirable save information generate figures. necessary understand structure erp. list two different fields. TIME - Time units data OBS - Observations (SMOOTH = FALSE), -1 (SMOOTH=TRUE) PRED - Predictions (SMOOTH = FALSE) VAR - Variance (SMOOTH = FALSE), -1 (SMOOTH=TRUE) SMOOTH - FALSE observation times, TRUE observations OUTPUT - name output COHORT - name cohort ts.time - Simulation time scale ts.TS - entry timescale TS pred - Simulated predictions name - State model output cohort - Cohort name Lastly predictions overlaying data observed vs predicted plots generated using system_plot_cohorts(). Basic formatting figures controlled using plot_opts list (see ?system_plot_cohorts details). called, system_plot_cohorts() write png pdf output time course observed vs predicted files. also return list ggplot objects relative paths files well. example following generated: output/parent_d1030_time course_Parent.pdf output/parent_d1030_time course_Parent.png output/parent_d1030_obs_pred_Parent.pdf output/parent_d1030_obs_pred_Parent.png","code":"flowctl = 'estimate' archive_results = TRUE analysis_name = 'parent_d1030' pnames = c('Vp', 'Vt', 'CLp', 'Q') cfg = system_select_set(cfg, \"default\", pnames) cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,100,1)) cfg = system_load_data(cfg, dsname = \"pm_data\", data_file = system.file(\"ubinc\", \"csv\", \"pm_data.csv\", package = \"ubiquity\")) cfg = system_clear_cohorts(cfg) cohort = list( name = \"dose_10\", cf = list(DOSE = c(10)), inputs = NULL, outputs = NULL, dataset = \"pm_data\") cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]] = c(10) # mpk cohort[[\"outputs\"]][[\"Parent\"]] = list() # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list( time = \"TIME\", value = \"PT\", missing = -1) # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list( time = \"hours\", value = \"Cpblood\", variance = \"1\") # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list( marker_color = \"black\", marker_shape = 1, marker_line = 2 ) cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list( marker_color = \"black\", marker_shape = 1, marker_line = 2 ) cfg = system_define_cohort(cfg, cohort) cohort = list( name = \"dose_30\", cf = list(DOSE = c(30)), dataset = \"pm_data\", inputs = NULL, outputs = NULL) # Bolus inputs for the cohort cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]] = c(30) # mpk # Defining Parent output cohort[[\"outputs\"]][[\"Parent\"]] = list() # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list( time = \"TIME\", value = \"PT\", missing = -1) # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list( time = \"hours\", value = \"Cpblood\", variance = \"1\") # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list( marker_color = \"red\", marker_shape = 2, marker_line = 2 ) cfg = system_define_cohort(cfg, cohort) pest = system_estimate_parameters(cfg, flowctl = flowctl, analysis_name = analysis_name, archive_results = archive_results) cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,100,5)) erp = system_simulate_estimation_results(pest = pest, cfg = cfg) plot_opts = c() plot_opts$outputs$Parent$yscale = 'log' plinfo = system_plot_cohorts(erp, plot_opts, cfg, analysis_name=analysis_name)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"automated-reporting","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r)","what":"Automated Reporting","title":"Naive-Pooled Parameter Estimation","text":"outputs provide components generating presentations documents. Coping pasting figures tables documents can tedious. can convenient automate process accomplished function system_rpt_estimation().","code":""},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"powerpoint","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r) > Automated Reporting","what":"PowerPoint","title":"Naive-Pooled Parameter Estimation","text":"append results analysis PowerPoint document simply initialize new report (template=\"PowerPoint\"), call system_rpt_estimation() appropriate analysis_name, results analysis attached slides. save analysis results output directory.","code":"cfg = system_rpt_read_template(cfg, template=\"PowerPoint\") cfg = system_rpt_estimation(cfg=cfg, analysis_name=analysis_name) system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",paste(analysis_name, \"-report.pptx\", sep=\"\")))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"word","dir":"Articles","previous_headings":"Least squares estimation/single output (analysis_parent.r) > Automated Reporting","what":"Word","title":"Naive-Pooled Parameter Estimation","text":"process Word document . Just make sure template set \"Word\" report initialized: information integrated report generation see Reporting vignette.","code":"cfg = system_rpt_read_template(cfg, template=\"Word\") cfg = system_rpt_estimation(cfg=cfg, analysis_name=analysis_name) system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",paste(analysis_name, \"-report.docx\", sep=\"\")))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"maximum-likelihoodtwo-outputs-analysis_parent_metabolite-r","dir":"Articles","previous_headings":"","what":"Maximum likelihood/two outputs (analysis_parent_metabolite.r)","title":"Naive-Pooled Parameter Estimation","text":"example similar last except analyzing two different outputs (parent metabolite) proportional variance model. now can estimate parameters associated outputs well variance parameters: parameters estimated contain variance parameters (slope_parent slope_metabolite) maximum likelihood objective used. cohort definitions look much except variance model defined 'slope_parent*PRED^2', separate output named Metabolite. Similar modifications made 30 mg dosing cohort. Note: variance model can speified system.txt file using descriptor. specify variance cohort definition value system file used. specified either location default value (PRED^2) used.","code":"pnames = c('Vp', 'Vt', 'Vm', 'CLp', 'Q', 'CLm', 'slope_parent', 'slope_metabolite'); cfg = system_select_set(cfg, \"default\", pnames) cohort = list( name = \"dose_10\", cf = list(DOSE = c(10)), inputs = NULL, outputs = NULL, dataset = \"pm_data\") # Bolus inputs for the cohort cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"TIME\"]] = c( 0) # hours cohort[[\"inputs\"]][[\"bolus\"]][[\"Mpb\"]][[\"AMT\"]] = c(10) # mpk # Defining Parent output cohort[[\"outputs\"]][[\"Parent\"]] = list() # Mapping to data set cohort[[\"outputs\"]][[\"Parent\"]][[\"obs\"]] = list( time = \"TIME\", value = \"PT\", missing = -1) # Mapping to system file cohort[[\"outputs\"]][[\"Parent\"]][[\"model\"]] = list( time = \"hours\", value = \"Cpblood\", variance = \"slope_parent*PRED^2\") # Plot formatting cohort[[\"outputs\"]][[\"Parent\"]][[\"options\"]] = list( marker_color = \"black\", marker_shape = 1, marker_line = 1 ) # Defining Metabolite output cohort[[\"outputs\"]][[\"Metabolite\"]] = list() # Mapping to data set cohort[[\"outputs\"]][[\"Metabolite\"]][[\"obs\"]] = list( time = \"TIME\", value = \"MT\", missing = -1) # Mapping to system file cohort[[\"outputs\"]][[\"Metabolite\"]][[\"model\"]] = list( time = \"hours\", value = \"Cmblood\", variance = \"slope_metabolite*PRED^2\") # Plot formatting cohort[[\"outputs\"]][[\"Metabolite\"]][[\"options\"]] = list( marker_color = \"blue\", marker_shape = 1, marker_line = 1 ) cfg = system_define_cohort(cfg, cohort)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"global-estimation-routines-analysis_parent_metabolite_global-r","dir":"Articles","previous_headings":"","what":"Global estimation routines (analysis_parent_metabolite_global.r)","title":"Naive-Pooled Parameter Estimation","text":"Now build previous example demonstrate select different optimization routines. default, parameter estimation carried using Nelder-Mead optimization method optim library. can specify different functions library. See documentation optim (?optim) valid values method elements control. example, use simulated annealing change method SANN. also global optimization libraries R, two can readily used ubiquity: Particle Swarm Optimizer (pso package) Genetic Algorithms (GA package). use pso package set following options: use GA package set following options: Note: Optimizers like SANN global optimizers (pso GA) good identifying parameter sets outside region initial guess. However, one consequence algorithms can quickly approach bounds. Consequently important provide realistic upper lower bounds parameters (

descriptor system file using system_set_guess() scripting level). use default value machine precision (eps) lower bound infinity (Inf) upper bound optimization routines can choose parameter values can cause internal simulations fail.","code":"cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"SANN\") library(pso) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"pso\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"psoptim\") library(GA) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(maxiter = 10000, optimArgs = list(method = \"Nelder-Mead\", maxiter = 1000)))"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"cohorts-from-nonmem-dataset-analysis_parent_metabolite_nm_data-r","dir":"Articles","previous_headings":"","what":"Cohorts from NONMEM dataset (analysis_parent_metabolite_nm_data.r)","title":"Naive-Pooled Parameter Estimation","text":"examples , cohorts defined manually. Sometimes may data NONMEM dataset dosing information located dataset. may convenient simply define cohort subject dataset. function system_define_cohorts_nm can used. differences script analysis_parent_metabolite.r now highlighted: First load NONMEM dataset clear cohorts: Next define filter use dataset (include 10 30 mg doses): information filtering datasets see help nm_select_records(). Now define maps different outputs. output specify variance, compartment (CMT) number, model output missing number flag: Lastly define map model inputs. case bolus Mpb compartment: Unused columns dataset ignored. filter, input observation maps defined, now add cohorts","code":"cfg = system_load_data(cfg, dsname = \"nm_pm_data\", data_file = system.file(\"ubinc\", \"csv\", \"nm_data.csv\", package = \"ubiquity\")) cfg = system_clear_cohorts(cfg); filter = list() filter$DOSE = c(10, 30) OBSMAP = list() OBSMAP$PT = list(variance = 'slope_parent*PRED^2', CMT = 1, output = 'Cpblood', missing = -1 ) OBSMAP$MT = list(variance = 'slope_metabolite*PRED^2', CMT = 2, output = 'Cmblood', missing = -1 ) INPUTMAP = list() INPUTMAP$bolus$Mpb$CMT_NUM = 1 cfg = system_define_cohorts_nm(cfg, DS = 'nm_pm_data', col_ID = 'ID', col_CMT = 'CMT', col_DV = 'DV', col_TIME = 'TIME', col_AMT = 'AMT', col_RATE = 'RATE', col_EVID = 'EVID', col_GROUP= 'DOSE', filter = filter, INPUTS = INPUTMAP, OBS = OBSMAP, group = FALSE)"},{"path":"https://r.ubiquity.tools/articles/Estimation.html","id":"contents-of-system-txt","dir":"Articles","previous_headings":"","what":"Contents of system.txt","title":"Naive-Pooled Parameter Estimation","text":"","code":"# # Parent/Metabolite example taken from Section 9.3 of the ADAPT5 Users Manual # # https://bmsr.usc.edu/files/2013/02/ADAPT5-User-Guide.pdf #

Vp 10.0 1e-5 100 L yes System

Vt 10.0 1e-5 100 L yes System

Vm 30.0 1e-5 100 L yes System

CLp 1.0 1e-5 100 L/hr yes System

CLm 1.0 1e-5 100 L/hr yes System

Q 0.3 1e-5 100 L/hr yes System Original Estimates slope_parent 0.1 1e-9 10 -- no Variance slope_metabolite 0.1 1e-9 10 -- no Variance ; [ 0 ]; 1; hours ; Mpb; [ 0 ]; 70; mpk -(CLp/Vp + Q/Vp)*Mpb + Q/Vt*Mpt Q/Vp*Mpb - Q/Vt*Mpt CLp/Vp*Mpb - CLm/Vm*Mmb Cpblood = Mpb/Vp Cmblood = Mmb/Vm 1.0 1.0/24.0 0.08 Vp 0.08 Vt 0.08 CLp 0.08 CLm SIMINT_SEQ[0][100][1] "},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"working-with-rxode2-nlmixr2-nonmem-and-monolix","dir":"Articles","previous_headings":"","what":"Working with rxode2, nlmixr2, NONMEM, and Monolix","title":"Howtos","text":"Say model ubiquity want use nlmixr2. perhaps want try simulation engine rxode2, want hand model someone using Monolix. provide way easily convert model different formats automated fashion.","code":""},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-rxode2-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in rxode2 format","title":"Howtos","text":"example consider system file two compartment model (system_2cmt.txt ). build system rxode2 output target created. can use system_fetch_template() function access file. ’m placing script temporary directory. script generate rxode2 model function store function object my_model. default input nlmixr2. can use function piping methodology things like add IIV terms parameters. can use ubiquity build structural model piping, rxode2, nlmixr2 analysis. can see contents system_nlmixr2.R my_model object looks like . Note include output ubiquity need error model. along Descriptor need define variance parameters () also output error model ().","code":"cfg = build_system(system_file = sf_2cmt_full, temporary_directory = file.path(tempdir(), \"transient\")) fr = system_fetch_template(cfg, template = \"nlmixr2\", output_directory = tempdir(), overwrite = TRUE) library(rxode2) source(file.path(tempdir(), \"system_nlmixr2.R\"))"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-nonmem-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in NONMEM format","title":"Howtos","text":"model rxode2 format can convert NONMEM format babelmixr2 package (via ruminate package). need least one inter-individual variability term. can system file delimiter. example using model piping. specify typical value Vc, parameter TV_Vc, error lognormally distributed. add IIV term eta_Vc. Next just need load ruminate package (>=0.2.4) use rx2other() function create NONMEM control stream:","code":"my_model = my_model |> model({Vc = exp(TV_Vc + eta_Vc)}) library(ruminate) my_model_nm = rx2other(my_model, out_type=\"nonmem\")"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"getting-your-model-in-monolix-format","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Getting your model in Monolix format","title":"Howtos","text":"can also get model Monolix specifying monolix output type:","code":"my_model_mlx = rx2other(my_model, out_type=\"monolix\")"},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"further-reading","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Further reading","title":"Howtos","text":"discussion topic see following: https://github.com/nlmixr2/babelmixr2/issues/107","code":""},{"path":"https://r.ubiquity.tools/articles/Howto.html","id":"models-in-different-formats","dir":"Articles","previous_headings":"Working with rxode2, nlmixr2, NONMEM, and Monolix","what":"Models in different formats","title":"Howtos","text":"ubiquity rxode2 script rxode2 object NONMEM Monolix Contents system_2cmt.txt file: Contents system_nlmixr2.R file produced system_fetch_template(): my_model object: file containing control stream found : my_model_nm$files$ctl$fn_full. file containing mlxtran output found : my_model_mlx$files$mlxtran$fn_full","code":"# Two compartment model with absorption compartment (At). The central # compartment (Cc) had a volume (Vc), and the tissue compartment (Cp) has a # volume (Vt). The system is parameterized in terms of macro constants (Q and # CL) # # While the the default dosing is a 1 mg IV dose into the central compartment, # the model is written to accept dosing into an absorption compartment and # through continuous IV infusion. # _________ # | | # | At | # | | # |_________| # | # | ka, fb # | # V # _________ _________ # | | Q | | # | Cc |------>| Cp | # | Vc |<------| Vt | # |_________| |_________| # | # | CL # | # V # # System Units: # # mass [=] mg # volume [=] ml # concentration [=] mg/ml # time [=] hr # #-------------# # | Parameters | # #-------------# # # System parameters # name value lower upper units editable grouping # bound bound

Vc 1.0 eps Inf ml yes System

Vt 1.0 eps Inf ml yes System

CL 1.0 eps Inf ml/hr yes System

Q 1.0 eps Inf ml/hr yes System

ka 1.0 eps Inf 1/hr yes System

fb 1.0 eps Inf -- yes System # Bolus Events # ------------ # times/events state values scale units ; [ 0 ]; 1; hours ; Cc; [1.0 ]; 1/Vc; mg ; At; [0.0 ]; 1; mg # Infusion Rates # ------------ # name time/levels values scale units ; times; [0]; 1; hours ; levels; [0]; 1; mg/hour -ka*At ka*At*fb/Vc - CL/Vc*Cc -Q*(Cc-Cp)/Vc + Dinf/Vc +Q*(Cc-Cp)/Vt Cc_mg_ml = Cc prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance add=add_err; prop=prop_err 1.0 1.0/24 # # # my_model <- function() { ini({ # Typical Value of System Parameters TV_Vc = c(.Machine$double.eps, 1.0, Inf) TV_Vt = c(.Machine$double.eps, 1.0, Inf) TV_CL = c(.Machine$double.eps, 1.0, Inf) TV_Q = c(.Machine$double.eps, 1.0, Inf) TV_ka = c(.Machine$double.eps, 1.0, Inf) TV_fb = c(.Machine$double.eps, 1.0, Inf) # Between-subject variability: # Error model parameters prop_err = c(.Machine$double.eps, 0.1, .Machine$double.xmax) add_err = c(.Machine$double.eps, 0.1, .Machine$double.xmax) }) model({ # System Parameters Vc = TV_Vc Vt = TV_Vt CL = TV_CL Q = TV_Q ka = TV_ka fb = TV_fb # Placeholders for infusion rates. # These should be defined in the dataset. # time scale: 1 units: (hours) # mass scale: 1 units: (mg/hour) Dinf = 0.0 # Defining ODEs d/dt(At) = (-ka*At) d/dt(Cc) = (ka*At*fb/Vc - CL/Vc*Cc -Q*(Cc-Cp)/Vc + Dinf/Vc) d/dt(Cp) = (+Q*(Cc-Cp)/Vt) # Outputs and error models Cc_mg_ml = Cc Cc_mg_ml ~ add(add_err) + prop(prop_err) }) } 
[36m──
[39m 
[1mrxode2-based free-form 3-cmt ODE model
[22m 
[36m──────────────────────────────────────
[39m ── 
[1m
[1mInitalization:
[1m
[22m ── 
[1mFixed Effects
[22m (
[1m
[34m$theta
[39m
[22m): TV_Vc TV_Vt TV_CL TV_Q TV_ka TV_fb prop_err add_err 1.0 1.0 1.0 1.0 1.0 1.0 0.1 0.1 
[1mOmega
[22m (
[1m
[34m$omega
[39m
[22m): eta_Vc eta_Vc 1 
[1m States
[22m (
[1m
[34m$state
[39m
[22m or 
[1m
[34m$stateDf
[39m
[22m): Compartment Number Compartment Name 1 1 At 2 2 Cc 3 3 Cp ── 
[1m
[1m
[1m
[1mμ-referencing
[1m
[1m (
[1m
[1m
[34m$muRefTable
[39m
[1m
[1m):
[1m
[22m ── theta eta level 1 TV_Vc eta_Vc id ── 
[1m
[1mModel (Normalized Syntax):
[1m
[22m ── function() { ini({ TV_Vc <- c(2.22044604925031e-16, 1) TV_Vt <- c(2.22044604925031e-16, 1) TV_CL <- c(2.22044604925031e-16, 1) TV_Q <- c(2.22044604925031e-16, 1) TV_ka <- c(2.22044604925031e-16, 1) TV_fb <- c(2.22044604925031e-16, 1) prop_err <- c(2.22044604925031e-16, 0.1) add_err <- c(2.22044604925031e-16, 0.1) eta_Vc ~ 1 }) model({ Vc <- exp(TV_Vc + eta_Vc) Vt = TV_Vt CL = TV_CL Q = TV_Q ka = TV_ka fb = TV_fb Dinf = 0 d/dt(At) = (-ka * At) d/dt(Cc) = (ka * At * fb/Vc - CL/Vc * Cc - Q * (Cc - Cp)/Vc + Dinf/Vc) d/dt(Cp) = (+Q * (Cc - Cp)/Vt) Cc_mg_ml = Cc Cc_mg_ml ~ add(add_err) + prop(prop_err) }) } $PROBLEM translated from babelmixr2 ; comments show mu referenced model in ui$getSplitMuModel $DATA my_model.csv IGNORE=@ $INPUT ID TIME EVID AMT DV CMT RXROW $SUBROUTINES ADVAN13 TOL=6 ATOL=12 SSTOL=6 SSATOL=12 $MODEL NCOMPARTMENTS=3 COMP(AT, DEFDOSE) ; At COMP(CC) ; Cc COMP(CP) ; Cp $PK MU_1=THETA(1) VC=DEXP(MU_1+ETA(1)) ; Vc <- exp(TV_Vc) VT=THETA(2) ; Vt <- TV_Vt CL=THETA(3) ; CL <- TV_CL RXR1=THETA(4) ; Q <- TV_Q KA=THETA(5) ; ka <- TV_ka FB=THETA(6) ; fb <- TV_fb $DES DINF=0 ; Dinf = 0 DADT(1) = (- KA*A(1)) ; d/dt(At) = (-ka * At) DADT(2) = (KA*A(1)*FB/VC-CL/VC*A(2)-RXR1*(A(2)-A(3))/VC+DINF/VC) ; d/dt(Cc) = (ka * At * fb/Vc - CL/Vc * Cc - Q * (Cc - Cp)/Vc + Dinf/Vc) DADT(3) = (RXR1*(A(2)-A(3))/VT) ; d/dt(Cp) = (Q * (Cc - Cp)/Vt) CC_MG_ML=A(2) ; Cc_mg_ml = Cc $ERROR ;Redefine LHS in $DES by prefixing with on RXE_ for $ERROR RXE_DINF=0 ; Dinf = 0 RXE_CC_MG_ML=A(2) ; Cc_mg_ml = Cc RX_PF1=RXE_CC_MG_ML ; rx_pf1 ~ Cc_mg_ml ; Write out expressions for ipred and w RX_IP1 = RX_PF1 RX_P1 = RX_IP1 W1=DSQRT((THETA(8))**2+(RX_PF1)**2*(THETA(7))**2) ; W1 ~ sqrt((add_err)^2 + (rx_pred_f_)^2 * (prop_err)^2) IF (W1 .EQ. 0.0) W1 = 1 IPRED = RX_IP1 W = W1 Y = IPRED + W*EPS(1) $THETA (2.2204e-16, 1 ) ; 1 - TV_Vc (2.2204e-16, 1 ) ; 2 - TV_Vt (2.2204e-16, 1 ) ; 3 - TV_CL (2.2204e-16, 1 ) ; 4 - TV_Q (2.2204e-16, 1 ) ; 5 - TV_ka (2.2204e-16, 1 ) ; 6 - TV_fb (2.2204e-16, 0.1) ; 7 - prop_err (2.2204e-16, 0.1) ; 8 - add_err $OMEGA 1 ; eta_Vc $SIGMA 1 FIX $ESTIMATION METHOD=1 INTER MAXEVALS=100000 SIGDIG=3 SIGL=12 PRINT=1 NOABORT $COVARIANCE $TABLE ID ETAS(1:LAST) OBJI FIRSTONLY ONEHEADER NOPRINT FORMAT=s1PE17.9 NOAPPEND FILE=my_model.eta $TABLE ID TIME IPRED PRED RXROW ONEHEADER NOPRINT FORMAT=s1PE17.9 NOAPPEND FILE=my_model.pred [FILEINFO] file='my_model-monolix.csv' delimiter = comma header = {ID, TIME, EVID, AMT, DV, ADM, nlmixrRowNums} [CONTENT] ID = {use=identifier} TIME = {use=time} EVID = {use=eventidentifier} AMT = {use=amount} DV = {use=observation, name=rx_prd_Cc_mg_ml, type=continuous} ADM = {use=administration} [INDIVIDUAL] input={Vc_pop, omega_Vc, Vt_pop, CL_pop, Q_pop, ka_pop, fb_pop} DEFINITION: Vc = {distribution=logNormal, typical=Vc_pop, sd=omega_Vc} Vt = {distribution=normal, typical=Vt_pop, no-variability} CL = {distribution=normal, typical=CL_pop, no-variability} Q = {distribution=normal, typical=Q_pop, no-variability} ka = {distribution=normal, typical=ka_pop, no-variability} fb = {distribution=normal, typical=fb_pop, no-variability} [LONGITUDINAL] input={add_err, prop_err} file='my_model-monolix.txt' DEFINITION: rx_prd_Cc_mg_ml={distribution = normal, prediction = rx_pred_Cc_mg_ml, errorModel=combined2(add_err,prop_err)} data={rx_prd_Cc_mg_ml} model={rx_prd_Cc_mg_ml} Vc_pop={value=2.71828182845905, method=MLE} Vt_pop={value=1, method=MLE} CL_pop={value=1, method=MLE} Q_pop={value=1, method=MLE} ka_pop={value=1, method=MLE} fb_pop={value=1, method=MLE} prop_err={value=0.1, method=MLE} add_err={value=0.1, method=MLE} omega_Vc={value=1, method=MLE} [TASKS] populationParameters() individualParameters(method = {conditionalMode}) fim(method = StochasticApproximation) logLikelihood(method = ImportanceSampling) plotResult(method = {outputplot, indfits, obspred, residualsscatter, residualsdistribution, parameterdistribution, covariatemodeldiagnosis, randomeffects, covariancemodeldiagnosis, saemresults}) [SETTINGS] GLOBAL: exportpath = 'my_model-monolix' POPULATION: exploratoryautostop = no smoothingautostop = no burniniterations = 5 exploratoryiterations = 250 simulatedannealingiterations = 250 smoothingiterations = 200 exploratoryalpha = 0 exploratoryinterval = 200 omegatau = 0.95 errormodeltau = 0.95"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Analysis of Static Systems, an In Vitro Example","text":"tutorial requires ubiquity 2.04 greater. Currently available using development version github Sometimes need analyze data independent variable time. can ubiquity tutorial highlight done. done already, please review naive-pooled parameter estimation tutorial build concepts covered . workshop (workshop.ubiquity.tools) provides example analyize static vitro data. make copy scripts supporting files current working directory run following: create following files current working direcotry: system-in_vitro.txt - System file can run vivo vitro in_vitro_er_data.csv- vitro data file mk_data_in_vitro.R- Script generate vitro data analysis_in_vitro.R- Script perform parameter estimation using vitro data example uses system Chakraborty Jusko. J Pharm Sci 91(5), 1334-1342. Specifically equation 5 article effect two drugs, B, driven concentrations (C_A, C_B): E = 100 \\left( 1- \\frac{ \\frac{I_{max,}(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} + \\frac{I_{max,B}(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ + (I_{max,} + I_{max,B} + I_{max,} I_{max,B}) \\\\ \\times \\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} \\times \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ }{ \\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} + \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} \\\\ +\\frac{(C_A) ^{\\gamma_A}}{(\\Psi IC_{50,})^{\\gamma_A}} \\times \\frac{(\\xi C_B)^{\\gamma_B}}{(\\Psi IC_{50,B})^{\\gamma_B}} +1 } \\right) \\xi = \\frac{IC_{50,}}{IC_{50,B}} implemented PKPD system file (system-in_vitro.txt) shown bottom. implementation dynamic meaning effect changes PK drug. However effect considered instantaneous typically analyzed vitro data using algebraic relationships. system consider following data: concentrations drug B altered (independent variable) Effect measured (dependent variable).","code":"library(ubiquity) fr = workshop_fetch(section=\"In Vitro\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-sysem-file-system-in_vitro-txt","dir":"Articles","previous_headings":"","what":"The sysem file: system-in_vitro.txt","title":"Analysis of Static Systems, an In Vitro Example","text":"First lets discuss way system file structured. bolus dosing PK specified, initial conditions effect compartments also defined terms system parameters: system parameters (C_A0 C_B0) default value zero. default system run like vivo PKPD system. initial condition placeholders used performing vitro analyses. allows use system file vitro vivo analyses. useful static vitro analysis one system file copy paste vivo dynamic system.","code":" Cp_A = C_A0 Cp_B = C_B0"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-dataset-in_vitro_er_data-csv","dir":"Articles","previous_headings":"","what":"The dataset: in_vitro_er_data.csv","title":"Analysis of Static Systems, an In Vitro Example","text":"table contains snapshot relevant columns dataset: C_A0 C_B0 Effect treat samp_time 0.001 0.1 102.15401 A_0_001_B_0_1 1 0.001 0.1 100.78589 A_0_001_B_0_1 1 0.001 0.1 91.14621 A_0_001_B_0_1 1 0.001 100 93.38012 A_0_001_B_100 1 0.001 100 91.03467 A_0_001_B_100 1 0.001 100 86.20118 A_0_001_B_100 1 0.001 500 51.76744 A_0_001_B_500 1 0.001 500 48.95016 A_0_001_B_500 1 0.001 500 52.68611 A_0_001_B_500 1 0.001 1000 28.46122 A_0_001_B_1000 1 C_A0 C_B0 columns correspond concentrations elicit Effect. treat column unique name combination two drug concentrations. letters numbers underscores. intentional can use cohort name ’m constructing estimation script . samp_time column set 1. arbitrary mapping cohort definitions requires time column. ’ll see arbitrary .","code":""},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"the-analysis-script-analysis_in_vitro-r","dir":"Articles","previous_headings":"","what":"The analysis script: analysis_in_vitro.R","title":"Analysis of Static Systems, an In Vitro Example","text":"analysis scripts aspects unique vitro analysis performed.","code":""},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"output-times","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Output times","title":"Analysis of Static Systems, an In Vitro Example","text":"First output times. run simulations (happens performing parameter estimation) output times results slower simulations. important include ncesssary output times. case two output times (0 1): final value 1 chosen corresponds time column (samp_time) analysis dataset.","code":"cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,1,1))"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"making-a-dynamic-simulation-static","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Making a dynamic simulation static:","title":"Analysis of Static Systems, an In Vitro Example","text":"Next set simulation option dynamic FALSE: fix values differential equations 0 purposes subsequent simulations. available ubiquity version \\ge 2.04.","code":"cfg=system_set_option(cfg, group = \"simulation\", option = \"dynamic\", value = FALSE)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"datasets","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Datasets","title":"Analysis of Static Systems, an In Vitro Example","text":"dataset reading dataframe loading way. done dataset used internally ubiqiuty also construct analysis :","code":"er_data = readr::read_csv(\"in_vitro_er_data.csv\") cfg = system_load_data(cfg, dsname = \"er_data\", data_file = er_data)"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"defining-cohorts","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Defining cohorts","title":"Analysis of Static Systems, an In Vitro Example","text":"estimation tutorial cohorts defined individually. rather tedious. See need cohort every unique combination C_A0 C_B0 dataset. going loop unique value treat column create cohort. variable tmp_treat contains value current treatment first thing get records current treatment: subset data used define initial condition parameters current cohort using cp field (see help system_define_cohort() information option). way treat column constructed can use cohort name. allow us link simulated output original dataset post processing section . inputs set NULL change dosing. set simulation option dynamic FALSE, initial condition set values current treatment, inputs, system effectively behaving like vitro system.","code":"treat_recs = dplyr::filter(er_data, treat == tmp_treat) cohort = list( name = tmp_treat, cf = list( treat = c(tmp_treat)), cp = list( C_A0 = treat_recs$C_A0[1], C_B0 = treat_recs$C_B0[1]), inputs = NULL, outputs = NULL, dataset = \"er_data\")"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"postprocessing","dir":"Articles","previous_headings":"The analysis script: analysis_in_vitro.R","what":"Postprocessing","title":"Analysis of Static Systems, an In Vitro Example","text":"rely normal figure generation reporting elements. example can take simulated output estimation erp original data dataset er_data create meaningful diagnostic plots. can link two datasets using treat column original dataset COHORT column erp$pred:","code":"df_orig = er_data |> dplyr::select(C_A0, C_B0, ave_eff, treat) |> dplyr::distinct() df_est = erp$pred |> dplyr::filter(!SMOOTH) |> dplyr::rename(treat = COHORT) df_plot = dplyr::full_join(df_est, df_orig, by=\"treat\") |> dplyr::mutate(C_B0 = as.factor(C_B0)) library(ggplot2) p = ggplot(data=df_plot) + geom_point(aes(x=C_A0, y=OBS, group=C_B0, color=C_B0)) + geom_line(aes(x=C_A0, y=PRED, group=C_B0, color=C_B0)) + scale_x_log10()"},{"path":"https://r.ubiquity.tools/articles/In_Vitro.html","id":"contents-of-system-in_vitro-txt","dir":"Articles","previous_headings":"","what":"Contents of system-in_vitro.txt","title":"Analysis of Static Systems, an In Vitro Example","text":"","code":"# Author: John Harrold # # Analysis of an in vitro system. The system below was taken from: # # Chakraborty A, Jusko WJ. Pharmacodynamic interaction of recombinant human # interleukin-10 and prednisolone using in vitro whole blood lymphocyte # proliferation. J Pharm Sci. 2002 May;91(5):1334-42. doi: 10.1002/jps.3000. # PMID: 11977109. # # #-------------# # | Parameters | # #-------------# # # System parameters # name value lower upper units editable grouping # bound bound

IC50_A 1.0 eps Inf ----- yes Efficacy

IC50_B 50.0 eps Inf ----- yes Efficacy

Imax_A 1.0 eps Inf ----- yes Efficacy

Imax_B 1.0 eps Inf ----- yes Efficacy

PSI 10.0 eps Inf ----- yes Efficacy

G_A 0.6 eps Inf ----- yes Efficacy

G_B 1.4 eps Inf ----- yes Efficacy

Vp_A 1.0 eps Inf ml yes PK

CL_A 1.0 eps Inf ml/hr yes PK

Vp_B 1.0 eps Inf ml yes PK

CL_B 1.0 eps Inf ml/hr yes PK

C_A0 0.0 eps Inf ----- yes IC

C_B0 0.0 eps Inf ----- yes IC # #-------------------# # |Input Information | # #-------------------# # # Bolus Events # ------------ # times/events state values scale units ; [ 0 ]; 1.0; hours ; Cp_A; [1.0 ]; 1.0/Vp_A; mg ; Cp_B; [1.0 ]; 1.0/Vp_B; mg # By default these values are zero but can be overwritten when # doing analysis of in vitro data. Cp_A = C_A0 Cp_B = C_B0 XI = IC50_A/IC50_B COMP_A = SIMINT_POWER[Cp_A][G_A]/(SIMINT_POWER[PSI*IC50_A][G_A]) COMP_B = SIMINT_POWER[XI*Cp_B][G_B]/(SIMINT_POWER[PSI*IC50_A][G_B]) COMP_Imax = Imax_A + Imax_B - Imax_A*Imax_B EFF_num = Imax_A*COMP_A + Imax_B*COMP_B + COMP_Imax*COMP_A*COMP_B EFF_den = COMP_A + COMP_B + COMP_A*COMP_B + 1.0 EFF = 100.0*(1.0-EFF_num/EFF_den) # #-----------------------------# # | ODEs, and State Information | # #-----------------------------# CL_A/Vp_A*Cp_A CL_B/Vp_B*Cp_B # #---------# # | Outputs | # #---------# Cp_A_mg_ml = Cp_A Cp_B_mg_ml = Cp_B Effect = EFF # prop_err 1.0 eps Inf ----- yes IC # prop=prop_err # #---------# # | Options # # #---------# # specify different time scales 1.0"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Modeling Language","text":"core, ubiquity modeling language set scripts meant facilitate model development deployment. focus document model description language. plain text file, referred system file. line contains descriptor (e.g. 

) defines aspect model, comments made hash sign (#). follows overview different components language can used create system file.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"system-parameters-p","dir":"Articles","previous_headings":"Parameters","what":"System parameters

","title":"Modeling Language","text":"system parameter specified name, value, lower bound, upper bound, units, whether editable ShinyApp ‘type’ parameter (grouping ShinyApp). values eps (machine precision, smallest value zero) inf (infinity) can used. example specify parameter koffR value .1 positive parameter KDR value .04 also positive following used:","code":"# name value lb ub units editable type

koffR 0.1 eps inf 1/hr yes Target

KDR 0.04 eps inf nM yes Target"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"parameter-sets","dir":"Articles","previous_headings":"Parameters","what":"Parameter sets","title":"Modeling Language","text":"Often model developed incorporate different situations scenarios. example, model may used describe healthy diseased individuals. differences simply parametric nature, can cumbersome code model multiple times (parameterization). framework provides mechanism including multiple parameterizations withing system file. Consider system want describe antibody disposition. humans described two compartment model, mice single compartment needed. First create set parameters describing human scenario. mean parameters taken literature [DM]: parameter created using

descriptor part default parameter set. short name1 parameter set. longer verbose name can given well, seen ShinyApp. human parameter set can labeled using PSET descriptor following way: default parameter set short name name, “mAb Human” value shown user ShinyApp. Next, add parameterization mice simply create new set following way: alone create new parameter set short name mouse, exact copy default parameter set. identify parametric differences mouse human use PSET following way: Consider clearance parameter entry want murine half-life antibody [VR]: use set name (mouse) parameter name (CL) overwrite default specified value 7.71e-6. aspects parameter (bounds, edit flag, etc.) default value.","code":"

Weight 70.0 eps inf kg yes System # Organism weight

CL 0.0129 eps inf L/hr yes System # Systemic Clearance

Q 0.0329 eps inf L/hr yes System # Inter-compartmental clearance

Vp 3.1 eps inf L yes System # Vol. central compartment

Vt 2.8 eps inf L yes System # Vol. peripheral compartment mAb in Human mAb in Mouse 0.020 # 20 gram mouse 7.71e-6 0.0 1.6e-3 1 # arbitrary 7.71e-6"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"secondary-parameters-as-and-ad","dir":"Articles","previous_headings":"Parameters","what":"Secondary parameters and ","title":"Modeling Language","text":"static secondary parameter refers parameter change simulation. specified using <> descriptor can written terms system parameters previously defined static secondary parameters. can used differential equations, defining initial conditions, input scaling model outputs. similar secondary parameters defined $PK block NONMEM. example, wanted define rate elimination terms system parameters clearance CL volume distribution Vp following used: dynamic secondary parameters refers parameter can change simulation. typically means defined, using descriptor, terms state another dynamic secondary parameter. can used differential equations model outputs. similar parameters defined $DES block NONMEM. example wanted use concentration central compartment Cp dependent amount compartment Ap volume compartment Vp following used:","code":" kel = CL/Vp Cp = Ap/Vp"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"variance-parameters-vp","dir":"Articles","previous_headings":"Parameters","what":"Variance parameters ","title":"Modeling Language","text":"Variance parameters specified using format system parameters (

) : difference descriptor used grouping set Variance. used performing parameter estimation simulating residual variability.","code":"# name value lower_bound upper_bound units editable grouping SLOPE 0.01 eps inf 1/hr yes Variance"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"parameter-estimation-information-est","dir":"Articles","previous_headings":"Parameters","what":"Parameter estimation information ?","title":"Modeling Language","text":"Currently applies nlmixr2/rxode . Essentially parameters listed fixed. descriptor specifies information parameters estimation. Sometimes necessary estimate parameters log space. can specify parmaeters log transform (LT). wanted log transform parameters P1, P2, P3 following: NOTE Monolix outputs work correctly need logtransform parameters log-normal IIV assigned. default parameters specified estimation. want estimate subset parameters (P), say P1 P2, can use following:","code":" P1; P2; P3 P1; P2"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"variability-defining-the-variancecovariance-matrix-iiv-iivcor","dir":"Articles","previous_headings":"Parameters","what":"Variability: defining the variance/covariance Matrix ? & ?","title":"Modeling Language","text":"variable name assigned inter-individual variability (IIV) correlation/covariance (IIVCOR) term makes sense user may used. following sample codes variable names (eg: ETACL) likely make sense population modeler NONMEM user. define IIV term named ETACL variance 0.15 use following: next need associate IIV term system parameter. associate IIV term clearance (system parameter CL) specify log normal distribution (LN) simply write: Alternatively normal (N) distribution can used. Next specify IIV term ETAV variance 0.1. IIV term also log normal distribution applied parameter V: Now can define covariance (-diagonal elements) CL V 0.01 using: order isn’t important IIV terms can reversed","code":" 0.15 CL 0.10 V 0.01"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"iiv-and-parameter-sets-iivset-iivcorset","dir":"Articles","previous_headings":"Parameters","what":"IIV and parameter sets ? & ?","title":"Modeling Language","text":"default parameter sets inter individual variability specified using descriptors. associate specific set IIVs parameter set use descriptors. set descriptors operate differently parameter set descriptors (). just overwrites default values inherits default variance/covariance information. alter IIV information parameter set reset IIV information parameter set. entire variance covariance matrix need specified parameter set. parameter set MYPSET defined following used define IIV parameters Q CL: system parameters IIV information parameter set.","code":" 0.05 Q 0.25 CL 0.01"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"differential-equations","dir":"Articles","previous_headings":"","what":"Differential equations","title":"Modeling Language","text":"differential equations system can defined simply writing . Alternative can ‘built’ using different descriptors provided . Part flexibility ubiquity lies ability combine different notations. construct model (see section : Bringing together) combination five following methods can used: Differential equations Reaction rates =?=> Equilibrium relationships <=kforward:kreverse=> Sources sinks Movement compartments ","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"writing-odes-ode","dir":"Articles","previous_headings":"Differential equations","what":"Writing ODEs ","title":"Modeling Language","text":"Portions differential equations can specified ? state compartment. define dA/dT koffR*C - konR**B write: might convenient specify ODE across several lines, making things readable. Just use multiple statements appended together. give result example :","code":" koffR*C - konR*A*B koffR*C - konR*A*B"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"rate-equations","dir":"Articles","previous_headings":"Differential equations","what":"Rate equations =?=>","title":"Modeling Language","text":"may convenient write chemical reactions rather differential equations. can done using general form: stoichiometric coefficients, beginning CR CP , brackets need specified one. reaction order assumed equal stoichiometric coefficient reactant. specific example Consider decomposition hydrogen peroxide water oxygen: H_2O_2 \\xrightarrow{k_{deg}} H_2O + \\frac{1}{2}O_2 system format written following manner: translated following differential equations: \\frac{dH_2O_2}{dt}=-k_{deg}H_2O_2 \\\\ \\frac{dH_2O}{dt}= k_{deg}H_2O_2 \\\\ \\frac{dO_2}{dt}= 0.5k_{deg}H_2O_2 also defined differential equations using ?. equivalent: rates (e.g. kdeg) need defined either system secondary parameter. can put saturable terms, Michaelis-Menten kinetics.","code":"[CR1]Reactant1 + [CR2]Reactant2 + ... =kf=> [CP1]Product1 + [CP2]Product2 + ... H2O2 =kdeg=> H2O + [0.5]O2 - kdeg*H2O2 kdeg*H2O2 0.5*kdeg*H2O2"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"equilibrium-relationships-kforwardkreverse","dir":"Articles","previous_headings":"Differential equations","what":"Equilibrium relationships <=kforward:kreverse=>","title":"Modeling Language","text":"Forward reverse reaction rates can written separately: can written equilibrium equations forward (konR) reverse (koffR) rates specified : specify reaction differential equations, following also used: stoichiometric coefficients also define reaction order . example, create following equilibrium reaction: 2A + 3B \\mathop{\\rightleftarrows}^{\\mathrm{k_f}}_{\\mathrm{k_r}} 4C rate notation used system file: produce following terms differential equations: \\frac{dA}{dt} = 2k_rC^4 - 2k_fA^2B^3 \\\\ \\frac{dB}{dt} = 3k_rC^4 - 3k_fA^2B^3 \\\\ \\frac{dC}{dt} =-4k_rC^4 + 4k_fA^2B^3 write equilibrium reaction differential equations following used: See generic functions SIMINT_POWER[][].","code":"A + B =konR=> C C =koffR=> A + B A + B <=konR:koffR=> C koffR*C - konR*A*B koffR*C - konR*A*B -koffR*C + konR*A*B [2]A + [3]B <=kf:kr=> [4]C = 2*kr*SIMINT_POWER[C][4] - 2*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3] = 3*kr*SIMINT_POWER[C][4] - 3*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3] = -4*kr*SIMINT_POWER[C][4] + 4*kf*SIMINT_POWER[A][2]*SIMINT_POWER[B][3]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"sources-and-sinks-s","dir":"Articles","previous_headings":"Differential equations","what":"Sources and sinks ","title":"Modeling Language","text":"method allows turnover described terms synthesis degradation terms. produced rate ksynA (mass quantities), degraded rate kdegA, modeled concentration units sources specified left hand side sinks (elimination) specified left hand side . Multiple sources sinks can separated semicolons. example compartment volume V writing differential equation:","code":"ksynA/V kdeg*A koffR*C - konR*A*B + ksynA/V - kdeg*A"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"movement-between-compartments-c","dir":"Articles","previous_headings":"Differential equations","what":"Movement between compartments ","title":"Modeling Language","text":"mass moves two physical spaces different volumes need specify, compartment, species, volume rate transport. descriptor allows us just identify compartment information separated semicolons (order important) movement central compartment volume V tissue space volume Vt rates kps ksp respectively specified following manner: equivalent following differential equation:","code":"Species; Volume; Rate Species; Volume; Rate A; V; kps At; Vt; ksp -kps*A + ksp*At*Vt/V +kps*A*V/Vt - ksp*At"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"bringing-it-all-together","dir":"Articles","previous_headings":"","what":"Bringing it all together","title":"Modeling Language","text":"final example consider target-mediated drug disposition system . system can defined set ODES: simply defined terms underlying processes:","code":" Cp*kpt*Vp/Vt - Ct*ktp -Cp*kpt + Ct*ktp*Vt/Vp - kel*Cp + koff*CpTp - kon*Cp*Tp + ksyn/Vp - kint*Tp + koff*CpTp - kon*Cp*Tp - kint*CpTp - koff*CpTp + kon*Cp*Tp # tissue distribution Ct; Vt; ktp Cp; Vp; kpt # equilibrium Cp + Tp <=kon:koff=> CpTp # Turnover ksyn/Vp kint*Tp kel*Cp kint*CpTp"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"initial-conditions-i","dir":"Articles","previous_headings":"Bringing it all together","what":"Initial conditions ","title":"Modeling Language","text":"default initial conditions zero. can specify non-zero initial condition using <> string set ‘state’ ‘value’ Value can combination numbers, system parameters

static secondary parameters <. Consider turnover system value ksyn kdeg specified parameters: can calculate initial value target : can specify initial value target :","code":" state = value

ksyn 0.1 eps inf 1/hr yes Target

kdeg 0.04 eps inf nM yes Target T_IC = ksyn/kdeg T = T_IC"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"model-inputs","dir":"Articles","previous_headings":"","what":"Model inputs","title":"Modeling Language","text":"Inputs model include typical interventions bolus dosing continuous infusions. However inputs refers mathematical inputs. Typically covariates may attributes system (gender, specific genotype), treated inputs. defining inputs necessary provide typical/placeholder values. provide default values ShinyApp interface well scripting level (Matlab R) can overwritten user.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"bolus-dosing-btimes-bevents","dir":"Articles","previous_headings":"Model inputs","what":"Bolus dosing , ","title":"Modeling Language","text":" descriptor used define bolus dosing. Dosing information broken list times bolus injections occur list events containing amount specified compartment receive. scale used convert bolus dosing information proscribed units (mg daily) units system coded (mg/mL hours). dosing done days 0, 1, 2… simulation time hours, scale dosing times 24.events contain magnitude bolus given time. want dose central compartment Cp mg/kg central compartment mg/mL need scale body weight (e.g. 70 kg) volume central compartment (system static secondary parameter Vp) scale 70/Vp. just want create palceholder can following: want setup default dosing shiny app scripts, can somethign complicated. multiple compartments receiving bolus, times must include times bolus may applied system. state receive bolus particular time, magnitude time 0. illustrate consider following dosing schedule: example want dose two different drugs two different states/compartments. Drug 1 (D1) dosed Cp1 drug 2 (D2) Cp2. Dosing mg/kg concentrations mg/ml. dosing time days, simulation time units hours. dosing D1 8 & 2 mpk days 0 & 6. D2 dosed 5 mpk day 9. Assume V1 V2 compartmental volumes D1 D2 ml, subject body weight 70 kg. convert doses mpk mg/ml. default doses can overwritten ShinyApp within scripts.","code":"# type state values scale units ; [0]; 24; days ; Cp; [0]; 70/Vc; mpk # type state values scale units ; [0 6 9]; 24; days ; Cp1; [8 2 0]; 70/V1; mpk ; Cp2; [0 0 5]; 70/V2; mpk"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"continuous-infusions-r","dir":"Articles","previous_headings":"Model inputs","what":"Continuous infusions ","title":"Modeling Language","text":"Rates infusion defined using descriptor. Like bolus values, infusion rates two components. component specifies switching times (e.g. switching 10 mg/hr 0). switching time corresponding rate infusion. infusion rate held constant next time. Also like bolus specification scale associated infusion times levels converts proscriptive units units simulation. Consider following example: two entries create infusion rate called myrate. can used system specifications (e.g., myrate/Vp). first row specifies times rate changed (0 30 minutes). system coded terms hours, scale 1/60 must used. levels indicate rate 1 mg/min switched 30 minutes. converted mg/hr using scale 60. can add many paired rate entries need describe many infusion interventions necessary. Note: just want placeholder can just set values [0].","code":"# name time/levels values scale units ; times; [0 30]; 1/60; min ; levels; [1 0]; 60; mg/min"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"simple-covariates","dir":"Articles","previous_headings":"Model inputs","what":"Simple covariates","title":"Modeling Language","text":"simulation purposes covariates (normally found dataset) need defined. Covariates can either constant change time. times values must scale system. following defines value covariate RACE: Covariates can also change time. case consider subject weight (WGT). begins 70 measurements made several time points. Next can alter simulations interpret values setting type covariate. default weight linearly interpolated (type = linear), however can hold weight constant next measurement encountered (last value carried forward) declaring type step Now model parameterized male female subjects can define two parameter sets (described ) account : values covariate can changed set ‘female’:","code":"; times; [0]; hours ; values; [1]; ethnicity ; times; [ 0 1680 3360 5040 10080]; hours ; values; [70 65 60 58 56]; kg step Male Female ; times; [ 0 1680 3360 10080] ; values; [60 55 52 50]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"complicated-covariates","dir":"Articles","previous_headings":"Model inputs","what":"Complicated covariates","title":"Modeling Language","text":"Detailed time course profiles can created well. example, create covariate profile zero time 0-1 time 1 jumps 8 decreases rate 1 per unit time time 5 stays value 4 time 12. might profile like following:","code":"# name time/values values units ; times; [0 .999 1 5 12]; hours ; values; [0 0 8 4 4 ]; -- linear"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"model-outputs","dir":"Articles","previous_headings":"","what":"Model outputs","title":"Modeling Language","text":"Outputs defined terms states, parameters, secondary parameters, input rates, covariates listed . format used : example: Outputs begin QC, like QC_CLtot , displayed ShinyApp. intended make available scripting level quality control (QC) purposes.","code":" name = expression A_obs = A Coverage = A/(KD + A) QC_CLtot = Cp*CL/Vp + Cp*Vmax/(Km+Cp)"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"output-error-model-oe","dir":"Articles","previous_headings":"Model outputs","what":"Output error model ?","title":"Modeling Language","text":"links parameters defined using specific outputs defined using . can define either add additive /prop proportional error: OUTPUT can name output defined . expression model type (add additive, prop proportional) equal sign name variance paramter () use. use one error model type separate statments ; example define variance parameters add_err prop_err want use proportional error model output Cp use: use additive proportional error following work: certain target-specific considerations. example using Matlab R just wanted weighted least squares estimation proportional prediction squared use following fix prop_err 1. least squares estimation following fix add_err 1. represent default values though ’s possible overwrite . Matlab R workflows define variance cohort level, error models system file overwritten. ## Functions operators standard operators behave expected (+, -, *, & /) languages use consistently. however certain operators functions differ languages. example, consider power function (^b). FORTRAN **b, Matlab ^b, C pow(,b). Given objectives (write create multiple formats), can quite challenging. solution used convert language specific functions operators generic functions. power operator : converted appropriate output format depending output target. following generic functions can used:","code":"` expression` prop=prop_err add=add_err; prop=prop_err prop=prop_err add=add_err SIMINT_POWER[a][b]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"current-simulation-time","dir":"Articles","previous_headings":"Model outputs","what":"Current simulation time","title":"Modeling Language","text":"systems want access simulation time. can use internal variable SIMINT_TIME.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"modeling-quasi-equilibrium-of-target-mediated-drugs","dir":"Articles","previous_headings":"Model outputs","what":"Modeling quasi-equilibrium of target-mediated drugs","title":"Modeling Language","text":"free amount drug Cfree binding receptor affinity KD given total values Ctot Rtot following can calculated using following equation: C_{free}=\\frac{1}{2} \\left[ (C_{tot}-R_{tot}-K_D) + \\sqrt{(C_{tot}-R_{tot}-K_D)^2 + 4K_DC_{tot}} \\right] can tedious, especially using generic functions . make easier can use following generic function: get Rfree, just switch first two arguments:","code":" Cfree = SIMINT_QEQ[Ctot][Rtot][KD] Rfree = SIMINT_QEQ[Rtot][Ctot][KD]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"timescales","dir":"Articles","previous_headings":"","what":"Timescales","title":"Modeling Language","text":"system default units constructed, indicated comments model. can useful (generating figures example) show simulations different time scales. Now can achieved multiplying time outputs correct scaling factor. However requires end user (1) remember original timescale (2) correctly scale value. Now particularly challenging mathematical perspective, introduces chance error. possible, instead, specify time scale information using descriptor. system coded hours, following define timescales default (hours), days, weeks months: used ShinyApp command line Matlab R","code":" 1.0 1.0/24.0 1.0/24.0/7.0 1.0/24.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"mathematical-sets","dir":"Articles","previous_headings":"","what":"Mathematical sets","title":"Modeling Language","text":"Consider following systems: PBPK: organs systems mathematically identical, variations parameters. However coding organs modifying existing system (say incorporate presences target organ) can become tedious. Anti-drug antibody generation: consider ADAs generated response therapeutic proteins, response consist distribution ADAs terms concentration separate distribution terms affinity. Modeling maturation process interactions ADAs, therapeutic protein, drug targets becomes unmanageable quickly. question : can make difficult problems easy intractable problems possible? solution implemented allows system defined terms mathematical sets","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-notation-set","dir":"Articles","previous_headings":"Mathematical sets","what":"Set notation ?","title":"Modeling Language","text":"Consider interactions occurring assay designed detect drug (D) present serum. assay biotinylated target (TB) used pull drug labeled target (TL) signaling molecule used. assay provide signal complex containing TB TL present (TB:D:TL TL:D:TB). Samples can contain soluble target well (TS) can interfere assay. model assay, following interactions considered: Several options available construct system. ODEs simply typed every possible combination. ’s also possible use equilibrium <=kon:koff=> interactions well. However, another option handle enumeration easily. First define two mathematical sets TSi TSk: defined can use curly brace notation ({ }) descriptors used construct system. example, initial conditions target states defined parameters (T0_TL, T0_TS, T0_TB) model. identified initial conditions using <> notation, can done single statement. line: Expands : Similar initial condition, equilibrium monomeric drug different targets can defined using single statement: uses one sets (TSi) expanded element set. account formation complexes contain drug molecule two different target molecules, following statement used: statement contains two different sets (TSi TSk). multiple sets encountered, every possible combination evaluated","code":" TL; TB; TS TL; TB; TS {TSi} = T0_{TSi} TL = T0_TL TB = T0_TB TS = T0_TS D + {TSi} <=kon:koff=> D_{TSi} D_{TSi} + {TSk} <=kon:koff=> {TSk}_D_{TSi}"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"aligning-sets","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Aligning Sets","title":"Modeling Language","text":"default sets interpreted evaluating every possible permutation shown . However, may desirable pair align sets. Take example transit compartments implemented Lobo Balthasar delay onset drug effect cancer cells [LB]. transit compartment implemented using series differential equations: \\frac{dK1}{dt} = (K-K1)\\frac{1}{\\tau} \\\\ \\frac{dK2}{dt} = (K1-K2)\\frac{1}{\\tau} \\\\ \\frac{dK3}{dt} = (K2-K3)\\frac{1}{\\tau} \\\\ \\frac{dK4}{dt} = (K3-K4)\\frac{1}{\\tau} ’s possible code individually, ’s also possible define using mathematical set notation. see first equation K paired aligned K1, second ’s K1 K2, etc. first define two sets equal length whose elements aligned: Next write ? statement terms sets, use SIMINT_SET_ALIGN function: first argument names sets align separated semicolon ; second argument system file descriptor written terms sets. expanded internally :","code":" K; K1; K2; K3 K1; K2; K3; K4 SIMINT_SET_ALIGN[TRIN;TROUT][ 1.0/tau*({TRIN}-{TROUT})] 1.0/tau*(K-K1) 1.0/tau*(K1-K2) 1.0/tau*(K2-K3) 1.0/tau*(K3-K4)"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-functions","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Set Functions","title":"Modeling Language","text":"can useful perform operations sets. can use following functions: SIMINT_SET_SUM mathematical equivalent \\sum_{SET} SIMINT_SET_PRODUCT mathematical equivalent \\prod_{SET} functions take two bracketed arguments. first argument set name second argument mathematical relationship expanded. example, consider system parameterized several species. variable EN_Mouse 1 species mouse 0 otherwise. Similarly EN_Human, EN_Monkey, etc. also defined body weights system parameters: BW_Mouse mouse, BW_Human human, etc. Now want assign BW value currently selected species (EN species 1). First define species parameter set: Next define secondary parameter BW summing product Boolean species parameter body weight species:","code":" Mouse; Rat; Monkey; Human BW = SIMINT_SET_SUM[SP][EN_{SP}*BW_{SP}]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"set-evaluation","dir":"Articles","previous_headings":"Mathematical sets > Set notation ?","what":"Set Evaluation","title":"Modeling Language","text":"Sets evaluated following order: First set functions (SIMINT_SET_SUM SIMINT_SET_PRODUCT) evaluated. Next aligned sets applied (SIMINT_SET_ALIGN) Lastly, remaining sets evaluated every permutation","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"piecewise-continuous-functionsparameters-if","dir":"Articles","previous_headings":"","what":"Piecewise-continuous functions/parameters ","title":"Modeling Language","text":"specify conditional assignment use statement: name name secondary parameter defined COND indicates Boolean condition needs satisfied. condition (boolean) can , , greater , etc. relationships. parameter assigned value Boolean relationship true. conditions can function different elements system depending whether name refers static dynamic secondary parameter: <> function system parameters, previously defined static secondary parameters covariates change given subject. function system parameters, static secondary parameters, states, previously defined dynamic secondary parameters covariates. important include default ELSE condition:","code":" boolean; value value"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"constructing-a-piece-wise-continuous-functionparameter","dir":"Articles","previous_headings":"Piecewise-continuous functions/parameters ","what":"Constructing a piece-wise continuous function/parameter","title":"Modeling Language","text":"see example use following command (use ?system_new see list available system file examples): system_new(system_file=\"pwc\", file_name=\"system-pwc.txt\") example specify fast (kelf) slow (kels) rates elimination. want fast rate active drug concentration Cth time Tf. system parameters look like: Now need define rate elimination constraints followed. First define kel dynamic secondary parameter value 0.0. define different conditions relevant values:","code":"

kelf 1.0 eps inf 1/time yes System

kels 0.01 eps inf 1/time yes System

Cth 10 eps inf conc yes System

Tf 10 eps inf time yes System kel = 0.0 SIMINT_AND[SIMINT_LT[SIMINT_TIME][Tf]][ SIMINT_GT[Cp][Cth]]; kelf kels"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"controlling-indices","dir":"Articles","previous_headings":"","what":"Controlling indices","title":"Modeling Language","text":"default, build script construct odes, parameter sets, etc. automatically. means order states/compartments going arbitrary. Sometimes necessary specify order states outputs. example using NONMEM order control stream must correlate values dataset. specify state Cp compartment 3, following used: general notation output state name assigned number :","code":" 3 number number"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"concentrations-vs-amounts","dir":"Articles","previous_headings":"","what":"Concentrations vs amounts","title":"Modeling Language","text":"’s convenient model systems terms concentrations. However software allow scaling inputs. inputs provided mass units, need differential equation also mass units. can use descriptor system.txt tell ubiquity generate perform conversion differential equations. example, defined state Cc want Ac within nlmixr2 model target. related Cc = Ac/Vc Vc parameter following used:","code":" Cc; Ac; Vc"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"options","dir":"Articles","previous_headings":"","what":"Options","title":"Modeling Language","text":"Several options can specified using ? can used timescale plotting ShinyApp using: define default output times ShinyApp simulation scripts use following:","code":" days SIMINT_SEQ[0][100][1]"},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"example-system-files","dir":"Articles","previous_headings":"","what":"Example system files","title":"Modeling Language","text":"example system files can found examples directory stand-alone analysis template (ubiquity_template.zip). can also loaded form R package (see help ?system_new). system-adapt.txt - Parent/metabolite structural model taken ADAPT5 Users Manual [ADAPT]. system used estimation examples ubiquity workshop. system-glp_study.txt - PK model parameterized humans NHPs, used example GLP tox study design. system-mab_pk.txt - Linear model mAb PK humans taken [DM]. model used simulation examples ubiquity workshop. system-one_cmt_cl.txt - One compartment model parameterized terms clearances volumes. system-one_cmt_micro.txt - One compartment model parameterized micro constants (rates). system-pbpk.txt - Implementation large molecule PBPK model Shah Betts [SB]. model provides good examples use mathematical set notation. system-pbpk_template.txt - Template containing species parameter [SB]. can used construct systems parameterized multiple species. system-pwc.txt - Example construct piece-wise secondary parameters (.e. using //else statements). system-sets.txt - Example parameterized systems multiple parameter sets. system-tmdd.txt - Example code TMDD model using either ODEs process descriptors. system-tumor.txt - Implementation transit effect model cancer cell inhibition [LB]. demonstrates use aligned mathematical sets. system-two_cmt_cl.txt - Two compartment model parameterized terms clearances volumes system-two_cmt_micro.txt - Two compartment model parameterized terms micro constants (rates)","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"templates","dir":"Articles","previous_headings":"","what":"Templates","title":"Modeling Language","text":"system built, multiple files generated temporary directory (transient) support different software. R package can access templates programatically (see help ?system_fetch_template). list supporting software generated.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"r-workflow","dir":"Articles","previous_headings":"Templates","what":"R workflow","title":"Modeling Language","text":"auto_simulation_driver.R: R-Script named placeholders used run simulations. auto_analysis_estimation.R: R-Script named placeholders used perform naive-pooled parameter estimation.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"matlab-workflow","dir":"Articles","previous_headings":"Templates","what":"Matlab workflow","title":"Modeling Language","text":"auto_simulation_driver.m: M-file named placeholders used run simulations. auto_analysis_estimation.m: M-file named placeholders used perform naive-pooled parameter estimation.","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"other-software-targets","dir":"Articles","previous_headings":"Templates","what":"Other Software Targets","title":"Modeling Language","text":"target_adapt_5.target_adapt_5-PSET.prm: system defined Adapt Fortran parameter (prm) file parameter set PSET. target_berkely_madonna-PSET.txt: text file containing system parameter set PSET run Berkeley Madonna. target_mrgsolve-PSET.cpp: C++ file containing system parameter set PSET run using mrgsolve package R. target_nlmixr-PSET.R: R script defines system analysis nlmixr2 parameter set PSET. Note: nlmixr2 target can used create input model files NONMEM Monolix","code":""},{"path":"https://r.ubiquity.tools/articles/Language.html","id":"references","dir":"Articles","previous_headings":"","what":"References","title":"Modeling Language","text":"[ADAPT] Adapt 5 Users Guide [DM] Dirks & Meibohm Clin. PK (2010) Oct 1;49(10):633-59 [LB] Lobo, E.D. & Balthasar, J.P. AAPS J (2002) 4, 212-222 [MK] Mager, D.E. & Krzyzanski, W. Pharm Res (2005) 22: 1589. [SB] Shah, D.K. & Betts, .M. JPKPD (2012) 39 (1), 67-86 [VR] Vieira & Rajewsky Eur J Immunol. (1988) Feb;18(2):313-6","code":""},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Noncompartmental Analysis","text":"Non-compartmental analysis (NCA) simple quick method evaluating exposure drug. allows evaluate things like linearity vivo exposure. illustrate consider antibody given subcutaneous injection. actual profile patient might experience given solid black line. don’t yet ability sample continuous fashion. might observer given blue points. Generally NCA determine following directly data: Cmax - Maximum observed concentration (units=concentration) Tmax - time maximum concentration observed (units=time) AUC - area curve (units=time \\times concentration) AUMC - area first moment curve (units=time^2 \\times concentration) properties based observational data. Cmax Tmax certainly actual maximum concentration long sample judiciously give us good approximation. Similarly, calculated AUC AUMC different actual values. calculate areas need dig back calculus text books trapezoid method. Basically sampling interval trapezoid area calculated added n samples: AUC = \\int_0^{t_f} Cdt \\approx \\sum_{=1}^{n-1}{\\frac{C_i+C_{+1}}{2}\\times (t_{+1}-t_{})} AUMC = \\int_0^{t_f} t\\times Cdt \\approx \\sum_{=1}^{n-1}{\\frac{t_iC_i+t_{+1}C_{+1}}{2}\\times (t_{+1}-t_{})} can done Excel pretty easily. Depending data analysis properties can calculated. example can calculate clearance, steady-state volume distribution terminal half-life: Clearance: CL = \\frac{Dose}{AUC} Mean residence time: MRT = \\frac{AUMC}{AUC} Steady state volume distribution: V_{ss} = MRT \\times CL Half-life: Terminal slope natural log data Properties like AUC AUMC can also calculated using extrapolation last time point infinity account data beyond observations hand. subsequent values clearance, volumes distribution, etc can also change extrapolation. lot nuance associated calculations, good rely software focuses type analysis. PKNCA package developed mind. Ubiquity provides set functions automate NCA reporting preclinical data. functions act wrapper PKNCA package heavy lifting. small subset PKNCA functionality used . extensive analysis necessary PKNCA can used directly. vignette contains series examples perform NCA ubiquity. make copy scripts supporting files current working directory run following: creates several files working directory. First data sets: pk_all_sd.csv - PK data multiple subjects dosed either IV SC different levels pk_all_md.csv - Multiple dose data intensive sampling first last dose pk_sparse_sd.csv - Single dose data sparse sampling Next following scripts demonstrate perform NCA: analysis_nca_sd.R - Single dose data individuals analysis_nca_md.R - Multiple dose data individuals analysis_nca_sparse.R- Average NCA analyzing sparsely sampled data","code":"library(ubiquity) fr = workshop_fetch(section=\"NCA\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"quick-template-for-running-nca","dir":"Articles","previous_headings":"","what":"Quick Template for Running NCA","title":"Noncompartmental Analysis","text":"read rest vignette understand required data format functions work. returning just want template running NCA can use following: create file analysis_nca.R current working directory. can just uncomment/edit script get started.","code":"library(ubiquity) cfg = build_system() fr = system_fetch_template(cfg, template = \"NCA\")"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"single-dose-data","dir":"Articles","previous_headings":"","what":"Single Dose Data","title":"Noncompartmental Analysis","text":"example follows script analysis_nca_sd.R, uses dataset pk_all_sd.csv.","code":""},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"expected-format-of-data","dir":"Articles","previous_headings":"Single Dose Data","what":"Expected Format of Data","title":"Noncompartmental Analysis","text":"First build system load dataset. NCA functions ubiquity expect data certain format. columns required, optional depend kind analysis performed columns can also present. context consider following dataset: required columns names dataset provided parenthesis : ID - Unique subject identifier (ID) TIME - Time since first dose (TIME_HR) NTIME - Nominal time since last recent dose (since dealing single dose data also TIME_HR) CONC - Observed concentration record (C_ng_ml ng/ml) DOSE - Dose given (DOSE mg) ROUTE - Route administration (ROUTE); can either: iv bolus, iv infusion extra-vascular Optional columns include: DOSENUM - analyzing multiple dose data (example ), column used associate records doses BACKEXTRAP - Back-extrapolation IV data can done generally entire dataset column can used specify number points use individual basis SPARSEGROUP - Grouping sparse sampling data want average data time point","code":"cfg = build_system(system_file=\"system.txt\") cfg = system_load_data(cfg, dsname = \"PKDATA\", data_file = \"pk_all_sd.csv\")"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"nca-and-outputs","dir":"Articles","previous_headings":"Single Dose Data","what":"NCA and Outputs","title":"Noncompartmental Analysis","text":"Next perform NCA using system_nca_run: link analysis dataset specifying dataset name (dsname) used load dataset. Data can filtered either ’s loaded using optional dsfilter input (used ). dosing dataset mg (.e. 30 mg dose), mass units concentration values ng (.e. ng/ml). dscale input converts mass units dose mass units observed concentration. analysis_name 1 used refer analysis reporting function well files generated analysis. default initial concentration (nominal time zero) back-extrapolated can disabled setting extrap_C0 FALSE. Next map columns dataset names used analysis (dsmap). Note actual time (TIME) nominal time (NTIME) use column dataset (TIME_HR). Lastly, NCA_options can used specify analysis options used PKNCA. example maximum percent AUCinf extrapolation specified 10%. change option remaining defaults PKCNA used. Either omit argument set NULL use PKNCA defaults. Running function produce following files: output/pk_single_dose-nca_summary-pknca.csv Summary level output analysis (see table ) output/pk_single_dose-nca_data.RData R objects used downstream reporting output/pk_single_dose-pknca_raw.csv Raw output PKNCA may useful carry forward values certain columns PK dataset output. can use dsinc argument provide list columns input dataset appended summary table. can access summary table using function system_fetch_nca analysis_name: get explanation columns NCA output can use system_fetch_nca_columns function passing NCA analysis name function. list output contains data frame NCA_col_summary outputs description meaning:","code":"cfg = system_nca_run(cfg, dsname = \"PKDATA\", dscale = 1e6, analysis_name = \"pk_single_dose\", extrap_C0 = FALSE, dsmap = list(TIME = \"TIME_HR\", NTIME = \"TIME_HR\", CONC = \"C_ng_ml\", DOSE = \"DOSE\", ROUTE = \"ROUTE\", ID = \"ID\"), NCA_options = list(max.aucinf.pext = 10) ) NCA_results = system_fetch_nca(cfg, analysis_name = \"pk_single_dose\") nca_cols = system_fetch_nca_columns(cfg, \"pk_single_dose\") rhandsontable(nca_cols[[\"NCA_col_summary\"]], width=\"100%\", height=200)"},{"path":[]},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"powerpoint","dir":"Articles","previous_headings":"Single Dose Data > Automated Reporting","what":"PowerPoint","title":"Noncompartmental Analysis","text":"NCA run, results can appended open PowerPoint report. initialize empty report use function system_rpt_nca() analysis name assigned analysis (pk_single_dose) attach results. can write file: dose summary slide produced full timecourse created showing data subject/group dataset: Actual data gray Data used NCA green Initial extrapolated concentrations orange (solid) Points used extrapolating “iv bolus” data shown orange open circles shows slides generated individual subject first set summary slides analysis. Notice extrap_C0 set FALSE C0 calculated (-1). individual received SC dose estimate Vp also calculated (-1). Also note data individual allow extrapolation AUC infinity (NA). result parameters depend value also resulted (NA). timecourse figure shows data dataset (gray closed symbols, solid line) data used NCA (green open symbols, dashed line). way can visually confirm subject level data used.","code":"cfg = system_rpt_read_template(cfg, template=\"PowerPoint\") cfg = system_rpt_add_slide(cfg, template = \"title_slide\", elements = list( title= list(content = \"NCA Single Dose PK\", type = \"text\"))) cfg = system_rpt_nca(cfg=cfg, analysis_name=\"pk_single_dose\") system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",\"pk_single_dose-report.pptx\"))"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"word","dir":"Articles","previous_headings":"Single Dose Data > Automated Reporting","what":"Word","title":"Noncompartmental Analysis","text":"Similarly, Word report can generated appending results already initialized Word report. done setting template \"Word\" calling system_rpt_read_template(). attach content report PowerPoint report . information integrated report generation see Reporting vignette.","code":"cfg = system_rpt_read_template(cfg, template=\"Word\") cfg = system_rpt_nca(cfg=cfg, analysis_name=\"pk_single_dose\") system_rpt_save_report(cfg=cfg, output_file=file.path(\"output\",\"pk_single_dose-report.docx\"))"},{"path":"https://r.ubiquity.tools/articles/NCA.html","id":"summarizing-data","dir":"Articles","previous_headings":"Single Dose Data","what":"Summarizing Data","title":"Noncompartmental Analysis","text":"automated reporting intended generate results quickly easily digestible way (Word PowerPoint). may decided need control presented. function system_fetch_nca() mentioned give access NCA output. want filter, select columns summarize results function system_nca_summary() can used. first argument (analysis_name) indicates NCA analysis want summarize. parameters summarized order table specified params_include. default internal headers used, can overwrite alter defaults optional params_header input. cmax overwritten internally predefined label (\"

F1 0.744 eps inf --- yes System

ka 0.282 eps inf 1/day yes System

CL 0.200 eps inf L/day yes System

Vc 3.61 eps inf L yes System

Vp 2.75 eps inf L yes System

Q 0.747 eps inf L/day yes System

MW 140 eps inf kD yes System mAb in Humans # Interindividual Variability # Taken from Table 3 0.416 ka 0.09875 CL 0.116 Vc 0.0789 Vp 0.699 Q 0.0786 0.0619 0.0377 # Covariates ; times; [ 0 ]; day ; values; [400]; mg step ; times; [ 0 ]; day ; values; [ 60]; kg step # static secondary parameters kel = CL/Vc kcp = Q/Vc kpc = Q/Vp # #-------------------# # |Input Information | # #-------------------# # # 1e6 ng 1 nmole 1 # X mg x ------ x ----------------- x --- => X*1e3/MW/Vc # 1 mg MW (KDA) * 1000 V(L) # # Bolus Events # times/events state values scale units ; [ 0.0, 7, 14 ]; 1; days ; At; [400.0, 0, 0 ]; 1e3/MW; mg ; Cc; [ 0.0, 0, 0 ]; 1e3/MW/Vc; mg ; times; [0, 30]; 1/60/24; min ; levels; [0, 0]; 60*24*1e3/MW; mg/min # ODEs -ka*At ka*At*F1/Vc -kel*Cc - kcp*Cc + kpc*Cp*Vp/Vc + Dinf/Vc kcp*Cc*Vc/Vp - kpc*Cp # #---------# # | Outputs | # #---------# # Outputs that begin with QC will not be displayed in the GUI # Convert nM to ng/ml # # X nM ===> X*MW(KDA) # # Convert nM to ug/ml/mg(dose) # # X nM ===> X*MW(KDA)/1000/dose # C_ng_ml = Cc*MW C_DOSE = Cc*MW/DOSE/1000 prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance Vp; Vc; CL; Q; ka Vp; Vc; CL; Q; ka; add_err; prop_err add=add_err; prop=prop_err Cp; Ap; Vp # #---------# # | Options # # #---------# # General Options: # specify different time scales 24.0*60.0 1.0 24.0 1.0/7.0 1.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Titration/Rule-Based Simulations","text":"Simulation vignette several examples provided using fixed dosing regimens. works well compounds relatively safe, PK consistent time, drug concentrations required achieve efficacy consistent. fact restrictions apply many different compounds. However, many scenarios necessary adjust dosing based periodic clinical visits: compounds narrow therapeutic index, disease progression alters drug PK requires increases dose amount, etc. possible manually current simulation tools provided, section outlines generalized framework make easier users. workshop provides several examples running titration rule-based simulations. make copy scripts supporting files current working directory run following: provide following scripts: analysis_repeat_dosing.r - Implement fixed bolus dosing using titration framework analysis_repeat_infusion.r - Implement fixed infusion rates using titration framework analysis_visit_dosing_titration.r - Alter dosing based predictions specified time points (individual) analysis_visit_dosing_titration_stochastic.r - Alter dosing based predictions specified time points (population) analysis_state_reset.r - Combine multiple rules dose drug perform state reset Titration rule-based simulations run using following functions: system_new_tt_rule() - Defines new rule times evaluated system_set_tt_cond() - Adds condition rule associated action perform condition true run_simulation_titrate() - Runs individual simulation using titration rules","code":"library(ubiquity) fr = workshop_fetch(section=\"Titration\", overwrite=TRUE)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"repeated-bolus-dosing-analysis_repeat_dosing-r","dir":"Articles","previous_headings":"","what":"Repeated Bolus Dosing (analysis_repeat_dosing.r)","title":"Titration/Rule-Based Simulations","text":"example shows implement dosing regimen using fixed-dosing methodologies titration functions . meant means bridge two concepts. First use model Simulation vignette (Davda etal. mAbs, 6(4), 1094-1102), simulate five doses 500 mg IV given every two weeks: use rule-based control simulation enable titration option: Next need define rule using system_new_tt_rule(). rule contains set times (timescale) want evaluate rule. create rule called \"ivdose\" evaluate rule weeks 0, 2, 4, 6 8. timescale defined using system file can used: rule created can attach conditions rule using system_set_tt_cond(). name passed function name rule condition applies. cond argument string evaluated internally. put kind Boolean argument want , even create user definable function returns Boolean argument (eg, 'myfunction(arguments)'). condition evaluates true string action evaluated. string SI_TT_BOLUS prototype function used modify dosing titration points. See help (?system_set_tt_cond) details prototype functions variables available titration environment. action define dosing specified state (defined system file) values times shown. units specified system file times relative titration time point. Next simulate system using titration function: Now can overlay predictions using methods show produce result: output run_simulation_titrate() similar run_simulation_ubiquity() two extra elements list returned: tt.tname.value - Value rule active condition -1 triggered tt.tname.simtime - Simulation time last condition became active tt.tname.timescale - Simulation time time scale rule specified fields tname - Titration rule name value - Value rule active condition simtime - Simulation time last condition became active timescale - Simulation time time scale rule specified ","code":"cfg = build_system() cfg = system_select_set(cfg, \"default\") parameters = system_fetch_parameters(cfg) cfg=system_set_option(cfg,group = \"simulation\", option = \"solver\", value = \"lsoda\") cfg=system_set_option(cfg, group = \"simulation\", option = \"output_times\", seq(0,10*7,1)) cfg = system_zero_inputs(cfg) cfg = system_set_bolus(cfg, state = \"Cc\", times = c(0, 14, 28, 42, 56), values = c(500, 500, 500, 500, 500)) som_fix = run_simulation_ubiquity(parameters, cfg) cfg=system_set_option(cfg, group = \"titration\", option = \"titrate\", value = TRUE) cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"TRUE\", action = \"SI_TT_BOLUS[state='Cc', values=500, times=0]\", value = \"1\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_fix$simout, aes(x=ts.days, y=Cc, color=\"Fixed Dosing\"), linetype=1) + geom_line(data=som_tt$simout, aes(x=ts.days, y=Cc, color=\"Titration\" ), linetype=2) + scale_colour_manual(values=c(\"Fixed Dosing\"=\"darkblue\", \"Titration\"=\"firebrick3\")) + theme(legend.title = element_blank()) + theme(legend.position = 'bottom') myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"repeated-infusions-analysis_repeat_infusion-r","dir":"Articles","previous_headings":"","what":"Repeated Infusions (analysis_repeat_infusion.r)","title":"Titration/Rule-Based Simulations","text":"example want give 30 minute infusion 15 mg/min every two weeks. Similar previous example first using fixed dosing methods: Now use rule-based dosing enable titration, create rule (\"ivdose\") hold dosing times, create conditions resulting dosing. similar previous example except use SI_TT_RATE prototype function. rate units times levels specified system file (). times also relative titration time.","code":"cfg = system_zero_inputs(cfg) cfg = system_set_rate(cfg, rate = \"Dinf\", times = c( 0, 30, 20160, 20190, 40320, 40350, 60480, 60510, 80640, 80670), levels = c(15 , 0, 15, 0, 15, 0, 15, 0, 15, 0)) som_fix = run_simulation_ubiquity(parameters, cfg) cfg=system_set_option(cfg, group = \"titration\", option = \"titrate\", value = TRUE) cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"TRUE\", action = \"SI_TT_RATE[rate='Dinf', times=c(0,30), levels=c(15,0)]\", value = \"1\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_fix$simout, aes(x=ts.days, y=Cc, color=\"Fixed Dosing\"), linetype=1) + geom_line(data=som_tt$simout, aes(x=ts.days, y=Cc, color=\"Titration\" ), linetype=2) + scale_colour_manual(values=c(\"Fixed Dosing\"=\"darkblue\", \"Titration\"=\"firebrick3\")) + theme(legend.title = element_blank()) + theme(legend.position = 'bottom') myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"titrated-dosing-analysis_visit_dosing_titration-r","dir":"Articles","previous_headings":"","what":"Titrated Dosing (analysis_visit_dosing_titration.r)","title":"Titration/Rule-Based Simulations","text":"following example want administer subcutaneous dose () every two weeks (interval=14) 12 weeks. dose level evaluated every 6 months. serum concentration (Cc) less 900, dose 700 mg. Cc greater 900 dose 600 mg. relevant code implement shown : Initially concentration serum 0 (Cc < 900), dosing starts 700. six months titration rule triggered . point serum concentration greater greater 900 dose level reduced 600. subsequent measurements greater 900 dose remains 600. Titration output: som_tt$titration Titration output: som_tt$titration_history","code":"cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 6, 12, 18, 24), timescale = \"months\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"Cc < 900\", action = \"SI_TT_BOLUS[state='At', values=700, times=0, repdose='last', number=11, interval=14]\", value = \"700\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = \"Cc > 900\", action = \"SI_TT_BOLUS[state='At', values=600, times=0, repdose='last', number=11, interval=14]\", value = \"600\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_tt$simout, aes(x=ts.weeks, y=Cc), color=\"blue\") myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"monte-carlo-simulations-analysis_visit_dosing_titration_stochastic-r","dir":"Articles","previous_headings":"","what":"Monte Carlo Simulations (analysis_visit_dosing_titration_stochastic.r)","title":"Titration/Rule-Based Simulations","text":"example similar last except performing population simulations (20 subjects). function (simulate_subjects()) used setting 'titrate' option TRUE tells function use rule-based dosing. add data list element called som$titration three fields titration rule (tname): tt.tname.value - Value rule active condition tt.tname.simtime - Simulation time last condition became active tt.tname.timescale - Simulation time time scale rule specified fields matrix entry simulation time (column) subject (row). example accessed following list elements: som$titration$tt.ivdose.simtime som$titration$tt.ivdose.value som$titration$tt.ivdose.timescaletimescale data structure (som) can collapsed data frame using som_to_df function. titration simulations column added rule giving value rule indicated time (first 100 rows shown):","code":"cfg = system_set_option(cfg, group=\"stochastic\", option=\"nsub\", value=20) som= simulate_subjects(parameters, cfg) sdf = som_to_df(cfg, som)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"performing-statecompartment-resets-analysis_state_reset-r","dir":"Articles","previous_headings":"","what":"Performing State/Compartment Resets (analysis_state_reset.r)","title":"Titration/Rule-Based Simulations","text":"Along changing dosing titration time points, may also necessary directly alter state compartment values. last example dose every two weeks week 3 drop total drug system 1/2. portion covers IV dosing component: portion reduces amount drug Cc Cp 1/2 week 3:","code":"cfg=system_new_tt_rule(cfg, name = \"ivdose\", times = c(0, 2, 4, 6, 8), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"ivdose\", cond = 'TRUE', action = \"SI_TT_BOLUS[state='Cc', values=500, times=0]\", value = \"5\") cfg=system_new_tt_rule(cfg, name = \"state_reset\", times = c(3), timescale = \"weeks\") cfg=system_set_tt_cond(cfg, name = \"state_reset\", cond = 'TRUE', action = \"SI_TT_STATE[Cc][0.5*Cc]\", value = \"0\") cfg=system_set_tt_cond(cfg, name = \"state_reset\", cond = 'TRUE', action = \"SI_TT_STATE[Cp][0.5*Cp]\", value = \"0\") som_tt = run_simulation_titrate(parameters, cfg) myfig = ggplot() + geom_line(data=som_tt$simout, aes(x=ts.weeks, y=Cc), color=\"red\") myfig = prepare_figure('present', myfig) print(myfig)"},{"path":"https://r.ubiquity.tools/articles/Titration.html","id":"contents-of-system-txt","dir":"Articles","previous_headings":"","what":"Contents of system.txt","title":"Titration/Rule-Based Simulations","text":"","code":"# Implementation of the two compartment model from Davda 2014 # # Davda, J. P., Dodds, M. G., Gibbs, M. A., Wisdom, W., & Gibbs, J. (2014). A # model-based meta-analysis of monoclonal antibody pharmacokinetics to guide # optimal first-in-human study design. mAbs, 6(4), 1094-1102. # http://doi.org/10.4161/mabs.29095 # # System Units: # mass [=] nmoles # volume [=] L # concentration [=] nM # time [=] day # # #-------------# # | Parameters | # #-------------# # System parameters #name value lower upper units editable grouping # bound bound

F1 0.744 eps inf --- yes System

ka 0.282 eps inf 1/day yes System

CL 0.200 eps inf L/day yes System

Vc 3.61 eps inf L yes System

Vp 2.75 eps inf L yes System

Q 0.747 eps inf L/day yes System

MW 140 eps inf kD yes System mAb in Humans # Interindividual Variability # Taken from Table 3 0.416 ka 0.09875 CL 0.116 Vc 0.0789 Vp 0.699 Q 0.0786 0.0619 0.0377 # Covariates ; times; [ 0 ]; day ; values; [400]; mg step ; times; [ 0 ]; day ; values; [ 60]; kg step # static secondary parameters kel = CL/Vc kcp = Q/Vc kpc = Q/Vp # #-------------------# # |Input Information | # #-------------------# # # 1e6 ng 1 nmole 1 # X mg x ------ x ----------------- x --- => X*1e3/MW/Vc # 1 mg MW (KDA) * 1000 V(L) # # Bolus Events # times/events state values scale units ; [ 0.0, 7, 14 ]; 1; days ; At; [400.0, 0, 0 ]; 1e3/MW; mg ; Cc; [ 0.0, 0, 0 ]; 1e3/MW/Vc; mg ; times; [0, 30]; 1/60/24; min ; levels; [0, 0]; 60*24*1e3/MW; mg/min # ODEs -ka*At ka*At*F1/Vc -kel*Cc - kcp*Cc + kpc*Cp*Vp/Vc + Dinf/Vc kcp*Cc*Vc/Vp - kpc*Cp # #---------# # | Outputs | # #---------# # Outputs that begin with QC will not be displayed in the GUI # Convert nM to ng/ml # # X nM ===> X*MW(KDA) # # Convert nM to ug/ml/mg(dose) # # X nM ===> X*MW(KDA)/1000/dose # C_ng_ml = Cc*MW C_DOSE = Cc*MW/DOSE/1000 prop_err 0.1 eps inf -- yes Variance add_err 0.1 eps inf ng/ml yes Variance Vp; Vc; CL; Q; ka Vp; Vc; CL; Q; ka; add_err; prop_err add=add_err; prop=prop_err Cp; Ap; Vp # #---------# # | Options # # #---------# # General Options: # specify different time scales 24.0*60.0 1.0 24.0 1.0/7.0 1.0/7.0/4.0"},{"path":"https://r.ubiquity.tools/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John Harrold. Author, maintainer.","code":""},{"path":"https://r.ubiquity.tools/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Harrold, J.M., Abraham, .K. Ubiquity: framework physiological/mechanism-based pharmacokinetic/pharmacodynamic model development deployment. J Pharmacokinet Pharmacodyn 41, 141–151 (2014). https://doi.org/10.1007/s10928-014-9352-6","code":"@Article{, title = {Ubiquity: a framework for physiological/mechanism-based pharmacokinetic/pharmacodynamic model development and deployment}, author = {J.M. Harrold and A.K. Abraham}, journal = {Journal of Pharmacokinetics and Pharmacodynamics}, year = {2014}, volume = {41}, number = {2}, pages = {141-151}, url = {https://doi.org/10.1007/s10928-014-9352-6}, }"},{"path":[]},{"path":"https://r.ubiquity.tools/index.html","id":"overview","dir":"","previous_headings":"ubiquity R Workflow","what":"Overview","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"Provides interface R workflow ubiquity: set modeling tools created accelerate development deployment models drug disposition efficacy within organization institution. designed make model development easier, reduce pain moving modeling software, provide simple customizable interface allow scientists interrogate models. provide free BSD license source code available GitHub (R-package, ubiquity project).","code":""},{"path":"https://r.ubiquity.tools/index.html","id":"installing-ubiquity","dir":"","previous_headings":"ubiquity R Workflow","what":"Installing ubiquity","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"detailed software requirements installation instructions see page: (https://ubiquity.tools/rworkflow) Briefly, install following: R RStudio Perl (Windows) Rtools (Windows) can install ubiquity CRAN install development version GitHub: Note may need install development version onbrand GitHub well","code":"install.packages(\"ubiquity\", dependencies=TRUE) # Installing devtools if it's not already installed if(system.file(package=\"devtools\") == \"\"){ install.packages(\"devtools\") } devtools::install_github(\"john-harrold/ubiquity\", dependencies=TRUE)"},{"path":"https://r.ubiquity.tools/index.html","id":"getting-started","dir":"","previous_headings":"ubiquity R Workflow","what":"Getting started","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"full documentation ubiquity vignettes manuals available. information specific tasks see following vignettes: Language: Constructing ODE-based systems using ubiquity language Simulation: Running individual population simulations Estimation: Naive-pooled parameter estimation Titration: Rule-based/titration simulations Deployment: ShinyApp running deploying models Reporting: Inline generation PowerPoint Word reports NCA: Automated non-compartmental analysis PKNCA","code":""},{"path":"https://r.ubiquity.tools/index.html","id":"changes-and-updates","dir":"","previous_headings":"ubiquity R Workflow","what":"Changes and Updates","title":"PKPD, PBPK, and Systems Pharmacology Modeling Tools","text":"See NEWS.md details differences updates.","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate AUC for Sparse Data — AUC_Bailers_method","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"implementation Bailors method calculating AUCs sparse sampling. taken following publication: Nedelman, J. R., Gibiansky, E., & Lau, D. T. (1995). Applying Bailer's method AUC confidence intervals sparse sampling Pharmaceutical Research, 12(1), 124-128.","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"","code":"AUC_Bailers_method( conc_data = NULL, dsmap = list(NTIME = \"NTIME\", CONC = \"CONC\", ID = \"ID\") )"},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"conc_data data frame containing sparse data dsmap list names specifying columns: NTIME Nominal time since last dose; \"NTIME\" (default) CONC Concentration data; \"CONC\" (default) ID Subject ID; (\"ID\" (default)","code":""},{"path":"https://r.ubiquity.tools/reference/AUC_Bailers_method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate AUC for Sparse Data — AUC_Bailers_method","text":"list following elements isgood Boolean value indicating result function call AUC Mean AUC var_AUC Variance AUC msgs Sequence strings contianing description problems obss Internal observations times Sequence time corresponding rows obs r number observations time point (rows correspond rows obs)","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":null,"dir":"Reference","previous_headings":"","what":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"Called ShinyApp add log entry \"App\" prepended log entry","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"","code":"GUI_log_entry(cfg, text)"},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"cfg ubiquity system object text string print/log","code":""},{"path":"https://r.ubiquity.tools/reference/GUI_log_entry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Wrapper for system_log_entry Used in ShinyApp — GUI_log_entry","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"function used stochastic simulations performed using data file subject level information. data file contains covariate information, function update system subjects covariates.","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"","code":"apply_sub_file_COV( tmpcfg, cov_found, sub_dataset, sub_ID_col, sub_TIME_col, file_ID )"},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"tmpcfg ubiquity system object cov_found list covariates found dataset sub_dataset name dataset subject parameters sub_ID_col name column dataset subject IDs sub_TIME_col name column dataset simulation time file_ID subject ID extract covariates ","code":""},{"path":"https://r.ubiquity.tools/reference/apply_sub_file_COV.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts Covariates for a Subject from a Subject Data File — apply_sub_file_COV","text":"ubiquity system object covariates set current subject","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":null,"dir":"Reference","previous_headings":"","what":"Archive Estimation Results — archive_estimation","title":"Archive Estimation Results — archive_estimation","text":"Archives estimation results moving output files file names 'name' prepended . prevents overwritten different analysis script following files archived: output/parameters_all.csv output/parameters_est.csv output/report.txt Example: archive_estimation('mysoln', cfg) rename files output/mysoln-parameters_all.csv output/mysoln-parameters_est.csv output/mysoln-report.txt","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Archive Estimation Results — archive_estimation","text":"","code":"archive_estimation(name, cfg)"},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Archive Estimation Results — archive_estimation","text":"name analysis name cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/archive_estimation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Archive Estimation Results — archive_estimation","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":null,"dir":"Reference","previous_headings":"","what":"Build the System File — build_system","title":"Build the System File — build_system","text":"Builds specified system file creating targets R languages well templates performing simulations estimations.","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Build the System File — build_system","text":"","code":"build_system( system_file = \"system.txt\", distribution = \"automatic\", perlcmd = \"perl\", output_directory = file.path(\".\", \"output\"), temporary_directory = file.path(\".\", \"transient\"), verbose = TRUE, ubiquity_app = FALSE, debug = TRUE )"},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Build the System File — build_system","text":"system_file name file defining system ubiquity format (default = 'system.txt'), file exist template created compiled. distribution indicates weather using 'package' 'stand alone' distribution ubiquity. set 'automatic' build script first look see ubiquity R package installed. installed use package. Otherwise, assume \"sand alone\" distribution. perlcmd system command run perl (\"perl\") output_directory location store analysis outputs (file.path(\".\", \"output\")) temporary_directory location templates otehr files building system (file.path(\".\", \"transient\")) verbose enable verbose messaging (TRUE) ubiquity_app set TRUE building system used ubiquty App (FALSE) debug Boolean variable indicating debugging information displayed (TRUE)","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Build the System File — build_system","text":"initialized ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/build_system.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Build the System File — build_system","text":"","code":"# \\donttest{ fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Creating output directory #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # }"},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate the halflife of data — calculate_halflife","title":"Calculate the halflife of data — calculate_halflife","text":"Determines terminal halflife sequence corresponding times values optional minimum maximum times censor data.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate the halflife of data — calculate_halflife","text":"","code":"calculate_halflife(times = NULL, values = NULL, tmin = NULL, tmax = NULL)"},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate the halflife of data — calculate_halflife","text":"times - sequence times values - corresponding sequence values tmin - minimum time include (NULL) tmax - maximum time include (NULL)","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate the halflife of data — calculate_halflife","text":"List following names thalf Halflife units times mod Result lm used fit log transformed data df Dataframe data predicted values time within tmin tmax","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_halflife.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate the halflife of data — calculate_halflife","text":"","code":"x = c(0:100) y = exp(-.1*x) th = calculate_halflife(times=x, values=y) #> Warning: essentially perfect fit: summary may be unreliable #> Warning: essentially perfect fit: summary may be unreliable thalf = th$thalf"},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the Value of the Specified Objective Function — calculate_objective","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"given set system parameters objective function calculated based defined cohorts variance models.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"","code":"calculate_objective(parameters, cfg, estimation = TRUE)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"parameters system parameters cfg ubiquity system object estimation boolean variable indicate objective function called parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the Value of the Specified Objective Function — calculate_objective","text":"estimation TRUE return objective function value, FALSE return list element value containing objective function value element named isgood TRUE objective function successful.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":null,"dir":"Reference","previous_headings":"","what":"GA Wrapper for calculate_objective — calculate_objective_ga","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"Converts parameter vector named list returns negative objective (turning maximization minimization)","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"","code":"calculate_objective_ga(pvect, cfg)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"pvect system parameters cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_ga.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"GA Wrapper for calculate_objective — calculate_objective_ga","text":"objective function value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":null,"dir":"Reference","previous_headings":"","what":"pso Wrapper for calculate_objective — calculate_objective_pso","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"psoptim objective function assumes parameters vector function converts named list consistent ubiquity optmization routines.","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"","code":"calculate_objective_pso(pvect, cfg)"},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"pvect system parameters cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_objective_pso.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"pso Wrapper for calculate_objective — calculate_objective_pso","text":"objective function value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculates the Variance in od_general — calculate_variance","title":"Calculates the Variance in od_general — calculate_variance","text":"Takes variance specified string evaluates locally, returns value","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculates the Variance in od_general — calculate_variance","text":"","code":"calculate_variance( SIMINT_parameters, SIMINT_varstr, SIMINT_odchunk, SIMINT_cfg )"},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculates the Variance in od_general — calculate_variance","text":"SIMINT_parameters system parameters SIMINT_varstr string containing variance calculation SIMINT_odchunk chunk observation details containing predictions, observations time SIMINT_cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/calculate_variance.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculates the Variance in od_general — calculate_variance","text":"Variance calculated given set parameters model","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify System Steady State — check_steady_state","title":"Verify System Steady State — check_steady_state","text":"Takes output run_simulation_ubiquity verifies system running steady state analyzing timecourse states system","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify System Steady State — check_steady_state","text":"","code":"check_steady_state(cfg, som)"},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify System Steady State — check_steady_state","text":"cfg ubiquity system object som output run_simulation_ubiquity","code":""},{"path":"https://r.ubiquity.tools/reference/check_steady_state.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify System Steady State — check_steady_state","text":"list name steady_state (boolean indicating weather system steady state) states vector states steady state offset.","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":null,"dir":"Reference","previous_headings":"","what":"Compares Estimate to Bounds — compare_estimate","title":"Compares Estimate to Bounds — compare_estimate","text":"Compares parameter estimate bounds indicates estimate near bound.","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compares Estimate to Bounds — compare_estimate","text":"","code":"compare_estimate(cfg, parameters, pname)"},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compares Estimate to Bounds — compare_estimate","text":"cfg ubiquity system object parameters list parameter estimates pname name parameter compare","code":""},{"path":"https://r.ubiquity.tools/reference/compare_estimate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compares Estimate to Bounds — compare_estimate","text":"L - near lower bound, U - near upper bound","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Performs parameter estimation — estimate_parameters","title":"Performs parameter estimation — estimate_parameters","text":"Performs actual parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Performs parameter estimation — estimate_parameters","text":"","code":"estimate_parameters(cfg)"},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Performs parameter estimation — estimate_parameters","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/estimate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Performs parameter estimation — estimate_parameters","text":"list elements: estimate - vector parameter estimates raw - raw output underlying optimization routine conv - list convergence criteria keys num (numeric) text (text description) obj - objective function value statistics_est - solution statistics sysup - Text update system file parameter estimates estimate - Names list parameter estiamtes report - Named list elements reporting cohorts - Cohort elements cfg file cohort_view - Cohort view system_view() system_file - Contents system file estimation run","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"Can used take subset parameters (estimated returned ' system_estimate_parameters) full list system parameters.","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"","code":"fetch_full_parameters(pest, cfg)"},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"pest list containing subset parameters estimated cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"Full list parameters default values currently selected parameter set values pest merged","code":""},{"path":"https://r.ubiquity.tools/reference/fetch_full_parameters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create Full Parameter Vector from Estimation Subset — fetch_full_parameters","text":"function used build full parameter set subset, normally used parameter estimation observation details function entire parameter vector needed simulate system. function select_set pulls parameter set can optionally select subset estimation: default values subset can accessed following way: estimation routines work reduced parameter set, run simulations full set needed. full values can retrieved using following:","code":"pnames = c('Vp', 'CL') cfg = system_select_set(cfg, \"default\", pnames) pest = system_fetch_guess(cfg) parameters = fetch_full_parameters(pest, cfg)"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse Prototype Functions for Arguments — find_bracketed_arguments","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"Parses strings find abstract functions (format SIFUNC[ARG1][ARG2][ARG3] extract arguments function replace actual functions additional arguments needed","code":""},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"","code":"find_bracketed_arguments(str, pattern, replace = \"\", narg, op = \"[\", cp = \"]\")"},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"str string containing prototype function call pattern string indicating start function eg. \"SI_TT_BOLUS[\" replace string replace pattern narg number arguments prototype function op string used indicating open parenthesis cp string used indicating close parenthesis","code":""},{"path":"https://r.ubiquity.tools/reference/find_bracketed_arguments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse Prototype Functions for Arguments — find_bracketed_arguments","text":"string containing actual function call/code built prototype function","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":null,"dir":"Reference","previous_headings":"","what":"Generates a Parameter Based on in the System File — generate_parameter","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"Internal function used generate parameters based IIV information","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"","code":"generate_parameter( SIMINT_parameters, SIMINT_cfg, SIMINT_PARAMETER_TV, SIMINT_IIV_VALUE, SIMINT_equation )"},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"SIMINT_parameters parameters vector containing typical values SIMINT_cfg ubiquity system object SIMINT_PARAMETER_TV Typical value parameter question SIMINT_IIV_VALUE sample mvr distribution SIMINT_equation equation relating IIV typical value parameter value variability","code":""},{"path":"https://r.ubiquity.tools/reference/generate_parameter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generates a Parameter Based on in the System File — generate_parameter","text":"parameter value variability applied","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Text Report with Estimation Results — generate_report","title":"Generate Text Report with Estimation Results — generate_report","text":"Internal function used generate report estimation results","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Text Report with Estimation Results — generate_report","text":"","code":"generate_report(parameters, ss, cfg, conv_desc)"},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Text Report with Estimation Results — generate_report","text":"parameters list parameter estimates ss output solution_statistics cfg ubiquity system object conv_desc description convergence criteria","code":""},{"path":"https://r.ubiquity.tools/reference/generate_report.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Text Report with Estimation Results — generate_report","text":"List following elements: report_file name report file report_file_contents contents report file parameters_all_file name CSV file parameters parameters_est_file name CSV file estimates","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Subject — generate_subject","title":"Generate Subject — generate_subject","text":"Generates subject variability specified using descriptor system file","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Subject — generate_subject","text":"","code":"generate_subject(parameters, cfg)"},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Subject — generate_subject","text":"parameters vector nominal parameter values cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/generate_subject.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Subject — generate_subject","text":"List field named parameters containing sample representing subject","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"used convert x y-axis ggplot log 10 scale visually satisfying ggplot default.","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"","code":"gg_axis( fo, yaxis_scale = TRUE, xaxis_scale = TRUE, ylim_min = NULL, ylim_max = NULL, xlim_min = NULL, xlim_max = NULL, x_tick_label = TRUE, y_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"fo ggplot figure object yaxis_scale TRUE indicates y-axis log10 scaled xaxis_scale TRUE indicates x-axis log10 scaled ylim_min set number define lower bound y-axis ylim_max set number define upper bound y-axis xlim_min set number define lower bound x-axis xlim_max set number define upper bound x-axis x_tick_label TRUE show x tick labels, FALSE hide x tick labels y_tick_label TRUE show y tick labels, FALSE hide y tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_axis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot x- or y-Axis Log 10 Scale — gg_axis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"Wrapper gg_axis create log 10 x-axis","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"","code":"gg_log10_xaxis( fo, xlim_min = NULL, xlim_max = NULL, y_tick_label = TRUE, x_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"fo ggplot figure object xlim_min set number define lower bound x-axis xlim_max set number define upper bound x-axis y_tick_label TRUE show y tick labels, FALSE hide y tick labels x_tick_label TRUE show x tick labels, FALSE hide x tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_log10_xaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot x-Axis Log 10 Scale — gg_log10_xaxis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"Wrapper gg_axis create log 10 y-axis","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"","code":"gg_log10_yaxis( fo, ylim_min = NULL, ylim_max = NULL, y_tick_label = TRUE, x_tick_label = TRUE )"},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"fo ggplot figure object ylim_min set number define lower bound y-axis ylim_max set number define upper bound y-axis y_tick_label TRUE show y tick labels, FALSE hide y tick labels x_tick_label TRUE show x tick labels, FALSE hide x tick labels","code":""},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"ggplot object formatted axis","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/gg_log10_yaxis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make Pretty ggplot y-Axis Log 10 Scale — gg_log10_yaxis","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of the linspace Function from Matlab — linspace","title":"Implementation of the linspace Function from Matlab — linspace","text":"Creates vector n elements equally spaced apart.","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of the linspace Function from Matlab — linspace","text":"","code":"linspace(a, b, n = 100)"},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of the linspace Function from Matlab — linspace","text":"initial number b final number n number elements (integer >= 2)","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of the linspace Function from Matlab — linspace","text":"vector numbers b n linearly spaced apart","code":""},{"path":"https://r.ubiquity.tools/reference/linspace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of the linspace Function from Matlab — linspace","text":"","code":"linspace(0,100, 20) #> [1] 0.000000 5.263158 10.526316 15.789474 21.052632 26.315789 #> [7] 31.578947 36.842105 42.105263 47.368421 52.631579 57.894737 #> [13] 63.157895 68.421053 73.684211 78.947368 84.210526 89.473684 #> [19] 94.736842 100.000000"},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of the logspace Function from Matlab — logspace","title":"Implementation of the logspace Function from Matlab — logspace","text":"Creates vector n elements logarithmically spaced apart.","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of the logspace Function from Matlab — logspace","text":"","code":"logspace(a, b, n = 100)"},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of the logspace Function from Matlab — logspace","text":"initial number b final number n number elements (integer >=2)","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of the logspace Function from Matlab — logspace","text":"vector numbers b n logarithmically (base 10) spaced apart","code":""},{"path":"https://r.ubiquity.tools/reference/logspace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of the logspace Function from Matlab — logspace","text":"","code":"logspace(-2, 3,20) #> [1] 1.000000e-02 1.832981e-02 3.359818e-02 6.158482e-02 1.128838e-01 #> [6] 2.069138e-01 3.792690e-01 6.951928e-01 1.274275e+00 2.335721e+00 #> [11] 4.281332e+00 7.847600e+00 1.438450e+01 2.636651e+01 4.832930e+01 #> [16] 8.858668e+01 1.623777e+02 2.976351e+02 5.455595e+02 1.000000e+03"},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Makes Forcing Function From Times and Values — make_forcing_function","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"Takes list times, values, interpolation method","code":""},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"","code":"make_forcing_function( times, values, type, output_times, sample_delta_mult = 0.001 )"},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"times time values forcing function values magnitude time (length time) type string indicating type forcing function can one following: \"step\" constant values switch new values times \"linear\" linearly interpolate points output_times vector simulation output times sample_delta_mult multiplier used control magnitude spacing around event times","code":""},{"path":"https://r.ubiquity.tools/reference/make_forcing_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Makes Forcing Function From Times and Values — make_forcing_function","text":"matrix two columns: first column vector times second column vector values","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":null,"dir":"Reference","previous_headings":"","what":"Select Records from NONMEM-ish Data Set — nm_select_records","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"Retrieves subset NONMEM-ish data set based list containing filtering information.","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"","code":"nm_select_records(cfg, values, filter)"},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"cfg ubiquity system object values dataframe containing dataset column headers filter list element names headers values values header 'd values across headers 'd","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"subset dataset","code":""},{"path":"https://r.ubiquity.tools/reference/nm_select_records.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Select Records from NONMEM-ish Data Set — nm_select_records","text":"dataset headings ID, DOSE SEX filter following format: translated boolean filter:","code":"filter = list() filter$ID = c(1:4) filter$DOSE = c(5,10) filter$SEX = c(1) ((ID==1) | (ID==2) | (ID==3) | (ID==4)) & ((DOSE == 5) | (DOSE==10)) & (SEX == 1)"},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Pad String with Spaces — pad_string","title":"Pad String with Spaces — pad_string","text":"Adds spaces beginning end strings reaches maxlength. Used aligning text.","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pad String with Spaces — pad_string","text":"","code":"pad_string(str, maxlength = 1, location = \"beginning\")"},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pad String with Spaces — pad_string","text":"str string maxlength length pad location either \"beginning\" pad left \"end\" pad right","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pad String with Spaces — pad_string","text":"Padded string","code":""},{"path":"https://r.ubiquity.tools/reference/pad_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pad String with Spaces — pad_string","text":"","code":"pad_string(\"bob\", maxlength=10) #> [1] \" bob\" pad_string(\"bob\", maxlength=10, location=\"end\") #> [1] \"bob \""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":null,"dir":"Reference","previous_headings":"","what":"Parse String for Prototype Functions — parse_patterns","title":"Parse String for Prototype Functions — parse_patterns","text":"string can contain number prototype functions, function find replace actual R code.","code":""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Parse String for Prototype Functions — parse_patterns","text":"","code":"parse_patterns(cfg, str)"},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parse String for Prototype Functions — parse_patterns","text":"cfg ubiquity system object str string","code":""},{"path":"https://r.ubiquity.tools/reference/parse_patterns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parse String for Prototype Functions — parse_patterns","text":"String prototype functions replaced","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":null,"dir":"Reference","previous_headings":"","what":"Make ggplot Figure Pretty — prepare_figure","title":"Make ggplot Figure Pretty — prepare_figure","text":"Takes ggplot object alters line thicknesses makes cosmetic changes make appropriate exporting.","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make ggplot Figure Pretty — prepare_figure","text":"","code":"prepare_figure( purpose = \"present\", fo, y_tick_minor = FALSE, y_tick_major = FALSE, x_tick_minor = FALSE, x_tick_major = FALSE )"},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make ggplot Figure Pretty — prepare_figure","text":"purpose either \"present\" (default), \"print\" \"shiny\" fo ggplot figure object y_tick_minor Boolean value control grid lines y_tick_major Boolean value control grid lines x_tick_minor Boolean value control grid lines x_tick_major Boolean value control grid lines","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make ggplot Figure Pretty — prepare_figure","text":"ggplot object","code":""},{"path":"https://r.ubiquity.tools/reference/prepare_figure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make ggplot Figure Pretty — prepare_figure","text":"","code":"library(\"ggplot2\") df = data.frame(x = seq(0.01,10,.01), y = seq(0.01,10,.01)^2) p = ggplot(df, aes(x=x, y=y)) + geom_line() # pretty up the axes p = prepare_figure(fo=p, purpose=\"print\") # pretty log10 y-axis p_logy = gg_log10_yaxis(fo=p) # pretty log10 x-axis p_logx = gg_log10_xaxis(fo=p) # pretty log10 yx-axis p_logxy = gg_axis(fo=p)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"Provides interface run_simulation_ubiquity start stop simulations apply rules control dosing state-resets.","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"","code":"run_simulation_titrate(SIMINT_p, SIMINT_cfg, SIMINT_dropfirst = TRUE)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"SIMINT_p list system parameters SIMINT_cfg ubiquity system object SIMINT_dropfirst TRUE drop first sample point (prevents bolus doses starting 0)","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_titrate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate With Titration or Rule-Based Inputs — run_simulation_titrate","text":"som","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Individual Response — run_simulation_ubiquity","title":"Simulate Individual Response — run_simulation_ubiquity","text":"Controls execution individual simulations deSolve using either R scripts loadable C libraries.","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Individual Response — run_simulation_ubiquity","text":"","code":"run_simulation_ubiquity(SIMINT_parameters, SIMINT_cfg, SIMINT_dropfirst = TRUE)"},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Individual Response — run_simulation_ubiquity","text":"SIMINT_parameters vector parameters SIMINT_cfg ubiquity system object SIMINT_dropfirst TRUE drop first sample point (prevents bolus doses starting 0)","code":""},{"path":"https://r.ubiquity.tools/reference/run_simulation_ubiquity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Individual Response — run_simulation_ubiquity","text":"simulation output mapped (som) list. time-course stored simout element. first column (time) contains simulation time units simulation. Next column : State, output system parameter Models covariate contain initial value (prefix: SIMINT_CVIC_) well values time point static dynamic system parameter also passed column timescale returned \"ts.\" prefix.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Sample Times Around Events — sample_around","title":"Define Sample Times Around Events — sample_around","text":"events, bolus doses, applied system rapid changes can occur. system sampled heavily around times, changes may missed output profiles. Based total duration sample times, extra samples can added near events.","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Sample Times Around Events — sample_around","text":"","code":"sample_around(tvals, ot, sample_delta_mult = 1e-06)"},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Sample Times Around Events — sample_around","text":"tvals vector event times ot simualtion output times sample_delta_mult multiplier used control magnitude spacing around following event times","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Sample Times Around Events — sample_around","text":"vector event times added samples","code":""},{"path":"https://r.ubiquity.tools/reference/sample_around.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Sample Times Around Events — sample_around","text":"information setting options population simulation see stochastic section system_set_option help file.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":null,"dir":"Reference","previous_headings":"","what":"Run Population Simulations — simulate_subjects","title":"Run Population Simulations — simulate_subjects","text":"Used run Population/Monte Carlo simulations subjects generated either provided variance/covariance information dataset.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Run Population Simulations — simulate_subjects","text":"","code":"simulate_subjects( parameters, cfg, show_progress = TRUE, progress_message = \"Simulating Subjects:\" )"},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Run Population Simulations — simulate_subjects","text":"parameters list containing typical value parameters cfg ubiquity system object show_progress Boolean value controlling display progress indicator (TRUE) progress_message text string prepend called ShinyApp","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Run Population Simulations — simulate_subjects","text":"Mapped simulation output individual predictions, individual parameters, summary statistics parameters. Vignettes details format output.","code":""},{"path":"https://r.ubiquity.tools/reference/simulate_subjects.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Run Population Simulations — simulate_subjects","text":"Failures due numerical instability integration errors captured within function. Data subjects removed output. IDs displayed messages stored output. information setting options population simulation see stochastic section system_set_option help file.","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Solution Statistics — solution_statistics","title":"Calculate Solution Statistics — solution_statistics","text":"Attempts determine variance/covariance matrix, confidence intervals CV percent list parameter estimates parameters. method taken ADAPT 5 User's Guide chapter 3.","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Solution Statistics — solution_statistics","text":"","code":"solution_statistics(parameters, cfg)"},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Solution Statistics — solution_statistics","text":"parameters list parameter estimates cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Solution Statistics — solution_statistics","text":"list containing information provided estimates","code":""},{"path":"https://r.ubiquity.tools/reference/solution_statistics.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Calculate Solution Statistics — solution_statistics","text":"returned list following format: objective - objective function value num_observations - number observations degrees_of_freedom - degrees freedom aic - Akaike information criterion bic - Bayesian (Schwarz) information criterion covariance - variance covariance matrix wls - defined weighted least squares objective following elements: jacobian - Jacobian matrix weights - diagonal matrix weights error_variance - diagonal matrix variances ml - defined maximum likelihood objective following elements: M - Jacobian matrix block variance parameters coefficient_of_variation$pname - CV percent parameter pname confidence_interval$lower_bound$pname - Lower bound confidence interval pname confidence_interval$upper_bound$pname - Upper bound confidence interval pname","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"functions run_simulation_ubiquity, simulate_subjects, run_simulation_titrate provide outputs structured format, may useful convert \"wide\" format tall/skinny format.","code":""},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"","code":"som_to_df(cfg, som)"},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"cfg ubiquity system object som simulation output run_simulation_ubiquity, simulate_subjects, run_simulation_titrate","code":""},{"path":"https://r.ubiquity.tools/reference/som_to_df.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts the Wide/Verbose Output Simulation Functions into Data Frames — som_to_df","text":"Data frame format: applied output run_simulation_ubiquity run_simulation_titrate ts.time - timescale system ts.ts1, ... ts.tsn - timescales defined system () pred - predicted/simulated response tt.ti1.x - titration event information (*) name - state output () name corresponding prediction applied output simulate_subjects ID - subject ID ts.time - timescale system ts.ts1, ... ts.tsn - timescales defined system () pred - predicted/simulated response tt.ti1.x - titration event information (*) P1, P2, ... Pn - system parameters subject (

) name - state output () name corresponding prediction (* - field present titration enabled)","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":null,"dir":"Reference","previous_headings":"","what":"Check For Perl and C Tools — system_check_requirements","title":"Check For Perl and C Tools — system_check_requirements","text":"Check local installation perl verify C compiler installed working.","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check For Perl and C Tools — system_check_requirements","text":"","code":"system_check_requirements( checklist = list(perl = list(check = TRUE, perlcmd = \"perl\"), C = list(check = TRUE)), verbose = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check For Perl and C Tools — system_check_requirements","text":"checklist list names corresponding elements system check. verbose enable verbose messaging","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check For Perl and C Tools — system_check_requirements","text":"List fn result packages","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_requirements.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check For Perl and C Tools — system_check_requirements","text":"","code":"# \\donttest{ invisible(system_check_requirements()) #> #> system_check_requirements() #> #> Testing perl, looking for a perl interpreter #> #> Perl interpreter found, now testing it #> #> > Success: Perl runs, everything should be good #> #> Attempting to compile C file #> #> > Success: C file compiled #> #> Loading the library #> #> > Success: C library loaded # }"},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":null,"dir":"Reference","previous_headings":"","what":"Verify System Steady State — system_check_steady_state","title":"Verify System Steady State — system_check_steady_state","text":"Takes ubiquity system object optional inputs verify system running steady state. also provides information can helpful debugging systems running steady state.","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Verify System Steady State — system_check_steady_state","text":"","code":"system_check_steady_state( cfg, parameters = NULL, zero_rates = TRUE, zero_bolus = TRUE, output_times = seq(0, 100, 1), offset_tol = .Machine$double.eps * 100, derivative_tol = .Machine$double.eps * 100, derivative_time = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Verify System Steady State — system_check_steady_state","text":"cfg ubiquity system object parameters optional set parameters (NULL) check steady state (set NULL parameters currently selected parameter set used) zero_rates Boolean value control removing rate inputs (TRUE) zero_bolus Boolean value control removing bolus inputs (TRUE) output_times sequence output times simulate offset determination (seq(0,100,1)) offset_tol maximum percent offset considered zero (.Machine$double.eps*100) derivative_tol maximum derivative value considered zero (.Machine$double.eps*100) derivative_time time evaluate derivatives identify deviations (0), set NULL skip derivative evaluation","code":""},{"path":"https://r.ubiquity.tools/reference/system_check_steady_state.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Verify System Steady State — system_check_steady_state","text":"List following names steady_state Boolean indicating weather system steady state states_derivative Derivatives values greater derivative_tol states_simulation States values greater offset_tol som Simulated output derivatives Derivatives states_derivative_NA_NaN States derivatives evaluated either NA NaN states_simulation_NA_NaN States simulation values either NA NaN derivative_tc Data frame timecourse states derivative found greater tolerance (states_derivative)","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":null,"dir":"Reference","previous_headings":"","what":"Clear all Cohorts — system_clear_cohorts","title":"Clear all Cohorts — system_clear_cohorts","text":"Clear previously defined cohorts","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Clear all Cohorts — system_clear_cohorts","text":"","code":"system_clear_cohorts(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Clear all Cohorts — system_clear_cohorts","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_clear_cohorts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Clear all Cohorts — system_clear_cohorts","text":"ubiquity system object cohorts defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Estimation Cohort — system_define_cohort","title":"Define Estimation Cohort — system_define_cohort","text":"Define cohort include parameter estimation","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Estimation Cohort — system_define_cohort","text":"","code":"system_define_cohort(cfg, cohort)"},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Estimation Cohort — system_define_cohort","text":"cfg ubiquity system object cohort list cohort information","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Estimation Cohort — system_define_cohort","text":"ubiquity system object cohort defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohort.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Estimation Cohort — system_define_cohort","text":"cohort name (eg d5mpk), dataset containing information cohort identified (name defined system_load_data) Next portion dataset applies current cohort, can define filter (cf field). applied dataset return values relevant cohort. example, want records column DOSE 5 (5 mpk cohort). can use following: dataset headings ID, DOSE SEX cohort filter following format: translated boolean filter: Optionally may want fix system parameter different value given cohort. can done using cohort parameter (cp) field. example body weight defined system parameter (BW), wanted fix body weight 70 current cohort following: Note can fix parameters estimated. default underlying simulation output times taken general output_times option (see system_set_option). However may also necessary specify simulation output times specific cohort. output_times field can used . Simply provide vector output times: Next define dosing cohort. necessary define inputs non-zero. data generated animals given single 5 mpk IV time 0. Bolus dosing defined using . Cp central compartment, pass information cohort following manner: Inputs can also include infusion rates (infusion_rates) covariates (covariates). Covariates default value specified system file unless overwritten . units system file Next need map outputs model observation data dataset. outputs field field output. field ONAME can replaced something useful (like PK). want filter dataset. Say example two outputs cf applied reduces dataset outputs. can use \"\" field apply \"output filter\" filter records apply current output ONAME. need filtering data, can can just omit field. Next need identify columns dataset contain times observations. found obs field current observation: times observations dataset found ’TIMECOL’ column ’OBSCOL’ column (optional missing data option specified -1). observations dataset need mapped appropriate elements model defined system file. done model field: First system time scale indicated TS placeholder must specfied. time scale must correspond data found TIMECOL . Next model output indicated MODOUTPUT placeholder needs specified. defined system file using correspond OBSCOL dataset. Lastly variance field specifies variance model. can use keyword PRED (model predicted output) variance parameters. examples include: variance = \"1\" - Least squares variance = \"PRED^2\" - Weighted least squares proportional prediction squared variance = \"(SLOPE*PRED)^2\" Maximum likelihood estimation SLOPE defined variance parameter () following controls plotting aspects associated output. color, shape line values values used ggplot functions. cohort multiple outputs, simply repeat process . additional cohorts. estimation vignettes contains examples . Note: Output names consistent cohorts grouped together plotting results.","code":"cohort = list( name = \"d5mpk\", dataset = \"pm_data\", inputs = NULL, outputs = NULL) cohort[[\"cf\"]] = list(DOSE = c(5)) cohort[[\"cf\"]] = list(ID = c(1:4), DOSE = c(5,10), SEX = c(1)) (ID==1) | (ID==2) | (ID==3) | (ID==4)) & ((DOSE == 5) | (DOSE==10)) & (SEX == 1) cohort[[\"cp\"]] = list(BW = c(70)) cohort[[\"output_times\"]] = seq(0,100,2) cohort[[\"inputs\"]][[\"bolus\"]] = list() cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]] = list(TIME=NULL, AMT=NULL) cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]][[\"TIME\"]] = c( 0) cohort[[\"inputs\"]][[\"bolus\"]][[\"Cp\"]][[\"AMT\"]] = c( 5) cohort[[\"outputs\"]][[\"ONAME\"]] = list() cohort[[\"outputs\"]][[\"ONAME\"]][[\"of\"]] = list( COLNAME = c(), COLNAME = c()) cohort[[\"outputs\"]][[\"ONAME\"]][[\"obs\"]] = list( time = \"TIMECOL\", value = \"OBSCOL\", missing = -1) cohort[[\"outputs\"]][[\"ONAME\"]][[\"model\"]] = list( time = \"TS\", value = \"MODOUTPUT\", variance = \"PRED^2\") cohort[[\"outputs\"]][[\"ONAME\"]][[\"options\"]] = list( marker_color = \"black\", marker_shape = 16, marker_line = 1 )"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"function allows user define cohorts automatically NONMEM dataset","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"","code":"system_define_cohorts_nm( cfg, DS = \"DSNAME\", col_ID = \"ID\", col_CMT = \"CMT\", col_DV = \"DV\", col_TIME = \"TIME\", col_AMT = \"AMT\", col_RATE = \"RATE\", col_EVID = \"EVID\", col_GROUP = NULL, filter = NULL, INPUTS = NULL, OBS = NULL )"},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"cfg ubiquity system object DS Name dataset loaded using system_load_data col_ID Column unique subject identifier col_CMT Compartment column col_DV Column observations ’.’ input col_TIME Column system time record col_AMT Infusion/dose amounts (need units specified system.txt file) col_RATE Rate infusion ’.’ bolus col_EVID EVID (0 - observation, 1 dose) col_GROUP Column name use defining similar cohorts generating figures. filter List used filter dataset NULL whole dataset used (see filter rules nm_select_records description use option) INPUTS List mapping input information dataset names used system.txt file OBS List mapping obseravation information dataset nams used system.txt file","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"ubiquity system object cohorts defined.","code":""},{"path":"https://r.ubiquity.tools/reference/system_define_cohorts_nm.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Cohorts from NONMEM Input File — system_define_cohorts_nm","text":"NOTE: use function necessary timescale define system time scale. example, system time scale days, something like following needed: Include records dataset Include records matching following filter Mapping information: inputs mapping information (INPUTMAP) alist field type input: input: bolus List name bolus state dataset (): bolus name CMT_NUM field indicating compartment number state infusion_rates List name rate dataset (): rate name CMT_NUM field indicating compartment number state covariates List covariate dataset (): covariate name col_COV indicating column database contains covariate coding perspective looks like : observation mapping information (OBSMAP) list elements output described system_define_cohort. output list following names: variance Variance model output CMT Compartment number mapping observations output output Name output () corresponding observations missing Value indicating missing observation NULL coding perspective looks like :","code":" 1 filter = NULL filter = list() filter$COLNAME = c() INPUTMAP = list() INPUTMAP$bolus$SPECIES$CMT_NUM = 1 INPUTMAP$infusion_rates$RATE$CMT_NUM = 1 INPUTMAP$covariates$CVNAME$col_COV = 'CNAME' OBSMAP = list() OBSMAP$ONAME=list(variance = 'PRED^2', CMT = 1, output = '', missing = NULL )"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Control Estimation Process — system_estimate_parameters","title":"Control Estimation Process — system_estimate_parameters","text":"Manages flow parameter estimation using data specified system_define_cohort.","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Control Estimation Process — system_estimate_parameters","text":"","code":"system_estimate_parameters( cfg, flowctl = \"plot guess\", analysis_name = \"my_analysis\", archive_results = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Control Estimation Process — system_estimate_parameters","text":"cfg ubiquity system object flowctl string control flow function analysis_name string containing name analysis archive_results boolean variable control whether results archived","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Control Estimation Process — system_estimate_parameters","text":"parameter estimates","code":""},{"path":"https://r.ubiquity.tools/reference/system_estimate_parameters.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Control Estimation Process — system_estimate_parameters","text":"flowctl argument can following values \"plot guess\" return initial guess \"estimate\" perform estimation \"previous estimate guess\" load previous estimate analysis_name use initial guess \"plot previous estimate\" return previous estimate analysis_name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch System Timescale — system_fetch_TSsys","title":"Fetch System Timescale — system_fetch_TSsys","text":"Reads system information tries determine system time scale (timescale value 1)","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch System Timescale — system_fetch_TSsys","text":"","code":"system_fetch_TSsys(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch System Timescale — system_fetch_TSsys","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_TSsys.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch System Timescale — system_fetch_TSsys","text":"Name system timescale NULL found","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Current Parameter Guesses — system_fetch_guess","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"Fetch list guesses current parameter set parameters selected estimation","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"","code":"system_fetch_guess(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_guess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Current Parameter Guesses — system_fetch_guess","text":"list current parameter gauesses","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Variability Terms — system_fetch_iiv","title":"Fetch Variability Terms — system_fetch_iiv","text":"Extract elements current variance/covariance matrix specified system file ?, ?, ?, ?","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Variability Terms — system_fetch_iiv","text":"","code":"system_fetch_iiv(cfg, IIV1, IIV2)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Variability Terms — system_fetch_iiv","text":"cfg ubiquity system object IIV1 row name variance/covariance matrix IIV2 column name variance/covariance matrix","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Variability Terms — system_fetch_iiv","text":"Value variance/covariance matrix","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_iiv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Variability Terms — system_fetch_iiv","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Covariance term for ETACL and ETAVc val = system_fetch_iiv(cfg, IIV1=\"ETACL\", IIV2=\"ETAVc\") # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch NCA Results — system_fetch_nca","title":"Fetch NCA Results — system_fetch_nca","text":"Fetches NCA summary ubiquity system object.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch NCA Results — system_fetch_nca","text":"","code":"system_fetch_nca(cfg, analysis_name = \"analysis\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch NCA Results — system_fetch_nca","text":"cfg ubiquity system object analysis_name string containing name NCA analysis (default 'analysis')","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch NCA Results — system_fetch_nca","text":"List data frame NCA results (NCA_summary), raw output PKNCA (PKNCA_results), also list element indicating overall success function call (isgood)","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":null,"dir":"Reference","previous_headings":"","what":"Columns in NCA Analysis — system_fetch_nca_columns","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"Show columns available given NCA analysis","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"","code":"system_fetch_nca_columns(cfg, analysis_name = \"analysis\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"cfg ubiquity system object analysis_name string containing name NCA analysis (default 'analysis')","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_nca_columns.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Columns in NCA Analysis — system_fetch_nca_columns","text":"list following elements: isgood Boolean variable identify function executed properly (TRUE) errors (FALSE) NCA_col_summary dataframe columns analysis analysis_name (col_name - NCA short name, - parameter derived , label - verbose text label column, description, verbose text description parameter. len_NCA_col maximum length col_name column len_from maximum length column len_label maximum length label column len_description maximum length description column","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch System Parameters — system_fetch_parameters","title":"Fetch System Parameters — system_fetch_parameters","text":"Fetch parameters currently selected parameter set. switch parameter sets use system_select_set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch System Parameters — system_fetch_parameters","text":"","code":"system_fetch_parameters(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch System Parameters — system_fetch_parameters","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch System Parameters — system_fetch_parameters","text":"List parameters selected parameter set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_parameters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch System Parameters — system_fetch_parameters","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Fetching the default parameter set parameters = system_fetch_parameters(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"extract officer object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"","code":"system_fetch_rpt_officer_object(cfg, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"cfg ubiquity system object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_officer_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts the officer Object From the Specified ubiquity Report — system_fetch_rpt_officer_object","text":"officer report object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"extract onbrand object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"","code":"system_fetch_rpt_onbrand_object(cfg, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"cfg ubiquity system object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_rpt_onbrand_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts the onbrand Object From the Specified ubiquity Report — system_fetch_rpt_onbrand_object","text":"onbrand report object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Mathematical Set — system_fetch_set","title":"Fetch Mathematical Set — system_fetch_set","text":"Fetch elements specified mathematical set defined system file.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Mathematical Set — system_fetch_set","text":"","code":"system_fetch_set(cfg, set_name = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Mathematical Set — system_fetch_set","text":"cfg ubiquity system object set_name name mathematical set","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Mathematical Set — system_fetch_set","text":"sequence containing elements parameter set NULL problem.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_set.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Mathematical Set — system_fetch_set","text":"","code":"# \\donttest{ # Creating a system file from the pbpk example fr = system_new(file_name = \"system.txt\", system_file = \"pbpk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Fetching the contents of the ORG mathematical set ORG_elements = system_fetch_set(cfg, \"ORG\") # }"},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":null,"dir":"Reference","previous_headings":"","what":"Create New Analysis Template — system_fetch_template","title":"Create New Analysis Template — system_fetch_template","text":"Building system file produce templates R languages. function provides method make local copies templates.","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create New Analysis Template — system_fetch_template","text":"","code":"system_fetch_template( cfg, template = \"Simulation\", overwrite = FALSE, output_directory = getwd() )"},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create New Analysis Template — system_fetch_template","text":"cfg ubiquity system object template template type overwrite TRUE new system file overwrite existing files present output_directory directory workshop files placed (getwd())","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create New Analysis Template — system_fetch_template","text":"List vectors template sources, destinations corresponding write success (write_file), also list element indicating overall success function call (isgood)","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create New Analysis Template — system_fetch_template","text":"template argument can following values R workflow: \"Simulation\" produces analysis_simulate.R: R-Script named placeholders used run simulations \"Estimation\" produces analysis_estimate.R: R-Script named placeholders used perform naive-pooled parameter estimation \"NCA\" produces analysis_nca.R: R-Script perform non-compartmental analysis (NCA) report results \"ShinyApp\" produces ubiquity_app.R, server.R ui.R: files needed run model Shiny App either locally Shiny Server \"Model Diagram\" produces system.svg: SVG template producing model diagram (Goto https://inkscape.org free SVG editor) \"Shiny Rmd Report\" produces system_report.Rmd test_system_report.R: R-Markdown file used generate report tabs Shiny App script test create files use software: \"Adapt\" produces system_adapt.system_adapt.prm: Fortran parameter files currently selected parameter set Adapt format. \"Berkeley Madonna\" produces system_berkeley_madonna.txt: text file model currently selected parameter set Berkeley Madonna format \"nlmixr\" produces system_nlmixr.R currently selected parameter set define system `nlmixr` format. \"NONMEM\" produces system_nonmem.ctl currently selected parameter set NONMEM conntrol stream. \"Monolix\" produces system_monolix.txt system_monolix.mlxtran currently selected parameter set. \"mrgsolve\" produces system_mrgsolve.cpp: text file model currently selected parameter set mrgsolve format","code":""},{"path":"https://r.ubiquity.tools/reference/system_fetch_template.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create New Analysis Template — system_fetch_template","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Creating a simulation template fr = system_fetch_template(cfg, template = \"Simulation\", output_directory = tempdir()) #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_simulate.R # }"},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialize GLP study design — system_glp_init","title":"Initialize GLP study design — system_glp_init","text":"Creates new GLP study design","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialize GLP study design — system_glp_init","text":"","code":"system_glp_init(cfg, study_title = \"Study Title\", study_name = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialize GLP study design — system_glp_init","text":"cfg ubiquity system object study_title String containing descriptive information study study_name short name used identify study functions (\"default\")","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialize GLP study design — system_glp_init","text":"cfg ubiquity system object study initialized","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":null,"dir":"Reference","previous_headings":"","what":"Design GLP Study For a Scenario — system_glp_scenario","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"Identifies top dose required GLP tox study order match human metrics (Cmax AUCs) within specified multiplier. given set human parameters human doses required hit target Cmin AUC (one) identified. Cmax AUC associated largest doses determined corresponding doses tox species (provided parameters) determined specific tox multipliers. Optionally, simulations can run specifying doses either/human tox species. Sample times can also specified generate annotated figures tables given analysts facilitate assay design. system file requires following components: - Output drug concentration - Output cumulative AUC - Bolus dosing defined specific compartment - Timescale specified system timescale (e.g. timescale hours need hours = 1.0)","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"","code":"system_glp_scenario( cfg, output_Conc = NULL, output_AUC = NULL, timescale = NULL, units_Conc = \"\", units_AUC = \"\", study_scenario = \"Tox Study\", human_sim_times = NULL, study_name = \"default\", human_parameters = NULL, human_bolus = NULL, human_ndose = 1, human_dose_interval = 1, human_Cmin = NULL, human_AUC = NULL, human_sample_interval = NULL, human_sim_doses = NULL, human_sim_samples = NULL, tox_species = \"Tox\", tox_sim_times = NULL, tox_parameters = NULL, tox_bolus = NULL, tox_ndose = 1, tox_dose_interval = 1, tox_Cmax_multiple = 10, tox_AUC_multiple = 10, tox_sample_interval = NULL, tox_sim_doses = NULL, tox_sim_samples = NULL, annotate_plots = TRUE )"},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"cfg ubiquity system object output_Conc model output specified containing concentration associated drug exposure. output_AUC model output specified containing cumulative exposure timescale system timescale specified used AUC comparisons plotting units_Conc units concentration ('') units_AUC units AUC ('') study_scenario string containing descriptive name tox study human_sim_times user-specified simulation output times humans (timescale system) study_name name study append scenario set 'system_glp_init()' ('default'): report initialized using system_rpt_read_template report name 'default' unless otherwise specified. disable reporting set NULL, use different report specify name . human_parameters list containing human parameters human_bolus string containing dosing state human doses (specified ) human_ndose number human doses simulate human_dose_interval dosing interval humans (time units specified ) human_Cmin target Cmin humans (corresponding output_Conc ) human_AUC target AUC humans (corresponding output_AUC ) human_sample_interval time interval units specified timescale evaluate trough concentration AUC (e.g c(1.99, 4.001) consider interval 2 4) human_sim_doses optional list doses human_bolus simulate (see Details ) human_sim_samples optional list sample times units specified timescale label plots simulated doses (default NULL disable labels) tox_species optional name tox species (\"Tox\") tox_sim_times user-specified simulation output times tox species (timescale system) tox_parameters list containing parameters tox species tox_bolus string containing dosing state tox species doses (specified ) tox_ndose number tox doses simulate tox_dose_interval dosing interval tox species (time units specified ) tox_Cmax_multiple target (Cmin AUC) dose tox species found cover multiple projected Cmax humans (10) tox_AUC_multiple target (Cmin AUC) dose tox species found cover multiple projected AUC humans (10) tox_sample_interval interval consider AUC Cmax comparing human prediction tox multiple tox_sim_doses optional list doses tox_bolus simulate (see Details ) tox_sim_samples optional list sample times units specified timescale label plots simulated doses (default NULL disable labels) annotate_plots Boolean switch indicate human_sim_samples tox_sim_samples labeled respective plots (TRUE)","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"cfg ubiquity system object scenario added successful","code":""},{"path":"https://r.ubiquity.tools/reference/system_glp_scenario.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Design GLP Study For a Scenario — system_glp_scenario","text":"human_sim_doses tox_sim_doses lists names corresponding label dose. element AMT TIME element corresponds dosing times amounts units specified system file. example wanted simulate four weekly doses 20 mg 70 kg person units bolus doses days mg/kg times amounts following:","code":"human_sim_doses = list() human_sim_doses[[\"20 mg QW\"]]$TIME = c( 0, 7, 14, 21) human_sim_doses[[\"20 mg QW\"]]$AMT = c(0.2857, 0.2857, 0.2857, 0.2857)"},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Loading Datasets — system_load_data","title":"Loading Datasets — system_load_data","text":"Loads datasets scripting level variable data_file data.frame following formats (based file extension) csv - comma delimited tab - tab delimited xls xlsx - excel spread sheet Multiple datasets can loaded long given different names. Datasets NONMEM-ish format first row containing column header names.","code":""},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Loading Datasets — system_load_data","text":"","code":"system_load_data(cfg, dsname, data_file, data_sheet)"},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Loading Datasets — system_load_data","text":"cfg ubiquity system object dsname short name dataset used link dataset different operations data_file file name dataset data frame containing data data_sheet argument identifying name sheet excel file","code":""},{"path":"https://r.ubiquity.tools/reference/system_load_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Loading Datasets — system_load_data","text":"Ubiquity system object dataset loaded","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":null,"dir":"Reference","previous_headings":"","what":"Save variables to files — system_log_debug_save","title":"Save variables to files — system_log_debug_save","text":"Triggered debugging enabled, function save contents values specified file name ubiquity temporary directory.","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save variables to files — system_log_debug_save","text":"","code":"system_log_debug_save(cfg, file_name = \"my_file\", values = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save variables to files — system_log_debug_save","text":"cfg ubiquity system object file_name name save file without \".RData\" extension values named list variables save","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save variables to files — system_log_debug_save","text":"Boolean variable indicating success","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_debug_save.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save variables to files — system_log_debug_save","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # enable debugging: cfg=system_set_option(cfg,group = \"logging\", option = \"debug\", value = TRUE) # Saving the cfg variable system_log_debug_save(cfg, file_name = 'my_file', values = list(cfg=cfg)) #> [1] TRUE # }"},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":null,"dir":"Reference","previous_headings":"","what":"Add Log Entry — system_log_entry","title":"Add Log Entry — system_log_entry","text":"Appends specified line analysis log","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add Log Entry — system_log_entry","text":"","code":"system_log_entry(cfg, entry)"},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add Log Entry — system_log_entry","text":"cfg ubiquity system object entry string containing log entry","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add Log Entry — system_log_entry","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_entry.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add Log Entry — system_log_entry","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file system_log_entry(cfg, \"Text of log entry\") #> NULL # }"},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialize System Log File — system_log_init","title":"Initialize System Log File — system_log_init","text":"Initializes currently specified system log file.","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialize System Log File — system_log_init","text":"","code":"system_log_init(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialize System Log File — system_log_init","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialize System Log File — system_log_init","text":"ubiquity system object logging enabled","code":""},{"path":"https://r.ubiquity.tools/reference/system_log_init.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Initialize System Log File — system_log_init","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file cfg = system_log_init(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":null,"dir":"Reference","previous_headings":"","what":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"Provides verbose information NCA parameters","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"","code":"system_nca_parameters_meta(cfg)"},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"cfg ubiquity system object","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_parameters_meta.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List NCA parameters, text names and descriptions — system_nca_parameters_meta","text":"List following elements: isgood Boolean value indicating success function call. parameters List element names standard column header NCA output. element name list following elements: label Textual descriptor parameter. description Verbose description parameter. Text indicating source parameter (either PKNCA ubiquity).","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":null,"dir":"Reference","previous_headings":"","what":"Automatic NCA — system_nca_run","title":"Automatic NCA — system_nca_run","text":"Performs NCA automated fashion","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Automatic NCA — system_nca_run","text":"","code":"system_nca_run( cfg, dsname = \"PKDS\", dscale = 1, NCA_options = NULL, NCA_min = 4, analysis_name = \"analysis\", dsfilter = NULL, extrap_C0 = TRUE, extrap_N = 2, sparse = FALSE, dsmap = list(TIME = \"TIME\", NTIME = \"NTIME\", CONC = \"CONC\", DOSE = \"DOSE\", ID = \"ID\", ROUTE = \"ROUTE\", DOSENUM = NULL, BACKEXTRAP = NULL, SPARSEGROUP = NULL), dsinc = NULL )"},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Automatic NCA — system_nca_run","text":"cfg ubiquity system object dsname name dataset loaded (system_load_data) dscale factor multiply dose get units concentration (default 1): dosing mg/kg concentrations ng/ml, dscale = 1e6 NCA_options specify list options PKNCA overwrite defaults (default NULL use defaults). example want set maximum extrapolation AUCinf 10 half-life half-life 0.8 use: list(max.aucinf.pext=10, min.hl.r.squared=.9) NCA_min minimum number points required perform NCA given subset (default 4) analysis_name string containing name analysis (default 'analysis') archive files reference results later dsfilter list names corresponding column names dataset values sequence indicating values keep (default NULL. Multiple names -ed together. example following keep records dose 1, 2, 5 dose_number 1 extrap_C0 Boolean variable enable automatic determination initial drug concentration value specified; rules used WinNonlin used: route \"iv infusion\" \"extra-vascular\" data single dose data, concentration zero used. repeat dosing used, minimum value previous dosing interval used. route \"iv bolus\" log-linear regression number observations specified extrap_N used. slope points positive first positive observation used estimate C0 extrap_N number points use back extrapolation (default 2); number can overwritten subject using BACKEXTRAP column dataset sparse Boolean variable used indicate data used sparse sampling analysis use average time point (SPARSEGROUP column must specified dsmap ) dsmap list names specifying columns dataset (* required): TIME* Time since first dose; \"TIME\" (default) NTIME* Nominal time since last dose; \"NTIME\" (default) CONC* Concentration data; \"CONC\" (default) DOSE* Dose given; (\"DOSE\" (default) ID* Subject ID; (\"ID\" (default) ROUTE* Route administration; \"ROUTE\" (default), can either \"iv bolus\", \"iv infusion\" \"extra-vascular\". Variants \"IV_bolus\" \"extravascular\" work well. DOSENUM Numeric dose (starting 1) used grouping multiple dose data; optional, NULL (default) single dose data) BACKEXTRAP Specifying number points use extrapolate initial concentration \"iv bolus\" dosing; optoinal f NULL (default) use value defined extrap_N (note value must <= NCA_min) SPARSEGROUP Column containing unique value grouping cohorts pooling data. Needed sparse set TRUE; optional, NULL (default) dsinc (CURRENTLY IMPLEMENTED) optional character vector columns dataset include output summary (default NULL)","code":"dsfilter = list(dose=c(1,2,5), dose_number = c(1))"},{"path":"https://r.ubiquity.tools/reference/system_nca_run.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Automatic NCA — system_nca_run","text":"cfg ubiquity system object NCA results analysis name specified: output/analysis_name-nca_summary-pknca.csv NCA summary output/analysis_name-pknca_summary.csv Raw output PKNCA subject dose number columns appended output/analysis_name-nca_data.RData objects containing NCA summary list ggplot grobs","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize NCA Results in Tabular Format — system_nca_summary","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"Creates tabular summaries NCA results","code":""},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"","code":"system_nca_summary( cfg, analysis_name = \"analysis\", treat_as_factor = c(\"ID\", \"Dose_Number\", \"Dose\"), params_include = c(\"ID\", \"cmax\", \"tmax\", \"auclast\"), params_header = NULL, rptname = \"default\", label_format = NULL, summary_stats = NULL, summary_labels = list(MEAN = \"Mean\", STD = \"Std Dev\", MEDIAN = \"Median\", N = \"N obs\", SE = \"Std Err.\"), summary_location = NULL, ds_wrangle = NULL, digits = 3, table_theme = \"theme_zebra\" )"},{"path":"https://r.ubiquity.tools/reference/system_nca_summary.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize NCA Results in Tabular Format — system_nca_summary","text":"cfg ubiquity system object analysis_name string containing name analysis (default 'analysis') previously run treat_as_factor sequence column names treated factors (default c(\"ID\", \"Dose_Number\", \"Dose\")). Use report values without added decimals. params_include vector names parameters include (default c(\"ID\", \"cmax\", \"tmax\", \"auclast\")) params_header list names parameters followed vector headers. can use placeholder \"

) reassigned parameter set (?). can altered scripting level using function.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"","code":"system_set_guess(cfg, pname, value, lb = NULL, ub = NULL)"},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"cfg ubiquity system object pname name parameter set value value assign lb optionally change lower bound (NULL) ub optionally change upper bound (NULL)","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"cfg ubiquity system object guess bounds assigned","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_guess.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Alter Initial Guess and Parameter Bounds — system_set_guess","text":"performing parameter estimation, initial guess value specified system.txt file currently selected parameter set. following command can used parameter set selected specify value (VALUE) parameter PNAME optionally lower (lb) upper (ub) bounds: set initial guess parameter Vc value 3, following used: specify guess overwrite upper bound Vc set 5","code":"cfg = system_set_guess(cfg, pname=\"PNAME\", value=VALUE, lb=NULL, ub=NULL) cfg = system_set_guess(cfg, \"Vc\", value=3) cfg = system_set_guess(cfg, \"Vc\", value=3, ub=5)"},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Variability Terms — system_set_iiv","title":"Set Variability Terms — system_set_iiv","text":"Set elements current variance covariance matrix specified system file ?, ?, ?, ?","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Variability Terms — system_set_iiv","text":"","code":"system_set_iiv(cfg, IIV1, IIV2, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Variability Terms — system_set_iiv","text":"cfg ubiquity system object IIV1 row name variance/covariance matrix IIV2 column name variance/covariance matrix element value value assign variance/covariance matrix element","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Variability Terms — system_set_iiv","text":"Ubiquity system object IIV information set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_iiv.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Variability Terms — system_set_iiv","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clearing all inputs cfg = system_zero_inputs(cfg) # Setting the covariance element for CL and Vc to 0.03 cfg = system_set_iiv(cfg, IIV1 = \"ETACL\", IIV2 = \"ETAVc\", value=0.03) # }"},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":null,"dir":"Reference","previous_headings":"","what":"Setting Analysis Options — system_set_option","title":"Setting Analysis Options — system_set_option","text":"Different options associated performing analyses (e.g running simulations, performing parameter estimation, logging, etc.) can set function","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setting Analysis Options — system_set_option","text":"","code":"system_set_option(cfg, group, option, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setting Analysis Options — system_set_option","text":"cfg ubiquity system object group options grouped together underlying activity performed: \"estimation\", \"general\", \"logging\", \"simulation\", \"solver\", \"stochastic\", \"titration\" option group set options value corresponding value option","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Setting Analysis Options — system_set_option","text":"Ubiquity system object option set","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_option.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Setting Analysis Options — system_set_option","text":"group=\"estimation\" default estimation R performed using either optim optimx libraries. selected setting optimizer option: optimization routine specified using method. default option set Nelder-Mead. different attributes selected using control. different methods control options, see documentation optim optimx libraries. perform global optimization can install either particle swarm (pso) genetic algorithm (GA) libraries. use particle swarm set optimizer method: control option list described pso documentation. use genetic algorithm set optimizer method: control option list list elements named options GA documentation. Use following example: alter initial guesses see: system_set_guess performing parameter estimation, internal function system_od_general used. function simulates system conditions defined different cohorts. pretty flexible want go beyond can set observation_function option: instruct optimziation routines use user defined function my_od. need construct function input/output format system_od_general. group=general \"output_directory\" = String analysis outputs placed. Generally wont want change , can useful Shiny apps need shiny user generate output users directory : file.path(\".\", \"output\") group=logging default ubiquity prints different information console logs information log file. following options can used control behavior: \"enabled\" = Boolean variable control logging: TRUE \"file\" = String containing name log file: file.path(\"transient\", \"ubiquity_log.txt\") \"timestamp\" = Boolean switch control appending time stamp log entries: TRUE \"ts_str\" = String format timestamp: \" \"debug\" = Boolean switch control debugging (see ): FALSE \"verbose\" = Boolean switch control printing console FALSE enable debugging different functions (like performing esitmation), set debug option TRUE. Important function calls trapped information logged reported console. group=\"simulation\" \"dynamic\" - Set TRUE (default) simulations behave normally. Set FALSE ODES evaulate zero. useful steady-state anslysis. \"include_important_output_times\" - Automatically add bolus, infusion rate switching times, etc: \"yes\"(default), \"\". \"integrate_with\" - Specify ODE solver use Rscript (\"r-file\") compiled C (\"c-file\"), build process can compile load C version default otherwise switch R script. \"output_times\" - Vector times evaulate simulation (default seq(0,100,1)). \"solver\" - Selects ODE solver: \"lsoda\" (default), \"lsode\", \"vode\", etc.; see documentation deSolve exhaustive list. \"sample_bolus_delta\" - Spacing used sampling around bolus events (default 1e-6). \"sample_forcing_delta\" - Spacing used sampling around forcing functions (infusion rates, covariates, etc) (default 1e-3). group=solver Depending solver, different options can set. documentation deSolve lists different solvers. full list options, see documentation specific solver (e.g. ?lsoda). common options consider : \"atol\" - Relative error tolerance \"rtol\" - Absolute error tolerance \"hmin\" - Minimum integration step size \"hmax\" - Maximum integration step size select vode solver set maximum step size 0.01, following used: group=\"stochastic\" running stochastic simulations (inter-individual variability applied system parameters) can useful specify following: \"ci\" - Confidence interval (default 95) \"nsub\" - Number subjects (default 100) \"seed\" - Seed random numebr generator (default 8675309) \"ponly\" - generate subject parameters run simulations (default FALSE) \"ssp\" - list calculated static secondary parameters include (default parameters defined <>) \"outputs\" - list predicted outputs include (default outputs defined ) \"states\" - list predicted states include(default states) \"sub_file\" - Name data set loaded (system_load_data) containing subject level parameters coviariates \"sub_file_sample\" - Controls subjects sampled dataset wanted generate 1000 subjects wanted parameters, use following: wanted exclude states secondary parameters, including output Cp_nM, following: pull subject information data file instead generating subject parameters IIV information sub_file option can used. value SUBFILE_NAME name given dataset loaded (system_load_data): Sampling dataset can controlled using sub_file_sample option: Sampling can done sequentially (\"sequential\"), replacement (\"replacement\"), without replacement (\"without replacement\") group=\"titration\" \"titrate\" - default titration disable (set FALSE). going use titration, enable setting option TRUE. force #' simulate_subjects use run_simulation_titrate internally running simulations.","code":"cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"optim\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"Nelder-Mead\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(trace = TRUE, maxit = 500, REPORT = 10)) cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"pso\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"psoptim\") cfg = system_set_option(cfg, group = \"estimation\", option = \"optimizer\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"method\", value = \"ga\") cfg = system_set_option(cfg, group = \"estimation\", option = \"control\", value = list(maxiter = 10000, optimArgs = list( method = \"Nelder-Mead\", maxiter = 1000))) cfg = system_set_option(cfg, group = \"estimation\", option = \"observation_function\", value = \"my_od\") cfg = system_set_option(cfg, group = \"estimation\", option = \"debug\", value = FALSE) cfg=system_set_option(cfg, group = \"simulation\", option = \"solver\", value = \"vode\") cfg=system_set_option(cfg, group = \"solver\", option = \"hmax\", value = 0.01) cfg = system_set_option(cfg, group = \"stochastic\", option = \"nsub \", value = 1000) cfg = system_set_option(cfg, group = \"stochastic\", option = \"ponly\", value = TRUE ) cfg = system_set_option (cfg, group = \"stochastic\", option = \"ssp\", value = list()) cfg = system_set_option (cfg, group = \"stochastic\", option = \"states\", value = list()) cfg = system_set_option (cfg, group = \"stochastic\", option = \"outputs\", value = c(\"Cp_nM\")) cfg=system_set_option(cfg, group = \"stochastic\", option = \"sub_file\", value = \"SUBFILE_NAME\") cfg=system_set_option(cfg, group = \"stochastic\", option = \"sub_file_sample\", value = \"with replacement\")"},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Value for Parameter — system_set_parameter","title":"Set Value for Parameter — system_set_parameter","text":"Assigns value named parameter parameter list.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Value for Parameter — system_set_parameter","text":"","code":"system_set_parameter(cfg, parameters, pname, value)"},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Value for Parameter — system_set_parameter","text":"cfg ubiquity system object parameters vector parameters pname parameter name value value","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Value for Parameter — system_set_parameter","text":"parameters vector pname set value","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_parameter.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Value for Parameter — system_set_parameter","text":"set parameter Vc value 3, following used:","code":"parameters = system_fetch_parameters(cfg) parameters = system_set_parameter(cfg, parameters, pname = 'Vc', value = 3)"},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Infusion Rate Inputs — system_set_rate","title":"Set Infusion Rate Inputs — system_set_rate","text":"Defines infusion rates specified system file using ","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Infusion Rate Inputs — system_set_rate","text":"","code":"system_set_rate(cfg, rate, times, levels)"},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Infusion Rate Inputs — system_set_rate","text":"cfg ubiquity system object rate name infusion rate times list time values levels corresponding list infusion values","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Infusion Rate Inputs — system_set_rate","text":"Ubiquity system object infusion rate set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_rate.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Infusion Rate Inputs — system_set_rate","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clearing all inputs cfg = system_zero_inputs(cfg) # 5 minute infusion at 10 mg/min cfg = system_set_rate(cfg, rate = \"Dinf\", times = c(0, 5), levels = c(10, 0)) # }"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"replace officer object ubiqiuty system object specified report name value supplied.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"","code":"system_set_rpt_officer_object(cfg, rpt = NULL, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"cfg ubiquity system object rpt officer report object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_officer_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sets the officer Object for the Specified ubiquity Report — system_set_rpt_officer_object","text":"ubiquity system object replaced officer object","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":null,"dir":"Reference","previous_headings":"","what":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"reset onbrand object ubiqiuty system object specified report name.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"","code":"system_set_rpt_onbrand_object(cfg, obnd = NULL, rptname = \"default\")"},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"cfg ubiquity system object obnd onbrand report object rptname ubiquity report name","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_rpt_onbrand_object.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Sets the onbrand Object for the Specified ubiquity Report — system_set_rpt_onbrand_object","text":"ubiquity system object onbrand report set","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":null,"dir":"Reference","previous_headings":"","what":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"prototype function SI_TT_BOLUS provides interface function. Based input SI_TT_BOLUS bolus inputs updated current titration time.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"","code":"system_set_tt_bolus( cfg, state, values, times, tt_ts, tsinfo, repdose = \"none\", interval = 1, number = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"cfg ubiquity system object state dosing state/compartment (Defined ) values vector dosing amounts (dosing units defined ) times vector dosing times relative current titration time (# time units defiend ) tt_ts list timescale values current titration time tsinfo list timescale information inputs (bolus, rates, etc) repdose \"none\", \"last\", \"\" interval interval repeat units defined number number times repeat","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_bolus.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Actual Function Called by SI_TT_BOLUS — system_set_tt_bolus","text":"ubiquity system object bolus dosing updated.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":null,"dir":"Reference","previous_headings":"","what":"Define Titration Triggers and Actions — system_set_tt_cond","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"rule defined using system_new_tt_rule, can used specifying checks titration time points , true, perform actions.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"","code":"system_set_tt_cond(cfg, name, cond, action, value = \"-1\")"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"cfg ubiquity system object name string containing name titration rule condition applies cond string evaluates boolean value TRUE action triggered action stringing evaluates done condition met (e.g. changing dose, state change, etc) value code stored titration history track condition triggered","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"Ubiquity system object titration condition defined","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_cond.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Define Titration Triggers and Actions — system_set_tt_cond","text":"general syntax setting new condition : name input associate condition previously defined rule. time defined rule created, condition (cond) evaluated. condition evaluates TRUE action evaluated. Lastly, condition action evaluated, value stored titration history. Multiple conditions can associated rule. internal titration history track one condition evaluated true, simulation output show last condition evaluated true. cond field string , evaluated, produce boolean value (TRUE FALSE). simply want force action times given rule can use: cond = \"TRUE\". Alternatively can provide mathematical expressions even complicated user defined functions. action field evaluated cond true. modify simulation going performed, want modify SIMINT_cfgtt variable using different system commands. Certain common tasks prototype functions created make easier user: SI_TT_BOLUS - Set bolus dosing SI_TT_RATE - Set infusion inputs SI_TT_STATE - Reset system states Note: Protype functions strings sometimes necessary specify strings within string. main string use double quotes (\") internal strings use single quotes (') SI_TT_BOLUS simplest way apply bolus condition true use following: values times vectors numbers equal length. dosing time units specified system.txt file delimiter. times relative titration time. 0 means titration time. ’s possible specify interval number times repeat last dose using following: give dose 5 titration point 2 time units later. dose 10 time 4 repeated 7 times every 4 time units. total 8 (7 + 1) doses 10 administered. Remember time units defined . input repdose can either ’last’ ’none’. Note: main string double quotes \" \" strings protype argument (e.g. ’last’) single quotes ’ ’. SI_TT_RATE created infusion named Dinf using infusion units min (times) mg/min (rates). 60 minute infusion 20 mg/min following: wanted every day 9 days (total 10 days) can repeat sequence: input repdose can either ’sequence’ ’none’. Note: time units dosing rate specified using . SI_TT_STATE provide fine control states titration points state reset prototype provided. example, modeling assay wash step want drop concentration zero. state named Cc defined system.txt want set 0.0 condition following action work. value number can use mathematical combination variables available titration environment. Also can create user function place function call within brackets . Titration Environment cond, action, value statements can use variables available titration environment. want perform complicated actions, can simply create user defined functions pass variables titration environment need. include named variables model well internal variables used control titration. States Parameters System parameters (

), static secondary parameters (<>) initial value covariates available. Also state values (current titration time) can used. available names specified system.txt file. Since system resets (SI_TT_STATE) processed first, changes made states values active actions. Internal Simulation Variables Internal variables used control titration activities. variables can also used conditions actions. SIMINT_p - list system parameters SIMINT_cfg - system configuration sent titration routine SIMINT_cfgtt- system configuration current titration event time SIMINT_ttimes - vector titration times (simulation units) SIMINT_ttime - current titration time (simulation units) SIMINT_tt_ts - list time scales current titration SIMINT_history - data frame tracking history conditions evaluated true following structure: tname - name titration rule value - value indicating condition satisfied simtime - simulation time rule/value triggered timescale - time rule timescale rule/value triggered Individual Simulations run individual titration simulation use following: provides output run_simulation_ubiquity two extra fields. first, som$titration, contains three columns titration rule. columns length equal corresponding simulation times. rule name rname, column headers following names meanings: tt.rname.value - Value rule active condition -1 triggered tt.rname.simtime - Simulation time last condition became active tt.rname.timescale - Simulation time time scale rule specified second field som$titration_history contains summary list titration events triggered. tname - Titration rule name value - Value rule active condition -1 triggered simtime - Simulation time last condition became active timescale - Simulation time time scale rule specified convert structured list data frame som_to_df command can used: run stochastic titration simulations, function used: add data list element called som$titration three fields titration rule: tt.rname.value - Value rule active condition -1 triggered tt.rname.simtime - Simulation time last condition became active tt.rname.timescale - Simulation time time scale rule specified fields matrix entry simulation time (column) subject (row). data structure can also converted data frame using som_to_df.","code":"cfg = system_new_tt_cond(cfg, name = \"rname\", cond = \"BOOLEAN EXPRESSION\", action = \"EXPRESSION\", value = \"VALUE\") action = \"SI_TT_BOLUS[state=’At’, values=c(10, 10, 10), times=c(0, 1, 2)]\" action = \"SI_TT_BOLUS[state = ’At’, values = c(5, 5, 10), times = c(0, 2, 4), repdose = ’last’, number = 7, interval = 4]\" action = \"SI_TT_RATE[rate=’Dinf’, times=c(0, 60), levels=c(20.0, 0)]\" action = \"SI_TT_RATE[rate = ’Dinf’, times = c(0, 60), levels = c(20, 0), repdose = ’sequence’, number = 9, interval = 24*60]\" action = \"SI_TT_STATE[Cc][0.0]\" som = run_simulation_titrate(parameters, cfg) sdf = som_to_df(cfg, som) som = simulate_subjects(parameters, cfg)"},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":null,"dir":"Reference","previous_headings":"","what":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"prototype function SI_TT_RATE provides abstract interface function. Based input SI_TT_RATE infusion rate inputs updated current titration time.","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"","code":"system_set_tt_rate( cfg, rate, times, levels, tt_ts, tsinfo, repdose = \"none\", interval = 1, number = 0 )"},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"cfg ubiquity system object rate name infusion rate update(Defined ) times vector switching times relative current titration time (time units defined ) levels vector infusion rates (dosing units defined ) tt_ts list timescale values current titration time tsinfo list timescale information inputs (bolus, rates, etc) repdose \"none\" \"sequence\" interval interval repeat units defined number number times repeat","code":""},{"path":"https://r.ubiquity.tools/reference/system_set_tt_rate.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Actual Function Called by SI_TT_RATE — system_set_tt_rate","text":"ubiquity system object infusion rates updated.","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":null,"dir":"Reference","previous_headings":"","what":"Simulate Results at Estimates — system_simulate_estimation_results","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"Simulates system parameter estimates pest creating diagnostic plots","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"","code":"system_simulate_estimation_results(pest, cfg, details = FALSE)"},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"pest vector parameters cfg ubiquity system object details set TRUE display information cohorts simulated (useful debugging)","code":""},{"path":"https://r.ubiquity.tools/reference/system_simulate_estimation_results.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Simulate Results at Estimates — system_simulate_estimation_results","text":"observations list, see system_od_general estimation=FALSE","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"converts time specified defined timescale (say weeks) timescale simulation (say hours rates 1/hr units)","code":""},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"","code":"system_ts_to_simtime(cfg, tstime, ts)"},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"cfg ubiquity system object tstime numeric time timescale ts string containing timescale","code":""},{"path":"https://r.ubiquity.tools/reference/system_ts_to_simtime.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Time in Timescale to Simulation Time — system_ts_to_simtime","text":"tstime system timescale units","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":null,"dir":"Reference","previous_headings":"","what":"View Information About the System — system_view","title":"View Information About the System — system_view","text":"Displays information (dosing, simulation options, covariates, etc) system.","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"View Information About the System — system_view","text":"","code":"system_view(cfg, field = \"all\", verbose = FALSE)"},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"View Information About the System — system_view","text":"cfg ubiquity system object field string indicating aspect system display verbose Boolean variable set true echo information screen","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"View Information About the System — system_view","text":"sequence strings system formation (one line per element) field \"\" show information system \"parameters\" summary parameter information \"bolus\" currently set bolus dosing \"rate\" infusion rate dosing \"covariate\" covariates \"iiv\" variance/covariance information \"datasets\" loaded datasets \"simulation\" simulation options \"estimation\" estimation options \"nca\" non-compartmental analyses performed","code":""},{"path":"https://r.ubiquity.tools/reference/system_view.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"View Information About the System — system_view","text":"","code":"# To log and display the current system information: # \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") msgs = system_view(cfg, verbose=TRUE) #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' %s, %s(%s)' #> Warning: one argument not used by format ' ' #> → Parameter Information #> → Parameter set selected: #> → Short Name: default #> → Description: mAb in Humans #> → Default parameters for current set: #> → name | value | units #> → ---------------------------------------------------- #> → F1 | 0.7440 | --- #> → ka | 0.2820 | 1/day #> → CL | 0.2000 | L/day #> → Vc | 3.6100 | L #> → Vp | 2.7500 | L #> → Q | 0.7470 | L/day #> → MW | 140.0000 | kD #> → prop_err | 0.1000 | -- #> → add_err | 0.1000 | ng/ml #> → ---------------------------------------------------- #> → #> → Bolus dosing details #> → field | values | scaling | units #> → -------------------------------------------------- #> → times | 0 7 14 | 1 | days #> → Cc | 0 0 0 | 1e3/MW/Vc | mg #> → At | 400 0 0 | 1e3/MW | mg #> → -------------------------------------------------- #> → Infusion rate details #> → Rate | field | values | scaling | units #> → ----------------------------------------------------------------- #> → Dinf | time | 0 30 | 1/60/24 | min #> → | levels | 0 0 | 60*24*1e3/MW | mg/min #> → ----------------------------------------------------------------- #> → #> → Covariate details #> → Covariate | field | values | units #> → -------------------------------------------------- #> → DOSE | time | 0 | day #> → (step) | levels | 400 | mg #> → WT | time | 0 | day #> → (step) | levels | 60 | kg #> → -------------------------------------------------- #> → #> → IIV details #> → IIV/Parameter set: #> → Short Name: default #> → Variance/covariance matrix #> → #> → ETAka ETACL ETAVc ETAVp ETAQ #> → ETAka 0.4160 0 0 0 0 #> → ETACL 0 0.0988 0.0786 0.0619 0 #> → ETAVc 0 0.0786 0.1160 0.0377 0 #> → ETAVp 0 0.0619 0.0377 0.0789 0 #> → ETAQ 0 0 0 0 0.6990 #> → #> → On parameters #> → ka, ETAka(LN) #> → CL, ETACL(LN) #> → Q, ETAQ(LN) #> → Vc, ETAVc(LN) #> → Vp, ETAVp(LN) #> → #> → integrate_with c-file #> → output_times min = 0; max = 10.0; length = 101 #> → No datasets loaded #> → #> → Estimation details #> → Parameter set: default #> → Parameters estimated: F1, ka, CL, Vc, Vp, Q, MW, prop_err, add_err #> → objective_type ml #> → observation_function system_od_general #> → No cohort information found #> → No NCA has been performed # }"},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":null,"dir":"Reference","previous_headings":"","what":"Zero All Model Inputs — system_zero_inputs","title":"Zero All Model Inputs — system_zero_inputs","text":"Multiple default inputs can specified system file. scripting level function can used set inputs zero. subsequently specified inputs applied.","code":""},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Zero All Model Inputs — system_zero_inputs","text":"","code":"system_zero_inputs(cfg, bolus = TRUE, rates = TRUE)"},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Zero All Model Inputs — system_zero_inputs","text":"cfg ubiquity system object bolus Boolean value indicating weather bolus inputs set zero rates Boolean value indicating weather infusion rate inputs set zero","code":""},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Zero All Model Inputs — system_zero_inputs","text":"Ubiquity system object specified inputs set zero","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/system_zero_inputs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Zero All Model Inputs — system_zero_inputs","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Clear only infusion rates cfg = system_zero_inputs(cfg, bolus=TRUE, rates=FALSE) # Clear all inputs: cfg = system_zero_inputs(cfg) # }"},{"path":"https://r.ubiquity.tools/reference/tic.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of Matlab tic() command — tic","title":"Implementation of Matlab tic() command — tic","text":"Used conjunction toc() find elapsed time code executed.","code":""},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of Matlab tic() command — tic","text":"","code":"tic(type = c(\"elapsed\", \"user.self\", \"sys.self\"))"},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Implementation of Matlab tic() command — tic","text":"type can either \"elapsed\" \"user.self\" \"sys.self\"","code":""},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of Matlab tic() command — tic","text":"time tic called","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/tic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of Matlab tic() command — tic","text":"","code":"tic() Sys.sleep(3) toc() #> elapsed #> 3.011"},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"Given matrix (d) time courses (row individual column time point) confidence interval (ci) calculate mean, median, confidence intervals vector values creating patches.","code":""},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"","code":"timecourse_stats(d, ci)"},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"d matrix responses (row individual column time point) ci confidence interval percent (eg, 95)","code":""},{"path":"https://r.ubiquity.tools/reference/timecourse_stats.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate Timecourse Statistics for a Matrix of Responses — timecourse_stats","text":"List following elements: stats$ub_ci vector confidence interval upper bound stats$lb_ci vector confidence interval lower bound stats$mean vector mean values stats$median vector median values","code":""},{"path":"https://r.ubiquity.tools/reference/toc.html","id":null,"dir":"Reference","previous_headings":"","what":"Implementation of Matlab toc() command — toc","title":"Implementation of Matlab toc() command — toc","text":"Used conjunction tic() find elapsed time code executed.","code":""},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Implementation of Matlab toc() command — toc","text":"","code":"toc()"},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Implementation of Matlab toc() command — toc","text":"time seconds since tic() called","code":""},{"path":[]},{"path":"https://r.ubiquity.tools/reference/toc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Implementation of Matlab toc() command — toc","text":"","code":"tic() Sys.sleep(3) toc() #> elapsed #> 3.01"},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"Checks names specified different analysis aspects (cohorts, analyses, reports, etc.) make sure start letter contain letters, numbers _","code":""},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"","code":"ubiquity_name_check(test_name)"},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"test_name string containing name tested","code":""},{"path":"https://r.ubiquity.tools/reference/ubiquity_name_check.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Names of Cohorts, Analyses, Reports, etc. — ubiquity_name_check","text":"List Boolean element isgood TRUE name tests correct, FALSE fails. element msgs contains verbose message fails.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":null,"dir":"Reference","previous_headings":"","what":"Converts Numeric Variables into Padded Strings — var2string","title":"Converts Numeric Variables into Padded Strings — var2string","text":"Mechanism converting numeric variables strings reporting.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Converts Numeric Variables into Padded Strings — var2string","text":"","code":"var2string(vars, maxlength = 0, nsig_e = 3, nsig_f = 4)"},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Converts Numeric Variables into Padded Strings — var2string","text":"vars numeric variable vector numeric variables maxlength value greater zero spaces added beginning string total length equal maxlength nsig_e number significant figures scientific notation nsig_f number significant figures numbers (2.123)","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Converts Numeric Variables into Padded Strings — var2string","text":"Number string padded","code":""},{"path":"https://r.ubiquity.tools/reference/var2string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Converts Numeric Variables into Padded Strings — var2string","text":"","code":"var2string(pi, nsig_f=20) #> [1] \"3.14159265358979311600\" var2string(.0001121, nsig_e=2, maxlength=10) #> [1] \" 1.12e-04\""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert R Objects to Strings — var2string_gen","title":"Convert R Objects to Strings — var2string_gen","text":"Mechanism converting R objects strings reporting.","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert R Objects to Strings — var2string_gen","text":"","code":"var2string_gen(var)"},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert R Objects to Strings — var2string_gen","text":"var R variable","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert R Objects to Strings — var2string_gen","text":"Variable string form","code":""},{"path":"https://r.ubiquity.tools/reference/var2string_gen.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert R Objects to Strings — var2string_gen","text":"","code":"var2string_gen(c(1,2,3)) #> [1] \"min = 1.0; max = 3.0; length = 3 \""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":null,"dir":"Reference","previous_headings":"","what":"Print and Log Messages — vp","title":"Print and Log Messages — vp","text":"Used print messages screen log file.","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print and Log Messages — vp","text":"","code":"vp(cfg, str, fmt = \"alert\")"},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print and Log Messages — vp","text":"cfg ubiquity system object str sequence strings print fmt string format one following: \"h1\", \"h2\", \"h3\", \"verbatim\", \"alert\" (default), \"warning\", \"danger\".","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print and Log Messages — vp","text":"Boolean variable indicating success (TRUE) failure (FALSE)","code":""},{"path":"https://r.ubiquity.tools/reference/vp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print and Log Messages — vp","text":"","code":"# \\donttest{ # Creating a system file from the mab_pk example fr = system_new(file_name = \"system.txt\", system_file = \"mab_pk\", overwrite = TRUE, output_directory = tempdir()) # Building the system cfg = build_system(system_file = file.path(tempdir(), \"system.txt\"), output_directory = file.path(tempdir(), \"output\"), temporary_directory = tempdir()) #> #> ── Building the system: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms #> → ubiquity: https://r.ubiquity.tools #> → Distribution: package (2.1.0) #> → Compiling C version of system #> → Loading the shared C library #> ✔ System built #> ℹ To fetch a new analysis template use `system_fetch_template` #> ℹ For example: #> ℹ fr = system_fetch_template(cfg, template = \"Simulation\") #> ℹ fr = system_fetch_template(cfg, template = \"Estimation\") # Initialzing the log file vp(cfg, \"Message that will be logged\") #> → Message that will be logged #> [1] TRUE # }"},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch Ubiquity Workshop Sections — workshop_fetch","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"ubiquity package function can used fetch example files different sections workshop.","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"","code":"workshop_fetch( section = \"Simulation\", overwrite = FALSE, copy_files = TRUE, output_directory = getwd() )"},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"section Name section workshop retrieve (\"Simulation\") overwrite TRUE new workshop files overwrite existing files present (FALSE) copy_files TRUE files written output_directory, FALSE names locations files returned (TRUE) output_directory directory workshop files placed (getwd())","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"list","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"Valid sections \"Simulation\", \"Estimation\", \"Vitro\", \"Titration\" \"Reporting\", \"NCA\"","code":""},{"path":"https://r.ubiquity.tools/reference/workshop_fetch.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch Ubiquity Workshop Sections — workshop_fetch","text":"","code":"# \\donttest{ workshop_fetch(\"Estimation\", output_directory=tempdir(), overwrite=TRUE) #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite_global.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/analysis_parent_metabolite_nm_data.r #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/system.txt #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/pm_data.csv #> → Creating file: /var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T//Rtmpms4SZn/nm_data.csv #> $sources #> [1] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent.r\" #> [2] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite.r\" #> [3] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite_global.r\" #> [4] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/scripts/analysis_parent_metabolite_nm_data.r\" #> [5] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/systems/system-adapt.txt\" #> [6] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/csv/pm_data.csv\" #> [7] \"/private/var/folders/pq/7srbf_fx3rd3k706hgxkg61r0000gp/T/Rtmp0OZXtm/temp_libpathf4131265fbf/ubiquity/ubinc/csv/nm_data.csv\" #> #> $destinations #> [1] \"analysis_parent.r\" #> [2] \"analysis_parent_metabolite.r\" #> [3] \"analysis_parent_metabolite_global.r\" #> [4] \"analysis_parent_metabolite_nm_data.r\" #> [5] \"system.txt\" #> [6] \"pm_data.csv\" #> [7] \"nm_data.csv\" #> #> $write_file #> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE #> #> $isgood #> [1] TRUE #> # }"},{"path":[]},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-1-0","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.1.0 (development version)","text":"Removed NONMEM Monolix outputs Added translation nlmixr2 output NONMEM Monolix outputs Added simulation option dynamic set TRUE default set FALSE fix ODEs 0 allow vitro analysis. Applying variance models cohort definitions. Fixed issue initial conditions passed nlmixr2 output.","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-203","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.3","title":"ubiquity 2.0.3","text":"CRAN release: 2024-03-08","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-3","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.3","text":"Fixed IIV comments breaking nlmixr2 output Fixed bug spaces breaking compilation C output Fixed bug CRAN flextable/officer update broke saved values vignettes","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-201","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.1","title":"ubiquity 2.0.1","text":"CRAN release: 2023-10-29","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-1","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.1","text":"Removed internal files longer used Added documentation creating user defined observation functions running parameter estimation Updated reporting template work development version onbrand Changed terminal messaging use cli Added termination criteria estimation output Fixed wrapping issue Fortran output unwrappable strings resulted infinite loop Added system-testing.txt example Added nlmxir output target Added template creation NONMEM, Monolix, nlmixr Fixed R command compilation use R.home() Fixed broken tests Updated CITATION use bibentry Fixing error building systems windows","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-200","dir":"Changelog","previous_headings":"","what":"ubiquity 2.0.0","title":"ubiquity 2.0.0","text":"CRAN release: 2021-09-03","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-2-0-0","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 2.0.0","text":"Lots small updates function documentation vignettes Completely replaced reporting functionality. Now using onbrand package templated reporting. Note: break reporting version 1 R package. Old Word PowerPoint templates work, need create yaml mapping file. detailed Reporting vignette. Reporting changes added following functions system_rpt_add_slide() system_rpt_add_doc_content() system_rpt_read_template() system_rpt_save_report() system_rpt_template_details() system_fetch_rpt_officer_object() system_fetch_rpt_onbrand_object() system_set_rpt_officer_object() system_set_rpt_onbrand_object() Reporting changes removed following functions: system_report_doc_add_content() system_report_doc_format_section() system_report_doc_set_ph() system_report_estimation() system_report_glp() system_report_init() system_report_nca() system_report_ph_content() system_report_save() system_report_set() system_report_slide_content() system_report_slide_section() system_report_slide_title() system_report_slide_two_col() system_report_view_layout() system_fetch_report() system_fetch_report_format() md_to_officer() md_to_oo() Reporting changes updated vignettes, example scripts function templates","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-104","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.4","title":"ubiquity 1.0.4","text":"CRAN release: 2021-04-18","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-1-0-4","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 1.0.4","text":"Renamed system_report_fetch system_fetch_report Added reporting scripts unit tests Added import officer functions starting body_end_ Changed table figure captions numbered Word reporting Created testthat scripts run workshop functions","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"new-features-1-0-4","dir":"Changelog","previous_headings":"","what":"New Features","title":"ubiquity 1.0.4","text":"Added shaded region observed AUC NCA reporting Added cohort-specific output times option estimation workflow Updated references documentation templates point r.ubiquity.tools Added checks estimation routines check reasonable bounds global optimizer notify users estimates near bounds Added sessionInfo() estimation Word reporting Added system_fetch_report_format Integrated markdown (md) header format option flextable outputs Added default cfg$reporting$enabled (FALSE) Added ability use markdown NCA summary tables generated system_nca_summary Fixed placeholder text, now delimiters ===either side text Added system_set_option general group output_directory option markdown Word reporting, default font properties defined ability specify org_functions.R template added. Moved annotated layout generation PowerPoint files system_report_view_layout() annotate_base() command officer Added optional key fields tables figures Word reporting Added ability pass PKNCA.options system_nca_run Added verbose option system_view command Allowing pass dataset columns summary NCA output Updated system_report_ph_content system_report_doc_add_content allow inclusion flextable objects Updated system_view include nca results system_fetch_nca - function fetch NCA results system_fetch_nca_columns - function fetch column descriptors specific analysis system_nca_parameters_meta - list standard NCA parameters system_nca_summary - creates summary tables NCA results Adding checks simulate_subjects ensure required columns present Added ability read xlsx data sets system_load_data","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-4","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.4","text":"CRAN erroring tic() function. Removed tic() toc() functions Fixed bug dataset given system_run_nca enough valid data actually run NCA Fixed “Coordinate system already present…” warning gg_axis Fixed location table generation example script analysis_nca_md.R table styles picked properly Added scales package requirement Fixed missing rptname inputs system_report_ph_content Fixed Bug system view cohort-specific parameters defined Fixed figure generation errors estimation workflow Fixed bug system_report_save() Removed aberrant gdata require calls templates Fixed bug system_nca_run DOSE factor Fixed bug system_nca_run back extrapolation done doses skipped due insufficient points. causing error. Removed coercion warnings: tmpsumhalflife = NCA.resresult[NCA.resresultPPTESTCD == “half.life”, : Coercing LHS list Removed digits input system_nca_run (now handled system_nca_summary ) Fixed coercion warnings covariates building system Using explicit declaration officer functions specifying importFrom prevent namespace issues readxl allow function readxl::read_xlsx","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-103","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.3","title":"ubiquity 1.0.3","text":"CRAN release: 2020-09-13","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"notes-1-0-3","dir":"Changelog","previous_headings":"","what":"Notes","title":"ubiquity 1.0.3","text":"Removed gdata dependency Removed URL redirects documentation resolve CRAN submission warnings","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"new-features-1-0-3","dir":"Changelog","previous_headings":"","what":"New Features","title":"ubiquity 1.0.3","text":"Added option simulate subjects specify secondary parameters saved","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-3","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.3","text":"Converted system_nca_run() using $ mostly using [[“”]] Fixed NCA template Fixed bug ShinyApp template iiv tab displayed even system iiv elements","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"ubiquity-102","dir":"Changelog","previous_headings":"","what":"ubiquity 1.0.2","title":"ubiquity 1.0.2","text":"CRAN release: 2020-07-05","code":""},{"path":"https://r.ubiquity.tools/news/index.html","id":"bug-fixes-1-0-2","dir":"Changelog","previous_headings":"","what":"Bug Fixes","title":"ubiquity 1.0.2","text":"Updated components fix issues encountered R 4.0","code":""}] diff --git a/inst/ubinc/scripts/ubiquity_fcns.R b/inst/ubinc/scripts/ubiquity_fcns.R index 22de9bb..c5b39af 100644 --- a/inst/ubinc/scripts/ubiquity_fcns.R +++ b/inst/ubinc/scripts/ubiquity_fcns.R @@ -758,6 +758,8 @@ system_fetch_template <- function(cfg, template="Simulation", overwrite=FALSE, write_file = c(TRUE) } if(template == "NONMEM" || template == "Monolix" ){ + # Needed because capture is created in an eval + capture = NULL deps_found = TRUE # Walking through the dependencies to make sure everything is needed if(system.file(package="rxode2") == ""){