Git Product home page Git Product logo

opennca's People

Contributors

opennca avatar tensfeldt avatar thomas-g-tensfeldt avatar tomtensfeldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opennca's Issues

run_computation.R refers to AUCINFOi/AUCINFPi as AUINFOi/AUINFPi in select circumstances

in run_computation.R: the following code needs updating

  1. ```
    

if("MRTEVIFPi" %in% parameter_list && (!"AUCINFPi" %in% parameter_list || !"AUCTAUi" %in% parameter_list || !"AUMCTAUi" %in% parameter_list)){
if(!"AUCINFPi" %in% parameter_list){
parameter_list[[length(parameter_list)+1]] <- "AUINFPi"
}


to 

if("MRTEVIFPi" %in% parameter_list && (!"AUCINFPi" %in% parameter_list || !"AUCTAUi" %in% parameter_list || !"AUMCTAUi" %in% parameter_list)){
if(!"AUCINFPi" %in% parameter_list){
parameter_list[[length(parameter_list)+1]] <- "AUCINFPi"
}


2)

if("MRTEVIFOi" %in% parameter_list && (!"AUCINFOi" %in% parameter_list || !"AUCTAUi" %in% parameter_list || !"AUMCTAUi" %in% parameter_list)){
if(!"AUCINFOi" %in% parameter_list){
parameter_list[[length(parameter_list)+1]] <- "AUINFOi"
}


to
    ```
if("MRTEVIFOi" %in% parameter_list && (!"AUCINFOi" %in% parameter_list || !"AUCTAUi" %in% parameter_list || !"AUMCTAUi" %in% parameter_list)){
      if(!"AUCINFOi" %in% parameter_list){
        parameter_list[[length(parameter_list)+1]] <- "**AUCINFOi**"
      }

2019-11-20 tc014 M2SS - ctrough computation crashes

running tc014 with CTROUGHi specified through PARAMETERLIST causes crash:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in ctrough(conc = tmp_di_df[, map_data$CONC], time = tmp_di_df[, : object 'tmp_di_df' not found
For SDEID 50896291
In addition: Warning message:
In run_M2_SS_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in ctrough(conc = tmp_di_df[, map_data$CONC], time = tmp_di_df[, : object 'tmp_di_df' not found
For SDEID 50896291 

There's nothing obviously distinct about SDEID==50896291

       SDEID   SUBJID PKDATAROWID    STUDY SITEID RAND TREATXT TRTCD PKCOLL PKBDFLD     PKTERM PERIODU PERIOD VISITU VISIT PHASE        PKACES PKSCOM PKUSMID PKSAMQA NTPDU PKAACES
108 50896291 10021020    28860392 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA PK30-01863171      0     690   FINAL  Hour     687
109 50896291 10021020    28860393 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA  PK1-01863181      0     691   FINAL  Hour     688
110 50896291 10021020   -28860394 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA PK24-01863112      0     692   FINAL  Hour     689
111 50896291 10021020   -28860396 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA   PK-01863136      0     694   FINAL  Hour     690
112 50896291 10021020   -28860400 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA   PK-01863135      0     698   FINAL  Hour     694
113 50896291 10021020   -28860411 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA   PK-01863137      0     709   FINAL  Hour     705
114 50896291 10021020   -28860414 A4021010   1002 2020      NA  9999  POINT  Plasma CP-751,871   Cycle      4    Day     1    NA PK30-01863192      0     712   FINAL  Hour     708
    PKACOM PKAMT PKAMTU  PKCNC PKCNCU PKCOML PKPTMR NTPDMN PKCNCN PKPTM PKPTMI PKPTMS PKPTME PKPTMU PKCOMC PKATM      PKADT PKSMND PKND PKSMMSU PKSMMS PKSMVLU PKSMVL PKATME PKADTE
108     NA     0     NA 198000  ng/mL     NA      0     NA 198000   0HR     NA      0     NA     HR     NA  1026 01 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
109     NA     0     NA 843000  ng/mL     NA      1     NA 843000   1HR     NA      1     NA     HR     NA  1653 01 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
110     NA     0     NA 536000  ng/mL     NA     24     NA 536000  24HR     NA     24     NA     HR     NA  1556 02 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
111     NA     0     NA 481000  ng/mL     NA     NA     NA 481000           NA     NA     NA     HR     NA  1236 04 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
112     NA     0     NA 333000  ng/mL     NA     NA     NA 333000           NA     NA     NA     HR     NA  1140 08 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
113     NA     0     NA 208000  ng/mL     NA     NA     NA 208000           NA     NA     NA     HR     NA   950 22 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
114     NA     0     NA 225000  ng/mL     NA      0     NA 225000   0HR     NA    672     NA     HR     NA  1021 29 11 2007   DONE DONE      NA     NA      NA     NA     NA     NA
    DOSE DOSEUNI           COHORT DOSE.FREQ INF.START PTINIT HT WT AGEDERU AGEDER WTUNI WTRAW HTUNI HTRAW RACEOTH RACES SEX DOB RACIALD ETHNIC    DRGDATE DOSETIM
108 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
109 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
110 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
111 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
112 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
113 1106      MG 20 MG/KG RP2D ES         4     11:11     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
114 1102      MG 20 MG/KG RP2D ES         4     10:46     NA NA NA      NA     NA    NA    NA    NA    NA      NA    NA  NA  NA      NA     NA 01 11 2007    1558
                        ACTTRT ACTTRTS ACTTRTC  PKATPD PKATPDU PKATPDE PKATPDEU                                PKDCOM LCDF C0 CONC.BC CONC.BCU PKCNC.BC            PKTERM.BC ACONC
108 CP-751,871 dose escalation       A      NA   0.000      HR      NA       HR                                          Y  0     198     MG/L      198 CP-751,871_Corrected   198
109 CP-751,871 dose escalation       A      NA   0.917      HR      NA       HR                                          Y  0     843     MG/L      843 CP-751,871_Corrected   843
110 CP-751,871 dose escalation       A      NA  23.967      HR      NA       HR                    Map Day 2 to Day 1    Y  0     536     MG/L      536 CP-751,871_Corrected   536
111 CP-751,871 dose escalation       A      NA      NA      HR      NA       HR                    Map Day 4 to Day 1    Y  0     481     MG/L      481 CP-751,871_Corrected   481
112 CP-751,871 dose escalation       A      NA      NA      HR      NA       HR                    Map Day 8 to Day 1    Y  0     333     MG/L      333 CP-751,871_Corrected   333
113 CP-751,871 dose escalation       A      NA      NA      HR      NA       HR                   Map Day 15 to Day 1    Y  0     208     MG/L      208 CP-751,871_Corrected   208
114 CP-751,871 dose escalation       A      NA 666.383      HR      NA       HR Map Cycle 5 predose to Cycle 4 672 hr    Y  0     225     MG/L      225 CP-751,871_Corrected   225
    ACONC.CHAR NTIME   ATIME TAU TOLD DOSE1
108        198     0   0.000 672    0  1106
109        843     1   0.917 672    0  1106
110        536    24  23.967 672    0  1106
111        481    72  68.633 672    0  1106
112        333   168 163.700 672    0  1106
113        208   336 497.867 672    0  1106
114        225   672 666.383 672    0  1106

2019-11-20 tc017 M4SD if FLGACCEPTKELCRIT is specified with a parameter not support by model computation engine crashes

Test case tc017 M4SD was executed with mct$FLGACCEPTKELCRIT set to
"KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=20.0"

However, AUCXPCTP is not computed by the M4SD model.

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in `[.data.frame`(computation_df, , flag_df$VAR[f]) : 
  undefined columns selected
In addition: Warning messages:
1: In run_M4_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTKELCRIT' values provided via 'map' does not have a valid parameter name 'AUCXPCTP'
2: In run_M4_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in `[.data.frame`(computation_df, , flag_df$VAR[f]) : 
  undefined columns selected 

When FLGACCEPTKELCRIT is reset to "KELRSQ>=0.9,KELNOPT>=3" and run_computation re-executed, the computation runs as expected.

2019-11-20 tc012 M1SS if length of TAU extends beyond range of the original time concentration data, computation engine crashes

tc012 M1SS amplified to include a 3rd dosing interval with TAU/TOLD extending beyond extent of the data. Expected behavior is for the parameters that can be reasonably computed (AUCTAU for example) should be computed with value of the concentration data point extrapolated based upon the estimated KEL/slope. The observed behavior is that the computation engine crashes unexpectedly.

> testcase.id <- "tc012"
> p <- "./testcases/tc012"
> params["INPUT1"] = file.path(p, "A0081216.in.csv")
> params["parameterset"] ="PARAMETERLIST"
> params["map"] = file.path(p, "tc012_mct_updated.csv")
> params["flags"] = file.path(p, "A0081216_flag_data.in.csv")
> params["OUTPUT"] ="."
> print(params)
                                       INPUT1                                  parameterset                                           map 
          "./testcases/tc012/A0081216.in.csv"                               "PARAMETERLIST"     "./testcases/tc012/tc012_mct_updated.csv" 
                                        flags                                        OUTPUT 
"./testcases/tc012/A0081216_flag_data.in.csv"                                           "." 
>   
> mct <- read_csv(params["map"])
Parsed with column specification:
cols(
  .default = col_character(),
  AUCNPAIR = col_integer(),
  FLGNOCMAX = col_integer(),
  FLGACCEPTPREDOSECRIT = col_double(),
  SPANRATIOCRIT = col_integer(),
  DP.DEFAULT = col_integer(),
  SF.DEFAULT = col_integer(),
  OPTIMIZEKEL = col_integer(),
  INCLUDEINTERPOLATION = col_integer(),
  INCLUDEEXTRAPOLATION = col_integer(),
  AUC.1.T1 = col_integer(),
  AUC.1.T2 = col_integer(),
  AUC.2.T1 = col_integer(),
  AUC.2.T2 = col_integer(),
  AUC.3.T1 = col_integer(),
  AUC.3.T2 = col_integer(),
  AUC.4.T1 = col_integer(),
  AUC.4.T2 = col_integer(),
  AUC.5.T1 = col_integer(),
  AUC.5.T2 = col_integer()
)
See spec(...) for full column specifications.
> write_file(toJSON(mct, na="string"), path=file.path(p, "tc012_mct_updated.json"))
> params["map"] = file.path(p, "tc012_mct_updated.json")
>   
> flags <- read_csv(params["flags"])
Parsed with column specification:
cols(
  PKDATAROWID = col_integer(),
  FLGEXSDE = col_integer(),
  FLGEXKEL = col_integer(),
  FLGEXAUC = col_integer(),
  FLGEXST = col_integer(),
  NDOSEI = col_integer(),
  PKPCOM = col_character(),
  MIDPNTN = col_character(),
  MIDPNTA = col_character(),
  MIDPNTNU = col_character(),
  MIDPNTAU = col_character(),
  RATEN = col_character(),
  RATEA = col_character(),
  RATENU = col_character(),
  RATEAU = col_character()
)
> write_file(toJSON(flags, na="string"), path=file.path(p, "tc012_flags.json"))
> params["flags"] = file.path(p, "tc012_flags.json")
> conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
> vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
>   
> # Read mct
> mct <- params["map"]
> ###mct <- read_file(mct)
> ###mct <- gsub("[\\]+", "", mct)
> mct <- fromJSON(mct)
>   
> # Read flags
> flags <- params["flags"]
> ###flags <- read_file(flags)
> ###flags <- gsub("[\\]+", "", flags)
> flags <- fromJSON(flags)
>   
> # ParameterSet
> if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
> parameterset <- params["parameterset"]
>   
> # FLAGS is a subset for the specific profile, subset concentration dataframe 
> #  to those records by PKDATAROWID
> d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
>   
> # Add in missing required parameters for virtual compute call
> klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
> if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
> for(i in klist) {
+ ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
+   if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
+ }
> 
> # Remove any leading semi-colons ";"
> mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
> 
> # For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
> if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
> 
> # Check whether TIME selection has been set in MCT - default to NOMINAL
> if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
>   
> # Determine whether there are any points selected for inclusion in the terminal elimination phase via 
> #  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
> #  ***What happens if there are no flags provided?***
> n <- factor(flags$FLGEXKEL, levels=c(0,1))
> ninc <- length(n[n==0])
> nexc <- length(n[n==1])
> model_spec(mct)
[1] "openNCA: Model: M1 DosingType: SS AUCMETHOD: LINLOG"
> mct$TIME
[1] "NOMINAL"
> 
> mct$PARAMETERDISPLAYLIST
[1] "SUBJID;TREATXT;PKBDFLD;PKTERM;PERIODU;PERIOD;VISITU;VISIT;DOSE;DOSEU;ACTTRT;AUCTAU;AUCLASTi;AUCXPCTP;CLFTAUi;CMAX;CMAXi;KEL;KELNOPT;KELRSQ;KELTMHI;KELTMLO;THALF;TLAST;TMAX;TMAXi;VZFP;CAV;CTROUGH;CMIN;PTR;PTF;RACC;RSS;RACCMAXi;THALFF"
> mct$PARAMETERLIST
[1] "AUCALL;AUCALLDN;AUCINFO;AUCINFOC;AUCINFODN;AUCINFP;AUCINFPC;AUCINFPDN;AUCLAST;AUCLASTi;AUCLASTDNi;AUCLASTCi;AUCT;AUCT1_T2;AUCTAUi;AUCTAUDNi;AUCXPCTO;AUCXPCTP;AUMCTAUi;CAVi;CLASTi;CLFO;CLFTAUi;CLFTAUWi;CLO;CLRTAUi;CMAXi;CMAXCi;CMAXDNi;CMINi;DOSECi;CTROUGHi;CTROUGHENDi;DIi;DOSEi;KEL;KELNOPT;KELRSQ;KELRSQA;KELTMHI;KELTMLO;LASTTIME;MRTEVIFOi;MRTEVIFPi;PTFi;PTRi;PTROUGHRi;PTROUGHREND;TAU;TAUi;THALF;THALFF;TLAG;TLAST;TMAXi;TMINi;TOLD;VZFP;VZFTAUi;VZFTAUWi"
> 
> parameterset <- "PARAMETERDISPLAYLIST"
> parameterset <- "PARAMETERLIST"
> parameterset
[1] "PARAMETERLIST"
> 
> mct$CONCOUTPUTUNIT <- "UG/ML"
> unique(d$PKCNCU)
[1] "UG/ML"
> 
> mct$DOSEOUTPUTUNIT
[1] "MG"
> mct$DOSE1U
[1] "DOSEUNI"
> unique(d[,mct$DOSE1U])
[1] "MG"
> 
> # Parmeters for M1SS
> model_parameters("M1|M1SS")
  [1] "AUCALL"       "AUCALLDN"     "AUCDN"        "AUCINFO"      "AUCINFOC"     "AUCINFODN"    "AUCINFOi"     "AUCINFP"      "AUCINFPC"     "AUCINFPDN"    "AUCINFPi"    
 [12] "AUCLAST"      "AUCLASTi"     "AUCLASTC"     "AUCLASTCi"    "AUCLASTDN"    "AUCLASTDNi"   "AUCT"         "AUCT1_T2"     "AUCTAUDNi"    "AUCTAU"       "AUCTAUi"     
 [23] "AUCTDN"       "AUCXPCTO"     "AUCXPCTOi"    "AUCXPCTP"     "AUCXPCTPi"    "AUMCINFO"     "AUMCINFOi"    "AUMCINFP"     "AUMCINFPi"    "AUMCLAST"     "AUMCLASTi"   
 [34] "AUMCTAUi"     "AUMCXPTO"     "AUMCXPTOi"    "AUMCXPTP"     "AUMCXPTPi"    "CAVi"         "CEST"         "CLAST"        "CLASTi"       "CLFO"         "CLFOW"       
 [45] "CLFP"         "CLFPW"        "CLFTAUi"      "CLFTAUWi"     "CMAX"         "CMAXi"        "CMAXDN"       "CMAXDNi"      "CMIN"         "CMINi"        "CMINDN"      
 [56] "CMINDNi"      "CTROUGHi"     "CTROUGHENDi"  "DIi"          "DOSE"         "DOSEi"        "DOSEC"        "DOSECi"       "F"            "FREL"         "FRELLAST"    
 [67] "FRELLASTi"    "FTAUi"        "KEL"          "KELC0"        "KELNOPT"      "KELR"         "KELRSQ"       "KELRSQA"      "KELTMHI"      "KELTMLO"      "LASTTIME"    
 [78] "LASTTIMEi"    "MRTEVIFO"     "MRTEVIFOi"    "MRTEVIFP"     "MRTEVIFPi"    "MRTLAST"      "MRTLASTi"     "PTF"          "PTFi"         "PTR"          "PTRi"        
 [89] "PTROUGHRi"    "PTROUGHRENDi" "RACi"         "RACCMAXi"     "RACCMINi"     "RSSi"         "TAU"          "TAUi"         "THALF"        "THALFF"       "TLAG"        
[100] "TLAST"        "TLASTi"       "TMAX"         "TMAXi"        "TMIN"         "TMINi"        "TOLD"         "TOLDi"        "VZFO"         "VZFOW"        "VZFP"        
[111] "VZFPW"        "VZFTAUi"      "VZFTAUWi"    
> 
> k <- parameter_required("OUTPUTUNIT$", names(mct), simplify=FALSE)
> mct[,names(k)]
  TIMEOUTPUTUNIT AMOUNTOUTPUTUNIT DOSEOUTPUTUNIT VOLUMEOUTPUTUNIT CONCOUTPUTUNIT KELOUTPUTUNIT CLOUTPUTUNIT AUCOUTPUTUNIT AUMCOUTPUTUNIT AUCNORMOUTPUTUNIT AUROUTPUTUNIT
1             HR               NA             MG                L          UG/ML          1/HR         L/HR      NG.HR/ML    NG.HR.HR/ML       NG.HR/ML/MG            NA
  CONCNORMOUTPUTUNIT RATEOUTPUTUNIT VOLUMENORMOUTPUTUNIT CLNORMOUTPUTUNIT
1           NG/ML/MG             NA                 L/KG         ML/HR/KG
> 
> k <- parameter_required("^DOSE", names(mct), simplify=FALSE)
> mct[,names(k)]
  DOSE1  DOSE1U DOSEOUTPUTUNIT  DOSETIM DOSETIMESTOP DOSE2  DOSE2U
1 DOSE1 DOSEUNI             MG DOSETIME DOSETIMESTOP DOSE2 DOSEUNI
> 
> mct$DOSE3 <- "DOSE3"
> mct$DOSE3U <- "DOSEUNI"
> 
> d$DOSE3 <- d$DOSE2
> 
> k <- parameter_required("^DOSE", names(mct), simplify=FALSE)
> mct[,names(k)]
  DOSE1  DOSE1U DOSEOUTPUTUNIT  DOSETIM DOSETIMESTOP DOSE2  DOSE2U DOSE3  DOSE3U
1 DOSE1 DOSEUNI             MG DOSETIME DOSETIMESTOP DOSE2 DOSEUNI DOSE3 DOSEUNI
> 
> k <- parameter_required("^TAU", names(mct), simplify=FALSE)
> mct[,names(k)]
  TAU1  TAU1U TAU2  TAU2U
1 TAU1 PKPTMU TAU2 PKPTMU
> k <- parameter_required("^TOLD", names(mct), simplify=FALSE)
> mct[,names(k)]
  TOLD1 TOLD1U TOLD2 TOLD2U
1 TOLD1 TOLD1U TOLD2 PKPTMU
> 
> mct$TOLD3 <- "TOLD3"
> mct$TAU3 <- "TAU3"
> 
> d$TAU1
  [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12
 [60] 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24
[119] 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12
[178] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[237] 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
[296] 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[355] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24
[414] 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12 12 12 12 12 12
[473] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 12 12 12 12 12 12
[532] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24
> d$TOLD1
  [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
 [90] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[179] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[268] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[357] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[446] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[535] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> d$TAU2
  [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12
 [60] 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA
[119] NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12
[178] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[237] 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[296] NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[355] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA
[414] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12
[473] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12
[532] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA
> d$TOLD2
  [1] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12
 [60] 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA
[119] NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12
[178] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[237] 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
[296] NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
[355] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA
[414] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12 12 12 12 12 12
[473] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA 12 12 12 12 12 12
[532] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 NA NA NA NA NA NA NA NA NA NA NA NA NA
> d$TAU3 <- 24
> d$TOLD3 <- 12
> 
> k <- parameter_required("^TAU", names(mct), simplify=FALSE)
> mct[,names(k)]
  TAU1  TAU1U TAU2  TAU2U TAU3
1 TAU1 PKPTMU TAU2 PKPTMU TAU3
> k <- parameter_required("^TOLD", names(mct), simplify=FALSE)
> mct[,names(k)]
  TOLD1 TOLD1U TOLD2 TOLD2U TOLD3
1 TOLD1 TOLD1U TOLD2 PKPTMU TOLD3
> 
> #mct$OPTIMIZEKEL <- 0 # don't optimize
> #mct$OPTIMIZEKEL <- 1 # optimize
> mct$OPTIMIZEKEL
[1] 0
> mct$FLGNOCMAX
[1] 1

the subsequent computation engine call generates an error and crashes

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in rep(1, (tau_i - told_i + 1)) : invalid 'times' argument

2019-11-17 tc011 execution of run_computation with FLGNOCMAX==1 with optimizekel routine doesn't return optimized flags

tc011 M1SS multiple dosing intervals

> mct$OPTIMIZEKEL
[1] 1
> mct$FLGNOCMAX
[1] 1

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
unit_conversion : Unit Class 1 (Time) time_col:  TMAX1 TMAX2 TMIN1 TMIN2 TLAST TLAG KELTMLO KELTMHI THALF LASTTIME MRTLAST MRTLAST1 MRTLAST2 MRTEVIFO1 MRTEVIFO2 MRTEVIFP1 MRTEVIFP2 TAU1 TAU2 TOLD1 TOLD2  parameters are scaled from  HR  to  HR  via scaling factor:  1 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE1  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE2  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 4 (Volume) volume_col:  VZFTAU1 VZFTAU2  parameters are scaled from  ML  to  L  via scaling factor:  0.001 
unit_conversion : Unit Class 5 (Amount/Volume) conc_col:  CMAX1 CMAX2 CMIN1 CMIN2 CLAST1 CLAST2 KELC0 CAV1 CAV2  parameters are scaled from  UG/ML  to  NG/ML  via scaling factor:  1000 
unit_conversion : Unit Class 6 (1/Time) kel_col:  KEL  parameters are scaled from  1/HR  to  1/HR  via scaling factor:  1 
unit_conversion : Unit Class 7 (Volume/Time) cl_col:  CLFTAU1 CLFTAU2  parameters are scaled from  ML/HR  to  L/HR  via scaling factor:  0.001 
unit_conversion : Unit Class 8: (Amount.Time/Volume) auc_col:  AUCALL AUCLASTC AUCLAST1 AUCLAST2 AUCLASTC1 AUCLASTC2 AUCINFO AUCINFOC AUCINFP AUCINFPC AUCTAU1 AUCTAU2  parameters are scaled from  UG.HR/ML  to  NG.HR/ML  via scaling factor:  1000 
unit_conversion : Unit Class 9: (Amount.Time.Time/Volume) aumc_col:  AUMCTAU1 AUMCTAU2  parameters are scaled from  UG.HR.HR/ML  to  NG.HR.HR/ML  via scaling factor:  1000 
unit_conversion : Unit Class 12: ([Amount/Volume]/Amount) concdn_col:  CMAXDN1 CMAXDN2  parameters are scaled from  UG/ML/MG  to  NG/ML/MG  via scaling factor:  1000 
There were 50 or more warnings (use warnings() to see the first 50)
> mct$FLGNOCMAX
[1] 1
> r <- results_list$data_out
> e <- results_list$est_data
> f <- results_list$flags_data

r
      SDEID DOSE1 DOSE2 DOSEC CMAX1 CMAX2  CMAXDN1  CMAXDN2 FLGACCEPTPREDOSE CMIN1 CMIN2 CLAST1 CLAST2 TMAX1  TMAX2 TMIN1 TMIN2 TLAST TLAG        KEL    KELC0 KELTMLO KELTMHI KELNOPT
1 130509330   300   300   300  8120  9540 27.06667 31.80000                0  1940  2200   2290   2200 1.500 13.000     0    24    24    0 0.10416094 26895.50      18      24       3
2 246409536   300   300   300  8130 12600 27.10000 42.00000                0   945  2240   2240   2420 0.667 12.667     0    12    24    0 0.09888024 25947.24      16      24       4
3 249265153   300   300   300 12200 12100 40.66667 40.33333                0  1620  1720   2030   1720 1.000 13.000     0    24    24    0 0.13200860 40690.22      16      24       4
4 283369224   300   300   300  8060 12900 26.86667 43.00000                0  2060  1990   2520   1990 2.000 12.667     0    24    24    0 0.12773909 43409.40      16      24       4
5 292748221   300   300   300 10900 11500 36.33333 38.33333                0  2260  2490   2720   2490 1.000 12.667     0    24    24    0 0.12117629 44414.40      14      24       5
     KELRSQ   KELRSQA FLGACCEPTKEL    THALF THALFF LASTTIME FLGACCEPTTAU   AUCALL  AUCLASTC AUCLASTDN AUCLAST1 AUCLAST2 AUCLASTC1 AUCLASTC2 AUCLASTDN1 AUCLASTDN2      AUC1     AUC2     AUC3
1 0.9995933 0.9991866            1 6.654578      1       24            1 109551.6  89397.55 0.3651721 52845.65 56408.31  28884.10  36254.25  0.1761522  0.1880277 0.8341650 2.400625 4.718305
2 0.9990935 0.9986402            1 7.009967      1       24            1 106168.3  95720.65 0.3538942 47738.74 58241.68  35264.26  47794.05  0.1591291  0.1941389 0.9948375 3.192557 5.815717
3 0.9992316 0.9988474            1 5.250773      1       24            1 105527.0  92738.73 0.3517568 52905.14 52810.07  38115.86  40021.75  0.1763505  0.1760336 0.6826500 2.464540 5.859475
4 0.9981222 0.9971833            1 5.426273      1       24            1 114926.6  98048.17 0.3830887 56672.84 57905.26  37064.23  41026.82  0.1889095  0.1930175 0.7242750 2.085325 4.386355
5 0.9974224 0.9965632            1 5.720155      1       24            1 126567.0 106898.69 0.4218900 60777.39 65482.37  37769.98  45814.05  0.2025913  0.2182746 0.8974350 2.729425 5.849635
       AUC4     AUC5     AUC6     AUC7     AUC8     AUC9    AUC10    AUC11    AUC12    AUC13    AUC14    AUC15     AUC16     AUC17    AUC18 AUCINT1 AUCINT2 AUCINT3 AUCINT4 AUCINT5 AUCINT6
1  8.650805 12.44749 24.65110 34.14267 44.97227 52.84565 53.61321 55.58214 58.74731 63.26010 67.45218 81.15689  90.81730 101.46176 109.2540 0_0.333 0_0.667     0_1   0_1.5     0_2     0_4
2  9.411433 12.52392 22.40110 30.30788 40.09891 47.73874 49.53361 53.06399 56.62310 60.70804 64.29425 76.44969  86.15488  97.56380 105.9804 0_0.333 0_0.667     0_1   0_1.5     0_2     0_4
3 11.018396 14.95149 27.18914 36.12720 45.83054 52.90514 53.94410 56.29045 59.94346 65.12475 69.18582 81.37289  90.06063  99.44468 105.7152 0_0.333 0_0.667     0_1   0_1.5     0_2     0_4
4  8.333855 12.30635 25.64657 35.66197 47.72318 56.67284 57.89495 60.85419 64.62109 69.16313 73.16058 86.23729  96.12274 107.14399 114.5781 0_0.333 0_0.667     0_1   0_1.5     0_2     0_4
5 10.817479 15.09058 29.06755 39.55078 51.52416 60.77739 62.69380 66.08223 69.79396 74.88027 79.35072 93.96139 105.16892 117.49550 126.2598 0_0.333 0_0.667     0_1   0_1.5     0_2     0_4
  AUCINT7 AUCINT8 AUCINT9 AUCINT10 AUCINT11 AUCINT12 AUCINT13 AUCINT14 AUCINT15 AUCINT16 AUCINT17 AUCINT18   AUC0_12 AUC12_24  AUC0_48 AUC16_30   AUC0_10  AUCINFO AUCINFOC AUCINFODN  AUCINFP
1     0_6     0_9    0_12 0_12.333 0_12.667     0_13   0_13.5     0_14     0_16     0_18     0_21     0_24 106.28661 112.8166 219.1032 56.19414  90.44661 130672.8 112047.8 0.4355759 130749.8
2     0_6     0_9    0_12 0_12.333 0_12.667     0_13   0_13.5     0_14     0_16     0_18     0_21     0_24  95.85319 116.4834 212.3365 59.06146  80.49320 130642.3 121085.3 0.4354744 130622.1
3     0_6     0_9    0_12 0_12.333 0_12.667     0_13   0_13.5     0_14     0_16     0_18     0_21     0_24 105.81029 105.2438 211.0541 48.68464  91.66109 118556.5 106284.6 0.3951883 118497.4
4     0_6     0_9    0_12 0_12.333 0_12.667     0_13   0_13.5     0_14     0_16     0_18     0_21     0_24 114.04271 115.8105 229.8532 56.68161  95.98271 130505.2 114378.6 0.4350175 130769.2
5     0_6     0_9    0_12 0_12.333 0_12.667     0_13   0_13.5     0_14     0_16     0_18     0_21     0_24 122.16927 130.9647 253.1340 64.59674 103.56927 147115.6 128465.1 0.4903853 146569.2
  AUCINFPC AUCINFPDN  AUCTAU1  AUCTAU2 AUCTAUDN1 AUCTAUDN2 AUMCTAU1  AUMCTAU2  MRTLAST MRTLAST1 MRTLAST2 MRTEVIFO1 MRTEVIFO2 MRTEVIFP1 MRTEVIFP2 AUCXPCTO AUCXPCTP     CAV1     CAV2
1 112124.8 0.4358326 52845.65 56408.31 0.1761522 0.1880277 260105.4  942066.2 10.94530 4.921983 16.70084  224.5912  556.8441  276.3798  680.3965 16.16340 16.21277 4403.804 4700.693
2 121065.1 0.4354069 47738.74 58241.68 0.1591291 0.1941389 234609.1  972113.2 11.34247 4.914439 16.69102  224.4750  469.6765  262.9995  505.0156 18.73363 18.72103 3978.228 4853.473
3 106225.5 0.3949915 52905.14 52810.07 0.1763505 0.1760336 243375.6  865304.0 10.48215 4.600225 16.38521  140.5347  277.5242  170.1054  322.0234 10.99008 10.94572 4408.762 4400.839
4 114642.6 0.4358974 56672.84 57905.26 0.1889095 0.1930175 286599.3  959068.4 10.80928 5.057084 16.56272  370.5493  350.4807  485.4397  413.7246 11.93717 12.11494 4722.737 4825.438
5 127918.7 0.4885640 60777.39 65482.37 0.2025913 0.2182746 296295.7 1086653.1 10.89879 4.875098 16.59459  255.1137  444.1550  303.1944  489.7116 13.96764 13.64693 5064.782 5456.864
      CLFTAU1     CLFTAU2     PTF1     PTF2     PTR1     PTR2    VZFTAU1    VZFTAU2  VZFTAUW1  VZFTAUW2 CONC1 CONC2 CONC3 CONC4 CONC5 CONC6 CONC7 CONC8 CONC9 CONC10 CONC11 CONC12 CONC13
1 0.005676910 0.005318365 1.403332 1.561472 4.185567 4.336364 0.05450133 0.05105911 0.7887313 0.7389162 1.940  3.07  6.31  7.61  8.12  7.09  5.21  4.31  2.99   2.29   2.32   9.47   9.54
2 0.006284205 0.005150951 1.806080 2.134554 8.603175 5.625000 0.06355370 0.05209282 0.7570422 0.6205220 0.945  5.03  8.13  7.63  6.77  5.71  4.24  3.68  2.88   2.24   8.54  12.60   8.98
3 0.005670526 0.005680735 2.399767 2.358641 7.530864 7.034884 0.04295573 0.04303307 0.6368530 0.6379995 1.620  2.48  8.19 12.20  8.64  7.14  5.20  3.81  2.72   2.03   4.21   9.84  12.10
4 0.005293541 0.005180877 1.270450 2.260935 3.912621 6.482412 0.04144026 0.04055827 0.5173565 0.5063455 2.060  2.29  5.86  7.96  7.83  8.06  5.45  4.59  3.50   2.52   4.82  12.90   9.86
5 0.004936046 0.004581386 1.705898 1.651132 4.823009 4.618474 0.04073443 0.03780761 0.6634271 0.6157592 2.260  3.13  7.84 10.90  9.03  8.08  6.00  4.55  3.48   2.72   8.79  11.50  10.80
  CONC14 CONC15 CONC16 CONC17 CONC18 CONC19 CONCTIME1 CONCTIME2 CONCTIME3 CONCTIME4 CONCTIME5 CONCTIME6 CONCTIME7 CONCTIME8 CONCTIME9 CONCTIME10 CONCTIME11 CONCTIME12 CONCTIME13 CONCTIME14
1   8.53   8.24   5.63   4.11   3.04   2.20         0     0.333     0.667         1       1.5         2         4         6         9         12     12.333     12.667         13       13.5
2   7.41   6.94   5.29   4.44   3.23   2.42         0     0.333     0.667         1       1.5         2         4         6         9         12     12.333     12.667         13       13.5
3   8.80   7.48   4.89   3.84   2.51   1.72         0     0.333     0.667         1       1.5         2         4         6         9         12     12.333     12.667         13       13.5
4   8.35   7.65   5.54   4.39   3.04   1.99         0     0.333     0.667         1       1.5         2         4         6         9         12     12.333     12.667         13       13.5
5   9.57   8.34   6.36   4.91   3.40   2.49         0     0.333     0.667         1       1.5         2         4         6         9         12     12.333     12.667         13       13.5
  CONCTIME15 CONCTIME16 CONCTIME17 CONCTIME18 CONCTIME19 DI1 DI2 TAU1 TAU2 TOLD1 TOLD2 TIMEU AMOUNTU DOSE1U DOSE2U VOLUMEU CONCU KELU  CLU     AUCU       AUMCU AUCNORMU AURCU CONCNORMU RATEU
1         14         16         18         21         24  NA  NA   12   12     0    12    HR      NA     MG     MG       L NG/ML 1/HR L/HR NG.HR/ML NG.HR.HR/ML       NA    NA  NG/ML/MG    NA
2         14         16         18         21         24  NA  NA   12   12     0    12    HR      NA     MG     MG       L NG/ML 1/HR L/HR NG.HR/ML NG.HR.HR/ML       NA    NA  NG/ML/MG    NA
3         14         16         18         21         24  NA  NA   12   12     0    12    HR      NA     MG     MG       L NG/ML 1/HR L/HR NG.HR/ML NG.HR.HR/ML       NA    NA  NG/ML/MG    NA
4         14         16         18         21         24  NA  NA   12   12     0    12    HR      NA     MG     MG       L NG/ML 1/HR L/HR NG.HR/ML NG.HR.HR/ML       NA    NA  NG/ML/MG    NA
5         14         16         18         21         24  NA  NA   12   12     0    12    HR      NA     MG     MG       L NG/ML 1/HR L/HR NG.HR/ML NG.HR.HR/ML       NA    NA  NG/ML/MG    NA
  VOLUMEWU CLWU    STUDY SITEID   SUBJID RAND                 TREATXT TRTCD PKCOLL PKBDFLD     PKTERM PERIODU PERIOD VISITU VISIT                                   ACTTRT ACTTRTC
1       NA   NA A0081216   1001 10011015   15 1X300 mg IR Fasted q12h     B  POINT  PLASMA PREGABALIN  PERIOD      2    DAY     4 PREGABALIN 1 X 300 MG IR CAPSULE FASTED        B
2       NA   NA A0081216   1001 10011008    8 1X300 mg IR Fasted q12h     B  POINT  PLASMA PREGABALIN  PERIOD      1    DAY     4 PREGABALIN 1 X 300 MG IR CAPSULE FASTED        B
3       NA   NA A0081216   1001 10011007    7 1X300 mg IR Fasted q12h     B  POINT  PLASMA PREGABALIN  PERIOD      2    DAY     4 PREGABALIN 1 X 300 MG IR CAPSULE FASTED        B
4       NA   NA A0081216   1001 10011005    5 1X300 mg IR Fasted q12h     B  POINT  PLASMA PREGABALIN  PERIOD      1    DAY     4 PREGABALIN 1 X 300 MG IR CAPSULE FASTED        B
5       NA   NA A0081216   1001 10011010   10 1X300 mg IR Fasted q12h     B  POINT  PLASMA PREGABALIN  PERIOD      2    DAY     4 PREGABALIN 1 X 300 MG IR CAPSULE FASTED        B
          DOSEP DOSPND ROUTE RACES SEX  HT    WT HTUNI WTUNI TAU
1 PREGABALIN BD   DONE  ORAL WHITE   M 172 69.10    CM    KG  12
2 PREGABALIN BD   DONE  ORAL WHITE   M 185 83.95    CM    KG  12
3 PREGABALIN BD   DONE  ORAL BLACK   M 171 67.45    CM    KG  12
4 PREGABALIN BD   DONE  ORAL WHITE   M 175 80.10    CM    KG  12
5 PREGABALIN BD   DONE  ORAL WHITE   M 180 61.40    CM    KG  12

> e
   PKDATAROWID     SDEID TIME CEST_KEL CEST_INT CEST_EXT CEST_C0 CEST_TLAST
1     26908935  70745987 18.0 4.780859       NA       NA      NA         NA
2     26908936  70745987 21.0 3.498742       NA       NA      NA         NA
3     26908937  70745987 24.0 2.560460       NA       NA      NA   2.560460
4     26908954 130509330 18.0 4.124984       NA       NA      NA         NA
5     26908955 130509330 21.0 3.017955       NA       NA      NA         NA
6     26908956 130509330 24.0 2.208021       NA       NA      NA   2.208021
7     26908535 246409536 16.0 5.333360       NA       NA      NA         NA
8     26908536 246409536 18.0 4.376376       NA       NA      NA         NA
9     26908537 246409536 21.0 3.253009       NA       NA      NA         NA
10    26908538 246409536 24.0 2.417997       NA       NA      NA   2.417997
11    26908877 249265153 16.0 4.922666       NA       NA      NA         NA
12    26908878 249265153 18.0 3.780412       NA       NA      NA         NA
13    26908879 249265153 21.0 2.544177       NA       NA      NA         NA
14    26908880 249265153 24.0 1.712204       NA       NA      NA   1.712204
15    26908516 283369224 16.0 5.622917       NA       NA      NA         NA
16    26908517 283369224 18.0 4.355208       NA       NA      NA         NA
17    26908518 283369224 21.0 2.968792       NA       NA      NA         NA
18    26908519 283369224 24.0 2.023721       NA       NA      NA   2.023721
19    26908895 292748221 14.0 8.142487       NA       NA      NA         NA
20    26908896 292748221 16.0 6.390056       NA       NA      NA         NA
21    26908897 292748221 18.0 5.014785       NA       NA      NA         NA
22    26908898 292748221 21.0 3.486372       NA       NA      NA         NA
23    26908899 292748221 24.0 2.423791       NA       NA      NA   2.423791
24    26908495 328228072 13.5 6.605181       NA       NA      NA         NA
25    26908496 328228072 14.0 6.128861       NA       NA      NA         NA
26    26908497 328228072 16.0 4.543182       NA       NA      NA         NA
27    26908498 328228072 18.0 3.367756       NA       NA      NA         NA
28    26908499 328228072 21.0 2.149370       NA       NA      NA         NA
29    26908500 328228072 24.0 1.371771       NA       NA      NA   1.371771
30    26908818 331625416 13.5 9.835481       NA       NA      NA         NA
31    26908819 331625416 14.0 9.241418       NA       NA      NA         NA
32    26908820 331625416 16.0 7.202953       NA       NA      NA         NA
33    26908821 331625416 18.0 5.614131       NA       NA      NA         NA
34    26908822 331625416 21.0 3.863140       NA       NA      NA         NA
35    26908823 331625416 24.0 2.658266       NA       NA      NA   2.658266
36    26908839 494439910 16.0 5.601851       NA       NA      NA         NA
37    26908840 494439910 18.0 4.508992       NA       NA      NA         NA
38    26908841 494439910 21.0 3.256126       NA       NA      NA         NA
39    26908842 494439910 24.0 2.351381       NA       NA      NA   2.351381
40    26908969 543244472 13.0 8.540985       NA       NA      NA         NA
41    26908970 543244472 13.5 8.080628       NA       NA      NA         NA
42    26908971 543244472 14.0 7.645084       NA       NA      NA         NA
43    26908972 543244472 16.0 6.125348       NA       NA      NA         NA
44    26908973 543244472 18.0 4.907714       NA       NA      NA         NA
45    26908974 543244472 21.0 3.519670       NA       NA      NA         NA
46    26908975 543244472 24.0 2.524206       NA       NA      NA   2.524206
47    26908572 695874499 14.0 7.097609       NA       NA      NA         NA
48    26908573 695874499 16.0 5.476251       NA       NA      NA         NA
49    26908574 695874499 18.0 4.225272       NA       NA      NA         NA
50    26908575 695874499 21.0 2.863595       NA       NA      NA         NA
51    26908576 695874499 24.0 1.940745       NA       NA      NA   1.940745
52    26908476 783385801 13.5 8.322697       NA       NA      NA         NA
53    26908477 783385801 14.0 7.852061       NA       NA      NA         NA
54    26908478 783385801 16.0 6.221025       NA       NA      NA         NA
55    26908479 783385801 18.0 4.928789       NA       NA      NA         NA
56    26908480 783385801 21.0 3.475823       NA       NA      NA         NA
57    26908481 783385801 24.0 2.451179       NA       NA      NA   2.451179
58    26908553 797620983 14.0 9.083895       NA       NA      NA         NA
59    26908554 797620983 16.0 7.349303       NA       NA      NA         NA
60    26908555 797620983 18.0 5.945936       NA       NA      NA         NA
61    26908556 797620983 21.0 4.326944       NA       NA      NA         NA
62    26908557 797620983 24.0 3.148780       NA       NA      NA   3.148780
63    26908916 856727921 18.0 6.093222       NA       NA      NA         NA
64    26908917 856727921 21.0 4.251489       NA       NA      NA         NA
65    26908918 856727921 24.0 2.966437       NA       NA      NA   2.966437
66    26908858 895085608 16.0 6.810659       NA       NA      NA         NA
67    26908859 895085608 18.0 5.571924       NA       NA      NA         NA
68    26908860 895085608 21.0 4.123151       NA       NA      NA         NA
69    26908861 895085608 24.0 3.051078       NA       NA      NA   3.051078
70    26908610 897885073 14.0 8.898941       NA       NA      NA         NA
71    26908611 897885073 16.0 7.213563       NA       NA      NA         NA
72    26908612 897885073 18.0 5.847380       NA       NA      NA         NA
73    26908613 897885073 21.0 4.267550       NA       NA      NA         NA
74    26908614 897885073 24.0 3.114554       NA       NA      NA   3.114554
75    26908593 916516839 18.0 5.022101       NA       NA      NA         NA
76    26908594 916516839 21.0 3.451510       NA       NA      NA         NA
77    26908595 916516839 24.0 2.372099       NA       NA      NA   2.372099
78    26908629 982849649 14.0 7.872877       NA       NA      NA         NA
79    26908630 982849649 16.0 6.229732       NA       NA      NA         NA
80    26908631 982849649 18.0 4.929528       NA       NA      NA         NA
81    26908632 982849649 21.0 3.469838       NA       NA      NA         NA
82    26908633 982849649 24.0 2.442379       NA       NA      NA   2.442379
> f
NULL

Note that estimated concentration dataset missing any entries required for interpolation/extrapolation as reported in issue #2

2019-11-20 tc012 M1SS comp engine error when parameterset set to "PARAMETERDISPLAYLIST"

Issue

When using tc012 and using the value of "PARAMETERDISPLAYLIST" for parameterset the computation engine crashes. This does not cause an error for tc010, tc011, tc013 or tc014. Errors for tc015 and tc016 are documented separately due to their unique error messages.

Error

parameterset <- "PARAMETERDISPLAYLIST"
Error in `[.data.frame`(computation_df, , flag_df$VAR[f]) : 
  undefined columns selected

No option for traceback is provided for this error.

2019-11-11 'opt_list' missing for M1, M2 and M3 SS methods

Error

The latest commit, 1fc479c, has an error when running computation while asking for partial AUC. The following error is given when running test case tc012, tc014 and tc016 when a partial AUC is added to the mct:

Error in value[[3L]](cond) : 
  Error in opt_list[3] %in% names(map_data): object 'opt_list' not found

All three test cases worked for the base test cases with no changes; error only occurs when including a partial AUC. While the traceback is similar for each test case, I've included them all below along with a reproducible example for test case 012.

Traceback

Traceback for tc012 (with added partial AUC)

Error in value[[3L]](cond) : 
  Error in opt_list[3] %in% names(map_data): object 'opt_list' not found
For SDEID 24280050
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M1_SS_computation.R#2601
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    if (comp_required[["CMAXi"]]) {
        c_maxi <- list()
    } ... at
run_M1_SS_computation.R#1021
2. run_M1_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at
run_computation.R#2223
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

Traceback for tc014 (with added partial AUC)

Error in value[[3L]](cond) : 
  Error in opt_list[3] %in% names(map_data): object 'opt_list' not found
For SDEID 24280050
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M2_SS_computation.R#2291
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    if (comp_required[["C0"]]) {
        c_0 <- list()
    } ... at
run_M2_SS_computation.R#935
2. run_M2_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at
run_computation.R#2235
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)
 

Traceback for tc016 (with added partial AUC)

Error in value[[3L]](cond) : 
  Error in opt_list[3] %in% names(map_data): object 'opt_list' not found
For SDEID 24280050
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M3_SS_computation.R#2174
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    if (comp_required[["CMAXi"]]) {
        c_maxi <- list()
    } ... at
run_M3_SS_computation.R#922
2. run_M3_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at
run_computation.R#2247
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)
 
#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-b1977923fc/openNCA")  # 11/8-v1
# pkgload::load_all(path = "codebase/openNCA-051805c887/openNCA")  # 11/8-v2
pkgload::load_all(path = "codebase/openNCA-1fc479c2ca/openNCA")  # 11/11
 
#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)
 
profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()
 
#### Test Case 012 ------------------------------------------------------- ####
# M1 SS
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc012"
testcase.id <- "tc012"
p <- "testcase/tc012_M1SS"
params["INPUT1"] = file.path(p, "A0081216.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc012_mct_updated.csv")
params["flags"] = file.path(p, "A0081216_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)
 
mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc012_mct_updated.json"))
params["map"] = file.path(p, "tc012_mct_updated.json")
 
flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc012_flags.json"))
params["flags"] = file.path(p, "tc012_flags.json")
 
#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
 
# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)
 
# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)
 
# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]
 
# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
 
# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}
 
# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
 
# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
 
# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
 
# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])
 
#### Final changes to test ----------------------------------------------- ####
### Add partial AUC
mct$AUC.1.T1 <- 11
mct$AUC.1.T2 <- 26
 
#### Run computation engine ---------------------------------------------- ####
# Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

2019-11-13 Extrapolated points not appearing in est_data output

Issue

When running a test case with a partial AUC including a point beyond the final observed value, the extrapolated point does not appear in the est_data output. Despite this, extrapolated points do seem to affect the value given in data_out for the partial AUC.

Output

Using tc010 with two added partial AUCs from 0 to 120 and from 0 to 144. The first partial AUC includes extrapolation for some SDEIDs, while other SDEIDs have an observed value at this time. No SDEIDs have an observed value at 144.

The output from est_data is:

   PKDATAROWID    SDEID TIME  CEST_KEL   CEST_INT CEST_EXT CEST_C0 CEST_TLAST
1           NA  2925168    7        NA 3.59500000       NA      NA         NA
2     22289754  2925168   24 1.7026376         NA       NA      NA         NA
3     22289755  2925168   48 0.5878072         NA       NA      NA         NA
4           NA  2925168   64        NA 0.32866667       NA      NA         NA
5     22289756  2925168   72 0.2029306         NA       NA      NA  0.2029306
6           NA 40876220    7        NA 1.11575000       NA      NA         NA
7     22289571 40876220   16 0.4954443         NA       NA      NA         NA
8     22289572 40876220   24 0.3651747         NA       NA      NA         NA
9     22289573 40876220   48 0.1462239         NA       NA      NA         NA
10          NA 40876220   64        NA 0.08246667       NA      NA         NA

The extrapolated points do not appear in the est_data, while the interpolated points (from partial AUCs 0 to 7 and 0 to 64 from the original tc010) do appear.

The output from data_out for the same run is:

      SDEID     AUC0_7    AUC8_48     AUC0_64    AUC0_120    AUC0_144
1 111299859    5.15075   16.11586    23.59851    27.81464    29.81102
2 112146587   16.63043   27.18657    47.51955    50.43985    51.81112
3 123811839 1826.88593 1140.50993  3155.39210  3185.37920  3189.62671
4 145593586  759.77223 1482.00641  2543.66350  2692.11817  2708.33439
5 202367199 6447.26053 5524.24397 12915.26200 13167.20305 13196.88021
6 233891605 2026.37365 1432.19220  3683.11590  3729.02670  3733.35383

When comparing the partial AUCs given in data_out a difference between AUC0_120 and AUC0_144 is observed. This implies that extrapolation is likely occurring and being used to calculate the partial AUCs, but aren't being reported in est_data. This is consistent for all SDEIDs (including 2925168 shown in the est_data above).

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)
 
#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-b1977923fc/openNCA")  # 11/8-v1
# pkgload::load_all(path = "codebase/openNCA-051805c887/openNCA")  # 11/8-v2
# pkgload::load_all(path = "codebase/openNCA-1fc479c2ca/openNCA")  # 11/11
# pkgload::load_all(path = "codebase/openNCA-a06c1c7461/openNCA")  # 11/12
pkgload::load_all(path = "codebase/openNCA-e3be44d927/openNCA")  # 11/13
 
#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)
 
profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()
 
#### Test Case 010 ------------------------------------------------------- ####
# M1 SD
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc010"
testcase.id <- "tc010"
p <- "testcase/tc010_M1SD"
params["INPUT1"] = file.path(p, "B1261002.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc010_mct_updated.csv")
params["flags"] = file.path(p, "B1261002_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)
 
mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc010_mct_updated.json"))
params["map"] = file.path(p, "tc010_mct_updated.json")
 
flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc010_flags.json"))
params["flags"] = file.path(p, "tc010_flags.json")
 
#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
 
# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)
 
# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)
 
# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]
 
# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
 
# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}
 
# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
 
# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
 
# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
 
# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])
#### Final changes to test ----------------------------------------------- ####
### Add partial AUC
mct$AUC.4.T1 <- 0
mct$AUC.4.T2 <- 120
mct$AUC.5.T1 <- 0
mct$AUC.5.T2 <- 144

#### Run computation engine ---------------------------------------------- ####
### Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

### Save results to objects
r <- results_list$data_out
e <- results_list$est_data
f <- results_list$flag_data

### View output
head(e, 10)
e[e$TIME == 144,]  # no rows with time 144
head(r[c("SDEID", "AUC0_7", "AUC8_48", "AUC0_64", "AUC0_120", "AUC0_144")])
r$AUC0_144 - r$AUC0_120  # partial AUC 0-120 consistently smaller than 0-144

2019-11-08 Code Commit Fails tc010.

Something has changes drastically with out the map_data is being evaluated relative to the master branch. No change has occurred to tc010 configuration. Please execute tc010 and provide results and review and resolve ASAP.

results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[3L] :
Error in [.data.frame(map_data, , opt_list[3]): undefined columns selected
For SDEID 2925168
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method, :
Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method, :

Show Traceback

Rerun with Debug
Error in value[3L] :
Error in [.data.frame(map_data, , opt_list[3]): undefined columns selected
For SDEID 2925168

stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M1_SD_computation.R#1624
6.
value[3L]
5.
tryCatchOne(expr, names, parentenv, handlers[[1L]])
4.
tryCatchList(expr, classes, parentenv, handlers)
3.
tryCatch({
tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[,
map_data$SDEID])[i], ]
tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M1_SD_computation.R#812
2.
run_M1_SD_computation(data = merged_data, map = map_data, method = method,
model_regex = model_regex, parameter_list = parameter_list,
return_list = return_list) at run_computation.R#2217
1.
run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

2019-11-20 tc016 M3SS comp engine error when parameterset set to "PARAMETERDISPLAYLIST"

Issue

When using tc016 and using the value of "PARAMETERDISPLAYLIST" for parameterset the computation engine crashes. This does not cause an error for tc010, tc011, tc013 or tc014. Errors for tc012 and tc015 are documented separately due to their unique error messages.

Error

parameterset <- "PARAMETERDISPLAYLIST"
Error in value[[3L]](cond) : 
  Error in cltau(auctau = auctau[[d]], dose = dose_c[d]): object 'dose_c' not found
For SDEID 12596809 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M3_SS_computation.R#2180
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    if (comp_required[["CMAXi"]]) {
        c_maxi <- list()
    } ... at run_M3_SS_computation.R#923
2. run_M3_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2247
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

2019-11-13 FLGACCEPTKEL providing incorrect output

Issue

The output for FLGACCEPTKEL does not appear to provide the correct output.

  1. It provides a FALSE or TRUE value, when it should provide a 0 or 1 value.
  2. There are inconsistencies in FLGACCEPTKELCRIT and FLGACCEPTKEL behaviour which are outlined below.

Output

When running the base test case 010 with OPTIMIZEKEL <- 1 the following output is given.

      SDEID        KEL KELTMLO KELTMHI KELNOPT    KELRSQ   AUCXPCTP FLGACCEPTKEL
1 111299859 0.05815238      12      48       4 0.9947858 6.81888591        FALSE
2 112146587 0.08695843       8      48       5 0.9906898 1.83937140        FALSE
3 123811839 0.06147205       2     120      10 0.9436264 0.05578474        FALSE
4 145593586 0.04258080       4     120       9 0.9882692 0.58769593        FALSE
5 202367199 0.05424527       4     120       9 0.9623526 0.13064667         TRUE
6 233891605 0.05989964       4     120       9 0.9674385 0.06301853         TRUE

This results from the default value for FLGACCEPTKELCRIT from the mct which is:

[1] "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=0.2"

@tensfeldt - This criteria for AUCXPCTP reads as being less than 0.2%. Is this an error in the test case mcts? Should it be "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=20.0"? This value for FLGACCEPTKELCRIT is consistent across all test cases.

When changing the value using to 20%, the following output is given:

      SDEID        KEL KELTMLO KELTMHI KELNOPT    KELRSQ   AUCXPCTP FLGACCEPTKEL
1 111299859 0.05815238      12      48       4 0.9947858 6.81888591        FALSE
2 112146587 0.08695843       8      48       5 0.9906898 1.83937140         TRUE
3 123811839 0.06147205       2     120      10 0.9436264 0.05578474        FALSE
4 145593586 0.04258080       4     120       9 0.9882692 0.58769593         TRUE
5 202367199 0.05424527       4     120       9 0.9623526 0.13064667         TRUE
6 233891605 0.05989964       4     120       9 0.9674385 0.06301853         TRUE

My observations on these results are:

  • It appears that mct$FLGACCEPTKELCRIT does not affect the OPTIMIZEKEL algorithm, which may be intentional
  • It also appears that mct$FLGACCEPTKELCRIT interacts strangely with FLGACCEPTKEL
  • It has changed the criteria as the values for FLGACCEPTKEL have changed
  • It does not appear to be using the criteria exactly as outlined in mct$FLGACCEPTKELCRIT as SDEID == 111299859 should be TRUE

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)

#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-b1977923fc/openNCA")  # 11/8-v1
# pkgload::load_all(path = "codebase/openNCA-051805c887/openNCA")  # 11/8-v2
# pkgload::load_all(path = "codebase/openNCA-1fc479c2ca/openNCA")  # 11/11
# pkgload::load_all(path = "codebase/openNCA-a06c1c7461/openNCA")  # 11/12
pkgload::load_all(path = "codebase/openNCA-e3be44d927/openNCA")  # 11/13

#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)

profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()

#### Test Case 010 ------------------------------------------------------- ####
# M1 SD
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc010"
testcase.id <- "tc010"
p <- "testcase/tc010_M1SD"
params["INPUT1"] = file.path(p, "B1261002.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc010_mct_updated.csv")
params["flags"] = file.path(p, "B1261002_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)

mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc010_mct_updated.json"))
params["map"] = file.path(p, "tc010_mct_updated.json")

flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc010_flags.json"))
params["flags"] = file.path(p, "tc010_flags.json")

#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")

# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)

# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)

# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]

# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]

# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}

# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)

# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }

# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }

# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])

#### Final changes to test ----------------------------------------------- ####

### Optimise Kel
# mct$OPTIMIZEKEL <- 0 # don't optimise
mct$OPTIMIZEKEL <- 1 # optimise

### Check FLGACCEPTKELCRIT
print(mct$FLGACCEPTKELCRIT)
# mct$FLGACCEPTKELCRIT <- "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=0.2"
mct$FLGACCEPTKELCRIT <- "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=20"

#### Run computation engine ---------------------------------------------- ####
### Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

### Save results to objects
r <- results_list$data_out
e <- results_list$est_data
f <- results_list$flag_data

### View results
head(r[c("SDEID", "KEL", "KELTMLO", "KELTMHI", "KELNOPT", "KELRSQ", "AUCXPCTP", "FLGACCEPTKEL")])

2019-11-13 OPTIMIZEKEL providing NA values for KEL

Issue

When using OPTIMIZEKEL there are cases where an NA value is returned for KEL and its associated outputs.

Output

When using tc012 with mct$OPTIMIZEKEL <- 1 some rows for KEL are given an NA output:

      SDEID        KEL KELTMLO KELTMHI KELNOPT    KELRSQ AUCXPCTP FLGACCEPTKEL
1 130509330 0.13135136    13.5      24       6 0.9846997 12.58249        FALSE
2 147299665         NA      NA      NA       0        NA       NA        FALSE
3  24280050 0.11779122    12.0      24       3 0.9970626 10.56075        FALSE
4 246409536 0.11237648    13.0      24       7 0.9828765 16.29267        FALSE
5 246953363         NA      NA      NA       0        NA       NA        FALSE
6 249265153 0.03964688     1.5      24      15 0.1861215 41.69759        FALSE

This is compared to the following output when mct$OPTIMIZEKEL <- 0

      SDEID        KEL KELTMLO KELTMHI KELNOPT    KELRSQ  AUCXPCTP FLGACCEPTKEL
1 130509330 0.10416094      18      24       3 0.9995933 16.212771        FALSE
2 147299665 0.12611367      12      24       3 0.9999997  9.352225        FALSE
3  24280050 0.11779122      12      24       3 0.9970626 10.560748        FALSE
4 246409536 0.09888024      16      24       4 0.9990935 18.721028        FALSE
5 246953363 0.10647171      12      24       3 0.9975960 14.288932        FALSE
6 249265153 0.13200860      16      24       4 0.9992316 10.945719        FALSE

Despite there being a selection of points that result in an acceptable KELNOPT, KELRSQ and AUCXPCTP value (as provided by a user), it appears that the OPTIMIZEKEL algorithm was unable to find one.

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)

#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-b1977923fc/openNCA")  # 11/8-v1
# pkgload::load_all(path = "codebase/openNCA-051805c887/openNCA")  # 11/8-v2
# pkgload::load_all(path = "codebase/openNCA-1fc479c2ca/openNCA")  # 11/11
# pkgload::load_all(path = "codebase/openNCA-a06c1c7461/openNCA")  # 11/12
pkgload::load_all(path = "codebase/openNCA-e3be44d927/openNCA")  # 11/13

#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)

profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()

#### Test Case 012 ------------------------------------------------------- ####
# M1 SS
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc012"
testcase.id <- "tc012"
p <- "testcase/tc012_M1SS"
params["INPUT1"] = file.path(p, "A0081216.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc012_mct_updated.csv")
params["flags"] = file.path(p, "A0081216_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)

mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc012_mct_updated.json"))
params["map"] = file.path(p, "tc012_mct_updated.json")

flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc012_flags.json"))
params["flags"] = file.path(p, "tc012_flags.json")

#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")

# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)

# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)

# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]

# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]

# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}

# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)

# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }

# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }

# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])

#### Final changes to test ----------------------------------------------- ####
### Optimise Kel
# mct$OPTIMIZEKEL <- 0 # don't optimise
mct$OPTIMIZEKEL <- 1 # optimise

#### Run computation engine ---------------------------------------------- ####
### Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

### Save results to objects
r <- results_list$data_out
e <- results_list$est_data
f <- results_list$flag_data

### Difference in KEL
head(r[c("SDEID", "KEL", "KELTMLO", "KELTMHI", "KELNOPT", "KELRSQ", "AUCXPCTP", "FLGACCEPTKEL")])

2019-11-20 tc017 M4SD specifying partial AURCs via the AUC.#.T1/T2 mechanism leads to a computation engine crash

Partial AURCs were specified as follows:

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2
1        2       18        8       16       12       30

The run_computation execution ends in a crash:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in doTryCatch(return(expr), name, parentenv, handler): object 'aurc_par_len' not found
For SDEID 58098661
In addition: Warning message:
In run_M4_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in doTryCatch(return(expr), name, parentenv, handler): object 'aurc_par_len' not found
For SDEID 58098661 

2019-11-20 tc010 M1SD - test case variant with 3 profiles (SDEIDs) with duplicate records, i.e. exact same TIME and differing CONCENTRATION values - computation engine fails unacceptably

Behavior in this case is that the computation engine should report the issue, report what records are impacted by it and generate missing values for all of the expected parameters for the affected PROFILE but not crash and must continue to process and generate parameters for all subsequent profiles.

The following table shows the duplicated TIME records/values for 3 SDEIDs:

     PKDATAROWID     SDEID   SUBJID PKPTMS PKATPD TREATXT PERIOD  PKCNCN
170           27 908214575 10011002    0.0  0.000   10 mg      3  0.0000
171           28 908214575 10011002    0.5  0.600   10 mg      3  6.2900
172           29 908214575 10011002    1.0  1.000   10 mg      3  7.9300
173           30 908214575 10011002    1.5  1.500   10 mg      3  7.6500
174           31 908214575 10011002    2.0  2.000   10 mg      3  8.0100
175           32 908214575 10011002    2.5  2.500   10 mg      3 16.8000
176           33 908214575 10011002    4.0  4.000   10 mg      3 23.1000
177           34 908214575 10011002    8.0  8.000   10 mg      3 16.4000
178           35 908214575 10011002   12.0 12.000   10 mg      3 10.1000
179           36 908214575 10011002   16.0 16.000   10 mg      3  7.5800
1791          37 908214575 10011002   16.0 16.000   10 mg      3 15.1600
180           38 908214575 10011002   24.0 24.000   10 mg      3  6.2800
181           39 908214575 10011002   48.0 48.000   10 mg      3  1.7900
182           40 908214575 10011002   72.0 72.000   10 mg      3  0.5880
118          119 257914734 10011005    0.0  0.000    3 mg      2  0.0000
119          120 257914734 10011005    0.5  0.500    3 mg      2  1.7400
120          121 257914734 10011005    1.0  1.000    3 mg      2  2.9900
121          122 257914734 10011005    1.5  1.500    3 mg      2  2.1500
122          123 257914734 10011005    2.0  2.000    3 mg      2  1.8500
123          124 257914734 10011005    2.5  2.500    3 mg      2  1.5200
124          125 257914734 10011005    4.0  4.017    3 mg      2  2.6700
125          126 257914734 10011005    8.0  8.000    3 mg      2  2.8700
126          127 257914734 10011005   12.0 12.017    3 mg      2  1.7400
127          128 257914734 10011005   16.0 16.000    3 mg      2  1.2300
1271         129 257914734 10011005   16.0 16.000    3 mg      2  2.4600
128          130 257914734 10011005   24.0 24.000    3 mg      2  1.2000
129          131 257914734 10011005   48.0 48.000    3 mg      2  0.6720
130          132 257914734 10011005   72.0 72.000    3 mg      2  0.2240
144          198 949633293 10011008    0.0  0.000    3 mg      2  0.0000
145          199 949633293 10011008    0.5  0.500    3 mg      2  1.3700
146          200 949633293 10011008    1.0  1.000    3 mg      2  1.7500
147          201 949633293 10011008    1.5  1.500    3 mg      2  1.2000
148          202 949633293 10011008    2.0  2.000    3 mg      2  1.2400
149          203 949633293 10011008    2.5  2.533    3 mg      2  1.9400
150          204 949633293 10011008    4.0  4.000    3 mg      2  3.5700
151          205 949633293 10011008    8.0  8.000    3 mg      2  3.6500
152          206 949633293 10011008   12.0 12.000    3 mg      2  2.2300
153          207 949633293 10011008   16.0 16.000    3 mg      2  1.3600
1531         208 949633293 10011008   16.0 16.000    3 mg      2  2.7200
154          209 949633293 10011008   24.0 24.000    3 mg      2  1.1800
155          210 949633293 10011008   48.0 48.000    3 mg      2  0.3400
156          211 949633293 10011008   72.0 72.000    3 mg      2  0.0748
 

and the error from the computation engine crash:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in FUN(X[[i]], ...): Error in kel: unable to calcualte due to duplicate entires in 'time' vector
For SDEID 257914734
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in FUN(X[[i]], ...): Error in kel: unable to calcualte due to duplicate entires in 'time' vector
For SDEID 257914734 

2019-11-18 Incorrect partial AUCs when extrapolating from same point

Issue

When including multiple partial AUC that extrapolate from the same point. For example for tc015 the partial AUCs 18-505 and 18-550:

  • both require extrapolation (final time is 504)
  • both extrapolate from the same point (18)

This results in the same AUC.

      SDEID  AUC0_120  AUC80_505 AUC18_505 AUC18_550  AUC0_720  AUC0_505
1 106469843  159513.0   58235.45  144957.0  144957.0  204068.1  204068.1
2 119434169  129250.5   54387.23  122510.6  122510.6  171431.4  171431.4
3  12659123 1158678.4  455358.79 1047471.1 1047471.1 1527374.6 1527374.6
4 133443675  670111.1  224537.42  550947.2  550947.2  846810.7  846810.7
5 147147665 2707675.8 1533806.64 2967803.1 2967803.1 3985682.1 3985682.1
6 162298431  381595.8  110243.82  302533.7  302533.7  464524.6  464524.6

This same behaviour occurs when the point shared by the partial AUCs is zero, and does not affect interpolated values (120).

This has been replicated in tc011, tc012 and tc015. This does not occur in tc010. I am yet to test this for tc013, tc014 and tc016, but they may also be affected.

2019-11-20 tc011 and tc012 both trigger warnings concerning CONCOUTPUTUNIT not in proper form in unit_conversion routine

Following occurs when executing tc012 but warnings from tc011 are similar:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
unit_conversion : Unit Class 1 (Time) time_col:  TMAX1 TMAX2 TMIN1 TMIN2 TLAST TLAG KELTMLO KELTMHI THALF LASTTIME MRTEVIFO1 MRTEVIFO2 MRTEVIFP1 MRTEVIFP2 TAU1 TAU2  parameters are scaled from  HR  to  HR  via scaling factor:  1 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE1  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE2  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 4 (Volume) volume_col:  VZFTAU1 VZFTAU2  parameters are scaled from  ML  to  L  via scaling factor:  0.001 
unit_conversion : Unit Class 5 (Amount/Volume) conc_col:  CMAX1 CMAX2 CMIN1 CMIN2 CLAST1 CLAST2 CTROUGH1 CTROUGH2 CTROUGHEND1 CTROUGHEND2 CAV1 CAV2  parameters are scaled from  UG/ML  to  NG/ML  via scaling factor:  1000 
unit_conversion : Unit Class 6 (1/Time) kel_col:  KEL  parameters are scaled from  1/HR  to  1/HR  via scaling factor:  1 
unit_conversion : Unit Class 7 (Volume/Time) cl_col:  CLFTAU1 CLFTAU2  parameters are scaled from  ML/HR  to  L/HR  via scaling factor:  0.001 
unit_conversion : Unit Class 8: (Amount.Time/Volume) auc_col:  AUCALL AUCLAST AUCLAST1 AUCLAST2 AUCLASTC1 AUCLASTC2 AUCINFO AUCINFOC AUCINFP AUCINFPC AUCTAU1 AUCTAU2  parameters are scaled from  UG.HR/ML  to  NG.HR/ML  via scaling factor:  1000 
unit_conversion : Unit Class 9: (Amount.Time.Time/Volume) aumc_col:  AUMCTAU1 AUMCTAU2  parameters are scaled from  UG.HR.HR/ML  to  NG.HR.HR/ML  via scaling factor:  1000 
unit_conversion : Unit Class 12: ([Amount/Volume]/Amount) concdn_col:  CMAXDN1 CMAXDN2  parameters are scaled from  UG/ML/MG  to  NG/ML/MG  via scaling factor:  1000 
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In run_M1_SS_computation(data = merged_data, map = map_data,  ... :
  Flag 'FLGEMESIS' is not present in the dataset
2: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
3: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
4: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
5: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
6: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
7: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
8: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
9: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
10: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :
  'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
11: In unit_conversion(data = data_data, map = map_data, result = data_data,  ... :

new MCT item: DATADISPLAYLIST

@Rudraya, Currently, MCT includes PARAMETERDISPLAYLIST which, out of necessity is required to include the parameters to return for a virtual compute call (i.e. parameterset argument == "PARAMETERDISPLAYLIST") AS WELL AS any data items from the input dataset needed to display in the KEL parameter results pane in the Application Analysis module.

In order to separate the DATA items from the computation engine PARAMETER result items being displayed in the Application Analysis Module a new MCT entry is being introduced with openNCA 2.0.1, the DATADISPLAYLIST.

DATADISPLAYLIST will contain data field names from the input dataset required to display in the KEL parameter results pane in the application and now the PARAMETERDISPLAYLIST will only have names of the parameters required.

It is considered that the virtual compute call wrapper script can be updated to manage changes in openNCA 2.0.1 that are required for this without modification to the compute engine code itself but this issue is entered for awareness and to consider the implications in more depth as development proceeds with openNCA CE 2.0.1. If modifications are required to the wrapper script that calls the compute engine for virtual compute calls, these will be done separately from the work being pursued by @Rudraya .

Running tc016 provides empty est_data output

Issue

No est_data output is included in the output for tc016 (unchanged).

This issue was inherited from the master branch.

Running run_computation and checking the values stored for est_data provides the following output:

[1] PKDATAROWID SDEID       TIME        CEST_KEL    CEST_INT    CEST_EXT    CEST_C0     CEST_TLAST 
<0 rows> (or 0-length row.names)

2019-11-14 "Subscript out of bounds" error for M2 SD

Error

When running tc013 with no changes the following error and traceback is given:

 Error in value[[3L]](cond) : 
  Error in value[[jvseq[[jjj]]]]: subscript out of bounds
For SDEID 10589286 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M2_SD_computation.R#1683
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M2_SD_computation.R#804
2. run_M2_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2229
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

This error has been introduced in 6284702 and did not occur in the previous commit e3be44d.

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)

#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-a06c1c7461/openNCA")  # 11/12
# pkgload::load_all(path = "codebase/openNCA-e3be44d927/openNCA")  # 11/13
pkgload::load_all(path = "codebase/openNCA-6284702d62/openNCA")  # 11/14

#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)

profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()

#### Test Case 013 ------------------------------------------------------- ####
# M2 SD
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc013"
testcase.id <- "tc013"
p <- "testcase/tc013_M2SD"
params["INPUT1"] = file.path(p, "B2901001.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc013_mct_updated.csv")
params["flags"] = file.path(p, "B2901001_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)

mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc013_mct_updated.json"))
params["map"] = file.path(p, "tc013_mct_updated.json")

flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc013_flags.json"))
params["flags"] = file.path(p, "tc013_flags.json")

#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")

# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)

# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)

# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]

# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]

# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}

# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)

# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }

# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }

# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])

#### Run computation engine ---------------------------------------------- ####
### Run computation
# pretime <- Sys.time()
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

2019-11-20 Interpolation still occurs when mct$INCLUDEINTERPOLATION == 0

Issue

When setting INCLUDEINTERPOLATION in the mct to 0, interpolation still occurs. This has been tested and found to occur for tc010, tc011, tc012, tc013, tc014 (using historic commit 066fa5d), tc015, tc016. Testing of test cases without interpolation requested in the mct were changed to request a partial AUC with interpolation.

mct$INCLUDEINTERPOLATION <- 1
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)
r_on <- results_list$data_out
e_on <- results_list$est_data
f_on <- results_list$flag_data

mct$INCLUDEINTERPOLATION <- 0
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)
r_off <- results_list$data_out
e_off <- results_list$est_data
f_off <- results_list$flag_data

all.equal(r_on, r_off)
all.equal(e_on, e_off)
all.equal(f_on, f_off)
> all.equal(r_on, r_off)
[1] TRUE
> all.equal(e_on, e_off)
[1] TRUE
> all.equal(f_on, f_off)
[1] TRUE

2019-11-20 tc010 M1SD - test case variant with 3 profiles (SDEIDs) with duplicate records, i.e. exact same TIME and CONCENTRATION - computation engine fails unacceptably

Behavior in this case is that the computation engine should report the issue, report what records are impacted by it and ignore the duplication, i.e. effectively ignore one of the records with the duplicated concentration and time values but continue to generate parameters.

The following table shows the duplicated values for 3 SDEIDs:

    PKDATAROWID     SDEID   SUBJID PKPTMS PKATPD TREATXT PERIOD  PKCNCN
170           27 908214575 10011002    0.0  0.000   10 mg      3  0.0000
171           28 908214575 10011002    0.5  0.600   10 mg      3  6.2900
172           29 908214575 10011002    1.0  1.000   10 mg      3  7.9300
173           30 908214575 10011002    1.5  1.500   10 mg      3  7.6500
174           31 908214575 10011002    2.0  2.000   10 mg      3  8.0100
175           32 908214575 10011002    2.5  2.500   10 mg      3 16.8000
176           33 908214575 10011002    4.0  4.000   10 mg      3 23.1000
177           34 908214575 10011002    8.0  8.000   10 mg      3 16.4000
178           35 908214575 10011002   12.0 12.000   10 mg      3 10.1000
179           36 908214575 10011002   16.0 16.000   10 mg      3  7.5800
1791          37 908214575 10011002   16.0 16.000   10 mg      3  7.5800
180           38 908214575 10011002   24.0 24.000   10 mg      3  6.2800
181           39 908214575 10011002   48.0 48.000   10 mg      3  1.7900
182           40 908214575 10011002   72.0 72.000   10 mg      3  0.5880
118          119 257914734 10011005    0.0  0.000    3 mg      2  0.0000
119          120 257914734 10011005    0.5  0.500    3 mg      2  1.7400
120          121 257914734 10011005    1.0  1.000    3 mg      2  2.9900
121          122 257914734 10011005    1.5  1.500    3 mg      2  2.1500
122          123 257914734 10011005    2.0  2.000    3 mg      2  1.8500
123          124 257914734 10011005    2.5  2.500    3 mg      2  1.5200
124          125 257914734 10011005    4.0  4.017    3 mg      2  2.6700
125          126 257914734 10011005    8.0  8.000    3 mg      2  2.8700
126          127 257914734 10011005   12.0 12.017    3 mg      2  1.7400
127          128 257914734 10011005   16.0 16.000    3 mg      2  1.2300
1271         129 257914734 10011005   16.0 16.000    3 mg      2  1.2300
128          130 257914734 10011005   24.0 24.000    3 mg      2  1.2000
129          131 257914734 10011005   48.0 48.000    3 mg      2  0.6720
130          132 257914734 10011005   72.0 72.000    3 mg      2  0.2240
144          198 949633293 10011008    0.0  0.000    3 mg      2  0.0000
145          199 949633293 10011008    0.5  0.500    3 mg      2  1.3700
146          200 949633293 10011008    1.0  1.000    3 mg      2  1.7500
147          201 949633293 10011008    1.5  1.500    3 mg      2  1.2000
148          202 949633293 10011008    2.0  2.000    3 mg      2  1.2400
149          203 949633293 10011008    2.5  2.533    3 mg      2  1.9400
150          204 949633293 10011008    4.0  4.000    3 mg      2  3.5700
151          205 949633293 10011008    8.0  8.000    3 mg      2  3.6500
152          206 949633293 10011008   12.0 12.000    3 mg      2  2.2300
153          207 949633293 10011008   16.0 16.000    3 mg      2  1.3600
1531         208 949633293 10011008   16.0 16.000    3 mg      2  1.3600
154          209 949633293 10011008   24.0 24.000    3 mg      2  1.1800
155          210 949633293 10011008   48.0 48.000    3 mg      2  0.3400
156          211 949633293 10011008   72.0 72.000    3 mg      2  0.0748

and the error from the computation engine crash:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in FUN(X[[i]], ...): Error in kel: unable to calcualte due to duplicate entires in 'time' vector
For SDEID 257914734
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in FUN(X[[i]], ...): Error in kel: unable to calcualte due to duplicate entires in 'time' vector
For SDEID 257914734 

2019-11-20 tc018 M4SS no partial AURC generated

Partial AURCs requested are:

  AUC.1.T1 AUC.1.T2
1        0       24

Partial printout of parameters generated indicate that no Partial AURCs are generated:

       SDEID AMT.12.00 AMT.24.00 AE.12.00 AE.24.00 AEPCT.12.00 AEPCT.24.00       AE    AEPCT  MAXRATE1 TMAXRATE1 RATELAST1 MIDPTLAST1 TLAG KEL KELTMLO KELTMHI KELNOPT KELR KELRSQ
1  102652097   79.3760   27.7380  79.3760 107.1140    39688000    53557000 107.1140 53557000 6614.6667         6 2311.5000         18   NA  NA      NA      NA       0   NA     NA
2  155315252   41.3270   22.2250  41.3270  63.5520    20663500    31776000  63.5520 31776000 3443.9167         6 1852.0833         18   NA  NA      NA      NA       0   NA     NA
3  212128320   66.4200   35.6890  66.4200 102.1090    33210000    51054500 102.1090 51054500 5535.0000         6 2974.0833         18   NA  NA      NA      NA       0   NA     NA
4  232007206   43.4750   34.0375  43.4750  77.5125    43475000    77512500  77.5125 77512500 3622.9167         6 3622.9167          6   NA  NA      NA      NA       0   NA     NA
5  303069272    4.3056    3.0774   4.3056   7.3830    14352000    24610000   7.3830 24610000  358.8000         6  256.4500         18   NA  NA      NA      NA       0   NA     NA
6  322184155   44.7300    4.6200  44.7300  49.3500    22365000    24675000  49.3500 24675000 3727.5000         6  385.0000         18   NA  NA      NA      NA       0   NA     NA
7  346821548    8.5995    1.8480   8.5995  10.4475    28665000    34825000  10.4475 34825000  716.6250         6  154.0000         18   NA  NA      NA      NA       0   NA     NA
8  359622627   43.5400   34.5466  43.5400  78.0866    21770000    39043300  78.0866 39043300 3628.3333         6 2878.8833         18   NA  NA      NA      NA       0   NA     NA
9  392430764   35.1200   28.1775  35.1200  63.2975    35120000    63297500  63.2975 63297500 2926.6667         6 2926.6667          6   NA  NA      NA      NA       0   NA     NA
10 395827329   62.4800   28.0416  62.4800  90.5216    31240000    45260800  90.5216 45260800 5206.6667         6 2336.8000         18   NA  NA      NA      NA       0   NA     NA
11  43456658    6.3280    3.7180   6.3280  10.0460    21093333    33486667  10.0460 33486667  527.3333         6  309.8333         18   NA  NA      NA      NA       0   NA     NA
   KELRSQA FLGACCEPTKEL THALF THALFF AURCALL AURCLAST AURCINFO AURCINFP AURCXPCTO AURCXPCTP VOLSUM RATE1 RATE2 MIDPT1 MIDPT2 DI1 TAU1 TOLD1 DOSE1 TIMEU AMOUNTU DOSEU VOLUMEU CONCU
1       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  3.760    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
2       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  3.085    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
3       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  2.940    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
4       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  2.725    NA    NA      6     18  NA   12     0   100    HR      MG    MG       L NG/ML
5       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  2.160    NA    NA      6     18  NA   24     0    30    HR      MG    MG       L NG/ML
6       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  2.083    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
7       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  1.190    NA    NA      6     18  NA   24     0    30    HR      MG    MG       L NG/ML
8       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  2.166    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
9       NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  1.775    NA    NA      6     18  NA   12     0   100    HR      MG    MG       L NG/ML
10      NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  1.608    NA    NA      6     18  NA   24     0   200    HR      MG    MG       L NG/ML
11      NA            0    NA   <NA>      NA       NA       NA       NA        NA        NA  1.210    NA    NA      6     18  NA   24     0    30    HR      MG    MG       L NG/ML
   KELU CLU AUCU AUMCU AUCNORMU    AURCU CONCNORMU RATEU VOLUMEWU CLWU    STUDY SITEID   SUBJID RAND                              TREATXT TRTCD   PKCOLL PKBDFLD      PKTERM PERIODU
1  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011198 1056     PF-05175157- 200mg - T2DM cohort     F INTERVAL   URINE PF-05175157      NA
2  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011132 1053     PF-05175157- 200mg - T2DM cohort     F INTERVAL   URINE PF-05175157      NA
3  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011219 1062     PF-05175157- 200mg - T2DM cohort     F INTERVAL   URINE PF-05175157      NA
4  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011130 1042 PF-05175157- 100 mg  BID- HOV Cohort     E INTERVAL   URINE PF-05175157      NA
5  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011007 1006      PF-05175157- 30mg -  HOV Cohort     B INTERVAL   URINE PF-05175157      NA
6  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011048 1026     PF-05175157- 200mg -  HOV Cohort     D INTERVAL   URINE PF-05175157      NA
7  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011023 1011      PF-05175157- 30mg -  HOV Cohort     B INTERVAL   URINE PF-05175157      NA
8  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011078 1033     PF-05175157- 200mg -  HOV Cohort     D INTERVAL   URINE PF-05175157      NA
9  1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011128 1040 PF-05175157- 100 mg  BID- HOV Cohort     E INTERVAL   URINE PF-05175157      NA
10 1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011086 1036     PF-05175157- 200mg -  HOV Cohort     D INTERVAL   URINE PF-05175157      NA
11 1/HR  NA   NA    NA       NA ML.UG/ML        NA UG/HR       NA   NA B1731007   1001 10011011 1008      PF-05175157- 30mg -  HOV Cohort     B INTERVAL   URINE PF-05175157      NA
   PERIOD VISITU VISIT PHASE     HT WT AGEDERU AGEDER WTUNI WTRAW HTUNI HTRAW RACEOTH RACES SEX RACIALD ETHNIC                               ACTTRT ACTTRTS ACTTRTC PKPCOM
1      NA    DAY    14    NA 168.91 NA      YR     54    NA    NA    IN  66.5      NA     W   M      NA     NA     PF-05175157- 200mg - T2DM cohort       F      NA   <NA>
2      NA    DAY    14    NA 167.89 NA      YR     43    NA    NA    IN  66.1      NA     W   M      NA     NA     PF-05175157- 200mg - T2DM cohort       F      NA   <NA>
3      NA    DAY    14    NA 169.93 NA      YR     48    NA    NA    IN  66.9      NA     W   M      NA     NA     PF-05175157- 200mg - T2DM cohort       F      NA   <NA>
4      NA    DAY    14    NA 174.50 NA      YR     41    NA    NA    IN  68.7      NA     W   M      NA     NA PF-05175157- 100 mg  BID- HOV Cohort       E      NA   <NA>
5      NA    DAY    14    NA 175.26 NA      YR     22    NA    NA    IN  69.0      NA     W   M      NA     NA      PF-05175157- 30mg -  HOV Cohort       B      NA   <NA>
6      NA    DAY    14    NA 170.94 NA      YR     32    NA    NA    IN  67.3      NA     W   M      NA     NA     PF-05175157- 200mg -  HOV Cohort       D      NA   <NA>
7      NA    DAY    14    NA 175.77 NA      YR     40    NA    NA    IN  69.2      NA     W   M      NA     NA      PF-05175157- 30mg -  HOV Cohort       B      NA   <NA>
8      NA    DAY    14    NA 162.56 NA      YR     43    NA    NA    IN  64.0      NA     W   M      NA     NA     PF-05175157- 200mg -  HOV Cohort       D      NA   <NA>
9      NA    DAY    14    NA 175.77 NA      YR     31    NA    NA    IN  69.2      NA     W   M      NA     NA PF-05175157- 100 mg  BID- HOV Cohort       E      NA   <NA>
10     NA    DAY    14    NA 160.78 NA      YR     34    NA    NA    IN  63.3      NA     W   M      NA     NA     PF-05175157- 200mg -  HOV Cohort       D      NA   <NA>
11     NA    DAY    14    NA 170.94 NA      YR     33    NA    NA    IN  67.3      NA     W   M      NA     NA      PF-05175157- 30mg -  HOV Cohort       B      NA   <NA>

2019-11-20 tc010 M1SD extrapolation still occurs when mct$INCLUDEEXTRAPOLATION == 0

Issue

When setting INCLUDEEXTRAPOLATION in the mct to 0, extrapolation still occurs in tc010. This issue appears to be specific to M1SD as INCLUDEEXTRAPOLATION turns off extrapolation for tc011, tc012, tc013, tc014 (using historic commit 066fa5d), tc015 and tc016.

The output for partial AUCs for these testcases where INCLUDEEXTRAPOLATION "works" but it isn't clear to me if they work as desired.

mct$INCLUDEEXTRAPOLATION <- 1
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)
r_on <- results_list$data_out
e_on <- results_list$est_data
f_on <- results_list$flag_data

mct$INCLUDEEXTRAPOLATION <- 0
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)
r_off <- results_list$data_out
e_off <- results_list$est_data
f_off <- results_list$flag_data

all.equal(r_on, r_off)
all.equal(e_on, e_off)
all.equal(f_on, f_off)
> all.equal(r_on, r_off)
[1] TRUE
> all.equal(e_on, e_off)
[1] TRUE
> all.equal(f_on, f_off)
[1] TRUE

2019-11-17 tc010 if OPTIMIZEKEL routine is run it chooses points that are not consistent with constraints

When testing with tc010 (M1SD) with mct$FLGACCEPTKELCRIT <- "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=20.0"

and comparing runs with no-optimization, i.e. Analyst selected points for terminal elimination phase, against optimization selection, there is at least one profile where the optimization routine doesn't select a data points that are appropriate, i.e. see SDEID == 257914734 below. The "optimized" selection of points results in KELNOPT =10, KELRSQ==0.8988036, AUCXPCTP==10.26398558 and thus FLGACCEPTKEL==0. The analyst chosen points ensures that KELRSQ is > 0.9, i.e. 0.9613906 but with KELNOPT==5 and AUCXPCTP==9.76685944.

It appears that the optimization routine is favoring KELNOPT and AUCXPCTP over KELRSQ but this is not acceptable. Note that none of the runs included FLGNOCMAX included in the mct for optimization runs.

Note that this same behavior is exhibited with tc012. The results of that execution are reported in a separate issue.

       SDEID SUBJID.nonopt KEL.nonopt KELRSQ.nonopt KELNOPT.nonopt AUCXPCTP.nonopt FLGACCEPTKEL.nonopt SUBJID.opt    KEL.opt KELRSQ.opt KELNOPT.opt AUCXPCTP.opt FLGACCEPTKEL.opt
1  111299859      10011008 0.05566002     0.9988961              3      7.23522456                   1   10011008 0.05815238  0.9947858           4   6.81888591                1
2  112146587      10011003 0.08330574     0.9951571              4      1.99934371                   1   10011003 0.08695843  0.9906898           5   1.83937140                1
3  123811839      10011011 0.05281662     0.9636440              7      0.08823883                   1   10011011 0.06147205  0.9436264          10   0.05578474                1
4  145593586      10011020 0.04739864     0.9966203              4      0.47100278                   1   10011020 0.04258080  0.9882692           9   0.58769593                1
5  202367199      10011021 0.04684777     0.9835298              6      0.19312645                   1   10011021 0.05424527  0.9623526           9   0.13064667                1
6  233891605      10011016 0.05222238     0.9894347              6      0.09322297                   1   10011016 0.05989964  0.9674385           9   0.06301853                1
7  257914734      10011005 0.03131748     0.9613906              5      9.76685944                   1   10011005 0.03062752  0.8988036          10  10.26398558                0
8    2925168      10011002 0.04431395     0.9997271              3      4.66602992                   1   10011002 0.04240636  0.9980178           5   4.98349076                1
9  355441192      10011014 0.04208899     0.9992629              4      0.33226979                   1   10011014 0.04880107  0.9846049           8   0.23672166                1
10  40876220      10011006 0.03813488     0.9655010              4      6.23791345                   1   10011006 0.04126708  0.9609512           5   5.54311872                1
11 409149207      10011011 0.05021346     0.9543205              7      0.11182722                   1   10011011 0.05697667  0.9365584           9   0.07813746                1
12 427589065      10011023 0.04673851     0.9773159              6      0.16395512                   1   10011023 0.05595121  0.9459362           9   0.10094153                1
13 443820693      10011007 0.04421840     0.9823067              6      4.70630987                   1   10011007 0.04372414  0.9785370           5   4.79813326                1
14 463304641      10011009 0.03739737     0.9407686              5      5.71496594                   1   10011009 0.04165165  0.9198912           6   4.79325626                1
15 471081571      10011001 0.04627941     1.0000000              3      2.99165240                   1   10011001 0.04888617  0.9900202           6   2.70670195                1
16 499820574      10011018 0.04165683     0.9703506              6      0.35211658                   1   10011018 0.04941609  0.9499996           9   0.23018682                1
17 500091016      10011004 0.05335558     0.9999235              3      2.70851854                   1   10011004 0.04493265  0.9655896          10   3.66911987                1
18 500805530      10011013 0.03427675     0.9996774              3      0.67790230                   1   10011013 0.04440325  0.9793138           8   0.41060023                1
19 503192693      10011017 0.03532785     0.9998712              4      0.49131046                   1   10011017 0.04686789  0.9710978           8   0.27016466                1
20 507682703      10011004 0.06333590     0.9887088              5      1.10940746                   1   10011004 0.06333590  0.9887088           5   1.10940746                1
21 518707064      10011015 0.03432966     0.9893330              4      0.43744959                   1   10011015 0.05271560  0.9465682          10   0.16557760                1
22 524844737      10011013 0.02935190     0.9976472              3      0.86654332                   1   10011013 0.04307692  0.9622531           8   0.42210649                1
23 539272807      10011010 0.04133378     0.9955633              6      0.52463423                   1   10011010 0.04518451  0.9808084           8   0.42557031                1
24 565486844      10011026 0.03199563     0.9952792              4      1.01580296                   1   10011026 0.04391688  0.9360280          10   0.50664052                1
25 577177821      10011010 0.04579767     0.9918967              6      0.26211759                   1   10011010 0.05018806  0.9772797           8   0.20836321                1
26 579271281      10011019 0.03547044     0.9990374              3      0.27534233                   1   10011019 0.05372507  0.9648265           8   0.11519217                1
27 582963447      10011006 0.05260636     0.9991340              3      2.70867797                   1   10011006 0.05053362  0.9945994           5   2.87814254                1
28 621374373      10011025 0.03378230     0.9809676              4      0.46584953                   1   10011025 0.04884008  0.9593891           8   0.21422584                1
29  63536292      10011003 0.08502919     0.9889092              3     14.58611253                   1   10011003 0.08502919  0.9889092           3  14.58611253                1
30 652003114      10011022 0.02668476     0.9898088              4      1.85008395                   1   10011022 0.03708543  0.9626457           8   1.00976424                1
31 668240634      10011014 0.03609468     0.9940950              4      0.43732511                   1   10011014 0.04998195  0.9592045           9   0.21119266                1
32 670348158      10011018 0.02964177     0.9478122              7      2.35042936                   1   10011018 0.03355781  0.9507289           8   1.96793076                1
33 732449590      10011026 0.02936040     0.9993806              4      2.41913473                   1   10011026 0.03235872  0.9941782           7   2.04753778                1
34 754174517      10011023 0.02756380     0.9961138              3      1.02224944                   1   10011023 0.04595063  0.9720685           9   0.40095666                1
35 759109991      10011017 0.03745894     0.9993944              3      0.26760127                   1   10011017 0.05460425  0.9633959           9   0.11642010                1
36 773547601      10011007 0.04050294     0.9863159              6      5.92845655                   1   10011007 0.03561278  0.9504574           9   7.43474461                1
37 822445112      10011001 0.03273358     0.9955421              4      7.68404767                   1   10011001 0.03986173  0.9618308           7   5.66672776                1
38 832770130      10011019 0.03672732     0.9982046              3      0.70887642                   1   10011019 0.04341118  0.9959798          10   0.54369069                1
39 836945347      10011015 0.03595652     0.9942042              4      0.32536639                   1   10011015 0.05512637  0.9614452          10   0.12251302                1
40 908214575      10011002 0.04934163     0.9988047              3      2.96074170                   1   10011002 0.04935120  0.9893417           6   2.91998068                1
41 919470224      10011012 0.03779177     0.9991832              3      0.48016959                   1   10011012 0.04762913  0.9812637           8   0.29612886                1
42 921404682      10011016 0.04101774     0.9977553              3      0.20593715                   1   10011016 0.05790952  0.9787239          10   0.09482574                1
43 922793085      10011012 0.04543198     0.9889319              7      0.36714559                   1   10011012 0.04708142  0.9848534           8   0.33577338                1
44 927491002      10011027 0.04082005     0.9985587              3      0.29914548                   1   10011027 0.05079954  0.9910480           8   0.19388510                1
45 935549083      10011009 0.03852380     0.9998668              4      5.42144297                   1   10011009 0.04309364  0.9745427           6   4.52221548                1
46 949633293      10011008 0.05746775     0.9968212              3      1.88276503                   1   10011008 0.05398483  0.9893433           5   2.07933473                1
47 954855373      10011024 0.04864521     0.9585562              6      0.11235917                   1   10011024 0.06186859  0.9429812          11   0.05618289                1
48 978075228      10011005 0.04315283     0.9848178              3      9.84141179                   1   10011005 0.05431844  0.9364206           5   7.19276947                1

2019-11-14 "missing values" error in M2 SS

Error

When running tc014 with no changes the following error and traceback is given:

Error in `[<-.data.frame`(`*tmp*`, eval(parse(text = flag_subset)), ,  : 
  missing values are not allowed in subscripted assignments of data frames 
5. stop("missing values are not allowed in subscripted assignments of data frames") 
4. `[<-.data.frame`(`*tmp*`, eval(parse(text = flag_subset)), , 
    value = structure(list(SDEID = c(NA, NA, NA, NA, NA, "551055579", 
    NA, NA, NA, NA, NA), DOSE1 = c(NA, NA, NA, NA, NA, "1006", 
    NA, NA, NA, NA, NA), DOSEC = c(NA, NA, NA, NA, NA, "1006",  ... at run_M2_SS_computation.R#2331
3. `[<-`(`*tmp*`, eval(parse(text = flag_subset)), , value = structure(list(
    SDEID = c(NA, NA, NA, NA, NA, "551055579", NA, NA, NA, NA, 
    NA), DOSE1 = c(NA, NA, NA, NA, NA, "1006", NA, NA, NA, NA, 
    NA), DOSEC = c(NA, NA, NA, NA, NA, "1006", NA, NA, NA, NA,  ... at run_M2_SS_computation.R#2331
2. run_M2_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2235
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

This error has been introduced in 6284702 and did not occur in the previous commit e3be44d.

Reproducible Example

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)

#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-a06c1c7461/openNCA")  # 11/12
# pkgload::load_all(path = "codebase/openNCA-e3be44d927/openNCA")  # 11/13
pkgload::load_all(path = "codebase/openNCA-6284702d62/openNCA")  # 11/14

#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)

profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()

#### Test Case 014 ------------------------------------------------------- ####
# M2 SS - nominal time
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc014"
testcase.id <- "tc014"
p <- "testcase/tc014_M2SS"
params["INPUT1"] = file.path(p, "A4021010.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc014_mct_updated.csv")
params["flags"] = file.path(p, "A4021010_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)

mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc014_mct_updated.json"))
params["map"] = file.path(p, "tc014_mct_updated.json")

flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc014_flags.json"))
params["flags"] = file.path(p, "tc014_flags.json")

#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")

# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)

# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)

# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]

# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]

# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}

# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)

# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }

# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }

# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])

#### Run computation engine ---------------------------------------------- ####
### Run computation
# pretime <- Sys.time()
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

2019-11-20 tc010 M1SD test case variant with All FLGEXAUC set to 1, i.e. exclude all data points from AUC computations crashes computation engine

This WAS working appropriately in current master branch, i.e. expectation is that all parameters other than AUCs are computed as expected. Requested AUCs are set to NA.

flags$FLGEXAUC <- rep(1, nrow(flags)) # exclude all records/data points from KEL calcs
> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168 

2019-11-20 tc015 M3SD comp engine error when parameterset set to "PARAMETERDISPLAYLIST"

Issue

When using tc015 and using the value of "PARAMETERDISPLAYLIST" for parameterset the computation engine crashes. This does not cause an error for tc010, tc011, tc013 or tc014. Errors for tc012 and tc016 are documented separately due to their unique error messages.

Error

parameterset <- "PARAMETERDISPLAYLIST"
Error in value[[3L]](cond) : 
  Error in `[<-.data.frame`(`*tmp*`, i, , value = c(12659123, 1e+05, 32700, : replacement has 56 items, need 57
For SDEID 12659123 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M3_SD_computation.R#1659
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M3_SD_computation.R#814
2. run_M3_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2241
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

2019-11-19 tc010 Partial AUCs whose start and end Times are both extrapolated cause crash

Partial AUCs where both T1 and T2 times are both extrapolated cause crash with subscript out of bounds error.

Note here that the following sampling times are available and the requested partial AUCs are a mixture of partial AUCs with interpolated values and extrapolated values

Sample collection Times

> table(d$PKPTMS, d$TREATXT)
     
      1 mg 10 mg 100 mg 3 mg 30 mg 300 mg 600 mg 900 mg
  0      6     6      6    6     6      6      6      6
  0.5    6     6      6    6     6      6      6      6
  1      6     6      6    6     6      6      6      6
  1.5    6     6      0    6     0      0      0      0
  2      6     6      6    6     6      6      6      6
  2.5    6     6      0    6     0      0      0      0
  4      6     6      6    6     6      6      6      6
  8      6     6      6    6     6      6      6      6
  12     6     6      6    6     6      6      6      6
  16     6     6      6    6     6      6      6      6
  24     6     6      6    6     6      6      6      6
  48     6     6      6    6     6      6      6      6
  72     6     6      6    6     6      6      6      6
  96     0     0      6    0     6      6      6      6
  120    0     0      6    0     6      6      6      6

tc010 ex1: Simple case that is successfully executed

Where the partial AUCs are specified through a mix of only interpolated 1 and 3, designed 2 time
points, the parameters generated and estimated concentration results appear rational.

ex1: Partial AUCs

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2
1        0        7        8       48        0       64

ex1: Estimated concentration Dataset

    PKDATAROWID     SDEID TIME     CEST_KEL     CEST_INT CEST_EXT CEST_C0 CEST_TLAST
4            NA   2925168    7           NA   3.59500000       NA      NA         NA
1      22289754   2925168   24   1.70263761           NA       NA      NA         NA
2      22289755   2925168   48   0.58780724           NA       NA      NA         NA
5            NA   2925168   64           NA   0.32866667       NA      NA         NA
3      22289756   2925168   72   0.20293065           NA       NA      NA 0.20293065
51           NA  40876220    7           NA   1.11575000       NA      NA         NA
11     22289571  40876220   16   0.49544432           NA       NA      NA         NA
21     22289572  40876220   24   0.36517471           NA       NA      NA         NA
31     22289573  40876220   48   0.14622386           NA       NA      NA         NA
6            NA  40876220   64           NA   0.08246667       NA      NA         NA
41     22289574  40876220   72   0.05855120           NA       NA      NA 0.05855120
42           NA  63536292    7           NA   1.03375000       NA      NA         NA
12     22289531  63536292   12   0.51896071           NA       NA      NA         NA
22     22289532  63536292   16   0.36933771           NA       NA      NA         NA
32     22289533  63536292   24   0.18706907           NA       NA      NA 0.18706907
52           NA  63536292   64           NA   0.00000000       NA      NA         NA
43           NA 111299859    7           NA   1.31050000       NA      NA         NA
13     22289597 111299859   16   0.58377725           NA       NA      NA         NA
23     22289598 111299859   24   0.37399383           NA       NA      NA         NA
33     22289599 111299859   48   0.09833684           NA       NA      NA 0.09833684
53           NA 111299859   64           NA   0.03250000       NA      NA         NA
54           NA 112146587    7           NA   2.98750000       NA      NA         NA
14     22289765 112146587   12   1.59483827           NA       NA      NA         NA
24     22289766 112146587   16   1.14287770           NA       NA      NA         NA
34     22289767 112146587   24   0.58690253           NA       NA      NA         NA
44     22289768 112146587   48   0.07948124           NA       NA      NA 0.07948124
61           NA 112146587   64           NA   0.02586667       NA      NA         NA

ex1: Output parameters:

       SDEID      AUC0_7     AUC8_48     AUC0_64
1  111299859    5.150750   16.115864    23.59851
2  112146587   16.630430   27.186570    47.51955
3  123811839 1826.885933 1140.509935  3155.39210
4  145593586  759.772228 1482.006413  2543.66350
5  202367199 6447.260530 5524.243972 12915.26200
6  233891605 2026.373649 1432.192203  3683.11590
7  257914734   16.023791   46.488059    73.48402
8    2925168   19.037500   62.309949    91.99822
9  355441192  395.187556  414.853089   883.42274
10  40876220    3.982875   15.775430    22.50988
11 409149207 4278.933737 2468.641048  7170.07381
12 427589065 7730.206336 5323.498495 13984.33804
13 443820693   11.910000   51.133415    70.47629
14 463304641   94.077277  145.965750   268.55542

tc010 ex2: adding an partial AUC that requires extrapolation at T2

ex2: Partial AUCs

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2
1        0        7        8       48        0       64       12      130

ex2: Estimated Concentration Dataset

    PKDATAROWID     SDEID TIME     CEST_KEL     CEST_INT     CEST_EXT CEST_C0 CEST_TLAST
4            NA   2925168    7           NA   3.59500000           NA      NA         NA
1      22289754   2925168   24   1.70263761           NA           NA      NA         NA
2      22289755   2925168   48   0.58780724           NA           NA      NA         NA
5            NA   2925168   64           NA   0.32866667           NA      NA         NA
3      22289756   2925168   72   0.20293065           NA           NA      NA 0.20293065
6            NA   2925168  130           NA           NA 1.552816e-02      NA         NA
51           NA  40876220    7           NA   1.11575000           NA      NA         NA
11     22289571  40876220   16   0.49544432           NA           NA      NA         NA
21     22289572  40876220   24   0.36517471           NA           NA      NA         NA
31     22289573  40876220   48   0.14622386           NA           NA      NA         NA
61           NA  40876220   64           NA   0.08246667           NA      NA         NA
41     22289574  40876220   72   0.05855120           NA           NA      NA 0.05855120
7            NA  40876220  130           NA           NA 6.411404e-03      NA         NA
42           NA  63536292    7           NA   1.03375000           NA      NA         NA
12     22289531  63536292   12   0.51896071           NA           NA      NA         NA
22     22289532  63536292   16   0.36933771           NA           NA      NA         NA
32     22289533  63536292   24   0.18706907           NA           NA      NA 0.18706907
52           NA  63536292   64           NA   0.00000000           NA      NA         NA
62           NA  63536292  130           NA           NA 2.278583e-05      NA         NA
43           NA 111299859    7           NA   1.31050000           NA      NA         NA
13     22289597 111299859   16   0.58377725           NA           NA      NA         NA
23     22289598 111299859   24   0.37399383           NA           NA      NA         NA
33     22289599 111299859   48   0.09833684           NA           NA      NA 0.09833684
53           NA 111299859   64           NA   0.03250000           NA      NA         NA
63           NA 111299859  130           NA           NA 1.024574e-03      NA         NA
54           NA 112146587    7           NA   2.98750000           NA      NA         NA
14     22289765 112146587   12   1.59483827           NA           NA      NA         NA
24     22289766 112146587   16   1.14287770           NA           NA      NA         NA
34     22289767 112146587   24   0.58690253           NA           NA      NA         NA
44     22289768 112146587   48   0.07948124           NA           NA      NA 0.07948124
64           NA 112146587   64           NA   0.02586667           NA      NA         NA
71           NA 112146587  130           NA           NA 8.581603e-05      NA         NA

ex2: output parameters

       SDEID      AUC0_7     AUC8_48     AUC0_64   AUC12_130
1  111299859    5.150750   16.115864    23.59851   12.812288
2  112146587   16.630430   27.186570    47.51955   19.245042
3  123811839 1826.885933 1140.509935  3155.39210  832.210865
4  145593586  759.772228 1482.006413  2543.66350 1602.216675
5  202367199 6447.260530 5524.243972 12915.26200 4355.547472
6  233891605 2026.373649 1432.192203  3683.11590 1078.280104
7  257914734   16.023791   46.488059    73.48402   53.516499
8    2925168   19.037500   62.309949    91.99822   63.098301
9  355441192  395.187556  414.853089   883.42274  353.383998
10  40876220    3.982875   15.775430    22.50988   15.219666
11 409149207 4278.933737 2468.641048  7170.07381 1770.280370
12 427589065 7730.206336 5323.498495 13984.33804 3981.989941
13 443820693   11.910000   51.133415    70.47629   51.239667
14 463304641   94.077277  145.965750   268.55542  146.083234
15 471081571   77.181437  108.658798   204.54646  101.591513
16 499820574 5228.563212 4459.884946 10432.14093 3657.863653
17 500091016   22.587594   61.264286    93.30063   57.757705
18 500805530  471.496268  542.503402  1117.77753  486.659083
19 503192693 3620.713623 3105.414236  7252.21114 2605.480406
20 507682703   53.298750  131.477784   203.91558  101.097514
21 518707064 6670.725819 4731.692389 12129.35766 4005.987642
22 524844737 1628.484634 1407.499421  3307.33363 1224.938501
23 539272807  209.312058  332.789228   604.37115  297.353704
24 565486844 7445.501574 5909.793566 14477.65743 5877.935706
25 577177821 1055.339216 1175.596164  2437.80067  962.091893
26 579271281 4400.426105 3558.197713  8568.68723 2604.478526
27 582963447   41.346250  154.878916   221.93726  137.869401
28 621374373 7451.020059 6656.170696 15160.12434 5251.671038
29  63536292    4.869875    9.248423    15.17517    6.130309
30 652003114 1290.255720 1627.226746  3215.16872 1587.397767
31 668240634 4569.409480 3585.059094  8754.50885 3009.311355
32 670348158  405.622354  588.225438  1114.30067  668.916118
33 732449590  840.800000 2728.955981  4087.42371 3045.073255
34 754174517 1252.107866 1828.834087  3373.54061 1658.022511
35 759109991 1681.984359 1188.749998  3068.01559  946.023432
36 773547601   55.151957  191.942856   277.91700  200.581554
37 822445112    6.878162   11.650839    20.89284   12.635232
38 832770130  391.805441  946.630254  1508.28984  964.916176
39 836945347 2142.867553 1753.192912  4159.07458 1384.564832
40 908214575  110.519647  228.236251   377.13650  213.323090
41 919470224 3371.716409 4370.179733  8514.10003 3735.307241
42 921404682  493.469246  499.497906  1072.45419  403.226382
43 922793085  269.998844  458.234651   805.44510  409.614595
44 927491002 1103.458808 1334.859976  2665.03729 1159.199149
45 935549083   10.641990   21.250117    36.06401   21.305225
46 949633293   18.197500   44.909422    70.60103   38.855472
47 954855373 5402.856051 3347.044867  9289.05440 2365.879252
48 978075228    9.329302   14.832649    26.59689   12.390984

tc010 ex3: adding an partial AUC that requires extrapolation at T1 and T2

Note that this fails in a crash. The crash is not acceptable. While it's not required to support partial AUCs with both points extrapolated, it's reasonable to expect that there is no reason not to support this use case and it's comletely unacceptable that it causes a crash while processing the data. It is an expectation that the computation engine should handle such cases (all numerical computations) in a way that if the computation is numerical infeasible or not consistent with the computation of a PK parameter, the code should indicate that the parameter is not able to be computed by creating a missing value, i.e. an "NA" but not cause a code crash or stop.

ex3: Partial AUCs

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2 AUC.5.T1 AUC.5.T2
1        0        7        8       48        0       64       12      130      130      140

ex3: stdout - crash!

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168 

tc010 ex4: adding an partial AUC that requires interpolation at both T1 and T2

ex4: Partial AUCs

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2 AUC.5.T1 AUC.5.T2
1        0        7        8       48        0       64       12      130        6       20

ex4: Estimated Concentration Dataset

    PKDATAROWID     SDEID TIME     CEST_KEL     CEST_INT     CEST_EXT CEST_C0 CEST_TLAST
7            NA   2925168    6           NA 3.590000e+00           NA      NA         NA
4            NA   2925168    7           NA 3.595000e+00           NA      NA         NA
8            NA   2925168   20           NA 1.970000e+00           NA      NA         NA
1      22289754   2925168   24   1.70263761           NA           NA      NA         NA
2      22289755   2925168   48   0.58780724           NA           NA      NA         NA
5            NA   2925168   64           NA 3.286667e-01           NA      NA         NA
3      22289756   2925168   72   0.20293065           NA           NA      NA 0.20293065
6            NA   2925168  130           NA           NA 1.552816e-02      NA         NA
81           NA  40876220    6           NA 9.315000e-01           NA      NA         NA
51           NA  40876220    7           NA 1.115750e+00           NA      NA         NA
11     22289571  40876220   16   0.49544432           NA           NA      NA         NA
9            NA  40876220   20           NA 4.580000e-01           NA      NA         NA
21     22289572  40876220   24   0.36517471           NA           NA      NA         NA
31     22289573  40876220   48   0.14622386           NA           NA      NA         NA
61           NA  40876220   64           NA 8.246667e-02           NA      NA         NA
41     22289574  40876220   72   0.05855120           NA           NA      NA 0.05855120
71           NA  40876220  130           NA           NA 6.411404e-03      NA         NA
72           NA  63536292    6           NA 9.875000e-01           NA      NA         NA
42           NA  63536292    7           NA 1.033750e+00           NA      NA         NA
12     22289531  63536292   12   0.51896071           NA           NA      NA         NA
22     22289532  63536292   16   0.36933771           NA           NA      NA         NA
82           NA  63536292   20           NA 2.690000e-01           NA      NA         NA
32     22289533  63536292   24   0.18706907           NA           NA      NA 0.18706907
52           NA  63536292   64           NA 0.000000e+00           NA      NA         NA
62           NA  63536292  130           NA           NA 2.278583e-05      NA         NA
73           NA 111299859    6           NA 1.161000e+00           NA      NA         NA
43           NA 111299859    7           NA 1.310500e+00           NA      NA         NA
13     22289597 111299859   16   0.58377725           NA           NA      NA         NA
83           NA 111299859   20           NA 4.780000e-01           NA      NA         NA
23     22289598 111299859   24   0.37399383           NA           NA      NA         NA
33     22289599 111299859   48   0.09833684           NA           NA      NA 0.09833684
53           NA 111299859   64           NA 3.250000e-02           NA      NA         NA
63           NA 111299859  130           NA           NA 1.024574e-03      NA         NA
84           NA 112146587    6           NA 3.055000e+00           NA      NA         NA
54           NA 112146587    7           NA 2.987500e+00           NA      NA         NA
14     22289765 112146587   12   1.59483827           NA           NA      NA         NA
24     22289766 112146587   16   1.14287770           NA           NA      NA         NA
91           NA 112146587   20           NA 8.375000e-01           NA      NA         NA
34     22289767 112146587   24   0.58690253           NA           NA      NA         NA
44     22289768 112146587   48   0.07948124           NA           NA      NA 0.07948124
64           NA 112146587   64           NA 2.586667e-02           NA      NA         NA
74           NA 112146587  130           NA           NA 8.581603e-05      NA         NA
111          NA 123811839    6           NA 1.945000e+02           NA      NA         NA
85           NA 123811839    7           NA 1.647500e+02           NA      NA         NA
15     22290452 123811839   12  44.59385840           NA           NA      NA         NA
25     22290453 123811839   16  36.10132904           NA           NA      NA         NA
121          NA 123811839   20           NA 3.180000e+01           NA      NA         NA
35     22290454 123811839   24  23.66025768           NA           NA      NA         NA
45     22290455 123811839   48   6.66052265           NA           NA      NA         NA
92           NA 123811839   64           NA 2.280000e+00           NA      NA         NA
55     22290456 123811839   72   1.87498220           NA           NA      NA         NA
65     22290457 123811839   96   0.52782018           NA           NA      NA         NA
75     22290458 123811839  120   0.14858495           NA           NA      NA 0.14858495
10           NA 123811839  130           NA           NA 8.761837e-02      NA         NA
86           NA 145593586    6           NA 9.995000e+01           NA      NA         NA
56           NA 145593586    7           NA 8.692500e+01           NA      NA         NA
93           NA 145593586   20           NA 4.175000e+01           NA      NA         NA
16     22291157 145593586   48  18.32531818           NA           NA      NA         NA
66           NA 145593586   64           NA 1.027333e+01           NA      NA         NA
26     22291158 145593586   72   5.87505987           NA           NA      NA         NA
36     22291159 145593586   96   1.88353229           NA           NA      NA         NA
46     22291160 145593586  120   0.60385664           NA           NA      NA 0.60385664
76           NA 145593586  130           NA           NA 3.759102e-01      NA         NA
101          NA 202367199    6           NA 8.275000e+02           NA      NA         NA
77           NA 202367199    7           NA 7.162500e+02           NA      NA         NA
17     22290934 202367199   16 155.89036680           NA           NA      NA         NA
112          NA 202367199   20           NA 1.540000e+02           NA      NA         NA
27     22290935 202367199   24 107.16512307           NA           NA      NA         NA
37     22290936 202367199   48  34.81416886           NA           NA      NA         NA
87           NA 202367199   64           NA 1.520667e+01           NA      NA         NA
47     22290937 202367199   72  11.30989560           NA           NA      NA         NA
57     22290938 202367199   96   3.67418619           NA           NA      NA         NA
67     22290939 202367199  120   1.19361351           NA           NA      NA 1.19361351
94           NA 202367199  130           NA           NA 7.471477e-01      NA         NA
102          NA 233891605    6           NA 2.475000e+02           NA      NA         NA
78           NA 233891605    7           NA 2.017500e+02           NA      NA         NA
18     22290518 233891605   16  41.50390320           NA           NA      NA         NA
113          NA 233891605   20           NA 3.980000e+01           NA      NA         NA
28     22290519 233891605   24  27.33064016           NA           NA      NA         NA
38     22290520 233891605   48   7.80427191           NA           NA      NA         NA
88           NA 233891605   64           NA 3.320000e+00           NA      NA         NA
48     22290521 233891605   72   2.22851202           NA           NA      NA         NA
58     22290522 233891605   96   0.63635223           NA           NA      NA         NA
68     22290523 233891605  120   0.18171056           NA           NA      NA 0.18171056
95           NA 233891605  130           NA           NA 1.077907e-01      NA         NA
96           NA 257914734    6           NA 2.770000e+00           NA      NA         NA
69           NA 257914734    7           NA 2.820000e+00           NA      NA         NA
19     22289791 257914734   12   1.66768192           NA           NA      NA         NA
29     22289792 257914734   16   1.47132691           NA           NA      NA         NA
103          NA 257914734   20           NA 1.215000e+00           NA      NA         NA
39     22289793 257914734   24   1.14525209           NA           NA      NA         NA
49     22289794 257914734   48   0.54010330           NA           NA      NA         NA
79           NA 257914734   64           NA 3.733333e-01           NA      NA         NA
59     22289795 257914734   72   0.25471386           NA           NA      NA 0.25471386
89           NA 257914734  130           NA           NA 4.141846e-02      NA         NA
810          NA 355441192    6           NA 6.115000e+01           NA      NA         NA
510          NA 355441192    7           NA 5.107500e+01           NA      NA         NA
97           NA 355441192   20           NA 1.174500e+01           NA      NA         NA
110    22290260 355441192   48   2.64457864           NA           NA      NA         NA
610          NA 355441192   64           NA 1.538000e+00           NA      NA         NA
210    22290261 355441192   72   0.96307502           NA           NA      NA         NA
310    22290262 355441192   96   0.35072260           NA           NA      NA         NA
410    22290263 355441192  120   0.12772249           NA           NA      NA 0.12772249
710          NA 355441192  130           NA           NA 8.384501e-02      NA         NA
114          NA 409149207    6           NA 4.605000e+02           NA      NA         NA
811          NA 409149207    7           NA 3.882500e+02           NA      NA         NA
115    22290686 409149207   12  92.37008404           NA           NA      NA         NA
211    22290687 409149207   16  75.56168235           NA           NA      NA         NA
122          NA 409149207   20           NA 6.920000e+01           NA      NA         NA
311    22290688 409149207   24  50.56408802           NA           NA      NA         NA
411    22290689 409149207   48  15.15178707           NA           NA      NA         NA
98           NA 409149207   64           NA 4.846667e+00           NA      NA         NA
511    22290690 409149207   72   4.54031034           NA           NA      NA         NA
611    22290691 409149207   96   1.36052717           NA           NA      NA         NA
711    22290692 409149207  120   0.40768891           NA           NA      NA 0.40768891
104          NA 409149207  130           NA           NA 2.467485e-01      NA         NA
105          NA 427589065    6           NA 1.026500e+03           NA      NA         NA
712          NA 427589065    7           NA 8.447500e+02           NA      NA         NA
116    22290960 427589065   16 140.81814484           NA           NA      NA         NA
117          NA 427589065   20           NA 1.455000e+02           NA      NA         NA
212    22290961 427589065   24  96.88854127           NA           NA      NA         NA
312    22290962 427589065   48  31.55831549           NA           NA      NA         NA
812          NA 427589065   64           NA 1.312000e+01           NA      NA         NA
412    22290963 427589065   72  10.27910281           NA           NA      NA         NA
512    22290964 427589065   96   3.34808601           NA           NA      NA         NA

ex4: Output Parameters

      SDEID TREATXT      AUC0_7     AUC8_48     AUC0_64   AUC12_130     AUC6_20
1  111299859    1 mg    5.150750   16.115864    23.59851   12.812288   12.008237
2  112146587    3 mg   16.630430   27.186570    47.51955   19.245042   23.774437
3  123811839  100 mg 1826.885933 1140.509935  3155.39210  832.210865 1071.528281
4  145593586  900 mg  759.772228 1482.006413  2543.66350 1602.216675  796.854834
5  202367199  600 mg 6447.260530 5524.243972 12915.26200 4355.547472 4800.194133
6  233891605  100 mg 2026.373649 1432.192203  3683.11590 1078.280104 1313.115532
7  257914734    3 mg   16.023791   46.488059    73.48402   53.516499   25.442785
8    2925168    3 mg   19.037500   62.309949    91.99822   63.098301   37.097428
9  355441192   30 mg  395.187556  414.853089   883.42274  353.383998  345.894467
10  40876220    1 mg    3.982875   15.775430    22.50988   15.219666   11.053262
11 409149207  300 mg 4278.933737 2468.641048  7170.07381 1770.280370 2448.882872
12 427589065  600 mg 7730.206336 5323.498495 13984.33804 3981.989941 5134.207534
13 443820693    3 mg   11.910000   51.133415    70.47629   51.239667   29.116758
14 463304641   10 mg   94.077277  145.965750   268.55542  146.083234  109.630738
15 471081571   10 mg   77.181437  108.658798   204.54646  101.591513   76.211768
16 499820574  300 mg 5228.563212 4459.884946 10432.14093 3657.863653 3803.017712
17 500091016    3 mg   22.587594   61.264286    93.30063   57.757705   36.260678
18 500805530   30 mg  471.496268  542.503402  1117.77753  486.659083  434.664441
19 503192693  300 mg 3620.713623 3105.414236  7252.21114 2605.480406 2711.409465
20 507682703   10 mg   53.298750  131.477784   203.91558  101.097514  106.434627
21 518707064  300 mg 6670.725819 4731.692389 12129.35766 4005.987642 3853.675277
22 524844737  100 mg 1628.484634 1407.499421  3307.33363 1224.938501 1187.121566
23 539272807   30 mg  209.312058  332.789228   604.37115  297.353704  264.822788
24 565486844  600 mg 7445.501574 5909.793566 14477.65743 5877.935706 4408.930076
25 577177821  100 mg 1055.339216 1175.596164  2437.80067  962.091893 1059.412730
26 579271281  600 mg 4400.426105 3558.197713  8568.68723 2604.478526 3529.223634
27 582963447   10 mg   41.346250  154.878916   221.93726  137.869401  103.445417
28 621374373  600 mg 7451.020059 6656.170696 15160.12434 5251.671038 6076.315913
29  63536292    1 mg    4.869875    9.248423    15.17517    6.130309    8.159038
30 652003114  900 mg 1290.255720 1627.226746  3215.16872 1587.397767 1210.859818
31 668240634  300 mg 4569.409480 3585.059094  8754.50885 3009.311355 3026.455685
32 670348158   30 mg  405.622354  588.225438  1114.30067  668.916118  416.936841
33 732449590  900 mg  840.800000 2728.955981  4087.42371 3045.073255 1544.921978
34 754174517  900 mg 1252.107866 1828.834087  3373.54061 1658.022511 1293.081605
35 759109991  100 mg 1681.984359 1188.749998  3068.01559  946.023432 1036.509708
36 773547601   10 mg   55.151957  191.942856   277.91700  200.581554  109.896773
37 822445112    1 mg    6.878162   11.650839    20.89284   12.635232    7.509056
38 832770130  900 mg  391.805441  946.630254  1508.28984  964.916176  537.035801
39 836945347  100 mg 2142.867553 1753.192912  4159.07458 1384.564832 1523.287556
40 908214575   10 mg  110.519647  228.236251   377.13650  213.323090  152.152089
41 919470224  300 mg 3371.716409 4370.179733  8514.10003 3735.307241 3690.125705
42 921404682   30 mg  493.469246  499.497906  1072.45419  403.226382  398.650667
43 922793085   30 mg  269.998844  458.234651   805.44510  409.614595  337.659477
44 927491002  900 mg 1103.458808 1334.859976  2665.03729 1159.199149 1014.496642
45 935549083    1 mg   10.641990   21.250117    36.06401   21.305225   14.257864
46 949633293    3 mg   18.197500   44.909422    70.60103   38.855472   31.082832
47 954855373  600 mg 5402.856051 3347.044867  9289.05440 2365.879252 3282.149978
48 978075228    1 mg    9.329302   14.832649    26.59689   12.390984   10.727837

tc010 ex5: adding an partial AUC that requires interpolation at T1 and extrapolation at T2

ex5: Partial AUCs

  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2 AUC.5.T1 AUC.5.T2 AUC.6.T1 AUC.6.T2
1        0        7        8       48        0       64       12      130        6       20       60      124

ex4: Estimated Concentration Dataset

     PKDATAROWID     SDEID TIME     CEST_KEL     CEST_INT     CEST_EXT CEST_C0 CEST_TLAST
7             NA   2925168    6           NA   3.59000000           NA      NA         NA
4             NA   2925168    7           NA   3.59500000           NA      NA         NA
8             NA   2925168   20           NA   1.97000000           NA      NA         NA
1       22289754   2925168   24   1.70263761           NA           NA      NA         NA
2       22289755   2925168   48   0.58780724           NA           NA      NA         NA
9             NA   2925168   60           NA   0.39050000           NA      NA         NA
5             NA   2925168   64           NA   0.32866667           NA      NA         NA
3       22289756   2925168   72   0.20293065           NA           NA      NA 0.20293065
10            NA   2925168  124           NA           NA 2.025778e-02      NA         NA
6             NA   2925168  130           NA           NA 1.552816e-02      NA         NA
81            NA  40876220    6           NA   0.93150000           NA      NA         NA
51            NA  40876220    7           NA   1.11575000           NA      NA         NA
12      22289571  40876220   16   0.49544432           NA           NA      NA         NA
91            NA  40876220   20           NA   0.45800000           NA      NA         NA
21      22289572  40876220   24   0.36517471           NA           NA      NA         NA
31      22289573  40876220   48   0.14622386           NA           NA      NA         NA
101           NA  40876220   60           NA   0.08985000           NA      NA         NA
61            NA  40876220   64           NA   0.08246667           NA      NA         NA
41      22289574  40876220   72   0.05855120           NA           NA      NA 0.05855120
11            NA  40876220  124           NA           NA 8.059791e-03      NA         NA
71            NA  40876220  130           NA           NA 6.411404e-03      NA         NA
72            NA  63536292    6           NA   0.98750000           NA      NA         NA
42            NA  63536292    7           NA   1.03375000           NA      NA         NA
13      22289531  63536292   12   0.51896071           NA           NA      NA         NA
22      22289532  63536292   16   0.36933771           NA           NA      NA         NA
82            NA  63536292   20           NA   0.26900000           NA      NA         NA
32      22289533  63536292   24   0.18706907           NA           NA      NA 0.18706907
92            NA  63536292   60           NA   0.00000000           NA      NA         NA
52            NA  63536292   64           NA   0.00000000           NA      NA         NA
102           NA  63536292  124           NA           NA 3.795169e-05      NA         NA
62            NA  63536292  130           NA           NA 2.278583e-05      NA         NA
73            NA 111299859    6           NA   1.16100000           NA      NA         NA
43            NA 111299859    7           NA   1.31050000           NA      NA         NA
14      22289597 111299859   16   0.58377725           NA           NA      NA         NA
83            NA 111299859   20           NA   0.47800000           NA      NA         NA
23      22289598 111299859   24   0.37399383           NA           NA      NA         NA
33      22289599 111299859   48   0.09833684           NA           NA      NA 0.09833684
93            NA 111299859   60           NA   0.04875000           NA      NA         NA
53            NA 111299859   64           NA   0.03250000           NA      NA         NA
103           NA 111299859  124           NA           NA 1.430805e-03      NA         NA
63            NA 111299859  130           NA           NA 1.024574e-03      NA         NA
84            NA 112146587    6           NA   3.05500000           NA      NA         NA
54            NA 112146587    7           NA   2.98750000           NA      NA         NA
15      22289765 112146587   12   1.59483827           NA           NA      NA         NA
24      22289766 112146587   16   1.14287770           NA           NA      NA         NA
94            NA 112146587   20           NA   0.83750000           NA      NA         NA
34      22289767 112146587   24   0.58690253           NA           NA      NA         NA
44      22289768 112146587   48   0.07948124           NA           NA      NA 0.07948124
104           NA 112146587   60           NA   0.03880000           NA      NA         NA
64            NA 112146587   64           NA   0.02586667           NA      NA         NA
111           NA 112146587  124           NA           NA 1.414633e-04      NA         NA
74            NA 112146587  130           NA           NA 8.581603e-05      NA         NA
112           NA 123811839    6           NA 194.50000000           NA      NA         NA
85            NA 123811839    7           NA 164.75000000           NA      NA         NA
16      22290452 123811839   12  44.59385840           NA           NA      NA         NA
25      22290453 123811839   16  36.10132904           NA           NA      NA         NA
121           NA 123811839   20           NA  31.80000000           NA      NA         NA
35      22290454 123811839   24  23.66025768           NA           NA      NA         NA
45      22290455 123811839   48   6.66052265           NA           NA      NA         NA
131           NA 123811839   60           NA   2.88000000           NA      NA         NA
95            NA 123811839   64           NA   2.28000000           NA      NA         NA
55      22290456 123811839   72   1.87498220           NA           NA      NA         NA
65      22290457 123811839   96   0.52782018           NA           NA      NA         NA
75      22290458 123811839  120   0.14858495           NA           NA      NA 0.14858495
141           NA 123811839  124           NA           NA 1.202882e-01      NA         NA
105           NA 123811839  130           NA           NA 8.761837e-02      NA         NA
86            NA 145593586    6           NA  99.95000000           NA      NA         NA
56            NA 145593586    7           NA  86.92500000           NA      NA         NA
96            NA 145593586   20           NA  41.75000000           NA      NA         NA
17      22291157 145593586   48  18.32531818           NA           NA      NA         NA
106           NA 145593586   60           NA  12.45500000           NA      NA         NA
66            NA 145593586   64           NA  10.27333333           NA      NA         NA
26      22291158 145593586   72   5.87505987           NA           NA      NA         NA
36      22291159 145593586   96   1.88353229           NA           NA      NA         NA
46      22291160 145593586  120   0.60385664           NA           NA      NA 0.60385664
113           NA 145593586  124           NA           NA 4.995673e-01      NA         NA
76            NA 145593586  130           NA           NA 3.759102e-01      NA         NA
107           NA 202367199    6           NA 827.50000000           NA      NA         NA
77            NA 202367199    7           NA 716.25000000           NA      NA         NA
18      22290934 202367199   16 155.89036680           NA           NA      NA         NA
114           NA 202367199   20           NA 154.00000000           NA      NA         NA
27      22290935 202367199   24 107.16512307           NA           NA      NA         NA
37      22290936 202367199   48  34.81416886           NA           NA      NA         NA
122           NA 202367199   60           NA  18.30500000           NA      NA         NA
87            NA 202367199   64           NA  15.20666667           NA      NA         NA
47      22290937 202367199   72  11.30989560           NA           NA      NA         NA
57      22290938 202367199   96   3.67418619           NA           NA      NA         NA
67      22290939 202367199  120   1.19361351           NA           NA      NA 1.19361351
132           NA 202367199  124           NA           NA 9.896482e-01      NA         NA
97            NA 202367199  130           NA           NA 7.471477e-01      NA         NA
108           NA 233891605    6           NA 247.50000000           NA      NA         NA
78            NA 233891605    7           NA 201.75000000           NA      NA         NA
19      22290518 233891605   16  41.50390320           NA           NA      NA         NA
115           NA 233891605   20           NA  39.80000000           NA      NA         NA
28      22290519 233891605   24  27.33064016           NA           NA      NA         NA
38      22290520 233891605   48   7.80427191           NA           NA      NA         NA
123           NA 233891605   60           NA   4.08000000           NA      NA         NA
88            NA 233891605   64           NA   3.32000000           NA      NA         NA
48      22290521 233891605   72   2.22851202           NA           NA      NA         NA
58      22290522 233891605   96   0.63635223           NA           NA      NA         NA
68      22290523 233891605  120   0.18171056           NA           NA      NA 0.18171056
133           NA 233891605  124           NA           NA 1.474554e-01      NA         NA
98            NA 233891605  130           NA           NA 1.077907e-01      NA         NA
99            NA 257914734    6           NA   2.77000000           NA      NA         NA
69            NA 257914734    7           NA   2.82000000           NA      NA         NA
110     22289791 257914734   12   1.66768192           NA           NA      NA         NA
29      22289792 257914734   16   1.47132691           NA           NA      NA         NA
109           NA 257914734   20           NA   1.21500000           NA      NA         NA
39      22289793 257914734   24   1.14525209           NA           NA      NA         NA
49      22289794 257914734   48   0.54010330           NA           NA      NA         NA
116           NA 257914734   60           NA   0.44800000           NA      NA         NA
79            NA 257914734   64           NA   0.37333333           NA      NA         NA
59      22289795 257914734   72   0.25471386           NA           NA      NA 0.25471386
124           NA 257914734  124           NA           NA 4.998043e-02      NA         NA
89            NA 257914734  130           NA           NA 4.141846e-02      NA         NA
810           NA 355441192    6           NA  61.15000000           NA      NA         NA
510           NA 355441192    7           NA  51.07500000           NA      NA         NA
910           NA 355441192   20           NA  11.74500000           NA      NA         NA
117     22290260 355441192   48   2.64457864           NA           NA      NA         NA
1010          NA 355441192   60           NA   1.82600000           NA      NA         NA
610           NA 355441192   64           NA   1.53800000           NA      NA         NA
210     22290261 355441192   72   0.96307502           NA           NA      NA         NA
310     22290262 355441192   96   0.35072260           NA           NA      NA         NA
410     22290263 355441192  120   0.12772249           NA           NA      NA 0.12772249
118           NA 355441192  124           NA           NA 1.079323e-01      NA         NA

ex4: Output Parameters

       SDEID TREATXT      AUC0_7     AUC8_48     AUC0_64   AUC12_130     AUC6_20    AUC60_124
1  111299859    1 mg    5.150750   16.115864    23.59851   12.812288   12.008237 3.297009e-01
2  112146587    3 mg   16.630430   27.186570    47.51955   19.245042   23.774437 2.364780e-01
3  123811839  100 mg 1826.885933 1140.509935  3155.39210  832.210865 1071.528281 4.724301e+01
4  145593586  900 mg  759.772228 1482.006413  2543.66350 1602.216675  796.854834 2.141581e+02
5  202367199  600 mg 6447.260530 5524.243972 12915.26200 4355.547472 4800.194133 3.486005e+02
6  233891605  100 mg 2026.373649 1432.192203  3683.11590 1078.280104 1313.115532 6.823288e+01
7  257914734    3 mg   16.023791   46.488059    73.48402   53.516499   25.442785 9.910584e+00
8    2925168    3 mg   19.037500   62.309949    91.99822   63.098301   37.097428 7.604945e+00
9  355441192   30 mg  395.187556  414.853089   883.42274  353.383998  345.894467 3.612597e+01
10  40876220    1 mg    3.982875   15.775430    22.50988   15.219666   11.053262 2.396276e+00
11 409149207  300 mg 4278.933737 2468.641048  7170.07381 1770.280370 2448.882872 1.152641e+02
12 427589065  600 mg 7730.206336 5323.498495 13984.33804 3981.989941 5134.207534 3.071642e+02
13 443820693    3 mg   11.910000   51.133415    70.47629   51.239667   29.116758 5.988614e+00
14 463304641   10 mg   94.077277  145.965750   268.55542  146.083234  109.630738 2.669005e+01
15 471081571   10 mg   77.181437  108.658798   204.54646  101.591513   76.211768 1.093362e+01
16 499820574  300 mg 5228.563212 4459.884946 10432.14093 3657.863653 3803.017712 3.534637e+02
17 500091016    3 mg   22.587594   61.264286    93.30063   57.757705   36.260678 5.072884e+00
18 500805530   30 mg  471.496268  542.503402  1117.77753  486.659083  434.664441 5.875573e+01
19 503192693  300 mg 3620.713623 3105.414236  7252.21114 2605.480406 2711.409465 2.793451e+02
20 507682703   10 mg   53.298750  131.477784   203.91558  101.097514  106.434627 5.418666e+00
21 518707064  300 mg 6670.725819 4731.692389 12129.35766 4005.987642 3853.675277 3.746088e+02
22 524844737  100 mg 1628.484634 1407.499421  3307.33363 1224.938501 1187.121566 1.558447e+02
23 539272807   30 mg  209.312058  332.789228   604.37115  297.353704  264.822788 3.774075e+01
24 565486844  600 mg 7445.501574 5909.793566 14477.65743 5877.935706 4408.930076 9.551179e+02
25 577177821  100 mg 1055.339216 1175.596164  2437.80067  962.091893 1059.412730 1.011227e+02
26 579271281  600 mg 4400.426105 3558.197713  8568.68723 2604.478526 3529.223634 1.955577e+02
27 582963447   10 mg   41.346250  154.878916   221.93726  137.869401  103.445417 1.188009e+01
28 621374373  600 mg 7451.020059 6656.170696 15160.12434 5251.671038 6076.315913 4.695618e+02
29  63536292    1 mg    4.869875    9.248423    15.17517    6.130309    8.159038 9.867439e-04
30 652003114  900 mg 1290.255720 1627.226746  3215.16872 1587.397767 1210.859818 2.560997e+02
31 668240634  300 mg 4569.409480 3585.059094  8754.50885 3009.311355 3026.455685 3.204506e+02
32 670348158   30 mg  405.622354  588.225438  1114.30067  668.916118  416.936841 1.687498e+02
33 732449590  900 mg  840.800000 2728.955981  4087.42371 3045.073255 1544.921978 5.612106e+02
34 754174517  900 mg 1252.107866 1828.834087  3373.54061 1658.022511 1293.081605 1.717519e+02
35 759109991  100 mg 1681.984359 1188.749998  3068.01559  946.023432 1036.509708 7.730765e+01
36 773547601   10 mg   55.151957  191.942856   277.91700  200.581554  109.896773 2.861341e+01
37 822445112    1 mg    6.878162   11.650839    20.89284   12.635232    7.509056 2.386116e+00
38 832770130  900 mg  391.805441  946.630254  1508.28984  964.916176  537.035801 1.051958e+02
39 836945347  100 mg 2142.867553 1753.192912  4159.07458 1384.564832 1523.287556 1.061628e+02
40 908214575   10 mg  110.519647  228.236251   377.13650  213.323090  152.152089 2.116397e+01
41 919470224  300 mg 3371.716409 4370.179733  8514.10003 3735.307241 3690.125705 3.931082e+02
42 921404682   30 mg  493.469246  499.497906  1072.45419  403.226382  398.650667 2.730232e+01
43 922793085   30 mg  269.998844  458.234651   805.44510  409.614595  337.659477 3.903040e+01
44 927491002  900 mg 1103.458808 1334.859976  2665.03729 1159.199149 1014.496642 9.812001e+01
45 935549083    1 mg   10.641990   21.250117    36.06401   21.305225   14.257864 3.128326e+00
46 949633293    3 mg   18.197500   44.909422    70.60103   38.855472   31.082832 2.812116e+00
47 954855373  600 mg 5402.856051 3347.044867  9289.05440 2365.879252 3282.149978 1.405599e+02
48 978075228    1 mg    9.329302   14.832649    26.59689   12.390984   10.727837 4.683784e-01

2019-11-20 tc010 M1SD test case variant with all Concentration values set to NA. This causes computation engine to crash. Expectation is that it would not crash but set requested parameters to NA

This WAS working appropriately in current master branch.

d$PKCNCN <- rep(NA, nrow(d)) # computation engine should not FALL OVER

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168 

2019-11-14 CEST_INT and CEST_EXT reporting problems for some partial AUCs

Issue

When asking for partial AUCs from x to an extrapolated point, values for CEST_EXT are reported as the same value if they share x in their partial AUC. Additionally there seems to be some IDs which cause some interpolated or extrapolated values to not be reported at all.

Hopefully the outputs below can help make sense of this issue. Understandably, there are a lot of different partial AUCs that I have not tested.

Output 1

When running tc010 with additional partial AUCs from 0 to 120, 60 to 122, 60 to 144, 0 to 205 (where x = 0 or 60) and 24 to 124 (24 being an existing point, 124 being extrapolated) following output is given for SDEID == 2925168:

   PKDATAROWID   SDEID TIME  CEST_KEL  CEST_INT  CEST_EXT CEST_C0 CEST_TLAST
1           NA 2925168    7        NA 3.5950000        NA      NA         NA
2     22289754 2925168   24 1.7026376        NA        NA      NA         NA
3     22289755 2925168   48 0.5878072        NA        NA      NA         NA
4           NA 2925168   64        NA 0.3286667        NA      NA         NA
5     22289756 2925168   72 0.2029306        NA        NA      NA  0.2029306
6           NA 2925168  120        NA        NA 0.2837817      NA         NA
7           NA 2925168   60        NA 0.3905000        NA      NA         NA
8           NA 2925168  122        NA        NA 0.2050000      NA         NA
9           NA 2925168  144        NA        NA 0.2050000      NA         NA
10          NA 2925168  205        NA        NA 0.2837817      NA         NA
11          NA 2925168  124        NA        NA 0.2029306      NA         NA

As can be seen the value for CEST_EXT is the same for both 120 and 205 are the same, which shared the same lower value for their partial AUCs (x = 0), while 122 and 144 are the same (x = 60).

This is not expected behaviour as it should be that the CEST_EXT value for each time point decreases and the time gets larger.

Additionally, it shows that CEST_TLAST at TIME == 72 is lower than the CEST at TIME == 120. This may be intentional, but just raising it as a potential problem if it isn't intentional.

Despite this, the partial AUCs appear to be working correctly:

   AUC0_7  AUC8_48  AUC0_64 AUC0_120 AUC60_122 AUC60_144 AUC0_205 AUC24_124
8 19.0375 62.30995 91.99822 105.1922  13.87095  18.45428 125.7842  44.32238

Output 2

For the same test case as above looking at SDEID == 63536292 the following output is given:

   PKDATAROWID    SDEID TIME  CEST_KEL CEST_INT  CEST_EXT CEST_C0 CEST_TLAST
24          NA 63536292    7        NA  1.03375        NA      NA         NA
25    22289531 63536292   12 0.5189607       NA        NA      NA         NA
26          NA 63536292   64        NA  0.00000        NA      NA         NA
27          NA 63536292  120        NA       NA 0.2842993      NA         NA
28          NA 63536292   60        NA  0.00000        NA      NA         NA
29          NA 63536292  205        NA       NA 0.2842993      NA         NA
30    22289532 63536292   16 0.3693377       NA        NA      NA         NA
31    22289533 63536292   24 0.1870691       NA        NA      NA  0.1870691

In this output:

  • interpolated values of 0 are given for 64 and 60
  • extrapolated values for 120 and 205 are the same
  • extrapolated values associated with an interpolated time point with value 0 are missing
  • extrapolated value associated with an existing time point is missing

The associated value in data_out was:

     AUC0_7  AUC8_48  AUC0_64 AUC0_120 AUC60_122 AUC60_144 AUC0_205 AUC24_124
29 4.869875 9.248423 15.17517 21.99836         0         0 34.08108     2.292

The AUC from 60 to 122 and 60 to 144 may be very small, so this could be correct.

Reproducible Example

#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)
 
profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()
 
#### Test Case 010 ------------------------------------------------------- ####
# M1 SD
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc010"
testcase.id <- "tc010"
p <- "testcase/tc010_M1SD"
params["INPUT1"] = file.path(p, "B1261002.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc010_mct_updated.csv")
params["flags"] = file.path(p, "B1261002_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)
 
mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc010_mct_updated.json"))
params["map"] = file.path(p, "tc010_mct_updated.json")
 
flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc010_flags.json"))
params["flags"] = file.path(p, "tc010_flags.json")
 
#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
 
# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)
 
# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)
 
# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]
 
# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
 
# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}
 
# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
 
# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
 
# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
 
# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])
#### Final changes to test ----------------------------------------------- ####
### Add partial AUC
mct$AUC.4.T1 <- 0
mct$AUC.4.T2 <- 120
mct$AUC.5.T1 <- 60
mct$AUC.5.T2 <- 122
mct$AUC.6.T1 <- 60
mct$AUC.6.T2 <- 144
mct$AUC.7.T1 <- 0
mct$AUC.7.T2 <- 205
mct$AUC.8.T1 <- 24
mct$AUC.8.T2 <- 124

#### Run computation engine ---------------------------------------------- ####
### Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

### Save results to objects
r <- results_list$data_out
e <- results_list$est_data
f <- results_list$flag_data

### View output
e[e$SDEID == 2925168, ]
r[r$SDEID == 2925168, c("AUC0_7", "AUC8_48", "AUC0_64", "AUC0_120", "AUC60_122", "AUC60_144", "AUC0_205", "AUC24_124")]
e[e$SDEID == 63536292, ]
r[r$SDEID == 63536292, c("AUC0_7", "AUC8_48", "AUC0_64", "AUC0_120", "AUC60_122", "AUC60_144", "AUC0_205", "AUC24_124")]

2019-11-12 "Subscript out of bounds" for some partial AUCs

Error

There are specific cases in commit a06c1c7 where an error occurs when asking for partial AUCs. I am not certain why this error occurs for some partial AUCs and not others. The error and traceback for an example using tc010 has been included below.

Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 63536292
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 63536292 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M1_SD_computation.R#1698
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M1_SD_computation.R#817
2. run_M1_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2217
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

The error can be replicated by adding an additional partial AUC to test case 010 using the code below:

### Add partial AUC
mct$AUC.4.T1 <- 25
mct$AUC.4.T2 <- 48

The error does not occur when mct$AUC.4.T1 is given a value of 23 or 24. mct$AUC.4.T2 appears to have some impact on the error, changing the SDEID which causes the error. A value of 144 results in SDEID 63536292 causing the error, while a value of 48 results in SDEID 2925168 causing the error

Reproducible Example

#### Final changes to test ----------------------------------------------- ####
### Add partial AUC
mct$AUC.4.T1 <- 25
mct$AUC.4.T2 <- 48

#### Run computation engine ---------------------------------------------- ####
# Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

2019-11-17 tc010 IF FLGNOCMAX ==1 is incorporated in MCT, run_computation throws error

If mct$FLGNOCMAX==1 (or FLGNOCMAX==0 it turns out) (i.e. prohibit CMAX from being incorporated into KEL selections through the optimizekel routine) the following error occurs with tc010:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in if (flg_no_cmax) {: missing value where TRUE/FALSE needed
For SDEID 2925168
In addition: Warning messages:
1: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGACCEPTTAU' cannot be computed if 'TAUi' is not provided
2: In run_M1_SD_computation(data = merged_data, map = map_data, method = method,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in if (flg_no_cmax) {: missing value where TRUE/FALSE needed
For SDEID 2925168 

Not that if mct$OPTIMIZEKEL == 0 (i.e. do not optimize), this error doesn't occur even with mct$FLGNOCMAX==1.

Note that if mct$NOCMAX is included at all, the optimization routine fails with this error.

Test Results of optimizekel functionality with code from 2019-11-06 in branch openNCA-2.0.5-M1-Release

<2019-11-07 Thu> openNCA-2.0.5-M1-Release development branch testing

tc010 M1SD -

ran with both mct$optimizekel = 0 & 1, ran as expected in both cases
confirmation of whether the optimization worked completely as expected was not undertaken but will be evaluated next
need to confirm whether changes to MCT$FLGACCEPTKELCRIT are respected as well

tc011 M1SS - errors with unit conversion optimizekel==0 (non optimize)

these errors were confirmed to be pre-existing in the master code branch

> resultslist <- runcomputation(data=d, map=mct, flag=flags, parameterset=parameterset)

Error in withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning")) :
(list) object cannot be coerced to type 'double'
In addition: There were 50 or more warnings (use warnings() to see the first 50)

warnings()
Warning messages:
1: In runM1SScomputation(data = mergeddata, map = mapdata, โ€ฆ :
Flag 'FLGEMESIS' is not present in the dataset
2: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
3: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
4: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
5: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
6: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
7: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
8: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
9: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
10: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
11: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
12: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
13: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
14: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
15: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
16: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
17: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
18: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
19: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
20: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
21: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
22: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
23: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
24: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
25: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
26: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
27: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
28: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
29: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
30: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
31: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
32: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
33: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
34: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
35: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
36: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
37: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
38: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
39: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
40: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
41: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
42: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
43: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
44: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
45: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
46: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
47: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
48: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!
49: In matrix(value, n, p) :
data length [157] is not a sub-multiple or multiple of the number of columns [156]
50: In unitconversion(data = datadata, map = mapdata, result = datadata, โ€ฆ :
'CONCOUTPUTUNIT' is not present in the proper form! Please try again using 'Amount/Volume' format!

tc012 M1SS - failed :FAIL:

run 1 - ran mct$OPTIMIZEKEL == 0 with expected results

run 2 - re-ran mct$OPTIMIZEKEL == 1 and there were no discernible changes in KEL, FLAG$FLGEXKEL etc from the nonopt version

run 3 - flags$FLGEXKEL <- rep(1, nrow(flags)) # i.e. just didn't select ANY data points for inclusion in terminal elimination regression

to test further
and no regression was performed apparently when executing runcomputation, i.e.

all values of KEL were NA

tc013 M2SD - took 2:10.20 min to execute

2019-11-19 Comp engine error when all concentrations are NA for tc008 M4SDSS, tc018 M4SS

Error

When setting all concentrations to NA (changed in the data), an error occurs for tc010, 011, 012, 013 and 015 when otherwise unchanged (unchanged mct). No errors occur for tc014 and tc016 when otherwise unchanged (unchanged mct).

All test cases except tc013 provide the following error when setting all concentrations to NA and a partial AUC is asked for by the mct (besides partial AUCs starting from zero). Note that when unchanged, tc010, tc011 and tc015 all contain such partial AUCs.

 Error in value[[3L]](cond) : Error in tmp[[2]]: subscript out of bounds
For SDEID 2925168 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M1_SD_computation.R#1701
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M1_SD_computation.R#820
2. run_M1_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2217
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

When left unchanged, tc012 gives the following error when all concentrations are set to NA:

 Error in value[[3L]](cond) : 
  Error in if (time[e] == t_last) {: missing value where TRUE/FALSE needed
For SDEID 24280050 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M1_SS_computation.R#2608
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    if (comp_required[["DOSECi"]] || comp_required[["DOSEC"]]) {
        dose_ci <- list()
    } ... at run_M1_SS_computation.R#1020
2. run_M1_SS_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2223
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

Unlike the other test cases, tc013 provides the following error when all concentrations to NA and does not appear to change when adding a partial AUC.

Error in value[[3L]](cond) : 
  Error in est_c_0$est_c0: $ operator is invalid for atomic vectors
For SDEID 10589286 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M2_SD_computation.R#1663
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M2_SD_computation.R#805
2. run_M2_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2229
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

2019-11-20 tc071 M1 AUC0-24 and AUCLAST parameters do not match reference results

Comparison of AUC0-24 and AUCLAST appear to have fairly large differences, with an average difference of 13.3 for AUC0-24 and 39.5 for AUCTLAST.
While not a comprehensive check on the qualification of the computation engine and validity of results, this check was done in the course of other testing and it was noticed that these results would not be acceptable relative to the reference results.

> testcase.id <- "tc071"
> p <- "./testcases/tc071_ogormanmt_20180417_005556827PM"
> params["INPUT1"] = file.path(p, "B3461056.in.csv")
> params["parameterset"] ="PARAMETERLIST"
> params["map"] = file.path(p, "tc071_mct_updated.csv")
> params["flags"] = file.path(p, "B3461056_flag_data.in.csv")
> params["OUTPUT"] ="."
> print(params)
                                                                      INPUT1                                                                 parameterset 
          "./testcases/tc071_ogormanmt_20180417_005556827PM/B3461056.in.csv"                                                              "PARAMETERLIST" 
                                                                         map                                                                        flags 
    "./testcases/tc071_ogormanmt_20180417_005556827PM/tc071_mct_updated.csv" "./testcases/tc071_ogormanmt_20180417_005556827PM/B3461056_flag_data.in.csv" 
                                                                      OUTPUT                                                             REFERENCERESULTS 
                                                                         "."  "./testcases/tc071_ogormanmt_20180417_005556827PM/B3461056_pp_calc.xml.csv" 
> 
> mct <- read_csv(params["map"])
Parsed with column specification:
cols(
  .default = col_character(),
  AUCNPAIR = col_integer(),
  FLGNOCMAX = col_integer(),
  FLGACCEPTPREDOSECRIT = col_double(),
  SPANRATIOCRIT = col_integer(),
  DP.DEFAULT = col_integer(),
  SF.DEFAULT = col_integer(),
  OPTIMIZEKEL = col_integer(),
  INCLUDEINTERPOLATION = col_integer(),
  INCLUDEEXTRAPOLATION = col_integer(),
  AUC.1.T1 = col_integer(),
  AUC.1.T2 = col_integer(),
  AUC.2.T1 = col_integer(),
  AUC.2.T2 = col_integer(),
  AUC.3.T1 = col_integer(),
  AUC.3.T2 = col_integer()
)
See spec(...) for full column specifications.
> write_file(toJSON(mct, na="string"), path=file.path(p, "tc071_mct_updated.json"))
> params["map"] = file.path(p, "tc071_mct_updated.json")
> 
> flags <- read_csv(params["flags"])
Parsed with column specification:
cols(
  PKDATAROWID = col_integer(),
  FLGEXSDE = col_integer(),
  FLGEXKEL = col_integer(),
  FLGEXAUC = col_integer(),
  FLGEXST = col_integer(),
  NDOSEI = col_integer(),
  PKPCOM = col_character(),
  MIDPNTN = col_character(),
  MIDPNTA = col_character(),
  MIDPNTNU = col_character(),
  MIDPNTAU = col_character(),
  RATEN = col_character(),
  RATEA = col_character(),
  RATENU = col_character(),
  RATEAU = col_character()
)
> write_file(toJSON(flags, na="string"), path=file.path(p, "tc071_flags.json"))
> params["flags"] = file.path(p, "tc071_flags.json")
> 
> params["REFERENCERESULTS"] = file.path(p, "B3461056_pp_calc.xml.csv")
> conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
> vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
>   
> # Read mct
> mct <- params["map"]
> ###mct <- read_file(mct)
> ###mct <- gsub("[\\]+", "", mct)
> mct <- fromJSON(mct)
>   
> # Read flags
> flags <- params["flags"]
> ###flags <- read_file(flags)
> ###flags <- gsub("[\\]+", "", flags)
> flags <- fromJSON(flags)
>   
> # ParameterSet
> if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
> parameterset <- params["parameterset"]
>   
> # FLAGS is a subset for the specific profile, subset concentration dataframe 
> #  to those records by PKDATAROWID
> d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
>   
> # Add in missing required parameters for virtual compute call
> klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
> if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
> for(i in klist) {
+ ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
+   if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
+ }
> 
> # Remove any leading semi-colons ";"
> mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
> 
> # For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
> if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
> 
> # Check whether TIME selection has been set in MCT - default to NOMINAL
> if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
>   
> # Determine whether there are any points selected for inclusion in the terminal elimination phase via 
> #  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
> #  ***What happens if there are no flags provided?***
> n <- factor(flags$FLGEXKEL, levels=c(0,1))
> ninc <- length(n[n==0])
> nexc <- length(n[n==1])
> model_spec(mct)
[1] "openNCA: Model: M1 DosingType: SS AUCMETHOD: LINLOG"
> mct$TIME #<- "Nominal"
[1] "NOMINAL"
> mct$NOMTIME
[1] "PKPTMS"
> mct$NOMTIMEU
[1] "PKPTMU"
> mct$ACTTIME #<- "PKATPD"
[1] "PKATPD"
> mct$ACTTIMEU
[1] "PKATPDU"
> 
> mct$PARAMETERLIST
[1] "AUCALL;AUCALLDN;AUCINFO;AUCINFOC;AUCINFODN;AUCINFP;AUCINFPC;AUCINFPDN;AUCLAST;AUCLASTi;AUCLASTDNi;AUCLASTCi;AUCT;AUCT1_T2;AUCTAUi;AUCTAUDNi;AUCXPCTO;AUCXPCTP;AUMCTAUi;CAVi;CLASTi;CLFO;CLFTAUi;CLFTAUWi;CLO;CLRTAUi;CMAXi;CMAXCi;CMAXDNi;CMINi;DOSECi;CTROUGHi;CTROUGHENDi;DIi;DOSEi;KEL;KELNOPT;KELRSQ;KELRSQA;KELTMHI;KELTMLO;LASTTIME;MRTEVIFOi;MRTEVIFPi;PTFi;PTRi;PTROUGHRi;PTROUGHREND;TAU;TAUi;THALF;THALFF;TLAG;TLAST;TMAXi;TMINi;TOLD;VZFP;VZFTAUi;VZFTAUWi"
> mct$PARAMETERDISPLAYLIST
[1] "SUBJID;TREATXT;PKBDFLD;PKTERM;PERIODU;PERIOD;VISITU;VISIT;DOSE;DOSEU;ACTTRT;AUCTAU;AUCLASTi;AUCXPCTP;CLFTAUi;CMAX;CMAXi;KEL;KELNOPT;KELRSQ;KELTMHI;KELTMLO;THALF;TLAST;TMAX;TMAXi;VZFP;CAV;CTROUGH;CMIN;PTR;PTF;RACC;RSS;RACCMAXi;THALFF"
> 
> parameterset <- "PARAMETERDISPLAYLIST"
> parameterset <- "PARAMETERLIST"
> parameterset
[1] "PARAMETERLIST"
> 
> # Parmeters for M1SS
> model_parameters("M1|M1SS")
  [1] "AUCALL"       "AUCALLDN"     "AUCDN"        "AUCINFO"      "AUCINFOC"     "AUCINFODN"    "AUCINFOi"     "AUCINFP"      "AUCINFPC"     "AUCINFPDN"    "AUCINFPi"    
 [12] "AUCLAST"      "AUCLASTi"     "AUCLASTC"     "AUCLASTCi"    "AUCLASTDN"    "AUCLASTDNi"   "AUCT"         "AUCT1_T2"     "AUCTAUDNi"    "AUCTAU"       "AUCTAUi"     
 [23] "AUCTDN"       "AUCXPCTO"     "AUCXPCTOi"    "AUCXPCTP"     "AUCXPCTPi"    "AUMCINFO"     "AUMCINFOi"    "AUMCINFP"     "AUMCINFPi"    "AUMCLAST"     "AUMCLASTi"   
 [34] "AUMCTAUi"     "AUMCXPTO"     "AUMCXPTOi"    "AUMCXPTP"     "AUMCXPTPi"    "CAVi"         "CEST"         "CLAST"        "CLASTi"       "CLFO"         "CLFOW"       
 [45] "CLFP"         "CLFPW"        "CLFTAUi"      "CLFTAUWi"     "CMAX"         "CMAXi"        "CMAXDN"       "CMAXDNi"      "CMIN"         "CMINi"        "CMINDN"      
 [56] "CMINDNi"      "CTROUGHi"     "CTROUGHENDi"  "DIi"          "DOSE"         "DOSEi"        "DOSEC"        "DOSECi"       "F"            "FREL"         "FRELLAST"    
 [67] "FRELLASTi"    "FTAUi"        "KEL"          "KELC0"        "KELNOPT"      "KELR"         "KELRSQ"       "KELRSQA"      "KELTMHI"      "KELTMLO"      "LASTTIME"    
 [78] "LASTTIMEi"    "MRTEVIFO"     "MRTEVIFOi"    "MRTEVIFP"     "MRTEVIFPi"    "MRTLAST"      "MRTLASTi"     "PTF"          "PTFi"         "PTR"          "PTRi"        
 [89] "PTROUGHRi"    "PTROUGHRENDi" "RACi"         "RACCMAXi"     "RACCMINi"     "RSSi"         "TAU"          "TAUi"         "THALF"        "THALFF"       "TLAG"        
[100] "TLAST"        "TLASTi"       "TMAX"         "TMAXi"        "TMIN"         "TMINi"        "TOLD"         "TOLDi"        "VZFO"         "VZFOW"        "VZFP"        
[111] "VZFPW"        "VZFTAUi"      "VZFTAUWi"    
> 
> k <- parameter_required("OUTPUTUNIT$", names(mct), simplify=FALSE)
> k <- names(k)
> mct[,k]
  TIMEOUTPUTUNIT AMOUNTOUTPUTUNIT DOSEOUTPUTUNIT VOLUMEOUTPUTUNIT CONCOUTPUTUNIT KELOUTPUTUNIT CLOUTPUTUNIT AUCOUTPUTUNIT AUMCOUTPUTUNIT AUCNORMOUTPUTUNIT AUROUTPUTUNIT
1             HR               NA             MG                L          NG/ML          1/HR         L/HR      NG.HR/ML    NG.HR.HR/ML       NG.HR/ML/MG            NA
  CONCNORMOUTPUTUNIT RATEOUTPUTUNIT VOLUMENORMOUTPUTUNIT CLNORMOUTPUTUNIT
1           NG/ML/MG             NA                 L/KG         ML/HR/KG
> 
> k <- parameter_required("^AUC.", names(mct), simplify=FALSE)
> k <- names(k)
> mct[,k]
  AUCMETHOD AUCOUTPUTUNIT AUCNORMOUTPUTUNIT AUCNPAIR AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2
1    LINLOG      NG.HR/ML       NG.HR/ML/MG        0        0       12        0       26        0       24
> 
> mct.saved <- mct
> 
> j <- parameter_required("DOSE", names(mct), simplify=FALSE)
> mct[, names(j)]
  DOSE1  DOSE1U DOSEOUTPUTUNIT  DOSETIM DOSETIMESTOP FLGACCEPTPREDOSECRIT
1  DOSE DOSEUNI             MG DOSETIME DOSETIMESTOP                 0.05
> 
> j <- parameter_required("TAU|TOLD", names(mct), simplify=FALSE)
> mct[, names(j)]
  TOLD1 TOLD1U TAU1 TAU1U FLGACCEPTTAU
1  TOLD  TOLDU  TAU  TAUU FLGACCEPTTAU
> 
> #mct$OPTIMIZEKEL <- 0 # don't optimize
> #mct$OPTIMIZEKEL <- 1 # optimize
> mct$OPTIMIZEKEL
[1] 0
> mct$INCLUDEEXTRAPOLATION
[1] 1
> mct$INCLUDEINTERPOLATION
[1] 1
> #mct$FLGNOCMAX <- 0 # permit CMAX in optimal selections for KEL
> #mct$FLGNOCMAX <- 1 # do NO permit CMAX in optimal selections for KEL
> mct$FLGNOCMAX
[1] 1
> 
> table(d$PKPTMS, d$TREATXT)
     
      61 mgA Tafa free acid cap 80 mg Tafa meglumine cap
  0                          30                       30
  0.5                        30                       30
  1                          30                       30
  2                          30                       30
  3                          30                       30
  4                          30                       30
  6                          30                       30
  8                          30                       30
  12                         30                       30
  24                         30                       30
> 
> j <- parameter_required("^AUC.[0-9]+?.", names(mct), simplify=FALSE)
> mct[, names(j)]
  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2
1        0       12        0       26        0       24
> 
> (tclabel <- paste0("results.", testcase.id, ".", mct$MODEL, ".", mct$DOSINGTYPE, ".", mct$AUCMETHOD))
[1] "results.tc071.M1.SS.LINLOG"
> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
unit_conversion : Unit Class 1 (Time) time_col:  TMAX1 TMIN1 TLAST TLAG KELTMLO KELTMHI THALF LASTTIME MRTEVIFO1 MRTEVIFP1 TAU1  parameters are scaled from  HR  to  HR  via scaling factor:  1 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE1  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 4 (Volume) volume_col:  VZFTAU1  parameters are scaled from  ML  to  L  via scaling factor:  0.001 
unit_conversion : Unit Class 5 (Amount/Volume) conc_col:  CMAX1 CMIN1 CLAST1 CTROUGH1 CTROUGHEND1 CAV1  parameters are scaled from  NG/ML  to  NG/ML  via scaling factor:  1 
unit_conversion : Unit Class 6 (1/Time) kel_col:  KEL  parameters are scaled from  1/HR  to  1/HR  via scaling factor:  1 
unit_conversion : Unit Class 7 (Volume/Time) cl_col:  CLFTAU1  parameters are scaled from  ML/HR  to  L/HR  via scaling factor:  0.001 
unit_conversion : Unit Class 8: (Amount.Time/Volume) auc_col:  AUCALL AUCLAST AUCLAST1 AUCLASTC1 AUCINFO AUCINFOC AUCINFP AUCINFPC AUCTAU1  parameters are scaled from  NG.HR/ML  to  NG.HR/ML  via scaling factor:  1 
unit_conversion : Unit Class 9: (Amount.Time.Time/Volume) aumc_col:  AUMCTAU1  parameters are scaled from  NG.HR.HR/ML  to  NG.HR.HR/ML  via scaling factor:  1 
unit_conversion : Unit Class 12: ([Amount/Volume]/Amount) concdn_col:  CMAXDN1  parameters are scaled from  NG/ML/MG  to  NG/ML/MG  via scaling factor:  1 
Warning messages:
1: In run_M1_SS_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGEMESIS' is not present in the dataset
2: In unit_conversion(data = data_data, map = map_data, result = computation_df,  :
  'AMOUNTU' #2# is not present in the dataset provided via 'map'
3: In unit_conversion(data = data_data, map = map_data, result = computation_df,  :
  'CONCU' and 'DOSEU' values provided via 'map' is not present in the dataset provided via 'data'
4: In unit_conversion(data = data_data, map = map_data, result = computation_df,  :
  'PKPTMU' and 'CONCU' #10# are not present in the dataset provided via 'map'
5: In unit_conversion(data = data_data, map = map_data, result = computation_df,  :
  'CONCU' and 'NORMBSU' value provided via 'map' #13# are not present in the dataset provided via 'data'
6: In unit_conversion(data = data_data, map = map_data, result = computation_df,  :
  'CONCU', 'PKPTMU and 'NORMBSU' #19# are not present in the dataset provided via 'map'
> r <- results_list$data_out
> e <- results_list$est_data
> f <- results_list$flag_data
> # review eNCA Results
> results_list$ref <- read.csv(file=params["REFERENCERESULTS"], header=TRUE, sep=",", as.is=TRUE)
> 
> k <- match(r$SDEID, results_list$ref$SDEID)
> x <- r$AUC0_24
> y <- results_list$ref$AUC0..24[k]
> compare(y, x, tolerance=10^-16)
36/60 mismatches (average diff: 13.3)
[1]  150481 - 150481 == -9.90e-10
[2]  132118 - 132138 == -1.97e+01
[3]  136703 - 136756 == -5.28e+01
[5]  176346 - 176346 == -1.02e-09
[6]  176465 - 176465 == -9.90e-10
[8]  158495 - 158495 == -9.90e-10
[10] 158790 - 158783 ==  7.65e+00
[11] 137383 - 137373 ==  1.05e+01
[13] 249063 - 249063 == -9.90e-10
...
> x <- r$AUCLAST
> y <- results_list$ref$AUCLAST[k]
> compare(y, x, tolerance=10^-16)
36/60 mismatches (average diff: 39.5)
[1]  150481 - 150481 == -9.90e-10
[2]  132118 - 132138 == -1.97e+01
[3]  136703 - 136756 == -5.28e+01
[5]  176346 - 176346 == -1.02e-09
[6]  176465 - 176465 == -9.90e-10
[8]  158495 - 158495 == -9.90e-10
[10] 158790 - 158783 ==  7.65e+00
[11] 137383 - 137373 ==  1.05e+01
[13] 249063 - 249063 == -9.90e-10
...
...

2019-11-18 tc012 M1SS estimated concentration dataset doesn't include any data for AUCs requiring interpolation or extrapolation

tc012 M1SS single tau testcase:

> j <- parameter_required("^AUC[0-9]+?_[0-9]+?", names(r), simplify=FALSE)
> r[, c("SDEID", names(j))]
       SDEID   AUC0_12   AUC0_8  AUC13_24   AUC0_10  AUC12_30
1  130509330 106.28661 68.54661 101.01331  90.44661 112.81663
2  147299665 127.75800 74.57500  23.49161 101.57500  73.56096
3   24280050 121.70093 73.21000  22.86411  97.93000  69.57968
4  246409536  95.85319 60.81320  98.71463  80.49320 116.48335
5  246953363 132.22544 70.38500  35.31717 101.62500 101.83405
6  249265153 105.81029 72.25441  91.54349  91.66109 105.24380
7  283369224 114.04271 71.71271  99.91402  95.98271 115.81051
8  292748221 122.16927 79.47927 112.93158 103.56927 130.96473
9  297583299 132.20000 76.39500  26.74885 105.83036  78.93559
10 328228072  88.32373 59.80799  77.48153  76.38155  89.02996
11 330747542 112.24156 56.16500  29.08473  84.02500  88.21482
12 331625416 122.09137 71.06137 126.62559  99.92137 148.21804
13 331909809 138.43017 79.18000  30.52975 108.94000  91.42768
14 361955746 122.78796 72.57998  21.54994  99.22797  67.70626
15 372645306 145.30759 86.97000  34.52197 117.55135  96.67961
16 392032034 120.81805 70.88500  33.59945  96.32397  91.33066
17  45831434 135.53617 84.53981  30.15169 110.98868  85.08787
18 494439910 112.34286 76.28286 105.79389  97.01286 122.01738
19 543244472 122.89782 78.21380 108.80205 102.91218 120.43644
20 545913303 131.41914 72.60000  33.73834 101.18000 100.20367
21 579885120 118.70500 58.86500  35.66342  86.36500 106.65215
22 695874499 104.99736 65.78736  95.46428  87.80736 106.38086
23 702415421 151.49158 95.08500  34.66523 124.71463  92.83962
24 705396261 151.38648 83.33500  46.54758 117.72680 127.06918
25  70745987 109.22692 67.51494 101.45221  91.01704 109.01992
26 708723045 162.47091 86.09000  44.12660 125.28559 126.86082
27 716555376 137.28371 79.19000  35.46160 108.74820  98.07116
28  72354714 165.66456 92.14500  56.67040 128.68500 148.45348
29 777074699 148.96822 86.15000  31.92311 117.23000  95.83193
30 783385801 121.90605 79.12605 109.52263 104.47605 129.27205
31 797620983 129.24303 75.30303 129.72168 106.08303 140.93127
32 856727921 142.12160 84.61160 139.59919 117.28160 158.58041
33 895085608 128.76625 79.23625 126.03772 107.67625 144.30093
34 897885073 132.62947 81.23947 131.13516 109.79947 147.78610
35 916516839 121.50282 76.98282 113.49268 102.06282 129.42216
36 982849649 125.99427 78.86427 110.91988 105.68427 129.27825

where AUC13_24 and AUC12_30 are included to test interpolation/extrapolation. However the estimated concentration dataset doesn't include any values for interpolation or extrapolation.

   PKDATAROWID     SDEID   TIME  CEST_KEL CEST_INT CEST_EXT CEST_C0 CEST_TLAST
1      26908252  24280050 12.000  5.467556       NA       NA      NA         NA
2      26908253  24280050 18.000  2.696850       NA       NA      NA         NA
3      26908254  24280050 24.000  1.330210       NA       NA      NA   1.330210
4      26908341  45831434  8.000  7.594357       NA       NA      NA         NA
5      26908342  45831434 10.000  6.382756       NA       NA      NA         NA
6      26908343  45831434 12.000  5.364453       NA       NA      NA         NA
7      26908344  45831434 18.000  3.184764       NA       NA      NA         NA
8      26908345  45831434 24.000  1.890727       NA       NA      NA   1.890727
9      26908924  70745987  2.000  5.638244       NA       NA      NA         NA
10     26908925  70745987  4.000  5.382876       NA       NA      NA         NA
11     26908926  70745987  6.000  5.139075       NA       NA      NA         NA
12     26908927  70745987  9.000  4.793919       NA       NA      NA         NA
13     26908928  70745987 12.000  4.471946       NA       NA      NA         NA
14     26908929  70745987 12.333  4.437567       NA       NA      NA         NA
15     26908930  70745987 12.667  4.403351       NA       NA      NA         NA
16     26908931  70745987 13.000  4.369500       NA       NA      NA         NA
17     26908932  70745987 13.500  4.319161       NA       NA      NA         NA
18     26908933  70745987 14.000  4.269402       NA       NA      NA         NA
19     26908934  70745987 16.000  4.076032       NA       NA      NA         NA
20     26908935  70745987 18.000  3.891420       NA       NA      NA         NA
21     26908936  70745987 21.000  3.630061       NA       NA      NA         NA
22     26908937  70745987 24.000  3.386256       NA       NA      NA   3.386256
23     26908291  72354714 12.000  9.540110       NA       NA      NA         NA
24     26908292  72354714 18.000  5.836801       NA       NA      NA         NA
25     26908293  72354714 24.000  3.571053       NA       NA      NA   3.571053
26     26908951 130509330 13.500  8.226134       NA       NA      NA         NA
27     26908952 130509330 14.000  7.703235       NA       NA      NA         NA
28     26908953 130509330 16.000  5.923561       NA       NA      NA         NA
29     26908954 130509330 18.000  4.555043       NA       NA      NA         NA
30     26908955 130509330 21.000  3.071546       NA       NA      NA         NA
31     26908956 130509330 24.000  2.071197       NA       NA      NA   2.071197
32     26908018 147299665 12.000  5.948676       NA       NA      NA         NA
33     26908019 147299665 18.000  2.791242       NA       NA      NA         NA
34     26908020 147299665 24.000  1.309709       NA       NA      NA   1.309709
35     26908532 246409536 13.000  7.993709       NA       NA      NA         NA
36     26908533 246409536 13.500  7.556942       NA       NA      NA         NA
37     26908534 246409536 14.000  7.144040       NA       NA      NA         NA
38     26908535 246409536 16.000  5.706041       NA       NA      NA         NA
39     26908536 246409536 18.000  4.557492       NA       NA      NA         NA
40     26908537 246409536 21.000  3.253213       NA       NA      NA         NA
41     26908538 246409536 24.000  2.322197       NA       NA      NA   2.322197
42     26908317 246953363 12.000  7.453740       NA       NA      NA         NA
43     26908318 246953363 18.000  3.934901       NA       NA      NA         NA
44     26908319 246953363 24.000  2.077272       NA       NA      NA   2.077272
45     26908866 249265153  1.500  7.301496       NA       NA      NA         NA
46     26908867 249265153  2.000  7.158180       NA       NA      NA         NA
47     26908868 249265153  4.000  6.612501       NA       NA      NA         NA
48     26908869 249265153  6.000  6.108420       NA       NA      NA         NA
49     26908870 249265153  9.000  5.423425       NA       NA      NA         NA
50     26908871 249265153 12.000  4.815245       NA       NA      NA         NA
51     26908872 249265153 12.333  4.752090       NA       NA      NA         NA
52     26908873 249265153 12.667  4.689577       NA       NA      NA         NA
53     26908874 249265153 13.000  4.628071       NA       NA      NA         NA
54     26908875 249265153 13.500  4.537230       NA       NA      NA         NA
55     26908876 249265153 14.000  4.448172       NA       NA      NA         NA
56     26908877 249265153 16.000  4.109081       NA       NA      NA         NA
57     26908878 249265153 18.000  3.795840       NA       NA      NA         NA
58     26908879 249265153 21.000  3.370176       NA       NA      NA         NA
59     26908880 249265153 24.000  2.992246       NA       NA      NA   2.992246
60     26908513 283369224 13.000  9.017636       NA       NA      NA         NA
61     26908514 283369224 13.500  8.412782       NA       NA      NA         NA
62     26908515 283369224 14.000  7.848499       NA       NA      NA         NA
63     26908516 283369224 16.000  5.945310       NA       NA      NA         NA
64     26908517 283369224 18.000  4.503626       NA       NA      NA         NA
65     26908518 283369224 21.000  2.969232       NA       NA      NA         NA
66     26908519 283369224 24.000  1.957609       NA       NA      NA   1.957609
67     26908893 292748221 13.000  9.929105       NA       NA      NA         NA
68     26908894 292748221 13.500  9.299885       NA       NA      NA         NA
69     26908895 292748221 14.000  8.710541       NA       NA      NA         NA
70     26908896 292748221 16.000  6.703709       NA       NA      NA         NA
71     26908897 292748221 18.000  5.159233       NA       NA      NA         NA
72     26908898 292748221 21.000  3.483295       NA       NA      NA         NA
73     26908899 292748221 24.000  2.351772       NA       NA      NA   2.351772
74     26908108 297583299 10.000  7.328109       NA       NA      NA         NA
75     26908109 297583299 12.000  5.880090       NA       NA      NA         NA
76     26908110 297583299 18.000  3.037806       NA       NA      NA         NA
77     26908485 328228072  1.000  6.393740       NA       NA      NA         NA
78     26908486 328228072  1.500  6.263443       NA       NA      NA         NA
79     26908487 328228072  2.000  6.135801       NA       NA      NA         NA
80     26908488 328228072  4.000  5.650722       NA       NA      NA         NA
81     26908489 328228072  6.000  5.203992       NA       NA      NA         NA
82     26908490 328228072  9.000  4.599235       NA       NA      NA         NA
83     26908491 328228072 12.000  4.064757       NA       NA      NA         NA
84     26908492 328228072 12.333  4.009399       NA       NA      NA         NA
85     26908493 328228072 12.667  3.954633       NA       NA      NA         NA
86     26908494 328228072 13.000  3.900775       NA       NA      NA         NA
87     26908495 328228072 13.500  3.821282       NA       NA      NA         NA
88     26908496 328228072 14.000  3.743409       NA       NA      NA         NA
89     26908497 328228072 16.000  3.447465       NA       NA      NA         NA
90     26908498 328228072 18.000  3.174918       NA       NA      NA         NA
91     26908499 328228072 21.000  2.805961       NA       NA      NA         NA
92     26908500 328228072 24.000  2.479879       NA       NA      NA   2.479879
93     26908304 330747542 12.000  6.886258       NA       NA      NA         NA
94     26908305 330747542 18.000  3.393008       NA       NA      NA         NA
95     26908306 330747542 24.000  1.671808       NA       NA      NA   1.671808
96     26908817 331625416 13.000 12.769752       NA       NA      NA         NA
97     26908818 331625416 13.500 10.631781       NA       NA      NA         NA
98     26908819 331625416 14.000  8.851760       NA       NA      NA         NA
99     26908057 331909809 12.000  7.001066       NA       NA      NA         NA
100    26908058 331909809 18.000  3.485191       NA       NA      NA         NA
101    26908059 331909809 24.000  1.734958       NA       NA      NA   1.734958
102    26908042 361955746  8.000  7.027679       NA       NA      NA         NA
103    26908043 361955746 10.000  6.206793       NA       NA      NA         NA
104    26908044 361955746 12.000  5.481793       NA       NA      NA         NA
105    26908238 372645306 10.000  7.457668       NA       NA      NA         NA
106    26908239 372645306 12.000  6.344770       NA       NA      NA         NA
107    26908240 372645306 18.000  3.907100       NA       NA      NA         NA
108    26908082 392032034 10.000  6.498894       NA       NA      NA         NA
109    26908083 392032034 12.000  5.705948       NA       NA      NA         NA
110    26908084 392032034 18.000  3.861828       NA       NA      NA         NA
111    26908837 494439910 13.500  8.242931       NA       NA      NA         NA
112    26908838 494439910 14.000  7.749338       NA       NA      NA         NA
113    26908839 494439910 16.000  6.053358       NA       NA      NA         NA
114    26908840 494439910 18.000  4.728551       NA       NA      NA         NA
115    26908841 494439910 21.000  3.264568       NA       NA      NA         NA
116    26908842 494439910 24.000  2.253841       NA       NA      NA   2.253841
117    26908960 543244472  1.000  7.597843       NA       NA      NA         NA
118    26908961 543244472  1.500  7.479809       NA       NA      NA         NA
119    26908962 543244472  2.000  7.363608       NA       NA      NA         NA
120    26908963 543244472  4.000  6.916580       NA       NA      NA         NA
121    26908964 543244472  6.000  6.496690       NA       NA      NA         NA
122    26908965 543244472  9.000  5.914163       NA       NA      NA         NA
123    26908966 543244472 12.000  5.383868       NA       NA      NA         NA
124    26908967 543244472 12.333  5.328019       NA       NA      NA         NA
125    26908968 543244472 12.667  5.272584       NA       NA      NA         NA

2019-11-15 tc010 extrapolation for partial AUCs is not being recorded to the estimated concentration dataset

test case tc010

Add partial AUCs:

 mct$AUC.4.T1 <- 0
 mct$AUC.4.T2 <- 30
 # Extrapolate Partial AUC
 mct$AUC.5.T1 <- 0
 mct$AUC.5.T2 <- 124
 
  j <- parameter_required("^AUC.[0-9]+?.", names(mct), simplify=FALSE)
 mct[, names(j)]
   AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2 AUC.5.T1 AUC.5.T2
 1        0        7        8       48        0       64        0       30        0      124

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)

Resulting parameter dataframe

         AUC0_7     AUC8_48     AUC0_64     AUC0_30    AUC0_124
 1     5.150750   16.115864    23.59851    19.70926    24.36632
 2    16.630430   27.186570    47.51955    43.74855    47.72142
 3  1826.885933 1140.509935  3155.39210  2946.43465  3186.01791
 4   759.772228 1482.006413  2543.66350  1857.10614  2694.60452
 5  6447.260530 5524.243972 12915.26200 11697.15968 13171.68935
 6  2026.373649 1432.192203  3683.11590  3400.62904  3729.67352
 7    16.023791   46.488059    73.48402    50.29528    81.36431
 8    19.037500   62.309949    91.99822    69.28342    99.67902
 9   395.187556  414.853089   883.42274   772.97428   910.68799
 10    3.982875   15.775430    22.50988    17.76147    25.19713
 11 4278.933737 2468.641048  7170.07381  6754.99124  7254.46948
 12 7730.206336 5323.498495 13984.33804 12936.52938 14211.86415
 13   11.910000   51.133415    70.47629    54.10371    76.67034
 14   94.077277  145.965750   268.55542   222.07822   290.29162
 15   77.181437  108.658798   204.54646   169.21880   211.74998
 16 5228.563212 4459.884946 10432.14093  9395.26444 10703.89267
 17   22.587594   61.264286    93.30063    72.58782    97.01257
 18  471.496268  542.503402  1117.77753   950.86283  1162.13224
 19 3620.713623 3105.414236  7252.21114  6526.48819  7477.50030
 20   53.298750  131.477784   203.91558   179.66670   208.43803
 21 6670.725819 4731.692389 12129.35766 11050.42709 12426.39270
 22 1628.484634 1407.499421  3307.33363  2908.00294  3430.97916
 23  209.312058  332.789228   604.37115   508.88000   634.62825
 24 7445.501574 5909.793566 14477.65743 12515.36085 15269.39305
 25 1055.339216 1175.596164  2437.80067  2163.83949  2518.82981
 26 4400.426105 3558.197713  8568.68723  7909.54856  8711.33322
 27   41.346250  154.878916   221.93726   173.65382   232.86491
 28 7451.020059 6656.170696 15160.12434 13792.24073 15525.50229
 29    4.869875    9.248423    15.17517    13.87906    15.53051
 30 1290.255720 1627.226746  3215.16872  2704.65531  3429.48143
 31 4569.409480 3585.059094  8754.50885  7914.15886  9012.59798
 32  405.622354  588.225438  1114.30067   906.41187  1265.21106
 33  840.800000 2728.955981  4087.42371  2989.31063  4561.64687
 34 1252.107866 1828.834087  3373.54061  2840.56572  3502.13778
 35 1681.984359 1188.749998  3068.01559  2800.86999  3124.56661
 36   55.151957  191.942856   277.91700   210.41895   304.09100
 37    6.878162   11.650839    20.89284    16.35036    22.55152
 38  391.805441  946.630254  1508.28984  1124.35012  1576.78256
 39 2142.867553 1753.192912  4159.07458  3828.34464  4241.54138
 40  110.519647  228.236251   377.13650   303.88578   395.17431
 41 3371.716409 4370.179733  8514.10003  7349.36142  8812.14012
 42  493.469246  499.497906  1072.45419   954.89993  1090.45759
 43  269.998844  458.234651   805.44510   669.69489   833.17675
 44 1103.458808 1334.859976  2665.03729  2277.13391  2728.93677
 45   10.641990   21.250117    36.06401    28.29687    38.44154
 46   18.197500   44.909422    70.60103    56.97479    72.72429
 47 5402.856051 3347.044867  9289.05440  8742.69395  9388.28350
 48    9.329302   14.832649    26.59689    22.20162    26.93439

Resulting estimated concentration dataset however is missing CEST_EXT values

 4            NA   2925168    7           NA   3.59500000       NA      NA         NA
 1      22289754   2925168   24   1.70263761           NA       NA      NA         NA
 6            NA   2925168   30           NA   1.43400000       NA      NA         NA
 7            NA   2925168   30           NA   1.43400000       NA      NA         NA
 2      22289755   2925168   48   0.58780724           NA       NA      NA         NA
 5            NA   2925168   64           NA   0.32866667       NA      NA         NA
 3      22289756   2925168   72   0.20293065           NA       NA      NA 0.20293065
 51           NA  40876220    7           NA   1.11575000       NA      NA         NA
 11     22289571  40876220   16   0.49544432           NA       NA      NA         NA
 21     22289572  40876220   24   0.36517471           NA       NA      NA         NA
 71           NA  40876220   30           NA   0.31600000       NA      NA         NA
 8            NA  40876220   30           NA   0.31600000       NA      NA         NA
 31     22289573  40876220   48   0.14622386           NA       NA      NA         NA
 61           NA  40876220   64           NA   0.08246667       NA      NA         NA
 41     22289574  40876220   72   0.05855120           NA       NA      NA 0.05855120
 42           NA  63536292    7           NA   1.03375000       NA      NA         NA
 12     22289531  63536292   12   0.51896071           NA       NA      NA         NA
 22     22289532  63536292   16   0.36933771           NA       NA      NA         NA
 32     22289533  63536292   24   0.18706907           NA       NA      NA 0.18706907
 62           NA  63536292   30           NA   0.14325000       NA      NA         NA
 72           NA  63536292   30           NA   0.14325000       NA      NA         NA
 52           NA  63536292   64           NA   0.00000000       NA      NA         NA
 43           NA 111299859    7           NA   1.31050000       NA      NA         NA
 13     22289597 111299859   16   0.58377725           NA       NA      NA         NA
 23     22289598 111299859   24   0.37399383           NA       NA      NA         NA
 63           NA 111299859   30           NA   0.31462500       NA      NA         NA
 73           NA 111299859   30           NA   0.31462500       NA      NA         NA
 33     22289599 111299859   48   0.09833684           NA       NA      NA 0.09833684
 53           NA 111299859   64           NA   0.03250000       NA      NA         NA
 54           NA 112146587    7           NA   2.98750000       NA      NA         NA
 14     22289765 112146587   12   1.59483827           NA       NA      NA         NA
 24     22289766 112146587   16   1.14287770           NA       NA      NA         NA
 34     22289767 112146587   24   0.58690253           NA       NA      NA         NA
 74           NA 112146587   30           NA   0.51065000       NA      NA         NA
 81           NA 112146587   30           NA   0.51065000       NA      NA         NA
 44     22289768 112146587   48   0.07948124           NA       NA      NA 0.07948124
 64           NA 112146587   64           NA   0.02586667       NA      NA         NA
 82           NA 123811839    7           NA 164.75000000       NA      NA         NA
 15     22290452 123811839   12  44.59385840           NA       NA      NA         NA
 25     22290453 123811839   16  36.10132904           NA       NA      NA         NA
 35     22290454 123811839   24  23.66025768           NA       NA      NA         NA
 10           NA 123811839   30           NA  19.47000000       NA      NA         NA
 111          NA 123811839   30           NA  19.47000000       NA      NA         NA
 45     22290455 123811839   48   6.66052265           NA       NA      NA         NA
 9            NA 123811839   64           NA   2.28000000       NA      NA         NA
 55     22290456 123811839   72   1.87498220           NA       NA      NA         NA
 65     22290457 123811839   96   0.52782018           NA       NA      NA         NA
 75     22290458 123811839  120   0.14858495           NA       NA      NA 0.14858495```

2019-11-20 tc013 M2SD test case variant with All FLGEXAUC set to 1 crashes computation engine

Issue

When excluding all data point from AUC computations for tc013 the computation engine crashes giving a unique error (not the same error as specified in #35).

flags$FLGEXAUC <- rep(1, nrow(flags)) # exclude all records/data points from KEL calcs
 Error in value[[3L]](cond) : 
  Error in auc_XbpctO(conc = tmp_df[, map_data$CONC], time = tmp_df[, map_data$TIME], : object 'auc_xbpcto' not found
For SDEID 10589286 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M2_SD_computation.R#1708
6. value[[3L]](cond) 
5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 
4. tryCatchList(expr, classes, parentenv, handlers) 
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at run_M2_SD_computation.R#816
2. run_M2_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2229
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

When a partial AUC is added to tc013 it will crash with the error shown in #35.

2019-11-17 tc011 partial AUCs that require interpolation or extrapolation are computed but not included in estimated concentration dataset

tc010

# Interpolate Partial AUC
mct$AUC.4.T1 <- 16
mct$AUC.4.T2 <- 30
# Extrapolate Partial AUC
mct$AUC.5.T1 <- 0
mct$AUC.5.T2 <- 10

> j <- parameter_required("^AUC.[0-9]+?.", names(mct), simplify=FALSE)
> mct[, names(j)]
  AUC.1.T1 AUC.1.T2 AUC.2.T1 AUC.2.T2 AUC.3.T1 AUC.3.T2 AUC.4.T1 AUC.4.T2 AUC.5.T1 AUC.5.T2
1        0       12       12       24        0       48       16       30        0       10

Resulting parameters include the requested partial AUCs:

> j <- parameter_required("^AUC[0-9]+?_[0-9]+?", names(r), simplify=FALSE)
> r[, c("SDEID", names(j))]
       SDEID   AUC0_12  AUC12_24  AUC0_48 AUC16_30   AUC0_10
1  130509330 106.28661 112.81663 219.1032 56.19414  90.44661
2  246409536  95.85319 116.48335 212.3365 59.06146  80.49320
3  249265153 105.81029 105.24380 211.0541 48.68464  91.66109
4  283369224 114.04271 115.81051 229.8532 56.68161  95.98271
5  292748221 122.16927 130.96473 253.1340 64.59674 103.56927
6  328228072  88.32373  89.02996 177.3537 42.98849  76.38155
7  331625416 122.09137 148.21804 270.3094 73.89268  99.92137
8  494439910 112.34286 122.01738 234.3602 60.32097  97.01286
9  543244472 122.89782 120.43644 243.3343 65.12749 102.91218
10 695874499 104.99736 106.38086 211.3782 54.37459  87.80736
11  70745987 109.22692 109.01992 218.2468 64.32691  91.01704
12 783385801 121.90605 129.27205 251.1781 63.54793 104.47605
13 797620983 129.24303 140.93127 270.1743 78.46572 106.08303
14 856727921 142.12160 158.58041 300.7020 79.40981 117.28160
15 895085608 128.76625 144.30093 273.0672 74.78059 107.67625
16 897885073 132.62947 147.78610 280.4156 78.28684 109.79947
17 916516839 121.50282 129.42216 250.9250 64.19622 102.06282
18 982849649 125.99427 129.27825 255.2725 64.79428 105.68427

However the estimated concentration dataset doesn't include the values that require interpolation or extrapolation:

   PKDATAROWID     SDEID TIME CEST_KEL CEST_INT CEST_EXT CEST_C0 CEST_TLAST
1     26908935  70745987 18.0 4.780859       NA       NA      NA         NA
2     26908936  70745987 21.0 3.498742       NA       NA      NA         NA
3     26908937  70745987 24.0 2.560460       NA       NA      NA   2.560460
4     26908954 130509330 18.0 4.124984       NA       NA      NA         NA
5     26908955 130509330 21.0 3.017955       NA       NA      NA         NA
6     26908956 130509330 24.0 2.208021       NA       NA      NA   2.208021
7     26908535 246409536 16.0 5.333360       NA       NA      NA         NA
8     26908536 246409536 18.0 4.376376       NA       NA      NA         NA
9     26908537 246409536 21.0 3.253009       NA       NA      NA         NA
10    26908538 246409536 24.0 2.417997       NA       NA      NA   2.417997
11    26908877 249265153 16.0 4.922666       NA       NA      NA         NA
12    26908878 249265153 18.0 3.780412       NA       NA      NA         NA
13    26908879 249265153 21.0 2.544177       NA       NA      NA         NA
14    26908880 249265153 24.0 1.712204       NA       NA      NA   1.712204
15    26908516 283369224 16.0 5.622917       NA       NA      NA         NA
16    26908517 283369224 18.0 4.355208       NA       NA      NA         NA
17    26908518 283369224 21.0 2.968792       NA       NA      NA         NA
18    26908519 283369224 24.0 2.023721       NA       NA      NA   2.023721
19    26908895 292748221 14.0 8.142487       NA       NA      NA         NA
20    26908896 292748221 16.0 6.390056       NA       NA      NA         NA
21    26908897 292748221 18.0 5.014785       NA       NA      NA         NA
22    26908898 292748221 21.0 3.486372       NA       NA      NA         NA
23    26908899 292748221 24.0 2.423791       NA       NA      NA   2.423791
24    26908495 328228072 13.5 6.605181       NA       NA      NA         NA
25    26908496 328228072 14.0 6.128861       NA       NA      NA         NA
26    26908497 328228072 16.0 4.543182       NA       NA      NA         NA
27    26908498 328228072 18.0 3.367756       NA       NA      NA         NA
28    26908499 328228072 21.0 2.149370       NA       NA      NA         NA
29    26908500 328228072 24.0 1.371771       NA       NA      NA   1.371771
30    26908818 331625416 13.5 9.835481       NA       NA      NA         NA
31    26908819 331625416 14.0 9.241418       NA       NA      NA         NA
32    26908820 331625416 16.0 7.202953       NA       NA      NA         NA
33    26908821 331625416 18.0 5.614131       NA       NA      NA         NA
34    26908822 331625416 21.0 3.863140       NA       NA      NA         NA
35    26908823 331625416 24.0 2.658266       NA       NA      NA   2.658266
36    26908839 494439910 16.0 5.601851       NA       NA      NA         NA
37    26908840 494439910 18.0 4.508992       NA       NA      NA         NA
38    26908841 494439910 21.0 3.256126       NA       NA      NA         NA
39    26908842 494439910 24.0 2.351381       NA       NA      NA   2.351381
40    26908969 543244472 13.0 8.540985       NA       NA      NA         NA
41    26908970 543244472 13.5 8.080628       NA       NA      NA         NA
42    26908971 543244472 14.0 7.645084       NA       NA      NA         NA
43    26908972 543244472 16.0 6.125348       NA       NA      NA         NA
44    26908973 543244472 18.0 4.907714       NA       NA      NA         NA
45    26908974 543244472 21.0 3.519670       NA       NA      NA         NA
46    26908975 543244472 24.0 2.524206       NA       NA      NA   2.524206
47    26908572 695874499 14.0 7.097609       NA       NA      NA         NA
48    26908573 695874499 16.0 5.476251       NA       NA      NA         NA
49    26908574 695874499 18.0 4.225272       NA       NA      NA         NA
50    26908575 695874499 21.0 2.863595       NA       NA      NA         NA
51    26908576 695874499 24.0 1.940745       NA       NA      NA   1.940745
52    26908476 783385801 13.5 8.322697       NA       NA      NA         NA
53    26908477 783385801 14.0 7.852061       NA       NA      NA         NA
54    26908478 783385801 16.0 6.221025       NA       NA      NA         NA
55    26908479 783385801 18.0 4.928789       NA       NA      NA         NA
56    26908480 783385801 21.0 3.475823       NA       NA      NA         NA
57    26908481 783385801 24.0 2.451179       NA       NA      NA   2.451179
58    26908553 797620983 14.0 9.083895       NA       NA      NA         NA
59    26908554 797620983 16.0 7.349303       NA       NA      NA         NA
60    26908555 797620983 18.0 5.945936       NA       NA      NA         NA
61    26908556 797620983 21.0 4.326944       NA       NA      NA         NA
62    26908557 797620983 24.0 3.148780       NA       NA      NA   3.148780
63    26908916 856727921 18.0 6.093222       NA       NA      NA         NA
64    26908917 856727921 21.0 4.251489       NA       NA      NA         NA
65    26908918 856727921 24.0 2.966437       NA       NA      NA   2.966437
66    26908858 895085608 16.0 6.810659       NA       NA      NA         NA
67    26908859 895085608 18.0 5.571924       NA       NA      NA         NA
68    26908860 895085608 21.0 4.123151       NA       NA      NA         NA
69    26908861 895085608 24.0 3.051078       NA       NA      NA   3.051078
70    26908610 897885073 14.0 8.898941       NA       NA      NA         NA
71    26908611 897885073 16.0 7.213563       NA       NA      NA         NA
72    26908612 897885073 18.0 5.847380       NA       NA      NA         NA
73    26908613 897885073 21.0 4.267550       NA       NA      NA         NA
74    26908614 897885073 24.0 3.114554       NA       NA      NA   3.114554
75    26908593 916516839 18.0 5.022101       NA       NA      NA         NA
76    26908594 916516839 21.0 3.451510       NA       NA      NA         NA
77    26908595 916516839 24.0 2.372099       NA       NA      NA   2.372099
78    26908629 982849649 14.0 7.872877       NA       NA      NA         NA
79    26908630 982849649 16.0 6.229732       NA       NA      NA         NA
80    26908631 982849649 18.0 4.929528       NA       NA      NA         NA
81    26908632 982849649 21.0 3.469838       NA       NA      NA         NA
82    26908633 982849649 24.0 2.442379       NA       NA      NA   2.442379

2019-11-20 M2SD model execution with tc013 in application directly (SDEID: 343222739) fails with Error: $ operator is invalid for atomic vectors

Execution of M2 SD bolus model with commit 92ca12a

It appears that the 343222739 SDEID is associated with records where PKCNCN is ALL missing, i.e. NA. This needs to be addressed in a way that missing PKCNCN values do not impair execution or processing of profiles and generation of parameters for other profiles.

Links to #38

There were 25 warnings (use warnings() to see them)
[1] "openNCA: Model: M2 DosingType: SD AUCMETHOD: LINLOG"
Error in value[[3L]](cond) : 
Error: $ operator is invalid for atomic vectors
For SDEID 343222739
Calls: run_computation ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
In addition: Warning messages:
1: In run_M2_SD_computation(data = merged_data, map = map_data, method = method, :
Flag 'FLGEMESIS' is not present in the dataset
2: In run_M2_SD_computation(data = merged_data, map = map_data, method = method, :
Flag 'FLGACCEPTTAU' is not present in the dataset
Execution halted

Columns in data_out for tc011 misaligned

Issue

When running tc011 unchanged, columns in data_out are misaligned, each value has been pushed one position to the right. An example is shown below:

      SDEID DOSE DOSE.1 DOSEC CMAX1 CMAX2 CMAXDN1  CMAXDN2   FLGACCEPTPREDOSE CMIN1 CMIN2 CLAST1 CLAST2 TMAX1
1 130509330  300    300   300 3e+05  8120    9540 27.06667             0.0318     0  1940   2200   2290  2.20
2 246409536  300    300   300 3e+05  8130   12600 27.10000              0.042     0   945   2240   2240  2.42
3 249265153  300    300   300 3e+05 12200   12100 40.66667 0.0403333333333333     0  1620   1720   2030  1.72
4 283369224  300    300   300 3e+05  8060   12900 26.86667              0.043     0  2060   1990   2520  1.99
5 292748221  300    300   300 3e+05 10900   11500 36.33333 0.0383333333333333     0  2260   2490   2720  2.49
  TMAX2  TMIN1 TMIN2 TLAST TLAG KEL     KELC0  KELTMLO KELTMHI KELNOPT KELRSQ   KELRSQA FLGACCEPTKEL THALF
1 1.500 13.000     0    24   24   0 104.16094 26.89550      18      24      3 0.9995933            1     0
2 0.667 12.667     0    12   24   0  98.88024 25.94724      16      24      4 0.9990935            1     0
3 1.000 13.000     0    24   24   0 132.00860 40.69022      16      24      4 0.9992316            1     0
4 2.000 12.667     0    24   24   0 127.73909 43.40940      16      24      4 0.9981222            1     0
5 1.000 12.667     0    24   24   0 121.17629 44.41440      14      24      5 0.9974224            1     0

This issue with tc011 was brought up in a previous touchpoint meeting and documenting it as an issue so it's not forgotten.

List of Open and Closed Issues

This list has been updated for commit e7df513 on 28MAY20, see individual listings for last commit where testing occurred.

Issues

  • 2020-05-28 - tc1514 M2SS "isTRUE(time_min_range <= lastttime)" execution error introduced with e7df513 (#250)
  • 2020-05-21 tc131 & tc133 M1SS + tc1514 M2SS "tau < orig_time..." execution error with actual time introduced with 786bf37 (#249)
  • 2020-05-14 tc1513 M2SD weight-normalised parameters provided when NORMBSU is not valid
    (#247)
  • 2020-05-14 tc119 M1SD KEL NA for unknown reason when OPTIMIZEKEL == 1 for two profiles (#246)
  • 2020-05-13 tc158 M1SS AUCTAU2 not matching partial AUC for same time period (#244)
  • 2020-05-12 tc1510_M1SD-1 testcase variant fails with "interpolate_lin" error (#238)
  • 2020-05-09 tc1510_M1SD CTOLDesti parameter not generated (#233)
  • 2020-05-08 tc1513 M2SD unit_conversion warning messages falsely lists columns as missing from mct/data (#232)
  • 2020-04-23 Add TIME UNIT of "H" to option of "HR" in unit_conversion.R to avoid warning messages that "H" is inappropriate. (#230)
    • candidate for closure
    • last tested 8e304f8
  • 2020-04-17 tc1518_M4SS - concerning warning message from run_computation (#229)
  • 2020-04-07 tc157 incorrect DOSE units doesn't always trigger warning and continues to produce parameter data (#225)
  • 2020-04-06 tc015 M3SD mct$DOSEOUTPUTUNIT does not influence unit conversion (#222)
  • 2020-04-03 tc111 M4 TMAXRATE selecting wrong interval when RATE is NaN (#206)
  • 2020-04-03 tc111 M4 RATEN returning NaN instead of NA when mct$ACTENDTIME <= mct$ACTTIME (#205)
  • 2020-04-02 tc1572 M4SS - CONC and CONCTIME, parameter outputs not provided in results from run_computation (#202)
  • 2020-04-01 tc155 M1SS computation engine doesn't generate error when duplicate time values appear with different concentration values (#201)
  • 2020-04-01 tc152 M1SD TLAG values are incorrect (#199)
  • 2020-02-06 tc119 OPTIMIZEKEL results not consistent with generated FLGEXKEL values, generated parameters nor FLGACCEPTKELCRIT settings (#173)
  • 2020-01-31 FLGEXKEL computation error when using OPTIMIZEKEL in five testcases introduced with a6cb6ff (#169)
  • Performance characteristics for computation engine execution not acceptable (#159)
  • 2020-01-17 tc125 M1SS fails to find TAU/TOLD values in either input concentration dataset or flags dataset (#158)
    • potential data issue
  • 2020-01-07 tc120 M3SS missing DOSE2U definition causes crash (#149)
  • 2019-12-18 tc113 M3SD doesn't generate CMINDN (#124)

Documentation

  • TAUi/TOLDi sourced from FLAGS if present and parameterset=="PARAMETERDISPLAYLIST" (#139) - documentation
  • 2019-12-20 Running M4 methods with OPTIMIZEKEL == 1 results in computation error (#135) - documentation
  • Updated Computation Engine Specification Document in master branch with definition of CMINDN (#125) - documentation
  • Updated definitions of CENDINF/TENDINF in the documentation in master branch (#122) - documentation
  • 2019-12-17 openNCA commit 42ede0d code review (#119) - documentation
  • 2019-12-13 Documentation of partial AUC handling (#115) - documentation
  • ACCEPTANCE FLAGS must be incorporated into PARAMETERDISPLAYLIST, PARAMETERLIST for them to be included in output (#75) - documentation
  • new MCT item: DATADISPLAYLIST (#1) - documentation

2019-11-18 tc012 optimizekel routine selects points not consistent with FLGACCEPTKELCRIT

When testing with tc012 (M1SS single tau) with mct$FLGACCEPTKELCRIT <- "KELRSQ>=0.9,KELNOPT>=3,AUCXPCTP<=20.0"

and comparing runs with no-optimization, i.e. Analyst selected points for terminal elimination phase, against optimization selection, there is at least one profile where the optimization routine doesn't select a data points that are appropriate, i.e. see SDEID == 249265153 below. The "optimized" selection of points results in KELNOPT =15, KELRSQ==0.1861215, AUCXPCTP==41.6975933 and thus FLGACCEPTKEL==0. The analyst chosen points ensures that KELRSQ is > 0.9, i.e. 0.9992316 but with KELNOPT==4 and AUCXPCTP==10.945719. This occurs with SDEID==328228072 as well below.

It appears that the optimization routine is favoring KELNOPT over KELRSQ and AUCXPCTP but this is not acceptable since all 3 constraints must be satisfied to set FLGACCEPTKEL to 1. Note that none of the runs included FLGNOCMAX included in the mct for optimization runs.

        SDEID SUBJID.nonopt KEL.nonopt KELRSQ.nonopt KELNOPT.nonopt AUCXPCTP.nonopt FLGACCEPTKEL.nonopt SUBJID.opt    KEL.opt KELRSQ.opt KELNOPT.opt AUCXPCTP.opt FLGACCEPTKEL.opt
1  130509330      10011015 0.10416094     0.9995933              3       16.212771                   1   10011015 0.13135136  0.9846997           6   12.5824889                1
2  147299665      10011003 0.12611367     0.9999997              3        9.352225                   1   10011003 0.12611367  0.9999997           3    9.3522248                1
3   24280050      10011004 0.11779122     0.9970626              3       10.560748                   1   10011004 0.11779122  0.9970626           3   10.5607478                1
4  246409536      10011008 0.09888024     0.9990935              4       18.721028                   1   10011008 0.11237648  0.9828765           7   16.2926707                1
5  246953363      10011013 0.10647171     0.9975960              3       14.288932                   1   10011013 0.10647171  0.9975960           3   14.2889318                1
6  249265153      10011007 0.13200860     0.9992316              4       10.945719                   1   10011007 0.03964688  0.1861215          15   41.6975933                0
7  283369224      10011005 0.12773909     0.9981222              4       12.114940                   1   10011005 0.13885987  0.9925170           7   10.9264101                1
8  292748221      10011010 0.12117629     0.9974224              5       13.646925                   1   10011010 0.13093646  0.9895611           7   12.4274535                1
9  297583299      10011017 0.11094610     0.9995613              3       11.868315                   1   10011017 0.11007273  0.9978652           3   11.8988892                1
10 328228072      10011004 0.14969062     0.9950580              6        9.366272                   1   10011004 0.04117867  0.2447580          16   40.4450752                0
11 330747542      10011012 0.11796850     0.9998570              3       12.387824                   1   10011012 0.11796850  0.9998570           3   12.3878236                1
12 331625416      10011002 0.12460213     0.9915082              6       13.632952                   1   10011002 0.36646295  0.9106462           3    0.4556764                1
13 331909809      10011010 0.11625660     0.9974519              3       11.492677                   1   10011010 0.11625660  0.9974519           3   11.4926770                1
14 361955746      10011007 0.12801045     0.9985610              3        8.821899                   1   10011007 0.06210606  0.9474643           3   30.5465816                1
15 372645306      10011001 0.09831321     0.9996748              3       15.022547                   1   10011001 0.08080593  0.9666803           3   19.7487372                1
16 392032034      10011014 0.09183114     0.9877755              3       17.395528                   1   10011014 0.06506141  0.9794191           3   27.4692315                0
17  45831434      10011018 0.10127805     0.9946942              3       13.845428                   1   10011018 0.08690274  0.9750847           5   16.4738500                1
18 494439910      10011003 0.10851179     0.9956459              4       15.606367                   1   10011003 0.12349713  0.9789955           6   13.4756817                1
19 543244472      10011017 0.11081363     0.9974500              7       15.769798                   1   10011017 0.03131429  0.2753718          16   49.2507389                0
20 545913303      10011015 0.11387213     0.9984973              3       12.821012                   1   10011015 0.11387213  0.9984973           3   12.8210116                1
21 579885120      10011006 0.11481358     0.9999872              3       13.752910                   1   10011006 0.11552453  1.0000000           2   13.6630693                0
22 695874499      10011012 0.12966859     0.9995428              5       12.404652                   1   10011012 0.13340668  0.9973957           6   11.9834562                1
23 702415421      10011008 0.08612275     0.9998397              3       17.369464                   1   10011008 0.08464560  0.9994439           4   17.6835865                1
24 705396261      10011002 0.09244230     0.9944449              3       18.168612                   1   10011002 0.06397088  0.9329329           3   28.9398530                0
25  70745987      10011014 0.10407221     0.9999990              3       18.397842                   1   10011014 0.02317490  0.1646085          14   57.2468704                0
26 708723045      10011011 0.10622643     0.9943391              3       14.378572                   1   10011011 0.08120510  0.9800843           3   21.4741684                1
27 716555376      10011016 0.09397368     0.9974393              3       16.737645                   1   10011016 0.08674130  0.9667493           3   18.3131984                1
28  72354714      10011009 0.08188704     0.9829235              3       21.732110                   0   10011009 0.08188704  0.9829235           3   21.7321103                0
29 777074699      10011005 0.11443233     0.9968965              3       11.822826                   1   10011005 0.11443233  0.9968965           3   11.8228255                1
30 783385801      10011001 0.11642069     0.9909143              6       14.357602                   1   10011001 0.12504291  0.9733875           7   13.1751675                1
31 797620983      10011009 0.10594879     0.9922606              5       18.033114                   1   10011009 0.09514846  0.9772005           3   20.4857378                1
32 856727921      10011011 0.11996924     0.9998907              3       14.123245                   1   10011011 0.15415068  0.9301476           3    9.1711532                1
33 895085608      10011006 0.10037422     0.9990909              4       18.209381                   1   10011006 0.33940336  0.9465666           3    0.6162318                1
34 897885073      10011016 0.10498462     0.9992916              5       17.463926                   1   10011016 0.15107762  0.9186121           3    9.0145584                1
35 916516839      10011013 0.12501219     0.9987959              3       13.137136                   1   10011013 0.12915288  0.9882755           6   12.5495078                1
36 982849649      10011018 0.11704509     0.9996112              5       14.051541                   1   10011018 0.12706540  0.9789002           7   12.7246902                1

2019-11-11 TOLD1 Error for M1, M2 and M3 SD methods

Error

The latest commit, 1fc479c, has an error when running computation that I believe is caused by asking for partial AUC. The following error is given when running test case 010 and 015 (unchanged) and test cases 013 (with added partial AUC):

Error in value[[3L]](cond) :
 Error in doTryCatch(return(expr), name, parentenv, handler): Dataset provided via 'map' does no contain the required columns for interpolating partial areas TOLD1

While the traceback is similar for each testcase I've included them all below along with a reproducible example for test case 013.

Traceback

Traceback for tc010 (no changes):

  Error in doTryCatch(return(expr), name, parentenv, handler): Dataset provided via 'map' does not contain the required columns for interpolating partial areas TOLD1
For SDEID 2925168
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M1_SD_computation.R#1708
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at
run_M1_SD_computation.R#817
2. run_M1_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at
run_computation.R#2217
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 

Traceback for tc013 (with partial AUC)

  Error in doTryCatch(return(expr), name, parentenv, handler): Dataset provided via 'map' does not contain the required columns for interpolating partial areas TOLD1
For SDEID 10589286
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M2_SD_computation.R#1666
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at
run_M2_SD_computation.R#804
2. run_M2_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at run_computation.R#2229
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

Traceback for t015 (no changes)

  Error in doTryCatch(return(expr), name, parentenv, handler): Dataset provided via 'map' does not contain the required columns for interpolating partial areas TOLD1
For SDEID 12659123
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at
run_M3_SD_computation.R#1664
6. value[[3L]](cond)
5. tryCatchOne(expr, names, parentenv, handlers[[1L]])
4. tryCatchList(expr, classes, parentenv, handlers)
3. tryCatch({
    tmp_df <- data_data[data_data[, map_data$SDEID] == unique(data_data[, 
        map_data$SDEID])[i], ]
    tmp_df <- tmp_df[order(tmp_df[, map_data$TIME]), ] ... at
run_M3_SD_computation.R#813
2. run_M3_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list) at
run_computation.R#2241
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) 
 

Reproducible Example

I have attached code below used to run test case 013 with the added partial AUC from 492 to 516.

#### Load Libraries ------------------------------------------------------ ####
library(readr)
library(jsonlite)
library(testthat)
 
#### Load specific code-base for OpenNCA --------------------------------- ####
# pkgload::load_all(path = "codebase/openNCA-master/openNCA")
# pkgload::load_all(path = "codebase/openNCA-b1977923fc/openNCA")  # 11/8-v1
# pkgload::load_all(path = "codebase/openNCA-051805c887/openNCA")  # 11/8-v2
pkgload::load_all(path = "codebase/openNCA-1fc479c2ca/openNCA")  # 11/11
 
#### Clean test environment ---------------------------------------------- ####
# Clean environment
rm(params, conc, vlist, results, results_list, r, e, mct, d, flags, p, klist, n, 
  ninc, nexc, k, rlist, dlist, nlist, slist, df, xmin, xmax, dk, flag_data, 
  est_data, outputdir)
 
profileid <- "SDEID"
args = commandArgs(trailingOnly=TRUE)
params = c()
 
#### Test Case 013 ------------------------------------------------------- ####
# M2 SD
# p <- "C:/Users/tensfeldt/Box Sync/EQuIP Computation Engine/Rudraya_executed_test_cases/tc013"
testcase.id <- "tc013"
p <- "testcase/tc013_M2SD"
params["INPUT1"] = file.path(p, "B2901001.in.csv")
params["parameterset"] ="PARAMETERLIST"
params["map"] = file.path(p, "tc013_mct_updated.csv")
params["flags"] = file.path(p, "B2901001_flag_data.in.csv")
params["OUTPUT"] ="."
print(params)
 
mct <- read_csv(params["map"])
write_file(toJSON(mct, na="string"), path=file.path(p, "tc013_mct_updated.json"))
params["map"] = file.path(p, "tc013_mct_updated.json")
 
flags <- read_csv(params["flags"])
write_file(toJSON(flags, na="string"), path=file.path(p, "tc013_flags.json"))
params["flags"] = file.path(p, "tc013_flags.json")
 
#### Read full concentration dataset ------------------------------------- ####
# Read conc
conc <- read.csv(file=params["INPUT1"], header=TRUE, sep=",", as.is=TRUE)
vlist <- c("PKDATAROWID", "PKPTMS", "PKCNCN", "PERIOD", "TREATXT")
 
# Read mct
mct <- params["map"]
###mct <- read_file(mct)
###mct <- gsub("[\\]+", "", mct)
mct <- fromJSON(mct)
 
# Read flags
flags <- params["flags"]
###flags <- read_file(flags)
###flags <- gsub("[\\]+", "", flags)
flags <- fromJSON(flags)
 
# ParameterSet
if(is.na(params["parameterset"])) { params["parameterset"] <- "PARAMETERDISPLAYLIST" }
parameterset <- params["parameterset"]
 
# FLAGS is a subset for the specific profile, subset concentration dataframe 
#  to those records by PKDATAROWID
d <- conc[is.element(conc$PKDATAROWID, flags$PKDATAROWID),]
 
# Add in missing required parameters for virtual compute call
klist <- c("KEL", "KELRSQ", "KELNOPT", "THALFF")
if(!is.element("PARAMETERDISPLAYLIST", names(mct))) { mct$PARAMETERDISPLAYLIST <- "" }
for(i in klist) {
  ###if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- c(mct$PARAMETERDISPLAYLIST, i) }
  if(regexpr(i, mct$PARAMETERDISPLAYLIST, ignore.case=TRUE)==-1) { mct$PARAMETERDISPLAYLIST <- paste(mct$PARAMETERDISPLAYLIST, i, sep=";") }
}
 
# Remove any leading semi-colons ";"
mct$PARAMETERDISPLAYLIST <- gsub("^;*", "", mct$PARAMETERDISPLAYLIST, ignore.case=TRUE, perl=TRUE)
 
# For virtual compute call only: Subset the parameters to be calculated to those in parameterdisplaylist
if(!is.element("PARAMETERLIST", names(mct))) { mct$PARAMETERLIST <- "" }
 
# Check whether TIME selection has been set in MCT - default to NOMINAL
if(!is.element("TIME", names(mct))) { mct$TIME <- "NOMINAL" }
 
# Determine whether there are any points selected for inclusion in the terminal elimination phase via 
#  FLGEXKEL (0=not excluded/included; 1=excluded/not included)
#  ***What happens if there are no flags provided?***
n <- factor(flags$FLGEXKEL, levels=c(0,1))
ninc <- length(n[n==0])
nexc <- length(n[n==1])
 
#### Final changes to test ----------------------------------------------- ####
### Add partial AUC
mct$AUC.1.T1 <- 492
mct$AUC.1.T2 <- 516
 
#### Run computation engine ---------------------------------------------- ####
# Run computation
results_list <- run_computation(data = d, map = mct, flag = flags, 
  parameterset = parameterset)

2019-01-18 tc012 run_computation generates error if kel optimization executes and mct$NOCMAX==1

mct012 M1 SS (single TAU)

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
Error in value[[3L]](cond) : 
  Error in if (flg_no_cmax) {: missing value where TRUE/FALSE needed
For SDEID 24280050
In addition: Warning messages:
1: In run_M1_SS_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGEMESIS' is not present in the dataset
2: In run_M1_SS_computation(data = merged_data, map = map_data, method = method,  :
  Kel optimization cannot be performed because 'TMAX', 'TLAST', 'CMAX', 'CLAST', 'AUCLAST' are not part of the calulcated parameters AND Flag 'FLGACCEPTKELCRIT' and Flag 'FLGXKEL' are not present in the dataset
3: In unit_conversion(data = data_data, map = map_data, result = data_data,  :
 
 Show Traceback
 
 Rerun with Debug
 Error in value[[3L]](cond) : 
  Error in if (flg_no_cmax) {: missing value where TRUE/FALSE needed
For SDEID 24280050 

Note above that one of the warning messages also has misspelled "calculated" as "calulcated".
Note that if NOCMAX is removed from mct this error doesn't occur.

2019-11-20 tc018 M4SS execution test case is displaying errors concerning specific gravity dose adjustment

This code was not entirely complete in master branch.

Parameter results are generated but not entirely confirmed as yet.

errors displayed are:

> results_list <- run_computation(data=d, map=mct, flag=flags, parameterset=parameterset)
specific_gravity_adjustment : units not recognized!i:  1  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  1  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  2  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  2  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  3  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  3  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  4  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  4  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  5  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  5  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  6  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  6  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  7  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  7  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  8  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  8  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  9  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  9  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  10  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  10  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  11  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  11  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  12  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  12  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  13  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  13  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  14  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  14  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  15  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  15  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  16  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  16  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  17  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  17  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  18  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  18  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  19  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  19  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  20  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  20  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  21  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  21  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  22  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  22  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  23  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  23  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  24  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  24  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  25  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  25  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  26  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  26  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  27  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  27  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  28  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  28  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  29  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  29  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  30  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  30  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  31  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  31  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  32  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  32  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  33  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  33  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  34  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  34  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  35  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  35  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  36  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  36  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  37  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  37  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  38  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  38  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  39  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  39  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  40  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  40  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  41  tmp_dose:  200  d:  1  dose[[d]]:  200 
i:  41  tmp_dose:  200  d:  1  dose[[d]]:  200 
specific_gravity_adjustment : units not recognized!i:  42  tmp_dose:  30  d:  1  dose[[d]]:  30 
i:  42  tmp_dose:  30  d:  1  dose[[d]]:  30 
specific_gravity_adjustment : units not recognized!i:  43  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  43  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  44  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  44  tmp_dose:  100  d:  1  dose[[d]]:  100 
specific_gravity_adjustment : units not recognized!i:  45  tmp_dose:  100  d:  1  dose[[d]]:  100 
i:  45  tmp_dose:  100  d:  1  dose[[d]]:  100 
unit_conversion : Unit Class 1 (Time) time_col:  TLAG KELTMLO KELTMHI THALF MIDPT1 MIDPT2 TAU1 TOLD1  parameters are scaled from  HR  to  HR  via scaling factor:  1 
unit_conversion : Unit Class 2 (Amount) amount_col:  AMT.12.00 AMT.24.00 AE.12.00 AE.24.00 AE  parameters are scaled from  NG  to  MG  via scaling factor:  1e-06 
unit_conversion : Unit Class 3 (Dose) dose_col:  DOSE1  parameters are scaled from  MG  to  MG  via scaling factor:  1 
unit_conversion : Unit Class 4 (Volume) volume_col:  VOLSUM  parameters are scaled from  ML  to  L  via scaling factor:  0.001 
unit_conversion : Unit Class 6 (1/Time) kel_col:  KEL  parameters are scaled from  1/HR  to  1/HR  via scaling factor:  1 
unit_conversion : Unit Class 11: ([Volume.Amount]/Volume) aurc_col:  AURCALL AURCLAST AURCINFO AURCINFP  parameters are scaled from  ML.NG/ML  to  ML.UG/ML  via scaling factor:  0.001 
unit_conversion : Unit Class 13: (Amount/Time) rate_col:  MAXRATE1 RATELAST1 RATE1 RATE2  parameters are scaled from  NG/HR  to  UG/HR  via scaling factor:  0.001 
There were 50 or more warnings (use warnings() to see the first 50)

Warning messages:
1: In run_M4_SS_computation(data = merged_data, map = map_data,  ... :
  Flag 'FLGEMESIS' is not present in the dataset
2: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
3: In specific_gravity_adjustment(amt_units = volu, map = map) : 
4: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
5: In specific_gravity_adjustment(amt_units = volu, map = map) : 
6: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
7: In specific_gravity_adjustment(amt_units = volu, map = map) : 
8: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
9: In specific_gravity_adjustment(amt_units = volu, map = map) : 
10: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
11: In specific_gravity_adjustment(amt_units = volu, map = map) : 
12: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
13: In specific_gravity_adjustment(amt_units = volu, map = map) : 
14: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
15: In specific_gravity_adjustment(amt_units = volu, map = map) : 
16: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
17: In specific_gravity_adjustment(amt_units = volu, map = map) : 
18: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
19: In specific_gravity_adjustment(amt_units = volu, map = map) : 
20: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
21: In specific_gravity_adjustment(amt_units = volu, map = map) : 
22: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
23: In specific_gravity_adjustment(amt_units = volu, map = map) : 
24: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
25: In specific_gravity_adjustment(amt_units = volu, map = map) : 
26: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
27: In specific_gravity_adjustment(amt_units = volu, map = map) : 
28: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
29: In specific_gravity_adjustment(amt_units = volu, map = map) : 
30: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
31: In specific_gravity_adjustment(amt_units = volu, map = map) : 
32: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
33: In specific_gravity_adjustment(amt_units = volu, map = map) : 
34: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
35: In specific_gravity_adjustment(amt_units = volu, map = map) : 
36: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
37: In specific_gravity_adjustment(amt_units = volu, map = map) : 
38: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
39: In specific_gravity_adjustment(amt_units = volu, map = map) : 
40: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
41: In specific_gravity_adjustment(amt_units = volu, map = map) : 
42: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
43: In specific_gravity_adjustment(amt_units = volu, map = map) : 
44: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
45: In specific_gravity_adjustment(amt_units = volu, map = map) : 
46: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
47: In specific_gravity_adjustment(amt_units = volu, map = map) : 
48: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion
49: In specific_gravity_adjustment(amt_units = volu, map = map) : 
50: In specific_gravity_adjustment(amt_units = volu, map = map) :
  NAs introduced by coercion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.