Coder Social home page Coder Social logo

pmxtools's Introduction

pmxTools

Pharmacometric Tools for Modeling & Simulation

Build Status contributions welcome

Developed by Justin Wilkins, Bill Denney and Rik Schoemaker, with contributions from a host of others.

Pharmacometric tools for common data analytical tasks; closed-form solutions for calculating concentrations at given times after dosing based on compartmental PK models (1-compartment, 2-compartment and 3-compartment, covering infusions, zero- and first-order absorption, and lag times, after single doses and at steady state, per Bertrand & Mentre (2008) http://lixoft.com/wp-content/uploads/2016/03/PKPDlibrary.pdf); parametric simulation from NONMEM-generated parameter estimates and other output; and parsing, tabulating and plotting results generated by Perl-speaks-NONMEM (PsN).

To install:

devtools::install_github("kestrel99/pmxTools")

or download directly from CRAN.

pmxtools's People

Contributors

billdenney avatar kestrel99 avatar sn248 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

Watchers

 avatar  avatar  avatar  avatar

pmxtools's Issues

calc_derived: feature request for micro parameter interface

I love the generality of calc_derived(), thanks!

Looking at internals, it seems that macro parameters are converted to micro parameters which are then used to solve the system. In my use case, I already have the micro parameters k10, k12, k21 etc so I end up converting these to macros which then calc_derived converts back to micros. Perhaps pmxTools could export a micro interface which both calc_derived() and the user could call. Maybe it's more complicated than that since most users of the micro interface would probably want the macro parameters back-calculated as well. "Clearinghouse" interface?

Allow vector input for `calc_derived_3cpt()`

Here is what I was trying to do (except my real data had 26k rows):

library(pmxTools)
#> Loading required package: patchwork
mydata <-
  data.frame(
    CL = c(0.25, 0.25),
    Vcentral = c(1, 1),
    Vperiph1 = c(0.25, 0.25),
    Vperiph2 = c(0.25, 0.25),
    Qcp1 = c(0.25, 0.25),
    Qcp2 = c(0.25, 0.25),
    Ka = c(0, 0)
  )

with(
  mydata,
  calc_derived_3cpt(
    CL=CL, V1=Vcentral,
    V2=Vperiph1, Q2=Qcp1,
    V3=Vperiph2, Q3=Qcp2,
    ka=Ka,
    sigdig=Inf
  )
)
#> Error in while (tend < guess_tmax) {: the condition has length > 1

Created on 2023-09-07 with reprex v2.0.2

ka and tlag returned even if not supplied to calc_derived()

Hi again.

The help for calc_derived() indicates that lag (actually, tlag) and ka will be returned if provided. I'm seeing them as list members with value NULL even when not supplied. I suggest, drop them, or if necessary return them with as NA with length like other members so that the following succeeds:

 as.data.frame(calc_derived_1cpt(CL=16, V=25))
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 1, 0

Thanks for considering!

pmxTools not loading

Hi, when loading pmxTools, I get a error message

compilation terminated.
make: *** [C:/PROGRA~1/R/R-3.5.3/etc/i386/Makeconf:208: feedback_arc_set.o] Error 1
ERROR: compilation failed for package 'igraph'

  • removing 'C:/Users/m5san/Documents/R/win-library/3.5/igraph'
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘igraph’ had non-zero exit status
    ERROR: dependency 'igraph' is not available for package 'DiagrammeR'
  • removing 'C:/Users/m5san/Documents/R/win-library/3.5/DiagrammeR'
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘DiagrammeR’ had non-zero exit status
    ERROR: dependency 'DiagrammeR' is not available for package 'pmxTools'
  • removing 'C:/Users/m5san/Documents/R/win-library/3.5/pmxTools'
    In R CMD INSTALL
    Warning in install.packages :
    installation of package ‘pmxTools’ had non-zero exit status

Thanks
Marty

Warn on flip-flop kinetics?

I have a model where the half-life is determined by the flip-flop kinetics rather than the elimination rate. I think that we should not change the method for half-life calculation, but I think that we should warn users in the case of flip-flop kinetics that the half-life may not be similar to the half-life calculated by typical NCA.

The technical definition of flip-flop is usually given as ka < kel, but I think that it's likely that absorption will affect half-life estimation at lower values (such as (2*ka) < kel).

I think that for now, we should give a warning if ka < kel, but we may consider another warning at a different ratio.

Thoughts?

Add NCA parameters to `calc_derived`

What do you think about adding NCA parameters to the outputs of calc_derived*()?

The specific parameters I'm thinking of are:

  • Cmax_dose_normalized
  • Tmax
  • AUC_dose_normalized (AUCinf for single dose and AUCtau for steady-state)

where can we find the file (run315.xml)?

Hi,
When I copy the code: nmOutput <- read_nm("run315.xml")
estTab <- get_est_table(nmOutput)
but it showed that can not find file "run315.xml", where can I find "run315.xml"?

Thank you!

calc_derived_2cpt seems not to accept Q2 as synonym for Q

Thanks for a great set of tools!

At version 1.0, for calc_derived(), I see the example

calc_derived_2cpt(CL=16, V1=25, V2=50, Q=0.5)

which works as expected, but I only get partial results for

calc_derived_2cpt(CL=16, V1=25, V2=50, Q2=0.5)

The help indicates Q2 and Q are synonyms. Indeed, all other uses of synonyms seem to work.

Reading is not working for the `mapbayr` example

I was using the example NONMEM files at:

https://github.com/FelicienLL/mapbayr-CPTPSP-2021

Specifically at:

https://github.com/FelicienLL/mapbayr-CPTPSP-2021/blob/main/nonmem%20output/run001.zip

And noticed that run1.mod had 42000 records but the input dataset had 18000 records (as shown in the nonmem .lst output).

I think that the pmxTools::read_nm_multi_table is not working correctly.

It has a custom format in the nomem file, but in theory that shouldn't affect it.

documentation for argument 'type' in calc_derived() is unclear

Hi again. calc_derived() seems really useful. I'm having trouble with argument type='all'. The main documentation says "see details" but there is no section by that name (v. 1.0) and I did not see further discussion below. By the way, I see units L and h etc. in the documentation for the output which likely are appropriate for most cases but not essential to the calculations.

Namespaces in Imports field not imported from

I'm not sure why these are listed as Imports. It seems like you could get back on CRAN really easily??

Namespaces in Imports field not imported from:GGally’ ‘PKNCA’ ‘grid’ ‘magrittr’ ‘plyr’ ‘xpose

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.