Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omega Labels Mis-Detected? #121

Open
billdenney opened this issue Oct 3, 2018 · 2 comments
Open

Omega Labels Mis-Detected? #121

billdenney opened this issue Oct 3, 2018 · 2 comments

Comments

@billdenney
Copy link
Contributor

(Hopefully this is unrelated, but I'm using @MikeKSmith 's #113.)

I think that this is an error with name detection of diagonal $OMEGA values.

I have the following $OMEGA block set in a model:

$OMEGA
 0.04   ; IIV KA
$OMEGA BLOCK(2)
 0.14  ; IIV CL
 -0.2  ; COV-IIV CL-V2
 0.4   ; IIV V2
$OMEGA
 0 FIX ; IIV Q3
 0 FIX ; IIV V3
 0 FIX ; IIV Q4
 0 FIX ; IIV V4

With it, I get the error:

> get_prm(xpdb=xpdb)
Returning parameter estimates from $prob no.1, subprob no.0, method lce
... # Some of the parameters here
# ... with 25 more rows
Warning message:
[$prob no.1, subprob no.0, lce] $OMEGA labels did not match the number of OMEGAs in the `.ext` file. 

As I looked, it appears to be an issue with off-diagonal $OMEGA values here such that they have blank names:

xpose/R/xpdb_access.R

Lines 426 to 433 in 74855b2

n_omega <- sum(prms$type == 'ome' & prms$diagonal, na.rm = TRUE)
omega_names <- data$prm_names$omega
if (n_omega != length(omega_names)) {
warning('[$prob no.', data$problem, ', subprob no.', data$subprob, ', ', data$method,
'] $OMEGA labels did not match the number of OMEGAs in the `.ext` file.', call. = FALSE)
} else {
prms$label[prms$type == 'ome' & prms$diagonal] <- omega_names
}

At that point, my omega names are:

[1] "IIV KA" "IIV CL" ""       "IIV V2" "IIV Q3" "IIV V3" "IIV Q4" "IIV V4"

while the number of diagonal omegas is accurately detected as 7.

@bguiastr
Copy link
Collaborator

bguiastr commented Nov 6, 2018

Thanks for the detailed example. I need to rethink the way that blocks are parsed, xpose currently assumes that all blocks are written in their "triangle" form and not as a list. This is related to #87

@billdenney
Copy link
Contributor Author

There is a project to make a full NONMEM parser: https://github.com/EightPillars/nmtranprocessorcpp

Might it be worthwhile to combine NONMEM parsing efforts into one rigorously tested parser that can be used across applications? (The linked effort is trying to make an ANTLR-based parser which would presumably be usable in many programming languages.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants