Skip to content

metrumresearchgroup/OpenBoneMin

Repository files navigation

About

A multiscale systems model of bone health and mineral homeostasis. Please see the wiki page for more information on this project.

Community contributions to this project are included here.

Documentation

  • Documentation here

Installation

Installation of OpenBoneMin requires the devtools package

if(!require("devtools")) install.packages("devtools")

Use the install_github function inside devtools to install the OpenBoneMin package from GitHub to your local machine

devtools::install_github("metrumresearchgroup/OpenBoneMin")

You can test the installation by trying an example

example("sim_teri", package = "OpenBoneMin")

Usage

library(OpenBoneMin)
library(ggplot2)

Simulate teriparatide data

  • PTHpm teriparatide concentration (pM)
  • CaC calcium concentration (mM)
out <- sim_teri(dose=c(20,40), dur=9)

plot(out)

Simulate denosumab data

  • DENCP denosumab concentration
  • BMDlsDENchange lumbar spine change from basline
out <- sim_denos(dose=c(10,60,210), dur=6)

plot(out, log(DENCP) + BMDlsDENchange ~ time, xlab="Time (months)")

Some helper functions

Convert teriparatide doses

Usually, we think of doses in micrograms. This function turns those doses into pmol.

amt_teri(20)
. [1] 4856.962

Export the model code

It's a little hard to see what's happening here. But basically, this grabs the model code and writes it to a file of your choosing. Use this when you want to export the model and start making changes yourself.

file <- file.path(tempdir(),"my_model.cpp")
file_location <- BoneMin_export(file)