Giter Site home page Giter Site logo

cnapy-org / cnapy Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 7.0 7.36 MB

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!

Home Page: https://cnapy-org.github.io/CNApy-guide/

License: Apache License 2.0

Python 99.24% Batchfile 0.04% Shell 0.01% HTML 0.71%
metabolic-models constraint-programming bioinformatics flux-balance-analysis sbml systems-biology computational-biology cobra stoichiometric-modeling constraint-based-modeling

cnapy's Introduction

CNApy: An integrated environment for metabolic modeling

Latest stable release Last commit Open issues Gitter chat

CNApy screenshot

Introduction

If you have questions, suggestions or bug reports regarding CNApy, you can use either of the CNApy GitHub issues, the CNApy GitHub discussions or the CNApy Gitter chat room.

CNApy is a Python-based graphical user interface for a) many common methods of Constraint-Based Reconstruction and Analysis (COBRA) with stoichiometric metabolic models, b) the visualization of COBRA calculation results and c) the creation and editing of metabolic models.

Supported COBRA methods (partly provided by cobrapy) include:

  • Flux Balance Analysis (FBA)
  • Flux Variability Analysis (FVA)
  • Making measured flux scenarios stoichiometrically feasible
  • Elementary Flux Modes (EFM)
  • Thermodynamic methods based on OptMDFpathway
  • Many advanced strain design algorithms such as OptKnock, RobustKnock, OptCouple and advanced Minimal Cut Sets through its integration of the StrainDesign package
  • Yield optimization (based on linear-fractional programming)
  • Phase plane analysis

All calculation results can be visualized in CNApy's interactive and editable metabolic maps. These maps can also use vector-based (SVG) backgrounds. Escher maps are also natively supported and can be created and edited inside CNApy.

Aside of performing calculations on metabolic models, CNApy can also be used to create and/or edit metabolic models. This includes all important aspects of the model's reactions, metabolites and genes. For model loading and export, CNApy supports the widely used SBML standard format.

For more details on CNApy's many more features, see section Documentation and Tutorials.

For information about how to install CNApy, see section Installation Options.

For information about how to contribute to CNApy as a developer, see section Contribute to the CNApy development.

If you want to cite CNApy, see section How to cite CNApy.

Associated project note: If you want to use the well-known MATLAB-based CellNetAnalyzer (CNA), which is not compatible with CNApy, you can download it from CNA's website.

Documentation and Tutorials

  • The CNApy guide contains information for all major functions of CNApy.
  • Our CNApy YouTube channel provides some videos of working with CNApy.
  • We also provide directly usable CNApy example projects which include some of the most common E. coli models. These projects can also be downloaded within CNApy at its first start-up or via CNApy's File menu.

Installation Options

There are 4 alternative ways to install CNApy:

  1. If you use Windows, the easiest way is to use our Windows installer, see section Using the Windows installer.
  2. If you use Linux or Apple MacOS X, the easiest installation producure is our assisted installation protocol, see Assisted installation under Linux and MacOS X.
  3. If you already have installed Anaconda, Miniconda or Miniforge on your computer, you can directly install CNApy as a conda package as described in section Install CNApy as conda package.
  4. If you want to develop CNApy, follow the instruction for the cloning and setup of the CNApy repository using git and conda or mamba in section Setup the CNApy development environment.

Contribute to the CNApy development

Everyone is welcome to contribute to CNApy's development. See our contribution file for more detailed instructions.

Using the Windows installer

  1. Download the zipped CNApy Windows installer from here.
  2. Unzip the file into your desired location. You can do this by right-clicking on the file and selecting the option to extract the files.
  3. In the location where you unzipped the file, click on "INSTALL_CNAPY.bat"; This installation procedure only works with an active internet conncection. As soon as the installation is finished, the appearing window closes and you can start CNApy either by double-clicking on the newly created CNApy shortcut on your desktop (which also shows CNApy's logo) or the newly created RUN_CNAPY.bat in the folder where INSTALL_CNAPY.bat lies. If CNApy is not starting, this might have been caused by an internet connection problem; Running "INSTALL_CNAPY.bat" again might solve the problem. To uninstall CNApy, double-click on the UNINSTALL_CNAPY.bat in the same folder.

Assisted installation under Linux and MacOS X

Click on the operating system you use:

Assisted Linux installation

  1. Download Miniforge from here.
  2. Install Miniforge by double-clicking the downloaded file. If the script does not run, right-click on the file, open its settings and select the option to make it executable (alternative: run 'chmod u+x ./Miniconda3-latest-Linux-x86_64.sh' in your terminal). Follow the appearing installation instructions and remember in which folder you install Miniconda. Note: If you already have installed Anaconda on your computer before (for which we also directly provide a conda CNApy package, see here), deactivate all installation options which put Miniconda to your console or system PATH to avoid possible problems.
  3. Using your file manager, go to the folder where you installed Miniforge. Then, open the appearing sub-folder "condabin".
  4. Download the CNApy installation assistant script from here into the mentioned "condabin" folder.
  5. In the file manager, double-click on the newly downloaded installation assistant script which is called "cnapy-assistant-script.sh". If the script does not run, right-click on the file, open its settings and select the option to make it executable or, alternatively, run 'chmod u+x ./cnapy-assistant-script.sh' in your terminal in the mentioned "condabin" folder. Wait until CNApy is downloaded and installed.
  6. You can now run CNApy by executing the following two terminal instructions in the mentioned "condabin" folder:
./conda activate cnapy-1.1.11
cnapy

If you installed Miniforge system-wide, it's also possible to run these commands in any other terminal folder.

Assisted MacOS X installation

  1. If you have a (new) Mac with an ARM processor, such as the M1, M2 or M3, download Miniconda from here. If you have an (older) Mac with an Intel processor, download Miniconda from here. If you are unsure which processor your Mac has, click on the Apple menu in the upper-left of your screen and choose "About This Mac". Note: Currently, if you want to use the CPLEX solver within CNApy, you have to install the Intel processor version of Miniconda regardless of your Mac's processor. This is caused by the lack of a CPLEX ARM Python package (see also this issue for more details).
  2. Install Miniconda by double-clicking the downloaded file. Follow the appearing installation instructions and remember in which folder you install Miniconda. Note: If you already use Anaconda on your computer (for which we directly provide a conda CNApy package, see here), deactivate all installation options which put Miniconda to your console or system PATH to avoid possible problems
  3. Using Finder, go to the folder where you installed Miniconda. Then, open the appearing sub-folder "condabin".
  4. Download the CNApy installation assistant script from here into the mentioned "condabin" folder.
  5. In the file manager, double-click on the newly downloaded installation assistant script which is called "cnapy-installation-script.sh". If the script does not run, right-click on the file, open its settings and select the option to make it executable (alternative: run 'chmod u+x ./cnapy-assistant-script.sh' in your terminal). Wait until CNApy is downloaded and installed.
  6. Open the terminal in the mentioned "condabin" folder. You can now run CNApy by executing the following two terminal instructions:
./conda activate cnapy-1.1.11
cnapy

Install CNApy as conda package

Note for Mac users (does not affect Windows or Linux users): Currently, if you want to use the CPLEX solver within CNApy, you have to install the Intel processor version of Anaconda/Miniconda/Miniforge regardless of your Mac's processor. This is caused by the lack of a CPLEX ARM Python package (see also this issue for more details).

Note for all users: If you've installed mamba on your system (e.g., with Miniforge), it is the recommended way to install CNApy as it is much faster than conda. To use mamba, just replace the "conda" command in the following steps with "mamba".

  1. Create a conda environment with all dependencies

    conda create -n cnapy-1.1.11 -c Gurobi -c IBMDecisionOptimization -c conda-forge -c cnapy cnapy=1.1.11 --yes
  2. Activate the cnapy conda environment

    conda activate cnapy-1.1.11
  3. Run CNApy within you activated conda environment

    cnapy

Furthermore, you can also perform the following optional steps:

  1. (optional and only possible if you have already installed CNApy by using conda) If you already have a cnapy environment, e.g., cnapy-1.X.X, you can delete it with the command

    # Here, the Xs stand for the last CNApy version you've installed by using conda
    conda env remove -n cnapy-1.X.X
  2. (optional, but recommended if you also use other Python distributions or Anaconda environments) In order to solve potential package version problems, set a systems variable called "PYTHONNOUSERSITE" to the value "True".

    Under Linux systems, you can do this with the following command:

    export PYTHONNOUSERSITE=True

    Under Windows systems, you can do this by searching for your system's "environmental variables" and adding the variable PYTHONNOUSERSITE with the value True using Window's environmental variables setting window.

Setup the CNApy development environment

We use conda as package manager to install all dependencies. You can use miniconda. If you have conda installed you can:

  1. Create a conda development environment with all dependencies

    conda env create -n cnapy-dev -f environment.yml
  2. Activate the development environment

    conda activate cnapy-dev
  3. Checkout the latest cnapy development version using git

    git clone https://github.com/cnapy-org/CNApy.git
  4. Change into the source directory and run CNApy

    cd CNApy
    python cnapy.py

Any contribution intentionally submitted for inclusion in the work by you, shall be licensed under the terms of the Apache 2.0 license without any additional terms or conditions.

How to cite CNApy

If you use CNApy in your scientific work, please consider to cite CNApy's publication:

Thiele et al. (2022). CNApy: a CellNetAnalyzer GUI in Python for analyzing and designing metabolic networks. Bioinformatics 38, 1467-1469, doi.org/10.1093/bioinformatics/btab828.

cnapy's People

Contributors

axelvonkamp avatar paulocracy avatar sthiele avatar vonalphabiszulu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cnapy's Issues

Show annotations from the sbml model in the reaction/species properties

  • We do read and show the cobra annotation for reactions.

But cobra does it's own parsing of the annotations

<reaction id="R_ULA4Ntppi" fast="false" reversible="false" name="Transport (cytoplasm to periplasm)" metaid="R_ULA4Ntppi" sboTerm="SBO:0000185" fbc:upperFluxBound="cobra_default_ub" fbc:lowerFluxBound="cobra_0_bound">
  <sbml:annotation xmlns:sbml="http://www.sbml.org/sbml/level3/version1/core">
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about="#R_ULA4Ntppi">
        <bqbiol:is xmlns:bqbiol="http://biomodels.net/biology-qualifiers/">
          <rdf:Bag>
            <rdf:li rdf:resource="http://identifiers.org/bigg.reaction/ULA4Ntppi"/>
            <rdf:li rdf:resource="http://identifiers.org/metanetx.reaction/MNXR105114"/>
            <rdf:li rdf:resource="http://identifiers.org/seed.reaction/rxn09357"/>
          </rdf:Bag>
        </bqbiol:is>
      </rdf:Description>
    </rdf:RDF>
  </sbml:annotation>

and is returning a bunch of identifiers

{'sbo': 'SBO:0000185', 'bigg.reaction': 'ULA4Ntppi', 'metanetx.reaction': 'MNXR105114', 'seed.reaction': 'rxn09357'}

I have no idea how we could get our metadata into this scheme.

Save/show/edit additional infos like comments or delta g_0

Either like cobrapy in the SBML annotations (as RDF) or in a separate file which would be included in the cna project/archive.
Here a list of CNA specific reaction attributes:

  • deltaGR_0 : -35.68;
  • deltaGR_Uncertainty : 7.97
  • KEGG_ID : R08549
  • BiGG_ID :AKGDH

and a list of CNA specific species attributes:

  • BiGG_ID : 4crsol_p
  • Universal_BiGG_ID : 4crsol
  • KEGG_ID :
  • CHEBI_ID : CHEBI:44726
  • Formula : C23H34N7O17P3S
  • Charge : NaN

Improve console

Maybe use pyqtconsole?
pyqtconsole is using PyQt5 while we are using PySide2 as qt bindings also it has no conda package.
qtconsole looks like a larger more active project they also have conda packages and may work with PySide2 via qtpy.

Set config option from UI

  • CNA path
  • Colors
  • Shown number of digits after decimal point
  • Defaultcolor : Qt.gray
  • self.abs_tol : 0.0001
  • Working directory should better be set to last used(open/save) directory

Compute/show basic model properties

  • Number of reactions, metabolites
  • Stoichiometric matrix infos
  • conservation relations
  • degrees of freedom
  • smallest/largest absolute value > 0 in matrix
STOICHIOMETRIC MATRIX (without external metabolites):
     6 internal (balanced) metabolites (rows)
     10 reactions (columns), thereof 2 reversible
     Rank of stoichiometric matrix: 6
          --> No conservation relation(s) exist.
     Degrees of freedom: 4
 
     Smallest (absolute) non-zero-value: 1
     Largest (absolute) value: 1
 
     Network can be compressed to (isozymes not considered): 
          2 metabolites 
          6 reactions (thereof 2 reversible)
  • Model Annotations

Cleanup examples directory

New structure simply projects

SmallExample2 - SmallExample2.cna
              - Smallexample2-map1.map
              - scenario1.scen
              - background-map1.svg
              - verycool.modes
...

Save default scenario within the project data

Not sure yet how this is done best.
In some sense the bounds on the models reaction represent itself a scenario.
Should constraints from an default scenario would overwrite these bounds?

Example: in the model has reaction R the bounds -10>=,<=5
in the scenario the bounds are set to 6>=,<=10.

I see two ways to interpret this situation and I'm not yet sure which to choose:

  1. If i give both constraints there would be no solution.
  2. if the scenario replaces the models constraint there are solutions

Add functionality to remove unused species

I see 3 approaches

  1. automatically remove unused species if the model changes
  2. add a function to remove unused species on demand
  3. add a button to remove species manually

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.