tensfeldt / openNCA

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

2020-02-12 tc008 M4SDSS "aet(...)" computation error when using actual time introduced with 4097880 #182

Closed jhhughes256 closed 4 years ago

jhhughes256 commented 4 years ago

Error

When testing tc008 M4SD and M4SS with commit 4097880 using actual time a computation error occurs. The example below is for tc008 M4SD, but a similar error occurs for tc008 M4SS. This error did not occur in the previous commit 8efa3ff. This may be a side effect of the changes made to address #177 and #178.

This issue occurs for tc018 M4SS, tc105 M4SS, tc111 M4SD, tc116 M4SD when using actual time. Notably it also occurs for tc111 M4SD when using nominal time. It does not occur for tc017 M4SD.

> mct$TIME
[1] "ACTUAL"
> mct$ACTTIME
[1] "PKATPD"
> mct$ACTENDTIME
[1] "PKATPDE"
> results_list <- run_computation(data = d, map = mct, flag = flags, 
+   parameterset = parameterset)
[1]       NA 12738576
Error in value[[3L]](cond) : 
  Error in aet(amt = amt, time = na.omit(sort(tmp_df[, map_data$ENDTIME])), : Error in aet: value 't' is not present in 'time' vector
For SDEID 225930823
In addition: Warning messages:
1: In run_computation(data = d, map = mct, flag = flags, parameterset = parameterset) :
  'TAUs and TOLDs values are not provided via 'flag'! Using values provided via 'data' instead!
2: 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'
3: In run_M4_SD_computation(data = merged_data, map = map_data, method = method,  :
  Flag 'FLGEMESIS' is not present in the dataset
4: In run_M4_SD_computation(data = merged_data, map = map_data, method = method,  :
 Error in value[[3L]](cond) : 
  Error in aet(amt = amt, time = na.omit(sort(tmp_df[, map_data$ENDTIME])), : Error in aet: value 't' is not present in 'time' vector
For SDEID 225930823 
7. stop(paste0(e, "For SDEID ", unique(data_data[, map_data$SDEID])[i])) at run_M4_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_M4_SD_computation.R#756
2. run_M4_SD_computation(data = merged_data, map = map_data, method = method, 
    model_regex = model_regex, parameter_list = parameter_list, 
    return_list = return_list, optimize_kel_debug = optimize_kel_debug) at run_computation.R#2467
1. run_computation(data = d, map = mct, flag = flags, parameterset = parameterset)

Edit: This issue was initially written with the wrong error code, apologies for the large number of edits.

jhhughes256 commented 4 years ago

This issue no longer occurs with commit 231f2da.