tensfeldt / openNCA

openNCA computation engine is an R package that provides for generation of pharmacokinetic parameter estimates using non-compartmental (NCA) pharmacokinetic analysis methods.
MIT License
27 stars 5 forks source link

DOSEC is not being computed nor any dependent parameters with CONC specified in NGEQ/ML #280

Open tensfeldt opened 3 years ago

tensfeldt commented 3 years ago

tc1909_M1SD illustrates an issue with DOSEC not being computed at all when CONC units are set to NGEQ/ML and DOSEOUTPUTUNIT set to MG. Nanogram-equivalents are not recognized by the DOSEC nor units_conversion code.

Output from tc1909_M1SD illustrates this with commit c3d3f48 (v3 production candidate) as well as current v1 production commit f5bf3ca.

Note that setting mct$DOSEOUTPUTUNIT to "NGEQ" has no impact on the results except that DOSE in parameter outputs is then all "NA", i.e. missing.

> #' Check Clearance computation  
> #' Note that DOSEC wasn't computed so needs to be computed manually here  
> #' Input concentration dataset `r mct$DOSE` and `r mct$DOSEU`  
> knitr::kable(d[!duplicated(d$SDEID),c(mct$DOSE, mct$DOSEU)])

|   |     DOSE|DOSEUNI |
|:--|--------:|:-------|
|76 | 50.08542|MG      |
|46 | 49.36096|MG      |
|61 | 49.08420|MG      |
|31 | 49.90634|MG      |
|1  | 49.24700|MG      |
|16 | 49.64586|MG      |
> #' Parameter Results dataset `r mct$DOSE` and `r mct$DOSEU`  
> knitr::kable(r[,c(mct$DOSE, mct$DOSEU, "DOSEC")])

|     DOSE|DOSEUNI | DOSEC|
|--------:|:-------|-----:|
| 50.08542|MG      |    NA|
| 49.36096|MG      |    NA|
| 49.08420|MG      |    NA|
| 49.90634|MG      |    NA|
| 49.24700|MG      |    NA|
| 49.64586|MG      |    NA|
> 
> #' Concentration is in `r unique(d[,mct$CONCU])`
> #' Compute DOSEC relative to DOSE units of `r unique(d[,mct$DOSEU])`
> #'
> r$DOSEC.NGEQ <- r$DOSE * 10^6
> knitr::kable(r[,c(mct$DOSE, mct$DOSEU, "DOSEC", "DOSEC.NGEQ")])

|     DOSE|DOSEUNI | DOSEC| DOSEC.NGEQ|
|--------:|:-------|-----:|----------:|
| 50.08542|MG      |    NA|   50085420|
| 49.36096|MG      |    NA|   49360960|
| 49.08420|MG      |    NA|   49084200|
| 49.90634|MG      |    NA|   49906340|
| 49.24700|MG      |    NA|   49247000|
| 49.64586|MG      |    NA|   49645860|
> 
> #' Compute CLFO/CLFOW/CLFP/CLFPW manually
> #' CLFO.L_HR in NGEQ/ML/`r mct$AUCOUTPUTUNIT` and mct\$CLOUTPUTUNIT is specified in `r mct$CLOUTPUTUNIT`  
> r$CLFO.L_HR <- r$DOSEC.NGEQ/r$AUCINFO/1000
> r$CLFP.L_HR <- r$DOSEC.NGEQ/r$AUCINFP/1000
> #' Body Size Normalization is in `r unique(d[,mct$NORMBSU])` and target output unit mct\$CLNORMOUTPUTUNIT is `r mct$CLNORMOUTPUTUNIT`   
> r$CLFOW.L_HR_KG <- r$CLFO.L_HR / r[,mct$NORMBS]
> r$CLFPW.L_HR_KG <- r$CLFP.L_HR / r[,mct$NORMBS]
> #' Display CLFO/CLFOW/CLFP/CLFPW parameter results  
> knitr::kable(r[,c(mct$DOSE, mct$DOSEU, "DOSEC", "DOSEC.NGEQ", "CLFO", "CLFO.L_HR", "CLFP", "CLFP.L_HR", "CLFOW", "CLFOW.L_HR_KG", "CLFPW.L_HR_KG")])

|     DOSE|DOSEUNI | DOSEC| DOSEC.NGEQ| CLFO| CLFO.L_HR| CLFP| CLFP.L_HR| CLFOW| CLFOW.L_HR_KG| CLFPW.L_HR_KG|
|--------:|:-------|-----:|----------:|----:|---------:|----:|---------:|-----:|-------------:|-------------:|
| 50.08542|MG      |    NA|   50085420|   NA|  38.71584|   NA|  38.76055|    NA|     0.4354987|     0.4360017|
| 49.36096|MG      |    NA|   49360960|   NA|  17.26629|   NA|  17.40689|    NA|     0.2330133|     0.2349108|
| 49.08420|MG      |    NA|   49084200|   NA|  20.63520|   NA|  20.52523|    NA|     0.2622008|     0.2608034|
| 49.90634|MG      |    NA|   49906340|   NA|  30.89920|   NA|  30.90392|    NA|     0.3916248|     0.3916847|
| 49.24700|MG      |    NA|   49247000|   NA|  22.44856|   NA|  23.06805|    NA|     0.3202363|     0.3290735|
| 49.64586|MG      |    NA|   49645860|   NA|  29.63951|   NA|  29.53431|    NA|     0.3068272|     0.3057382|
> 
> #' Compute VZFO/VZFOW/VZFP/VZFPW manually  
> #' Target output unit mct\$VOLUMEOUTPUTUNIT is `r mct$VOLUMEOUTPUTUNIT` 
> r$VZFO.L <- r$CLFO.L_HR/r$KEL
> r$VZFP.L <- r$CLFP.L_HR/r$KEL
> #' Body Size Normalization is in `r unique(d[,mct$NORMBSU])` and target output unit mct\$VOLUMENORMOUTPUTUNIT is `r mct$VOLUMENORMOUTPUTUNIT`   
> r$VZFOW.L_KG <- r$VZFO.L / r[,mct$NORMBS]
> r$VZFPW.L_KG <- r$VZFP.L / r[,mct$NORMBS]
> #' Display VZFO/VZFOW/VZFP/VZFPW parameter results  
> knitr::kable(r[,c(mct$DOSE, mct$DOSEU, "DOSEC", "DOSEC.NGEQ", "CLFO", "CLFO.L_HR", "CLFP", "CLFP.L_HR", "CLFOW", "CLFOW.L_HR_KG", "CLFPW.L_HR_KG", "VZFO", "VZFO.L", "VZFP", "VZFP.L", "VZFOW.L_KG", "VZFPW.L_KG")])

|     DOSE|DOSEUNI | DOSEC| DOSEC.NGEQ| CLFO| CLFO.L_HR| CLFP| CLFP.L_HR| CLFOW| CLFOW.L_HR_KG| CLFPW.L_HR_KG| VZFO|   VZFO.L| VZFP|   VZFP.L| VZFOW.L_KG| VZFPW.L_KG|
|--------:|:-------|-----:|----------:|----:|---------:|----:|---------:|-----:|-------------:|-------------:|----:|--------:|----:|--------:|----------:|----------:|
| 50.08542|MG      |    NA|   50085420|   NA|  38.71584|   NA|  38.76055|    NA|     0.4354987|     0.4360017|   NA| 212.4565|   NA| 212.7019|   2.389837|   2.392597|
| 49.36096|MG      |    NA|   49360960|   NA|  17.26629|   NA|  17.40689|    NA|     0.2330133|     0.2349108|   NA| 235.4740|   NA| 237.3915|   3.177787|   3.203664|
| 49.08420|MG      |    NA|   49084200|   NA|  20.63520|   NA|  20.52523|    NA|     0.2622008|     0.2608034|   NA| 228.8416|   NA| 227.6220|   2.907771|   2.892275|
| 49.90634|MG      |    NA|   49906340|   NA|  30.89920|   NA|  30.90392|    NA|     0.3916248|     0.3916847|   NA| 210.5745|   NA| 210.6067|   2.668878|   2.669286|
| 49.24700|MG      |    NA|   49247000|   NA|  22.44856|   NA|  23.06805|    NA|     0.3202363|     0.3290735|   NA| 129.9738|   NA| 133.5606|   1.854120|   1.905286|
| 49.64586|MG      |    NA|   49645860|   NA|  29.63951|   NA|  29.53431|    NA|     0.3068272|     0.3057382|   NA| 231.5452|   NA| 230.7234|   2.396948|   2.388441|