diff --git a/README.md b/README.md index 105372c..9a7918c 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ The computation of vulnerabilities can also be exploited programmatically via th ## Table of Contents - [License](#license) +- [Online Web](#online-web) - [Install](#Install) - [Quickstart](#Quickstart) - [Documentation](#documentation) @@ -48,6 +49,10 @@ The computation of vulnerabilities can also be exploited programmatically via th CONTRABASS is released under [GPLv3 license](LICENSE). +## Online Web + +CONTRABASS can also be executed through the [CONTRABASS Online Web App (http://contrabass.unizar.es)](http://contrabass.unizar.es). + ## Install ```CONTRABASS``` can be installed via **pip** package manager: ```shell @@ -59,7 +64,7 @@ CONTRABASS is released under [GPLv3 license](LICENSE). Generate report on vulnerabilities on input model ```MODEL.xml``` ```shell - $ contrabass report critial-reactions MODEL.xml + $ contrabass report critical-reactions MODEL.xml ``` Generate report on growth-dependent reactions on input model ```MODEL.xml``` diff --git a/docs/source/ComputeGrowthDependent.rst b/docs/source/ComputeGrowthDependent.rst index dd794ce..5e9861e 100644 --- a/docs/source/ComputeGrowthDependent.rst +++ b/docs/source/ComputeGrowthDependent.rst @@ -1,3 +1,5 @@ +.. _growth-op-documentation: + 5. Compute growth dependent reactions ======================================== . diff --git a/docs/source/License.rst b/docs/source/License.rst index ba45aea..22082d7 100644 --- a/docs/source/License.rst +++ b/docs/source/License.rst @@ -1,5 +1,5 @@ -9. License +10. License =============== CONTRABASS is released under GPLv3_. diff --git a/docs/source/OnlineWebApp.rst b/docs/source/OnlineWebApp.rst new file mode 100644 index 0000000..4d52291 --- /dev/null +++ b/docs/source/OnlineWebApp.rst @@ -0,0 +1,65 @@ + +9. Online Web App +=============== + +CONTRABASS can also be executed though the online web application at CONTRABASS-Online_. + +9.1. Usage +------------ + +9.1.1. Submit model +********************* + +To load a model in the web app drag-and-drop a valid SBML model to the box on the left (see image below). +CONTRABASS also comes with 4 sample models to try out the tool. To use one of the 4 sample models, simply click on one +of the ```Try this model``` buttons in the box on the right (see image below). (see image below). + +.. image:: _static/step1.png + :align: center + :alt: step 1 + +9.1.2. Run operation +************************ + +If the model is correctly formatted, CONTRABASS will read the model and notify when it is ready. +When the read completes successfully, a row similar to the following with the model data will appear on the page: + +.. image:: _static/step2.png + :align: center + :alt: step 2 +. +CONTRABASS allows you to execute the two operations explained above in the documentation, that is: + - **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`). + - **Compute critical reactions**: compute sets of critical reactions and their intersections for a given growth rate (See :ref:`vulnerabilities-documentation`). + +If we click on one of the 2 accordions showing the 2 possible operations, they will expand showing the optional parameters +that we can adjust before starting the execution (see image below). +Once we are done with the parameters, to start the execution simply click the ```Execute``` button. + +.. image:: _static/step3.png + :align: center + :alt: step 3 + +While the selected operation is being executed, the page will show feedback on the computations performed: + +.. image:: _static/step4.png + :align: center + :alt: step 4 + +9.1.3. Download reports +************************ + +Once the selected operation ends its execution, the web will display 2 buttons (see image below) to download different reports: + + - **Download spreadsheet**: Download the spreadsheet report of the computation. + - **View report**: View and online interactive report with the result of the computation. + + +.. image:: _static/step5.png + :align: center + :alt: step 5 + + + +.. _CONTRABASS-Online: https://github.com/openCONTRABASS/CONTRABASS/blob/master/LICENSE + diff --git a/docs/source/_static/step1.png b/docs/source/_static/step1.png new file mode 100644 index 0000000..7405942 Binary files /dev/null and b/docs/source/_static/step1.png differ diff --git a/docs/source/_static/step2.png b/docs/source/_static/step2.png new file mode 100644 index 0000000..74f3c1d Binary files /dev/null and b/docs/source/_static/step2.png differ diff --git a/docs/source/_static/step3.png b/docs/source/_static/step3.png new file mode 100644 index 0000000..6819a35 Binary files /dev/null and b/docs/source/_static/step3.png differ diff --git a/docs/source/_static/step4.png b/docs/source/_static/step4.png new file mode 100644 index 0000000..b878a2d Binary files /dev/null and b/docs/source/_static/step4.png differ diff --git a/docs/source/index.rst b/docs/source/index.rst index 102e9ef..bbad721 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,7 +3,7 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to CONRTABASS's documentation! +Welcome to CONTRABASS's documentation! ======================================== .. toctree:: @@ -11,6 +11,7 @@ Welcome to CONRTABASS's documentation! :glob: Introduction + OnlineWebApp Installation ToolCommands ComputeVulnerabilities diff --git a/setup.cfg b/setup.cfg index 359e50a..37019d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] name = contrabass url = https://github.com/openCONTRABASS/CONTRABASS -version = 0.2.0 +version = 0.2.1 author = Alex Oarga author_email = 718123@unizar.es description = Constraint-based model vulnerabilities analysis diff --git a/src/contrabass/core/Spreadsheet.py b/src/contrabass/core/Spreadsheet.py index 4b4a006..9126cd8 100644 --- a/src/contrabass/core/Spreadsheet.py +++ b/src/contrabass/core/Spreadsheet.py @@ -834,24 +834,7 @@ def __aux_spreadsheet_get_data(self, state): if state.essential_genes() is not None: essential_genes = [g.id for g in state.essential_genes()] - er_g0 = [] - er_g005 = [] - objective_value = state.objective_value() - if state.objective_value() is not None: - if not isnan(state.objective_value()): - objective_value_005 = state.objective_value() * 0.05 - else: - objective_value_005 = 0 - for reaction, value in knockout_growth.items(): - if not isnan(objective_value): - if isnan(value) or value == 0: - er_g0.append(reaction) - er_g005.append(reaction) - elif value < objective_value_005: - er_g005.append(reaction) - else: - er_g0.append(reaction) - er_g005.append(reaction) + essential_reactions = state.essential_reactions() reversibles = state.reversible_reactions() @@ -862,9 +845,7 @@ def __aux_spreadsheet_get_data(self, state): list(chokepoints_dict.keys()), essential_genes, genes_reactions_dict, - knockout_growth, - er_g0, - er_g005, + essential_reactions, reversibles, dead_reactions, ] @@ -878,15 +859,9 @@ def __aux_spreadsheet_write_two_model_summary( sheet.write(x + 3, y + 1, "Chokepoint reactions", style=style) sheet.write(x + 4, y + 1, "Essential genes", style=style) sheet.write(x + 5, y + 1, "Essential genes reactions", style=style) - sheet.write(x + 6, y + 1, "Essential reactions (objective=0)", style=style) - sheet.write( - x + 7, - y + 1, - "Essential reactions (objective < 5% max objective)", - style=style, - ) - sheet.write(x + 8, y + 1, "Reversible reactions", style=style) - sheet.write(x + 9, y + 1, "Dead reactions", style=style) + sheet.write(x + 6, y + 1, "Essential reactions", style=style) + sheet.write(x + 7, y + 1, "Reversible reactions", style=style) + sheet.write(x + 8, y + 1, "Dead reactions", style=style) sheet.write(x + 1, y + 2, "Before", style=style) sheet.write(x + 1, y + 3, "After", style=style) sheet.write(x + 1, y + 5, "Only before", style=style) @@ -951,15 +926,9 @@ def __aux_spreadsheet_write_four_model_summary( sheet.write(x + 3, y + 1, "Chokepoint reactions", style=style) sheet.write(x + 4, y + 1, "Essential genes", style=style) sheet.write(x + 5, y + 1, "Essential genes reactions", style=style) - sheet.write(x + 6, y + 1, "Essential reactions (objective=0)", style=style) - sheet.write( - x + 7, - y + 1, - "Essential reactions (objective < 5% max objective)", - style=style, - ) - sheet.write(x + 8, y + 1, "Reversible reactions", style=style) - sheet.write(x + 9, y + 1, "Dead reactions", style=style) + sheet.write(x + 6, y + 1, "Essential reactions", style=style) + sheet.write(x + 7, y + 1, "Reversible reactions", style=style) + sheet.write(x + 8, y + 1, "Dead reactions", style=style) sheet.write(x + 1, y + 2, "Only: M0", style=style) sheet.write(x + 1, y + 3, "Only: MNODEM", style=style) @@ -984,8 +953,6 @@ def __aux_spreadsheet_write_four_model_summary( model_results[2][i], model_results[3][i], ] - if i == 8: - print(set_list) self.__aux_write_sets(sheet, x + i + 2, y, set_list) # @@ -1100,10 +1067,6 @@ def spreadsheet_write_summary( list_model_fvadem_results, ] - # remove essential_reactions list with objective values - for m in models: - del m[4] - list_metabolites = [ len(state_initial.metabolites()), len(state_dem.metabolites()), @@ -1119,9 +1082,9 @@ def spreadsheet_write_summary( # 1: list(chokepoints_dict.keys()), # 3: genes_reactions_dict, - # 5: er_g0 + # 4: essential_reactions reactions_data = [] - for i in [1, 3, 5]: + for i in [1, 3, 4]: rdl = [ list_model_initial_results[i], list_model_dem_results[i], @@ -1223,7 +1186,7 @@ def spreadsheet_write_summary( style, y, 0, - "CHOKEPOINT REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)", + "CHOKEPOINT REACTIONS - ESSENTIAL REACTIONS", "Only chokepoints", reactions_data[0], "Only essential reactions", @@ -1236,7 +1199,7 @@ def spreadsheet_write_summary( style, y, 0, - "ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)", + "ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS", "Only essential genes reactions", reactions_data[1], "Only essential reactions", @@ -1249,7 +1212,7 @@ def spreadsheet_write_summary( style, y, 0, - "CHOKEPOINT REACTIONS - ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS (objectite value < 5% max objective value)", + "CHOKEPOINT REACTIONS - ESSENTIAL GENES REACTIONS - ESSENTIAL REACTIONS", "Only chokepoints reactions", reactions_data[0], "Only essential genes reactions",