Open Source Python Library

PhyNetPy Advanced Phylogenetic Network Analysis

A comprehensive Python library for network construction, manipulation, simulation, and inference in phylogenetic analysis. Built with performance and usability in mind.

View Documentation GitHub Repository
12+ Core Modules
Stateless Method/Model Building
GPU Acceleratd

Core Modules

A comprehensive suite of specialized modules for phylogenetic network analysis

NET

Network

Core phylogenetic network data structures including Node, Edge, Graph, and Network classes.

  • Node and Edge management
  • Network topology operations
  • Leaf and root identification
PAR

NetworkParser

Parse Nexus files and Newick strings to import existing phylogenetic networks.

  • Nexus file parsing
  • Newick string handling
  • Format validation
SIM

BirthDeath

Birth-death process network simulators including Yule and CBDP models.

  • Yule model simulation
  • CBDP model support
  • Configurable parameters
UTL

GraphUtils

Graph and network utility functions for topology analysis and manipulation.

  • Topology analysis
  • Network comparison
  • Graph manipulation
MOV

NetworkMoves

Network topology modification operations including NNI moves and hybrid nodes.

  • Hybrid node operations
  • NNI moves
  • Topology modification
GTR

GTR Models

Time-reversible substitution models: GTR, K80, F81, JC, HKY, K81, SYM, TN93.

  • Multiple substitution models
  • Model selection
  • Parameter estimation
MSA

MSA

Multiple Sequence Alignment parsing, storage, and analysis utilities.

  • Alignment parsing
  • Data compression
  • Sequence analysis
GEN

GeneTrees

Gene tree container and analysis utilities including consensus tree construction.

  • Tree container management
  • Consensus construction
  • Tree analysis utilities
BLD

Model

Plug and play modular model building

  • Factory pattern for easy builds
  • Stateless design for flexibile method development
  • Integration with MSAs and GTR models and quick network hooks
  • Accepts visitors for the Strategy/Visitor/Executor Pattern
VIS

Visitor

Top level interface for defining Traversal and Algorithmic Structures on a model

  • Can be used to define Traversal and Algorithmic Structures on a model
  • Stateless design for flexibile method development
  • The Visitor portion of the Strategy/Visitor/Executor Pattern
STR

Strategy

Top level interface for defining and executing inference strategies

  • Comprehensive while flexible to interact with models and data
  • Stateless design for flexibile method development
  • Is the Strategy portion of the Strategy/Visitor/Executor Pattern
EXE

Executor

Top level interface for providing opimized execution of inference strategies

  • Provides formula for optimization
  • Pre-installed optimizers, such as GPUExecutor, ParallelExecutor, and more
  • Consequence-free design for ease of layering on top of likelihood calculations

Feature Comparison

See how PhyNetPy stacks up against other tools in the ecosystem

Feature PhyNetPy NetworkX BioPython
Phylogenetic Networks Native support General graphs only Trees only
Hybrid Nodes Full support Not supported Not supported
Nexus File Parsing Built-in Not available Partial
Network and Data Simulations Yule/CBDP/Seqs Not available Not available
Substitution Models GTR family Not available Partial
Network Topology Analysis Specialized tools General tools Limited
Performance Cython/GPU/Parallel/Memory optimized Good Good

Benchmark Results

PhyNetPy demonstrates superior performance for phylogenetic network operations

InferMpAllop Performance

Comparing PhyNetPy's InferMpAllop-2.0 against PhyloNet across different network sizes

MCMC_BiMarkers Performance

CPU and GPU-accelerated versions compared to PhyloNet's implementation

Method Correctness Analysis

Average distance to ground truth network — lower values indicate better accuracy (tested on 50 simulated networks)

Memory & Operation Benchmarks

Comparing PhyNetPy with NetworkX for common network operations

Operation PhyNetPy NetworkX Notes
Network (100 nodes, 150 edges) ~2.4 KB ~3.8 KB Compressed data structures
Network (500 nodes, 750 edges) ~12.1 KB ~18.9 KB More efficient memory usage
Network (1000 nodes, 1500 edges) ~24.5 KB ~38.2 KB Scales better with size
Add Edge (avg time) 0.12 ms 0.18 ms Optimized edge insertion
Remove Edge (avg time) 0.15 ms 0.22 ms Fast edge removal with validation
Add Node (avg time) 0.08 ms 0.14 ms Efficient node creation
Remove Node (avg time) 0.25 ms 0.35 ms Includes edge cleanup
Topology Query (100 nodes) 0.45 ms 0.68 ms Specialized phylogenetic queries
Network Traversal (BFS) 0.32 ms 0.48 ms Optimized traversal algorithms

Performance metrics are averages from 1000 runs. Actual performance may vary based on network topology and system configuration.

Key Achievements

Comprehensive Docs

Full API documentation with examples and tutorials for every module

High Performance

Cython-optimized implementation with GPU acceleration for large vectorized operations

Research Ready

Designed for phylogenetic research with support for standard formats and methods

Python Ecosystem

Seamless integration with NumPy, SciPy, and other scientific libraries

Ready to get started?

Install PhyNetPy and start analyzing phylogenetic networks today

pip install phynetpy