Skip to content

Commit 3b11bcf

Browse files
committed
Rename dingo to dingo_walk
1 parent a965357 commit 3b11bcf

37 files changed

+1291
-1119
lines changed

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# dingo : a python library for metabolic networks sampling and analysis
2-
# dingo is part of GeomScale project
1+
# dingo_walk : a python library for metabolic networks sampling and analysis
2+
# dingo_walk is part of GeomScale project
33

44
# Copyright (c) 2021-2022 Vissarion Fisikopoulos
55

66
# Licensed under GNU LGPL.3, see LICENCE file
77

8-
name: dingo-ubuntu
8+
name: dingo_walk-ubuntu
99

1010
on: [push, pull_request]
1111

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
build
22
dist
33
boost_1_76_0
4-
dingo.egg-info
4+
dingo_walk.egg-info
55
*.pyc
66
*.so
77
volestipy.cpp
@@ -12,4 +12,4 @@ volestipy.egg-info
1212
venv
1313
lp_solve_5.5/
1414
.devcontainer/
15-
.github/dependabot.yml
15+
.github/dependabot.yml

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<p align="center"><img src="doc/logo/dingo.jpg" width="260" height="260"></p>
1+
<p align="center"><img src="https://raw.githubusercontent.com/GeomScale/dingo/refs/heads/develop/doc/logo/dingo.jpg" width="260" height="260"></p>
22

3-
**dingo** is a Python package that analyzes metabolic networks.
3+
**dingo_walk** is a Python package that analyzes metabolic networks.
44
It relies on high dimensional sampling with Markov Chain Monte Carlo (MCMC)
55
methods and fast optimization methods to analyze the possible states of a
6-
metabolic network. To perform MCMC sampling, `dingo` relies on the `C++` library
6+
metabolic network. To perform MCMC sampling, `dingo_walk` relies on the `C++` library
77
[volesti](https://github.com/GeomScale/volume_approximation), which provides
88
several algorithms for sampling convex polytopes.
9-
`dingo` also performs two standard methods to analyze the flux space of a
9+
`dingo_walk` also performs two standard methods to analyze the flux space of a
1010
metabolic network, namely Flux Balance Analysis and Flux Variability Analysis.
1111

12-
`dingo` is part of [GeomScale](https://geomscale.github.io/) project.
12+
`dingo_walk` is part of [GeomScale](https://geomscale.github.io/) project.
1313

14-
[![unit-tests](https://github.com/GeomScale/dingo/workflows/dingo-ubuntu/badge.svg)](https://github.com/GeomScale/dingo/actions?query=workflow%3Adingo-ubuntu)
14+
[![unit-tests](https://github.com/GeomScale/dingo/workflows/dingo_walk-ubuntu/badge.svg)](https://github.com/GeomScale/dingo/actions?query=workflow%3Adingo_walk-ubuntu)
1515
[![Tutorial In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/GeomScale/dingo/blob/develop/tutorials/dingo_tutorial.ipynb)
1616
[![Chat](https://badges.gitter.im/geomscale.png)](https://gitter.im/GeomScale/community?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
1717

@@ -28,7 +28,7 @@ If you have a different version of Python installed, you'll need to install it (
2828

2929

3030

31-
To load the submodules that dingo uses, run
31+
To load the submodules that dingo_walk uses, run
3232

3333
````bash
3434
git submodule update --init
@@ -55,7 +55,7 @@ sudo apt-get update -y
5555
sudo apt-get install -y libsuitesparse-dev
5656
```
5757

58-
To install the Python dependencies, `dingo` is using [Poetry](https://python-poetry.org/),
58+
To install the Python dependencies, `dingo_walk` is using [Poetry](https://python-poetry.org/),
5959
```
6060
curl -sSL https://install.python-poetry.org | python3 - --version 1.3.2
6161
poetry shell
@@ -98,28 +98,28 @@ python3 tests/sampling.py gurobi
9898
## Tutorial
9999

100100
You can have a look at our [Google Colab notebook](https://colab.research.google.com/github/GeomScale/dingo/blob/develop/tutorials/dingo_tutorial.ipynb)
101-
on how to use `dingo`.
101+
on how to use `dingo_walk`.
102102

103103

104104
## Documentation
105105

106106

107-
It quite simple to use dingo in your code. In general, dingo provides two classes:
107+
It quite simple to use dingo_walk in your code. In general, dingo_walk provides two classes:
108108

109109
- `metabolic_network` represents a metabolic network
110110
- `polytope_sampler` can be used to sample from the flux space of a metabolic network or from a general convex polytope.
111111

112-
The following script shows how you could sample steady states of a metabolic network with dingo. To initialize a metabolic network object you have to provide the path to the `json` file as those in [BiGG](http://bigg.ucsd.edu/models) dataset or the `mat` file (using the `matlab` wrapper in folder `/ext_data` to modify a standard `mat` file of a model as those in BiGG dataset):
112+
The following script shows how you could sample steady states of a metabolic network with dingo_walk. To initialize a metabolic network object you have to provide the path to the `json` file as those in [BiGG](http://bigg.ucsd.edu/models) dataset or the `mat` file (using the `matlab` wrapper in folder `/ext_data` to modify a standard `mat` file of a model as those in BiGG dataset):
113113

114114
```python
115-
from dingo import MetabolicNetwork, PolytopeSampler
115+
from dingo_walk import MetabolicNetwork, PolytopeSampler
116116

117117
model = MetabolicNetwork.from_json('path/to/model_file.json')
118118
sampler = PolytopeSampler(model)
119119
steady_states = sampler.generate_steady_states()
120120
```
121121

122-
`dingo` can also load a model given in `.sbml` format using the following command,
122+
`dingo_walk` can also load a model given in `.sbml` format using the following command,
123123

124124
```python
125125
model = MetabolicNetwork.from_sbml('path/to/model_file.sbml')
@@ -147,10 +147,10 @@ The default option is to run the sequential [Multiphase Monte Carlo Sampling alg
147147

148148
#### Rounding the polytope
149149

150-
`dingo` provides three methods to round a polytope: (i) Bring the polytope to John position by apllying to it the transformation that maps the largest inscribed ellipsoid of the polytope to the unit ball, (ii) Bring the polytope to near-isotropic position by using uniform sampling with Billiard Walk, (iii) Apply to the polytope the transformation that maps the smallest enclosing ellipsoid of a uniform sample from the interior of the polytope to the unit ball.
150+
`dingo_walk` provides three methods to round a polytope: (i) Bring the polytope to John position by apllying to it the transformation that maps the largest inscribed ellipsoid of the polytope to the unit ball, (ii) Bring the polytope to near-isotropic position by using uniform sampling with Billiard Walk, (iii) Apply to the polytope the transformation that maps the smallest enclosing ellipsoid of a uniform sample from the interior of the polytope to the unit ball.
151151

152152
```python
153-
from dingo import MetabolicNetwork, PolytopeSampler
153+
from dingo_walk import MetabolicNetwork, PolytopeSampler
154154

155155
model = MetabolicNetwork.from_json('path/to/model_file.json')
156156
sampler = PolytopeSampler(model)
@@ -170,31 +170,31 @@ samples = sample_from_polytope(A_rounded, b_rounded)
170170
Last you can map the samples back to steady states,
171171

172172
```python
173-
from dingo import map_samples_to_steady_states
173+
from dingo_walk import map_samples_to_steady_states
174174

175175
steady_states = map_samples_to_steady_states(samples, N, N_shift, Tr, Tr_shift)
176176
```
177177

178178
#### Other MCMC sampling methods
179179

180-
To use any other MCMC sampling method that `dingo` provides you can use the following piece of code:
180+
To use any other MCMC sampling method that `dingo_walk` provides you can use the following piece of code:
181181

182182
```python
183183
sampler = polytope_sampler(model)
184184
steady_states = sampler.generate_steady_states_no_multiphase() #default parameters (method = 'billiard_walk', n=1000, burn_in=0, thinning=1)
185185
```
186186

187-
The MCMC methods that dingo (through `volesti` library) provides are the following: (i) 'cdhr': Coordinate Directions Hit-and-Run, (ii) 'rdhr': Random Directions Hit-and-Run,
187+
The MCMC methods that dingo_walk (through `volesti` library) provides are the following: (i) 'cdhr': Coordinate Directions Hit-and-Run, (ii) 'rdhr': Random Directions Hit-and-Run,
188188
(iii) 'billiard_walk', (iv) 'ball_walk', (v) 'dikin_walk', (vi) 'john_walk', (vii) 'vaidya_walk'.
189189

190190

191191

192192
#### Switch the linear programming solver
193193

194-
We use `pyoptinterface` to interface with the linear programming solvers. To switch the solver that `dingo` uses, you can use the `set_default_solver` function. The default solver is `highs` and you can switch to `gurobi` by running,
194+
We use `pyoptinterface` to interface with the linear programming solvers. To switch the solver that `dingo_walk` uses, you can use the `set_default_solver` function. The default solver is `highs` and you can switch to `gurobi` by running,
195195

196196
```python
197-
from dingo import set_default_solver
197+
from dingo_walk import set_default_solver
198198
set_default_solver("gurobi")
199199
```
200200

@@ -205,7 +205,7 @@ You can also switch to other solvers that `pyoptinterface` supports, but we reco
205205
To apply FVA and FBA methods you have to use the class `metabolic_network`,
206206

207207
```python
208-
from dingo import MetabolicNetwork
208+
from dingo_walk import MetabolicNetwork
209209

210210
model = MetabolicNetwork.from_json('path/to/model_file.json')
211211
fva_output = model.fva()
@@ -233,7 +233,7 @@ while the output vectors are the same with the previous example.
233233

234234
### Set the restriction in the flux space
235235

236-
FVA and FBA, restrict the flux space to the set of flux vectors that have an objective value equal to the optimal value of the function. dingo allows for a more relaxed option where you could ask for flux vectors that have an objective value equal to at least a percentage of the optimal value,
236+
FVA and FBA, restrict the flux space to the set of flux vectors that have an objective value equal to the optimal value of the function. dingo_walk allows for a more relaxed option where you could ask for flux vectors that have an objective value equal to at least a percentage of the optimal value,
237237

238238
```python
239239
model.set_opt_percentage(90)
@@ -273,7 +273,7 @@ steady_states = sampler.generate_steady_states()
273273
The generated steady states can be used to estimate the marginal density function of each flux. You can plot the histogram using the samples,
274274

275275
```python
276-
from dingo import plot_histogram
276+
from dingo_walk import plot_histogram
277277

278278
model = MetabolicNetwork.from_json('path/to/e_coli_core.json')
279279
sampler = PolytopeSampler(model)
@@ -288,16 +288,16 @@ plot_histogram(
288288
)
289289
```
290290

291-
The default number of bins is 60. dingo uses the package `matplotlib` for plotting.
291+
The default number of bins is 60. dingo_walk uses the package `matplotlib` for plotting.
292292

293-
![histogram](./doc/e_coli_aconta.png)
293+
![histogram](https://raw.githubusercontent.com/GeomScale/dingo/refs/heads/develop/doc/e_coli_aconta.png)
294294

295295
### Plot a copula between two fluxes
296296

297297
The generated steady states can be used to estimate and plot the copula between two fluxes. You can plot the copula using the samples,
298298

299299
```python
300-
from dingo import plot_copula
300+
from dingo_walk import plot_copula
301301

302302
model = MetabolicNetwork.from_json('path/to/e_coli_core.json')
303303
sampler = PolytopeSampler(model)
@@ -312,8 +312,8 @@ data_flux1=[steady_states[13],reactions[13]]
312312
plot_copula(data_flux1, data_flux2, n=10)
313313
```
314314

315-
The default number of cells is 5x5=25. dingo uses the package `plotly` for plotting.
315+
The default number of cells is 5x5=25. dingo_walk uses the package `plotly` for plotting.
316316

317-
![histogram](./doc/aconta_ppc_copula.png)
317+
![histogram](https://raw.githubusercontent.com/GeomScale/dingo/refs/heads/develop/doc/aconta_ppc_copula.png)
318318

319319

build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def build(setup_kwargs):
1919
# This function will be executed in setup.py:
2020
def build(setup_kwargs):
2121
# The file you want to compile
22-
extensions = ["dingo/volestipy.pyx"]
22+
extensions = ["dingo_walk/volestipy.pyx"]
2323

2424
# gcc arguments hack: enable optimizations
2525
os.environ["CFLAGS"] = [

dingo/__main__.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

dingo/MetabolicNetwork.py renamed to dingo_walk/MetabolicNetwork.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# dingo : a python library for metabolic networks sampling and analysis
2-
# dingo is part of GeomScale project
1+
# dingo_walk : a python library for metabolic networks sampling and analysis
2+
# dingo_walk is part of GeomScale project
33

44
# Copyright (c) 2021 Apostolos Chalkis
55
# Copyright (c) 2021 Vissarion Fisikopoulos
@@ -11,8 +11,8 @@
1111
import sys
1212
from typing import Dict
1313
import cobra
14-
from dingo.loading_models import read_json_file, read_mat_file, read_sbml_file, parse_cobra_model
15-
from dingo.pyoptinterface_based_impl import fba,fva,inner_ball,remove_redundant_facets
14+
from dingo_walk.loading_models import read_json_file, read_mat_file, read_sbml_file, parse_cobra_model
15+
from dingo_walk.pyoptinterface_based_impl import fba,fva,inner_ball,remove_redundant_facets
1616

1717
class MetabolicNetwork:
1818
def __init__(self, tuple_args):
@@ -250,18 +250,18 @@ def set_active_bound(reaction: str, reac_index: int, bound: float) -> None:
250250
# Turn off reactions not present in media
251251
for rxn_id in exchange_rxns - frozen_media_rxns:
252252
"""
253-
is_export for us, needs to check on the S
254-
order reactions to their lb and ub
253+
is_export for us, needs to check on the S
254+
order reactions to their lb and ub
255255
"""
256256
# is_export = rxn.reactants and not rxn.products
257257
reac_index = self._reactions.index(rxn_id)
258-
products = np.any(self._S[:,reac_index] > 0)
258+
products = np.any(self._S[:,reac_index] > 0)
259259
reactants_exist = np.any(self._S[:,reac_index] < 0)
260260
is_export = True if not products and reactants_exist else False
261261
set_active_bound(
262262
rxn_id, reac_index, min(0.0, -self._lb[reac_index] if is_export else self._ub[reac_index])
263263
)
264-
264+
265265
def set_solver(self, solver: str):
266266
self._parameters["solver"] = solver
267267

dingo/PolytopeSampler.py renamed to dingo_walk/PolytopeSampler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# dingo : a python library for metabolic networks sampling and analysis
2-
# dingo is part of GeomScale project
1+
# dingo_walk : a python library for metabolic networks sampling and analysis
2+
# dingo_walk is part of GeomScale project
33

44
# Copyright (c) 2021 Apostolos Chalkis
55
# Copyright (c) 2024 Ke Shi
@@ -10,14 +10,14 @@
1010
import numpy as np
1111
import warnings
1212
import math
13-
from dingo.MetabolicNetwork import MetabolicNetwork
14-
from dingo.utils import (
13+
from dingo_walk.MetabolicNetwork import MetabolicNetwork
14+
from dingo_walk.utils import (
1515
map_samples_to_steady_states,
1616
get_matrices_of_low_dim_polytope,
1717
get_matrices_of_full_dim_polytope,
1818
)
1919

20-
from dingo.pyoptinterface_based_impl import fba,fva,inner_ball,remove_redundant_facets
20+
from dingo_walk.pyoptinterface_based_impl import fba,fva,inner_ball,remove_redundant_facets
2121

2222
from volestipy import HPolytope
2323

0 commit comments

Comments
 (0)