installation.Rmd
Before installing the packages in R, you must have successfully installed the following on your system.
For Windows please download R from CRAN, run the executable and follow the instructions. For Linux please use the instructions provided here.
Certara’s NLME Engine is required to execute models built with
RsNLME
. Click here to request a
30-day trial of the NLME Engine.
Note: Installation files and license will be emailed by Certara support after contact form has been submitted.
Installation and configuration of the NLME Engine is done in a few simple steps via the NLME Engine Installer.
1.) Open NLME-Engine-23.1.1.exe - Run as administrator.
2.) Select appropriate installation (e.g., typical).
The installer will install Certara’s NLME Engine, MPICH (used for
parallel execution), and GCC (compiler) inside
C:/Program Files/Certara
, and configure the appropriate
environment variables required to execute Certara.RsNLME
models from R.
Note: Existing Phoenix users already have MPICH2 and GCC on their system and only need to install the NLME_Engine.
Note: GCC version 8.5.0 required for the NMLE Engine distributed with CentOS8/RHEL8.
1.) Unzip NLME-Engine-23.1.1.zip
and note the location
of this folder on your system.
2.) Make sure that all bash scripts in NLME-Engine unzipped folder as well as TDL5 and initpml have flag ‘X’ (executable).
3.) Install OpenMPI to execute models using parallelization (optional):
# paste the code into Linux console, not R
# list available openmpi RPMs
yum list \*openmpi\*
# install default version
sudo yum install openmpi-devel.x86_64
4.) Initialize licensing system using the executable initpml in already unpacked InstallDirNLME:
# paste the code into Linux console, not R
sudo ./initpml
1.) After receiving your license key from Certara via email, open up
your text editor (e.g., Notepad) and paste the license key to the first
line of the empty .txt
file.
2.) Save this file inside installed
C:/Program Files/Certara/NLME_Engine
with the name
lservrc
. Linux users should add license file inside the
folder where NLME-Engine-23.1.1.zip
was extracted to.
3.) It is possible to have different storage for the license file, but in such case R session should have an access to PhoenixLicenseFile environment variable, see here for details.
4.) If Phoenix NLME is installed and licensed, full RsNLME functionality is available for the user on the current host, no additional license files required.
5.) If the floating license is used, then License server should be
installed within NLME Engine (Full installation). The manual explaining
the server start and access to that server could be found here.
NLME Engine recognizes the license server if the network
address is found in PhoenixLicenseServer
env.variable.
Please note that R >= 4.0.0
is required (see
above).
Define Certara_Packages
object in R as a character
vector of the required package names:
Certara_Packages <- c("Certara.RsNLME",
"Certara.NLME8",
"Certara.RsNLME.ModelBuilder",
"Certara.RsNLME.ModelExecutor",
"Certara.Xpose.NLME",
"Certara.ModelResults",
"Certara.VPCResults")
install.packages(Certara_Packages,
repos = c("https://certara.jfrog.io/artifactory/certara-cran-release-public/",
"https://cloud.r-project.org"), method = "libcurl")
Certara.RsNLME
is officially supported on CentOS8/RHEL8.
The package requires the xml2
and ssh
dependencies. If the xml2
package is not already installed
on your Linux distribution, users may first have to execute the
following command from the terminal in order to install the additional
Linux system library libxml2-devel
.
sudo yum install libxml2-devel
If the ssh
package is not already installed on your
Linux distribution, users may first have to execute the following
command from the terminal in order to install the additional Linux
system library libssh-devel
.
sudo yum install epel-release
sudo yum install libssh-devel
Then proceed to install Certara_Packages
from R.
install.packages(Certara_Packages,
repos = c("https://certara.jfrog.io/artifactory/certara-cran-release-public/",
"https://cloud.r-project.org"))
Important for Linux runs: please don’t forget to
initialize the license system, see Installation of NLME
Engine
.
To verify the successful installation of R packages and NLME-Engine, you may execute the following test code to build and execute an RsNLME model.
1.) Build Model
library(Certara.RsNLME)
model <- pkmodel(parameterization = "Clearance",
absorption = "Intravenous",
numCompartments = 2,
data = pkData,
ID = "Subject",
Time = "Act_Time",
A1 = "Amount",
CObs = "Conc")
print(model)
##
## Model Overview
## -------------------------------------------
## Model Name : Model_23_01_29_13_57
## Working Directory : C:/Users/jcraig/Documents/GitHub/R-RsNLME/vignettes/Model_23_01_29_13_57
## Is population : TRUE
## Model Type : PK
##
## PK
## -------------------------------------------
## Parameterization : Clearance
## Absorption : Intravenous
## Num Compartments : 2
## Dose Tlag? : FALSE
## Elimination Comp ?: FALSE
## Infusion Allowed ?: FALSE
## Sequential : FALSE
## Freeze PK : FALSE
##
## PML
## -------------------------------------------
## test(){
## cfMicro(A1,Cl/V, Cl2/V, Cl2/V2)
## dosepoint(A1)
## C = A1 / V
## error(CEps=0.1)
## observe(CObs=C * ( 1 + CEps))
## stparm(V = tvV * exp(nV))
## stparm(Cl = tvCl * exp(nCl))
## stparm(V2 = tvV2 * exp(nV2))
## stparm(Cl2 = tvCl2 * exp(nCl2))
## fixef( tvV = c(,1,))
## fixef( tvCl = c(,1,))
## fixef( tvV2 = c(,1,))
## fixef( tvCl2 = c(,1,))
## ranef(diag(nV,nCl,nV2,nCl2) = c(1,1,1,1))
## }
##
## Structural Parameters
## -------------------------------------------
## V Cl V2 Cl2
## -------------------------------------------
## Observations:
## Observation Name : CObs
## Effect Name : C
## Epsilon Name : CEps
## Epsilon Type : Multiplicative
## Epsilon frozen : FALSE
## is BQL : FALSE
## -------------------------------------------
## Column Mappings
## -------------------------------------------
## Model Variable Name : Data Column name
## id : Subject
## time : Act_Time
## A1 : Amount
## CObs : Conc
2.) Fit Model
fitmodelResults <- fitmodel(model)
print(fitmodelResults$Overall)
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub
## 1: WorkFlow 1 -632.7953 1265.591 1283.591 1308.057 9 112 16
## EpsShrinkage Condition
## 1: 0.17355 4.67685