Skip to content

raeslab/prodiphy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Pytest Coverage Code style: black License: CC 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 is required (or miniconda).

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

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.

cd prodiphy
conda env create -f docs/dev/environment.yml
conda activate prodiphy
pip install -e .

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 confidence interval for the difference in prevalence.

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.

Usage

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

  • ProDir: Model to compare the prevalence of specific classes in two populations.
  • CorProDir: Model to compare the prevalence of specific classes in two populations while correcting for covariates.
  • DeltaSlope: Model to compare the slope, intercept and spread of a linear regression between two groups.
  • DMM: Dirichlet Multinomial Mixture model to detect clusters with different prevalence of classes.

Contributing

Any contributions you make are greatly appreciated.

  • Found a bug or have some suggestions? Open an issue.
  • Pull requests are welcome! Though open an issue first to discuss which features/changes you wish to implement.

Contact

ProDiphy was developed by Sebastian Proost at the RaesLab. ProDiphy is available under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.

For commercial access inquiries, please contact Jeroen Raes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages