Metadata-Version: 2.1
Name: metworkpy
Version: 0.9.0
Summary: Tools for creating and working with network models of metabolism.
Keywords: FBA,metabolism,IMAT,metchange
Author-Email: Braden Griebel <bgriebel@uw.edu>
License: MIT
Project-URL: Homepage, https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy
Project-URL: Repository, https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy
Project-URL: Documentation, https://metworkpy.readthedocs.io/en/latest/
Project-URL: Issues, https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy/issues
Project-URL: Changelog, https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy/blob/main/CHANGELOG.md
Requires-Python: <3.14,>=3.9
Requires-Dist: cobra>=0.30.0
Requires-Dist: scipy>=1.12.0
Requires-Dist: networkx>=3.2.1
Requires-Dist: pandas>=2.2.0
Requires-Dist: numpy>=1.26
Requires-Dist: optlang>=1.8.1
Requires-Dist: sympy>=1.12
Requires-Dist: tqdm>=4.66.4
Requires-Dist: pyarrow>=16.0.0
Requires-Dist: joblib>=1.4.2
Requires-Dist: robustrankaggregpy>=0.3.0
Provides-Extra: cplex
Requires-Dist: cplex>=22.1.1.1; extra == "cplex"
Provides-Extra: gurobi
Requires-Dist: gurobipy>=11.0.0; extra == "gurobi"
Provides-Extra: fastparquet
Requires-Dist: fastparquet>=2024.5.0; extra == "fastparquet"
Provides-Extra: excel
Requires-Dist: openpyxl>=3.1.4; extra == "excel"
Provides-Extra: hybrid
Requires-Dist: highspy>=1.10.0; extra == "hybrid"
Requires-Dist: osqp>=1.0.3; extra == "hybrid"
Description-Content-Type: text/markdown

# Welcome to MetworkPy

![Metworkpy Logo](metworkpy_logo.png "MetworkPy Logo")

<!--toc:start-->

- [Welcome to MetworkPy](#welcome-to-metworkpy)
  - [Usage](#usage)
  - [Issues and Pull Requests](#issues-and-pull-requests)
  - [Licensing](#licensing)
  - [References](#references)
    - [iMAT References](#imat-references)
    - [Kullback-Leibler Divergence](#kullback-leibler-divergence)
    - [Mutual Information](#mutual-information)
    - [Permutation Testing](#permutation-testing)

<!--toc:end-->

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](https://metworkpy.readthedocs.io)

## Usage

MetworkPy can be installed with pip:

```{bash}
pip install metworkpy

```

The [documentation](https://metworkpy.readthedocs.io) includes some instructions
for getting started. For an example of the usage of MetworkPy see the
[examples directory](https://github.com/Ma-Lab-Seattle-Childrens-CGIDR/metworkpy/tree/main/examples)
. 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](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](https://github.com/opencobra/cobrapy/tree/devel) licensed under the
  [LGPL-2.1](https://github.com/opencobra/cobrapy/blob/devel/LICENSE)
- [NetworkX](https://networkx.org/) licensed under the
  [BSD-3-Clause](https://github.com/networkx/networkx/blob/main/LICENSE.txt)
- [NumPy](https://numpy.org/) licensed under the
  [BSD-3-Clause](https://numpy.org/doc/stable/license.html)
- [Optlang](https://github.com/opencobra/optlang) licensed under
  [Apace-2.0](https://github.com/opencobra/optlang/blob/master/LICENSE)
- [Pandas](https://pandas.pydata.org/) licensed under the
  [BSD-3-Clause](https://github.com/pandas-dev/pandas/?tab=BSD-3-Clause-1-ov-file#readme)
- [SciPy](https://github.com/scipy/scipy) licensed under the
  [BSD-3-Clause](https://github.com/opencobra/cobrapy/blob/devel/LICENSE)
- [SymPy](https://www.sympy.org/en/index.html) licensed under the
  [BSD-3-Clause](https://github.com/sympy/sympy/blob/master/LICENSE)

The mutual information implementation where partially inspired by those found in
the `feature_selection` module of
[scikit-learn](https://github.com/scikit-learn/scikit-learn?tab=readme-ov-file),
and the tests for those methods were adapted from those in scikit-learn, which
is licensed under the
[BSD-3-Clause](https://github.com/scikit-learn/scikit-learn?tab=BSD-3-Clause-1-ov-file).
Additionally, the implementation of the iMAT functionality was inspired by
[gembox](https://github.com/ruppinlab/gembox) (which uses a
[GPL-3.0-only](https://github.com/ruppinlab/gembox?tab=GPL-3.0-1-ov-file)
license), and [dexom-python](https://github.com/MetExplore/dexom-python) (which
uses the
[GPL-3.0-only](https://github.com/MetExplore/dexom-python?tab=GPL-3.0-1-ov-file)
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)](https://arxiv.org/abs/1603.05766).

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

1. [Shlomi T, et al. Network-based prediction of human tissue-specific metabolism, Nat. Biotechnol., 2008, vol. 26 (pg. 1003-1010)](https://www.nature.com/articles/nbt.1487)
1. 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](https://academic.oup.com/bioinformatics/article/26/24/3140/290045?login=true)

### Kullback-Leibler Divergence

1. [Q. Wang, S. R. Kulkarni and S. Verdu, "Divergence Estimation for Multidimensional Densities Via k-Nearest-Neighbor Distances," in IEEE Transactions on Information Theory, vol. 55, no. 5, pp. 2392-2405, May 2009, doi: 10.1109/TIT.2009.2016060.](https://ieeexplore.ieee.org/document/4839047)

### Mutual Information

1. [Kraskov, A., Stögbauer, H., & Grassberger, P. (2004). Estimating mutual information. Physical Review E, 69(6), 066138.](https://journals.aps.org/pre/abstract/10.1103/PhysRevE.69.066138)
1. [Ross, B. C. (2014). Mutual Information between Discrete and Continuous Data Sets. PLoS ONE, 9(2), e87357](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0087357)

### Permutation Testing

1. [Phipson, B., & Smyth, G. K. (2010). Permutation p-values should never be zero: Calculating exact p-values when permutations are randomly drawn. Statistical Applications in Genetics and Molecular Biology, 9(1). https://doi.org/10.2202/1544-6115.1585](https://arxiv.org/abs/1603.05766)

### Sampling

1. 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](https://doi.org/10.1016/j.jbi.2024.104597)
