Learn R Programming

ruminate

The goal of {ruminate} is to facilitate exploration of pharmacometrics data. This is done by creating a Shiny interface to different tools for data transformation ({dplyr} and {tidyr}), plotting ({ggplot2}), noncompartmental analysis ({PKNCA}), and ODE-based adaptive trial simulations ({rxode2}). These results can be reported in Excel, Word or PowerPoint. The state of the app can be saved and loaded at a later date. When saved, a script is generated to reproduce the different actions in the Shiny interface.

Deployed example in the cloud

You can point your web browser to runrumiate.ubiquity.tools and try the development version of ruminate. Keep in mind this is a public server. No data is tracked or kept, but it is open to the public. So be careful about uploading confidential data. Also know this is a single instance and if many people are using it at once it can be slow.

Local installation

From CRAN

You can install the released version of ruminate from CRAN with:

# Actual package
install.packages("ruminate",  dependencies=TRUE)

Development version

You can install the development version from GitHub with the following:

# Installing devtools if it's not already installed
if(system.file(package="devtools") == ""){
  install.packages("devtools") 
}

devtools::install_github("john-harrold/onbrand",   dependencies=TRUE)
devtools::install_github("john-harrold/formods",   dependencies=TRUE)
devtools::install_github("john-harrold/ruminate",  dependencies=TRUE)

Note that because {ruminate} depends on {formods} and {onbrand} you will need to first install the development versions of {onbrand} and {formods}.

Running ruminate

In RStudio

This will run the default/stable version of ruminate:

library(ruminate)
ruminate()

As new modules are developed they can be found in the development app. This command will run the ruminate with any development modules enabled:

library(ruminate)
library(shiny)
runApp(system.file(package="ruminate","templates", "ruminate_devel.R"))

If you are running this you should probably be using the development version off of github to make sure you have the latest version.

In a Docker container

This kind of assumes a basic familiarity with Docker. Keep in mind that these containers are built for ‘x86’ images. Essentially Intel/AMD cpus. This means that if you have a Mac with Apple Silicon (M1, M2,etc.) it may not work or the performance may not be that good.

Pull a container from Docker

This will pull container from docker and run it locally

docker pull johnmharrold/ruminate:latest
docker run -p 3838:3838   johnmharrold/ruminate:latest &

If that worked you can put the following into a web browser and then use ruminate there:

http://127.0.0.1:3838/

Create your own container

If you want to create your own container you can do the following:

docker build -t ruminate --no-cache  https://raw.githubusercontent.com/john-harrold/ruminate/main/inst/docker/local_container

This will run the Docker image locally:

docker run --name ruminate --rm -p 3838:3838 ruminate

If everything worked you can then point your web browser to:

http://127.0.0.1:3838/

This will push the image to DockerHub:

docker tag ruminate <username>/ruminate:latest
docker push <username>/ruminate:latest

You can use this to pull the image from DockerHub:

docker pull <username>/ruminate:latest

Deployment and Customization

If you want to deploy and customize ruminate, please see the Deployment vignette.

Copy Link

Version

Install

install.packages('ruminate')

Monthly Downloads

134

Version

0.3.1

License

BSD_2_clause + file LICENSE

Maintainer

John Harrold

Last Published

January 10th, 2025

Functions in ruminate (0.3.1)

CTS_fetch_sc_meta

Fetches Simulation Parameter Meta Information
CTS_Server

Clinical Trial Simulator State Server
CTS_append_report

Append Report Elements
CTS_add_covariate

Add Covariate to Elemetnt
CTS_add_rule

Add Rule to Element
CTS_fetch_code

Fetch Module Code
CTS_change_source_model

Change the Source Model
CTS_fetch_state

Fetch Clinical Trial Simulator State
CTS_init_state

Initialize CTS Module State
CTS_sim_isgood

Checks Simulation in Element for Goodness
CTS_preload

Preload Data for CTS Module
CTS_simulate_element

Simulates the Specified Element
CTS_mk_preload

Make List of Current CTS State
CTS_new_element

New Clinical Trial Simulation Cohort
CTS_plot_element

Plots the Specified Element
CTS_set_current_element

Sets the Value for the Current cohort
CTS_init_element_model

Initializes Cohort When Model Changes
CTS_test_mksession

Populate Session Data for Module Testing
MB_fetch_code

Fetch Module Code
MB_Server

Model Builder State Server
MB_fetch_catalog

Fetches List of Available Models
MB_append_report

Append Report Elements
MB_fetch_component

Fetch Selected Current Model Component
MB_fetch_appends

Fetches List of Available Models
CTS_update_checksum

Updates CTS Module Checksum
MB_build_code

Build Code to Generate Model
MB_del_current_element

Deletes Current model
MB_new_element

New Model Building Model
MB_mk_preload

Make List of Current MB State
MB_preload

Preload Data for MB Module
MB_test_catalog

Tests the Model Catalog
MB_init_state

Initialize MB Module State
MB_fetch_current_element

Fetches Current model
MB_fetch_state

Fetch Model Builder State
MB_fetch_mdl

Fetch Model Builder Module Models
MB_set_current_element

Sets the Value for the Current model
MB_test_mksession

Populate Session Data for Module Testing
NCA_fetch_current_ana

Fetches Current Analysis
NCA_Server

Fetch Non-Compartmental Analysis State
NCA_fetch_ana_ds

Fetch Analysis Dataset
NCA_fetch_code

Fetch Module Code
NCA_append_report

Append Report Elements
NCA_add_int

Adds Analysis Interval to Current Analysis
MB_update_checksum

Update MB Module Checksum
NCA_fetch_ana_pknca

Fetch PKNCA Results Object
NCA_fetch_PKNCA_meta

Fetches PKNCA Metadata
MB_update_model

Updates Current Element with rxode2 Model
NCA_fetch_ds

Fetch Module Datasets
NCA_fetch_state

Fetch ruminate State
NCA_fetch_current_obj

Fetches the Current Analysis Object
NCA_fetch_data_format

Fetches Details About Data Requirements
NCA_fetch_np_meta

Fetches NCA Parameter Meta Information
NCA_mkactive_ana

Fetch PKNCA Results Object
NCA_mk_preload

Make List of Current NCA State
NCA_init_state

Initialize NCA Module State
NCA_load_scenario

Loads Pre-Defined Scenario
NCA_find_col

Determines Default Column Name
NCA_new_ana

Initialize New Analysis
dose_records_builder

Builds Dose Records Dataframe
NCA_preload

Preload Data for NCA Module
fetch_rxinfo

Fetches Information from an rxode2 Object
mk_figure_ind_obs

Creates Figures of Individual Observations from PKNCA Result
NCA_test_mksession

Populate Session Data for Module Testing
apply_route_map

Applies Route Mapping to Dataset
fetch_rxtc

Extracts Timecourse and Merges Covariates
NCA_process_current_ana

Processes Current Analysis to be Run
NCA_set_current_ana

Sets Current Analysis
mk_rx_obj

Makes an rxode2 Object
ruminate_check

Checks ruminate Dependencies
mk_table_ind_obs

Creates Tables of Individual Observations from PKNCA Result
nca_builder

Builds NCA Code from ui Elements
plot_sr_tc

Plots Timecourse of Rules Simulations
ruminate

ruminate: Shiny app and module to facilitate pharamacometrics analysis
mk_table_nca_params

Create Tabular Output from PKNCA Results
rx2other

Converts an rxode2 Object Into Specified Model Format
mk_subjects

Fetches Information from an rxode2 Object
run_nca_components

Runs NCA for the Current Analysis
simulate_rules

Rule-Based simulates
plot_sr_ev

Plots Timecourse of Rules Simulations
CTS_fetch_current_element

Fetches Current cohort
CTS_del_current_element

Deletes Current cohort
CTS_fetch_ds

Fetch Clinical Trial Simulator Module Datasets