Releases: metrumresearchgroup/mrgsolve
mrgsolve 0.7.10
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. Usemrgsim(tad=TRUE)
. - Several new functions added to
$PLUGIN mrgx
, includingmrgx::get<T>
for getting objects out of$ENV
or a package namespace andmrgx::mt_fun()
that is just a function that you can assign when declaringRcpp::Function
. - Added
object
argument toidata_set
anddata_set
to get adata.frame
(or function to call that returnsdata.frame
) out of$ENV
to use for simulation.
Changes / additions
- Added
cmt
argument to$PKMODEL
. Whencmt
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 toas_bmat
andas_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 causesunlink
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.7
Important changes
- The
table()
macro in$TABLE
is now deprecated (#129). To get derived values into the simulated output, users should assign
to typedouble
and list that variable name in$CAPTURE
. See also thecapture
typedef introduced below. - The
mrgx
plugin was completely removed. - Parameter updates via
param
method with signaturemissing
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 signaturelist
(../../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 forqsim
. - Added
mrgsolve:::render
to create a document with overview of model contents. Methods for bothmrgmod
objects andcharacter
strings pointing to a model file. - Use
mrgsolve:::details
to extract model annotation. - Added
capture
typedef in the model specification file. Variables that are typecapture
are doubles and are automatically appended to$CAPTURE
. Thecapture
typedef is not allowed in$ODE
and probably should be reserved for$TABLE
. simeta
is available in$MAIN
andsimeps
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 thetibble
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 formrgmod
objects to return the value of a parameter (99748d8). - Added
mread_cache
andmcode_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 beV1
/V2
. - Fixed bug in
knobs
where output column names are mal-formed when a user$CAPTURE
s 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 aredatarecord
.
mrgsolve 0.7.6
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 createR
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 thename=value
statements that follow are to be parsed as block options. - Added
object
argument for the following blocks:$PARAM
,$OMEGA
,$SIGMA
,$FIXED
,$CMT
. Whenobject
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 returningFALSE
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
- The
modmrg
package was discontinued. All of the pre-coded models are now available inmrgsolve
. Simply callmread
with the model stem (e.g.pk1cmt
,irm3
, etc ...) and callmodlib()
as theproject
argument. For example:mod <- mread("emax", modlib())
will compile theemax
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
- Tests re-configured
- Fixed issue with record sorting for lagged doses when using full
data_set
andobsaug=TRUE
(#102) - Fixed issue where
idata_set
wasn't handled properly when it was passed in astbl
(#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
- 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 insoloc
to export only the functions thatmrgsolve
needs to use. - Added a check on the
project
argument tomread
: if newline(s) are found, an error is generated and the user is prompted to usemcode
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
- Fix bug in #96
mrgsolve 0.7.1
- Minor change to build process; no longer need to
cwd
to build dir to build.
mrgsolve 0.7.0
Features
- Added
as_data_set
to convert one or more event objects into a data frame that can be passed todata_set
. Does something similar toexpand.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 thetime
/TIME
column (always required when using a data set). Iftime
mrgsolve
will continue looking for lower case names; ifTIME
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 includesimeta
,Rcpp
,RcppArmadillo
, andBH
. 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 tomrgsolve
andRcppArmadillo
and allow the modeler to simulate a new set ofETA
s. UseRcpp
plugin to simulate random variates from common distibutions inR
(e.g.rnorm
,rexp
etc ... ).
Bugs fixed
- Fixed issue with
ev
where no rows were returned ifamt
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
withncmt=2
anddepot=FALSE
, the default PK parameters areCL
,V1
(central volume),Q
,V2
(peripheral volume). This is a change where the previous volumes wereV2
(central) andV3
(peripheral). $CAPTURE
now saves output items to slots instd::vector<double>
, rather thanstd::map<std::string,double>
. We've known for a while that thestd::map
wasn't very efficient especially with large simulations. Currently, items in$TABLE
are still saved intostd::map
withtable()
macro. The plan going forward is to eliminate thattable
map
and force output variables into$CAPTURE
.- Due to major changes to
dplyr
, now requiringdplyr >= 0.5.0
(issue 69) - The
data
slot inmrgsims
objects is nowdata.frame
- The
knobs
function andplot
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 withis.loaded
- Model shared objects are still stored within the
soloc
directory (by defaulttempdir()
), butmrgsolve
will create a subdirectory structure to organize compilation artifacts. The outer directory is keyed based on the currentmrgsolve
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 theR
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 bedyn.unload
ed. - Upon model rebuild (via
mread
ormcode
), 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 thepreclean
argument will force re-compilation (seeR CMD SHLIB
). - The header files
modelheader.h
andmrgsolv.h
are no longer copied into the project directory. ButCLINK_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 usesintern=TRUE
so that output is suppressed on bothWindows
andmac/unix
. The user may still request to view build output with theignore.stdout
argument. - Model build always links-to the
project
directory to look forC++
header files. When including a header file that may change from build to build, always run withpreclean=TRUE
. mrgsolve
now changes the working directory prior to building a model. The working directory is restored on exit frommread
.
Deprecated
- The entire
complog
system, including:comp_forget
a message is issuedcomplog
no message is issued
trequest
argument tomrgsim
mrgsolve 0.6.1
Bugs fixed
- Fixed a bug when an infusion was attempted with
rate > 0
andamt==0
. Additionally, an error is generated when an infusion is attempted with zeroamt
(issue 43).