Metadata-Version: 2.4
Name: prodiphy
Version: 0.2.0
Summary: Probabilistic models to examine differences between (sub-)populations
Author-email: Sebastian Proost <sebastian.proost@gmail.com>
License-Expression: CC-BY-NC-SA-4.0
Project-URL: Homepage, https://github.com/raeslab/prodiphy
Project-URL: Bug Tracker, https://github.com/raeslab/prodiphy/issues
Keywords: bayesian,pymc,probabilistic-modelling,statistics,microbiome,mixture-model
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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 :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymc<6.0.0,>=5.16.2
Requires-Dist: bambi<0.18.0,>=0.14.1
Requires-Dist: arviz<1.0.0,>=0.19.0
Requires-Dist: numpy>=1.26.4
Requires-Dist: pandas>=2.2.2
Requires-Dist: tabulate>=0.9.0
Requires-Dist: scipy>=1.7.3
Requires-Dist: matplotlib<3.11
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.0; extra == "dev"
Requires-Dist: ruff<0.15.0,>=0.14.0; extra == "dev"
Dynamic: license-file

[![Run Pytest](https://github.com/raeslab/prodiphy/actions/workflows/autopytest.yml/badge.svg)](https://github.com/raeslab/prodiphy/actions/workflows/autopytest.yml) [![Coverage](https://raw.githubusercontent.com/raeslab/prodiphy/main/docs/coverage-badge.svg)](https://raw.githubusercontent.com/raeslab/prodiphy/main/docs/coverage-badge.svg) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)

# ProDiphy

Python package that implements probabilistic models to compare (sub-)populations.

## Installation

Note: currently the package has not been deposited in a repository, so it needs to be installed through GitHub.

To install ProDiphy, [conda]([https://conda.io/projects/conda/en/latest/index.html](https://github.com/conda-forge/miniforge)) is required (or miniconda).

First, clone the repository to create a local copy in the current directory.

```bash
git clone https://github.com/raeslab/prodiphy
```

Then navigate to the source code, create an environment using the yaml file in the folder `docs/dev`, activate it and install the local copy of the code.

```bash
cd prodiphy
conda create -n prodiphy python=3.12
conda activate prodiphy
pip install -e .
```

**Note that creating the environment can take a few minutes as there are some fairly sizeable dependencies required for Prodiphy.**

## Quick Start

The following code snippet shows how to use the ProDir model to compare two populations. The model is used here to compare 
the prevalence of species in two ecosystems, one polluted and one unpolluted. The model will estimate the 
prevalence of each species in both ecosystems and provide a credible interval for the difference in prevalence.

```python
from prodiphy import ProDir

if __name__ == "__main__":
    reference_counts = [100, 30, 20, 10]
    polluted_counts = [90, 20, 5, 10]
    
    labels = ["SpeciesA", "SpeciesB", "SpeciesC", "SpeciesD"]
    
    model = ProDir()
    model.fit(reference_counts, polluted_counts, labels)
    
    summary = model.get_stats()
```

For more details including the output of this example, see the [ProDir documentation](https://github.com/raeslab/prodiphy/blob/main/docs/prodir.md).

## Usage

The Prodiphy package contains various models each with their own specific use case. The following models are currently
available:

  * [ProDir](https://github.com/raeslab/prodiphy/blob/main/docs/prodir.md): Model to compare the prevalence of specific classes in two populations. (Probabilistic alternative to a chi-square test)
  * [CorProDir](https://github.com/raeslab/prodiphy/blob/main/docs/corprodir.md): Model to compare the prevalence of specific classes in two populations while correcting for covariates.
  * [DeltaSlope](https://github.com/raeslab/prodiphy/blob/main/docs/deltaslope.md): Model to compare the slope, intercept and spread of a linear regression between two groups.
  * [DMM](https://github.com/raeslab/prodiphy/blob/main/docs/dmm.md): Dirichlet Multinomial Mixture model to detect clusters with different prevalence of classes.
  * [GMvM](https://github.com/raeslab/prodiphy/blob/main/docs/gmvm.md): Gaussian Multivariate Mixture model for clustering continuous multivariate data.
  * [ACORN](https://github.com/raeslab/prodiphy/blob/main/docs/acorn.md): Adjusted CORrelations, Negative-binomial. Hierarchical model testing whether every feature in a count table is associated with a continuous marker, adjusted for covariates.


## Contributing

Any contributions you make are **greatly appreciated**.

  * Found a bug or have some suggestions? Open an [issue](https://github.com/raeslab/prodiphy/issues).
  * Pull requests are welcome! Though open an [issue](https://github.com/raeslab/prodiphy/issues) first to discuss which features/changes you wish to implement.

## Contact

ProDiphy was developed by [Sebastian Proost](https://sebastian.proost.science/) at the 
[RaesLab](https://raeslab.sites.vib.be/en). ProDiphy is available under the 
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/) 
license. 

For commercial access inquiries, please contact [Jeroen Raes](mailto:jeroen.raes@kuleuven.vib.be).
