cnapy-org / CNApy

An integrated visual environment for metabolic modeling with common methods such as FBA, FVA and Elementary Flux Modes, and advanced features such as thermodynamic methods, extended Minimal Cut Sets, OptKnock, RobustKnock, OptCouple and more!
https://cnapy-org.github.io/CNApy-guide/
Apache License 2.0
46 stars 7 forks source link

Visual OptMDFpathway #441

Closed Paulocracy closed 1 year ago

Paulocracy commented 1 year ago

Welcome to a new world 🌍🌎🌏

Up to now, life seems bleak. Something is out of place, right? Ok, you go to parties and other events. But afterwards, everything feels like before. This nasty feeling that there is a hole in your soul. No problem, you say, that can be fixed! So you travel around the globe. But again, after everything that you've experienced, your soul feels empty. Whatever you do, something is missing.

But now, this something has arrived, finally, your life is complete, at last!

Introducing...

Visual_OptMDFpathway

Yes, it has arrived! OptMDFpathway in its basic form is now included inside CNApy 🎇🎆

Wow! So how does this major achievement work internally?

Programmatically, I wrote a new "class interface" for StrainDesign, currently, you can find it as "sd_class_interface.py" in CNApy but it will likely be released as a separate package in the future. This interface allows one to use StrainDesign in an object-oriented and strictly typed (as far as possible with Python) manner.

Then, I implemented OptMDFpathway using this class interface and with indicator constraints (contrary to prior Big-M-based implementations). It can be found as "sd_ci_optmdfpathway.py", which, again, will be likely part of the future new package. In fact, this is an OptMDFpathway implementation for models with irreversible reactions. Therefore, if the CNApy model contains reversible reactions, they are split first internally but without any effect on the user's model after the calculation.

Even more wow! And how do I use it in CNApy?

You can find all options for starting OptMDFpathway and loading its relevant information in the marked new "Analysis" tab menu entries:

In_menu

Before you can start OptMDFpathway for a CNApy project, you need the following data:

Note that whenever you load a dG'° or concentration ranges file, these values will completely replace all values beforehand. E.g., if a dG'° was set for a reaction beforehand but it is not set in the file, the reaction will not have a dG'° afterwards.

Furthermore, while XLSX files need a title in their first line, the text content of these captions is actually irrelevant.

Then, you can start the calculation which can be performed with all StrainDesign-supported solvers, just keep in mind that with GLPK, the indicator constraints will be transformed into Big-M constraints as indicators are not supported by GLPK.

I'm so hyped now! How can I test it?

Attached, you may find (as zipped version of them)...

  1. [ASTHERISC_OptMDF_toymodel.zip (Download by clicking here)] an adaptation of my ASTHERISC toy model with already loaded dG'° values and concentration ranges. It should result in an OptMDF of ca. -0.19 kJ/mol.
  2. [ASTHERISC_toymodel.zip] The ASTHERISC toymodel without dG'° and metabolite concentration values.
  3. [dG0s_xlsx.zip] A dG'° XLSX for the ASTHERISC toymodel.
  4. [dG0s_json.zip] A dG'° JSON for the ASTHERISC toymodel
  5. [concentrations_xlsx.zip] A concentration ranges XLSX for the ASTHERISC toymodel.
  6. [concentration_values_json.zip] A concentration ranges JSON for the ASTHERISC toymodel.

I want to exploit the hype generated by this pull request! Will there be a VisualOptMDF coin? Can I buy the Visual OptMDFpathway logo as NFT?

No.

axelvonkamp commented 1 year ago

tl;dr

Paulocracy commented 1 year ago

tl;dr

Just approve it, it's fantastic 😹