metrumresearchgroup / OpenBoneMin

The Bone Health and Mineral Model
https://www.metrumrg.com/open-science/models/
9 stars 3 forks source link

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

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

out <- sim_teri(dose=c(20,40), dur=9)

plot(out)

Simulate denosumab data

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)