Recent Releases of mrgsolve
mrgsolve - mrgsolve 1.5.3
D_CMT,ALAG_CMT, andsimeta()are now available to use in$TABLE($ERROR),$EVENT, and$PREDcode blocks (#1290).Added
END_OF_INFUSIONsyntax, which istrueon the internal record that stops an infusion (#1288).mwrite_yaml()andmwrite_cpp()now render block names in upper case, even for blocks coded with lower case in the original model file (#1282).When creating an
evt::regimenobject (viaevtoolsplugin), the default start time is now the time when the object was created; before this change, the default time was always0(#1266).Added methods for
evt::regimenobjects (viaevtoolsplugin) under the nametime_next(); this either gets or sets the time of the next dose in the regimen (#1266).
Bugs Fixed
Fixed an issue where
timevalues in the simulated output data frame were off by a very small amount, due to issues with floating point mathematical operations (#1287).Fixed a problem writing a model to file with
mwrite_yaml()andmwrite_cpp()when lower case block naming was used (#1282).Fixed a bug where invalid item passed through the
$SETblock caused an error when reading / building a model (#1271).Fixed a bug where mrgsolve was not matching NONMEM behavior when an
EVID=4record was included in the data set withSS=1; mrgsolve will now match NONMEM behavior in this case, with the output being identical toEVID=1withSS=1(#1262).
- R
Published by kylebaron 11 months ago
mrgsolve - mrgsolve 1.5.2
Add
$EVENTblock for writing code related to dosing or other events that are implemented through model code rather than the data set (#1230).Add
evt::reset()andevt::reset(self)functions under theevtoolsplugin; these reset the compartments in a model; overloaded functions are also provided to reset and dose with bolus or infusion (#1222).Completed dosing functionality in
evtoolsplugin; useevt::addl()to schedule additional doses through anevt::evobject; useevt::ii()to set the dosing interval; useevt::ss()to advance the pharmacokinetic system to steady state just prior to dosing;evt::cmt()sets the compartment number;evt::amt()sets the dose amount;evt::rate()sets the infusion rate; see the user guide for the specific signatures that are available (#1227).Add
evtoolsmodel tomodlib(), illustrating how to implement dosing regimens from inside the model a few different ways (#1230).Added more comprehensive checking for duplicate blocks in a model file; duplicate blocks are always handled when allowed; an error message is always issued when duplicates are not allowed (#1238).
Code to audit
$ODE(or$DES) code, looking for an equation for every model compartment was refactored to use a common approach for both traditional models and models written with thenm-varsplugin; regardless of approach, the user will be warned if mrgsolve does not detect code relevant to every model compartment; the audit system can be bypassed by including the@!auditblock option to$ODE(#1235).The
autodecplugin was lightly refactored to avoid false positive detection of variables declared asdouble; plans are in place to narrow the scope of what is detected for declaration in future releases (#1234).R help files (
.Rd) reviewed and revised for consistency and formatting (#1246).
- R
Published by kylebaron over 1 year ago
mrgsolve - mrgsolve 1.5.1
- Fixed
yaml_to_cpp()example code to prevent saving the file to the working directory (#1220).
- R
Published by kylebaron almost 2 years ago
mrgsolve - mrgsolve 1.5.0
New functions
mwrite_yaml()andmwrite_cpp()can write a model object back to a file, accounting for all updates since the model was read from native mrgsolve format usingmread()(#1213).New function
mread_yaml()for reading back models written out withmwrite_yaml()(#1213).New functions in
evtoolsplugin:evt::replace()works likeevt::bolus(), but will replace the amount in a given compartment rather than add to it (#1203).The
nm-varsplugin now exposesDEXP(),LOG10(),COS()andSIN()for use in the mrgsolve C++ code blocks (#1199).An error is now generated when
KAis equal toCL/VCwhile simulating from the one-compartment model with analytical solution invoked through$PKMODEL(#1179, #1197).
Bugs Fixed
- A bug was fixed when certain data frame inputs were passed to
as_data_set()(#1115, #1196).
- R
Published by kylebaron almost 2 years ago
mrgsolve - mrgsolve 1.4.2
- An error will now be issued at simulation time when simulation data sets
(data and idata) contain non-numeric data in columns sharing names with
parameters; non-numeric data in columns with certain reserved names
(like
AMT,RATE,II,ADDL, etc.) will also result in an error (#1193).
- R
Published by kylebaron about 2 years ago
mrgsolve - mrgsolve 1.4.1
- Fix bug in
evt::regimen.ii(double)where timing of next dose was not as expected (#1170).
- R
Published by kylebaron over 2 years ago
mrgsolve - mrgsolve 1.4.0
mrgsolve 1.4.0
evtoolsis a new plugin providing API for dynamic dosing from within the model; functions and classes are in theevtnamespace (#1149).regimenis a new class located in theevtnamespace via theevtoolsplugin;regimenobjects can execute doses in a regular regimen (#1156).mread()andmcode()no longer print a message before the required waiting period on model recompile (#1145).ev_rep()output rownames are cleaned up before returning (#1158).C++ model code blocks (GLOBAL, PREAMBLE, MAIN/PK, ODE/DES, TABLE/ERROR) are now checked for
<object>.<attribute>syntax; if found, symbols on both sides of the dot become reserved words when loading and compiling that model; specifically, an error will be generated if either side of the dot (<object>or<attribute>) is found in parameter names, compartment names, ETA labels, or EPS labels (#1159).ETA values are always simulated from OMEGA, even when the user requests they get scraped from
dataoridataviaetasrcargument tomrgsim(); this ensuresEPSare reproducible for model runs whereetasrc = "omega"(default, ETA are simulated) or, for example, whereetaasrc = "data.all"(scrape ETA from the data set) (#1163).
Bugs Fixed
Fixed a bug where modeled doses scheduled to happen
nowwere ignored if thetimeattribute was set to a value prior to the current simulation time (#1152).Fixed a bug in how doses were computed using the
untilargument toev()(#1154).
- R
Published by kylebaron over 2 years ago
mrgsolve - mrgsolve 1.3.0
The
evdataobject for modeled events now contains acheck_uniquemember; when set tofalse, the event will be processed without checking for a matching record in the modeled event log (#1119).The
amtattribute inevdatamodeled event objects is now considered when looking for duplicate records in the modeled event log (#1119).
Bugs Fixed
Fixed a bug where multiple lagged doses given at the same time but with different bioavailability were all given the bioavailability of the last dosing record (#1129, #1130).
Fixed a bug where modeled infusions given
nowwere never turned off (#1131).Fixed a bug where the
selfobject (type:databox) could not be passed into functions written into header files that were included through$INCLUDE; these header files are now included immediately preceding any user code written into$GLOBAL(#1125, #1126).Fixed a bug where modeled event log was not getting reset after simulating the first individual; this resulted in events not getting executed in subsequent individuals when matching events were executed in the first individual; this affects modeled events only, not events coming from the data set (#1117, #1118).
Fixed a bug in detecting which compartments are receiving doses (#1112, #1113).
- R
Published by kylebaron over 2 years ago
mrgsolve - mrgsolve 1.2.0
- Data set records at the same time within individual will receive different
EPSdraws; this is a change from previous behavior where records with the same time received the same value forEPS(#1110).
- R
Published by kylebaron over 2 years ago
mrgsolve - mrgsolve 1.1.0
Add new functionality for assessing consistency between names on input data set and parameter names (#1078).
- New function
check_data_names()executes the check. - New model specification block
$INPUTfor marking parameters as "inputs" and expecting them to be present in the data whencheck_data_names()is called. - New
$PARAMblock attributes@inputand@tagfor adding tags to parameters which will be checked whencheck_data_names()is called. - New function
param_tags()to list parameters and tags for a given model.
- New function
Now checking
TIMEandtimewhen assessing upper / lower case name consistency of input data sets (#1099).ETAs can now be passed via
idataby passingeta_srcas eitheridataoridata.alltomrgsim()(#1092).Internal refactor of mechanics checking for user interrupt during simulation (#1088).
Minor re-factor of
mrgsim_nid()and documentation update to be in line with original intent; no meaningful change in functionality (#1086).parameter_listobjects can now be passed toparam()(#1076).ev_rx()syntax gains&operator allowing specification of multiple events at a single time (#1072).Kyle Meyer added as contributor (#1095).
modlib()model1005re-coded to reflect the "traditional" model specification syntax (#1069).The model object
update()method will again issue a warning when unrecognized arguments are passed (#1068).
Bugs Fixed
- Fixed bug where ETA in the first column of
datawas not recognized when usingeta_src = "data"oreta_src = "data.all"(#1095).
- R
Published by kylebaron almost 3 years ago
mrgsolve - mrgsolve 1.1.1
- Remove
.xfrommatlistdocumentation object per new NOTE output from rdevel (#1103, #1104).
- R
Published by kylebaron almost 3 years ago
mrgsolve - mrgsolve 1.0.9
- Fix signatures for
compiled.mrgmod()andas_tibble.mrgsims()based on new R-devel check findings (#1065).
- R
Published by kylebaron about 3 years ago
mrgsolve - mrgsolve 1.0.8
SIGMA()is a new model macro which allows users to access on-diagonal elements ofSIGMAin the model (e.g.SIGMA(2)in$ERROR) (#1051, #1052).mrgsim()andmrgsim_q()gain anetasrcargument, allowingETAsto be either simulated fromOMEGA(new default and previously the only behavior) or taken from the input data set (new option), similar to the way parameters can be scraped from the data set (#1037).@etasis a new option for use with the$CAPTUREblock to let users nameETAsto be captured into the simulated output; for example, use@etas 1:lastto capture all modelETAsin the simulated output (#1055).Drop
CXX_STDstatement from Makevars file and DESCRIPTION to be consistent with current changes in R-devel; mrgsolve continues to require compiler capable of implementing C++11 standard, but this should be selected automatically by R (#1060).mrgsolve now depends on
R >= 3.6.2(#1060).
Bugs Fixed
Fix bug when the
pathargument is used in the$NMXMLor$NMEXTblocks; this bug was introduced through the@cppstemfeature in version1.0.7(#1046, #1048).Fix bug in
mread_cache()where theprojectdirectory wasn't getting rendered properly when passing the complete path to the model specification file (#1056).
- R
Published by kylebaron about 3 years ago
mrgsolve - mrgsolve 1.0.7
$NMXMLand$NMEXTnow accept therunargument set to"@cppstem"(i.e
run = "@cppstem"); in this case, the stem of the NONMEM run will be assumed to be the same as the stem of the mrgsolve model file (#1025).Missing values (
NA) in input data sets will be replaced with 0 for the following columns:AMT,CMT,EVID,II,ADDL,RATE,SSas well as their lower case counterparts (#1030).Refactored include order when building a model; this is an internal update and not expected to be visible to the user (#1038).
- R
Published by kylebaron over 3 years ago
mrgsolve - mrgsolve 1.0.6
Bugs Fixed
- Fix bug in
TOUCH_FUNSwhere parameter and compartment lists were not getting generated properly whenmrgsolvewas not loaded; bug was detected and fixed prior to upload to CRAN or MPN (#1013).
- R
Published by kyleam almost 4 years ago
mrgsolve - mrgsolve 1.0.5
Changed behavior for dosing records where EVID = 4 and SS != 0 to match what is done by NONMEM: the system will be advanced to steady-state but will not be reset; behavior prior to 1.0.5 release was to advance to steady-state and then reset (#1011).
Any column in an input data set that has a class attribute will now be dropped in addition to non-numeric columns; this includes columns that are
integer64which can be present in data frames derived fromdata.table::fread()or other.csvreaders (#1008).The
$MAINand$TABLEblocks will no longer get called for actual dose administration records with lag times; this could change time after dose calculations or other calculations that could be happening in those blocks when the actual administration is taking place (#992).Code to update the parameter list was re-factored to be much more efficient (#978).
Bugs Fixed
Fix bug where apparent dosing events for additional doses with lag times were not getting scheduled (only records for the actual administration); this doesn't change the simulated output but could change time after dose calculation (#992).
Fix bug where special
nm-varsvariables were not getting recognized as valid capture items during dynamic capture (#987).Fix bug when updating the parameter list with a data frame that included non-numeric columns that were not parameters (#978).
- R
Published by kylebaron almost 4 years ago
mrgsolve - mrgsolve 1.0.4
Fix bug where
as_data_frame()was not properly working when leading event object wasevdtype (#948, #955).Add
uctran()to convert nmtran data names to upper case (#955).Both
lctran()anductran()are generic and work ondata.frameor event (ev) objects (#949, #955).Fix bug where data records with
EVID = 3were getting shifted in time byALAG(#964, #969).Small negative eigenvalues from
OMEGAorSIGMAare set to zero in multivariate normal simulation ofETAandEPS, following the pattern seen inMASS::mvrnorm()(#956, #957).Fixed bug where template parameters (
T) were getting modified whennm-varsplugin was used in conjunction withmrgxplugin (#965, #968).
- R
Published by kylebaron about 4 years ago
mrgsolve - mrgsolve 1.0.3
Removed
assert()statement in LSODA code found by CRAN check (#943).Test class using
inherits()notclass()from CRAN check (#943).
These changes were made in two versions (1.0.2 and 1.0.3) after iteration with CRAN checks.
- R
Published by kylebaron about 4 years ago
mrgsolve - mrgsolve 1.0.1
Add
LOG(),EXP(),SQRT()macros whennm-varsplugin is invoked931, #936.
Use
evd()to create an event object which renders nmtran names in upper case (e.g.TIMErather thantime) #935, #919.Fixed bug where
ratewas not getting set for modeled events #934.Fixed bug where
self.stop_id()andself.stop_id_cf()had reversed behavior as documented #927, #928.Refactored EVID=3 behavior to leave
NEWINDas-is #934.
- R
Published by kylebaron about 4 years ago
mrgsolve - mrgsolve 1.0.0
New model syntax:
THETA(n)is interpreted asTHETAnin the model code;THETAis now a reserved word (#837, #891, #892).New functions
collapse_omega(),collapse_sigma()andcollapse_matrix()added which help to reshape OMEGA and SIGMA matrix objects with multiple blocks (#897, #900).New plugin
nm-varswhich implements NONMEM-like syntax for referring to compartments, differential equations, bioavailability factor, infusion duration and rate, and lag time (#904, #891).New plugin
autodecwhich will find user-defined variables in the model code and automatically declare them as typedouble(#905, #893).Use
iias spacer for setting the between-dose interval when putting event objects in a sequence (c.f.wait) (#906, #901).Start deprecating
simeta(n)andsimeps(n), calls tosimeta()orsimeps()with an integer argument thus limiting the update to just a singleETA(n)orEPS(n); use in model code will generate warning when loading the model that contains theninteger value (#908, #909).
- R
Published by kylebaron over 4 years ago
mrgsolve - release/0.11.2
mrgsolve 0.11.2
In
pk2iv, change scaling volume forCENTfromV2(incorrect) toV1(#831, #832, #833)Fix bug collating multiple
$OMEGAor$SIGMAmatrices when parsing a model (#863)Refactor how debugging information is processed when using the
recoverargument tomread()(#853)Fix typo in documentation for
as_cmat(); the off-diagonals are assumed to contain correlations (#856)Wrote a
as.data.frame.matrix()function in Rcpp; all simulation results return from the C++ simulation code as a data frame (#857)Fix bug where dynamic capture (via
mread()) was not allowed for variables declared in$GLOBAL(#868)
- R
Published by kylebaron over 4 years ago
mrgsolve - mrgsolve 0.10.5
- Suppress warnings when non-numeric columns are dropped when those columns are not relevant to the simulation #709
- Add
$ERRORas an alias for$TABLEin the model file #710 - Fix bug where warning messages during steady-state finding referenced
rtolandatolrather thanss_rtolandss_atol#703 - Fix annotation parsing bug when the description included semi-colon #696
loadsoissues a proper error when the model dll doesn't exist #724- Try loading the model with loadso once of the model isn't loaded at the time of simulation #725
- Throw an error when
addlorssare negative #733 - Internal refactoring so that there is a hard solver reset when parameters that are copied from data change #744
- Add
tadplugin to calculate time after dose in a specific compartment #702 - Internal refactor
carry_outto respect defaultnocbbehavior #759; see also #744 - Throw an error when matlist labels are duplicated #730
- Add
captureargument tomreadto add to$CAPTUREwhen compiling the model #704
- R
Published by kylebaron about 5 years ago
mrgsolve - mrgsolve 0.10.8
- Allow simulation from compartmental models with negative times #778
- Enable dynamic capture of pre-processor directives at compile time #776
- Fix error message when requesting invalid items during dynamic capture #776
- R
Published by kylebaron about 5 years ago
mrgsolve - mrgsolve 0.10.9
- Dosing into a compartment that is off at the time of the dose turns the compartment back on regardless of whether bioavailability is zero or non-zero (this is a bug fix where the compartment was not turned on when bioavailability was zero). (#800)
simeta()andsimeps()now accept an (optional) integer argument to limit re-simulation to single ETA or EPS values (#789)as.list(mod)output now includes a data frame ofC++variables and pre-processor definitions in thecpp_variablesslot. (#780)$PARAM,$THETA,$CMT,$INIT,$OMEGAand$SIGMAblocks all include the directives@objectand@as_objectso that block contents can be specified programmatically.@objectnames an object that was coded into$ENVand@as_objectindicates that the block contains code to realize the object. See?BLOCK_PARSEhelp topic for more information on how this all works. (#783)$NMEXTnow lets the user select between multiple tables for scraping parameter estimates. (#782)
- R
Published by kylebaron about 5 years ago
mrgsolve - mrgsolve 0.11.1
mrgsim()will now periodically check for user interrupt signal so that long-running simulations can be stopped usingEscand / orControl-C; the check interval can be modified through theinterruptargument tomrgsim(), but for most applications, this shouldn't need to be changed (#823)mrgsim()will issue a warning if duplicate columns are found in simulated output and rename duplicates usingmake.names(); thanks @FelicienLL for the report (#827, #828)- Users can now turn compartments to
OFFwhen they have active infusions running; this was previously an error (#822)
Milestone: https://github.com/metrumresearchgroup/mrgsolve/milestone/10
- R
Published by kylebaron about 5 years ago
mrgsolve - Release to CRAN
Important changes
- The bioavailability parameter now gets updated with each and every dose, regardless
of whether it was explicitly coded in the data set or implicitly via
addl. The previous behavior had bioavailability parameter locked at the value at the time the initiating dose was implemented - Updated package dependency requirements. Notably,
mrgsolvenow requiresRcpp >= 0.12.12anddplyr >= 0.7.1
New Features
- Dosing records with
ss=2are recognized, allowing combining of steady-state dosing regimens under linear kinetics (e.g. 10 mg QAM and 20 mg QPM) (#221) - Added function (
inventory) that reconciles model parameters with names in an object (e.g. a simulation data set) verify that required parameters can be found in the data object. - Added
ev_rep,ev_seq,seq.ev, andev_repeatfunctions for combining event objects
Bugs fixed
- PR #214 from @dastoor fixes compatibility issue with new
dplyr - Fixed bug in
deslistimplementation #222 - PR #238 fixes incorrect steady-state values when dose is associated with lagtime (#239)
- R
Published by kylebaron almost 9 years ago
mrgsolve - mrgsolve 0.8.6
Minor changes to improve portability and release to CRAN.
- R
Published by kylebaron about 9 years ago
mrgsolve - mrgsolve 0.8.3
Addresses issue to get compatible with solaris.
- R
Published by kylebaron about 9 years ago
mrgsolve - mrgsolve 0.8.2
This is the first release to CRAN.
- R
Published by kylebaron about 9 years ago
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$ENVor a package namespace andmrgx::mt_fun()that is just a function that you can assign when declaringRcpp::Function. - Added
objectargument toidata_setanddata_setto get adata.frame(or function to call that returnsdata.frame) out of$ENVto use for simulation.
Changes / additions
- Added
cmtargument to$PKMODEL. Whencmtis set to a character vector or a comma-separated string,$PKMODELinfers the number of compartments and declares them in the model. This means a separate$CMTblock is not required when using$PKMODEL. - Added
colsargument toas_bmatandas_dmatso that a character vector of names can be specified (rather than regular expression) to select data for creating matrix. - The
precleanargument now causesunlinkto 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.
- R
Published by kylebaron over 9 years ago
mrgsolve - mrgsolve 0.7.7
Important changes
- The
table()macro in$TABLEis now deprecated (https://github.com/metrumresearchgroup/mrgsolve/pull/129). To get derived values into the simulated output, users should assign to typedoubleand list that variable name in$CAPTURE. See also thecapturetypedef introduced below. - The
mrgxplugin was completely removed. - Parameter updates via
parammethod with signaturemissingwill 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 theparammethod with signaturelist(../../issues/144). - The git repository was re-organized so that the package lives in the base directory (https://github.com/metrumresearchgroup/mrgsolve/pull/171).
Features
- Added
@macros for indicating block options in model specification file. - Added
qsimfunction for quick(er) simulation runs with just one parameter set. - Added
recmatrixthat creates matrix simulation template forqsim. - Added
mrgsolve:::renderto create a document with overview of model contents. Methods for bothmrgmodobjects andcharacterstrings pointing to a model file. - Use
mrgsolve:::detailsto extract model annotation. - Added
capturetypedef in the model specification file. Variables that are typecaptureare doubles and are automatically appended to$CAPTURE. Thecapturetypedef is not allowed in$ODEand probably should be reserved for$TABLE. simetais available in$MAINandsimepsis available in$TABLEby default, no$PLUGINis required.- Better support for including
Robjects in the model via$ENV(../../issues/158). - Added
assign_evfunction to help build simulation data sets from event objects (https://github.com/metrumresearchgroup/mrgsolve/pull/164). - Added
as_data_framemethod from thetibblepackage (../../issues/166). - When annotating model blocks,
mrgsolvetakes the last parens item as the "units" and the last bracketed item as "options" - Added
$operator formrgmodobjects to return the value of a parameter (99748d8a7e4976fc710152c2dfc82da9b059a852). - Added
mread_cacheandmcode_cachefunctions to build and cache a model (https://github.com/metrumresearchgroup/mrgsolve/pull/143).
Bugs fixed
- Fixed documentation issue in
PKMODEL. The volumes for two-compartment model with no depot should beV1/V2. - Fixed bug in
knobswhere 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/boolin$MAIN,$ODE,$TABLEare kept in unnamed namespace and are local to the file. - Started to re-organize the
.Rfiles. mrgsolve:::detailsreturns a data frame of information regardless of whether the model was annotated or not (../../issues/165).mrgsolve::detailshas additional arguments to help control output.- Removed
pkeventclass; all records aredatarecord.
- R
Published by kylebaron over 9 years ago
mrgsolve - 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
$ENVto allow users to createRobjects 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=valuestatements that follow are to be parsed as block options. - Added
objectargument for the following blocks:$PARAM,$OMEGA,$SIGMA,$FIXED,$CMT. Whenobjectis 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.numericlistwasn't returningFALSEfor improperly-formed objects.
Under the hood
- Now using an
environmentto 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/mrgsolve@v0.7.6", subdir="rdev")
- R
Published by kylebaron over 9 years ago
mrgsolve - mrgsolve 0.7.5
- The
modmrgpackage was discontinued. All of the pre-coded models are now available inmrgsolve. Simply callmreadwith the model stem (e.g.pk1cmt,irm3, etc ...) and callmodlib()as theprojectargument. For example:mod <- mread("emax", modlib())will compile theemaxmodel and return the model object.
The source package (built) is attached as mrgsolve0.7.5.tar.gz. But the recommended installation method is with devtools::installgithub("metrumresearchgroup/mrgsolve@v0.7.5", subdir="rdev")
- R
Published by kylebaron almost 10 years ago
mrgsolve - mrgsolve 0.7.4
- Tests re-configured
- Fixed issue with record sorting for lagged doses when using full
data_setandobsaug=TRUE(#102) - Fixed issue where
idata_setwasn'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/mrgsolve@v0.7.4", subdir="rdev")
- R
Published by kylebaron almost 10 years ago
mrgsolve - 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.deffile is created insolocto export only the functions thatmrgsolveneeds to use. - Added a check on the
projectargument tomread: if newline(s) are found, an error is generated and the user is prompted to usemcodeinstead. - Several changes under the hood (https://github.com/metrumresearchgroup/mrgsolve/pull/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/mrgsolve@v0.7.3", subdir="rdev")
- R
Published by kylebaron almost 10 years ago
mrgsolve - mrgsolve 0.7.1
- Minor change to build process; no longer need to
cwdto build dir to build.
- R
Published by kylebaron almost 10 years ago
mrgsolve - mrgsolve 0.7.0
Features
- Added
as_data_setto 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/TIMEcolumn (always required when using a data set). Iftimemrgsolvewill continue looking for lower case names; ifTIMEit will look for upper case names. A warning is issued in case both upper and lower case names are included. - Added
$PLUGINto let users extend their model specification file. Valid plugins includesimeta,Rcpp,RcppArmadillo, andBH. When a plugin is used,mrgsolvewill link back the the appropriate package and possibly include appropriate header files when compiling the model. For example,simetawill link back tomrgsolveandRcppArmadilloand allow the modeler to simulate a new set ofETAs. UseRcppplugin to simulate random variates from common distibutions inR(e.g.rnorm,rexpetc ... ).
Bugs fixed
- Fixed issue with
evwhere no rows were returned ifamtwasn't supplied (issue 44). - Shortened the path for both the shared object and the name of the
.cpp.cppfile when compiling. - Fixed bug in
touch_funswhen large number (> 25) of ETAs in the model (issue 68).
Important changes
- When using
$PKMODELwithncmt=2anddepot=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). $CAPTUREnow saves output items to slots instd::vector<double>, rather thanstd::map<std::string,double>. We've known for a while that thestd::mapwasn't very efficient especially with large simulations. Currently, items in$TABLEare still saved intostd::mapwithtable()macro. The plan going forward is to eliminate thattablemapand force output variables into$CAPTURE.- Due to major changes to
dplyr, now requiringdplyr >= 0.5.0(issue 69) - The
dataslot inmrgsimsobjects is nowdata.frame - The
knobsfunction andplotmethod 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 (funsslot)- 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
funscan be found withis.loaded - Model shared objects are still stored within the
solocdirectory (by defaulttempdir()), butmrgsolvewill create a subdirectory structure to organize compilation artifacts. The outer directory is keyed based on the currentmrgsolveversion number and the computer platform. Inner directories are based on the model name (model(mod)). - A source file is created based on the
modelname and the shared object is created based on that name. If the compilation is successful, the shared object (.soon mac/unix,.dllon Windows) is copied to a.soor.dllfile with a unique stem (e.g.model2lj239wsfo.so). This unique shared object is loaded into theRprocess 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.unloaded. - Upon model rebuild (via
mreadormcode), if there are no changes to the source.cppfile, the source is not overwritten. In that case,makewill not re-build the shared object. Using theprecleanargument will force re-compilation (seeR CMD SHLIB). - The header files
modelheader.handmrgsolv.hare no longer copied into the project directory. ButCLINK_CPPFLAGSenvironment variable is modlifed to include<path-to-mrgsolve-package>/inst/baseso that these may be linked. - The
R CMD SHLIBbuild process always usesintern=TRUEso that output is suppressed on bothWindowsandmac/unix. The user may still request to view build output with theignore.stdoutargument. - Model build always links-to the
projectdirectory to look forC++header files. When including a header file that may change from build to build, always run withpreclean=TRUE. mrgsolvenow changes the working directory prior to building a model. The working directory is restored on exit frommread.
Deprecated
- The entire
complogsystem, including:comp_forgeta message is issuedcomplogno message is issued
trequestargument tomrgsim
- R
Published by kylebaron almost 10 years ago
mrgsolve - mrgsolve 0.6.1
Bugs fixed
- Fixed a bug when an infusion was attempted with
rate > 0andamt==0. Additionally, an error is generated when an infusion is attempted with zeroamt(issue 43).
- R
Published by kylebaron about 10 years ago
mrgsolve - mrgsolve 0.6.0
Bugs fixed
- Fixed a bug where infusion dosing events with
evid 4were not properly implemented. While investigating that issue, also found similar issue withevid 4infusions getting scheduled withaddl(issue 31). - Removed NSE evaluation for arguments passed into
evto avoid unintended issues in evaluation (issue 29).
New features
- Added
mcodefunction as alternative to usingmreadwhen your model is written in anRstring. Note the order of the arguments: firstmodel, thencode, thenproject.projectdefaults totempdir. So the call is:mod <- mcode("mymodel", code). The equivalentmreadcall is:mod <- mread("mymodel", tempdir(),code). carry.out()andReq()now takenewname = oldnameas input. Use this syntax incarry.outwhen you want to copy a column from the input data set into the simulated data set, changing the column tonewnamefromoldname. Use this syntax inReqwhen you want to change the names of compartments or output variables spcified in$TABLE/$CAPTURE.- Added
pkmodelfunction for easy loading and simulating from 1- and 2-compartment models (issue 39). - Added new code block:
$PKMODELfor simulating PK model with analytical solutions. The main option for this block isncmt, which picks the number of compartments for the pk model. See?PKMODELfor more information and other options (issue 34).
Under the hood
- Added
codeattribute tomrgmodobjects. The actual source code stays with the model object.seewas modified to look atx@codefirst when showing the model code. - Added a tokenizer function (
get_tokens), a wrapper for the boost tokenizer) to help checking the model specification file. - Data items entered in
$FIXEDare now implemented as C++ preprocessor directives by default rather thanconst doublevariables. Use$SET fixed_type = "define"or$SET fixed_type = "const"to select between the approaches.
- R
Published by kylebaron about 10 years ago
mrgsolve - mrgsolve 0.5.12
Bugs fixed
- Added missing example model specification files (popExample, viralExample, others)
- Added
mindtattribute tomrgmodobjects with default value of.Machine$double.eps*10. When the problem includes an infusion, the calculated end of the infusion may come too close to another record. Usually the solver will fail with the messageDLSODA- TOUT(=R1) too close to T(=R2) to start integration.. To fix this,mindtis set to be greater than zero but small. Whenmindtis greater than zero andtto - tfrom(the times of two adjacent records) is less thanmindt,mrgsolvewill setttoequal totfrom(issue 9). zero.redidn't properly update the$SIGMAlist when one matrix was named and another was unnamed. This has been fixed. (issue 16)- Fixed a bug where infusions with
ss=1 causedmrgsolve/Rto crash when the infusion duration was equal to or some multiple of the dosing interval. (issue 19) - Fixed a bug where setting
F_CENTto zero gave undefined behavior.mrgsolvewill issue an error ifF_CMTis set to zero and thessflag is set to 1. (issue 22) - Fixed bug where dosing records with
evid=4(reset the system and dose) andaddl > 0reset the system for all subsequent doses. Additional doses coming from records withevid=4will not do system reset. (issue 23)
Important changes
- New arguments for
$NMXML(see?nmxml) that are easier to understand and consistent with new prefixes and labels forETAandEPS.nameargument is removed. Usetname(to provide a prefix forTHETAs),oname(to name theOMEGAmatrix), andsname(to name theSIGMAmatrix) instead. In general, setthetato beTRUEto importTHETAs, setomegato beTRUEto importOMEGA, and setsigmato beTRUEto importSIGMA. Specifying character namestname,oname, andsnamewill implytheta=TRUE,omega=TRUE, andsigma=TRUE, respectively.
New features
- New aliases available for setting bioavailability, lag time and infusion duration and rate. For a compartment called
DEPOTuse:F_DEPOT(bioavailability),ALAG_DEPOT(dosing lag time),D_DEPOT(infusion duration), and / orR_DEPOT(infusion rate). (issue 13) - Added slightly more informative messages when
DLSODAfails, including clear identification if the value ofistate, which is 2 when the solver succeeds and negative when the solver fails. - Added
labelsandprefixoptions to$OMEGAand$SIGMA. These allow descriptive aliases for ETAs ... e.g. usingETA_CLrather thanETA(1). (issue 15) - Added
dplyr::slicemethod formrgsimsobjects (issue 11) - New argument to
mread:quiet. SettingquiettoTRUEwill prevent printing messages whenmreadis called. The default isgetOptions("mrgsolve_mread_quiet",FALSE)... so you can calloptions(mrgsolve_mread_quiet = TRUE)to globally turn off messages frommread.
- R
Published by kylebaron about 10 years ago
mrgsolve - mrgsolve 0.5.11
Bugs Fixed
- Fixed paths for project (
project) and shared object (soloc) so that "short" paths are used when compiling the model on Windows platforms (info issue 4 and here) - Fixed a bug where bioavailability fraction was not accounted for when setting infusion duration in
$MAINwithrate=-2(see issue 3) mrgsolve_exampleprints a message telling the user to usemrgmodto read and compile the model. The user should usemread. The message has been updated. (info issue 5)- Fixed bug where parameters were not correctly read from first row of a data set when certain
recsortoptions were selected (issue 6)
New Features
- Added
$ADVAN2and$ADVAN4for implementing one- and two-compartment PK models with analytical solutions rather than ODEs (thanks to contributions by Bill Gillespie and Charles Margossian) - Added
solocattribute added tomrgmodand argument added tomread, giving user control over where the shared object is stored; by default it is intempdir().solocneeds to be set to local directory when usingqapply - Added generics for various
dplyr_functions so thatmrgsimsobjects can be piped tomutate,group_by,filter,summarise,do,select, andsummarise.each(it's a dot not an underscore). So:mod %>% mrgsim %>% mutate(group=1) - You can now set initial conditions though
idata; for compartmentCMT, include a column inidatacalledCMT_0 - Modified update policy for
$OMEGAand$SIGMA: if all incoming matrices are unnamed and the signature matches the model object, the update will happen - Added
mcRNGfunction as alias tobase::RNGkind("L'Ecuyer-CMRG")
Under the hood
- Changed dosing lag time mechanism so that lag times are calculated as the simulation progresses and dose times in the simulated output are as in the input data
- Model shared objects are given random names every time the model is compiled and loaded
- Changes to
recsort: 1 and 2 will put explicit doses after observations at the same time, 3 and 4 will put explicit doses before observations at the same time. 2 and 4 will put doses scheduled through addl after observations at the same time; 1 and 3 put doses scheduled through addl before observations at the same tile - Various fixes and expansions to documentation
- Changed
Rdependency to>= 3.1.2 - All
Opsinvolvingmrgmodobjects are now deprecated loadsonow returns the model object (invisibly)- Compartment names are automatically removed from table map
- Model specification files in need of compilation are detected via md5sum
- Minimum of 2 sec wait time is required before re-compiling a model
- Added
initmethod with signaturemrgmod,ANY, withANYgetting coerced tolist
- R
Published by kylebaron over 10 years ago