https://github.com/computationalphysiology/modelgraph
A tool for visualizing dependencies between different components of your model
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
Repository
A tool for visualizing dependencies between different components of your model
Basic Info
- Host: GitHub
- Owner: ComputationalPhysiology
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://computationalphysiology.github.io/modelgraph/
- Size: 1.78 MB
Statistics
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
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
Authors
- Henrik Finsberg (henriknf@simula.no)
License
MIT
Owner
- Name: Computational Physiology at Simula Research Laboratory
- Login: ComputationalPhysiology
- Kind: organization
- Location: Fornebu, Norway
- Website: https://computationalphysiology.github.io
- Repositories: 51
- Profile: https://github.com/ComputationalPhysiology
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 | 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
- Homepage: https://github.com/ComputationalPhysiology/modelgraph
- Documentation: https://modelgraph.readthedocs.io/
- License: MIT
-
Latest release: 1.0.1
published over 4 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- peaceiris/actions-gh-pages v3 composite
- actions/checkout v2 composite
- actions/setup-python v1 composite
- codecov/codecov-action v3 composite