Skip to main content

CNApy: An integrated environment for metabolic modeling

Latest stable release Last commit Open issues Gitter chat

CNApy screenshot

Introduction

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:

  • Flux Balance Analysis (FBA) [Review]
  • Flux Variability Analysis (FVA) [Paper]
  • Yield optimization (based on linear-fractional programming) [Paper]
  • Phase plane analyses (can include flux and/or yield optimizations)
  • Making measured in vivo flux scenarios stoichiometrically feasible, optionally also by altering a biomass reaction [Paper]
  • Elementary Flux Modes (EFM) [Review]
  • Thermodynamic methods based on OptMDFpathway [Paper]
  • Many advanced strain design algorithms such as OptKnock [Paper], RobustKnock [Paper], OptCouple [Paper] and advanced Minimal Cut Sets [Paper] through its StrainDesign [GitHub][Paper] integration

→ 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.

Installation Options

There are 4 alternative ways to install CNApy:

  1. The easiest way for any user to install CNApy is by downloading its installer, which is provided for Windows, Linux and MacOS, see Using CNApy installer for more.
  2. If you already have installed Python 3.10 (no other version) on your system, you can install CNApy simply through 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.
  3. If you already use conda or mamba (for mamba, just change the "conda" command to "mamba"), you can create a CNApy environment named cnapy-1.2.10 as follows: 1) Run conda create --name cnapy-1.2.10 python=3.10 pip openjdk -c conda-forge, 2) run conda activate cnapy-1.2.10, 3) run pip install cnapy. Then, you can start CNApy in the cnapy-1.2.10 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.
  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.

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.

Using CNApy installer

This installer lets you create a local installation of CNApy under Windows, Linux or MacOS by following these instructions:

If you use Windows:

  • Download the Windows installer from here
  • Put this file into a folder where you want CNApy to be installed.
  • Double click on the file and let the CNApy installation run
  • Afterwards, you can run CNApy by either double-clicking on the newly created CNApy desktop icon, or by double-clicking "RUN_CNApy.bat" in the newly created cnapy-1.2.10 subfolder.

If you use Linux or MacOS:

  • Download the Linux & MacOS installer from here.
  • Put this file into a folder where you want CNApy to be installed.
  • Make the script executable by opening your console in the folder and run 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.
  • Now, either run ./install_cnapy_here.sh in your console or, if supported on your system, double-click on install_cnapy_here.sh.
  • Finally, you can run CNApy by calling ./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.10). Alternatively, if supported by your system, double-click on "run_cnapy.sh" in the newly created cnapy-1.2.10 subfolder.

Technical side note: CNApy's installer is utilizing micromamba.

Setup the CNApy development environment

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.

uv usage

You can use uv for CNApy as follows:

  1. Make sure that you have installed uv, e.g. through pip, pipx or another package manger (apt, brew, nix ...) of your choice:
# E.g., you can install uv through
pip install uv # or
pipx install uv
  1. Checkout the latest cnapy development version using git
git clone https://github.com/cnapy-org/CNApy.git
  1. Change into the source directory and run CNApy
cd CNApy
uv run cnapy.py

uv will automatically install the correct Python version and CNApy dependencies (all done by reading CNApy's pyproject.toml file). If you get a Java/JDK/JVM/jpype error when running CNApy, consider installing OpenJDK [Site] on your system to fix this problem.

How to cite CNApy

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.

Metadata

Release files for cnapy 1.2.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cnapy 1.2.10
File Size Uploaded Provenance Actions
cnapy-1.2.10.tar.gz 767.1 kB Without provenance Details for cnapy-1.2.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cnapy 1.2.10
File Interpreter ABI Platform Actions
cnapy-1.2.10-py3-none-any.whl Python 3 none any Details for cnapy-1.2.10-py3-none-any.whl

Total release size: 1.6 MB

Release files / cnapy-1.2.10.tar.gz

Download URL cnapy-1.2.10.tar.gz
Size 767.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ae5a96f3307ba47f4e2f7b7ba36b70661983977280e988c09af58ba39758be52
BLAKE2b-256 checksum
How to use checksums
f55a7261f9d5043b05f1956c8c556362f0f362f7115b7592a5adccf11b8e4f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / cnapy-1.2.10-py3-none-any.whl

Download URL cnapy-1.2.10-py3-none-any.whl
Size 794.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79fbd21ff8f62e9018248947bca6c1c81f8e4db3cc7b557a4b32f089e5f29932
BLAKE2b-256 checksum
How to use checksums
11a784401b451bcd78e6db6824a2639faf437d860ff039bf8fdda1fccb5ffdef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for cnapy 1.2.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page