|
4 | 4 |
|
5 | 5 | # PyDyNo |
6 | 6 |
|
7 | | -Python Dynamic analysis of Biochemical Networks |
8 | | - |
9 | | -The advent of quantitative techniques to probe biomolecular-signaling processes have led to increased use of |
10 | | -mathematical models to extract mechanistic insight from complex datasets. These complex mathematical models |
11 | | -can yield useful insights about intracellular signal execution but the task to identify key molecular drivers |
12 | | -in signal execution, within a complex network, remains a central challenge in quantitative biology. This challenge |
13 | | -is compounded by the fact that cell-to-cell variability within a cell population could yield multiple signal |
14 | | -execution modes and thus multiple potential drivers in signal execution. Here we present a novel approach to |
15 | | -identify signaling drivers and characterize dynamic signal processes within a network. Our method, PyDyNo, |
16 | | -combines physical chemistry, statistical clustering, and tropical algebra formalisms to identify interactions |
17 | | -that drive time-dependent behavior in signaling pathways. |
| 7 | +Python Dynamic analysis of Biochemical Networks (PyDyNo) is an open source python library for the analysis of |
| 8 | +signal execution in network-driven biological processes. PyDyNo supports the analysis of [PySB](http://pysb.org/) |
| 9 | +and [SBML](http://sbml.org/Main_Page) models. |
18 | 10 |
|
| 11 | +## Installation |
| 12 | + |
| 13 | +### From PyPI |
| 14 | + |
| 15 | +```bash |
| 16 | +> pip install pydyno |
| 17 | +``` |
| 18 | + |
| 19 | +### Installing the latest unreleased version |
| 20 | + |
| 21 | +```bash |
| 22 | +> pip install git+git:https://github.com/LoLab-VU/pydyno.git |
| 23 | +``` |
| 24 | + |
| 25 | +### Installing from source folder |
| 26 | + |
| 27 | +- Download and extract pydyno |
| 28 | +- Navigate into the pydyno directory |
| 29 | +- Install (Python is necessary for this step): |
| 30 | + |
| 31 | +```bash |
| 32 | +> python setup.py install |
| 33 | +``` |
| 34 | + |
| 35 | +## How to use PyDyNo |
| 36 | + |
| 37 | +# Import libraries |
| 38 | + |
| 39 | + |
| 40 | +```python |
| 41 | +import pydyno |
| 42 | +import numpy as np |
| 43 | +from os.path import dirname, join |
| 44 | +from IPython.display import Image |
| 45 | +from pydyno.examples.double_enzymatic.mm_two_paths_model import model |
| 46 | +from pydyno.visualize_simulations import VisualizeSimulations |
| 47 | +from pydyno.discretization import PysbDomPath |
| 48 | +from pydyno.visualize_discretization import visualization_path |
| 49 | +from pysb.simulator import ScipyOdeSimulator |
| 50 | +%matplotlib inline |
| 51 | +``` |
| 52 | + |
| 53 | +# Load the calibrated parameters and simulate the model with 100 different parameter sets |
| 54 | + |
| 55 | + |
| 56 | +```python |
| 57 | +# import calibrated parameters |
| 58 | +module_path = dirname(pydyno.__file__) |
| 59 | +pars_path = join(module_path, "examples", "double_enzymatic", "calibrated_pars.npy") |
| 60 | +pars = np.load(pars_path) |
| 61 | +``` |
| 62 | + |
| 63 | + |
| 64 | +```python |
| 65 | +# define time for the simulation and simulate model |
| 66 | +tspan = np.linspace(0, 100, 101) |
| 67 | +sim = ScipyOdeSimulator(model, tspan=tspan).run(param_values=pars[:100]) |
| 68 | +``` |
| 69 | + |
| 70 | +# Visualize the dynamics of the model |
| 71 | + |
| 72 | +```python |
| 73 | +vt = VisualizeSimulations(model, sim, clusters=None) |
| 74 | +vt.plot_cluster_dynamics(components=[5]) |
| 75 | +# This saves the figure in the local folder with the filename comp0_cluster0.png |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | +# Obtain the dominant paths for each of the simulations¶ |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | +```python |
| 84 | +dp = PysbDomPath(model, sim) |
| 85 | +signatures, paths = dp.get_path_signatures('s5', 'production', depth=2, dom_om=1) |
| 86 | +signatures.sequences.head() |
| 87 | +``` |
| 88 | + |
| 89 | +# Obtain distance matrix and optimal number of clusters (execution modes) |
| 90 | + |
| 91 | +```python |
| 92 | +signatures.dissimilarity_matrix() |
| 93 | +signatures.silhouette_score_agglomerative_range(4) |
| 94 | +``` |
| 95 | + |
| 96 | +```python |
| 97 | +# Select the number of cluster with highest silhouette score |
| 98 | +signatures.agglomerative_clustering(2) |
| 99 | +``` |
| 100 | + |
| 101 | + |
| 102 | +```python |
| 103 | +# Plot signatures |
| 104 | +signatures.plot_sequences() |
| 105 | +# File is saved to the local directory with the filename modal.png |
| 106 | +``` |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +```python |
| 111 | +paths |
| 112 | +``` |
| 113 | + {2: [OrderedDict([('s5', [['s3'], ['s4']])]), |
| 114 | + OrderedDict([('s3', [['s0', 's1']]), ('s4', [['s0', 's2']])])], |
| 115 | + 1: [OrderedDict([('s5', [['s4']])]), OrderedDict([('s4', [['s0', 's2']])])], |
| 116 | + 0: [OrderedDict([('s5', [['s3']])]), OrderedDict([('s3', [['s0', 's1']])])]} |
| 117 | + |
| 118 | +# Visualize execution modes |
| 119 | + |
| 120 | +```python |
| 121 | +visualization_path(model, |
| 122 | + path=paths[0], |
| 123 | + target_node='s5', |
| 124 | + type_analysis='production', |
| 125 | + filename='path_0.png') |
| 126 | +# Visualization is saved to local directory wit the filename path0.png |
| 127 | +``` |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | +```python |
| 132 | +visualization_path(model, |
| 133 | + path=paths[1], |
| 134 | + target_node='s5', |
| 135 | + type_analysis='production', |
| 136 | + filename='path_1.png') |
| 137 | +# Visualization is saved to local directory wit the filename path1.png |
| 138 | +``` |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | +```python |
| 143 | +visualization_path(model, |
| 144 | + path=paths[2], |
| 145 | + target_node='s5', |
| 146 | + type_analysis='production', |
| 147 | + filename='path_2.png') |
| 148 | +# Visualization is saved to local directory wit the filename path2.png |
| 149 | +``` |
| 150 | + |
| 151 | + |
0 commit comments