Skip to content

Commit 383acb0

Browse files
committed
Rename rename dingo package to dingo-walk
1 parent a965357 commit 383acb0

21 files changed

+1041
-874
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

33
**dingo** is a Python package that analyzes metabolic networks.
44
It relies on high dimensional sampling with Markov Chain Monte Carlo (MCMC)
@@ -290,7 +290,7 @@ plot_histogram(
290290

291291
The default number of bins is 60. dingo 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

@@ -314,6 +314,6 @@ plot_copula(data_flux1, data_flux2, n=10)
314314

315315
The default number of cells is 5x5=25. dingo 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

dingo/MetabolicNetwork.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def dingo_main():
7575

7676
# Move to the output directory
7777
os.chdir(output_path_dir)
78-
78+
7979
set_default_solver(args.solver)
8080

8181
if args.model_name is None:
@@ -133,7 +133,7 @@ def dingo_main():
133133
raise Exception("An unknown format file given.")
134134

135135
model.set_solver(args.solver)
136-
136+
137137
result_obj = model.fva()
138138

139139
with open("dingo_fva_" + name + ".pckl", "wb") as dingo_fva_file:
@@ -147,7 +147,7 @@ def dingo_main():
147147
model = MetabolicNetwork.fom_mat(args.metabolic_network)
148148
else:
149149
raise Exception("An unknown format file given.")
150-
150+
151151
model.set_solver(args.solver)
152152

153153
result_obj = model.fba()

dingo/bindings/bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ void HPolytopeCPP::apply_rounding(int rounding_method, double* new_A, double* ne
461461

462462
// run the rounding method
463463
if (rounding_method == 1) { // max ellipsoid
464-
round_res = inscribed_ellipsoid_rounding<MT, VT, NT>(P, CheBall.first);
464+
round_res = inscribed_ellipsoid_rounding<MT, VT, NT, decltype(P), Point, 2>(P, CheBall.first);
465465

466466
} else if (rounding_method == 2) { // isotropization
467467
round_res = svd_rounding<AcceleratedBilliardWalk, MT, VT>(P, CheBall, 1, rng);

dingo/illustrations.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def plot_copula(data_flux1, data_flux2, n = 5, width = 900 , height = 600, expor
3232
fig = go.Figure(
3333
data = [go.Surface(z=copula)],
3434
layout = go.Layout(
35-
height = height,
35+
height = height,
3636
width = width,
3737
)
3838
)
@@ -48,7 +48,7 @@ def plot_copula(data_flux1, data_flux2, n = 5, width = 900 , height = 600, expor
4848
margin=dict(r=30, b=30, l=30, t=50))
4949

5050
fig.layout.template = None
51-
51+
5252
fig.show()
5353
fig_name = data_flux1[1] + "_" + data_flux2[1] + "_copula." + export_format
5454

@@ -97,7 +97,7 @@ def plot_corr_matrix(corr_matrix, reactions, removed_reactions=[], format="svg")
9797
removed_reactions -- A list with the removed reactions in case of a preprocess.
9898
If provided removed reactions are not plotted.
9999
"""
100-
100+
101101
sns_colormap = [[0.0, '#3f7f93'],
102102
[0.1, '#6397a7'],
103103
[0.2, '#88b1bd'],
@@ -109,26 +109,26 @@ def plot_corr_matrix(corr_matrix, reactions, removed_reactions=[], format="svg")
109109
[0.8, '#e8848b'],
110110
[0.9, '#e15e68'],
111111
[1.0, '#da3b46']]
112-
112+
113113
if removed_reactions != 0:
114114
for reaction in reactions:
115115
index = reactions.index(reaction)
116116
if reaction in removed_reactions:
117117
reactions[index] = None
118-
119-
fig = px.imshow(corr_matrix,
118+
119+
fig = px.imshow(corr_matrix,
120120
color_continuous_scale = sns_colormap,
121121
x = reactions, y = reactions, origin="upper")
122-
122+
123123
fig.update_layout(
124124
xaxis=dict(tickfont=dict(size=5)),
125125
yaxis=dict(tickfont=dict(size=5)),
126126
width=900, height=900, plot_bgcolor="rgba(0,0,0,0)")
127-
127+
128128
fig.update_traces(xgap=1, ygap=1, hoverongaps=False)
129-
129+
130130
fig.show()
131-
131+
132132
fig_name = "CorrelationMatrix." + format
133133
pio.write_image(fig, fig_name, scale=2)
134134

@@ -141,18 +141,18 @@ def plot_dendrogram(dissimilarity_matrix, reactions , plot_labels=False, t=2.0,
141141
dissimilarity_matrix -- A matrix produced from the "cluster_corr_reactions" function
142142
reactions -- A list with the model's reactions
143143
plot_labels -- A boolean variable that if True plots the reactions labels in the dendrogram
144-
t -- A threshold that defines a threshold that cuts the dendrogram
144+
t -- A threshold that defines a threshold that cuts the dendrogram
145145
at a specific height and colors the occuring clusters accordingly
146-
linkage -- linkage defines the type of linkage.
146+
linkage -- linkage defines the type of linkage.
147147
Available linkage types are: single, average, complete, ward.
148148
"""
149149

150150
fig = ff.create_dendrogram(dissimilarity_matrix,
151151
labels=reactions,
152-
linkagefun=lambda x: hierarchy.linkage(x, linkage),
152+
linkagefun=lambda x: hierarchy.linkage(x, linkage),
153153
color_threshold=t)
154154
fig.update_layout(width=800, height=800)
155-
155+
156156
if plot_labels == False:
157157
fig.update_layout(
158158
xaxis=dict(
@@ -166,9 +166,9 @@ def plot_dendrogram(dissimilarity_matrix, reactions , plot_labels=False, t=2.0,
166166
yaxis=dict(
167167
title_font=dict(size=10),
168168
tickfont=dict(size=8) ) )
169-
169+
170170
fig.show()
171-
171+
172172

173173

174174
def plot_graph(G, pos):
@@ -184,24 +184,24 @@ def plot_graph(G, pos):
184184
for u, v, data in G.edges(data=True):
185185
x0, y0 = pos[u]
186186
x1, y1 = pos[v]
187-
187+
188188
edge_color = 'blue' if data['weight'] > 0 else 'red'
189-
190-
fig.add_trace(go.Scatter(x=[x0, x1], y=[y0, y1], mode='lines',
191-
line=dict(width=abs(data['weight']) * 1,
189+
190+
fig.add_trace(go.Scatter(x=[x0, x1], y=[y0, y1], mode='lines',
191+
line=dict(width=abs(data['weight']) * 1,
192192
color=edge_color), hoverinfo='none',
193193
showlegend=False))
194194

195195
for node in G.nodes():
196196
x, y = pos[node]
197197
node_name = G.nodes[node].get('name', f'Node {node}')
198-
199-
fig.add_trace(go.Scatter(x=[x], y=[y], mode='markers',
198+
199+
fig.add_trace(go.Scatter(x=[x], y=[y], mode='markers',
200200
marker=dict(size=10),
201201
text=[node_name],
202202
textposition='top center',
203203
name = node_name,
204204
showlegend=False))
205-
205+
206206
fig.update_layout(width=800, height=800)
207-
fig.show()
207+
fig.show()

dingo/loading_models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def read_json_file(input_file):
2323
input_file -- a json file that contains the information about a mettabolic network, for example see http://bigg.ucsd.edu/models
2424
"""
2525

26-
try:
26+
try:
2727
cobra.io.load_matlab_model( input_file )
2828
except:
2929
cobra_config = cobra.Configuration()
@@ -45,7 +45,7 @@ def read_mat_file(input_file):
4545
Keyword arguments:
4646
input_file -- a mat file that contains a MATLAB structure with the information about a mettabolic network, for example see http://bigg.ucsd.edu/models
4747
"""
48-
try:
48+
try:
4949
cobra.io.load_matlab_model( input_file )
5050
except:
5151
cobra_config = cobra.Configuration()
@@ -56,8 +56,8 @@ def read_mat_file(input_file):
5656
return (parse_cobra_model( model ))
5757

5858
def read_sbml_file(input_file):
59-
"""A Python function, based on the cobra.io.read_sbml_model() function of cabrapy
60-
and the extract_polytope() function of PolyRound
59+
"""A Python function, based on the cobra.io.read_sbml_model() function of cabrapy
60+
and the extract_polytope() function of PolyRound
6161
(https://gitlab.com/csb.ethz/PolyRound/-/blob/master/PolyRound/static_classes/parse_sbml_stoichiometry.py)
6262
to read an SBML file (.xml) and return:
6363
(a) lower/upper flux bounds
@@ -68,10 +68,10 @@ def read_sbml_file(input_file):
6868
(f) the objective function to maximize the biomass pseudoreaction
6969
7070
Keyword arguments:
71-
input_file -- a xml file that contains an SBML model with the information about a mettabolic network, for example see:
71+
input_file -- a xml file that contains an SBML model with the information about a mettabolic network, for example see:
7272
https://github.com/VirtualMetabolicHuman/AGORA/blob/master/CurrentVersion/AGORA_1_03/AGORA_1_03_sbml/Abiotrophia_defectiva_ATCC_49176.xml
7373
"""
74-
try:
74+
try:
7575
cobra.io.read_sbml_model( input_file )
7676
except:
7777
cobra_config = cobra.Configuration()

0 commit comments

Comments
 (0)