Skip to content

Releases: metrumresearchgroup/mrgsolve

mrgsolve 0.7.10

03 Feb 20:54
Compare
Choose a tag to compare

New Authors

  • Devin Pastoor is now listed as a contributor. Thanks for all of your help!

New Features

  • Added automatic, on-demand output of time-after-dose (tad) in the simulated output. Use mrgsim(tad=TRUE).
  • Several new functions added to $PLUGIN mrgx, including mrgx::get<T> for getting objects out of $ENV or a package namespace and mrgx::mt_fun() that is just a function that you can assign when declaring Rcpp::Function.
  • Added object argument to idata_set and data_set to get a data.frame (or function to call that returns data.frame) out of $ENV to use for simulation.

Changes / additions

  • Added cmt argument to $PKMODEL. When cmt is set to a character vector or a comma-separated string, $PKMODEL infers the number of compartments and declares them in the model. This means a separate $CMT block is not required when using $PKMODEL.
  • Added cols argument to as_bmat and as_dmat so that a character vector of names
    can be specified (rather than regular expression) to select data for creating matrix.
  • The preclean argument now causes unlink to be called on the model build directory.
  • Added several functions to help work with $ENV: ls_env, get_env, re_eval_env, update_env.
  • When a dose is administered into a compartment that is off, the compartment is now turned
    on and the dosing is allowed to proceed. This is a change from previous behavior, where an error was generated.

mrgsolve_0.7.10.tar.gz

mrgsolve 0.7.7

21 Dec 15:34
Compare
Choose a tag to compare

Important changes

  • The table() macro in $TABLE is now deprecated (#129). To get derived values into the simulated output, users should assign
    to type double and list that variable name in $CAPTURE. See also the capture typedef introduced below.
  • The mrgx plugin was completely removed.
  • Parameter updates via param method with signature missing will check names of
    input parameters against names of existing parameters. An error is generated if a user
    attempts to update a parameter that doesn't exist. Note that this does not apply for the
    param method with signature list (../../issues/144).
  • The git repository was re-organized so that the package lives in the base directory (#171).

Features

  • Added @ macros for indicating block options in model specification file.
  • Added qsim function for quick(er) simulation runs with just one parameter set.
  • Added recmatrix that creates matrix simulation template for qsim.
  • Added mrgsolve:::render to create a document with overview of model contents. Methods for both mrgmod objects and character strings pointing to a model file.
  • Use mrgsolve:::details to extract model annotation.
  • Added capture typedef in the model specification file. Variables that are type capture are doubles and are automatically appended to $CAPTURE. The capture typedef is not allowed in $ODE and probably should be reserved for $TABLE.
  • simeta is available in $MAIN and simeps is available in $TABLE by default, no $PLUGIN is required.
  • Better support for including R objects in the model via $ENV (../../issues/158).
  • Added assign_ev function to help build simulation data sets from event objects (#164).
  • Added as_data_frame method from the tibble package (../../issues/166).
  • When annotating model blocks, mrgsolve takes the last parens item as the "units" and the last bracketed item as "options"
  • Added $ operator for mrgmod objects to return the value of a parameter (99748d8).
  • Added mread_cache and mcode_cache functions to build and cache a model (#143).

Bugs fixed

  • Fixed documentation issue in PKMODEL. The volumes for two-compartment model with no depot should be V1/V2.
  • Fixed bug in knobs where output column names are mal-formed when a user $CAPTUREs a parameter that is also being tweaked as a knob.
  • Fixed bug in annotated model specification when multiple unit or option specifications are made.

Under the hood

  • User-declared double/int/bool in $MAIN, $ODE, $TABLE are kept in unnamed namespace and are local to the file.
  • Started to re-organize the .R files.
  • mrgsolve:::details returns a data frame of information regardless of whether the model was annotated or not (../../issues/165).
  • mrgsolve::details has additional arguments to help control output.
  • Removed pkevent class; all records are datarecord.

mrgsolve 0.7.6

06 Sep 02:16
Compare
Choose a tag to compare

Features

  • Added annotated code blocks for $PARAM, $FIXED, $THETA, $CMT, $INIT, and $VCMT. (#107)
  • mrgsolve:::house() model re-coded as an annotated model.
  • Re-implemented $ENV to allow users to create R objects that can be used at certain points
    when parsing the model. (#115)
  • Added >> signifier to code blocks that allow options; >> at the beginning of the line indicates that the name=value statements that follow are to be parsed as block options.
  • Added object argument for the following blocks: $PARAM, $OMEGA, $SIGMA, $FIXED, $CMT. When object is set to a character string naming an object in $ENV, that object will be used to form the output from the block.

Bugs fixed

  • Fixed a bug which caused simulation run to hang when implementing a dose with a very small lag time. (#109)
  • Fixed a bug where valid.numericlist wasn't returning FALSE for improperly-formed objects.

Under the hood

  • Now using an environment to collect objects when parsing the model specification file.
  • Some small changes to C++ code that calculates compartment amounts for closed form one- and two-compartment models resulting in faster simulation runs.

The source package (built) is attached as mrgsolve_0.7.6.tar.gz. But the recommended installation method is with devtools::install_github("metrumresearchgroup/[email protected]", subdir="rdev")

mrgsolve 0.7.5

06 Aug 03:57
Compare
Choose a tag to compare
  • The modmrg package was discontinued. All of the pre-coded models are now available in mrgsolve. Simply call mread with the model stem (e.g. pk1cmt, irm3, etc ...) and call modlib() as the project argument. For example: mod <- mread("emax", modlib()) will compile the emax model and return the model object.

The source package (built) is attached as mrgsolve_0.7.5.tar.gz. But the recommended installation method is with devtools::install_github("metrumresearchgroup/[email protected]", subdir="rdev")

mrgsolve 0.7.4

05 Aug 15:15
Compare
Choose a tag to compare
  • Tests re-configured
  • Fixed issue with record sorting for lagged doses when using full data_setand obsaug=TRUE (#102)
  • Fixed issue where idata_set wasn't handled properly when it was passed in as tbl (#100)

The source package (built) is attached as mrgsolve_0.7.4.tar.gz. But the recommended installation method is with devtools::install_github("metrumresearchgroup/[email protected]", subdir="rdev")

mrgsolve 0.7.3

04 Aug 05:17
Compare
Choose a tag to compare
  • Addressed an issue where model compilation on Windows systems failed when certain symbol names were used in the model (#97). In this release, a dllname-win.def file is created in soloc to export only the functions that mrgsolve needs to use.
  • Added a check on the project argument to mread: if newline(s) are found, an error is generated and the user is prompted to use mcode instead.
  • Several changes under the hood (#99)

The source package (built) is attached as mrgsolve_0.7.3.tar.gz. But the recommended installation method is with devtools::install_github("metrumresearchgroup/[email protected]", subdir="rdev")

mrgsolve 0.7.2

28 Jul 16:46
Compare
Choose a tag to compare
  • Fix bug in #96

mrgsolve 0.7.1

21 Jul 01:48
Compare
Choose a tag to compare
  • Minor change to build process; no longer need to cwd to build dir to build.

mrgsolve 0.7.0

21 Jul 01:47
Compare
Choose a tag to compare

Features

  • Added as_data_set to convert one or more event objects into a data frame that can be passed to data_set. Does something similar to expand.ev, but more control.
  • For special column names (time, amt, rate, evid, ii, addl ,ss, cmt) either lower case or upper case names are recognized. The determination is made on the time / TIME column (always required when using a data set). If time mrgsolve will continue looking for lower case names; if TIME it will look for upper case names. A warning is issued in case both upper and lower case names are included.
  • Added $PLUGIN to let users extend their model specification file. Valid plugins include simeta, Rcpp, RcppArmadillo, and BH. When a plugin is used, mrgsolve will link back the the appropriate package and possibly include appropriate header files when compiling the model. For example, simeta will link back to mrgsolve and RcppArmadillo and allow the modeler to simulate a new set of ETAs. Use Rcpp plugin to simulate random variates from common distibutions in R(e.g. rnorm, rexp etc ... ).

Bugs fixed

  • Fixed issue with ev where no rows were returned if amt wasn't supplied (issue 44).
  • Shortened the path for both the shared object and the name of the .cpp.cpp file when compiling.
  • Fixed bug in touch_funs when large number (> 25) of ETAs in the model (issue 68).

Important changes

  • When using $PKMODEL with ncmt=2 and depot=FALSE, the default PK parameters are CL, V1 (central volume), Q, V2 (peripheral volume). This is a change where the previous volumes were V2 (central) and V3 (peripheral).
  • $CAPTURE now saves output items to slots in std::vector<double>, rather than std::map<std::string,double>. We've known for a while that the std::map wasn't very efficient especially with large simulations. Currently, items in $TABLE are still saved into std::map with table() macro. The plan going forward is to eliminate that table map and force output variables into $CAPTURE.
  • Due to major changes to dplyr, now requiring dplyr >= 0.5.0 (issue 69)
  • The data slot in mrgsims objects is now data.frame
  • The knobs function and plot method has been re-written. Overall behavior for most applications should be the same.

Under the hood

  • C++ symbols for model functions are now stored in the model object (funs slot)
  • The status of the model object (function names and compile status) can be checked with mrgsolve:::funset(mod)
  • A model is considered to be loaded and ready to go if all functions in funs can be found with is.loaded
  • Model shared objects are still stored within the soloc directory (by default tempdir()), but mrgsolve will create a subdirectory structure to organize compilation artifacts. The outer directory is keyed based on the current mrgsolve version number and the computer platform. Inner directories are based on the model name (model(mod)).
  • A source file is created based on the model name and the shared object is created based on that name. If the compilation is successful, the shared object (.so on mac/unix, .dll on Windows) is copied to a .so or .dll file with a unique stem (e.g. model2lj239wsfo.so). This unique shared object is loaded into the R process for use with the model.
  • Every time the model is rebuilt, the build directory is scanned for shared object files. Excluding the main model shared object (unchanging name based on the model), old shared object files are deleted and, if currently loaded (getLoadedDLLs()), are attempted to be dyn.unloaded.
  • Upon model rebuild (via mread or mcode), if there are no changes to the source .cpp file, the source is not overwritten. In that case, make will not re-build the shared object. Using the preclean argument will force re-compilation (see R CMD SHLIB).
  • The header files modelheader.h and mrgsolv.h are no longer copied into the project directory. But CLINK_CPPFLAGS environment variable is modlifed to include <path-to-mrgsolve-package>/inst/base so that these may be linked.
  • The R CMD SHLIB build process always uses intern=TRUE so that output is suppressed on both Windows and mac/unix. The user may still request to view build output with the ignore.stdout argument.
  • Model build always links-to the project directory to look for C++ header files. When including a header file that may change from build to build, always run with preclean=TRUE.
  • mrgsolve now changes the working directory prior to building a model. The working directory is restored on exit from mread.

Deprecated

  • The entire complog system, including:
    • comp_forget a message is issued
    • complog no message is issued
  • trequest argument to mrgsim

mrgsolve 0.6.1

11 May 16:35
Compare
Choose a tag to compare

Bugs fixed

  • Fixed a bug when an infusion was attempted with rate > 0 and amt==0. Additionally, an error is generated when an infusion is attempted with zero amt (issue 43).