Giter Site home page Giter Site logo

uupharmacometrics / xpose4 Goto Github PK

View Code? Open in Web Editor NEW
33.0 6.0 11.0 107.97 MB

Model building aid for population analysis using NONMEM

Home Page: http://uupharmacometrics.github.io/xpose4/

License: GNU Lesser General Public License v3.0

R 99.95% Shell 0.04% Batchfile 0.01%
pharmacometrics xpose cran nonmem diagnostics population-model

xpose4's Introduction

Xpose 4

CRAN_Status_Badge codecov.io R-CMD-check

by Andrew C. Hooker, Mats O. Karlsson and E. Niclas Jonsson

Introduction

Xpose 4 is a collection of functions to be used as a model building aid for nonlinear mixed-effects (population) analysis using NONMEM. It facilitates data set checkout, exploration and visualization, model diagnostics, candidate covariate identification and model comparison.

Installation

To install xpose you will need R (>= version 2.2.0).
To install Xpose in R use one of the following methods:

  • latest stable release – From CRAN. Write at the R command line:

    install.packages("xpose4")
  • Latest development version – from Github. Note that the command below installs the “master” (development) branch; if you want the release branch from Github add ref="release" to the install_github() call.

    # install.packages("devtools")
    devtools::install_github("UUPharmacometrics/xpose4")

Running Xpose 4

Start R and load xpose:

library(xpose4)
#> Loading required package: lattice

To use the classic menu system, type at the R command prompt:

xpose4()

Each function is independently available from the command line, once the Xpose library is loaded.

First we create a set of files from a NONMEM run

cur.files <- dir() # current files in temp directory

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

Then we can import our files to Xpose

xpdb <- xpose.data(1) 

Display goodness-of-fit plots:

basic.gof(xpdb)

Clean up files that were created to show these examples:

unlink(new.files)

More help is available in the online documentation, which can be found by typing (for example) ?xpose4 at the R command line.

The Xpose 4 Bestiary

A more detailed description of Xpose with example plots and explanaitions for most of the functions in the package is available in our Bestiarium: https://xpose.sourceforge.net/bestiarium_v1.0.pdf

Don’t Panic

Andrew Hooker (andrew.hooker at farmaci.uu.se) should be able to get you an answer if you run into trouble. The website https://uupharmacometrics.github.io/xpose4/ should also be of help.

Release Schedule

Bugfix releases will be released regularly, fixing any problems that are found.

License

Xpose 4 is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details https://www.gnu.org/licenses/.

Known Bugs

None at present, but there will certainly be a few. Report them at https://github.com/UUPharmacometrics/xpose4/issues.

xpose4's People

Contributors

andrewhooker avatar mikeksmith-pfizer avatar rikardn avatar ronkeizer avatar vrognas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xpose4's Issues

Upper limit of quantification plots with Xpose.vpc.both

Dear all,

Recently I was making a model of data that had LLOQ and ULOQ data present.
Using the Xpose.vpc.both function I generated VPC plots, however the categorical subplot shows no data when plotting ULOQ data (see example below).
image

The function works fine when using LLOQ data.
I investigated the code of the function and found that the following part of the code still selects the LLOQ output table when ULOQ is present/selected:

for (LEVS in 1:n.levs) {
ret.new[(1 + (LEVS - 1) * n.idv.levs):(n.idv.levs *
LEVS), 1:5] <- tmp.table.2[, c(idv.index, real.index[[LEVS]],
lower.index[[LEVS]], median.index[[LEVS]], upper.index[[LEVS]])]
ret.new[(1 + (LEVS - 1) * n.idv.levs):(n.idv.levs *
LEVS), "by.var"] <- level.names[LEVS]
}

Therefore it presents the user with an empty table. For now I have created a new function that selects the right table columns to subset from to generate the plots, which does work.
I'm using xpose4_4.7.0 in R version 3.6.2.
Does anyone else have this problem?

Kind regards,
Simon Koele
Radboudumc Pharmacometrics

Error message in ETA vs. COV plot in xpose4

Hi,
I am using Xpose4 function for Etas_vs_Covariates to generate the the plot. Most of the ETA plots look fine, but for one of them I get the plot below. The error message seems to indicate I have non numeric value in the data for ETA 5 . But other ETA plots vs DOSA look fine. I thought may be this is due to the variability/sparsity of the data to allow fitting smooth line, so tried to turn off the argument as follows:
ranpar.vs.cov(xpdb, smooth = FALSE)

But, the error still appears and also all other ETA plots still have the smooth line.

What is the cause of this error?
Why smooth cannot be turned off with the argument above?
Is there a workaround for this?

Plot_xpose4

Thanks for any comments.
Pradeep

boot.hist plots get ugly error text when PsN bootstrap was run with -bca option

When PsN bootstrap is run with -bca option, the raw_results file will have a number of rows at the end with text jackknife in the first column. When such a raw_results file is used as input to boot.hist, every plots gets an error text all the way across saying

Error using packet 1
(list) object cannot be coerced to type 'double'

Suggestion: Change boot.hist to automatically discard any rows in raw_results that have text jackknife in first column. Regular bootstrap samples have text bootstrap in first column.

Question about setting different `ylim` for different panels

I am trying to set different ylim for the 2 panels in my xpose.VPC plot. Reading through the documentation of xyplot in lattice, I was thinking something like

scales = list(y = list(relation = "free")),
ylim = list(c(0,600),c(0,300)),

should work, but the limits for both the panels are set to (0,600). I also get the following warning

Warning messages:
1: In limitlist[id] <- lim :
  number of items to replace is not a multiple of replacement length
2: In limitlist[id] <- lim :
  number of items to replace is not a multiple of replacement length

Any help in how to set different ylim for different panels would be very much appreciated!

A similar setting in xyplot from lattice seems to be working and gives me different y-limits, e.g., the following works

library(lattice)
temp.cut <- equal.count(environmental$temperature, 2)
xyplot(ozone ~ radiation | temp.cut, data = environmental,
       scales = list(y = list(relation = "free",
                              limits = list(c(0,150),c(0,100)))))

Thank you!
SN

The observation in the figure does not reflect the table

Hi
In performing the diagnostic plot - i found the observation shown in the figure output is not same as the table obsevation.
in the image below the observation shows to be in > 100 however in the table (output form xpdb) shows arounf 38.3 (max) for ID 3009.
image

image

Please advise if im missing something

Jesmin

Feature Request: Allow FIRSTONLY catab, cotab, and patab files

In read.nm.tables.R, if the files read in have a different number of rows, no data is returned:

The table files associated with this run number ( ) appear
to have different lengths.

Since cotab, catab and patab in many cases just have unique data for the individual (not for each row like sdtab, etc.), it would help if xpose supported loading these files and then expanding based on the individuals (via merge or left_join).

xpose.VPC semi log plot for data with negative pi.ci

I am trying to do VPC plot with semilog y axis using xpose.VPC function but the lower bound of pi.ci is below zero. Can you please tell me how to fix this problem? Thanks!
Here is my code:

xpose.VPC(vpc.info=vpc_results.csv, vpctab=vpctab, logy = T)

And I received the following error message:

The PI.ci on the y-axis goes below zero.
This means that taking the log of this prediction
interval gives non-real numbers.
The plot will not be created.

xpose4 with -99

Hello, it's a new NONMEMer named Joanna.
When I trying to create a plot of ETA vs Covatiates with xpose4.ranpar.vs.cov, I found the covariates with value of -99 was not shown in the plot , which were remain in the dataset(object) with xpose4.xpose.data. So, I wonder if -99 was just handled as missing when ploting in this function? And if the -99 was handled as missing, will the records with -99 will be discarded or only -99 be recognized as NA?
(xpose4 version is 4.6.1)
Looking forward Your comment.

image

Some problems when I using Pirana and xpose4

微信截图_20210603132137
微信截图_20210603132152
When I am using xpose4 by pirana,the R gui could not work because“Couldn't find any table files that match run number !”!How should I solve this problem?My nonmem version is 7.5.0. Pirana is 3.0.0,R is 4.1.0.

Crash of dv.preds.vs.idv when WRES missing

I run a simple model (pheno) with the following table:

$TABLE ID MDV TIME DV IPRED PRED RES CWRES NOAPPEND NOPRINT ONEHEADER FILE=sdtab1

Loading into an xpose4 database and doing xpose4::dv.preds.vs.idv(xpdb) caused xpose4 to crash with the following backtrace:

Error in limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, : need at least one panel
7.stop("need at least one panel")
6.limits.and.aspect(default.prepanel, prepanel = prepanel, have.xlim = have.xlim, xlim = xlim, have.ylim = have.ylim, ylim = ylim, x.relation = foo$x.scales$relation, y.relation = foo$y.scales$relation, panel.args.common = foo$panel.args.common, panel.args = foo$panel.args, aspect = aspect, npackets = npackets, ...
5.xyplot.formula(formula(formel), data, obj = object, prepanel = function(x, y) { xlim <- NULL ylim <- NULL ...
4.xyplot(formula(formel), data, obj = object, prepanel = function(x, y) { xlim <- NULL ylim <- NULL ...
3.xpose.plot.default(xvardef("idv", object), c(xvardef("dv", object), xvardef("ipred", object), xvardef("pred", object)), object, scales = scales, ylb = ylb, layout = layout, smooth = smooth, ...)
2.xpose4::dv.preds.vs.idv(xpdb)
1.print(xpose4::dv.preds.vs.idv(xpdb))

Adding the column WRES to the $TABLE stops it from crashing.

Problems with reading xpose.ini in xpose.data

Running Xpose-4.5.3 under Windows 8, R-3.2.2.

In xpose.data there is the following code to pick up xpose.ini:
`xpobj <- new("xpose.data", Runno = 1, Doc = NULL, Data = NULL)

if (is.readable.file("xpose.ini")) {
xpobj <- xpose.read(xpobj, file = "xpose.ini")
}
else {
rhome <- R.home()
xdefini <- paste(rhome, "\library\xpose4\xpose.ini",
sep = "")
if (is.readable.file(xdefini)) {
xpobj <- xpose.read(xpobj, file = xdefini)
}
else {
xdefini2 <- paste(rhome, "\library\xpose4\xpose.ini",
sep = "")
if (is.readable.file(xdefini2)) {
xpobj <- xpose.read(xpobj, file = xdefini2)
}
}
}`

I suspect the definition of xdefini should actually point to .libPaths()[1] rather thanR.home(). In Windows, if R libraries are installed in the user directory ("Documents"), then .libPaths() would point to this location as the first entry. R.home() will point to the installation directory of R. It depends where users have their libraries... At present I think the code points to the same location for xdefiniand xdefini2... I think this is a mistake. Perhaps using .libPaths()[1] and .libPaths()[2] would be more robust?

Also, I'd suggest that you probably want to look at the user level before proceeding to the installation default.

Regards,
Mike

Possible bug with xpose 4.7.0 readting output tables

Hello all,

There seems to be an issue with the new xpose version when reading NONMEM generated table files, it fails to read the entire data items from tab files, e.g in patab.csv file (where I output my model parameters) I have around 10 data items but it only reads a subset of them. however, when I try to read the files with read.nm.tables, I can see that all of the data items are read.

I'm attaching a subset of the output files for reproducibility
example.zip

Thanks

Mahmoud

Adding additional NONMEM runs as example data?

Would it be possible to add another NONMEM run as example data to the package, in addition to the run created via simprazExample?

It would be helpful to have more than just run 1's files when working through examples associated with the model comparison functions

Thank you for your consideration!
Arianna

Crash of xpose.data when TIME column missing

I run a simple model (pheno) with the following (admittedly minimal) table:

$TABLE ID NOAPPEND NOPRINT ONEHEADER FILE=sdtab1

When trying to read the results into an xpdb with xpose.data it crashes with the following trace:

Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘Data’ in an object of class “xpose.data”; is(value, "data.frame_or_NULL") is not TRUE
4.stop(gettextf("assignment of an object of class %s is not valid for @%s in an object of class %s; is(value, \"%s\") is not TRUE", dQuote(valueClass), sQuote(name), dQuote(cl), slotClass), domain = NA)
3.(function (cl, name, valueClass) { ClassDef <- getClass(cl) slotClass <- ClassDef@slots[[name]] ...
2.`Data<-`(`*tmp*`, value = tmp)
1.xpose4::xpose.data(xpose.runno, directory = results.directory, tab.suffix = tab.suffix, mod.prefix = mod.prefix, mod.suffix = mod.suffix)

Adding the column TIME to the sdtab1 stops xpose from crashing.

Individual OFV plot in Xpose - Issues with multiple $estimation records

A quick bug report (maybe?).

He has 2 models he wanted to compare with the individual OFV plot (the shark plot).

The total OFV difference is about 5, but we noticed that from the plots it appears to be almost 20.

After checking a bit, it seems like the problem is due to the fact that each models have 2 estimation records, the first one with MAXEVAL=0. It seems like xpose only uses the values from the first record, hence the different values.

Ciao and thank you!
Paolo Denti

individual OFV plot in Xpose4: error message

Hi,

I'm trying to make a so called shark plot (dOFV.vs.ID), but unfortunately get the following error message:

Error in 1:max.rank : result would be too long a vector
In addition: Warning message:
In max(comp.frame$rnk) : no non-missing arguments to max; returning -Inf

I'm still pretty new to R and NONMEM, but my experienced colleagues run into the same issue.
Is this a bug, or do we need to do something differently?

Thank you very much in advance,

Rebecca Hermans
PhD student Erasmus MC Rotterdam

PsN-generated NM outputs for xpose.VPC.categorical

Hi!

Are the examples (data, NM ctl, outputs) listed under ?xpose.VPC.categorical (PsN-generated "/binary/vpc_36", "/ordered_cat/vpc_45" or "/count/vpc65b") generally available? Were they available with older PsN (or xpose4) releaseases?

Thanks!

Bojan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.