polyploid-haplotype-assembly-eval
pHapCompass: Probabilistic Assembly and Uncertainty Quantification of Polyploid Haplotype Phase — Hosseini et al. (2025) (arXiv:2512.04393, 2025)
What this evaluates
Evaluates the accuracy and continuity of polyploid haplotype assembly methods by measuring switch errors and read-haplotype conflicts, while also quantifying phasing uncertainty across varying ploidies, coverages, and genomic structures.
Datasets
Metrics
Generalized Vector Error Rate (VER) (primary) — range: [0, 1]
- VER(H, H*) = VE(H, H*) / L, where VE is the minimum number of haplotype-matching switches over L SNPs across all valid bijections between predicted and true haplotypes. Includes penalties for genotype mismatches and additional phased blocks.
Block-adjusted Minimum Error Correction (MEC) — range: [0, 1]
- MEC(R, H*) = (1/|R|) * sum_r min_k d(r, h_k*[r]) + penalties for reads spanning multiple blocks. Measures the proportion of alleles flipped to perfectly match reconstructed haplotypes, adjusted for fragmented assemblies.
Input / output format
Input: Aligned sequencing reads (BAM/VCF or Hap10 fragment files) with base qualities, covering heterozygous SNPs in diploid or polyploid genomes.
Output: Reconstructed haplotype sequences represented as phased allele blocks, and optionally a distribution of phasings via forward-filtering backward-sampling (FFBS) for uncertainty quantification.
Scoring recipe
def compute_ver(true_haps, pred_haps, L):
ve = min_over_bijections(sum(phi[l](k) != phi[l-1](k) for l in range(2, L+1)))
return ve / L
def compute_mec(reads, pred_haps, K):
total_flips = 0.0
total_alleles = 0
for r in reads:
total_alleles += len(r)
min_dist = min(hamming(r, pred_haps[k][r.snps]) for k in range(1, K+1))
total_flips += min_dist
if r.num_blocks > 1:
total_flips += (r.num_blocks - 1) * (1 - 1/K)
return total_flips / total_alleles
Common pitfalls
- Standard MEC and VER assume contiguous, fully phased diploid genomes; polyploid assemblers output fragmented blocks and may phase fewer than K haplotypes, requiring the paper's block-adjusted and genotype-penalized extensions.
- Computing VER requires solving a K! permutation matching problem at each SNP, which is often approximated or ignored in standard tools, leading to underestimation of switch errors.
- Uncertainty quantification via FFBS sampling plateaus at larger SNP distances because Hamming distance is undefined for unassembled SNPs, not due to model failure.
Evidence (verbatim from paper)
To facilitate a fair comparison across both deterministic and probabilistic assemblers, we extend the commonly used evaluation metrics of minimum error correction (MEC) and vector error rate (VER) to accommodate the complexity associated with partially phased haplotype blocks and assembly uncertainty.
Citation
@misc{hosseini2025phapcompass,
title={pHapCompass: Probabilistic Assembly and Uncertainty Quantification of Polyploid Haplotype Phase},
author={Hosseini et al. (2025)},
year={2025},
note={arXiv:2512.04393}
}
1---2name: polyploid-haplotype-assembly-eval3description: Evaluates the accuracy and continuity of polyploid haplotype assembly methods by measuring switch errors and read-haplotype conflicts, while also quantifying phasing uncertainty across varying ploidies, coverages, and genomic structures. Use when the user wants to benchmark on Synthetic Polyploid Genomes (S. tuberosum), Experimental Octoploid Strawberry (F. x ananassa), or asks about evaluating this task. Reports Generalized Vector Error Rate (VER).4---56# polyploid-haplotype-assembly-eval78> pHapCompass: Probabilistic Assembly and Uncertainty Quantification of Polyploid Haplotype Phase — Hosseini et al. (2025) (arXiv:2512.04393, 2025)910## What this evaluates1112Evaluates the accuracy and continuity of polyploid haplotype assembly methods by measuring switch errors and read-haplotype conflicts, while also quantifying phasing uncertainty across varying ploidies, coverages, and genomic structures.1314## Datasets1516- **Synthetic Polyploid Genomes (S. tuberosum)** — total 3120; splits: test (-1); repo https://github.com/bayesomicslab/pHapCompass17- **Experimental Octoploid Strawberry (F. x ananassa)** — total ?; splits: test (-1); repo https://github.com/bayesomicslab/pHapCompass1819## Metrics2021- `Generalized Vector Error Rate (VER)` **(primary)** — range: [0, 1]22 - VER(H, H*) = VE(H, H*) / L, where VE is the minimum number of haplotype-matching switches over L SNPs across all valid bijections between predicted and true haplotypes. Includes penalties for genotype mismatches and additional phased blocks.23- `Block-adjusted Minimum Error Correction (MEC)` — range: [0, 1]24 - MEC(R, H*) = (1/|R|) * sum_r min_k d(r, h_k*[r]) + penalties for reads spanning multiple blocks. Measures the proportion of alleles flipped to perfectly match reconstructed haplotypes, adjusted for fragmented assemblies.2526## Input / output format2728**Input**: Aligned sequencing reads (BAM/VCF or Hap10 fragment files) with base qualities, covering heterozygous SNPs in diploid or polyploid genomes.2930**Output**: Reconstructed haplotype sequences represented as phased allele blocks, and optionally a distribution of phasings via forward-filtering backward-sampling (FFBS) for uncertainty quantification.3132## Scoring recipe3334```python35def compute_ver(true_haps, pred_haps, L):36 ve = min_over_bijections(sum(phi[l](k) != phi[l-1](k) for l in range(2, L+1)))37 return ve / L3839def compute_mec(reads, pred_haps, K):40 total_flips = 0.041 total_alleles = 042 for r in reads:43 total_alleles += len(r)44 min_dist = min(hamming(r, pred_haps[k][r.snps]) for k in range(1, K+1))45 total_flips += min_dist46 if r.num_blocks > 1:47 total_flips += (r.num_blocks - 1) * (1 - 1/K)48 return total_flips / total_alleles49```5051## Common pitfalls5253- Standard MEC and VER assume contiguous, fully phased diploid genomes; polyploid assemblers output fragmented blocks and may phase fewer than K haplotypes, requiring the paper's block-adjusted and genotype-penalized extensions.54- Computing VER requires solving a K! permutation matching problem at each SNP, which is often approximated or ignored in standard tools, leading to underestimation of switch errors.55- Uncertainty quantification via FFBS sampling plateaus at larger SNP distances because Hamming distance is undefined for unassembled SNPs, not due to model failure.5657## Evidence (verbatim from paper)5859> To facilitate a fair comparison across both deterministic and probabilistic assemblers, we extend the commonly used evaluation metrics of minimum error correction (MEC) and vector error rate (VER) to accommodate the complexity associated with partially phased haplotype blocks and assembly uncertainty.6061## Citation6263```bibtex64@misc{hosseini2025phapcompass,65 title={pHapCompass: Probabilistic Assembly and Uncertainty Quantification of Polyploid Haplotype Phase},66 author={Hosseini et al. (2025)},67 year={2025},68 note={arXiv:2512.04393}69}70```7172- arXiv: 2512.04393