Metadata-Version: 2.4
Name: phylogenie
Version: 3.11.1
Summary: Generate phylogenetic datasets with minimal setup effort
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: joblib>=1.5.2
Requires-Dist: matplotlib>=3.10.7
Requires-Dist: pandas>=2.3.3
Requires-Dist: pydantic>=2.12.3
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: tqdm>=4.67.1
Dynamic: license-file

<p align="center">
<img src="https://raw.githubusercontent.com/gabriele-marino/phylogenie/main/logo.png" style="width:100%; height:auto;"/>
</p>

---

[![AliSim](https://img.shields.io/badge/Powered%20by-AliSim-orange?style=flat-square)](https://iqtree.github.io/doc/AliSim)
[![PyPI version](https://img.shields.io/pypi/v/phylogenie)](https://pypi.org/project/phylogenie/)

Phylogenie is a [Python](https://www.python.org/) package designed to easily simulate phylogenetic datasets—such as trees and multiple sequence alignments (MSAs)—with minimal setup effort. Simply specify the distributions from which your parameters should be sampled, and Phylogenie will handle the rest! It also makes it easy to define your own simulation models, allowing you to tailor simulations to your specific use cases.

## ✨ Features

Phylogenie comes packed with useful features, including:

- **Simulate tree and multiple sequence alignment (MSA) datasets from parameter distributions** 🌳🧬  
  Define distributions over your parameters and sample a different combination of parameters for each dataset sample.

- **Automatic metadata management** 🗂️  
  Phylogenie stores each parameter combination sampled during dataset generation in a `.csv` file.

- **Generalizable configurations** 🔧 
  Easily apply the same configuration across multiple dataset splits (e.g., train, validation, test).

- **Flexible acceptance criteria** 🔄  
  Define custom acceptance criteria on the simulated trees to ensure they meet your requirements.

- **Multiprocessing support** ⚙️💻  
  Simply specify the number of cores to use, and Phylogenie handles multiprocessing automatically.

- **Pre-implemented parameterizations** 🎯  
  Include birth-death (BD), birth-death with exposed-infectious (BDEI), birth-death with superspreading (BDSS), susceptible-infected-recovered (SIR), and other commonly used parameterizations.

- **Custom models and extensibility** 🧩  
  Define your own simulation models and extend Phylogenie via plugins.

- **Skyline parameter support** 🪜  
  Support for piece-wise constant parameters.

- **Operations on parameters** 🧮  
  Perform flexible operations between parameters directly within the config file.

## 📦 Installation
Phylogenie requires [Python](https://www.python.org/) 3.10+ to be installed on your system. There are several ways to install Python and managing different Python versions. One popular option is to use [uv](https://docs.astral.sh/uv/).

Once you have Python set up, you can install Phylogenie directly from PyPI:

```bash
pip install phylogenie
```

Or install from source:
```bash
git clone https://github.com/gabriele-marino/phylogenie.git
cd phylogenie
pip install .
```

## 🛠 Backend dependencies

Phylogenie relies on [AliSim](https://iqtree.github.io/doc/AliSim) for simulating multiple sequence alignments (MSAs). AliSim is a powerful MSAs simulation tool distributed with [IQ-TREE](https://iqtree.github.io/), and requires separate installation to use it as a simulation backend.

## 🚀 Quick start

Once you have installed Phylogenie, check out the [examples](https://github.com/gabriele-marino/phylogenie/tree/main/examples) folder.  

For quick start, pick your favorite config file and run Phylogenie with:
```bash
phylogenie examples/config_file.yaml
```
This command will create the output dataset in the folder specified inside the configuration file, including data directories and metadata files for each dataset split defined in the config.

## 📖 Examples and documentation

The [documentation website](https://gabriele-marino.github.io/phylogenie/) provides a comprehensive reference, including detailed explanations of configuration options, models, and usage examples. It also covers the full Python API, along with step-by-step tutorials on how to develop custom plugins and extend the framework with new functionality.

## 📄 License

This project is licensed under [MIT License](https://raw.githubusercontent.com/gabriele-marino/phylogenie/main/LICENSE.txt). 

## 📫 Contact

For questions, bug reports, or feature requests, please, consider opening an [issue on GitHub](https://github.com/gabriele-marino/phylogenie/issues), or [contact me directly](mailto:gabmarino.8601@email.com).

For help with configuration files, don’t hesitate to reach out — I’m happy to assist!
