ggPMXdevelopment / ggPMX

ggPMX R package
37 stars 12 forks source link

Monolix2020 compatibility #171

Closed baltcir1 closed 3 years ago

baltcir1 commented 3 years ago

Error is being produced when using pmx_mlxtran on a project created with Monolix2020.

To Reproduce ctr = pmx_mlxtran("MLX/PK_WITH_COVARIATE/warfarin_PK_project_mlx2020.mlxtran")

image

The dataset is not being recognized by the reader. The issue comes from the fact that the statement containing the dataset of Monolix2020 does not have spaces, which makes ggPMX reader to crash.

Monolix2019: image

Monolix2020: image

In v2020, there are no spaces in the statement file='warfarin_data3.csv' which messes up the reader.

The controller creation with pmx_mlx (or pmx) works fine.

agstudy commented 3 years ago

the error because the parser use " = " to split the monolix file. As a workaround you can make the parser replace "file=" by "file = " before splitting.

Something like should work:

dat[grepl("file=",line),`line := gsub("file=","file = ",line)]

You should add this to parse_mlxtran function in parse_mlxtran just before this line :

  dat[, c("key", "value") := tstrsplit(dat$line, " = ")]
mattfidler commented 3 years ago

Thanks @agstudy

tynesjo commented 3 years ago

Thanks for the suggested fix @agstudy

It has been possible to

  1. reproduce the error
  2. implement and test the suggested fix

Pull request forthcoming (ETA today)