At Metrum Research Group, we are strong advocates of open-source software development efforts. In fact, we make several of the useful tools we've developed for our own work available as free, open-source software under GPL. You'll find these tools hosted by Google Code or CRAN, at the links listed below. If you use these tools in your work, please acknowledge Metrum Research Group LLC, Tariffville, CT 06081 in any derived documents. Some of the tools are also associated with peer-reviewed publications, which are indicated with each distribution, and should also be referenced.

Visit github to download your copy of mrgsolve now.

mrgsolve facilitates simulation in R from hierarchical, ordinary differential equation (ODE) based models typically employed in drug development. The modeler creates a model specification file consisting of R and C++ code that is parsed, compiled, and dynamically loaded into the R session. Input data are passed in and simulated data are returned as R objects, so disk access is never required during the simulation cycle after compiling.

Features include:

  • NMTRAN-like input data sets
  • Bolus, infusion, compartment on/off and reset functionality
  • Bioavailability, ALAG, SS, II, ADDL, MTIME
  • Multivariate normal random effects simulated using RcppArmadillo
  • Compatible with parameter estimation and design packages in R (nlme, saemix, PopED, PFIM)
  • Integration with data summary (dplyr) and plotting (ggplot, lattice) packages
  • Parallelization with existing R infrastructure (mclapply) or Sun Grid Engine (qapply)
  • Compatible with output from many different model estimation platforms
  • Easily integrated with Shiny to create model-visualization applications

mrgsolve is a powerful and efficient tool for simulation from ODE-based PK/PD and systems pharmacology models. The resulting computational efficiency facilitates model exploration and application, both during model development and decision-making phases of a drug development program.


ggedit is an interactive ggplot aesthetic and theme editor. ggplot2 has become the standard of plotting in R for many users. New users, however, may find the learning curve steep at first, and more experienced users may find it challenging to keep track of all the options (especially in the theme!).

ggedit is a package that helps users bridge the gap between making a plot and getting all of those pesky plot aesthetics just right, all while keeping everything portable for further research and collaboration.

It is powered by a Shiny gadget where the user inputs a ggplot plot object or a list of ggplot objects. You can run ggedit directly from the console or from the Addin menu within RStudio.

Visit github to download ggedit, or read more about ggedit on our blog.

D3js trees

D3js is a great tool to visualize complex data in a dynamic way. But how can the visualization be part of the natural workflow?

Creating new reactive elements through the integration of Shiny with d3js objects allows us to solve this problem.

Through Shiny we let the server observe the d3 collapsible tree library and its real-time layout. The data transferred back to Shiny can be mapped to a series of logial expressions to create reactive filters. This allows for complex data structures, such as heirarchal simulations, complex design of clinical trials and results from polycompartmental structural models to be visually represented and filtered in a reactive manner through an intuitive and simple tool.

Visit github to download D3js trees, or read more about D3js trees on our blog.

Bugs Model Library

BUGSModelLibrary is a prototype PKPD model library for use with WinBUGS 1.4.3. The current version includes specific linear compartmental models (one compartment model with first order absorption and two compartment model with elimination from and first order absorption into central compartment), general linear compartmental model described by matrix exponential, and general compartmental model described by a system of first order ODEs. The models and data are based on NONMEM/NMTRAN/PREDPP conventions including recursive calculation (this permits piecewise constant covariate values), bolus or constant rate inputs into any compartment, handles single dose, multiple dose and steady-state dosing histories, implemented NMTRAN data items including TIME, EVID, CMT, AMT, RATE, ADDL, II, and SS.

The library provides BUGS language functions that calculate amounts in each compartment.


NMQual is software designed to assist in the installation, qualification, and running of the NONMEM software. NONMEM is proprietary software for nonlinear mixed effects modeling, distributed solely by Icon Development Solutions, Ellicott City, MD. Although it is not domain specific, most users are in pharmacology and related disciplines. An active user group is maintained at Valid license holders have limited means of installing and maintaining their NONMEM software. Major versions are released every several years. Media includes a DOS script for installing on Windows and a shell script for installing on UNIX. As bugs are discovered, remedies are reported on the help list, to be implemented by hand. Such manual interventions are tedious, and lack the sort of documentation increasingly expected in a federally regulated industry. Configuration details and bug fix details are pre-specified in XML files. Installation and operation of NMQual-mediated NONMEM installations generate XML logs for traceability.


Pharmacometric tools for common data preparation tasks, stratified bootstrap resampling of data sets, NONMEM control stream creation/editing, NONMEM model execution, creation of standard and user-defined diagnostic plots, execution and summary of bootstrap and predictive check results, implementation of simulations from posterior parameter distributions, reporting of output tables and creation of detailed analysis logs.

Bugs Parallel

bugsParallel is a set of R functions for distributed computing with WinBUGS. BugsParallel has been successfully installed on MS Windows and Mac OS X platforms, is a modified subset of the R2WinBugs package, uses the R package Rmpi to implement a network of Windsor workstations, and uses the rlecuyer package for parallel random number generation.

When used for a Bayesian analysis, Markov chain Monte Carlo (MCMC) simulations generate samples that approximate the joint posterior distribution of the sampled parameters. The sequential nature of MCMC simulation limits the benefits of parallel computation when applied to a single chain. However parallel computation of multiple chains is an “embarassingly parallel” problem that can substantially reduce computation time and is relatively easy to implement using bugsParallel in combination with other freely available software.


These functions provides simple wrappers around the Unix process management API calls: fork, signal, wait, waitpid, kill, and _exit. This enables construction of programs that utilize and mange multiple concurrent processes.


Functions for managing logs of reviews of files in a subversion repository (


This package provides functions for reading, listing the contents of, and writing SAS xport format files. The functions support reading and writing of either individual data frames or sets of data frames. Further, a mechanism has been provided for customizing how variables of different data types are stored.


The lapply(x, FUN) function in R ( returns a list of the same length as x, with each resulting element being the result of FUN to an element of x. Open Grid Scheduler/Engine is an open source batch-queuing system, developed and based upon Sun Grid Engine. While several packages provide implementations of parallel "apply" structures in CRAN (e.g., snow, Rmpi), none utilize the scheduling capabilities of Grid Engine. The ability to queue jobs (e.g., MCMC chains) works with well with elastic variants of cluster computing. Using qapply, the user can stack the queue and load balance the computational task, adding and removing computational resources as necessary to complete the the task in an efficient manner.


Tools for compiling and reporting meta-data collected during data manipulations. Changes to record and subject counts can be tracked and reported in tabular and flow-chart formats. Allows for greater transparency and accountability during data assembly.

© 2016 Metrum Research Group LLC