Metadata-Version: 2.5
Name: mmm4microbiome
Version: 0.1.0
Summary: Read a StripeSankey sweep of mixed-membership models as microbiome: microbial components (MC), their taxa, and the samples behind them
Project-URL: Homepage, https://gitlab.kuleuven.be/aida-lab/public/mmm4microbiome
Project-URL: Repository, https://gitlab.kuleuven.be/aida-lab/public/mmm4microbiome.git
Author-email: Peiyang Huo <peiyang.huo@kuleuven.be>
Maintainer-email: Peiyang Huo <peiyang.huo@kuleuven.be>
License: MIT License
        
        Copyright (c) 2025 peiyang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: LDA,NMF,anywidget,microbiome,mixed-membership,stripesankey,topic-modeling,visualization
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.9
Requires-Dist: anywidget>=0.9.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: plotly>=5.0.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: stripesankey>=0.4.1
Requires-Dist: traitlets>=5.0.0
Provides-Extra: daa
Requires-Dist: scikit-bio>=0.7.0; extra == 'daa'
Requires-Dist: statsmodels>=0.14.0; extra == 'daa'
Provides-Extra: static
Requires-Dist: kaleido>=1.0.0; extra == 'static'
Description-Content-Type: text/markdown

# mmm4microbiome

mmm4microbiome is the microbiome layer on top of
[stripesankey](https://pypi.org/project/stripesankey/) (>= 0.4.1). *mmm4microbiome* reads the output of *stripesankey* and makes interpretation plots for microbiome data analysis.

## Install

```bash
pip install mmm4microbiome # with pip
uv add mmm4microbiome # with uv
```

## Input: a stripesankey base folder

Everything takes a `base` folder written by *stripesankey*:

```python
import stripesankey as ss

ss.prepare(base, counts, feature_annotation, metadata, level="Genus")
ss.sweep(base, k_range=range(2, 11))
```

## Use

```python
import mmm4microbiome as mmm

# the sweep, with captions like "MC3 · Prevotella"
mmm.stripesankey_mb(base, metadata_df=meta, hover_field="METADATA_COLUMN")
mmm.metasankey_mb(base, metadata_df=meta, hover_field="METADATA_COLUMN")

# one k, sample by sample
mmm.heatmap_sample(base, 5, metadata_df=meta, include=["METADATA_COLUMN"])
mmm.bar_sample(base, 5, metadata_df=meta, sort="METADATA_COLUMN")

# what the MCs are made of
mmm.heatmap_mc(base, 5, feature_level="Family")

# everything in one self-contained HTML page: base/visualization/onestop_app.html
mmm.onestop(base, meta)
```

### Taxonomic levels

The **fit level** is what `prepare(level=)` collapsed the counts to. The
**display level** (`feature_level=`) is what a figure names. By default it is
the fit level, except that an ASV (or Species) fit is shown at Genus. A coarser
level sums the probabilities of its child taxa; a level finer than the fit
cannot be recovered and falls back to the fit level with a warning.

## License

MIT
