Skip to content

Commit 8c42fd6

Browse files
committed
Update essential reactions in spreadsheets. Include online web docs
1 parent bd269b2 commit 8c42fd6

11 files changed

+90
-54
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The computation of vulnerabilities can also be exploited programmatically via th
3535

3636
## Table of Contents
3737
- [License](#license)
38+
- [Online Web](#online-web)
3839
- [Install](#Install)
3940
- [Quickstart](#Quickstart)
4041
- [Documentation](#documentation)
@@ -48,6 +49,10 @@ The computation of vulnerabilities can also be exploited programmatically via th
4849

4950
CONTRABASS is released under [GPLv3 license](LICENSE).
5051

52+
## Online Web
53+
54+
CONTRABASS can also be executed through the [CONTRABASS Online Web App (http://contrabass.unizar.es)](http://contrabass.unizar.es).
55+
5156
## Install
5257
```CONTRABASS``` can be installed via **pip** package manager:
5358
```shell
@@ -59,7 +64,7 @@ CONTRABASS is released under [GPLv3 license](LICENSE).
5964
Generate report on vulnerabilities on input model ```MODEL.xml```
6065

6166
```shell
62-
$ contrabass report critial-reactions MODEL.xml
67+
$ contrabass report critical-reactions MODEL.xml
6368
```
6469

6570
Generate report on growth-dependent reactions on input model ```MODEL.xml```

docs/source/ComputeGrowthDependent.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _growth-op-documentation:
2+
13
5. Compute growth dependent reactions
24
========================================
35
.

docs/source/License.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
9. License
2+
10. License
33
===============
44

55
CONTRABASS is released under GPLv3_.

docs/source/OnlineWebApp.rst

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
9. Online Web App
3+
===============
4+
5+
CONTRABASS can also be executed though the online web application at CONTRABASS-Online_.
6+
7+
9.1. Usage
8+
------------
9+
10+
9.1.1. Submit model
11+
*********************
12+
13+
To load a model in the web app drag-and-drop a valid SBML model to the box on the left (see image below).
14+
CONTRABASS also comes with 4 sample models to try out the tool. To use one of the 4 sample models, simply click on one
15+
of the ```Try this model``` buttons in the box on the right (see image below). (see image below).
16+
17+
.. image:: _static/step1.png
18+
:align: center
19+
:alt: step 1
20+
21+
9.1.2. Run operation
22+
************************
23+
24+
If the model is correctly formatted, CONTRABASS will read the model and notify when it is ready.
25+
When the read completes successfully, a row similar to the following with the model data will appear on the page:
26+
27+
.. image:: _static/step2.png
28+
:align: center
29+
:alt: step 2
30+
.
31+
CONTRABASS allows you to execute the two operations explained above in the documentation, that is:
32+
- **Compute growth dependent reactions**: produce an overview of the critical reactions in the model and explore how they vary when the growth constraints vary (See :ref:`growth-op-documentation`).
33+
- **Compute critical reactions**: compute sets of critical reactions and their intersections for a given growth rate (See :ref:`vulnerabilities-documentation`).
34+
35+
If we click on one of the 2 accordions showing the 2 possible operations, they will expand showing the optional parameters
36+
that we can adjust before starting the execution (see image below).
37+
Once we are done with the parameters, to start the execution simply click the ```Execute``` button.
38+
39+
.. image:: _static/step3.png
40+
:align: center
41+
:alt: step 3
42+
43+
While the selected operation is being executed, the page will show feedback on the computations performed:
44+
45+
.. image:: _static/step4.png
46+
:align: center
47+
:alt: step 4
48+
49+
9.1.3. Download reports
50+
************************
51+
52+
Once the selected operation ends its execution, the web will display 2 buttons (see image below) to download different reports:
53+
54+
- **Download spreadsheet**: Download the spreadsheet report of the computation.
55+
- **View report**: View and online interactive report with the result of the computation.
56+
57+
58+
.. image:: _static/step5.png
59+
:align: center
60+
:alt: step 5
61+
62+
63+
64+
.. _CONTRABASS-Online: https://github.com/openCONTRABASS/CONTRABASS/blob/master/LICENSE
65+

docs/source/_static/step1.png

50.7 KB
Loading

docs/source/_static/step2.png

23.6 KB
Loading

docs/source/_static/step3.png

19.4 KB
Loading

docs/source/_static/step4.png

69.3 KB
Loading

docs/source/index.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
Welcome to CONRTABASS's documentation!
6+
Welcome to CONTRABASS's documentation!
77
========================================
88

99
.. toctree::
1010
:maxdepth: 4
1111
:glob:
1212

1313
Introduction
14+
OnlineWebApp
1415
Installation
1516
ToolCommands
1617
ComputeVulnerabilities

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = contrabass
33
url = https://github.com/openCONTRABASS/CONTRABASS
4-
version = 0.2.0
4+
version = 0.2.1
55
author = Alex Oarga
66
author_email = [email protected]
77
description = Constraint-based model vulnerabilities analysis

src/contrabass/core/Spreadsheet.py

+13-50
Original file line numberDiff line numberDiff line change
@@ -834,24 +834,7 @@ def __aux_spreadsheet_get_data(self, state):
834834
if state.essential_genes() is not None:
835835
essential_genes = [g.id for g in state.essential_genes()]
836836

837-
er_g0 = []
838-
er_g005 = []
839-
objective_value = state.objective_value()
840-
if state.objective_value() is not None:
841-
if not isnan(state.objective_value()):
842-
objective_value_005 = state.objective_value() * 0.05
843-
else:
844-
objective_value_005 = 0
845-
for reaction, value in knockout_growth.items():
846-
if not isnan(objective_value):
847-
if isnan(value) or value == 0:
848-
er_g0.append(reaction)
849-
er_g005.append(reaction)
850-
elif value < objective_value_005:
851-
er_g005.append(reaction)
852-
else:
853-
er_g0.append(reaction)
854-
er_g005.append(reaction)
837+
essential_reactions = state.essential_reactions()
855838

856839
reversibles = state.reversible_reactions()
857840

@@ -862,9 +845,7 @@ def __aux_spreadsheet_get_data(self, state):
862845
list(chokepoints_dict.keys()),
863846
essential_genes,
864847
genes_reactions_dict,
865-
knockout_growth,
866-
er_g0,
867-
er_g005,
848+
essential_reactions,
868849
reversibles,
869850
dead_reactions,
870851
]
@@ -878,15 +859,9 @@ def __aux_spreadsheet_write_two_model_summary(
878859
sheet.write(x + 3, y + 1, "Chokepoint reactions", style=style)
879860
sheet.write(x + 4, y + 1, "Essential genes", style=style)
880861
sheet.write(x + 5, y + 1, "Essential genes reactions", style=style)
881-
sheet.write(x + 6, y + 1, "Essential reactions (objective=0)", style=style)
882-
sheet.write(
883-
x + 7,
884-
y + 1,
885-
"Essential reactions (objective < 5% max objective)",
886-
style=style,
887-
)
888-
sheet.write(x + 8, y + 1, "Reversible reactions", style=style)
889-
sheet.write(x + 9, y + 1, "Dead reactions", style=style)
862+
sheet.write(x + 6, y + 1, "Essential reactions", style=style)
863+
sheet.write(x + 7, y + 1, "Reversible reactions", style=style)
864+
sheet.write(x + 8, y + 1, "Dead reactions", style=style)
890865
sheet.write(x + 1, y + 2, "Before", style=style)
891866
sheet.write(x + 1, y + 3, "After", style=style)
892867
sheet.write(x + 1, y + 5, "Only before", style=style)
@@ -951,15 +926,9 @@ def __aux_spreadsheet_write_four_model_summary(
951926
sheet.write(x + 3, y + 1, "Chokepoint reactions", style=style)
952927
sheet.write(x + 4, y + 1, "Essential genes", style=style)
953928
sheet.write(x + 5, y + 1, "Essential genes reactions", style=style)
954-
sheet.write(x + 6, y + 1, "Essential reactions (objective=0)", style=style)
955-
sheet.write(
956-
x + 7,
957-
y + 1,
958-
"Essential reactions (objective < 5% max objective)",
959-
style=style,
960-
)
961-
sheet.write(x + 8, y + 1, "Reversible reactions", style=style)
962-
sheet.write(x + 9, y + 1, "Dead reactions", style=style)
929+
sheet.write(x + 6, y + 1, "Essential reactions", style=style)
930+
sheet.write(x + 7, y + 1, "Reversible reactions", style=style)
931+
sheet.write(x + 8, y + 1, "Dead reactions", style=style)
963932

964933
sheet.write(x + 1, y + 2, "Only: M0", style=style)
965934
sheet.write(x + 1, y + 3, "Only: MNODEM", style=style)
@@ -984,8 +953,6 @@ def __aux_spreadsheet_write_four_model_summary(
984953
model_results[2][i],
985954
model_results[3][i],
986955
]
987-
if i == 8:
988-
print(set_list)
989956
self.__aux_write_sets(sheet, x + i + 2, y, set_list)
990957

991958
#
@@ -1100,10 +1067,6 @@ def spreadsheet_write_summary(
11001067
list_model_fvadem_results,
11011068
]
11021069

1103-
# remove essential_reactions list with objective values
1104-
for m in models:
1105-
del m[4]
1106-
11071070
list_metabolites = [
11081071
len(state_initial.metabolites()),
11091072
len(state_dem.metabolites()),
@@ -1119,9 +1082,9 @@ def spreadsheet_write_summary(
11191082

11201083
# 1: list(chokepoints_dict.keys()),
11211084
# 3: genes_reactions_dict,
1122-
# 5: er_g0
1085+
# 4: essential_reactions
11231086
reactions_data = []
1124-
for i in [1, 3, 5]:
1087+
for i in [1, 3, 4]:
11251088
rdl = [
11261089
list_model_initial_results[i],
11271090
list_model_dem_results[i],
@@ -1223,7 +1186,7 @@ def spreadsheet_write_summary(
12231186
style,
12241187
y,
12251188
0,
1226-
"CHOKEPOINT REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)",
1189+
"CHOKEPOINT REACTIONS - ESSENTIAL REACTIONS",
12271190
"Only chokepoints",
12281191
reactions_data[0],
12291192
"Only essential reactions",
@@ -1236,7 +1199,7 @@ def spreadsheet_write_summary(
12361199
style,
12371200
y,
12381201
0,
1239-
"ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)",
1202+
"ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS",
12401203
"Only essential genes reactions",
12411204
reactions_data[1],
12421205
"Only essential reactions",
@@ -1249,7 +1212,7 @@ def spreadsheet_write_summary(
12491212
style,
12501213
y,
12511214
0,
1252-
"CHOKEPOINT REACTIONS - ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)",
1215+
"CHOKEPOINT REACTIONS - ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS",
12531216
"Only chokepoints reactions",
12541217
reactions_data[0],
12551218
"Only essential genes reactions",

0 commit comments

Comments
 (0)