Generic Implementation of a PK/PD Model
Auto replication settings class.
Auto-detect special variables from NONMEM as compartment properties. B...
Delete an element from this list.
Disable.
Double-array parameter class. This parameter has 2 indexes. It can thu...
(Infusion)-duration record class.
Equation class. Any statement in the form A = B.
Create a new equation.
Error record class.
Create ERROR code record.
Export type class.
Export function.
Export the given object to a JSON object, ready to be written to files...
Extract left-hand-side expression.
Extract right-hand-side expression.
Extract text between brackets.
Bioavailability record class.
Find an element in list.
Fix omega matrix for SAME OMEGA parameters that have NA values due to ...
Flag all parameter rows that have at least one parameter out of the sp...
Get element by index.
Get an element from a list by name. Never return more than 1 element.
Get Campsismod option logic.
Get the Campsismod options (R options).
Get the compartment index for the specified compartment name.
Detect all compartments names from the code records. Only for model in...
Return a matrix filled in with OMEGA/SIGMA names to be mapped with the...
Get element name.
Get the name of the given parameter in the Campsis model.
Get element names from list.
Get NONMEM name.
Get the right block of OMEGA's.
Get the indexes of the omegas.
Get prefix.
Get record delimiter.
Get record equation names
Get record name.
Get uncertainty on the parameters.
Get variance-covariance matrix.
Magritt operator for piping.
Check if string contains Campsis-style comments.
Has off-diagonal omegas.
If-statement class. Any statement in the form if (condition) A = B.
Create a new IF-statement.
Return the IF-statement pattern (string form).
Get the index of an element in list.
Create an infusion duration.
Create an infusion rate.
Init record class.
Create an initial condition.
Say if the block is fixed (i.e. all parameters are fixed).
Check if string is a Campsis comment (i.e. not an equation).
Is diagonal.
Check if string is an empty line.
Say if line in record is an equation not.
Say if line in record is an IF-statement.
Is matrix positive definite. Same check as mvtnorm does.
Say if line(s) in record is/are ODE or not.
Is record delimiter. A record delimiter is any line starting with [......
Check if the destination engine is RxODE or rxode2. Note that rxode2 i...
Is strict record delimiter. A strict record delimiter is any line star...
JSON element class.
Instantiate a JSON element.
JSON to Campsis dataset.
Convert JSON correlation parameter (OMEGA or SIGMA) into a Campsis par...
JSON to Campsis parameter.
Lag record class.
Create a lag time for the specified compartment.
Return the length of this list.
Line-break class. A linebreak in the model.
Create a new line break.
Fill-in S4 object from the JSON content.
Main record class.
Create MAIN code record.
Manual replication settings class.
Create manual replication settings.
Map JSON properties to S4 slots.
Map S4 slots to JSON properties.
Match double array parameter from list based on the name instead of th...
Match single array parameter from list based on the name instead of th...
Max index.
A empty method only used to declare some of the global function defini...
Min index.
Min/max default values for the given parameter.
Model statement class. Any statement in a code record.
Model statements class. A list of statements.
Create an empty list of model statements.
Move element 'x' from object to a certain place.
Mrgsolve export type class.
Convert code record for mrgsolve.
Get the CAPTURE block for mrgsolve.
Get the compartment block for mrgsolve.
Get the MAIN block for mrgsolve.
Get the OMEGA/SIGMA matrix for mrgsolve.
Get the ODE block for mrgsolve.
Get the parameters block for mrgsolve.
Get the TABLE block for mrgsolve.
ODE record class.
ODE class. Any statement in the form d/dt(A_CMT) = B.
Create a new ordinary differential equation (ODE).
Create ODE code record.
Omega parameter class.
Create an OMEGA parameter.
Create a block of OMEGA's.
Create a list of OMEGA blocks.
Open JSON file.
Parameter class. Any parameter in a pharmacometric model.
Parameters class.
Create a list of parameters.
Parse IF-statement. Assumption: isIfStatement method already called ...
Parse statements code and return Campsis statements.
Pattern class.
Create a pattern.
PMX element class.
PMX list class.
PMX position by element class.
PMX position by index class.
PMX position class.
Element position in list.
Process double array arguments.
Process extra arguments.
Process JSON double array parameter.
Properties record class.
(Infusion)-rate record class.
Read all parameters files at once.
Read a Campsis model.
Read model file.
Read parameters file.
Read a Campsis model (deprecated).
Generic read method to read data from a file or a folder.
Read variance-covariance file.
Remove given column(s) if it has only NA's.
Remove all trailing line breaks.
Replace element by another in list.
Generic function for parameter sampling according to the minimum and m...
Get a subset of an object.
Set the minimum and maximum value on a model parameter.
Shift OMEGA indexes.
Sigma parameter class.
Create a SIGMA parameter.
Single-array parameter class. This parameter has a single index value.
Sort the specified list.
Standardise.
Statements record class.
Theta parameter class.
Create a THETA parameter.
ToString generic method.
Trim character vector. Remove all leading and trailing spaces.
Unknown statement class. Any statement not recognized by campsismod.
Create a new ordinary differential equation (ODE).
Unknown destination engine exception.
Update compartments list from the persisted records. Exported especial...
Update OMEGAs that are same. Same OMEGAs are written as follows: OMEGA...
Update model parameters based on the parameters issued from the model ...
Variable pattern class.
Create a variable pattern.
Return the variable pattern (string form), without the first character...
Return the variable pattern (string form).
Write generic object to files.
Write subset of parameters (theta, omega or sigma).
Write record delimiter line.
Write variance-covariance matrix.
Check if an element exists in list.
Convert Campsis comment style to C/C++ code. Only the first # is trans...
Convert outvars argument to capture. Variables that are already in err...
Get default element from list.
Add element to list.
Add ODE compartment to compartments object.
Add properties to compartments object.
Add relative standard error (RSE) to the specified parameter.
Generic function to add a suffix to various objects like parameters, c...
Check is vector has NA's only.
Append code records
Append comment.
Append compartments.
Append model (or simply add).
Append parameters.
As data frame method.
Assert the given character vector is a single character string.
Create auto replication settings.
Create a bioavailability for the specified compartment.
Campsis model class.
Create a new Campsis model.
Check OMEGA/SIGMA matrix for positive definiteness.
Code record class. See this code record as an abstract class. 2 implem...
Create a list of code records.
Colon-equals operator.
Comment class. A statement starting with #.
Create a new comment.
Compartment bioavailability class.
Compartment infusion duration class.
Compartment infusion rate class.
Compartment initial condition class.
Compartment lag time class.
Compartment properties class.
Compartment property class.
Compartment class.
Create a compartment.
Compartments class.
Create a list of compartments
Replace all occurrences in object.
Replicate generic object.
Replicated Campsis model class.
Replication settings interface.
RxODE/rxode2 export type class.
Get code for rxode2
Get the OMEGA/SIGMA matrix for rxode2.
Get the parameters vector for rxode2.
Sample from scaled inverse chi-squared distribution (core method).
Sample parameters from inverse scaled chi-squared or wishart distribut...
Sample from scaled inverse Wishart distribution (core method).
Sample from a multivariate normal distribution.
Sample from multivariate normal distribution (core method).
A generic, easy-to-use and expandable implementation of a pharmacokinetic (PK) / pharmacodynamic (PD) model based on the S4 class system. This package allows the user to read and write pharmacometric models from and to files, including a JSON-based interface to import Campsis models defined using a formal JSON schema distributed with the package. Models can be adapted further on the fly in the R environment using an intuitive API to add, modify or delete equations, ordinary differential equations (ODEs), model parameters or compartment properties (such as infusion duration or rate, bioavailability and initial values). The package also provides export facilities for use with the simulation packages ‘rxode2’ and ‘mrgsolve’. The package itself is licensed under the GPL (>= 3); the JSON schema file shipped in inst/extdata is licensed separately under the Creative Commons Attribution 4.0 International (CC BY 4.0). This package is designed and intended to be used with the package ‘campsis’, a PK/PD simulation platform built on top of ‘rxode2’ and ‘mrgsolve’.
Useful links