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.3.tar.gz (23.0 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.3-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phypanda-1.0.3.tar.gz
  • Upload date:
  • Size: 23.0 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.3.tar.gz
Algorithm Hash digest
SHA256 e6c9485223ffe001e96357b1d227fb39d2fc64b3dac9c28901ea39b18ebd65b1
MD5 8a61e996e37a1f3bfeaaf2f52f9f8f7c
BLAKE2b-256 a0b9e04467c8bfec61bee8f1fe58c44473a8402243beef710e6e220b85baa63d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phypanda-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1011d0b23cace462ce82867a00df7b855c11ead3bc4c38f0a8134911815ca85
MD5 cc8bb0f50d902bf0ace8d38e35450d29
BLAKE2b-256 431afc34260b6434f1e6eb88d5255d251f92ec3e2ad3607bc8915d130492ae21

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