ggPMXdevelopment / ggPMX

ggPMX R package
37 stars 12 forks source link

BUG in Reader (v.1.2.4) #183

Closed baltcir1 closed 2 years ago

baltcir1 commented 2 years ago

It seems to be a bug introduced in v.1.2.4. Problem when reading a PKPD model: ctr = pmx_mlxtran(file_name = "warfarin_PKPDeffect_project.mlxtran", endpoint = 1)

use y1_obsVsPred.txt as obsvspred file . use y1_obsVsPred.txt as obsvspred file. Using simulated BLOQs of Monolix 2018 can cause slight deviations from Monolix plots regarding simulated BLOQs of the DV! Try Monolix 2019 or later for improved ggPMX simulated BLOQ function. use y1_residuals.txt as residuals file . use y1_residuals.txt as residuals file. use predictions_y1.txt as model predictions file . y_residuals file do not exist use y1_fits.txt as finegrid file . sim_blq dataset could not be generated, sim_blq_npde_iwres or sim_blq_y is missing No data predictions provided for plot abs_iwres_ipred No data predictions provided for plot iwres_ipred No data predictions provided for plot iwres_time No data predictions provided for plot iwres_dens No data predictions provided for plot iwres_qq No data predictions provided for plot npde_time No data predictions provided for plot npde_pred No data predictions provided for plot npde_qq No data predictions provided for plot dv_pred No data predictions provided for plot dv_ipred

Strangely, Reader is searching for y_residuals file, while we have 2 endpoints, so the right file is y1_residuals.txt. The Controller is still created, but all plots related to residuals are missing:

R 4.1.0> ctr

pmx object:

PARAM VALUE
working directory .
Modelling input file warfarin_data.txt
dv dv
dvid dvid
cats sex
conts wt,age
data_name data_file data_label
sim_blq_y y_obsVsPred.txt obsvspred file
sim_blq_npde_iwres y_residuals.txt residuals file
predictions predictions.txt model predictions file
eta estimatedRandomEffects.txt invidual estimates of random effects file
estimates populationParameters.txt parameter estimates file
finegrid y_fits.txt finegrid file
input warfarin_data.txt modelling input
plot_name plot_type
individual IND
eta_hist DIS
eta_box DIS
eta_matrix ETA_PAIRS
eta_cats ETA_COV
eta_conts ETA_COV
eta_qq PMX_QQ

I have put in bold above the wrong data files (y_obsVsPred.txt and y_residuals.txt). When trying the same example and syntax with version 1.2.3, it works:

ctr = pmx_mlxtran(file_name = "warfarin_PKPDeffect_project.mlxtran", endpoint = 1) use y1_obsVsPred.txt as obsvspred file . y_obsVsPred file do not exist use y1_residuals.txt as residuals file . y_residuals file do not exist use predictions_y1.txt as model predictions file . use y1_residuals.txt as residuals file. use y1_fits.txt as finegrid file . sim_blq dataset could not be generated, sim_blq_npde_iwres or sim_blq_y is missing

R 3.6.1> ctr

pmx object:

PARAM VALUE
working directory .
Modelling input file warfarin_data.txt
dv dv
dvid dvid
cats sex
conts wt,age
data_name data_file data_label
sim_blq_y y_obsVsPred.txt obsvspred file
sim_blq_npde_iwres y_residuals.txt residuals file
predictions predictions.txt model predictions file
eta estimatedRandomEffects.txt invidual estimates of random effects file
estimates populationParameters.txt parameter estimates file
finegrid y_fits.txt finegrid file
input warfarin_data.txt modelling input
plot_name plot_type
abs_iwres_ipred SCATTER
iwres_ipred SCATTER
iwres_time SCATTER
iwres_dens PMX_DENS
iwres_qq PMX_QQ
npde_time SCATTER
npde_pred SCATTER
npde_qq PMX_QQ
dv_pred SCATTER
dv_ipred SCATTER
individual IND
eta_hist DIS
eta_box DIS
eta_matrix ETA_PAIRS
eta_cats ETA_COV
eta_conts ETA_COV
eta_qq PMX_QQ
tynsci commented 2 years ago

Some further background on this bug.