Skip to main content

package containing the PaNDA framework for exploring, visualizing and maximizing phylogenetic diversity in phylogenetic networks

Project description

phypanda

phypanda is a Python package that contains PaNDA (Phylogenetic Network Diversity Algorithms): a software framework for exploring, visualizing and maximizing phylogenetic diversity in phylogenetic networks.

List of important features

  • Maximizing all-paths diversity in a rooted phylogenetic network
  • Computing the all-paths diversity for a given set of taxa in a rooted phylogenetic network
  • Greedily select a set of taxa with large all-paths diversity

Installation

If you have an up-to-date version of Python installed on your device, the standard package manager pip should come pre-installed. Then, you can install phypanda from PyPI by simply using the following command in a terminal:

python -m pip install phypanda

Example usage

Importing the package

To get started with phypanda, open a Python shell and import the package with:

import phypanda as ppa

Maximizing all-paths diversity

To maximize the all-paths diversity of a rooted network (given in eNewick format) for a set of k taxa, use the function solve_MAPPD. For example, when finding a set of 10 taxa with maximum all-paths diversity in the Xiphophorus network from the PaNDA paper, run:

enewick = '((((((((((Xgordoni:1.3295084631587457,Xmeyeri:1.3295084631587457):0.0,Xcouchianus:1.329508093234352):6.999730834529853,Xvariatus:8.329238927764205):2.1769451514229345,Xevelynae:10.50618407918714):1.118605313770228,(Xxiphidium:7.2210504457107145,#H24:0.0):4.403738947246653):0.0,Xmilleri:11.624787067955268):4.296868586395352,Xandersi:15.92165565435062):0.9486610416497712,Xmaculatus:16.87031669600039):0.5723386247384958,((((Xmontezumae:7.221055986870681,(Xcortezi:5.485599585171238,((Xmalinche:5.485605240002155,Xbirchmanni:5.485605240002155):0.0)#H26:0.0):1.7354564016994427):0.0,((Xnigrensis:2.4303498026154564,Xmultilineatus:2.4303498026154564):0.19174715477323678,(Xpygmaeus:1.347820846400494,Xcontinens:1.347820846400494):1.2742761109881993):4.598960284156991):0.0,#H26:1.7354540549075645):0.0)#H24:10.2216024589192):2.1886232296055894,((Xclemenciae:11.254572014210282,Xmonticolus:11.254572014210282):6.4012991117391564,(#H25:1.6332001759073602,(Xsignum:10.266850863153604,((Xhellerii:8.633649976742058)#H25:1.6332013685506936,(Xalvarezi:8.362082334652573,Xmayae:8.362082334652573):1.9047690106401785):0.0):0.0):7.3890209733000205):1.975407424395037);'
k = 10
pd, taxa = ppa.solve_MAPPD(enewick, k)

Note, edges without branch lengths default 1.0 and not to 0.0. To use zero-length edges, explicitly set these edges to 0.0 in the eNewick string.

To print the resulting maximum all-paths diversity and the selected taxa, run:

print(f"Maximum all-paths diversity for k = {k} is {pd}")
print("Selected taxa:", taxa)

For a complete overview of different methods and extra parameter options, please check the method descriptions in the source code of phypanda.

Citation

If you use phypanda, please cite the corresponding paper:

PaNDA: Efficient Optimization of Phylogenetic Diversity in Networks. Niels Holtgrefe, Leo van Iersel, Ruben Meuwese, Yukihiro Murakami, Jannik Schestag. bioRxiv, 2025. doi: 10.1101/2025.11.14.688467

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phypanda-1.0.2.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phypanda-1.0.2-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file phypanda-1.0.2.tar.gz.

File metadata

  • Download URL: phypanda-1.0.2.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for phypanda-1.0.2.tar.gz
Algorithm Hash digest
SHA256 98f89033e800413babb7402166ed85be2830a4f8cebe4f00232e2d91ada60b3f
MD5 653b76c0580bfa943216652fdb5aba6c
BLAKE2b-256 093cd2edddecb8e1114154f816300edb8109f94e8f841ddd7692e1e0114ad670

See more details on using hashes here.

File details

Details for the file phypanda-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: phypanda-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for phypanda-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb0113cb682d8aab9a2363a4e1558385a3512978e25a3da3a2b6fa2f9f424fd3
MD5 fdd672e282b621fd5f7889c3451af8d8
BLAKE2b-256 9a2893dabf8cf7aaa168f83e706f0dafbdb957e322c4c1a7c77f9236f100b6d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page