CNApy [Paper] 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 as interactive and editable metabolic maps (including Escher maps [GitHub][Paper]) and c) the creation and editing of metabolic models, including its reactions, metabolites and genes. For model loading and export, CNApy supports the widely used SBML standard format [Site][Paper].
Supported COBRA methods (partly provided by cobrapy [GitHub][Paper]) include:
→ For information about how to install CNApy, see section Installation Options
→ For more details on CNApy's many features, see section Documentation and Tutorials
→ 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
→ If you want to cite CNApy, see section How to cite CNApy
→ For information about how to contribute to CNApy as a developer, see section Contribute to the CNApy development
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.
There are 4 alternative ways to install CNApy:
pip install cnapy
in your console. Afterwards, you can start CNApy's GUI by running either cnapy
or, if this doesn't work, python -m cnapy
where "python" must call your Python 3.10 installation.cnapy-1.2.2
as follows: 1) Run conda create --name cnapy-1.2.2 python=3.10 pip openjdk -c conda-forge
, 2) run conda activate cnapy-1.2.2
, 3) run pip install cnapy
. Then, you can start CNApy in the cnapy-1.2.2 conda environment by running either cnapy
or, if this doesn't work, python -m cnapy
. Note that the cnapy conda package is currently not being updated due to licensing uncertainties.This installer lets you create a local installation of CNApy under Windows, Linux or MacOS by following these instructions:
If you use Windows:
If you use Linux or MacOS:
chmod u+x ./install_cnapy_here.sh
. Alternatively, if supported on your system, right-click on the file, go the file's settings and mark it as executable../install_cnapy_here.sh
in your console or, if supported on your system, double-click on install_cnapy_here.sh../run_cnapy.sh
in your console (for this without another path beforehand, your console must point to the folder where run_cnapy.sh is located, e.g. if you are in the folder where install_cnapy_here.sh is located, through cd cnapy-1.2.2
). Alternatively, if supported by your system, double-click on "run_cnapy.sh" in the newly created cnapy-1.2.2 subfolder.Technical side note: CNApy's installer is utilizing micromamba.
Note: The following instructions only have to be followed if you want to contribute to CNApy as a programmer. If this is not the case, follow other steps of the Installation Options.
Everyone is welcome to contribute to CNApy's development. See our contribution file for general instructions. 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.
Programatically, we recommend to use uv [GitHub] to install all dependencies and manage installed Python versions. Alternatively, one can also use conda/mamba for the same tasks, although you would have to install CNApy's dependencies manually.
You can use uv for CNApy as follows:
pip install uv
git clone https://github.com/cnapy-org/CNApy.git
cd CNApy
uv run cnapy.py
uv will automatically install the correct Python version (by reading ./.python-version) and CNApy dependencies (by reading ./pyproject.toml). If you get a Java/JDK/JVM/jpype error when running CNApy, consider installing OpenJDK [Site] on your system to fix this problem.
If you use CNApy in your scientific work, please 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.