Normal (CN=2) Called deletion Called duplication Segment boundary

Copy Number Variant Read-Depth Detector (2D)

This 2D canvas engine generates a synthetic whole-genome sequencing read-depth trace across a chromosome, sampling read counts per bin from a real Poisson process around a diploid baseline with a few hidden deletion and duplication segments buried in the noise. Instead of a flat threshold, it locates CNV boundaries with a real recursive binary-segmentation change-point algorithm (a CUSUM-statistic search, the same family of method behind circular binary segmentation used by real CNV callers), then classifies each resulting segment as normal, deletion or duplication and scores every call live — precision and recall — against the hidden ground truth it generated. Adjust sequencing depth and CNV event count to change the underlying sample, then tune the smoothing window, segmentation sensitivity and call threshold to see how those choices trade sensitivity for precision, the same trade-off real bioinformatics pipelines (CBS, HMM-based CNV callers) navigate turning raw coverage into a clinically actionable copy-number call.