https://github.com/computationalphysiology/modelgraph

A tool for visualizing dependencies between different components of your model

https://github.com/computationalphysiology/modelgraph

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

A tool for visualizing dependencies between different components of your model

Basic Info
Statistics
  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License

README.md

codecov CI github pages pre-commit.ci status

modelgraph

A tool for visualizing dependencies between different components of your model.

Motivation

Assume you have some model, represented as a system of ODEs with potentially several intermediate expressions. For example in the classical Hodgkin Huxley model of the squid axon from 1952 we have the following expressions

git@github.com:ComputationalPhysiology/modelgraph.git dV_dt = -(-i_Stim + i_Na + i_K + i_L)/Cm i_Na = g_Na*m**3*h*(V - E_Na) From this we can deduce that i_Na depends on the parameter g_Na, and since dV_dt depends on i_Na it also depends (indirectly) on the parameter g_Na.

In modelgraph we can visualize this dependency using the following code snippet ```python from modelgraph import DependencyGraph import gotran

Load ode using gotran

ode = gotran.loadode("hodgkinhuxleysquidaxonmodel1952_original.ode")

Build dependency graph

graph = DependencyGraph(ode)

Get the components that depends on g_Na (we call this inverse dependents)

G = graph.invdependencygraph("g_Na")

Visualize using matplotlib (python -m pip install matplotlib)

import matplotlib.pyplot as plt nx.draw(G, withlabels=True, fontsize=10, nodesize=2000) plt.savefig("gNa_mpl.png") ``` _

```python

Or using pydot (python -m pip install pydot)

P = nx.nxpydot.topydot(G) P.writepng("gNa_pydot.png") ```

_

It is also possible to go the other way around, i.e if you want to look at e.g dV_dt and see what it depends on

```python

Visualize what dV_dt depdens on

GdVdt = graph.dependencygraph("dVdt")

nx.draw(GdVdt, withlabels=True, fontsize=10, nodesize=2000) plt.savefig("dVdt_mpl.png")

PdVdt = nx.nxpydot.topydot(GdVdt) PdVdt.writepng("dVdt_pydot.png") ```

Here we only display the graph using pydot since the matplotlib version seems to be a bit messy if the graph becomes too large

_

Installation

Install with pip python3 -m pip install modelgraph

GUI

There is also a graphical user interface. To use this you need to install streamlit python -m pip install streamlit You can run the the gui by passing in the .ode file as a command line argument e.g

python -m modelgraph demo/hodgkin_huxley_squid_axon_model_1952_original.ode This will start a streamlit server, and the GUI is now hosted on http://localhost:8501

_

Documentation

Documentation is hosted at http://computationalphysiology.github.io/modelgraph.

Automated test

Tests are provided in the folder tests. You can run the tests with pytest

python3 -m pytest tests -vv

Contributing

See the contributing section

Authors

  • Henrik Finsberg (henriknf@simula.no)

License

MIT

Owner

  • Name: Computational Physiology at Simula Research Laboratory
  • Login: ComputationalPhysiology
  • Kind: organization
  • Location: Fornebu, Norway

GitHub organization for the computational physiology department at Simula Research Laboratory

GitHub Events

Total
  • Push event: 18
  • Pull request event: 13
Last Year
  • Push event: 18
  • Pull request event: 13

Committers

Last synced: over 3 years ago

All Time
  • Total Commits: 40
  • Total Committers: 3
  • Avg Commits per committer: 13.333
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Henrik Finsberg h****f@s****o 20
pre-commit-ci[bot] 6****]@u****m 18
Henrik Finsberg h****g@h****m 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 52
  • Average time to close issues: N/A
  • Average time to close pull requests: 13 days
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.13
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 52
Past Year
  • Issues: 0
  • Pull requests: 12
  • Average time to close issues: N/A
  • Average time to close pull requests: 26 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 12
Top Authors
Issue Authors
Pull Request Authors
  • pre-commit-ci[bot] (64)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 21 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 2
  • Total maintainers: 1
pypi.org: modelgraph

Tool for extracting dependency graphs from gotran ODE models

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 21 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 21.6%
Average: 26.8%
Stargazers count: 27.8%
Forks count: 29.8%
Downloads: 44.8%
Maintainers (1)
Last synced: 12 months ago

Dependencies

.github/workflows/github-pages.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/main.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • codecov/codecov-action v3 composite
setup.py pypi