Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

raven-toolbox

CI PyPI

Reconstruction, Analysis and Visualisation of Metabolic Networks — in Python.

raven-toolbox is the Python counterpart of the RAVEN Toolbox (MATLAB). It builds on cobrapy for everything cobrapy already does well — simulation, standard analyses, SBML I/O, model manipulation — and adds the functionality that is unique to RAVEN:

  • De novo reconstruction from KEGG and protein homology (BLAST / DIAMOND).
  • Context-specific models from omics data via ftINIT, with task-aware gap-filling, the linear-merge MILP reduction, and metabolomics-informed reaction scoring.
  • Metabolic-task validation (check_tasks, find_task_essential_reactions).
  • Gap-filling — connectivity gap-filling against template models, plus LP/SWIFTCORE, MILP, and topological strategies.
  • Omics integration — Human Protein Atlas (proteomics + RNA-seq) ingestion.
  • Sub-cellular localisation prediction by MILP, with partial-update mode and pluggable evidence sources (DeepLoc 2, MULocDeep, COMPARTMENTS, UniProt, …).
  • N-model comparison; reporter metabolites; FSEOF; flux sampling (ACHR, CHRR, and the classic random-objective vertex method).
  • YAML I/O following the cobra standard, plus geckopy's ec-* enzyme-constrained fields, and RAVEN-style Excel export.

The status of every RAVEN function (ported, cheatsheet-mapped to cobra, or explicitly not ported) is documented function-by-function in docs/reference/migration.md.

Design principle

The canonical in-memory object is always a cobra.Model. There is no parallel RAVEN struct, no ravenCobraWrapper-style adapter. RAVEN-specific fields that cobra doesn't model natively (rxnMiriams, metDeltaG, rxnConfidenceScores, …) live in cobra's annotation / notes dictionaries. This avoids duplicating cobra's data model and keeps raven-toolbox interoperable with the wider COBRA ecosystem.

Status

raven-toolbox is working toward a 3.0 release tracking the upcoming MATLAB RAVEN 3.0 beta — see the changelog for what has changed since the last stable release. It has been validated against MATLAB RAVEN on Human-GEM (5 Hart2015 cell-line models, Jaccard 0.975–0.980 — see the Human-GEM validation study on raven-docs).

Two deliberate scope decisions, not pending work:

  • Classic tINIT is not implemented — only ftINIT. raven-toolbox is a new implementation with no installed base of tINIT-built models to support; MATLAB RAVEN keeps both algorithms for backwards compatibility, but ftINIT is the algorithm tINIT was superseded by.
  • MetaCyc-based reconstruction is not implemented and is flagged for removal from MATLAB RAVEN as well — see IMPROVEMENTS.md under R-MetaCyc.
  • Dynamic FBA is not implemented — several maintained Python packages already cover it (dfba, reframed, mewpy).

Installation

pip install raven-toolbox

The latest stable release is on PyPI. To work against the unreleased code on develop (including this beta), install from git instead:

git clone https://github.com/SysBioChalmers/raven-toolbox
cd raven-toolbox
pip install -e ".[dev]"

raven-toolbox requires Python ≥ 3.11. Genome-scale ftINIT MILPs currently require Gurobi (details on solver portability on raven-docs); toy and unit-test work runs on the open-source GLPK.

External command-line tools (BLAST, DIAMOND, HMMER, MAFFT, CD-HIT)

Some workflows call external tools. For most users there is nothing to do — raven-toolbox downloads each tool it needs automatically the first time it's used.

Which tools a workflow uses:

Workflow Tools
Homology-based reconstruction blastp + makeblastdb, or diamond
KEGG HMM query (get_kegg_model_for_organism) hmmsearch
Building the KEGG HMM libraries (maintainers) hmmbuild, mafft, cd-hit

Optional:

  • Fetch them up front instead of on first use:
    raven-toolbox-binaries --set runtime   # blastp, makeblastdb, diamond, hmmsearch
    raven-toolbox-binaries --set build     # hmmbuild, mafft, cd-hit
    
  • Use your own install — if a tool is on your PATH it's used instead of a download, e.g. conda install -c bioconda blast diamond hmmer mafft cd-hit.
  • Disable automatic downloads (air-gapped / conda-only setups): set RAVEN_PYTHON_AUTOFETCH=0.

Windows: homology reconstruction and the KEGG species model work as-is. To build the KEGG HMM libraries (needs MAFFT/CD-HIT), use WSL2.

Documentation

The documentation is built with Sphinx (MyST Markdown); the source lives in docs/ — see docs/README.md for the layout and local-build instructions. (A hosted ReadTheDocs site is not yet published.)

Relationship to MATLAB RAVEN

raven-toolbox is an independent Python reimplementation of the RAVEN Toolbox, released under the permissive MIT license. If you use it in scientific work, please cite the RAVEN 2 paper:

Wang H, Marcišauskas S, Sánchez BJ, Domenzain I, Hermansson D, Agren R, Nielsen J, Kerkhoven EJ. (2018) RAVEN 2.0: A versatile toolbox for metabolic network reconstruction and a case study on Streptomyces coelicolor. PLoS Comput Biol 14(10): e1006541.

License

MIT

Release files for raven-toolbox 3.0.0b1

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

Source distribution (sdist)

Source distribution for raven-toolbox 3.0.0b1
File Size Uploaded
raven_toolbox-3.0.0b1.tar.gz 3.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for raven-toolbox 3.0.0b1
File Interpreter ABI Platform
raven_toolbox-3.0.0b1-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / raven_toolbox-3.0.0b1.tar.gz

Download URL raven_toolbox-3.0.0b1.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
4ea2b4154b6b79b377e8eb19f3ddc95b453f630fa6bb434331a127c0a6722a98
BLAKE2b-256 checksum
How to use checksums
e177c7dcc20156819022a8b9990bf504a99b4413afecaf839cebba23b2c6eb7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / raven_toolbox-3.0.0b1-py3-none-any.whl

Download URL raven_toolbox-3.0.0b1-py3-none-any.whl
Size 370.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b3e00b54affa0d9cb938090b479068c271a4e1aee133da741a81f87c60f8f8e
BLAKE2b-256 checksum
How to use checksums
8a9e459d5716a6930328dc994527c55fc8cea673779fe51a2ff6e0cff25dcba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0b1 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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