Try Our Suite of Open Source Tools

We’re strong advocates of open-source software development efforts, and we make many of the tools we’ve developed for our own work available as free, open-source software under GPL.

If you use these tools in your work, please acknowledge Metrum Research Group, Tariffville, CT 06081 in any derived documents. Some of the tools are associated with peer-reviewed publications, which are indicated with each distribution, and should also be referenced.

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, during both model development and decision-making phases of a drug development program.

Get mrgsolve

Torsten is a collection of Stan functions to facilitate analysis of pharmacometric data using Stan, a flexible open-source software platform for Bayesian data analysis using Hamiltonian Monte Carlo (HMC) simulation—a type of MCMC simulation. 

The current version of Torsten includes functions for:

  • Specific linear compartment models:
    • One compartment model with first-order absorption.
    • Two compartment model with elimination from and first-order absorption into central compartment.
  • General linear compartment models described by systems of first-order \underline{linear} ordinary differential equations (ODEs).
  • General compartment models described by a system of first-order ODEs.
  • Mixed compartment models with a PK forcing function described by linear one or two compartment model.

Torsten provides Stan language functions that calculate amounts in each compartment, given an event schedule and an ODE system. The models and data format are based on NONMEM®/NMTRAN/PREDPP conventions. The most recent versions of Torsten support within chain parallel computation for models that require numerical solution of ODEs.

Get Torsten

Metrum Package Network

A curated, reproducible R package environment:

  • Open repository of ~1000 packages specific to PMX sourced from CRAN and github
  • Compatibility and stability tested
  • Binaries for Windows and MacOS across multiple versions of R
  • Immutable repository
  • Freely available and accessible to all

A user-friendly interface between R and NONMEM® to manage, track, and report modeling activities through simple R objects. Users can submit models, consume outputs and diagnostics, and iterate on models. bbr provides simple tagging and model inheritance trees to support the replication and external review of your work. bbr makes model development more efficient, reproducible, and traceable.

Get bbr


pkgr is a rethinking of the way packages are managed in R. Namely, it embraces the declarative philosophy of defining an ideal state of the entire system and works towards achieving that objective. pkgr is built with a focus on reproducibility and auditability of what is going on, a vital component for the pharmaceutical sciences + enterprises.  More details here.

Get pkgr


Data specifications, wrangling, and documentation.  Use yspec to document analysis data sets and utilize data attributes in a modeling and simulation workflow.

Get yspec



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.


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 task in an efficient manner.


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.

Plots for pharmacometrics. pmplots provide light wrappers around ‘ggplot2’ plotting code tailored for pharmacometric applications.

Get pmplots


Tables for pharmacometrics. pmtables is an R package that allows you to summarize data sets and create publication-quality tables for inclusion in ‘tex’ documents.

Get pmtables


Forest plots for pharmacometrics. pmforest is an R package to create forest plots, a visualization tool for identified variables of interest.

Get pmforest



This R package provides fast computation of [time since] and [amount of] the most-recent dose in a data set. Additional (ADDL) dosing records are expanded and included in the calculation.

Get lastdose



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


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


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.