A comprehensive Python library for network construction, manipulation, simulation, and inference in phylogenetic analysis. Built with performance and usability in mind.
A comprehensive suite of specialized modules for phylogenetic network analysis
Core phylogenetic network data structures including Node, Edge, Graph, and Network classes.
Parse Nexus files and Newick strings to import existing phylogenetic networks.
Birth-death process network simulators including Yule and CBDP models.
Graph and network utility functions for topology analysis and manipulation.
Network topology modification operations including NNI moves and hybrid nodes.
Time-reversible substitution models: GTR, K80, F81, JC, HKY, K81, SYM, TN93.
Multiple Sequence Alignment parsing, storage, and analysis utilities.
Gene tree container and analysis utilities including consensus tree construction.
Plug and play modular model building
Top level interface for defining Traversal and Algorithmic Structures on a model
Top level interface for defining and executing inference strategies
Top level interface for providing opimized execution of inference strategies
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 |
PhyNetPy demonstrates superior performance for phylogenetic network operations
Comparing PhyNetPy's InferMpAllop-2.0 against PhyloNet across different network sizes
CPU and GPU-accelerated versions compared to PhyloNet's implementation
Average distance to ground truth network — lower values indicate better accuracy (tested on 50 simulated networks)
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.
Full API documentation with examples and tutorials for every module
Cython-optimized implementation with GPU acceleration for large vectorized operations
Designed for phylogenetic research with support for standard formats and methods
Seamless integration with NumPy, SciPy, and other scientific libraries
Install PhyNetPy and start analyzing phylogenetic networks today
pip install phynetpy