Skip to content

Commit c3e70c7

Browse files
CopilotAdamtaranto
andcommitted
Add comprehensive documentation for PN and TSW algorithms
Co-authored-by: Adamtaranto <2160099+Adamtaranto@users.noreply.github.com>
1 parent 8cceee7 commit c3e70c7

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Features
99

10-
- **Multiple Network Algorithms**: MST, MSN, TCS (Statistical Parsimony), and Median-Joining
10+
- **Multiple Network Algorithms**: MST, MSN, TCS (Statistical Parsimony), Median-Joining (MJN), Parsimony Network (PN), and Tight Span Walker (TSW)
1111
- **Distance Metrics**: Hamming, Jukes-Cantor, Kimura 2-parameter, Tamura-Nei
1212
- **Comprehensive Analysis**: Network statistics, topology analysis, population genetics measures
1313
- **Rich Visualization**: Static (matplotlib) and interactive (Plotly) network plots
@@ -188,6 +188,40 @@ pypopart network sequences.fasta -a mjn -e 0 -o network.graphml
188188

189189
**Use when**: You want to infer ancestral haplotypes and show complex evolutionary relationships. The epsilon parameter controls network complexity (0 = maximum simplification).
190190

191+
### Parsimony Network (PN)
192+
193+
Creates a consensus network by sampling edges from multiple random parsimony trees.
194+
195+
```bash
196+
pypopart network sequences.fasta -a pn -o network.graphml
197+
```
198+
199+
**Use when**: You want a consensus approach that captures phylogenetic uncertainty across multiple tree topologies. This method samples 100 random parsimony trees by default and includes edges that appear frequently.
200+
201+
**Features**:
202+
- Captures phylogenetic uncertainty through tree sampling
203+
- Can represent reticulation events where multiple edges have similar frequencies
204+
- Automatically infers median vertices for multi-mutation edges
205+
- Handles sequences with gaps by treating length differences as mutations
206+
207+
### Tight Span Walker (TSW)
208+
209+
Computes the tight span of a distance matrix, creating a network that exactly represents metric properties.
210+
211+
```bash
212+
pypopart network sequences.fasta -a tsw -d hamming -o network.graphml
213+
```
214+
215+
**Use when**: You want an exact geometric representation of the distance relationships. This is the most computationally intensive method and works best for smaller datasets (< 100 sequences).
216+
217+
**Features**:
218+
- Computes dT (tree metric) distances for all sequence pairs
219+
- Creates reticulate networks preserving exact distance relationships
220+
- Suitable for detecting complex evolutionary patterns including recombination
221+
- Best for small to medium datasets due to O(n³) complexity
222+
223+
**Note**: The current implementation uses a simplified geodesic computation for practical performance. The full tight span algorithm with complete bipartite coloring is extremely complex and is deferred for future optimization.
224+
191225
## Distance Metrics
192226

193227
- **hamming**: Simple count of differences (fastest)
@@ -382,6 +416,20 @@ Taranto, A. (2024). PyPopART: Pure Python implementation of haplotype network an
382416
GitHub repository: https://github.com/adamtaranto/pypopart
383417
```
384418

419+
### Algorithm References
420+
421+
PyPopART implements algorithms from the following publications:
422+
423+
- **Minimum Spanning Tree/Network**: Excoffier, L. & Smouse, P. E. (1994). Using allele frequencies and geographic subdivision to reconstruct gene trees within a species: molecular variance parsimony. *Genetics*, 136(1), 343-359.
424+
425+
- **TCS (Statistical Parsimony)**: Clement, M., Posada, D., & Crandall, K. A. (2000). TCS: a computer program to estimate gene genealogies. *Molecular Ecology*, 9(10), 1657-1659.
426+
427+
- **Median-Joining Network**: Bandelt, H. J., Forster, P., & Röhl, A. (1999). Median-joining networks for inferring intraspecific phylogenies. *Molecular Biology and Evolution*, 16(1), 37-48.
428+
429+
- **Parsimony Network**: Excoffier, L. & Smouse, P. E. (1994). Using allele frequencies and geographic subdivision to reconstruct gene trees within a species: molecular variance parsimony. *Genetics*, 136(1), 343-359.
430+
431+
- **Tight Span Walker**: Dress, A. W., Huber, K. T., Koolen, J., Moulton, V., & Spillner, A. (2012). *Basic Phylogenetic Combinatorics*. Cambridge University Press.
432+
385433
## License
386434

387435
PyPopART is licensed under the GNU General Public License v3.0 or later. See [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)