raven-toolbox
Reconstruction, Analysis and Visualisation of Metabolic Networks — in Python.
raven-toolbox is the Python counterpart of the
RAVEN Toolbox 2 (MATLAB). It builds on
cobrapy for everything cobrapy already does
well (simulation, standard analyses, SBML I/O, model manipulation) and adds the
functionality that's unique to RAVEN:
- De novo reconstruction from KEGG and protein homology (BLAST / DIAMOND).
- Context-specific models from omics data via tINIT / ftINIT, with task-aware gap-filling and the linear-merge MILP reduction.
- Metabolic-task validation (
check_tasks,fitTasks). - Connectivity gap-filling against template models.
- 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.
- YAML I/O following the cobra standard, plus geckopy's
ec-*enzyme-constrained fields. SIF export. 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/raven_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 has been validated against MATLAB RAVEN on Human-GEM (5 Hart2015 cell-line models, Jaccard 0.975–0.980 — see docs/humangem_validation.md). The functional scope of the original RAVEN toolbox is covered with three principled omissions, all deliberately out of scope rather than pending work:
- 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). - Metabolomics-based scoring in tINIT / ftINIT is not implemented — passing a
non-empty
metabolomicsargument raisesNotImplementedError.
Installation (development)
git clone https://github.com/SysBioChalmers/raven-toolbox
cd raven-toolbox
pip install -e ".[dev]"
raven-toolbox requires Python ≥ 3.11. Genome-scale (f)tINIT MILPs currently require Gurobi (details on solver portability); 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 (getKEGGModelForOrganism) |
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
PATHit'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 2, 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
Release files for raven-toolbox 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| raven_toolbox-0.4.0.tar.gz | 3.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| raven_toolbox-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.5 MB
Release files / raven_toolbox-0.4.0.tar.gz
| Download URL | raven_toolbox-0.4.0.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22443cafba4c3b916660a2e79dcec1b6d74610bf9538a6f6410577accdcdf3d0
|
|
BLAKE2b-256 checksum How to use checksums |
245d3f8e548dfd31d57176acf455a836d273aebd16aba4625d4247ceefdb4e90
|
| 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 Aug 28, 2026.
Transparency logRelease files / raven_toolbox-0.4.0-py3-none-any.whl
| Download URL | raven_toolbox-0.4.0-py3-none-any.whl |
|---|---|
| Size | 315.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04154bfde630a7b88d1e5d1ddfd57f8279f75b865e477558fade3fd5563414b4
|
|
BLAKE2b-256 checksum How to use checksums |
4110d7dc11ac27ea5390639084c9abb732185ce2a965981e99365c0bcf36b966
|
| 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 Aug 28, 2026.
Transparency log