Copy-number variable (CNV) genes are important in evolution and disease, yet sequence variation in CNV genes remains a blindspot in large-scale studies. We present ctyper, a method that leverages pangenomes to produce allele-specific copy numbers with locally phased variants from NGS reads. Benchmarking on 3,351 CNV genes including