Nonmem License Cost

Posted on by

Population PK/PD Analysis – SAS® with R and NONMEM. The main disadvantage of SAS is the hefty license cost and for a smaller organization can be prohibitive. Several software tools are available that facilitate the use of the NONMEM software and extend its functionality. This tutorial shows how three commonly used and freely available tools, Pirana, PsN, and Xpose, form a tightly integrated workbench for modeling and simulation with NONMEM.

  1. Nonmem License Cost List
  2. Nonmem License Cost Of Living
  3. Nonmem License Cost Calculator
  4. Nonmem License Cost Of Texas
CPT Pharmacometrics Syst Pharmacol. 2013 Jun; 2(6): e50.
Published online 2013 Jun 26. doi: 10.1038/psp.2013.24
PMID: 23836189
This article has been cited by other articles in PMC.

Associated Data

Supplementary Materials
psp201324x1.doc (103K)

Abstract

Several software tools are available that facilitate the use of the NONMEM software and extend its functionality. This tutorial shows how three commonly used and freely available tools, Pirana, PsN, and Xpose, form a tightly integrated workbench for modeling and simulation with NONMEM. During the tutorial, we provide some guidance on what diagnostics we consider most useful in pharmacokinetic model development and how to construct them using these tools.

Background

Started in the early 1980s with the development of the NONMEM (acronym based on “NON-linear Mixed-Effects Modeling”) software, “population analysis” has proven to be extremely useful within pharmacometrics, both in the development of new drugs and the improvement of therapy with approved drugs. Development of the NONMEM software continues, and although over time several other modeling software tools have become available, NONMEM is still regarded as the gold standard within the pharmacometric community: a recent survey identified NONMEM (together with PsN) as the most frequently used software tool by far. Modeling and simulation (M&S) in clinical pharmacology, and the use of NONMEM in particular, however, has a steep learning curve for most starting researchers. This is partially because of the fact that NONMEM is invoked from the command line, and models are implemented using a Fortran-derived syntax (NM-TRAN). In addition, at its core, NONMEM performs only model estimation (or simulation), and the implementation of essential diagnostic tools such as bootstrap analyses and the creation of goodness-of-fit plots are left to the modeler. Therefore, alongside the development of NONMEM, many third-party tools have been developed that facilitate the use of NONMEM by providing tools for organization and automation. In this tutorial, we will demonstrate the use of some of the most widely used auxiliary software tools: PsN, Xpose, and Pirana. All three tools are released under an open-source license and are freely available (except for the commercial use of Pirana, for which a commercial license is required). Separately, each tool offers useful functionalities, but there is a synergistic benefit as well when used together.

The aim of this tutorial is to show how these three tools provide a comprehensive workbench for M&S. This will be performed by showing examples of the most often encountered steps in pharmacokinetic (PK) model development, i.e., a covariate modeling procedure and model evaluation using residual- and simulation-based diagnostics. However, the aim of the tutorial is not to provide guidance on how to perform a population PK analysis but strictly on these software tools. A detailed overview of important aspects in population PK analyses has recently been presented in this journal, and we refer the reader to that article for guidance. The current tutorial is structured in three parts: first, a brief introduction to these software tools is given explaining their basic purpose. In the main part of the tutorial, we show how a typical PK model-building analysis is performed with these tools and NONMEM. At the end of the tutorial, several interesting additional features are highlighted for each specific tool. We will assume the reader is already somewhat familiar with NONMEM, although we have made efforts to present and discuss the tools in a general manner wherever possible. All of the presented models, data sets, output, and diagnostic plots are available in the Supplementary Table S1 online.

Software

In this tutorial, we will use NONMEM 7.2, Pirana 2.7.0, PsN 3.5.3, and Xpose 4.3.5. It is likely that the future versions will behave similarly, but in earlier versions, not all functions presented here may be available. We will show screenshots taken from Windows, but all programs discussed here function similarly on all major operating systems.

NONMEM

NONMEM9 is a modeling software that allows the user to estimate parameters in mixed-effects models (“population approach”) on the basis of maximum-likelihood or Bayesian techniques that use either gradient or stochastic estimation methods. NONMEM translates model code written in a unique Fortran-based syntax (NM-TRAN) into pure Fortran code, which is then compiled and executed. NONMEM is currently developed by ICON Development Solutions (http://www.iconplc.com/technology/products/nonmem/) under a proprietary software license.

PsN

PsN is a combination of tools for performing advanced M&S with NONMEM. It allows the implementation of bootstraps, visual predictive checks (VPCs), and many other useful functionalities. PsN is written in Perl (and needs Perl installed, freely available for all major operating systems) and is operated from the command line. Development started in 2000, and updates have been released with regular intervals.

Xpose

Xpose is a tool for plotting and analyzing NONMEM output, developed as a module for the R software (http://cran.r-project.org/, open-source, S-based statistical software). The tools in Xpose can be used from the R command line or from a text-based menu system in R. Xpose was first released in 1998 and was initially developed for S-Plus. The current version (main version number 4) is, however, released exclusively for R and builds on the lattice module for plotting. Both PsN and Xpose are developed at the Uppsala University and are released under an open-source license (GNU v2).

Pirana

Pirana is a graphical user interface for NONMEM, PsN, and Xpose/R. It has functionality for model management, model execution, output generation, interpretation of results, and includes many other tools. Development of Pirana started in 2007 at the Netherlands Cancer Institute/Slotervaart Hospital (Amsterdam, The Netherlands) and is currently continued by Pirana Software & Consulting BV (http://www.pirana-software.com). Pirana is released under an open-source license (Creative Commons) for academic users as well as a commercial license.

Tutorial

In this tutorial, file and folder names are shown in italic, Pirana actions are shown red-italic, while commands, arguments, NONMEM syntax, and screen output are shown in fixed-width font. We will step through an example model-building exercise, with the intent of showing how to create, manage, and evaluate PK models for a given data set. The PK data set used in this tutorial (pktab1) is available in the Supplementary Table S1 online and contains plasma concentration data obtained from a simulated clinical trial of a novel i.v. drug, performed in 50 patients, measured at 8 time points. All model files that are mentioned in this article are also available online and can be used as reference. Make sure that all software is installed correctly, and NONMEM runs can be started from both PsN and Pirana (visit the respective websites for installation instructions) and that the Xpose4 package is installed in R. Create a folder for this analysis somewhere on your hard-drive, and put pktab1 in this folder. Browse to this folder in Pirana and save it as the project “TutorialPSP” (button 4 in Figure 1). As a starting point for NONMEM models, it is often easiest to use the PK model wizard in Pirana or start from one of the models available in the model library. Start the wizard dialog window in Pirana (Tools → Wizards), choose the PK model wizard, and explore the options. However, for this tutorial, we have already provided the first model (run1.mod): copy the model run1.mod from the Supplementary Table S1 online to the folder you created. This model should now be visible in the Pirana main model list when you direct Pirana to the right folder (if not, refresh Pirana; button 5 in Figure 1). If you run from a model created by the wizard, make sure that the columns in the data set match up exactly with the records specified in the $INPUT record in the model file. For the provided run1.mod, this has already been done.

Pirana main window.

First runs

If we would invoke the native NONMEM run script, we would run, e.g., nmfe72 run1.mod run1.lst, but Pirana automates this in a dialog window: (select model → right click → NONMEM → nmfe). Several options are available to configure how and where (local or on a cluster) to run the model, or whether to submit it to a job scheduler. If you choose to run your models in Pirana through nmfe, you need to configure a NONMEM installation in Pirana (Settings → NONMEM). Select the quick-find option to scan your hard-drive for common installation locations for NONMEM. If NONMEM is not found there yet, specify the location yourself.

In this tutorial, we will, however, not use nmfe, but only PsN to run models. There are multiple benefits of using PsN's execute over the regular nmfe command, the main ones being that models are run in separate folders, runs can be restarted automatically upon crashes and unsuccessful minimizations, and initial estimates can be tweaked. Select the model and right click → PsN → execute. Pirana will show a similar dialog window as shown for nmfe, but now the command line for PsN's execute tool is shown (Figure 2). For our first run, we will use the default command: execute run1.mod. After clicking the run button, if PsN and Pirana are set up correctly, a console window will open with the following message:

PsN dialog window.

Starting 1 NONMEM executions. 1 in parallel.

S:1 . ,

which indicates that one model estimation has been started. The actual NONMEM process will run in a subfolder created by PsN. By default, this will be /modelfit_dir1, but a custom folder name can be specified using the -dir argument. If the argument -model_dir_name is specified, PsN will automatically choose an informative folder name, in this case /run1.mod.dir.1. Check that inside the folder created by PsN, a subfolder is created in which the NONMEM process actually runs (/NM_run1). In Pirana, PsN folders are hidden by default, as they may quickly clutter the model overview. To unhide them again, select either “PsN folders” or “All folders” from the folder selector (button 7 in Figure 1). Many additional arguments can be supplied to PsN commands to customize how PsN runs the NONMEM model, e.g.:

execute run1.mod -dir=test1 –retries=3 -parafile=mpi6.pnm –nm_version=nm72,

which will run model run1.mod in the folder /test1. PsN is also instructed now to run using NONMEM version 7.2, parallelized using MPI (specified in configuration file mpi6.pnm) and to retry three times if the model does not converge in the initial run, each time changing the initial estimates of the parameters. A list of all available arguments including help information is available from the PsN dialog window in Pirana (Figure 2), which is similar to using the –h and –help arguments on the command line. In the PsN configuration file (psn.conf), a list of default arguments can be supplied as well, so commonly used arguments do not have to be repeated on the command line.

Results evaluation

After estimation has been completed, refresh the Pirana main overview again. Basic results are now shown for the run, such as the objective function value (OFV), whether minimization was successful (S), and whether the covariance step was successful (C). If the run was successful, PsN will automatically copy back the results file (run1.lst) and the produced output tables (sdtab1, patab1) to the parent folder, which are then parsed by Pirana upon refreshing. Select the model again, and now select the Estimates tab from the right section of the Pirana window (11 in Figure 1). The right section will then show the parameter estimates for this run. A more detailed overview that will, e.g., show full random effect blocks can be opened from here. Create a run summary in Word format (alternatives are HTML, plain text, or LaTeX), from the menu → Results → Run Reports → Word.

Diagnostic plots are a main decision tool in pharmacometric model development, in which a distinction can be made between residual-based diagnostics (goodness-of-fit plots based on residuals plotted vs. time or model predictions) and simulation-based diagnostics (e.g., VPC). Obviously, no strict rule should be applied here, but in our experience, residual-based diagnostics are more useful in the first stages of model development, whereas simulation-based diagnostics are more useful in the latter stages of model development. Depending on what part of the model is diagnosed, different diagnostic plots will be useful, and most likely, no single plot will suffice to evaluate model fit. Suggestions for diagnostic plots for specific model parts are shown in Table 1. Note that this list is not exhaustive, and in addition, more specific plots may be required for appropriate diagnosis.

Table 1

Suggested diagnostic plots for PK model development

For the current analysis, we will first have a look at some basic, residual-based goodness-of-fit plots. A general model diagnostic is the plot of weighted residuals vs. time, or vs. model predictions. For models run with the conditional estimation method (FOCE), it is most appropriate to use conditional weighted residuals (CWRES). Use the Xpose graphical user interface (GUI) within Pirana to create these plots (Figure 3): select model → right click → Xpose → Xpose GUI. Add the plot cwres.vs.pred and cwres.vs.idv to the list of plots, and possibly some additional goodness-of-fit plots (a list of useful Xpose plots is given in Table 2). In these plots, you should observe an obvious pattern in the residuals. It may not be obvious immediately what is the cause of the misspecification, but a look at the individual plots (ind.plots) probably gives more insight: the model seems to be missing the bi-phasic nature of the observed data. Therefore, in the next step, we will add distribution of drug into a peripheral compartment to our PK model, but first, we will briefly discuss how to keep track of model development.

Xpose graphical user interface in Pirana.

Table 2

Besides the Xpose GUI, there are several alternative ways of creating diagnostic plots from Pirana:

  • DataInspector: a quick and flexible method for creating diagnostic plots based on NONMEM output, or checking input data sets. Select the DataInspector for run1.mod (right click → Model → Open DataInspector). Pirana will ask you now which input- or output file to open, choose the file sdtab1. In the DataInspector window, the variables on the x and y axes can be easily changed to any variable in the data set, and filters can be applied on patient ID, or on any other variable. From this window, R-code can be generated that will recreate the same graph in R.

  • R-script library: Pirana comes bundled with a library of diagnostic R scripts, which can be run automatically from Pirana. Select a model and select one of the R scripts from the Scripts Tab, e.g., Basic GOF → DV vs IPRED, and then select Run script from the buttons above the list. The requested plot will be created and opened in a pdf document. Created plots will be listed in the “Reports” tab (10 in Figure 1). The standard scripts bundled with Pirana can be extended and customized easily, but that is beyond the scope of this tutorial. Please refer to the manual and default scripts for guidance.

  • Xpose menu system in R: The Xpose menu system can be started from Pirana (right click → Xpose → Start Xpose menu in R), or manually from an R session by invoking:

library(xpose4)

xpose4()

Xpose will then ask for the run number, which is used to determine which tables to import. Note that to use Xpose, NONMEM needs to be instructed to output tables that adhere to a specific naming and structure (Supplementary Table S1 online, or the Xpose Web site). If you did not use the Pirana model wizard to create the tables, add them manually in the NONMEM model file, using:

$TABLE ID TIME IPRED IWRES EVID MDV NOPRINT ONEHEADER FILE=sdtab1

From the Xpose menu system, goodness-of-fit plots can be created, e.g., browse to “4: Goodness-of-fit plots” and then “2: Basic goodness-of-fit plots.”

Model management in Pirana

In M&S projects in both academia and industry, it is essential to keep track of the model development history. Pirana and PsN offer a tool to aid the modeler with this through the run record. The run record entails a standardized way of keeping track of model meta-information such as the “parent” model, a description, and/or a label for the model, and other information about the model components. We consider it good modeling practice to create a new model file for every change that is made to a model.

Duplicate the first model in Pirana (right click on run1.mod actions → File actions → duplicate). In the dialog that will open up, run2.mod is suggested as new model file name, and we can select which model is the reference model for this model (run1.mod), and optionally update the initial estimates with the parameter estimates from the reference model. The model description and other meta-information are stored in the model file itself using the run record syntax (also see http://psn.sourceforge.net/pdfdocs/runrecord_userguide.pdf). Pirana can show the main model overview as a list or as a tree (button 6 in Figure 1) and can export a copy of the run record to various formats including comma separated (csv) files, HTML files, and Word documents (Results → Run records), or create an interactive visualization of the model development tree or “visual run record”11 such as that shown in Figure 4 (Results → Run records → Visual run record).

Visual run record example. Green indicates a significant improvement in fit, red indicates a worsening, yellow indicates approximate identical fit (ΔOFV < ±3.84), and gray indicates a noncomparable child model (e.g., change in dataset). The blue line is the path to the final model, whereas a dashed line indicates a nonnested model. OFV, objective function value.

After duplication, the model run2.mod will be shown in the model overview and opened in the editor, where we will now add a peripheral compartment to the model error model: change $SUBROUTINE to use ADVAN3 and TRANS4, change the parameter V into V1, and add to $PK:

Q = THETA(3)

V2 = THETA(4)

Of course, initial estimates for the intercompartmental distribution (Q) and peripheral compartment (V2) have to be specified as well in $THETA. For now, we chose to run this model without IIV on these parameters. Run this model using execute, evaluate the drop in objective function, and compare the diagnostic plots for run2 to those made for run1. You should encounter a considerable drop in the OFV and find that the diagnostic residual plots show much improved model fit.

Furthermore, we will diagnose the residual error model, for which an important diagnostic plot is that of absolute individual weighted residuals ( IWRES ) vs. individual predictions (IPRED). For a true model, the distribution of absolute residuals should be similar over the whole range of the x-axis variable. If a homoscedastic error structure (additive error) was implemented in run1.mod and run2.mod, the plot will show larger residuals at higher individual predictions. This should therefore lead you to conclude that a heteroscedastic (combined proportional and additive) error model should provide a better description of the data. Therefore, create a new model (run3.mod) based on run2.mod and implement a combined error model using e.g.:

Y = IPRED * (1+EPS(1)) + EPS(2)

W = SQRT(IPRED**2*SIGMA(1,1)**2 + SIGMA(2,2)**2)

IWRES = (DV-IPRED)/W

It must be noted that the plot mentioned above is only informative at low ε-shrinkage (as a rule of thumb, at ε-shrinkage greater than ~5%, this plot loses informativeness). In cases of higher shrinkage, plots of CWRES vs. individual predictions (IPRED), or IWRESnpde13 vs. IPRED are more informative. The diagnostic plots as well as the significant drop in OFV indicate that the combined error model provides better fit.

Covariate model

The data set pktab1 contains three continuous covariates: weight (WT), creatinine clearance (CRCL), AGE, and two binary covariates: SEX and study center (CENT). Because the number of covariates is low (5), one might choose to test these covariates manually. However, in the next step of this tutorial, we will perform stepwise covariate modeling (scm) in PsN, to demonstrate this automated method. In the first phase of the scm, covariates are added to the base model in a stepwise manner based on statistical significance (decrease in OFV). In a second “backward elimination” phase, covariates are then removed from the final model obtained in the first phase, if removal of the covariate does not result in significantly worse fit. The backward step is typically done at a higher significance level. Like all PsN tools, the scm can be run from the command line or from Pirana, in a similar way as done before for execute. However, the scm tool requires that a configuration file is created first. Several examples of configuration files are available on the PsN Web site, but here we will create one using the wizard in Pirana (Tools → Wizards → scm configuration file). Create a configuration file, with the filename psp.scm, in which all covariates are tested on both CL and V1, at a significance level of 0.1 (forward step) and 0.05 (backward step) and restrict the analysis to linear relationships (set the relationships argument to “1,2”). Check that the correct covariates are included; the ones shown in the wizard are only placeholders. If you are not sure on the correct syntax of the scm file, please have a look at the provided annotated configuration file (psp.scm in the Supplementary Data online). Before starting the scm, duplicate run3.mod to run4.mod, and remove any $TABLE records that are present. Start the scm from the PsN dialog window using this command:

Nonmem

scm psp.scm –model=run4.mod

After the scm has completed, PsN will compile an output file called scmlog.txt in the scm folder. Open this file and interpret the information, it holds the results for all tests performed in the scm and shows how the final covariate model was constructed. You should find that four covariate relationships are significant: CRCL on CL, WT on CL, WT on V, and SEX on V. This will be our “final model” from the covariate model-building step. If you did not find these results, compare your results with those provided in the Supplementary Data online.

More elaborate covariate model-building techniques based on the scm are available in PsN as well, such as the cross-validated scm (xv_scm),14 and the bootstrap of the scm (boot_scm).15 These tools provide more details on the predictive ability of the model, and on selection bias and expected covariate model size, respectively. They can also be run on linearized versions of the model, to reduce the computational workload. Other covariate modeling tools that are available in PsN include the lasso and the fixed random effects model (FREM),18 whereas in Xpose, the gam and bootstrap of the gam (bootgam) are implemented. All of these methods have certain advantages and drawbacks, which are however beyond the scope of this article.

Final model

If the scm completed successfully, you will find a folder called final_models inside the scm folder created by PsN. Inside that folder, locate the final model with included covariate relations and copy that to the main model folder, renaming it to run5.mod. We will use this model to perform some more elaborate diagnostic evaluation, i.e., we will get bootstrap estimates for our parameters and create a VPC. Therefore, first open the PsN bootstrap dialog window (Right click → PsN → Model diagnostic → bootstrap). A required argument to the bootstrap command is the –samples argument, which specifies how many bootstrap samples should be drawn. More samples will make the bootstrap estimates and percentile estimates more precise; however, at the expense of increased computation times. The recommended number of samples for an analysis will depend on what statistic is desired by the modeler. For obtaining bootstrap means of the parameter estimates, 100 samples may be enough, but to obtain accurate 5th and 95th percentiles, 1,000 or more are required to obtain precise estimates. After the bootstrap is finished (on a single core, a bootstrap of 200 samples may easily take an hour for this model), the results from the bootstrap are available in the bootstrap folder, in the files raw_results_run5.csv and bootstrap_results.csv. Open these files and interpret the output: are the parameters estimated with adequate precision? In Pirana, select the bootstrap folder created by PsN and run the R script to create plots of parameter distributions (Scripts tab → PsN → Bootstrap results), which facilitates evaluation and interpretation of these bootstrap results.

Earlier in this tutorial, we presented how basic goodness-of-fit plots can be created in Pirana and Xpose. Now, we will use all three tools to create a VPC of the final model (run5.mod). A VPC is an internal validation tool, i.e., it shows how well the model predicts the data on which the model was conditioned. It visualizes the median model prediction, the variability between patients and within patients (5th and 95th percentiles), and the uncertainty around the predicted percentiles.19 Before creating a VPC, we would like to stress a few points. First, in VPCs, it is important to show the uncertainty around the model-predicted percentiles, instead of presenting only lines indicating the point estimates of the percentiles. Signs of model improvement are when the confidence areas of the simulated percentiles encompass more of the observation percentiles, but also when the confidence intervals themselves are shrinking (while still encompassing the observation percentiles). Furthermore, because the VPC shows summary statistics (percentiles) of observations and predictions for binned data, the binning method is an important consideration. To avoid inflation of the uncertainty around the summary statistics, each bin should contain an adequate amount of observations. A quick rule of thumb is that there should not be more bins than the number of observations per individual. PsN currently incorporates several binning approaches: manual bin specification (-bin_array=x,y,z,etc), binning into an equal number of data points per bin (-bin_by_count=1 –no_of_bins=#), or spacing the bins equally over the x-axis (-bin_by_count=0, -no_of_bins=#). Of note, binning across a large variability in dose and/or influential covariates can diminish the diagnostic value of a VPC. One approach to overcome this is to stratify the VPC by the covariate, but this is not always possible, e.g., due to limited data per stratum. Moreover, when data arises from studies with adaptive designs (e.g., dose adjustments), VPCs are misleading unless the adaptation protocol is included in the model. The prediction-corrected VPC offers a solution to these problems while retaining the visual interpretation of the traditional VPC. Prediction-corrected VPCs can be constructed by adding the argument –pred_corr to the PsN VPC command.

VPCs can be made in Pirana using the PsN dialog window (right click → PsN → model evaluation → VPC), or from the command line. As discussed above, essential arguments to pass to the VPC are the number of samples and the binning method. Increasing the number of samples will increase the accuracy of the summary statistics for the simulation and their uncertainty interval (but it will not decrease the uncertainty interval itself). Start the VPC tool using

vpc –samples=500 –no_of_bins=8 –bin_by_count=1 run5.mod /movie-ringtones-free.html.

The first of the two NONMEM runs that are started will only output a table with the necessary (observation) data for the VPC, it does not perform parameter estimation. The other model runs repeated Monte Carlo simulations of the model, using the same data set design as the original. After the two NONMEM runs have finished, PsN will process the output, bin the simulated and observed data, calculate the percentiles and confidence intervals for each bin, and export a csv file with the summary statistics. This csv-file can then be processed by Xpose and turned into a VPC-plot, which can be automated from Pirana using the Xpose GUI as described before, or using the R scripts library. Both the approaches will create and open a pdf file with the VPC (see example in Figure 5). Using the latter approach, this is done as follows: select the VPC-folder created by PsN, and open the Scripts tab on the right. In the list of R scripts, choose Xpose → VPC → Basic_log_y.R. A pdf file with the VPC will be generated and opened from Pirana. As an exercise, try to create the same plot using the Xpose GUI in Pirana as well: select the model in the main overview and Right click → Xpose → Xpose GUI.

Visual predictive check. A visual predictive check for run3.mod. The solid line connects the observed median values per bin, whereas the dashed lines represent the observed 5th and 95th percentile of the observations. Blue areas indicate the 95% CIs of the 5th and 95th percentile of the predicted (simulated) value, whereas the red area indicates the CI of the median. The logarithmic y-axis makes it easier to judge correspondence between observed and predicted, especially in the terminal part of the plot. For this problem, it would be advisable to make a separate plot for the initial part of the VPC (0–4 h), because it is difficult to see the accordance between observed and predicted in that area. The VPC would also be clearer in the initial part if it would have been plotted without the observations (observed percentiles only).

Because only limited space is available for this tutorial, we will not demonstrate other diagnostics. We will however create a run record of the model development: in the menu bar, click Results → Run records → Detailed run record (csv). This will create and open a csv file containing run numbers, descriptions, other meta-information, and run results. If the file does not open automatically, please look it up in the “Files” tab on the right and double click it. As a final step in our PK model development, select the final model again and bundle that model file, the associated result files and output files and the VPC folder into a zip file (Right click → File actions→ Compress to zip-file). Moreover, create a bundled report of the goodness-of-fit plots for the final model (in the Reports tab, select the desired pdf's and click Bundle into… → <output format>).

Additional features

For all three software tools presented here, we have only scratched the surface of possibilities. The reader is encouraged to explore more advanced functionality using the documentation available on the respective websites. We will highlight a few examples of more advanced features for the three programs below.

PsN. The simulation and re-estimation (sse) tool can be used to evaluate trial designs, e.g., to evaluate whether model parameters can be estimated with adequate precision under the intended or alternative experimental designs or with alternative models. It is also useful for evaluating fundamental modeling aspects, e.g., to evaluate how model diagnostics perform under given designs. Another interesting tool for design evaluation, specifically for the calculation of study power and number of study subjects required, is Monte Carlo Mapped Power (mcmp). In this tool, which is also based on simulation and re-estimation, the individual OFVs calculated in NONMEM are exploited to evaluate designs in a more rapid way than using sse. Case deletion diagnostics (cdd) is a tool that can be used in the final stages of model development to investigate whether model fit depends more heavily on particular strata of the data set. The most important PsN functions are listed in Table 3.

Table 3

Xpose. In this tutorial, we showed how to create goodness-of-fit plots from the Xpose menu system, and from the Xpose interface in Pirana (VPC). However, the most efficient way to use Xpose, especially when doing repetitive jobs, is to use scripts to create the desired goodness-of-fit plots. A list of useful Xpose functions is given in Table 2, whereas a more complete overview of functions and example scripts (“bestiarium”) is available on the Xpose website. The default plots in Xpose can be extended and modified in various ways. First, most Xpose functions take arguments that alter the implementation of the plot. The looks of the plots can also be changed by directly passing lattice arguments to the Xpose function. Second, the input variables can be altered easily to allow creation of nondefault plots. For example, to create a plot of a covariate METAB vs. IDV instead of DV vs. IDV, we can “trick” Xpose into using METAB as DV while maintaining the plot characteristics:

> change.xvardef(xpdb, “dv”) <- c(“METAB”)

> xplot <- dv.vs.idv(xpdb)

> print(xplot)

Finally, since Xpose is an open-source R module, it is possible to modify the Xpose functions directly, if further modifications are required.

Pirana. A model translator is included that can translate any NONMEM model (written in an NM-TRAN ADVAN subroutine) to differential equation code for R (using deSolve library), Berkeley Madonna (software dedicated to ODE simulations), or Matlab/PopED. Note that many functions in Pirana can be extended and customized by the user, such as the R-scripts library and the wizards. Pirana can also be used for modeling on remote clusters (through ssh-connections) and has native support for SGE, Torque, and Condor job schedulers.

Conclusion

In this tutorial, we presented a modeling workbench that incorporates three tools, which in our view make M&S with NONMEM more powerful, more efficient, and easier to perform. It is our intention to implement all new modeling techniques and diagnostics developed within our group into PsN, Xpose, and/or Pirana, so new versions are expected to be released on a regular basis.

Conflict of interest

R.J.K. is owner of Pirana Software & Consulting BV, which provides commercial licensing of Pirana. The other authors declared no conflict of interest.

Acknowledgments

The researchers in the Pharmacometrics Research Group are acknowledged for their input on the use of diagnostics in model development.

Supplementary Material

Supplementary Table S1

References

  • Sheiner L.B., Beal S.L. Evaluation of methods for estimating population pharmacokinetics parameters. I. Michaelis-Menten model: routine clinical pharmacokinetic data. J. Pharmacokinet. Biopharm86553–571.1980). <http://www.ncbi.nlm.nih.gov/pubmed/7229908>. [PubMed] [Google Scholar]
  • Stone J.A., et al. Model-based drug development survey finds pharmacometrics impacting decision making in the pharmaceutical industry. J. Clin. Pharmacol50suppl. 920S–30S.2010). <http://www.ncbi.nlm.nih.gov/pubmed/20881214>. [PubMed] [Google Scholar]
  • Zandvliet A.S., Schellens J.H.M., Beijnen J.H., Huitema A.D.R. Population pharmacokinetics and pharmacodynamics for treatment optimization in clinical oncology. Clin. Pharmacokinet478487–513.2008). <http://www.ncbi.nlm.nih.gov/pubmed/18611060>. [PubMed] [Google Scholar]
  • Lindbom L., Pihlgren P., Jonsson E.N. PsN-Toolkit--a collection of computer intensive statistical methods for non-linear mixed effect modeling using NONMEM. Comput. Methods. Programs. Biomed793241–257.2005). <http://www.ncbi.nlm.nih.gov/pubmed/16023764>. [PubMed] [Google Scholar]
  • Vlasakakis G., et al. CPT:PSP. in press; White paper: landscape on technical and conceptual requirements and competence framework in drug/disease modeling & simulation. [PMC free article] [PubMed] [Google Scholar]
  • Jonsson E.N., Karlsson M.O. Xpose--an S-PLUS based population pharmacokinetic/pharmacodynamic model building aid for NONMEM. Comput. Methods. Programs. Biomed58151–64.1999). <http://www.ncbi.nlm.nih.gov/pubmed/10195646>. [PubMed] [Google Scholar]
  • Keizer R.J., Van Benten M., Beijnen J.H., Schellens J.H.M., Huitema A.D.R. Piraña and PCluster: a modeling environment and cluster infrastructure for NONMEM. Comput. Methods. Programs. Biomed101172–79.2011). <http://www.ncbi.nlm.nih.gov/pubmed/20627442>. [PubMed] [Google Scholar]
  • Byon W., et al. CPT:PSP. in press; Establishing best practices and guidance in population modeling: an industry experience with a population pharmacokinetic analysis guidance. [PMC free article] [PubMed] [Google Scholar]
  • Beal S., Sheiner L.B., Boekmann A., Bauer R.J. NONMEM's User's Guides. ICON Development Solutions, Ellicott City, MD, USA, 2009; [Google Scholar]
  • Hooker A.C., Staatz C.E., Karlsson M.O. Conditional weighted residuals (CWRES): a model diagnostic for the FOCE method. Pharm. Res24122187–2197.2007). <http://www.ncbi.nlm.nih.gov/pubmed/17612795>. [PubMed] [Google Scholar]
  • Keizer R.J. Abstracts of the World Conference on Pharmacometrics. Seoul, South Korea; 2012. The visual run record: visualization of the model development history. [Google Scholar]
  • Karlsson M.O., Savic R.M. Diagnosing model diagnostics. Clin. Pharmacol. Ther82117–20.2007). <http://www.ncbi.nlm.nih.gov/pubmed/17571070>. [PubMed] [Google Scholar]
  • Keizer R.J., Harling K., Karlsson M.O. Extended NPDE diagnostics for the between-subject variability and residual error model.PAGE. Abstracts of the Annual Meeting of the Population Approach Group in Europe; 21Abstr 2538.2012 [Google Scholar]
  • Katsube T., Khandelwal A., Harling K., Hooker A.C., Karlsson M.O. Evaluation of stepwise covariate model building combined with cross-validation. PAGE. Abstracts of the Annual Meeting of the Population Approach Group in Europe Abstr 2111.2011). <http://www.page-meeting.org/?abstract=2111>.
  • Keizer R.J., Khandelwal A., Hooker A.C., Karlsson M.O. PAGE. Abstracts of the Annual Meeting of the Population Approach Group in Europe. Athens, Greece; 2011. The bootstrap of stepwise covariate modeling. p. Abstr 2161. [Google Scholar]
  • Khandelwal A., Harling K., Jonsson E.N., Hooker A.C., Karlsson M.O. A fast method for testing covariates in population PK/PD models. AAPS J133464–472.2011). <http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=3160160&tool=pmcentrez&rendertype=abstract>. [PMC free article] [PubMed] [Google Scholar]
  • Ribbing J., Nyberg J., Caster O., Jonsson E.N. The lasso--a novel method for predictive covariate model building in nonlinear mixed effects models. J. Pharmacokinet. Pharmacodyn344485–517.2007). <http://www.ncbi.nlm.nih.gov/pubmed/17516152>. [PubMed] [Google Scholar]
  • Karlsson M.O. A full model approach based on the covariance matrix of parameters and covariates.PAGE. Abstracts of the Annual Meeting of the Population Approach Group in Europe; 21Abstr 2455.2012 [Google Scholar]
  • A tutorial on visual predictive checks. <http://www.page-meeting.org/default.asp?abstract=1434>.Accessed 3 August 2012.
  • Bergstrand M., Hooker A.C., Wallin J.E., Karlsson M.O. Prediction-corrected visual predictive checks for diagnosing nonlinear mixed-effects models. AAPS J132143–151.2011). <http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=3085712&tool=pmcentrez&rendertype=abstract>. [PMC free article] [PubMed] [Google Scholar]
  • Vong C., Bergstrand M., Nyberg J., Karlsson M.O. Rapid sample size calculations for a defined likelihood ratio test-based power in mixed-effects models. AAPS J142176–186.2012). <http://www.ncbi.nlm.nih.gov/pubmed/22350626>. [PMC free article] [PubMed] [Google Scholar]
  • Nyberg J., Ueckert S., Strömberg E.A., Hennig S., Karlsson M.O., Hooker A.C. PopED: an extended, parallelized, nonlinear mixed effects models optimal design tool. Comput. Methods. Programs. Biomed1082789–805.2012). <http://www.ncbi.nlm.nih.gov/pubmed/22640817>. [PubMed] [Google Scholar]
Articles from CPT: Pharmacometrics & Systems Pharmacology are provided here courtesy of Wiley-Blackwell
CPT Pharmacometrics Syst Pharmacol. 2015 Sep; 4(9): 537–546.
Published online 2015 Aug 22. doi: 10.1002/psp4.12016
PMID: 26451333
This article has been corrected. See CPT Pharmacometrics Syst Pharmacol. 2018 April 27; 7(6): 413.

Abstract

Cloud computing allows pharmacometricians to access advanced hardware, network, and security resources available to expedite analysis and reporting. Cloud-based computing environments are available at a fraction of the time and effort when compared to traditional local datacenter-based solutions. This tutorial explains how to get started with building your own personal cloud computer cluster using Amazon Web Services (AWS), NONMEM, PsN, Grid Engine, and Sonic.

NON-linear mixed-effect modeling (NONMEM1) is a modeling tool that pharmacometricians use in population pharmacokinetics and pharmacodynamics analysis. NONMEM provides built-in models that can be utilized to solve numerous pharmacokinetic and pharmacodynamic-related problems. It was first programmed in FORTRAN2 77 code and requires a FORTRAN 90/95-compliant compiler to run. When dealing with NONMEM executions, it is important that sufficient hardware resources are available to guarantee that a job can be processed as efficiently as possible. Unfortunately, NONMEM runs can take a considerable amount of time, perhaps many hours or even days, depending on the speed of the computer and the size of the problem. This behavior is certainly not desired by pharmacometricians who must often execute analysis jobs quickly. Fortunately, newer versions of NONMEM support parallel analysis in which the computation workload is divided and distributed to multiple CPUs that execute the job in parallel. This ensures a shorter waiting period for a job to complete. The purpose of this tutorial was not to provide guidance on pharmacometric analysis using NONMEM and Perl-speaks-NONMEM (PsN), but mainly on the usage of AWS4, Grid Engine,5 and Sonic6 applications to support more efficient and faster analysis using NONMEM on a cloud-based compute cluster.

CLOUD COMPUTING BASICS

In this age of the internet, software applications that were traditionally hosted within an organization's own infrastructure are making the transition to what is known as “the cloud.” But what is the cloud? More generally, what is cloud computing? Cloud computing is an approach to computing that enables organizations to improve their business pipeline efficiently by utilizing shared infrastructures that are outside the scope of the organization. An organization can lease their specific computational resources from the shared infrastructure for the time that they need, ranging from an hour to a year or more. The rise of cloud computing can be attributed to the vast amount of complexity that an entity encounters in the traditional IT environment in which the entity uses assumptions to predict the number of resources it needs to host an application rather than a true accurate measure. Applications that are not hosted on the cloud have a direct impact on multiple areas within a company. From the business perspective, the company must pay some amount upfront to buy and maintain resources without truly knowing how much workload will be directed to the application. For example, simple data storage requires hardware and server maintenance. This can be expensive to the business if the amount of resources purchased is more than what is actually required. On the other hand, if the amount of resources owned by the company is not adequate to support the users who are trying to access the application, the company may face the problem of scalability. This can be problematic, because the goal of a company is to reduce costs and be as efficient as possible while giving more users access to its application. From the developer's perspective, deploying an application can also be very time consuming. The developer must go through the hassle of setting up the operating system, databases, backups, and any other resources manually that an application might require. This can be inefficient because it is wasteful to spend excess time deploying an application rather than developing it. Eventually the problems of scalability and deployment trickle down to the end user, which can jeopardize the business. The cloud tackles these problems head on. By utilizing the services that the cloud provides, an organization can ensure reliability in all of its applications.

The cloud offers many services to ensure reliability of an application. The most popular services of the cloud are that of software, platform, and infrastructure or storage. Software as a Service (SaaS), also known as “on-demand software,” is a software delivery method where applications are delivered over the internet rather than having the user manually install the software directly onto his or her machine. Some benefits of SaaS include cost savings, scalability, accessibility, upgradeability, and resilience. When compared to a traditional IT infrastructure, SaaS can produce cost savings when utilized because additional resources (hardware) are not needed to add new software. In terms of scalability, SaaS allows the user to adjust the monthly SaaS subscription as required when new users are added to the organization, eliminating the need for individual software licenses. SaaS also automates software updates whenever a new version is available. This feature removes updating responsibilities of the administrator in the in-house IT department. Another service that the cloud provides is Platform as a Service. Platform as a Service provides the environment and tools needed for creating new online applications. By utilizing Platform as a Service, a company can successfully reduce time and effort and minimize the technical maintenance needed to maintain applications. Finally, we have Infrastructure as a Service (IaaS), where equipment, such as hardware storage, servers, and network components, is owned and hosted by a service provider and is offered to consumers on-demand. In this model, IaaS provides compute power, memory, and storage to the consumer, and is typically priced on a per-hour basis that is dependent on the resource consumption. The consumer will only pay for what is used and the service provides all the capacity that a consumer will need. One of the greatest advantages of IaaS is that it offers a cloud-based data center that does not require the consumer to install new equipment or wait for the hardware procurement process. In turn, this yields to more resources being available that otherwise were not. Currently, there are many vendors in the market that offer IaaS. A few of the vendors that provide IaaS are AWS, Microsoft Azure,7 Google Cloud,8 and Rackspace Managed Cloud.9 There are advantages and limitations10 associated with each vendor. For example, AWS, although it offers a competitive pricing model, a rich set of services, and integrated monitoring tools, is a complex mixture of services and, thus, it can be difficult to project expenses as workflows become more complex. Similarly, although Azure offers reasonable prices for use, the minimal portal interface may not be appealing to high-end users. The Google Compute Engine is well suited for high performance computing but lacks ease of administration features. It often calls for additional patches and packages to create a cluster. Finally, the Rackspace Cloud also offers minimal costs and an easy-to-use control panel, but does not offer the messaging or specialized services that Amazon does. From a specifications perspective,11 Amazon EC2 offers 7.5 GB of RAM, while Google Compute Engine offers 3.75 GB, Azure offers 3.5 GB, and Rackspace offers 4 GB. Similarly, Amazon EC2 provides 2 × 420 GB of disk space, whereas Google offers 420 GB, Azure offers 30 GB, and Rackspace offers 160 GB. All in all, IaaS is offered from a number of vendors with varying specifications, but vendor choice depends on how much the consumer intends to use or spend. Typically, the price of the vendor application correlates positively with the number of available features; as the number of features increases, so does the price of the application.

AMAZON WEB SERVICES

AWS12 uses remote computing services via Amazon.com to construct a cloud computing platform. These services, because they are cloud based, replace IT infrastructure, lower time and effort for most companies, provide agility and instant elasticity that allow for minimizing and maximizing applications, is open and flexible in allowing users to choose what development platform or programming model is used, and maintain a secure network that ensures data privacy and security. AWS offers a number of services and powers thousands of businesses across the globe.

Configuring The Aws Command Line Interface

The AWS Command Line Interface is a unified tool used to manage AWS. With this, you may download, configure, and control multiple AWSs from the command line and automate them through scripts. Use the “AWS configure” command to setup the AWS installation. You may be asked to enter an AWS access key ID, AWS secret access key, default region name, and default output format. Refer to the AWS Command Line Interface User Guide13 to learn more about installing and configuring the tool. “Screen”14 is a terminal multiplexer shipped with Ubuntu instructions, which allows a user to access multiple separate terminal sessions inside a single window. This increases ease of use when working with SSH tunnels.

ELASTIC COMPUTING CLOUD

The Elastic Computing Cloud15 (EC2) provides scalable capacity in the AWS cloud and is designed to reduce the efforts in web-scale cloud computing by eliminating investments in hardware and servers. Virtual servers are used to configure security and networking and to manage storage. Users only pay for the capacity used, which aids in building effective applications at reasonable expenses.

Some of the EC2 features include:

  1. Virtual computing environments (instances);

  2. Preconfigured templates for instances;

  3. Various configurations of CPU, memory storage, and network capacity for instances;

  4. Secure login information for instances using key pairs;16

  5. Storage volumes for temporary data that is deleted when an instance is terminated;

  6. Persistent storage volumes for data using Amazon Elastic Block Store (Amazon EBS);

  7. Multiple physical locations for resources (Availability Zones);

  8. A Security Group that enables specification of protocols, ports, and source IP ranges that reach instances;

  9. Static IP addresses for dynamic cloud computing (Elastic IP addresses);

  10. Metadata (tags) used to create and assign Amazon EC2 resources;

  11. Virtual networks that can be created to isolate from the rest of the AWS cloud; these can be connected to your own network (virtual private clouds (VPCs)).17

Nonmem License Cost List

Virtual private cloud

The VPC allows the user to arrange a logically isolated section of the AWS Cloud in which the user can define and launch AWS resources in a virtual network. The user has complete control over the virtual networking environment, including the selection of IP address ranges, creation of subnets, and configuration of route tables and network gateways. The network configuration can easily be customized. For instance, the user can create a public-facing subnet for webservers who have access to the internet and for the backend systems, such as databases or application servers; users can create a private subnet without internet access. This enables the user to leverage multiple layers of security, including security groups and network access control lists to help control access to Amazon EC2 instances in each individual subnet. The user can also create a Hardware Virtual Private Network connection between the corporate datacenter and VPC.

Storage

Amazon Simple Storage Service18 (Amazon S3) provides developers and IT teams with secure, durable, and highly scalable object storage. Amazon S3 is user-friendly and has a simple web service interface in which the user can store and retrieve any amount of data from anywhere on the web. Amazon S3 is cost-effective because the user only pays for the storage that is actually used and there is no minimum fee or setup cost. In addition, Amazon S3 can be used either alone or in sync with other AWSs, including, but not limited to, Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Block Store (Amazon EBS), and Amazon Glacier.

EC2 Instances

Amazon EC2 Instances19 provide a wide selection of instance types comprised of varying combinations of CPU, memory, storage, and network capacity to fit different use cases, and offer flexibility to choose a necessary combination of resources for applications. EC2 instances provide features to help deploy, manage, and scale user applications. See Table11 for the list of select instance types available in EC2, which can provide advanced performance for pharmacometricians.

Table 1

ModelVirtual CPUsMemory (GB)
m3.xlarge415
m3.2xlarge830
c3.2xlarge815
c3.4xlarge1630
c3.8xlarge3260
r3.2xlarge861
r3.4xlarge16122
r3.8xlarge32244

Amazon Machine Image

An Amazon Machine Image20 (AMI) is a virtual tool used to create and launch an instance in the cloud. A number of instances or virtual servers can be launched as needed. The lifecycle of an AMI involves creating a template for the root volume for the instance, creating permissions to control the AWS accounts that can use the AMI to launch instances, and providing a block device mapping that specifies the volumes that need to be attached to the instance when launched. Instances can be customized and deregistered as needed.

Security Groups

A Security Group21 mimics a virtual firewall to control the traffic of a single or number of instances. One or more security groups may be used when an instance is launched. Rules can be added to each security group to control traffic between instances. These can be customized as each rule is added to all instances associated with the security group.

NONMEM

NONMEM, which stands for NON-linear Mixed-Effect Modeling, is a specialized software used to analyze pharmacokinetic and pharmacodynamics data. The software is a regression program that specializes in nonlinear systems22 by solving differential equations, and is used to solve pharmaceutical statistical problems within a subject or between subjects. The analysis allows pharmaceutical companies to determine necessary dosage strategies for products and helps in understanding how drugs interact with various individuals.23

Perl-speaks-NONMEM

PsN, which stands for Perl-speaks-NONMEM, is a collection of Perl modules and programs that assists in the development of nonlinear mixed effect models using NONMEM. Some of the functions include providing solutions to a parameter estimate extraction from output files, ensuring data file sub settings, and resampling. Further, it applies to advanced computer-intensive statistical methods. It allows for the implementation of bootstraps, visual predictive checks, and other useful functionalities. PsN also includes stand-alone tools for end-users and development libraries for method developers.

Grid Engine

Grid Engine is a cluster management software that manages access, reports usage, and enforces business policies for a compute cluster. It is typically used on a computer farm or high-performance computing cluster and is responsible for accepting, scheduling, dispatching, and managing the remote and distributed execution of large numbers of stand-alone, parallel, or interactive user jobs. The allocation of distributed resources, such as processors, memory, disk space, and software licenses is also managed through the Grid Engine. The software allows for more organized usage of the compute hosts. Although it is an integral part of a cloud cluster, deployment is complex, and is beyond the scope of this tutorial. Grid Engine allows users to run applications and administrators to implement resource configurations and policy configurations. Sonic automatically configures Grid Engine so that the user does not need to.

Sonic

Sonic Cloud Computing Platform is a web-based, enterprise-level, and secure software solution for the management of cloud based clusters. It is proprietary software of Rudraya Corporation and the cost associated depends on the size of implementation. This allows the user to ensure that the tool is maintained, supported, and validated. Sonic provides resizable compute capacity in the cloud. The cloud-based computing platform provides an economical, agile, and flexible environment for pharmacometrics, genomics, biostatistics, and translational medicine needs. Cloud computing involves a combination of software and computing delivered on demand as a service. There are options apart from Sonic that allow the user to set up a cloud cluster, including products and services by Metrum, Mango Solutions, Certara, and Cycle Computing, however, this tutorial focuses on Sonic as one example of a software tool that provides an easy-to-use environment for cloud computing. One of the key benefits of cloud computing is the opportunity to replace up-front capital infrastructure expenses with less time and effort, increasing efficiency and productivity for a business.

CREATING PERSONAL CLOUD COMPUTE CLUSTER

Create AWS account

To create a new AWS account, proceed to http://aws.amazon.com/and click the “sign up” button in the top-right corner. Select the “I am a new user” checkbox and enter your email address. Fill out the email address and password boxes and click to continue. You may get a confirmation on the next screen which says “you have not yet signed up for AWS: click here to sign up for AWS,” and do so (click the link). Fill out all of the residential information and continue.

The next section will ask you for basic credit card payment information, and after this you will be asked to verify your telephone number. This is an automated system, which works well, and we have never had an issue with it. After clicking “call me now,” you will get a telephone call in which a computer voice will state the pin number you are to enter on the page. In the final segment, you will be asked to choose what type of support plan you desire. Because you are most likely creating this account as a test for the first time, choosing a “basic support plan” is fine at this time. After this is complete, you will return back to the AWS website homepage and you will need to log in once more. This is accomplished by clicking the small dropdown menu next to the location where you clicked “Sign up” previously. Choose “my account” and log in with your email and password. You should be logged in successfully to the AWS control panel and be able to see the “services” menu in the extreme top left that you can expand (see Figure11).

AWS control panel.

Create head node and compute node instances or use existing

After setting up the AWS account initially, we can use it to create a standalone server for running NONMEM analysis or PsN execute and bootstrap jobs as described later. Go to the top-left corner and click the services dropdown menu and choose “EC2.” In the left-hand panel, choose instances. In the upper left, choose “Launch instance.” Select “Ubuntu 14.04” or whatever the most recent LTS release of Ubuntu is. Next, select an instance size. For a basic testing system, using a micro instance is fine, and you always have the option to change to a more powerful system later. At the time of writing, AWS micro instances only come in the form “t2.micro,” and “t2” instances cannot be launched into a standalone network (EC2-Classic). This means we will have to do a little work setting up a VPC to connect to an instance.

Click the “create new VPC” button to the right of the VPC selection box. This will open a new tab in the web browser that we will use to set up the VPC that our machine will reside in. Again click “create VPC” in the upper left corner. In the box, choose any name you would like; for this guide, we will be using the convention “Sample vpc,” “Sample subnet,” etc. CIDR block should be “10.0.0.0/16” and Tenancy should be “default.” Next, proceed down the selections on the left part of the screen to the “subnets” section. In here, click “create subnet” and fill out the name. VPC should have a VPC named the same as previously available in the dropdown menu; choose it. For the Availability zone, pick “No Preference,” and for the CIDR block, input “10.0.0.0/24.” After this, choose “internet gateways” on the left, and create a new internet gateway with any name you like. Right click on the gateway and choose “attach to vpc,” making sure to choose the VPC you created earlier. Next choose “Route tables” on the left. In the list, there should exist a route table, which has already been created for our VPC, and has your VPC name listed. Click on it and some options will appear below. Under the “subnet associations” tab, click “edit” and select your previously created subnet; click save. Under the “Routes” tab, add another route with “destination” being “0.0.0.0/0” and “target” being the internet gateway you created earlier (it should pop up if you click on the box). That should be all for the VPC for now.

Click back to your previous tab where you were creating the cluster. Hit the refresh (circular arrow) button near the VPC selection part and select the VPC you created. Under subnet, verify that your subnet is selected. Other options can remain as default. Hit “next: add storage.” Keep the defaults here and hit “next: tag instance.” Choose any name you would like and insert it into the value box. Hit “next” again to configure the security group. Make sure “create a new security group” is selected and that only port 22 (SSH) is listed below. Hit “next” and then hit “launch”; this will create a box allowing you to choose a key pair. You can reuse the same key pair in the future but for now just select “create new” and download the key; then launch. The machine will start to boot up. While it is working, choose the “elastic ip's” section to the left and click the blue “allocate new address” button; make sure the “IP's used in” selection reads “VPC” and click “Yes, Allocate.” Now, right click on the address and choose “Associate Address.” Make note of the address, then click directly on the instance box and select your instance; you may leave the rest of the selections as default and click “Associate.” If everything went well, you should have all you need to connect.

Connecting Via Ssh/Sftp And Putty Configuration

The key file that you download is a type of file known as a “private key” file. It is designed so that it will cryptographically match with another file, called a “public key” file, which is already installed on the cloud server. The standard format of the key files has a “.pem” file extension. This should be familiar to anyone who had used linux/ssh before. If you use a windows system and connect with the PuTTy SSH24 client that we will describe in this tutorial, you will need to use another key with the extension “.ppk.” There is actually no meaningful difference between the “.pem” and “.ppk” files, but the PuTTy client requires that the key files be converted to “.ppk” format before you connect; the conversion utility is included with the program. This requires one extra step. Type “puttygen” in the start menu and launch the application. Choose the “conversions” tab on the top menu and select “Import key,” navigate to the location of the “.pem” file and select it. Next, leave the passphrase fields blank and choose the “Save private key” button. This allows you to export the “.ppk” file to use in future steps. PuTTY25 is an open source file transfer application that supports SSH and telnet clients. You may download PuTTy for free at http://www.putty.org/.

Using the previously obtained IP address; you may connect to the new node/instance in order to execute commands or download files. For executing commands on Windows, we will focus on using the “PuTTy” SSH client tool. To connect to the instance, type or paste the IP address into the “Host Name (or IP address)” field in the top center (see Figure22).

PuTTy configuration window.

Next, expand the “SSH” section under the “Connection” section in the left pane. Under it, choose the “Auth” button. In the bottommost field will be a section labeled “Private key file for authentication.” Click “browse” and select the location where you have stored the “.PPK” file previously (see Figure33).

PuTTy configuration window.

Finally, click back to the uppermost button in the left pane: “session.” Type a name under the “saved sessions” section and click the nearby “save” button to make an easily reusable profile for this instance. Now you may connect by clicking “Open” (at the bottom). A new window will open which states: “login as:…” Type in the user name “<your username>” and press the enter key. The session will begin and you will now be able to execute SSH commands.

In order to transfer files, we can use a similar process with another program: Filezilla.26 Open up a Filezilla client and type in the IP address once more into the “host” field and the name “<your username>” into the “username” field near the top. Now, from the top toolbar, choose “edit > settings…” Under “Connection > SFTP” should be a button which reads: “Add keyfile…” Click it, and this time, choose the “.PEM” file instead of the “.PPK” file. Choose the “ok” button to exit settings and choose “Quickconnect” (to the right of the host and username fields). After a few seconds, you should see a listing of the files on the remote server.

Install the analysis software and create an image

In order to prepare for the installation, we will need to install some supporting libraries and tools. In Ubuntu, this is fairly easy because it only requires inputting one command for each library. By default, instances are set up with Ubuntu user account with sudo privileges. The same account can be used to install analysis software. Note that for the remainder of this tutorial, the “$” symbol followed by text indicates that that line of text is meant to be entered into the PuTTy window when connected to your machine. You enter the text after the “$,” but not the “$” itself. Enter the following commands, in order, one at a time:

  1. $ sudo add-apt-repository ppa:webupd8team/java

  2. $ sudo apt-get update

  3. $ sudo apt-get install oracle-java7-installer

  4. $ sudo apt-get install gcc-multilib

  5. $ sudo apt-get install r-recommended

  6. $ sudo apt-get upgrade

Next, we need to install the two commercial pieces of software in the setup: Intel Fortran composer27 and NONMEM. A noncommercial version of the Fortran compiler can be used, however, optimal performance is obtained with the Intel compiler. Each should have either come with a physical installation disk or a digital download. For the Fortran composer, we are looking for the folder containing a file called “install.sh.” Upload this entire folder to the machine using the Filezilla SFTP client we opened earlier. It is fine to place it in your user home directory, for example “/home/<your user>/fortran.” Assuming this is where you placed it, enter the directory on the PuTTy window and run the file:

  1. $ cd ∼/fortran

  2. $ sudo chmod +x install.sh

  3. $ sudo. /install.sh

The script is good in the readability department and you should have no issue following along. After entering the license key, you should choose option 2 to change which components to install. Choose 3, 5, and 7 to disable 32 bit components (the vast majority of AWS instances will be 64 bit only). Choose option 1 and continue with the installation. This can take a very long time but it will finish eventually. To complete the installation on Ubuntu, you will need to add a failsafe shell script to add the license file to the environment if it is not automatically found. To do this, create a new file:

  1. $ sudo nano /etc/profile.d/ifort.sh

Copy and paste the following text into the file (in PuTTy, copy the text here as you usually would, and right click anywhere in the PuTTy window to paste).

  1. if [x$INTEL_LICENSE_FILE = “x”]

  2. then source /opt/intel/bin/compilervars.sh intel64

  3. fi

Next, save and exit by pressing CTRL+O, <Return key>, CTRL+X. Finally, verify that the file is accessible by all users:

  1. $ sudo chmod 755 /etc/profile.d/ifort.sh

Nonmem license cost 2017

This concludes the Fortran composer installation. Next, we will install NONMEM. Upload the installation files in a similar manner, with the folder having a file with the name “SETUP73.” Supposing you have uploaded the installation files to the folder called “NONMEM,” run the following command to start the installer:

  1. $ sudo /bin/bash SETUP32/home/<your username>/NONMEM7/opt/nm73/opt/intel/bin/ifort y ar same rec I

Accept the defaults for the settings by entering “y” at each of the prompts. As before, the installation may take a very long time. Next, you will have to install the license. Using Filezilla, upload the license file to your home directory and execute the following commands:

  1. $ cd ∼/

  2. $ cp nonmem.lic /opt/nm73/license/nonmem.lic

  3. Next, you can add the NONMEM binary to the system path so that you can run it from anywhere easily.

  4. $ sudo nano/etc/profile

  5. Scroll to the bottom of the file with the arrow keys and paste in the following text as before:

  6. PATH=$PATH:/opt/nm72/run

  7. export PATH

Save the file and exit as before. You will need to log out of PuTTy and log back in for the path to update, but after that, the NONMEM installation should be complete. Now that the underlying components are installed, we can install the automation software PsN to greatly assist in running NONMEM jobs.

To install PsN, begin by setting up the required Perl libraries:

  1. $ sudo apt-get install libmoose-perl

  2. $ sudo cpan Math::Random

  3. $ sudo cpan Statistics::Distributions

  4. $ sudo cpan Archive::Zip

  5. $ sudo cpan File::Copy::Recursive

  6. $ sudo cpan Storable

  7. $ sudo cpan Moose

  8. $ sudo cpan MooseX::Params::Validate

(If you are prompted to configure as much as possible automatically, select “yes” and for “approach,” select “sudo”.)

As of this writing, the main PsN installation file can be downloaded for free at http://sourceforge.net/projects/psn/files/PsN-4.2.0.tar.gz/download. Obtain the file and upload it using Filezilla.

Nonmem License Cost Of Living

The following installation commands assume that you placed the file in the folder “PsN” under your home directory:

  1. $ cd ∼/psn

  2. $ tar -zxf PsN-3.5.3.tar.gz

  3. $ cd PsN-Source

  4. $ sudo perl -w setup.pl

Choose the default option for every step and the installation will be completed.

At this point, you have the option to create an image (AMI) on AWS so that you will not have to go through the installation again. Keep in mind that if you terminate an instance, unless you create an AMI, any machine configuration as well as all stored data on the machine will be lost forever. Back on your AWS account, under the EC2 service, select “instances” on the left-hand side. Right click on the sample instance you made and select “create image.” Choose any name you like; note that the instance will shut down during imaging, but they will not be deleted. You can start them from where you left off once the image creation process finishes. After this process is complete, you can click on “images” to the side, right click on your image, and choose “launch” to create a ready-to-use server.

Perform NONMEM analysis using PsN execute command

You now have everything setup to run your jobs and retrieve the output. First, you need to place the data on the server. You may create a new folder if you wish by right clicking on the right-hand pane in Filezilla and choosing “create directory.” Once you have opened the folder you wish to use, drag and drop or right click > upload any control and data files that are required to the folder on the server (in the right pane of Filezilla). Note that in order for the job to run correctly, the folder that it runs from must be under /home on the head node. Once the files are uploaded, switch to the PuTTy/SSH window and navigate to the directory that you uploaded to. If you are not sure how to do this, the easiest guaranteed method is to choose the path listed in the right pane of Filezilla above the files listing, and paste it into the PuTTy window after the command “cd.” For example, suppose you created and entered a new folder in Filezilla under your home directory called “test01.” The path displayed above the files in Filezilla should read: “/home/<your username>/test01.” Take this and paste or type it into the terminal window so the command in PuTTy should read: “cd/home/<your username>/test01.” Next, you may begin execution. In the terminal window, enter the command “execute test01.ctl,” replacing “test01.ctl” with the name of the control file that you had uploaded. The terminal window will show a change indicating that the model is running.

See Table22 for an example of a NONMEM analysis run on the local cluster vs. a run on the cloud cluster. Note that local or cloud-based virtual machines with similar specifications are able to process a resource intensive NONMEM execution in a similar amount of time. This illustrates that it is possible to obtain similar productivity using an Amazon cloud image compared to a local virtual image on a dedicated hardware, although in either case the quality (server hardware or Amazon instance type) of the resource that you purchase will have a direct impact on the speed at which runs are processed.

Table 2

Local clusterCloud cluster
Server typeVMWare InstanceAmazon Instance
Server locationLocal, New Jersey, USAVirginia, USA
CPU usage100%100%
CPU speed2.53 GHz2.50 GHz
CPU cores42
Disk space27.8 GB8 GB
Memory8053828kB7693824kB
Model run time2m53.486s3m2.563s

Perform NONMEM analysis using PsN bootstrap command

The process for initiating a bootstrap job is very similar to that of the above step, starting an execute job. The main difference is that you may choose the amount of threads per core and the amount of samples (separate runs) for bootstrapping. All of the setup (creating the folders and uploading the data and control files) is exactly the same. Suppose we have another control file, called test02.ctl, which we intend to run as a bootstrap job. Assuming that we have already navigated to the correct folder, we can run the command “bootstrap test02.ctl –threads=4 –samples=8,” replacing the “4” with the number of threads to use (multiple threads will run on only one machine at a time) and replacing “8” with the number of samples to repeat (each sample can run on a separate compute node). The terminal window will show the status of each sample run, adding a number to the count after each run is submitted, and after each run is completed.

Launching a new cloud cluster

To use the Sonic interface, proceed to http://sonic.mashframe.com/and log in using the boxes in the top-right corner. After logging in, click the “Sonic clusters” dropdown and choose “Clusters Manager” (see Figure44).

Sonic clusters manager interface.

Choose “New Cluster…” in the top right corner and fill out the short information form (see Figure5)5) that is presented. The screen will return to an overview of any clusters that you have previously created and will keep track of the status of preparing the new cluster. This may take some time to complete, but usually no more than 15 minutes.

Create new cluster form.

When it is finished, a button reading “Get keys and information” will become available. This will pop-up in a screen giving the login username and IP address, as well as a button that will download the key file to authenticate to the head node. Note that after clicking download for the first time, you will not be able to re-download the key again for this cluster. Also, be sure to make a note of the IP address before closing the dialog box. By using this IP address and key file, you will be able to log into the system.

Tracking of jobs on a cloud cluster

You may often need to run an analysis on a very large dataset in which the execution will take a very long time, and, often, you will be sharing the available resources with other users. Because of this, it is helpful to be able to monitor the status of the current running jobs on the grid. Commands for this are provided for simple viewing using the SSH connection. On the PuTTy window, type the command “qstat –f.” This shows a listing of all of the compute nodes and the head node as well as any jobs currently running and jobs that are still waiting for a free slot. Note that you cannot run this command in the same PuTTy window as you submitted your own jobs in because PsN will keep control of the window until it is finished. Instead, you will have to open a second instance of the PuTTy program and log in again.

Also note that a few useful commands are available to modify jobs you have started if something comes up. Type the command “qmod -sj 5” or “qmod -sj “*”” to suspend a running job. If the argument is numerical, as in the former, you are indicating the job number/id as read from qstat. If the argument is ““*”” (note that the quotes are required), all of your jobs will be suspended. Note that this will stop the job from consuming CPU time but will not remove the job from the queue. Two more commands can be used with similar syntax: “qmod -usj” and “qdel” (both of which still require the ““*”” or job number). The former will unsuspend a previously suspended job, and qdel will completely remove/delete a job (see Table33).

Table 3

CommandWhat it is used for:
qstat -fDisplay a listing of all nodes and their load/slots as well as all current running jobs and their status, such as what node they are running on and their job number.
qmod -sj 15Suspend (temporarily stop) a specific job.
qmod -sj “*Suspend (temporarily stop) all jobs.
qmod -usj 15Unsuspend (start after having been stopped) a specific job.
qmod -usj “*Unsuspend (start after having been stopped) all jobs.
qdel 15Stop and remove a specific job.
qdel “*Stop and remove all jobs.

Audit trail of jobs running on a cloud cluster

The Sonic audit trail extension will make audit data from a Linux cluster available to view on the Sonic Platform. This provides a level of increased convenience as well as retention of the audit data after the cluster machine is terminated. The audit trail must be activated when the cluster is created and cannot be added after the fact. When using the Sonic Platform to create a cluster, as described above, just select the check-box called “enable auditing” to set up the auditing in the background. Please note that it will create slightly more network overhead, which is why it is not enabled by default. Currently, the audit viewer on the Sonic Platform website is broken down into two sections: “TTY” and “Low Level.” TTY mode will show the exact commands that each user typed in the BASH session. It is useful when a user may have made a mistake and you can look back to see why the problem might have arisen. “Low Level” really means: everything else. These are system events that can be configured to your liking using the audited configuration options, which are well-documented on the internet. Anything that appears in the audit log file will appear here. The automatically generated Sonic instances are moderately paranoid by default, but you may wish to manually add more monitoring. Please note that for the TTY log, the log will only be updated after the user ends their BASH session. So if you are imagining that a command was entered that you cannot find in the log, you can force the user to log out first and then check the log.

Backup of analysis data on a cloud cluster

The Sonic backup program is a simple interface to AWS Glacier features. AWS Glacier is a cost-efficient product of AWS, which allows very large storage volumes for a very low cost. A downside to using Amazon Glacier is that obtaining the data from storage may typically take a number of hours to complete. Amazon Glacier is suited for long-term backups, while S3, an alternative backup program, is secure, efficient, and cost-effective for backing up and retrieving information immediately. The Glacier service is preferred for this application because you may or may not actually use the stored data, and so, the low price tag—usually less than $0.01 per gigabyte per month—is highly desirable. Glacier services are available in the same regions as the other AWS so you can keep latency low. Amazon Glacier synchronously stores your data across multiple facilities before returning SUCCESS on uploading archives, so there are no worries of lost data.

The included program is meant as a set-up-and-forget, which will keep a backup sustained at a defined interval. Before launching the program, you must edit the configuration file to reflect your preferences. Enter the command “sudo nano /etc/sonic/sonicBackup.ini.” You will be able to change the name of the vault that the cluster uses, the AWS credentials, and the AWS region.

You may then launch the setup script by running the command “sudo sonicBackup” on any node created with Sonic. The script will present a small list of options, the primary one being the first “create backup.” You navigate this program by typing a number or letter for an option and pressing the enter key. Choose option 1—create backup—to begin. Follow the on-screen instructions. The only step that might not make immediate sense to you is entering the path, as you must manually type the path. Usually, typing “/home” will obtain all user files and get everything that you need, but you may specify another path if you desire. After following the setup instructions, the job will continue to run in the background at the specified interval.

If you would like to set up email notifications for verifications, you may use option 4 and enter the desired email address.

Managing user access on a cloud cluster

The Sonic administrative program is another helper program that provides automation of common Linux administrative actions across all of the compute nodes in parallel. It does not require any configuration when it is launched as part of a Sonic cluster. You may run the program by typing “sudo sonicAdmin.”

Options include adding users and groups, suspending or unsuspending users, and adding/removing users to/from groups. All of these actions should be self-evident. When creating a new group, an option to create a study folder is presented, which will set up automatic folder permissions for users of a specific study group so that when they run a job from the study folder the group may be able to read the results.

It is recommended that you only add new users with the script instead of manually if you plan to allow the user to run jobs on the grid because it is required for the users to exist on all of the nodes in the cluster.

Security in the cloud

Amazon provides support for encryption of one or more storage devices that may be attached to an Amazon image. This makes it easy to encrypt large amounts of data; a private key is used to log into the machines, streamlining access, whereas an encryption key works like a password to provide heightened security for the server. Amazon encrypted EBS is generally very helpful, but it is limited in scope because it can only encrypt specific locations and not the entire machine (for example, system boot files). If analyses are to be stored in a specific folder, where the encrypted volume may be mounted, then encrypted EBS may be a viable option to encrypt results.

Nonmem License Cost Calculator

Conclusion

In this tutorial, we presented how to get started with building your own personal cloud compute cluster using AWS, NONMEM, PsN, Grid Engine, and Sonic. In our view, a cloud-based compute cluster can provide a powerful yet very economical computing platform for performing NONMEM analysis. Tools like Sonic can provide a very simple-to-use web-based interface for the management of cloud-based clusters, so that you only actively run the amount of resources that you need during analysis.

Conflict of Interest

S.S. is CEO of Rudraya Corporation, which provides commercial licensing of Sonic. The other authors declared no conflict of interest.

References

  • Beal S, Sheiner LB, Boekmann A. Bauer RJ. NONMEM's user's guides. Ellicott City, MD: ICON Development Solutions; 2009. [Google Scholar]
  • Nyhoff LR. Leestma SC. Fortran 90 for engineers. Upper Saddle River, NJ: Prentice-Hall; 1997. [Google Scholar]
  • Lindbom L, Pihlgren P. Jonsson EN. PsN-Toolkit–a collection of computer intensive statistical methods for non-linear mixed effect modeling using NONMEM. Comput. Methods Programs Biomed. 2005;79:241–257. [PubMed] [Google Scholar]
  • Amazon Web Services . About AWS. < http://aws.amazon.com/about-aws/ >.
  • Grid Engine . Open grid scheduler. < http://gridscheduler.sourceforge.net/ >.
  • Rudraya Sonic . Cloud computing platform. < http://sonic.mashframe.com/ >.
  • Microsoft . What is Microsoft Azure. < http://azure.microsoft.com/en-us/overview/what-is-azure/ >.
  • Google . Google cloud platform. < https://cloud.google.com/docs/ >.
  • Rackspace . Rackspace managed cloud. < http://www.rackspace.com/managed-cloud/ >.
  • IaaS Providers List: 2014 comparison and guide. <http://www.tomsitpro.com/articles/iaas-providers,1-1560.html>
  • WebHosting Talk . Amazon EC2 vs Azure vs Rackspace Cloud vs Google C. Engine Some tests and stats. < http://www.webhostingtalk.com/showthread.php?t=1281096 >.
  • Amazon Web Services . AWS CLI. < http://aws.amazon.com/cli >.
  • AWS Command Line Interface user guide . < http://awsdocs.s3.amazonaws.com/cli/latest/aws-cli.pdf >.
  • Ubuntu documentation. < https://help.ubuntu.com/community/Screen >.
  • Amazon Web Services. Amazon EC2. < http://aws.amazon.com/ec2/ >.
  • Key Pairs. Public-key cryptography. < http://en.wikipedia.org/wiki/Public-key_cryptography >.
  • Amazon Web Services . Amazon VPC. < http://aws.amazon.com/vpc/ >.
  • Amazon Web Services . Amazon S3. < http://aws.amazon.com/s3/ >.
  • Amazon Web Services. Amazon EC2 Instance Types. < http://aws.amazon.com/ec2/instance-types/ >.
  • Amazon Documentation. Amazon Machine Images (AMI). < http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html >.
  • Amazon Documentation. Amazon EC2 Security Groups. Amazon Web Services. < http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html >.
  • Teuscher N. What is NONMEM? Learn PK/PD training for the future. < http://learnpkpd.com/2011/01/12/what-is-nonmem/ > (2011)
  • ICON. A symbol of excellence. NONMEM History. <http://www.iconplc.com/technology/products/nonmem/history/>
  • Tatham S. PUTTY user manual. < http://the.earth.li/∼sgtatham/putty/0.63/puttydoc.txt> (2001–2013)
  • PuTTY download page. <http://www.chiark.greenend.org.uk/∼sgtatham/putty/download.html>
  • FileZilla. Client tutorial. <https://wiki.filezilla-project.org/FileZilla_Client_Tutorial_(en)>
  • Intel Fortran Composer XE 2011 for Linux* installation guide and release notes. <http://registrationcenter-download.intel.com/akdlm/irc_nas/2373/l_fcompxe_2011_sp1.7.256_Release_Notes_en_US.pdf>

Nonmem License Cost Of Texas

Articles from CPT: Pharmacometrics & Systems Pharmacology are provided here courtesy of Wiley-Blackwell