UUPharmacometrics / xpose

Graphical diagnostics for pharmacometric models
https://uupharmacometrics.github.io/xpose
GNU Lesser General Public License v3.0
55 stars 28 forks source link

xpose_data() returns a warning/is unable to import NONMEM output table #224

Closed adcascone closed 7 months ago

adcascone commented 7 months ago

Hello,

Given that xpose was designed as a ggplot2-based alternative to xpose4, I tried loading in the example NONMEM run files created by xpose4::simprazExample() using xpose::xpose_data()

The example files I tried to load in were created as described in the xpose4 documentation (https://uupharmacometrics.github.io/xpose4/index.html) via the following code:

cur.files <- dir() ##current files in temp dir simprazExample() ##write files from an example NONMEM run new.files <- dir()[!dir() %in% cur.files)] ##new files created by simprazExample

Once those files were created, I then ran xpose_data(1) to import the NONMEM run's output. However, the following warnings appeared: image

I don't understand why the NONMEM run files that can be imported using xpose4::xpose.data() cannot be imported properly using xpose::xpose_data().

What is the expected data format for data read into xpose and how is it different from that of xpose4?

bguiastr commented 7 months ago

Hi @adcascone ,

xpose4 and xpose are 2 different packages using different approaches to read files. NONMEM allows for a lot of flexibility in the output format which makes it difficult to cover all cases. The xpose tries to be smart by understanding the format of the data based on the headers and can handle most "general cases" i.e. default format in which it parses based on column width and coma separated tables. However, the xpose4 example you are referring seems to be a special case where it is space separated (despite the absence of FORMAT argument in $TABLE?). I would recommend that if using xpose you look into the dedicated examples here, you can also have a look into the .mod where I exemplify the different output format that xpose can handle.

Hope it helps,

Ben