Metadata-Version: 2.4
Name: phypanda
Version: 2.1.0
Summary: a package for computing and maximizing phylogenetic diversity in phylogenetic networks
Author-email: Niels Holtgrefe <n.a.l.holtgrefe@tudelft.nl>
License: MIT License
        
        Copyright (c) 2025-2026 Niels Holtgrefe
        
        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.
        
Project-URL: Repository, https://github.com/nholtgrefe/panda
Keywords: phylogenetics,phylogenetic network,phylogenetic diversity
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: phylozoo>=0.1.2
Requires-Dist: networkx>=3.0
Requires-Dist: scanwidth>=0.2.5
Requires-Dist: numba>=0.56
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.0.0; extra == "docs"
Requires-Dist: pydata-sphinx-theme>=0.15.0; extra == "docs"
Dynamic: license-file

[![PyPI](https://img.shields.io/pypi/v/phypanda)](https://pypi.org/project/phypanda/)
[![License](https://img.shields.io/github/license/nholtgrefe/panda)](https://github.com/nholtgrefe/panda/blob/main/LICENSE)
[![Docs](https://img.shields.io/badge/docs-stable-blue)](https://nholtgrefe.github.io/panda/)

# phypanda

<img src="docs/source/_static/phypanda_full.svg" alt="phypanda logo" width="200" align="right">

phypanda is the Python library for **PaNDA**—an algorithm library for phylogenetic diversity (PD)
optimization on directed phylogenetic networks. It builds on
[phylozoo](https://github.com/nholtgrefe/phylozoo) for network representations and
[scanwidth](https://github.com/nholtgrefe/scanwidth) for node- and edge-scanwidth–based
dynamic programming.

<br>

## Key Features

- **All-paths (MAPPD), Max-tree and Min-tree PD**: compute the diversity score of a fixed taxon set for several PD measures, or maximize PD using exact FPT algorithms parameterized by node scanwidth or edge scanwidth.
- **Budgeted maximization**: assign integer costs to taxa and maximize PD under budget constraints.
- **JIT-compilation**: speed up algorithms by optional `numba` JIT compilation.
- **High-level API** — `compute_diversity`, `marginal_diversities`, `greedy_max_diversity`, and `solve_max_diversity` work with any measure and dispatch to the appropriate solver.

## Installation

```bash
pip install phypanda
```

Runtime dependencies (`phylozoo`, `networkx`, `scanwidth`, `numba`) are installed automatically. For development or documentation extras:

```bash
pip install phypanda[dev]   # testing
pip install phypanda[docs]  # Sphinx documentation
```

## Documentation

For the full manual, API reference, and installation guide, visit the **[phypanda docs](https://nholtgrefe.github.io/panda/)**.

## Citation

If you use phypanda, please cite:

> Niels Holtgrefe, Leo van Iersel, Ruben Meuwese, Yukihiro Murakami, and Jannik Schestag.
> **PaNDA: Efficient Optimization of Phylogenetic Diversity in Networks.**
> *bioRxiv*, 2025. doi: [10.1101/2025.11.14.688467](https://doi.org/10.1101/2025.11.14.688467)

If your work builds specifically on the budgeted node-scanwidth algorithms, please also cite:

> Niels Holtgrefe and Jannik Schestag.
> **Tractable Optimization of Budgeted Phylogenetic Diversity on Networks Utilizing Node-Scanwidth.**
> 2026.


## See also

For the graphical-user interface developed for the first paper, please go to [`gui/`](https://github.com/nholtgrefe/panda/tree/main/gui). 

For the experimental materials corresponding to the above two papers, please go to [`experiments/`](https://github.com/nholtgrefe/panda/tree/main/experiments).
