Welcome to MetworkPy
MetworkPy is a Python library containing tools for working with and analyzing metabolic networks. This functionality includes:
- Generating network representations of Genome Scale Metabolic Networks (GSMMs)
- Integrating gene expression data with GSMMs
- Evaluating where the metabolism is most perturbed using divergence metrics
Documentation
Documentation can be found at https://metworkpy.readthedocs.io
Usage
MetworkPy can be installed with pip:
pip install metworkpy
The documentation includes some instructions for getting started. For an example of the usage of MetworkPy see the examples directory . For a more advanced example associated associated with the application note for MetworkPy (including some test data) see https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy_application_note.
Issues and Pull Requests
If you experience any problems while using MetworkPy (including the documentation), please create a GitHub issue in this repository. When creating an issue, a minimal reproducible example of the issue will make getting you help much easier. You can also create issues for any enhancements you would like to see in MetworkPy. Contributions are welcome! Please see the CONTRIBUTING.md for more information.
Licensing
This project makes use of the following external libraries:
- COBRApy licensed under the LGPL-2.1
- NetworkX licensed under the BSD-3-Clause
- NumPy licensed under the BSD-3-Clause
- Optlang licensed under Apace-2.0
- Pandas licensed under the BSD-3-Clause
- SciPy licensed under the BSD-3-Clause
- SymPy licensed under the BSD-3-Clause
The mutual information implementation where partially inspired by those found in
the feature_selection module of
scikit-learn,
and the tests for those methods were adapted from those in scikit-learn, which
is licensed under the
BSD-3-Clause.
Additionally, the implementation of the iMAT functionality was inspired by
gembox (which uses a
GPL-3.0-only
license), and dexom-python (which
uses the
GPL-3.0-only
license).
The permutation test implementation uses modified code from SciPy's stats module (licensed under the BSD-3-Clause, see above) for estimating the empirical p-value in line with Phipson, B., & Smyth, G. K. (2010).
The code for the centrality submodule is based on code from NetworkX (licensed under the BSD-3-Clause, see above) function closeness_centrality. Specifically,
- closeness_centrality_subset is based on networkx.algorithms.centrality.closeness_centrality, modified to calculate the closeness only to a susbet of nodes
- betweenness_centrality_subset is based on networkx.algorithms.centrality.betweenness_centrality_subset, modified to change the rescaling of the nodes to only be relative to the number of paths between the subset of nodes, not all nodes in the graph.
- _rescale is modified from network.algorithms.centrality.betweenness_centrality_subset._rescale, modified for the changed rescaling of the betweenness_centrality_subset
- _accumulate_subset is essentially unmodified from network.algorithms.centrality.betweenness_centrality_subset._accumulate_subset (included to avoid issues with later implementation changes in NetworkX).
References
iMAT References
- Shlomi T, et al. Network-based prediction of human tissue-specific metabolism, Nat. Biotechnol., 2008, vol. 26 (pg. 1003-1010)
- Hadas Zur, Eytan Ruppin, Tomer Shlomi, iMAT: an integrative metabolic analysis tool, Bioinformatics, Volume 26, Issue 24, December 2010, Pages 3140–3142, https://doi.org/10.1093/bioinformatics/btq602
Kullback-Leibler Divergence
Mutual Information
- Kraskov, A., Stögbauer, H., & Grassberger, P. (2004). Estimating mutual information. Physical Review E, 69(6), 066138.
- Ross, B. C. (2014). Mutual Information between Discrete and Continuous Data Sets. PLoS ONE, 9(2), e87357
Permutation Testing
Sampling
- Galuzzi, B. G., Milazzo, L., & Damiani, C. (2024). Adjusting for false discoveries in constraint-based differential metabolic flux analysis. Journal of Biomedical Informatics, 150, 104597. https://doi.org/10.1016/j.jbi.2024.104597
Metadata
Release files for metworkpy 0.11.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 | |
|---|---|---|---|
| metworkpy-0.11.0.tar.gz | 123.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metworkpy-0.11.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 278.6 kB
Release files / metworkpy-0.11.0.tar.gz
| Download URL | metworkpy-0.11.0.tar.gz |
|---|---|
| Size | 123.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77f8124ab599b8fd0fb194a79a305b2861df8725d7f277a88ad60975a191acc9
|
|
BLAKE2b-256 checksum How to use checksums |
2243f589e88dc13d72e034167fd62ae54bcaa3776b6f9cdaed790615c8b6c803
|
| 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 26, 2026.
Transparency logRelease files / metworkpy-0.11.0-py3-none-any.whl
| Download URL | metworkpy-0.11.0-py3-none-any.whl |
|---|---|
| Size | 155.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2008a6a0e6a874f6fcae9972ec876f79d2042a33372adbea798930ca34ba2503
|
|
BLAKE2b-256 checksum How to use checksums |
8eef00c5f832be2dfa48c34190ad80d6ec02d5f1afd00f2ca1ab33e674a30649
|
| 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 26, 2026.
Transparency log