Skip to content

A Docker file for running a CellML simulation and passing parameters through the command line.

License

Notifications You must be signed in to change notification settings

hsorby/docker_opencor_run_model

Repository files navigation

Docker for OpenCOR

This repository holds the files required to build a Docker image that runs a simulation of a CellML model using OpenCOR with Python.

Build Command

You will need to get a copy of the OpenCOR binary from here. Save this in the directory where the 'Dockerfile' file exists.

docker build --rm -t hsorby/opencor-python .

Run Command

docker run hsorby/opencor-python <int> <float>

where <int> is the stimulation mode as an integer number (1:stellate; 2:vagal) and <float> is the stimulation level (0-1) as a decimal number.

Output

The output is a JSON string with the membrane potential 'v' at each time step and the heart rate in beats per minute, as per the sample shown below.

{
    "heart_rate": 73,
    "membrane": {
        "v": [-47.78, -47.82, -47.85, ...]
    }
}

Implementation notes

We are using the Fabbri et al (2017) sinoatrial cell model: https://models.physiomeproject.org/e/568

The model includes autonomic modulation via inclusion of the effects of ACh on If, ICaL, SR calcium uptake, and IK,ACh; and the effect of isoprenaline on If, ICaL, INaK, maximal Ca uptake, and IKs. We are varying the concentration of ACh according to the stimulation level, while isoprenaline is encoded to be "on" or "off" only (we use the "on" version in this exemplar). The range of ACh we're allowing is beyond what has been presented in the paper.

Example output

Plotted example data when using this container to simulate various levels of stellate stimulation:

stellate-stimulation.png

Plotted example data when using this container to simulate various levels of vagus stimulation:

vagus-stimulation.png

About

A Docker file for running a CellML simulation and passing parameters through the command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published